001package org.hl7.fhir.r5.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r5
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Thu, Dec 13, 2018 14:07+1100 for FHIR v4.0.0
053import java.util.ArrayList;
054import java.util.Date;
055import java.util.List;
056import org.hl7.fhir.exceptions.FHIRException;
057import org.hl7.fhir.instance.model.api.ICompositeType;
058
059import org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
060import org.hl7.fhir.utilities.Utilities;
061import ca.uhn.fhir.model.api.annotation.ResourceDef;
062import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
063import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
064import ca.uhn.fhir.model.api.annotation.Child;
065import ca.uhn.fhir.model.api.annotation.ChildOrder;
066import ca.uhn.fhir.model.api.annotation.Description;
067import ca.uhn.fhir.model.api.annotation.Block;
068/**
069 * Catalog entries are wrappers that contextualize items included in a catalog.
070 */
071@ResourceDef(name="CatalogEntry", profile="http://hl7.org/fhir/StructureDefinition/CatalogEntry")
072public class CatalogEntry extends DomainResource {
073
074    public enum CatalogEntryType {
075        /**
076         * null
077         */
078        ACTIVITYDEFINITION, 
079        /**
080         * null
081         */
082        PLANDEFINITION, 
083        /**
084         * null
085         */
086        SPECIMENDEFINITION, 
087        /**
088         * null
089         */
090        OBSERVATIONDEFINITION, 
091        /**
092         * null
093         */
094        DEVICEDEFINITION, 
095        /**
096         * null
097         */
098        ORGANIZATION, 
099        /**
100         * null
101         */
102        PRACTITIONER, 
103        /**
104         * null
105         */
106        PRACTITIONERROLE, 
107        /**
108         * null
109         */
110        HEALTHCARESERVICE, 
111        /**
112         * null
113         */
114        MEDICATIONKNOWLEDGE, 
115        /**
116         * null
117         */
118        MEDICATION, 
119        /**
120         * null
121         */
122        SUBSTANCE, 
123        /**
124         * null
125         */
126        LOCATION, 
127        /**
128         * added to help the parsers with the generic types
129         */
130        NULL;
131        public static CatalogEntryType fromCode(String codeString) throws FHIRException {
132            if (codeString == null || "".equals(codeString))
133                return null;
134        if ("ActivityDefinition".equals(codeString))
135          return ACTIVITYDEFINITION;
136        if ("PlanDefinition".equals(codeString))
137          return PLANDEFINITION;
138        if ("SpecimenDefinition".equals(codeString))
139          return SPECIMENDEFINITION;
140        if ("ObservationDefinition".equals(codeString))
141          return OBSERVATIONDEFINITION;
142        if ("DeviceDefinition".equals(codeString))
143          return DEVICEDEFINITION;
144        if ("Organization".equals(codeString))
145          return ORGANIZATION;
146        if ("Practitioner".equals(codeString))
147          return PRACTITIONER;
148        if ("PractitionerRole".equals(codeString))
149          return PRACTITIONERROLE;
150        if ("HealthcareService".equals(codeString))
151          return HEALTHCARESERVICE;
152        if ("MedicationKnowledge".equals(codeString))
153          return MEDICATIONKNOWLEDGE;
154        if ("Medication".equals(codeString))
155          return MEDICATION;
156        if ("Substance".equals(codeString))
157          return SUBSTANCE;
158        if ("Location".equals(codeString))
159          return LOCATION;
160        if (Configuration.isAcceptInvalidEnums())
161          return null;
162        else
163          throw new FHIRException("Unknown CatalogEntryType code '"+codeString+"'");
164        }
165        public String toCode() {
166          switch (this) {
167            case ACTIVITYDEFINITION: return "ActivityDefinition";
168            case PLANDEFINITION: return "PlanDefinition";
169            case SPECIMENDEFINITION: return "SpecimenDefinition";
170            case OBSERVATIONDEFINITION: return "ObservationDefinition";
171            case DEVICEDEFINITION: return "DeviceDefinition";
172            case ORGANIZATION: return "Organization";
173            case PRACTITIONER: return "Practitioner";
174            case PRACTITIONERROLE: return "PractitionerRole";
175            case HEALTHCARESERVICE: return "HealthcareService";
176            case MEDICATIONKNOWLEDGE: return "MedicationKnowledge";
177            case MEDICATION: return "Medication";
178            case SUBSTANCE: return "Substance";
179            case LOCATION: return "Location";
180            default: return "?";
181          }
182        }
183        public String getSystem() {
184          switch (this) {
185            case ACTIVITYDEFINITION: return "http://hl7.org/fhir/catalogentry-type";
186            case PLANDEFINITION: return "http://hl7.org/fhir/catalogentry-type";
187            case SPECIMENDEFINITION: return "http://hl7.org/fhir/catalogentry-type";
188            case OBSERVATIONDEFINITION: return "http://hl7.org/fhir/catalogentry-type";
189            case DEVICEDEFINITION: return "http://hl7.org/fhir/catalogentry-type";
190            case ORGANIZATION: return "http://hl7.org/fhir/catalogentry-type";
191            case PRACTITIONER: return "http://hl7.org/fhir/catalogentry-type";
192            case PRACTITIONERROLE: return "http://hl7.org/fhir/catalogentry-type";
193            case HEALTHCARESERVICE: return "http://hl7.org/fhir/catalogentry-type";
194            case MEDICATIONKNOWLEDGE: return "http://hl7.org/fhir/catalogentry-type";
195            case MEDICATION: return "http://hl7.org/fhir/catalogentry-type";
196            case SUBSTANCE: return "http://hl7.org/fhir/catalogentry-type";
197            case LOCATION: return "http://hl7.org/fhir/catalogentry-type";
198            default: return "?";
199          }
200        }
201        public String getDefinition() {
202          switch (this) {
203            case ACTIVITYDEFINITION: return "";
204            case PLANDEFINITION: return "";
205            case SPECIMENDEFINITION: return "";
206            case OBSERVATIONDEFINITION: return "";
207            case DEVICEDEFINITION: return "";
208            case ORGANIZATION: return "";
209            case PRACTITIONER: return "";
210            case PRACTITIONERROLE: return "";
211            case HEALTHCARESERVICE: return "";
212            case MEDICATIONKNOWLEDGE: return "";
213            case MEDICATION: return "";
214            case SUBSTANCE: return "";
215            case LOCATION: return "";
216            default: return "?";
217          }
218        }
219        public String getDisplay() {
220          switch (this) {
221            case ACTIVITYDEFINITION: return "ActivityDefinition";
222            case PLANDEFINITION: return "PlanDefinition";
223            case SPECIMENDEFINITION: return "SpecimenDefinition";
224            case OBSERVATIONDEFINITION: return "ObservationDefinition";
225            case DEVICEDEFINITION: return "DeviceDefinition";
226            case ORGANIZATION: return "Organization";
227            case PRACTITIONER: return "Practitioner";
228            case PRACTITIONERROLE: return "PractitionerRole";
229            case HEALTHCARESERVICE: return "HealthcareService";
230            case MEDICATIONKNOWLEDGE: return "MedicationKnowledge";
231            case MEDICATION: return "Medication";
232            case SUBSTANCE: return "Substance";
233            case LOCATION: return "Location";
234            default: return "?";
235          }
236        }
237    }
238
239  public static class CatalogEntryTypeEnumFactory implements EnumFactory<CatalogEntryType> {
240    public CatalogEntryType fromCode(String codeString) throws IllegalArgumentException {
241      if (codeString == null || "".equals(codeString))
242            if (codeString == null || "".equals(codeString))
243                return null;
244        if ("ActivityDefinition".equals(codeString))
245          return CatalogEntryType.ACTIVITYDEFINITION;
246        if ("PlanDefinition".equals(codeString))
247          return CatalogEntryType.PLANDEFINITION;
248        if ("SpecimenDefinition".equals(codeString))
249          return CatalogEntryType.SPECIMENDEFINITION;
250        if ("ObservationDefinition".equals(codeString))
251          return CatalogEntryType.OBSERVATIONDEFINITION;
252        if ("DeviceDefinition".equals(codeString))
253          return CatalogEntryType.DEVICEDEFINITION;
254        if ("Organization".equals(codeString))
255          return CatalogEntryType.ORGANIZATION;
256        if ("Practitioner".equals(codeString))
257          return CatalogEntryType.PRACTITIONER;
258        if ("PractitionerRole".equals(codeString))
259          return CatalogEntryType.PRACTITIONERROLE;
260        if ("HealthcareService".equals(codeString))
261          return CatalogEntryType.HEALTHCARESERVICE;
262        if ("MedicationKnowledge".equals(codeString))
263          return CatalogEntryType.MEDICATIONKNOWLEDGE;
264        if ("Medication".equals(codeString))
265          return CatalogEntryType.MEDICATION;
266        if ("Substance".equals(codeString))
267          return CatalogEntryType.SUBSTANCE;
268        if ("Location".equals(codeString))
269          return CatalogEntryType.LOCATION;
270        throw new IllegalArgumentException("Unknown CatalogEntryType code '"+codeString+"'");
271        }
272        public Enumeration<CatalogEntryType> fromType(Base code) throws FHIRException {
273          if (code == null)
274            return null;
275          if (code.isEmpty())
276            return new Enumeration<CatalogEntryType>(this);
277          String codeString = ((PrimitiveType) code).asStringValue();
278          if (codeString == null || "".equals(codeString))
279            return null;
280        if ("ActivityDefinition".equals(codeString))
281          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.ACTIVITYDEFINITION);
282        if ("PlanDefinition".equals(codeString))
283          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.PLANDEFINITION);
284        if ("SpecimenDefinition".equals(codeString))
285          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.SPECIMENDEFINITION);
286        if ("ObservationDefinition".equals(codeString))
287          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.OBSERVATIONDEFINITION);
288        if ("DeviceDefinition".equals(codeString))
289          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.DEVICEDEFINITION);
290        if ("Organization".equals(codeString))
291          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.ORGANIZATION);
292        if ("Practitioner".equals(codeString))
293          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.PRACTITIONER);
294        if ("PractitionerRole".equals(codeString))
295          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.PRACTITIONERROLE);
296        if ("HealthcareService".equals(codeString))
297          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.HEALTHCARESERVICE);
298        if ("MedicationKnowledge".equals(codeString))
299          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.MEDICATIONKNOWLEDGE);
300        if ("Medication".equals(codeString))
301          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.MEDICATION);
302        if ("Substance".equals(codeString))
303          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.SUBSTANCE);
304        if ("Location".equals(codeString))
305          return new Enumeration<CatalogEntryType>(this, CatalogEntryType.LOCATION);
306        throw new FHIRException("Unknown CatalogEntryType code '"+codeString+"'");
307        }
308    public String toCode(CatalogEntryType code) {
309      if (code == CatalogEntryType.ACTIVITYDEFINITION)
310        return "ActivityDefinition";
311      if (code == CatalogEntryType.PLANDEFINITION)
312        return "PlanDefinition";
313      if (code == CatalogEntryType.SPECIMENDEFINITION)
314        return "SpecimenDefinition";
315      if (code == CatalogEntryType.OBSERVATIONDEFINITION)
316        return "ObservationDefinition";
317      if (code == CatalogEntryType.DEVICEDEFINITION)
318        return "DeviceDefinition";
319      if (code == CatalogEntryType.ORGANIZATION)
320        return "Organization";
321      if (code == CatalogEntryType.PRACTITIONER)
322        return "Practitioner";
323      if (code == CatalogEntryType.PRACTITIONERROLE)
324        return "PractitionerRole";
325      if (code == CatalogEntryType.HEALTHCARESERVICE)
326        return "HealthcareService";
327      if (code == CatalogEntryType.MEDICATIONKNOWLEDGE)
328        return "MedicationKnowledge";
329      if (code == CatalogEntryType.MEDICATION)
330        return "Medication";
331      if (code == CatalogEntryType.SUBSTANCE)
332        return "Substance";
333      if (code == CatalogEntryType.LOCATION)
334        return "Location";
335      return "?";
336      }
337    public String toSystem(CatalogEntryType code) {
338      return code.getSystem();
339      }
340    }
341
342    public enum CatalogEntryStatus {
343        /**
344         * null
345         */
346        DRAFT, 
347        /**
348         * null
349         */
350        ACTIVE, 
351        /**
352         * null
353         */
354        RETIRED, 
355        /**
356         * added to help the parsers with the generic types
357         */
358        NULL;
359        public static CatalogEntryStatus fromCode(String codeString) throws FHIRException {
360            if (codeString == null || "".equals(codeString))
361                return null;
362        if ("draft".equals(codeString))
363          return DRAFT;
364        if ("active".equals(codeString))
365          return ACTIVE;
366        if ("retired".equals(codeString))
367          return RETIRED;
368        if (Configuration.isAcceptInvalidEnums())
369          return null;
370        else
371          throw new FHIRException("Unknown CatalogEntryStatus code '"+codeString+"'");
372        }
373        public String toCode() {
374          switch (this) {
375            case DRAFT: return "draft";
376            case ACTIVE: return "active";
377            case RETIRED: return "retired";
378            default: return "?";
379          }
380        }
381        public String getSystem() {
382          switch (this) {
383            case DRAFT: return "http://hl7.org/fhir/catalogentry-status";
384            case ACTIVE: return "http://hl7.org/fhir/catalogentry-status";
385            case RETIRED: return "http://hl7.org/fhir/catalogentry-status";
386            default: return "?";
387          }
388        }
389        public String getDefinition() {
390          switch (this) {
391            case DRAFT: return "";
392            case ACTIVE: return "";
393            case RETIRED: return "";
394            default: return "?";
395          }
396        }
397        public String getDisplay() {
398          switch (this) {
399            case DRAFT: return "Draft";
400            case ACTIVE: return "Active";
401            case RETIRED: return "Retired";
402            default: return "?";
403          }
404        }
405    }
406
407  public static class CatalogEntryStatusEnumFactory implements EnumFactory<CatalogEntryStatus> {
408    public CatalogEntryStatus fromCode(String codeString) throws IllegalArgumentException {
409      if (codeString == null || "".equals(codeString))
410            if (codeString == null || "".equals(codeString))
411                return null;
412        if ("draft".equals(codeString))
413          return CatalogEntryStatus.DRAFT;
414        if ("active".equals(codeString))
415          return CatalogEntryStatus.ACTIVE;
416        if ("retired".equals(codeString))
417          return CatalogEntryStatus.RETIRED;
418        throw new IllegalArgumentException("Unknown CatalogEntryStatus code '"+codeString+"'");
419        }
420        public Enumeration<CatalogEntryStatus> fromType(Base code) throws FHIRException {
421          if (code == null)
422            return null;
423          if (code.isEmpty())
424            return new Enumeration<CatalogEntryStatus>(this);
425          String codeString = ((PrimitiveType) code).asStringValue();
426          if (codeString == null || "".equals(codeString))
427            return null;
428        if ("draft".equals(codeString))
429          return new Enumeration<CatalogEntryStatus>(this, CatalogEntryStatus.DRAFT);
430        if ("active".equals(codeString))
431          return new Enumeration<CatalogEntryStatus>(this, CatalogEntryStatus.ACTIVE);
432        if ("retired".equals(codeString))
433          return new Enumeration<CatalogEntryStatus>(this, CatalogEntryStatus.RETIRED);
434        throw new FHIRException("Unknown CatalogEntryStatus code '"+codeString+"'");
435        }
436    public String toCode(CatalogEntryStatus code) {
437      if (code == CatalogEntryStatus.DRAFT)
438        return "draft";
439      if (code == CatalogEntryStatus.ACTIVE)
440        return "active";
441      if (code == CatalogEntryStatus.RETIRED)
442        return "retired";
443      return "?";
444      }
445    public String toSystem(CatalogEntryStatus code) {
446      return code.getSystem();
447      }
448    }
449
450    public enum CatalogEntryRelationType {
451        /**
452         * Depending on the context, the item of the related catalog entry may be added by the performer.
453         */
454        TRIGGERS, 
455        /**
456         * the related catalog entry supersedes this one when it is not active.
457         */
458        ISREPLACEDBY, 
459        /**
460         * The related catalog entry is excluded by this one.
461         */
462        EXCLUDES, 
463        /**
464         * The item of the related catalog entry  will be part of the orders containing the current item.
465         */
466        INCLUDES, 
467        /**
468         * added to help the parsers with the generic types
469         */
470        NULL;
471        public static CatalogEntryRelationType fromCode(String codeString) throws FHIRException {
472            if (codeString == null || "".equals(codeString))
473                return null;
474        if ("triggers".equals(codeString))
475          return TRIGGERS;
476        if ("is-replaced-by".equals(codeString))
477          return ISREPLACEDBY;
478        if ("excludes".equals(codeString))
479          return EXCLUDES;
480        if ("includes".equals(codeString))
481          return INCLUDES;
482        if (Configuration.isAcceptInvalidEnums())
483          return null;
484        else
485          throw new FHIRException("Unknown CatalogEntryRelationType code '"+codeString+"'");
486        }
487        public String toCode() {
488          switch (this) {
489            case TRIGGERS: return "triggers";
490            case ISREPLACEDBY: return "is-replaced-by";
491            case EXCLUDES: return "excludes";
492            case INCLUDES: return "includes";
493            default: return "?";
494          }
495        }
496        public String getSystem() {
497          switch (this) {
498            case TRIGGERS: return "http://hl7.org/fhir/catalogentry-relation-type";
499            case ISREPLACEDBY: return "http://hl7.org/fhir/catalogentry-relation-type";
500            case EXCLUDES: return "http://hl7.org/fhir/catalogentry-relation-type";
501            case INCLUDES: return "http://hl7.org/fhir/catalogentry-relation-type";
502            default: return "?";
503          }
504        }
505        public String getDefinition() {
506          switch (this) {
507            case TRIGGERS: return "Depending on the context, the item of the related catalog entry may be added by the performer.";
508            case ISREPLACEDBY: return "the related catalog entry supersedes this one when it is not active.";
509            case EXCLUDES: return "The related catalog entry is excluded by this one.";
510            case INCLUDES: return "The item of the related catalog entry  will be part of the orders containing the current item.";
511            default: return "?";
512          }
513        }
514        public String getDisplay() {
515          switch (this) {
516            case TRIGGERS: return "Triggers";
517            case ISREPLACEDBY: return "Is replaced by";
518            case EXCLUDES: return "Excludes";
519            case INCLUDES: return "Includes";
520            default: return "?";
521          }
522        }
523    }
524
525  public static class CatalogEntryRelationTypeEnumFactory implements EnumFactory<CatalogEntryRelationType> {
526    public CatalogEntryRelationType fromCode(String codeString) throws IllegalArgumentException {
527      if (codeString == null || "".equals(codeString))
528            if (codeString == null || "".equals(codeString))
529                return null;
530        if ("triggers".equals(codeString))
531          return CatalogEntryRelationType.TRIGGERS;
532        if ("is-replaced-by".equals(codeString))
533          return CatalogEntryRelationType.ISREPLACEDBY;
534        if ("excludes".equals(codeString))
535          return CatalogEntryRelationType.EXCLUDES;
536        if ("includes".equals(codeString))
537          return CatalogEntryRelationType.INCLUDES;
538        throw new IllegalArgumentException("Unknown CatalogEntryRelationType code '"+codeString+"'");
539        }
540        public Enumeration<CatalogEntryRelationType> fromType(Base code) throws FHIRException {
541          if (code == null)
542            return null;
543          if (code.isEmpty())
544            return new Enumeration<CatalogEntryRelationType>(this);
545          String codeString = ((PrimitiveType) code).asStringValue();
546          if (codeString == null || "".equals(codeString))
547            return null;
548        if ("triggers".equals(codeString))
549          return new Enumeration<CatalogEntryRelationType>(this, CatalogEntryRelationType.TRIGGERS);
550        if ("is-replaced-by".equals(codeString))
551          return new Enumeration<CatalogEntryRelationType>(this, CatalogEntryRelationType.ISREPLACEDBY);
552        if ("excludes".equals(codeString))
553          return new Enumeration<CatalogEntryRelationType>(this, CatalogEntryRelationType.EXCLUDES);
554        if ("includes".equals(codeString))
555          return new Enumeration<CatalogEntryRelationType>(this, CatalogEntryRelationType.INCLUDES);
556        throw new FHIRException("Unknown CatalogEntryRelationType code '"+codeString+"'");
557        }
558    public String toCode(CatalogEntryRelationType code) {
559      if (code == CatalogEntryRelationType.TRIGGERS)
560        return "triggers";
561      if (code == CatalogEntryRelationType.ISREPLACEDBY)
562        return "is-replaced-by";
563      if (code == CatalogEntryRelationType.EXCLUDES)
564        return "excludes";
565      if (code == CatalogEntryRelationType.INCLUDES)
566        return "includes";
567      return "?";
568      }
569    public String toSystem(CatalogEntryRelationType code) {
570      return code.getSystem();
571      }
572    }
573
574    @Block()
575    public static class CatalogEntryRelatedEntryComponent extends BackboneElement implements IBaseBackboneElement {
576        /**
577         * The type of relationship to the related entry.
578         */
579        @Child(name = "relationship", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
580        @Description(shortDefinition="triggers | is-replaced-by | excludes | includes", formalDefinition="The type of relationship to the related entry." )
581        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/catalogentry-relation-type")
582        protected Enumeration<CatalogEntryRelationType> relationship;
583
584        /**
585         * The reference to the related entry.
586         */
587        @Child(name = "target", type = {CatalogEntry.class}, order=2, min=1, max=1, modifier=false, summary=false)
588        @Description(shortDefinition="The reference to the related entry", formalDefinition="The reference to the related entry." )
589        protected Reference target;
590
591        private static final long serialVersionUID = -1175541480L;
592
593    /**
594     * Constructor
595     */
596      public CatalogEntryRelatedEntryComponent() {
597        super();
598      }
599
600    /**
601     * Constructor
602     */
603      public CatalogEntryRelatedEntryComponent(Enumeration<CatalogEntryRelationType> relationship, Reference target) {
604        super();
605        this.relationship = relationship;
606        this.target = target;
607      }
608
609        /**
610         * @return {@link #relationship} (The type of relationship to the related entry.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value
611         */
612        public Enumeration<CatalogEntryRelationType> getRelationshipElement() { 
613          if (this.relationship == null)
614            if (Configuration.errorOnAutoCreate())
615              throw new Error("Attempt to auto-create CatalogEntryRelatedEntryComponent.relationship");
616            else if (Configuration.doAutoCreate())
617              this.relationship = new Enumeration<CatalogEntryRelationType>(new CatalogEntryRelationTypeEnumFactory()); // bb
618          return this.relationship;
619        }
620
621        public boolean hasRelationshipElement() { 
622          return this.relationship != null && !this.relationship.isEmpty();
623        }
624
625        public boolean hasRelationship() { 
626          return this.relationship != null && !this.relationship.isEmpty();
627        }
628
629        /**
630         * @param value {@link #relationship} (The type of relationship to the related entry.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value
631         */
632        public CatalogEntryRelatedEntryComponent setRelationshipElement(Enumeration<CatalogEntryRelationType> value) { 
633          this.relationship = value;
634          return this;
635        }
636
637        /**
638         * @return The type of relationship to the related entry.
639         */
640        public CatalogEntryRelationType getRelationship() { 
641          return this.relationship == null ? null : this.relationship.getValue();
642        }
643
644        /**
645         * @param value The type of relationship to the related entry.
646         */
647        public CatalogEntryRelatedEntryComponent setRelationship(CatalogEntryRelationType value) { 
648            if (this.relationship == null)
649              this.relationship = new Enumeration<CatalogEntryRelationType>(new CatalogEntryRelationTypeEnumFactory());
650            this.relationship.setValue(value);
651          return this;
652        }
653
654        /**
655         * @return {@link #target} (The reference to the related entry.)
656         */
657        public Reference getTarget() { 
658          if (this.target == null)
659            if (Configuration.errorOnAutoCreate())
660              throw new Error("Attempt to auto-create CatalogEntryRelatedEntryComponent.target");
661            else if (Configuration.doAutoCreate())
662              this.target = new Reference(); // cc
663          return this.target;
664        }
665
666        public boolean hasTarget() { 
667          return this.target != null && !this.target.isEmpty();
668        }
669
670        /**
671         * @param value {@link #target} (The reference to the related entry.)
672         */
673        public CatalogEntryRelatedEntryComponent setTarget(Reference value) { 
674          this.target = value;
675          return this;
676        }
677
678        protected void listChildren(List<Property> children) {
679          super.listChildren(children);
680          children.add(new Property("relationship", "code", "The type of relationship to the related entry.", 0, 1, relationship));
681          children.add(new Property("target", "Reference(CatalogEntry)", "The reference to the related entry.", 0, 1, target));
682        }
683
684        @Override
685        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
686          switch (_hash) {
687          case -261851592: /*relationship*/  return new Property("relationship", "code", "The type of relationship to the related entry.", 0, 1, relationship);
688          case -880905839: /*target*/  return new Property("target", "Reference(CatalogEntry)", "The reference to the related entry.", 0, 1, target);
689          default: return super.getNamedProperty(_hash, _name, _checkValid);
690          }
691
692        }
693
694      @Override
695      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
696        switch (hash) {
697        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Enumeration<CatalogEntryRelationType>
698        case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference
699        default: return super.getProperty(hash, name, checkValid);
700        }
701
702      }
703
704      @Override
705      public Base setProperty(int hash, String name, Base value) throws FHIRException {
706        switch (hash) {
707        case -261851592: // relationship
708          value = new CatalogEntryRelationTypeEnumFactory().fromType(castToCode(value));
709          this.relationship = (Enumeration) value; // Enumeration<CatalogEntryRelationType>
710          return value;
711        case -880905839: // target
712          this.target = castToReference(value); // Reference
713          return value;
714        default: return super.setProperty(hash, name, value);
715        }
716
717      }
718
719      @Override
720      public Base setProperty(String name, Base value) throws FHIRException {
721        if (name.equals("relationship")) {
722          value = new CatalogEntryRelationTypeEnumFactory().fromType(castToCode(value));
723          this.relationship = (Enumeration) value; // Enumeration<CatalogEntryRelationType>
724        } else if (name.equals("target")) {
725          this.target = castToReference(value); // Reference
726        } else
727          return super.setProperty(name, value);
728        return value;
729      }
730
731      @Override
732      public Base makeProperty(int hash, String name) throws FHIRException {
733        switch (hash) {
734        case -261851592:  return getRelationshipElement();
735        case -880905839:  return getTarget();
736        default: return super.makeProperty(hash, name);
737        }
738
739      }
740
741      @Override
742      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
743        switch (hash) {
744        case -261851592: /*relationship*/ return new String[] {"code"};
745        case -880905839: /*target*/ return new String[] {"Reference"};
746        default: return super.getTypesForProperty(hash, name);
747        }
748
749      }
750
751      @Override
752      public Base addChild(String name) throws FHIRException {
753        if (name.equals("relationship")) {
754          throw new FHIRException("Cannot call addChild on a primitive type CatalogEntry.relationship");
755        }
756        else if (name.equals("target")) {
757          this.target = new Reference();
758          return this.target;
759        }
760        else
761          return super.addChild(name);
762      }
763
764      public CatalogEntryRelatedEntryComponent copy() {
765        CatalogEntryRelatedEntryComponent dst = new CatalogEntryRelatedEntryComponent();
766        copyValues(dst);
767        return dst;
768      }
769
770      public void copyValues(CatalogEntryRelatedEntryComponent dst) {
771        super.copyValues(dst);
772        dst.relationship = relationship == null ? null : relationship.copy();
773        dst.target = target == null ? null : target.copy();
774      }
775
776      @Override
777      public boolean equalsDeep(Base other_) {
778        if (!super.equalsDeep(other_))
779          return false;
780        if (!(other_ instanceof CatalogEntryRelatedEntryComponent))
781          return false;
782        CatalogEntryRelatedEntryComponent o = (CatalogEntryRelatedEntryComponent) other_;
783        return compareDeep(relationship, o.relationship, true) && compareDeep(target, o.target, true);
784      }
785
786      @Override
787      public boolean equalsShallow(Base other_) {
788        if (!super.equalsShallow(other_))
789          return false;
790        if (!(other_ instanceof CatalogEntryRelatedEntryComponent))
791          return false;
792        CatalogEntryRelatedEntryComponent o = (CatalogEntryRelatedEntryComponent) other_;
793        return compareValues(relationship, o.relationship, true);
794      }
795
796      public boolean isEmpty() {
797        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(relationship, target);
798      }
799
800  public String fhirType() {
801    return "CatalogEntry.relatedEntry";
802
803  }
804
805  }
806
807    /**
808     * Business identifier uniquely assigned to the catalog entry.
809     */
810    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
811    @Description(shortDefinition="Business identifier of the catalog entry", formalDefinition="Business identifier uniquely assigned to the catalog entry." )
812    protected List<Identifier> identifier;
813
814    /**
815     * The name of this catalog entry announces the item that is represented by the entry.
816     */
817    @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
818    @Description(shortDefinition="Displayable name assigned to the catalog entry", formalDefinition="The name of this catalog entry announces the item that is represented by the entry." )
819    protected StringType name;
820
821    /**
822     * The type of resource that is represented by this catalog entry.
823     */
824    @Child(name = "type", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
825    @Description(shortDefinition="ActivityDefinition | PlanDefinition | SpecimenDefinition | ObservationDefinition | DeviceDefinition | Organization | Practitioner | PractitionerRole | HealthcareService | MedicationKnowledge | Medication | Substance | Location", formalDefinition="The type of resource that is represented by this catalog entry." )
826    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/catalogentry-type")
827    protected Enumeration<CatalogEntryType> type;
828
829    /**
830     * Indicates whether this catalog entry is open to public usage (active) or not (draft or retired).
831     */
832    @Child(name = "status", type = {CodeType.class}, order=3, min=0, max=1, modifier=true, summary=true)
833    @Description(shortDefinition="draft | active | retired", formalDefinition="Indicates whether this catalog entry is open to public usage (active) or not (draft or retired)." )
834    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/catalogentry-status")
835    protected Enumeration<CatalogEntryStatus> status;
836
837    /**
838     * Period of usability of the catalog entry.
839     */
840    @Child(name = "effectivePeriod", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=false)
841    @Description(shortDefinition="When this catalog entry is expected to be active", formalDefinition="Period of usability of the catalog entry." )
842    protected Period effectivePeriod;
843
844    /**
845     * Indicates whether or not the entry represents an item that is orderable.
846     */
847    @Child(name = "orderable", type = {BooleanType.class}, order=5, min=1, max=1, modifier=true, summary=true)
848    @Description(shortDefinition="Is orderable", formalDefinition="Indicates whether or not the entry represents an item that is orderable." )
849    protected BooleanType orderable;
850
851    /**
852     * The item (resource) that this entry of the catalog represents.
853     */
854    @Child(name = "referencedItem", type = {DeviceDefinition.class, Organization.class, Practitioner.class, PractitionerRole.class, HealthcareService.class, ActivityDefinition.class, PlanDefinition.class, SpecimenDefinition.class, ObservationDefinition.class, MedicationKnowledge.class, Substance.class, Location.class}, order=6, min=1, max=1, modifier=false, summary=true)
855    @Description(shortDefinition="Item attached to this entry of the catalog", formalDefinition="The item (resource) that this entry of the catalog represents." )
856    protected Reference referencedItem;
857
858    /**
859     * Used for example, to point to a substance, or to a device used to administer a medication.
860     */
861    @Child(name = "relatedEntry", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
862    @Description(shortDefinition="Another entry of the catalog related to this one", formalDefinition="Used for example, to point to a substance, or to a device used to administer a medication." )
863    protected List<CatalogEntryRelatedEntryComponent> relatedEntry;
864
865    /**
866     * Last actor who recorded (created or updated) this catalog entry.
867     */
868    @Child(name = "updatedBy", type = {Person.class, Device.class}, order=8, min=0, max=1, modifier=false, summary=false)
869    @Description(shortDefinition="Last updater of this catalog entry", formalDefinition="Last actor who recorded (created or updated) this catalog entry." )
870    protected Reference updatedBy;
871
872    /**
873     * Notes and comments about this catalog entry.
874     */
875    @Child(name = "note", type = {Annotation.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
876    @Description(shortDefinition="Notes and comments about this catalog entry", formalDefinition="Notes and comments about this catalog entry." )
877    protected List<Annotation> note;
878
879    /**
880     * Estimated duration of the orderable item of this  entry of the catalog.
881     */
882    @Child(name = "estimatedDuration", type = {Duration.class}, order=10, min=0, max=1, modifier=false, summary=false)
883    @Description(shortDefinition="Estimated duration of the orderable item", formalDefinition="Estimated duration of the orderable item of this  entry of the catalog." )
884    protected Duration estimatedDuration;
885
886    /**
887     * Billing code associated to the  item in the context of this  entry of the catalog.
888     */
889    @Child(name = "billingCode", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
890    @Description(shortDefinition="Billing code in the context of this catalog entry", formalDefinition="Billing code associated to the  item in the context of this  entry of the catalog." )
891    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cpt-all")
892    protected List<CodeableConcept> billingCode;
893
894    /**
895     * Billing summary attached to the  item in the context of this  entry of the catalog.
896     */
897    @Child(name = "billingSummary", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=true)
898    @Description(shortDefinition="Billing summary in the context of this catalog entry", formalDefinition="Billing summary attached to the  item in the context of this  entry of the catalog." )
899    protected StringType billingSummary;
900
901    /**
902     * Schedule summary for the  item in the context of this  entry of the catalog.
903     */
904    @Child(name = "scheduleSummary", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false)
905    @Description(shortDefinition="Schedule summary for the catalog entry", formalDefinition="Schedule summary for the  item in the context of this  entry of the catalog." )
906    protected StringType scheduleSummary;
907
908    /**
909     * Summary of limitations for the  item in the context of this  entry of the catalog.
910     */
911    @Child(name = "limitationSummary", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false)
912    @Description(shortDefinition="Summary of limitations for the catalog entry", formalDefinition="Summary of limitations for the  item in the context of this  entry of the catalog." )
913    protected StringType limitationSummary;
914
915    /**
916     * Regulatory summary for the  item in the context of this  entry of the catalog.
917     */
918    @Child(name = "regulatorySummary", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false)
919    @Description(shortDefinition="Regulatory  summary for the catalog entry", formalDefinition="Regulatory summary for the  item in the context of this  entry of the catalog." )
920    protected StringType regulatorySummary;
921
922    private static final long serialVersionUID = -2010989359L;
923
924  /**
925   * Constructor
926   */
927    public CatalogEntry() {
928      super();
929    }
930
931  /**
932   * Constructor
933   */
934    public CatalogEntry(BooleanType orderable, Reference referencedItem) {
935      super();
936      this.orderable = orderable;
937      this.referencedItem = referencedItem;
938    }
939
940    /**
941     * @return {@link #identifier} (Business identifier uniquely assigned to the catalog entry.)
942     */
943    public List<Identifier> getIdentifier() { 
944      if (this.identifier == null)
945        this.identifier = new ArrayList<Identifier>();
946      return this.identifier;
947    }
948
949    /**
950     * @return Returns a reference to <code>this</code> for easy method chaining
951     */
952    public CatalogEntry setIdentifier(List<Identifier> theIdentifier) { 
953      this.identifier = theIdentifier;
954      return this;
955    }
956
957    public boolean hasIdentifier() { 
958      if (this.identifier == null)
959        return false;
960      for (Identifier item : this.identifier)
961        if (!item.isEmpty())
962          return true;
963      return false;
964    }
965
966    public Identifier addIdentifier() { //3
967      Identifier t = new Identifier();
968      if (this.identifier == null)
969        this.identifier = new ArrayList<Identifier>();
970      this.identifier.add(t);
971      return t;
972    }
973
974    public CatalogEntry addIdentifier(Identifier t) { //3
975      if (t == null)
976        return this;
977      if (this.identifier == null)
978        this.identifier = new ArrayList<Identifier>();
979      this.identifier.add(t);
980      return this;
981    }
982
983    /**
984     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
985     */
986    public Identifier getIdentifierFirstRep() { 
987      if (getIdentifier().isEmpty()) {
988        addIdentifier();
989      }
990      return getIdentifier().get(0);
991    }
992
993    /**
994     * @return {@link #name} (The name of this catalog entry announces the item that is represented by the entry.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
995     */
996    public StringType getNameElement() { 
997      if (this.name == null)
998        if (Configuration.errorOnAutoCreate())
999          throw new Error("Attempt to auto-create CatalogEntry.name");
1000        else if (Configuration.doAutoCreate())
1001          this.name = new StringType(); // bb
1002      return this.name;
1003    }
1004
1005    public boolean hasNameElement() { 
1006      return this.name != null && !this.name.isEmpty();
1007    }
1008
1009    public boolean hasName() { 
1010      return this.name != null && !this.name.isEmpty();
1011    }
1012
1013    /**
1014     * @param value {@link #name} (The name of this catalog entry announces the item that is represented by the entry.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1015     */
1016    public CatalogEntry setNameElement(StringType value) { 
1017      this.name = value;
1018      return this;
1019    }
1020
1021    /**
1022     * @return The name of this catalog entry announces the item that is represented by the entry.
1023     */
1024    public String getName() { 
1025      return this.name == null ? null : this.name.getValue();
1026    }
1027
1028    /**
1029     * @param value The name of this catalog entry announces the item that is represented by the entry.
1030     */
1031    public CatalogEntry setName(String value) { 
1032      if (Utilities.noString(value))
1033        this.name = null;
1034      else {
1035        if (this.name == null)
1036          this.name = new StringType();
1037        this.name.setValue(value);
1038      }
1039      return this;
1040    }
1041
1042    /**
1043     * @return {@link #type} (The type of resource that is represented by this catalog entry.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1044     */
1045    public Enumeration<CatalogEntryType> getTypeElement() { 
1046      if (this.type == null)
1047        if (Configuration.errorOnAutoCreate())
1048          throw new Error("Attempt to auto-create CatalogEntry.type");
1049        else if (Configuration.doAutoCreate())
1050          this.type = new Enumeration<CatalogEntryType>(new CatalogEntryTypeEnumFactory()); // bb
1051      return this.type;
1052    }
1053
1054    public boolean hasTypeElement() { 
1055      return this.type != null && !this.type.isEmpty();
1056    }
1057
1058    public boolean hasType() { 
1059      return this.type != null && !this.type.isEmpty();
1060    }
1061
1062    /**
1063     * @param value {@link #type} (The type of resource that is represented by this catalog entry.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1064     */
1065    public CatalogEntry setTypeElement(Enumeration<CatalogEntryType> value) { 
1066      this.type = value;
1067      return this;
1068    }
1069
1070    /**
1071     * @return The type of resource that is represented by this catalog entry.
1072     */
1073    public CatalogEntryType getType() { 
1074      return this.type == null ? null : this.type.getValue();
1075    }
1076
1077    /**
1078     * @param value The type of resource that is represented by this catalog entry.
1079     */
1080    public CatalogEntry setType(CatalogEntryType value) { 
1081      if (value == null)
1082        this.type = null;
1083      else {
1084        if (this.type == null)
1085          this.type = new Enumeration<CatalogEntryType>(new CatalogEntryTypeEnumFactory());
1086        this.type.setValue(value);
1087      }
1088      return this;
1089    }
1090
1091    /**
1092     * @return {@link #status} (Indicates whether this catalog entry is open to public usage (active) or not (draft or retired).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1093     */
1094    public Enumeration<CatalogEntryStatus> getStatusElement() { 
1095      if (this.status == null)
1096        if (Configuration.errorOnAutoCreate())
1097          throw new Error("Attempt to auto-create CatalogEntry.status");
1098        else if (Configuration.doAutoCreate())
1099          this.status = new Enumeration<CatalogEntryStatus>(new CatalogEntryStatusEnumFactory()); // bb
1100      return this.status;
1101    }
1102
1103    public boolean hasStatusElement() { 
1104      return this.status != null && !this.status.isEmpty();
1105    }
1106
1107    public boolean hasStatus() { 
1108      return this.status != null && !this.status.isEmpty();
1109    }
1110
1111    /**
1112     * @param value {@link #status} (Indicates whether this catalog entry is open to public usage (active) or not (draft or retired).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1113     */
1114    public CatalogEntry setStatusElement(Enumeration<CatalogEntryStatus> value) { 
1115      this.status = value;
1116      return this;
1117    }
1118
1119    /**
1120     * @return Indicates whether this catalog entry is open to public usage (active) or not (draft or retired).
1121     */
1122    public CatalogEntryStatus getStatus() { 
1123      return this.status == null ? null : this.status.getValue();
1124    }
1125
1126    /**
1127     * @param value Indicates whether this catalog entry is open to public usage (active) or not (draft or retired).
1128     */
1129    public CatalogEntry setStatus(CatalogEntryStatus value) { 
1130      if (value == null)
1131        this.status = null;
1132      else {
1133        if (this.status == null)
1134          this.status = new Enumeration<CatalogEntryStatus>(new CatalogEntryStatusEnumFactory());
1135        this.status.setValue(value);
1136      }
1137      return this;
1138    }
1139
1140    /**
1141     * @return {@link #effectivePeriod} (Period of usability of the catalog entry.)
1142     */
1143    public Period getEffectivePeriod() { 
1144      if (this.effectivePeriod == null)
1145        if (Configuration.errorOnAutoCreate())
1146          throw new Error("Attempt to auto-create CatalogEntry.effectivePeriod");
1147        else if (Configuration.doAutoCreate())
1148          this.effectivePeriod = new Period(); // cc
1149      return this.effectivePeriod;
1150    }
1151
1152    public boolean hasEffectivePeriod() { 
1153      return this.effectivePeriod != null && !this.effectivePeriod.isEmpty();
1154    }
1155
1156    /**
1157     * @param value {@link #effectivePeriod} (Period of usability of the catalog entry.)
1158     */
1159    public CatalogEntry setEffectivePeriod(Period value) { 
1160      this.effectivePeriod = value;
1161      return this;
1162    }
1163
1164    /**
1165     * @return {@link #orderable} (Indicates whether or not the entry represents an item that is orderable.). This is the underlying object with id, value and extensions. The accessor "getOrderable" gives direct access to the value
1166     */
1167    public BooleanType getOrderableElement() { 
1168      if (this.orderable == null)
1169        if (Configuration.errorOnAutoCreate())
1170          throw new Error("Attempt to auto-create CatalogEntry.orderable");
1171        else if (Configuration.doAutoCreate())
1172          this.orderable = new BooleanType(); // bb
1173      return this.orderable;
1174    }
1175
1176    public boolean hasOrderableElement() { 
1177      return this.orderable != null && !this.orderable.isEmpty();
1178    }
1179
1180    public boolean hasOrderable() { 
1181      return this.orderable != null && !this.orderable.isEmpty();
1182    }
1183
1184    /**
1185     * @param value {@link #orderable} (Indicates whether or not the entry represents an item that is orderable.). This is the underlying object with id, value and extensions. The accessor "getOrderable" gives direct access to the value
1186     */
1187    public CatalogEntry setOrderableElement(BooleanType value) { 
1188      this.orderable = value;
1189      return this;
1190    }
1191
1192    /**
1193     * @return Indicates whether or not the entry represents an item that is orderable.
1194     */
1195    public boolean getOrderable() { 
1196      return this.orderable == null || this.orderable.isEmpty() ? false : this.orderable.getValue();
1197    }
1198
1199    /**
1200     * @param value Indicates whether or not the entry represents an item that is orderable.
1201     */
1202    public CatalogEntry setOrderable(boolean value) { 
1203        if (this.orderable == null)
1204          this.orderable = new BooleanType();
1205        this.orderable.setValue(value);
1206      return this;
1207    }
1208
1209    /**
1210     * @return {@link #referencedItem} (The item (resource) that this entry of the catalog represents.)
1211     */
1212    public Reference getReferencedItem() { 
1213      if (this.referencedItem == null)
1214        if (Configuration.errorOnAutoCreate())
1215          throw new Error("Attempt to auto-create CatalogEntry.referencedItem");
1216        else if (Configuration.doAutoCreate())
1217          this.referencedItem = new Reference(); // cc
1218      return this.referencedItem;
1219    }
1220
1221    public boolean hasReferencedItem() { 
1222      return this.referencedItem != null && !this.referencedItem.isEmpty();
1223    }
1224
1225    /**
1226     * @param value {@link #referencedItem} (The item (resource) that this entry of the catalog represents.)
1227     */
1228    public CatalogEntry setReferencedItem(Reference value) { 
1229      this.referencedItem = value;
1230      return this;
1231    }
1232
1233    /**
1234     * @return {@link #relatedEntry} (Used for example, to point to a substance, or to a device used to administer a medication.)
1235     */
1236    public List<CatalogEntryRelatedEntryComponent> getRelatedEntry() { 
1237      if (this.relatedEntry == null)
1238        this.relatedEntry = new ArrayList<CatalogEntryRelatedEntryComponent>();
1239      return this.relatedEntry;
1240    }
1241
1242    /**
1243     * @return Returns a reference to <code>this</code> for easy method chaining
1244     */
1245    public CatalogEntry setRelatedEntry(List<CatalogEntryRelatedEntryComponent> theRelatedEntry) { 
1246      this.relatedEntry = theRelatedEntry;
1247      return this;
1248    }
1249
1250    public boolean hasRelatedEntry() { 
1251      if (this.relatedEntry == null)
1252        return false;
1253      for (CatalogEntryRelatedEntryComponent item : this.relatedEntry)
1254        if (!item.isEmpty())
1255          return true;
1256      return false;
1257    }
1258
1259    public CatalogEntryRelatedEntryComponent addRelatedEntry() { //3
1260      CatalogEntryRelatedEntryComponent t = new CatalogEntryRelatedEntryComponent();
1261      if (this.relatedEntry == null)
1262        this.relatedEntry = new ArrayList<CatalogEntryRelatedEntryComponent>();
1263      this.relatedEntry.add(t);
1264      return t;
1265    }
1266
1267    public CatalogEntry addRelatedEntry(CatalogEntryRelatedEntryComponent t) { //3
1268      if (t == null)
1269        return this;
1270      if (this.relatedEntry == null)
1271        this.relatedEntry = new ArrayList<CatalogEntryRelatedEntryComponent>();
1272      this.relatedEntry.add(t);
1273      return this;
1274    }
1275
1276    /**
1277     * @return The first repetition of repeating field {@link #relatedEntry}, creating it if it does not already exist
1278     */
1279    public CatalogEntryRelatedEntryComponent getRelatedEntryFirstRep() { 
1280      if (getRelatedEntry().isEmpty()) {
1281        addRelatedEntry();
1282      }
1283      return getRelatedEntry().get(0);
1284    }
1285
1286    /**
1287     * @return {@link #updatedBy} (Last actor who recorded (created or updated) this catalog entry.)
1288     */
1289    public Reference getUpdatedBy() { 
1290      if (this.updatedBy == null)
1291        if (Configuration.errorOnAutoCreate())
1292          throw new Error("Attempt to auto-create CatalogEntry.updatedBy");
1293        else if (Configuration.doAutoCreate())
1294          this.updatedBy = new Reference(); // cc
1295      return this.updatedBy;
1296    }
1297
1298    public boolean hasUpdatedBy() { 
1299      return this.updatedBy != null && !this.updatedBy.isEmpty();
1300    }
1301
1302    /**
1303     * @param value {@link #updatedBy} (Last actor who recorded (created or updated) this catalog entry.)
1304     */
1305    public CatalogEntry setUpdatedBy(Reference value) { 
1306      this.updatedBy = value;
1307      return this;
1308    }
1309
1310    /**
1311     * @return {@link #note} (Notes and comments about this catalog entry.)
1312     */
1313    public List<Annotation> getNote() { 
1314      if (this.note == null)
1315        this.note = new ArrayList<Annotation>();
1316      return this.note;
1317    }
1318
1319    /**
1320     * @return Returns a reference to <code>this</code> for easy method chaining
1321     */
1322    public CatalogEntry setNote(List<Annotation> theNote) { 
1323      this.note = theNote;
1324      return this;
1325    }
1326
1327    public boolean hasNote() { 
1328      if (this.note == null)
1329        return false;
1330      for (Annotation item : this.note)
1331        if (!item.isEmpty())
1332          return true;
1333      return false;
1334    }
1335
1336    public Annotation addNote() { //3
1337      Annotation t = new Annotation();
1338      if (this.note == null)
1339        this.note = new ArrayList<Annotation>();
1340      this.note.add(t);
1341      return t;
1342    }
1343
1344    public CatalogEntry addNote(Annotation t) { //3
1345      if (t == null)
1346        return this;
1347      if (this.note == null)
1348        this.note = new ArrayList<Annotation>();
1349      this.note.add(t);
1350      return this;
1351    }
1352
1353    /**
1354     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
1355     */
1356    public Annotation getNoteFirstRep() { 
1357      if (getNote().isEmpty()) {
1358        addNote();
1359      }
1360      return getNote().get(0);
1361    }
1362
1363    /**
1364     * @return {@link #estimatedDuration} (Estimated duration of the orderable item of this  entry of the catalog.)
1365     */
1366    public Duration getEstimatedDuration() { 
1367      if (this.estimatedDuration == null)
1368        if (Configuration.errorOnAutoCreate())
1369          throw new Error("Attempt to auto-create CatalogEntry.estimatedDuration");
1370        else if (Configuration.doAutoCreate())
1371          this.estimatedDuration = new Duration(); // cc
1372      return this.estimatedDuration;
1373    }
1374
1375    public boolean hasEstimatedDuration() { 
1376      return this.estimatedDuration != null && !this.estimatedDuration.isEmpty();
1377    }
1378
1379    /**
1380     * @param value {@link #estimatedDuration} (Estimated duration of the orderable item of this  entry of the catalog.)
1381     */
1382    public CatalogEntry setEstimatedDuration(Duration value) { 
1383      this.estimatedDuration = value;
1384      return this;
1385    }
1386
1387    /**
1388     * @return {@link #billingCode} (Billing code associated to the  item in the context of this  entry of the catalog.)
1389     */
1390    public List<CodeableConcept> getBillingCode() { 
1391      if (this.billingCode == null)
1392        this.billingCode = new ArrayList<CodeableConcept>();
1393      return this.billingCode;
1394    }
1395
1396    /**
1397     * @return Returns a reference to <code>this</code> for easy method chaining
1398     */
1399    public CatalogEntry setBillingCode(List<CodeableConcept> theBillingCode) { 
1400      this.billingCode = theBillingCode;
1401      return this;
1402    }
1403
1404    public boolean hasBillingCode() { 
1405      if (this.billingCode == null)
1406        return false;
1407      for (CodeableConcept item : this.billingCode)
1408        if (!item.isEmpty())
1409          return true;
1410      return false;
1411    }
1412
1413    public CodeableConcept addBillingCode() { //3
1414      CodeableConcept t = new CodeableConcept();
1415      if (this.billingCode == null)
1416        this.billingCode = new ArrayList<CodeableConcept>();
1417      this.billingCode.add(t);
1418      return t;
1419    }
1420
1421    public CatalogEntry addBillingCode(CodeableConcept t) { //3
1422      if (t == null)
1423        return this;
1424      if (this.billingCode == null)
1425        this.billingCode = new ArrayList<CodeableConcept>();
1426      this.billingCode.add(t);
1427      return this;
1428    }
1429
1430    /**
1431     * @return The first repetition of repeating field {@link #billingCode}, creating it if it does not already exist
1432     */
1433    public CodeableConcept getBillingCodeFirstRep() { 
1434      if (getBillingCode().isEmpty()) {
1435        addBillingCode();
1436      }
1437      return getBillingCode().get(0);
1438    }
1439
1440    /**
1441     * @return {@link #billingSummary} (Billing summary attached to the  item in the context of this  entry of the catalog.). This is the underlying object with id, value and extensions. The accessor "getBillingSummary" gives direct access to the value
1442     */
1443    public StringType getBillingSummaryElement() { 
1444      if (this.billingSummary == null)
1445        if (Configuration.errorOnAutoCreate())
1446          throw new Error("Attempt to auto-create CatalogEntry.billingSummary");
1447        else if (Configuration.doAutoCreate())
1448          this.billingSummary = new StringType(); // bb
1449      return this.billingSummary;
1450    }
1451
1452    public boolean hasBillingSummaryElement() { 
1453      return this.billingSummary != null && !this.billingSummary.isEmpty();
1454    }
1455
1456    public boolean hasBillingSummary() { 
1457      return this.billingSummary != null && !this.billingSummary.isEmpty();
1458    }
1459
1460    /**
1461     * @param value {@link #billingSummary} (Billing summary attached to the  item in the context of this  entry of the catalog.). This is the underlying object with id, value and extensions. The accessor "getBillingSummary" gives direct access to the value
1462     */
1463    public CatalogEntry setBillingSummaryElement(StringType value) { 
1464      this.billingSummary = value;
1465      return this;
1466    }
1467
1468    /**
1469     * @return Billing summary attached to the  item in the context of this  entry of the catalog.
1470     */
1471    public String getBillingSummary() { 
1472      return this.billingSummary == null ? null : this.billingSummary.getValue();
1473    }
1474
1475    /**
1476     * @param value Billing summary attached to the  item in the context of this  entry of the catalog.
1477     */
1478    public CatalogEntry setBillingSummary(String value) { 
1479      if (Utilities.noString(value))
1480        this.billingSummary = null;
1481      else {
1482        if (this.billingSummary == null)
1483          this.billingSummary = new StringType();
1484        this.billingSummary.setValue(value);
1485      }
1486      return this;
1487    }
1488
1489    /**
1490     * @return {@link #scheduleSummary} (Schedule summary for the  item in the context of this  entry of the catalog.). This is the underlying object with id, value and extensions. The accessor "getScheduleSummary" gives direct access to the value
1491     */
1492    public StringType getScheduleSummaryElement() { 
1493      if (this.scheduleSummary == null)
1494        if (Configuration.errorOnAutoCreate())
1495          throw new Error("Attempt to auto-create CatalogEntry.scheduleSummary");
1496        else if (Configuration.doAutoCreate())
1497          this.scheduleSummary = new StringType(); // bb
1498      return this.scheduleSummary;
1499    }
1500
1501    public boolean hasScheduleSummaryElement() { 
1502      return this.scheduleSummary != null && !this.scheduleSummary.isEmpty();
1503    }
1504
1505    public boolean hasScheduleSummary() { 
1506      return this.scheduleSummary != null && !this.scheduleSummary.isEmpty();
1507    }
1508
1509    /**
1510     * @param value {@link #scheduleSummary} (Schedule summary for the  item in the context of this  entry of the catalog.). This is the underlying object with id, value and extensions. The accessor "getScheduleSummary" gives direct access to the value
1511     */
1512    public CatalogEntry setScheduleSummaryElement(StringType value) { 
1513      this.scheduleSummary = value;
1514      return this;
1515    }
1516
1517    /**
1518     * @return Schedule summary for the  item in the context of this  entry of the catalog.
1519     */
1520    public String getScheduleSummary() { 
1521      return this.scheduleSummary == null ? null : this.scheduleSummary.getValue();
1522    }
1523
1524    /**
1525     * @param value Schedule summary for the  item in the context of this  entry of the catalog.
1526     */
1527    public CatalogEntry setScheduleSummary(String value) { 
1528      if (Utilities.noString(value))
1529        this.scheduleSummary = null;
1530      else {
1531        if (this.scheduleSummary == null)
1532          this.scheduleSummary = new StringType();
1533        this.scheduleSummary.setValue(value);
1534      }
1535      return this;
1536    }
1537
1538    /**
1539     * @return {@link #limitationSummary} (Summary of limitations for the  item in the context of this  entry of the catalog.). This is the underlying object with id, value and extensions. The accessor "getLimitationSummary" gives direct access to the value
1540     */
1541    public StringType getLimitationSummaryElement() { 
1542      if (this.limitationSummary == null)
1543        if (Configuration.errorOnAutoCreate())
1544          throw new Error("Attempt to auto-create CatalogEntry.limitationSummary");
1545        else if (Configuration.doAutoCreate())
1546          this.limitationSummary = new StringType(); // bb
1547      return this.limitationSummary;
1548    }
1549
1550    public boolean hasLimitationSummaryElement() { 
1551      return this.limitationSummary != null && !this.limitationSummary.isEmpty();
1552    }
1553
1554    public boolean hasLimitationSummary() { 
1555      return this.limitationSummary != null && !this.limitationSummary.isEmpty();
1556    }
1557
1558    /**
1559     * @param value {@link #limitationSummary} (Summary of limitations for the  item in the context of this  entry of the catalog.). This is the underlying object with id, value and extensions. The accessor "getLimitationSummary" gives direct access to the value
1560     */
1561    public CatalogEntry setLimitationSummaryElement(StringType value) { 
1562      this.limitationSummary = value;
1563      return this;
1564    }
1565
1566    /**
1567     * @return Summary of limitations for the  item in the context of this  entry of the catalog.
1568     */
1569    public String getLimitationSummary() { 
1570      return this.limitationSummary == null ? null : this.limitationSummary.getValue();
1571    }
1572
1573    /**
1574     * @param value Summary of limitations for the  item in the context of this  entry of the catalog.
1575     */
1576    public CatalogEntry setLimitationSummary(String value) { 
1577      if (Utilities.noString(value))
1578        this.limitationSummary = null;
1579      else {
1580        if (this.limitationSummary == null)
1581          this.limitationSummary = new StringType();
1582        this.limitationSummary.setValue(value);
1583      }
1584      return this;
1585    }
1586
1587    /**
1588     * @return {@link #regulatorySummary} (Regulatory summary for the  item in the context of this  entry of the catalog.). This is the underlying object with id, value and extensions. The accessor "getRegulatorySummary" gives direct access to the value
1589     */
1590    public StringType getRegulatorySummaryElement() { 
1591      if (this.regulatorySummary == null)
1592        if (Configuration.errorOnAutoCreate())
1593          throw new Error("Attempt to auto-create CatalogEntry.regulatorySummary");
1594        else if (Configuration.doAutoCreate())
1595          this.regulatorySummary = new StringType(); // bb
1596      return this.regulatorySummary;
1597    }
1598
1599    public boolean hasRegulatorySummaryElement() { 
1600      return this.regulatorySummary != null && !this.regulatorySummary.isEmpty();
1601    }
1602
1603    public boolean hasRegulatorySummary() { 
1604      return this.regulatorySummary != null && !this.regulatorySummary.isEmpty();
1605    }
1606
1607    /**
1608     * @param value {@link #regulatorySummary} (Regulatory summary for the  item in the context of this  entry of the catalog.). This is the underlying object with id, value and extensions. The accessor "getRegulatorySummary" gives direct access to the value
1609     */
1610    public CatalogEntry setRegulatorySummaryElement(StringType value) { 
1611      this.regulatorySummary = value;
1612      return this;
1613    }
1614
1615    /**
1616     * @return Regulatory summary for the  item in the context of this  entry of the catalog.
1617     */
1618    public String getRegulatorySummary() { 
1619      return this.regulatorySummary == null ? null : this.regulatorySummary.getValue();
1620    }
1621
1622    /**
1623     * @param value Regulatory summary for the  item in the context of this  entry of the catalog.
1624     */
1625    public CatalogEntry setRegulatorySummary(String value) { 
1626      if (Utilities.noString(value))
1627        this.regulatorySummary = null;
1628      else {
1629        if (this.regulatorySummary == null)
1630          this.regulatorySummary = new StringType();
1631        this.regulatorySummary.setValue(value);
1632      }
1633      return this;
1634    }
1635
1636      protected void listChildren(List<Property> children) {
1637        super.listChildren(children);
1638        children.add(new Property("identifier", "Identifier", "Business identifier uniquely assigned to the catalog entry.", 0, java.lang.Integer.MAX_VALUE, identifier));
1639        children.add(new Property("name", "string", "The name of this catalog entry announces the item that is represented by the entry.", 0, 1, name));
1640        children.add(new Property("type", "code", "The type of resource that is represented by this catalog entry.", 0, 1, type));
1641        children.add(new Property("status", "code", "Indicates whether this catalog entry is open to public usage (active) or not (draft or retired).", 0, 1, status));
1642        children.add(new Property("effectivePeriod", "Period", "Period of usability of the catalog entry.", 0, 1, effectivePeriod));
1643        children.add(new Property("orderable", "boolean", "Indicates whether or not the entry represents an item that is orderable.", 0, 1, orderable));
1644        children.add(new Property("referencedItem", "Reference(DeviceDefinition|Organization|Practitioner|PractitionerRole|HealthcareService|ActivityDefinition|PlanDefinition|SpecimenDefinition|ObservationDefinition|MedicationKnowledge|Substance|Location)", "The item (resource) that this entry of the catalog represents.", 0, 1, referencedItem));
1645        children.add(new Property("relatedEntry", "", "Used for example, to point to a substance, or to a device used to administer a medication.", 0, java.lang.Integer.MAX_VALUE, relatedEntry));
1646        children.add(new Property("updatedBy", "Reference(Person|Device)", "Last actor who recorded (created or updated) this catalog entry.", 0, 1, updatedBy));
1647        children.add(new Property("note", "Annotation", "Notes and comments about this catalog entry.", 0, java.lang.Integer.MAX_VALUE, note));
1648        children.add(new Property("estimatedDuration", "Duration", "Estimated duration of the orderable item of this  entry of the catalog.", 0, 1, estimatedDuration));
1649        children.add(new Property("billingCode", "CodeableConcept", "Billing code associated to the  item in the context of this  entry of the catalog.", 0, java.lang.Integer.MAX_VALUE, billingCode));
1650        children.add(new Property("billingSummary", "string", "Billing summary attached to the  item in the context of this  entry of the catalog.", 0, 1, billingSummary));
1651        children.add(new Property("scheduleSummary", "string", "Schedule summary for the  item in the context of this  entry of the catalog.", 0, 1, scheduleSummary));
1652        children.add(new Property("limitationSummary", "string", "Summary of limitations for the  item in the context of this  entry of the catalog.", 0, 1, limitationSummary));
1653        children.add(new Property("regulatorySummary", "string", "Regulatory summary for the  item in the context of this  entry of the catalog.", 0, 1, regulatorySummary));
1654      }
1655
1656      @Override
1657      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1658        switch (_hash) {
1659        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifier uniquely assigned to the catalog entry.", 0, java.lang.Integer.MAX_VALUE, identifier);
1660        case 3373707: /*name*/  return new Property("name", "string", "The name of this catalog entry announces the item that is represented by the entry.", 0, 1, name);
1661        case 3575610: /*type*/  return new Property("type", "code", "The type of resource that is represented by this catalog entry.", 0, 1, type);
1662        case -892481550: /*status*/  return new Property("status", "code", "Indicates whether this catalog entry is open to public usage (active) or not (draft or retired).", 0, 1, status);
1663        case -403934648: /*effectivePeriod*/  return new Property("effectivePeriod", "Period", "Period of usability of the catalog entry.", 0, 1, effectivePeriod);
1664        case -391199320: /*orderable*/  return new Property("orderable", "boolean", "Indicates whether or not the entry represents an item that is orderable.", 0, 1, orderable);
1665        case -1896630996: /*referencedItem*/  return new Property("referencedItem", "Reference(DeviceDefinition|Organization|Practitioner|PractitionerRole|HealthcareService|ActivityDefinition|PlanDefinition|SpecimenDefinition|ObservationDefinition|MedicationKnowledge|Substance|Location)", "The item (resource) that this entry of the catalog represents.", 0, 1, referencedItem);
1666        case 130178823: /*relatedEntry*/  return new Property("relatedEntry", "", "Used for example, to point to a substance, or to a device used to administer a medication.", 0, java.lang.Integer.MAX_VALUE, relatedEntry);
1667        case -1949194638: /*updatedBy*/  return new Property("updatedBy", "Reference(Person|Device)", "Last actor who recorded (created or updated) this catalog entry.", 0, 1, updatedBy);
1668        case 3387378: /*note*/  return new Property("note", "Annotation", "Notes and comments about this catalog entry.", 0, java.lang.Integer.MAX_VALUE, note);
1669        case 1266497008: /*estimatedDuration*/  return new Property("estimatedDuration", "Duration", "Estimated duration of the orderable item of this  entry of the catalog.", 0, 1, estimatedDuration);
1670        case 91787016: /*billingCode*/  return new Property("billingCode", "CodeableConcept", "Billing code associated to the  item in the context of this  entry of the catalog.", 0, java.lang.Integer.MAX_VALUE, billingCode);
1671        case 28404907: /*billingSummary*/  return new Property("billingSummary", "string", "Billing summary attached to the  item in the context of this  entry of the catalog.", 0, 1, billingSummary);
1672        case -255728369: /*scheduleSummary*/  return new Property("scheduleSummary", "string", "Schedule summary for the  item in the context of this  entry of the catalog.", 0, 1, scheduleSummary);
1673        case -79871444: /*limitationSummary*/  return new Property("limitationSummary", "string", "Summary of limitations for the  item in the context of this  entry of the catalog.", 0, 1, limitationSummary);
1674        case 1296867822: /*regulatorySummary*/  return new Property("regulatorySummary", "string", "Regulatory summary for the  item in the context of this  entry of the catalog.", 0, 1, regulatorySummary);
1675        default: return super.getNamedProperty(_hash, _name, _checkValid);
1676        }
1677
1678      }
1679
1680      @Override
1681      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1682        switch (hash) {
1683        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1684        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1685        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<CatalogEntryType>
1686        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<CatalogEntryStatus>
1687        case -403934648: /*effectivePeriod*/ return this.effectivePeriod == null ? new Base[0] : new Base[] {this.effectivePeriod}; // Period
1688        case -391199320: /*orderable*/ return this.orderable == null ? new Base[0] : new Base[] {this.orderable}; // BooleanType
1689        case -1896630996: /*referencedItem*/ return this.referencedItem == null ? new Base[0] : new Base[] {this.referencedItem}; // Reference
1690        case 130178823: /*relatedEntry*/ return this.relatedEntry == null ? new Base[0] : this.relatedEntry.toArray(new Base[this.relatedEntry.size()]); // CatalogEntryRelatedEntryComponent
1691        case -1949194638: /*updatedBy*/ return this.updatedBy == null ? new Base[0] : new Base[] {this.updatedBy}; // Reference
1692        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1693        case 1266497008: /*estimatedDuration*/ return this.estimatedDuration == null ? new Base[0] : new Base[] {this.estimatedDuration}; // Duration
1694        case 91787016: /*billingCode*/ return this.billingCode == null ? new Base[0] : this.billingCode.toArray(new Base[this.billingCode.size()]); // CodeableConcept
1695        case 28404907: /*billingSummary*/ return this.billingSummary == null ? new Base[0] : new Base[] {this.billingSummary}; // StringType
1696        case -255728369: /*scheduleSummary*/ return this.scheduleSummary == null ? new Base[0] : new Base[] {this.scheduleSummary}; // StringType
1697        case -79871444: /*limitationSummary*/ return this.limitationSummary == null ? new Base[0] : new Base[] {this.limitationSummary}; // StringType
1698        case 1296867822: /*regulatorySummary*/ return this.regulatorySummary == null ? new Base[0] : new Base[] {this.regulatorySummary}; // StringType
1699        default: return super.getProperty(hash, name, checkValid);
1700        }
1701
1702      }
1703
1704      @Override
1705      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1706        switch (hash) {
1707        case -1618432855: // identifier
1708          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1709          return value;
1710        case 3373707: // name
1711          this.name = castToString(value); // StringType
1712          return value;
1713        case 3575610: // type
1714          value = new CatalogEntryTypeEnumFactory().fromType(castToCode(value));
1715          this.type = (Enumeration) value; // Enumeration<CatalogEntryType>
1716          return value;
1717        case -892481550: // status
1718          value = new CatalogEntryStatusEnumFactory().fromType(castToCode(value));
1719          this.status = (Enumeration) value; // Enumeration<CatalogEntryStatus>
1720          return value;
1721        case -403934648: // effectivePeriod
1722          this.effectivePeriod = castToPeriod(value); // Period
1723          return value;
1724        case -391199320: // orderable
1725          this.orderable = castToBoolean(value); // BooleanType
1726          return value;
1727        case -1896630996: // referencedItem
1728          this.referencedItem = castToReference(value); // Reference
1729          return value;
1730        case 130178823: // relatedEntry
1731          this.getRelatedEntry().add((CatalogEntryRelatedEntryComponent) value); // CatalogEntryRelatedEntryComponent
1732          return value;
1733        case -1949194638: // updatedBy
1734          this.updatedBy = castToReference(value); // Reference
1735          return value;
1736        case 3387378: // note
1737          this.getNote().add(castToAnnotation(value)); // Annotation
1738          return value;
1739        case 1266497008: // estimatedDuration
1740          this.estimatedDuration = castToDuration(value); // Duration
1741          return value;
1742        case 91787016: // billingCode
1743          this.getBillingCode().add(castToCodeableConcept(value)); // CodeableConcept
1744          return value;
1745        case 28404907: // billingSummary
1746          this.billingSummary = castToString(value); // StringType
1747          return value;
1748        case -255728369: // scheduleSummary
1749          this.scheduleSummary = castToString(value); // StringType
1750          return value;
1751        case -79871444: // limitationSummary
1752          this.limitationSummary = castToString(value); // StringType
1753          return value;
1754        case 1296867822: // regulatorySummary
1755          this.regulatorySummary = castToString(value); // StringType
1756          return value;
1757        default: return super.setProperty(hash, name, value);
1758        }
1759
1760      }
1761
1762      @Override
1763      public Base setProperty(String name, Base value) throws FHIRException {
1764        if (name.equals("identifier")) {
1765          this.getIdentifier().add(castToIdentifier(value));
1766        } else if (name.equals("name")) {
1767          this.name = castToString(value); // StringType
1768        } else if (name.equals("type")) {
1769          value = new CatalogEntryTypeEnumFactory().fromType(castToCode(value));
1770          this.type = (Enumeration) value; // Enumeration<CatalogEntryType>
1771        } else if (name.equals("status")) {
1772          value = new CatalogEntryStatusEnumFactory().fromType(castToCode(value));
1773          this.status = (Enumeration) value; // Enumeration<CatalogEntryStatus>
1774        } else if (name.equals("effectivePeriod")) {
1775          this.effectivePeriod = castToPeriod(value); // Period
1776        } else if (name.equals("orderable")) {
1777          this.orderable = castToBoolean(value); // BooleanType
1778        } else if (name.equals("referencedItem")) {
1779          this.referencedItem = castToReference(value); // Reference
1780        } else if (name.equals("relatedEntry")) {
1781          this.getRelatedEntry().add((CatalogEntryRelatedEntryComponent) value);
1782        } else if (name.equals("updatedBy")) {
1783          this.updatedBy = castToReference(value); // Reference
1784        } else if (name.equals("note")) {
1785          this.getNote().add(castToAnnotation(value));
1786        } else if (name.equals("estimatedDuration")) {
1787          this.estimatedDuration = castToDuration(value); // Duration
1788        } else if (name.equals("billingCode")) {
1789          this.getBillingCode().add(castToCodeableConcept(value));
1790        } else if (name.equals("billingSummary")) {
1791          this.billingSummary = castToString(value); // StringType
1792        } else if (name.equals("scheduleSummary")) {
1793          this.scheduleSummary = castToString(value); // StringType
1794        } else if (name.equals("limitationSummary")) {
1795          this.limitationSummary = castToString(value); // StringType
1796        } else if (name.equals("regulatorySummary")) {
1797          this.regulatorySummary = castToString(value); // StringType
1798        } else
1799          return super.setProperty(name, value);
1800        return value;
1801      }
1802
1803      @Override
1804      public Base makeProperty(int hash, String name) throws FHIRException {
1805        switch (hash) {
1806        case -1618432855:  return addIdentifier(); 
1807        case 3373707:  return getNameElement();
1808        case 3575610:  return getTypeElement();
1809        case -892481550:  return getStatusElement();
1810        case -403934648:  return getEffectivePeriod();
1811        case -391199320:  return getOrderableElement();
1812        case -1896630996:  return getReferencedItem();
1813        case 130178823:  return addRelatedEntry(); 
1814        case -1949194638:  return getUpdatedBy();
1815        case 3387378:  return addNote(); 
1816        case 1266497008:  return getEstimatedDuration();
1817        case 91787016:  return addBillingCode(); 
1818        case 28404907:  return getBillingSummaryElement();
1819        case -255728369:  return getScheduleSummaryElement();
1820        case -79871444:  return getLimitationSummaryElement();
1821        case 1296867822:  return getRegulatorySummaryElement();
1822        default: return super.makeProperty(hash, name);
1823        }
1824
1825      }
1826
1827      @Override
1828      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1829        switch (hash) {
1830        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1831        case 3373707: /*name*/ return new String[] {"string"};
1832        case 3575610: /*type*/ return new String[] {"code"};
1833        case -892481550: /*status*/ return new String[] {"code"};
1834        case -403934648: /*effectivePeriod*/ return new String[] {"Period"};
1835        case -391199320: /*orderable*/ return new String[] {"boolean"};
1836        case -1896630996: /*referencedItem*/ return new String[] {"Reference"};
1837        case 130178823: /*relatedEntry*/ return new String[] {};
1838        case -1949194638: /*updatedBy*/ return new String[] {"Reference"};
1839        case 3387378: /*note*/ return new String[] {"Annotation"};
1840        case 1266497008: /*estimatedDuration*/ return new String[] {"Duration"};
1841        case 91787016: /*billingCode*/ return new String[] {"CodeableConcept"};
1842        case 28404907: /*billingSummary*/ return new String[] {"string"};
1843        case -255728369: /*scheduleSummary*/ return new String[] {"string"};
1844        case -79871444: /*limitationSummary*/ return new String[] {"string"};
1845        case 1296867822: /*regulatorySummary*/ return new String[] {"string"};
1846        default: return super.getTypesForProperty(hash, name);
1847        }
1848
1849      }
1850
1851      @Override
1852      public Base addChild(String name) throws FHIRException {
1853        if (name.equals("identifier")) {
1854          return addIdentifier();
1855        }
1856        else if (name.equals("name")) {
1857          throw new FHIRException("Cannot call addChild on a primitive type CatalogEntry.name");
1858        }
1859        else if (name.equals("type")) {
1860          throw new FHIRException("Cannot call addChild on a primitive type CatalogEntry.type");
1861        }
1862        else if (name.equals("status")) {
1863          throw new FHIRException("Cannot call addChild on a primitive type CatalogEntry.status");
1864        }
1865        else if (name.equals("effectivePeriod")) {
1866          this.effectivePeriod = new Period();
1867          return this.effectivePeriod;
1868        }
1869        else if (name.equals("orderable")) {
1870          throw new FHIRException("Cannot call addChild on a primitive type CatalogEntry.orderable");
1871        }
1872        else if (name.equals("referencedItem")) {
1873          this.referencedItem = new Reference();
1874          return this.referencedItem;
1875        }
1876        else if (name.equals("relatedEntry")) {
1877          return addRelatedEntry();
1878        }
1879        else if (name.equals("updatedBy")) {
1880          this.updatedBy = new Reference();
1881          return this.updatedBy;
1882        }
1883        else if (name.equals("note")) {
1884          return addNote();
1885        }
1886        else if (name.equals("estimatedDuration")) {
1887          this.estimatedDuration = new Duration();
1888          return this.estimatedDuration;
1889        }
1890        else if (name.equals("billingCode")) {
1891          return addBillingCode();
1892        }
1893        else if (name.equals("billingSummary")) {
1894          throw new FHIRException("Cannot call addChild on a primitive type CatalogEntry.billingSummary");
1895        }
1896        else if (name.equals("scheduleSummary")) {
1897          throw new FHIRException("Cannot call addChild on a primitive type CatalogEntry.scheduleSummary");
1898        }
1899        else if (name.equals("limitationSummary")) {
1900          throw new FHIRException("Cannot call addChild on a primitive type CatalogEntry.limitationSummary");
1901        }
1902        else if (name.equals("regulatorySummary")) {
1903          throw new FHIRException("Cannot call addChild on a primitive type CatalogEntry.regulatorySummary");
1904        }
1905        else
1906          return super.addChild(name);
1907      }
1908
1909  public String fhirType() {
1910    return "CatalogEntry";
1911
1912  }
1913
1914      public CatalogEntry copy() {
1915        CatalogEntry dst = new CatalogEntry();
1916        copyValues(dst);
1917        return dst;
1918      }
1919
1920      public void copyValues(CatalogEntry dst) {
1921        super.copyValues(dst);
1922        if (identifier != null) {
1923          dst.identifier = new ArrayList<Identifier>();
1924          for (Identifier i : identifier)
1925            dst.identifier.add(i.copy());
1926        };
1927        dst.name = name == null ? null : name.copy();
1928        dst.type = type == null ? null : type.copy();
1929        dst.status = status == null ? null : status.copy();
1930        dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy();
1931        dst.orderable = orderable == null ? null : orderable.copy();
1932        dst.referencedItem = referencedItem == null ? null : referencedItem.copy();
1933        if (relatedEntry != null) {
1934          dst.relatedEntry = new ArrayList<CatalogEntryRelatedEntryComponent>();
1935          for (CatalogEntryRelatedEntryComponent i : relatedEntry)
1936            dst.relatedEntry.add(i.copy());
1937        };
1938        dst.updatedBy = updatedBy == null ? null : updatedBy.copy();
1939        if (note != null) {
1940          dst.note = new ArrayList<Annotation>();
1941          for (Annotation i : note)
1942            dst.note.add(i.copy());
1943        };
1944        dst.estimatedDuration = estimatedDuration == null ? null : estimatedDuration.copy();
1945        if (billingCode != null) {
1946          dst.billingCode = new ArrayList<CodeableConcept>();
1947          for (CodeableConcept i : billingCode)
1948            dst.billingCode.add(i.copy());
1949        };
1950        dst.billingSummary = billingSummary == null ? null : billingSummary.copy();
1951        dst.scheduleSummary = scheduleSummary == null ? null : scheduleSummary.copy();
1952        dst.limitationSummary = limitationSummary == null ? null : limitationSummary.copy();
1953        dst.regulatorySummary = regulatorySummary == null ? null : regulatorySummary.copy();
1954      }
1955
1956      protected CatalogEntry typedCopy() {
1957        return copy();
1958      }
1959
1960      @Override
1961      public boolean equalsDeep(Base other_) {
1962        if (!super.equalsDeep(other_))
1963          return false;
1964        if (!(other_ instanceof CatalogEntry))
1965          return false;
1966        CatalogEntry o = (CatalogEntry) other_;
1967        return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(type, o.type, true)
1968           && compareDeep(status, o.status, true) && compareDeep(effectivePeriod, o.effectivePeriod, true)
1969           && compareDeep(orderable, o.orderable, true) && compareDeep(referencedItem, o.referencedItem, true)
1970           && compareDeep(relatedEntry, o.relatedEntry, true) && compareDeep(updatedBy, o.updatedBy, true)
1971           && compareDeep(note, o.note, true) && compareDeep(estimatedDuration, o.estimatedDuration, true)
1972           && compareDeep(billingCode, o.billingCode, true) && compareDeep(billingSummary, o.billingSummary, true)
1973           && compareDeep(scheduleSummary, o.scheduleSummary, true) && compareDeep(limitationSummary, o.limitationSummary, true)
1974           && compareDeep(regulatorySummary, o.regulatorySummary, true);
1975      }
1976
1977      @Override
1978      public boolean equalsShallow(Base other_) {
1979        if (!super.equalsShallow(other_))
1980          return false;
1981        if (!(other_ instanceof CatalogEntry))
1982          return false;
1983        CatalogEntry o = (CatalogEntry) other_;
1984        return compareValues(name, o.name, true) && compareValues(type, o.type, true) && compareValues(status, o.status, true)
1985           && compareValues(orderable, o.orderable, true) && compareValues(billingSummary, o.billingSummary, true)
1986           && compareValues(scheduleSummary, o.scheduleSummary, true) && compareValues(limitationSummary, o.limitationSummary, true)
1987           && compareValues(regulatorySummary, o.regulatorySummary, true);
1988      }
1989
1990      public boolean isEmpty() {
1991        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, name, type, status
1992          , effectivePeriod, orderable, referencedItem, relatedEntry, updatedBy, note, estimatedDuration
1993          , billingCode, billingSummary, scheduleSummary, limitationSummary, regulatorySummary
1994          );
1995      }
1996
1997  @Override
1998  public ResourceType getResourceType() {
1999    return ResourceType.CatalogEntry;
2000   }
2001
2002 /**
2003   * Search parameter: <b>identifier</b>
2004   * <p>
2005   * Description: <b>Business identifier of the catalog entry</b><br>
2006   * Type: <b>token</b><br>
2007   * Path: <b>CatalogEntry.identifier</b><br>
2008   * </p>
2009   */
2010  @SearchParamDefinition(name="identifier", path="CatalogEntry.identifier", description="Business identifier of the catalog entry", type="token" )
2011  public static final String SP_IDENTIFIER = "identifier";
2012 /**
2013   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2014   * <p>
2015   * Description: <b>Business identifier of the catalog entry</b><br>
2016   * Type: <b>token</b><br>
2017   * Path: <b>CatalogEntry.identifier</b><br>
2018   * </p>
2019   */
2020  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2021
2022 /**
2023   * Search parameter: <b>related-entry</b>
2024   * <p>
2025   * Description: <b>The reference to the related entry</b><br>
2026   * Type: <b>reference</b><br>
2027   * Path: <b>CatalogEntry.relatedEntry.target</b><br>
2028   * </p>
2029   */
2030  @SearchParamDefinition(name="related-entry", path="CatalogEntry.relatedEntry.target", description="The reference to the related entry", type="reference", target={CatalogEntry.class } )
2031  public static final String SP_RELATED_ENTRY = "related-entry";
2032 /**
2033   * <b>Fluent Client</b> search parameter constant for <b>related-entry</b>
2034   * <p>
2035   * Description: <b>The reference to the related entry</b><br>
2036   * Type: <b>reference</b><br>
2037   * Path: <b>CatalogEntry.relatedEntry.target</b><br>
2038   * </p>
2039   */
2040  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATED_ENTRY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATED_ENTRY);
2041
2042/**
2043   * Constant for fluent queries to be used to add include statements. Specifies
2044   * the path value of "<b>CatalogEntry:related-entry</b>".
2045   */
2046  public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATED_ENTRY = new ca.uhn.fhir.model.api.Include("CatalogEntry:related-entry").toLocked();
2047
2048 /**
2049   * Search parameter: <b>referenced-item</b>
2050   * <p>
2051   * Description: <b>Item attached to this entry of the catalog</b><br>
2052   * Type: <b>reference</b><br>
2053   * Path: <b>CatalogEntry.referencedItem</b><br>
2054   * </p>
2055   */
2056  @SearchParamDefinition(name="referenced-item", path="CatalogEntry.referencedItem", description="Item attached to this entry of the catalog", type="reference", target={ActivityDefinition.class, DeviceDefinition.class, HealthcareService.class, Location.class, MedicationKnowledge.class, ObservationDefinition.class, Organization.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, SpecimenDefinition.class, Substance.class } )
2057  public static final String SP_REFERENCED_ITEM = "referenced-item";
2058 /**
2059   * <b>Fluent Client</b> search parameter constant for <b>referenced-item</b>
2060   * <p>
2061   * Description: <b>Item attached to this entry of the catalog</b><br>
2062   * Type: <b>reference</b><br>
2063   * Path: <b>CatalogEntry.referencedItem</b><br>
2064   * </p>
2065   */
2066  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REFERENCED_ITEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REFERENCED_ITEM);
2067
2068/**
2069   * Constant for fluent queries to be used to add include statements. Specifies
2070   * the path value of "<b>CatalogEntry:referenced-item</b>".
2071   */
2072  public static final ca.uhn.fhir.model.api.Include INCLUDE_REFERENCED_ITEM = new ca.uhn.fhir.model.api.Include("CatalogEntry:referenced-item").toLocked();
2073
2074 /**
2075   * Search parameter: <b>orderable</b>
2076   * <p>
2077   * Description: <b>Is orderable</b><br>
2078   * Type: <b>token</b><br>
2079   * Path: <b>CatalogEntry.orderable</b><br>
2080   * </p>
2081   */
2082  @SearchParamDefinition(name="orderable", path="CatalogEntry.orderable", description="Is orderable", type="token" )
2083  public static final String SP_ORDERABLE = "orderable";
2084 /**
2085   * <b>Fluent Client</b> search parameter constant for <b>orderable</b>
2086   * <p>
2087   * Description: <b>Is orderable</b><br>
2088   * Type: <b>token</b><br>
2089   * Path: <b>CatalogEntry.orderable</b><br>
2090   * </p>
2091   */
2092  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORDERABLE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORDERABLE);
2093
2094 /**
2095   * Search parameter: <b>name</b>
2096   * <p>
2097   * Description: <b>Displayable name assigned to the catalog entry</b><br>
2098   * Type: <b>string</b><br>
2099   * Path: <b>CatalogEntry.name</b><br>
2100   * </p>
2101   */
2102  @SearchParamDefinition(name="name", path="CatalogEntry.name", description="Displayable name assigned to the catalog entry", type="string" )
2103  public static final String SP_NAME = "name";
2104 /**
2105   * <b>Fluent Client</b> search parameter constant for <b>name</b>
2106   * <p>
2107   * Description: <b>Displayable name assigned to the catalog entry</b><br>
2108   * Type: <b>string</b><br>
2109   * Path: <b>CatalogEntry.name</b><br>
2110   * </p>
2111   */
2112  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
2113
2114 /**
2115   * Search parameter: <b>type</b>
2116   * <p>
2117   * Description: <b>ActivityDefinition | PlanDefinition | SpecimenDefinition | ObservationDefinition | DeviceDefinition | Organization | Practitioner | PractitionerRole | HealthcareService | MedicationKnowledge | Medication | Substance | Location</b><br>
2118   * Type: <b>token</b><br>
2119   * Path: <b>CatalogEntry.type</b><br>
2120   * </p>
2121   */
2122  @SearchParamDefinition(name="type", path="CatalogEntry.type", description="ActivityDefinition | PlanDefinition | SpecimenDefinition | ObservationDefinition | DeviceDefinition | Organization | Practitioner | PractitionerRole | HealthcareService | MedicationKnowledge | Medication | Substance | Location", type="token" )
2123  public static final String SP_TYPE = "type";
2124 /**
2125   * <b>Fluent Client</b> search parameter constant for <b>type</b>
2126   * <p>
2127   * Description: <b>ActivityDefinition | PlanDefinition | SpecimenDefinition | ObservationDefinition | DeviceDefinition | Organization | Practitioner | PractitionerRole | HealthcareService | MedicationKnowledge | Medication | Substance | Location</b><br>
2128   * Type: <b>token</b><br>
2129   * Path: <b>CatalogEntry.type</b><br>
2130   * </p>
2131   */
2132  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
2133
2134 /**
2135   * Search parameter: <b>status</b>
2136   * <p>
2137   * Description: <b>Usability status of this entry in the catalog</b><br>
2138   * Type: <b>token</b><br>
2139   * Path: <b>CatalogEntry.status</b><br>
2140   * </p>
2141   */
2142  @SearchParamDefinition(name="status", path="CatalogEntry.status", description="Usability status of this entry in the catalog", type="token" )
2143  public static final String SP_STATUS = "status";
2144 /**
2145   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2146   * <p>
2147   * Description: <b>Usability status of this entry in the catalog</b><br>
2148   * Type: <b>token</b><br>
2149   * Path: <b>CatalogEntry.status</b><br>
2150   * </p>
2151   */
2152  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2153
2154
2155}
2156