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