001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * A single issue - either an indication, contraindication, interaction or an undesirable effect for a medicinal product, medication, device or procedure.
052 */
053@ResourceDef(name="ClinicalUseDefinition", profile="http://hl7.org/fhir/StructureDefinition/ClinicalUseDefinition")
054public class ClinicalUseDefinition extends DomainResource {
055
056    @Block()
057    public static class ClinicalUseDefinitionContraindicationComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * The situation that is being documented as contraindicating against this item.
060         */
061        @Child(name = "diseaseSymptomProcedure", type = {CodeableReference.class}, order=1, min=0, max=1, modifier=false, summary=true)
062        @Description(shortDefinition="The situation that is being documented as contraindicating against this item", formalDefinition="The situation that is being documented as contraindicating against this item." )
063        protected CodeableReference diseaseSymptomProcedure;
064
065        /**
066         * The status of the disease or symptom for the contraindication.
067         */
068        @Child(name = "diseaseStatus", type = {CodeableReference.class}, order=2, min=0, max=1, modifier=false, summary=true)
069        @Description(shortDefinition="The status of the disease or symptom for the contraindication", formalDefinition="The status of the disease or symptom for the contraindication." )
070        protected CodeableReference diseaseStatus;
071
072        /**
073         * A comorbidity (concurrent condition) or coinfection.
074         */
075        @Child(name = "comorbidity", type = {CodeableReference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
076        @Description(shortDefinition="A comorbidity (concurrent condition) or coinfection", formalDefinition="A comorbidity (concurrent condition) or coinfection." )
077        protected List<CodeableReference> comorbidity;
078
079        /**
080         * The indication which this is a contraidication for.
081         */
082        @Child(name = "indication", type = {ClinicalUseDefinition.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
083        @Description(shortDefinition="The indication which this is a contraidication for", formalDefinition="The indication which this is a contraidication for." )
084        protected List<Reference> indication;
085
086        /**
087         * Information about the use of the medicinal product in relation to other therapies described as part of the contraindication.
088         */
089        @Child(name = "otherTherapy", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
090        @Description(shortDefinition="Information about the use of the medicinal product in relation to other therapies described as part of the contraindication", formalDefinition="Information about the use of the medicinal product in relation to other therapies described as part of the contraindication." )
091        protected List<ClinicalUseDefinitionContraindicationOtherTherapyComponent> otherTherapy;
092
093        private static final long serialVersionUID = 832395863L;
094
095    /**
096     * Constructor
097     */
098      public ClinicalUseDefinitionContraindicationComponent() {
099        super();
100      }
101
102        /**
103         * @return {@link #diseaseSymptomProcedure} (The situation that is being documented as contraindicating against this item.)
104         */
105        public CodeableReference getDiseaseSymptomProcedure() { 
106          if (this.diseaseSymptomProcedure == null)
107            if (Configuration.errorOnAutoCreate())
108              throw new Error("Attempt to auto-create ClinicalUseDefinitionContraindicationComponent.diseaseSymptomProcedure");
109            else if (Configuration.doAutoCreate())
110              this.diseaseSymptomProcedure = new CodeableReference(); // cc
111          return this.diseaseSymptomProcedure;
112        }
113
114        public boolean hasDiseaseSymptomProcedure() { 
115          return this.diseaseSymptomProcedure != null && !this.diseaseSymptomProcedure.isEmpty();
116        }
117
118        /**
119         * @param value {@link #diseaseSymptomProcedure} (The situation that is being documented as contraindicating against this item.)
120         */
121        public ClinicalUseDefinitionContraindicationComponent setDiseaseSymptomProcedure(CodeableReference value) { 
122          this.diseaseSymptomProcedure = value;
123          return this;
124        }
125
126        /**
127         * @return {@link #diseaseStatus} (The status of the disease or symptom for the contraindication.)
128         */
129        public CodeableReference getDiseaseStatus() { 
130          if (this.diseaseStatus == null)
131            if (Configuration.errorOnAutoCreate())
132              throw new Error("Attempt to auto-create ClinicalUseDefinitionContraindicationComponent.diseaseStatus");
133            else if (Configuration.doAutoCreate())
134              this.diseaseStatus = new CodeableReference(); // cc
135          return this.diseaseStatus;
136        }
137
138        public boolean hasDiseaseStatus() { 
139          return this.diseaseStatus != null && !this.diseaseStatus.isEmpty();
140        }
141
142        /**
143         * @param value {@link #diseaseStatus} (The status of the disease or symptom for the contraindication.)
144         */
145        public ClinicalUseDefinitionContraindicationComponent setDiseaseStatus(CodeableReference value) { 
146          this.diseaseStatus = value;
147          return this;
148        }
149
150        /**
151         * @return {@link #comorbidity} (A comorbidity (concurrent condition) or coinfection.)
152         */
153        public List<CodeableReference> getComorbidity() { 
154          if (this.comorbidity == null)
155            this.comorbidity = new ArrayList<CodeableReference>();
156          return this.comorbidity;
157        }
158
159        /**
160         * @return Returns a reference to <code>this</code> for easy method chaining
161         */
162        public ClinicalUseDefinitionContraindicationComponent setComorbidity(List<CodeableReference> theComorbidity) { 
163          this.comorbidity = theComorbidity;
164          return this;
165        }
166
167        public boolean hasComorbidity() { 
168          if (this.comorbidity == null)
169            return false;
170          for (CodeableReference item : this.comorbidity)
171            if (!item.isEmpty())
172              return true;
173          return false;
174        }
175
176        public CodeableReference addComorbidity() { //3
177          CodeableReference t = new CodeableReference();
178          if (this.comorbidity == null)
179            this.comorbidity = new ArrayList<CodeableReference>();
180          this.comorbidity.add(t);
181          return t;
182        }
183
184        public ClinicalUseDefinitionContraindicationComponent addComorbidity(CodeableReference t) { //3
185          if (t == null)
186            return this;
187          if (this.comorbidity == null)
188            this.comorbidity = new ArrayList<CodeableReference>();
189          this.comorbidity.add(t);
190          return this;
191        }
192
193        /**
194         * @return The first repetition of repeating field {@link #comorbidity}, creating it if it does not already exist {3}
195         */
196        public CodeableReference getComorbidityFirstRep() { 
197          if (getComorbidity().isEmpty()) {
198            addComorbidity();
199          }
200          return getComorbidity().get(0);
201        }
202
203        /**
204         * @return {@link #indication} (The indication which this is a contraidication for.)
205         */
206        public List<Reference> getIndication() { 
207          if (this.indication == null)
208            this.indication = new ArrayList<Reference>();
209          return this.indication;
210        }
211
212        /**
213         * @return Returns a reference to <code>this</code> for easy method chaining
214         */
215        public ClinicalUseDefinitionContraindicationComponent setIndication(List<Reference> theIndication) { 
216          this.indication = theIndication;
217          return this;
218        }
219
220        public boolean hasIndication() { 
221          if (this.indication == null)
222            return false;
223          for (Reference item : this.indication)
224            if (!item.isEmpty())
225              return true;
226          return false;
227        }
228
229        public Reference addIndication() { //3
230          Reference t = new Reference();
231          if (this.indication == null)
232            this.indication = new ArrayList<Reference>();
233          this.indication.add(t);
234          return t;
235        }
236
237        public ClinicalUseDefinitionContraindicationComponent addIndication(Reference t) { //3
238          if (t == null)
239            return this;
240          if (this.indication == null)
241            this.indication = new ArrayList<Reference>();
242          this.indication.add(t);
243          return this;
244        }
245
246        /**
247         * @return The first repetition of repeating field {@link #indication}, creating it if it does not already exist {3}
248         */
249        public Reference getIndicationFirstRep() { 
250          if (getIndication().isEmpty()) {
251            addIndication();
252          }
253          return getIndication().get(0);
254        }
255
256        /**
257         * @return {@link #otherTherapy} (Information about the use of the medicinal product in relation to other therapies described as part of the contraindication.)
258         */
259        public List<ClinicalUseDefinitionContraindicationOtherTherapyComponent> getOtherTherapy() { 
260          if (this.otherTherapy == null)
261            this.otherTherapy = new ArrayList<ClinicalUseDefinitionContraindicationOtherTherapyComponent>();
262          return this.otherTherapy;
263        }
264
265        /**
266         * @return Returns a reference to <code>this</code> for easy method chaining
267         */
268        public ClinicalUseDefinitionContraindicationComponent setOtherTherapy(List<ClinicalUseDefinitionContraindicationOtherTherapyComponent> theOtherTherapy) { 
269          this.otherTherapy = theOtherTherapy;
270          return this;
271        }
272
273        public boolean hasOtherTherapy() { 
274          if (this.otherTherapy == null)
275            return false;
276          for (ClinicalUseDefinitionContraindicationOtherTherapyComponent item : this.otherTherapy)
277            if (!item.isEmpty())
278              return true;
279          return false;
280        }
281
282        public ClinicalUseDefinitionContraindicationOtherTherapyComponent addOtherTherapy() { //3
283          ClinicalUseDefinitionContraindicationOtherTherapyComponent t = new ClinicalUseDefinitionContraindicationOtherTherapyComponent();
284          if (this.otherTherapy == null)
285            this.otherTherapy = new ArrayList<ClinicalUseDefinitionContraindicationOtherTherapyComponent>();
286          this.otherTherapy.add(t);
287          return t;
288        }
289
290        public ClinicalUseDefinitionContraindicationComponent addOtherTherapy(ClinicalUseDefinitionContraindicationOtherTherapyComponent t) { //3
291          if (t == null)
292            return this;
293          if (this.otherTherapy == null)
294            this.otherTherapy = new ArrayList<ClinicalUseDefinitionContraindicationOtherTherapyComponent>();
295          this.otherTherapy.add(t);
296          return this;
297        }
298
299        /**
300         * @return The first repetition of repeating field {@link #otherTherapy}, creating it if it does not already exist {3}
301         */
302        public ClinicalUseDefinitionContraindicationOtherTherapyComponent getOtherTherapyFirstRep() { 
303          if (getOtherTherapy().isEmpty()) {
304            addOtherTherapy();
305          }
306          return getOtherTherapy().get(0);
307        }
308
309        protected void listChildren(List<Property> children) {
310          super.listChildren(children);
311          children.add(new Property("diseaseSymptomProcedure", "CodeableReference(ObservationDefinition)", "The situation that is being documented as contraindicating against this item.", 0, 1, diseaseSymptomProcedure));
312          children.add(new Property("diseaseStatus", "CodeableReference(ObservationDefinition)", "The status of the disease or symptom for the contraindication.", 0, 1, diseaseStatus));
313          children.add(new Property("comorbidity", "CodeableReference(ObservationDefinition)", "A comorbidity (concurrent condition) or coinfection.", 0, java.lang.Integer.MAX_VALUE, comorbidity));
314          children.add(new Property("indication", "Reference(ClinicalUseDefinition)", "The indication which this is a contraidication for.", 0, java.lang.Integer.MAX_VALUE, indication));
315          children.add(new Property("otherTherapy", "", "Information about the use of the medicinal product in relation to other therapies described as part of the contraindication.", 0, java.lang.Integer.MAX_VALUE, otherTherapy));
316        }
317
318        @Override
319        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
320          switch (_hash) {
321          case -1497395130: /*diseaseSymptomProcedure*/  return new Property("diseaseSymptomProcedure", "CodeableReference(ObservationDefinition)", "The situation that is being documented as contraindicating against this item.", 0, 1, diseaseSymptomProcedure);
322          case -505503602: /*diseaseStatus*/  return new Property("diseaseStatus", "CodeableReference(ObservationDefinition)", "The status of the disease or symptom for the contraindication.", 0, 1, diseaseStatus);
323          case -406395211: /*comorbidity*/  return new Property("comorbidity", "CodeableReference(ObservationDefinition)", "A comorbidity (concurrent condition) or coinfection.", 0, java.lang.Integer.MAX_VALUE, comorbidity);
324          case -597168804: /*indication*/  return new Property("indication", "Reference(ClinicalUseDefinition)", "The indication which this is a contraidication for.", 0, java.lang.Integer.MAX_VALUE, indication);
325          case -544509127: /*otherTherapy*/  return new Property("otherTherapy", "", "Information about the use of the medicinal product in relation to other therapies described as part of the contraindication.", 0, java.lang.Integer.MAX_VALUE, otherTherapy);
326          default: return super.getNamedProperty(_hash, _name, _checkValid);
327          }
328
329        }
330
331      @Override
332      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
333        switch (hash) {
334        case -1497395130: /*diseaseSymptomProcedure*/ return this.diseaseSymptomProcedure == null ? new Base[0] : new Base[] {this.diseaseSymptomProcedure}; // CodeableReference
335        case -505503602: /*diseaseStatus*/ return this.diseaseStatus == null ? new Base[0] : new Base[] {this.diseaseStatus}; // CodeableReference
336        case -406395211: /*comorbidity*/ return this.comorbidity == null ? new Base[0] : this.comorbidity.toArray(new Base[this.comorbidity.size()]); // CodeableReference
337        case -597168804: /*indication*/ return this.indication == null ? new Base[0] : this.indication.toArray(new Base[this.indication.size()]); // Reference
338        case -544509127: /*otherTherapy*/ return this.otherTherapy == null ? new Base[0] : this.otherTherapy.toArray(new Base[this.otherTherapy.size()]); // ClinicalUseDefinitionContraindicationOtherTherapyComponent
339        default: return super.getProperty(hash, name, checkValid);
340        }
341
342      }
343
344      @Override
345      public Base setProperty(int hash, String name, Base value) throws FHIRException {
346        switch (hash) {
347        case -1497395130: // diseaseSymptomProcedure
348          this.diseaseSymptomProcedure = TypeConvertor.castToCodeableReference(value); // CodeableReference
349          return value;
350        case -505503602: // diseaseStatus
351          this.diseaseStatus = TypeConvertor.castToCodeableReference(value); // CodeableReference
352          return value;
353        case -406395211: // comorbidity
354          this.getComorbidity().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
355          return value;
356        case -597168804: // indication
357          this.getIndication().add(TypeConvertor.castToReference(value)); // Reference
358          return value;
359        case -544509127: // otherTherapy
360          this.getOtherTherapy().add((ClinicalUseDefinitionContraindicationOtherTherapyComponent) value); // ClinicalUseDefinitionContraindicationOtherTherapyComponent
361          return value;
362        default: return super.setProperty(hash, name, value);
363        }
364
365      }
366
367      @Override
368      public Base setProperty(String name, Base value) throws FHIRException {
369        if (name.equals("diseaseSymptomProcedure")) {
370          this.diseaseSymptomProcedure = TypeConvertor.castToCodeableReference(value); // CodeableReference
371        } else if (name.equals("diseaseStatus")) {
372          this.diseaseStatus = TypeConvertor.castToCodeableReference(value); // CodeableReference
373        } else if (name.equals("comorbidity")) {
374          this.getComorbidity().add(TypeConvertor.castToCodeableReference(value));
375        } else if (name.equals("indication")) {
376          this.getIndication().add(TypeConvertor.castToReference(value));
377        } else if (name.equals("otherTherapy")) {
378          this.getOtherTherapy().add((ClinicalUseDefinitionContraindicationOtherTherapyComponent) value);
379        } else
380          return super.setProperty(name, value);
381        return value;
382      }
383
384      @Override
385      public Base makeProperty(int hash, String name) throws FHIRException {
386        switch (hash) {
387        case -1497395130:  return getDiseaseSymptomProcedure();
388        case -505503602:  return getDiseaseStatus();
389        case -406395211:  return addComorbidity(); 
390        case -597168804:  return addIndication(); 
391        case -544509127:  return addOtherTherapy(); 
392        default: return super.makeProperty(hash, name);
393        }
394
395      }
396
397      @Override
398      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
399        switch (hash) {
400        case -1497395130: /*diseaseSymptomProcedure*/ return new String[] {"CodeableReference"};
401        case -505503602: /*diseaseStatus*/ return new String[] {"CodeableReference"};
402        case -406395211: /*comorbidity*/ return new String[] {"CodeableReference"};
403        case -597168804: /*indication*/ return new String[] {"Reference"};
404        case -544509127: /*otherTherapy*/ return new String[] {};
405        default: return super.getTypesForProperty(hash, name);
406        }
407
408      }
409
410      @Override
411      public Base addChild(String name) throws FHIRException {
412        if (name.equals("diseaseSymptomProcedure")) {
413          this.diseaseSymptomProcedure = new CodeableReference();
414          return this.diseaseSymptomProcedure;
415        }
416        else if (name.equals("diseaseStatus")) {
417          this.diseaseStatus = new CodeableReference();
418          return this.diseaseStatus;
419        }
420        else if (name.equals("comorbidity")) {
421          return addComorbidity();
422        }
423        else if (name.equals("indication")) {
424          return addIndication();
425        }
426        else if (name.equals("otherTherapy")) {
427          return addOtherTherapy();
428        }
429        else
430          return super.addChild(name);
431      }
432
433      public ClinicalUseDefinitionContraindicationComponent copy() {
434        ClinicalUseDefinitionContraindicationComponent dst = new ClinicalUseDefinitionContraindicationComponent();
435        copyValues(dst);
436        return dst;
437      }
438
439      public void copyValues(ClinicalUseDefinitionContraindicationComponent dst) {
440        super.copyValues(dst);
441        dst.diseaseSymptomProcedure = diseaseSymptomProcedure == null ? null : diseaseSymptomProcedure.copy();
442        dst.diseaseStatus = diseaseStatus == null ? null : diseaseStatus.copy();
443        if (comorbidity != null) {
444          dst.comorbidity = new ArrayList<CodeableReference>();
445          for (CodeableReference i : comorbidity)
446            dst.comorbidity.add(i.copy());
447        };
448        if (indication != null) {
449          dst.indication = new ArrayList<Reference>();
450          for (Reference i : indication)
451            dst.indication.add(i.copy());
452        };
453        if (otherTherapy != null) {
454          dst.otherTherapy = new ArrayList<ClinicalUseDefinitionContraindicationOtherTherapyComponent>();
455          for (ClinicalUseDefinitionContraindicationOtherTherapyComponent i : otherTherapy)
456            dst.otherTherapy.add(i.copy());
457        };
458      }
459
460      @Override
461      public boolean equalsDeep(Base other_) {
462        if (!super.equalsDeep(other_))
463          return false;
464        if (!(other_ instanceof ClinicalUseDefinitionContraindicationComponent))
465          return false;
466        ClinicalUseDefinitionContraindicationComponent o = (ClinicalUseDefinitionContraindicationComponent) other_;
467        return compareDeep(diseaseSymptomProcedure, o.diseaseSymptomProcedure, true) && compareDeep(diseaseStatus, o.diseaseStatus, true)
468           && compareDeep(comorbidity, o.comorbidity, true) && compareDeep(indication, o.indication, true)
469           && compareDeep(otherTherapy, o.otherTherapy, true);
470      }
471
472      @Override
473      public boolean equalsShallow(Base other_) {
474        if (!super.equalsShallow(other_))
475          return false;
476        if (!(other_ instanceof ClinicalUseDefinitionContraindicationComponent))
477          return false;
478        ClinicalUseDefinitionContraindicationComponent o = (ClinicalUseDefinitionContraindicationComponent) other_;
479        return true;
480      }
481
482      public boolean isEmpty() {
483        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(diseaseSymptomProcedure, diseaseStatus
484          , comorbidity, indication, otherTherapy);
485      }
486
487  public String fhirType() {
488    return "ClinicalUseDefinition.contraindication";
489
490  }
491
492  }
493
494    @Block()
495    public static class ClinicalUseDefinitionContraindicationOtherTherapyComponent extends BackboneElement implements IBaseBackboneElement {
496        /**
497         * The type of relationship between the medicinal product indication or contraindication and another therapy.
498         */
499        @Child(name = "relationshipType", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
500        @Description(shortDefinition="The type of relationship between the medicinal product indication or contraindication and another therapy", formalDefinition="The type of relationship between the medicinal product indication or contraindication and another therapy." )
501        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/therapy-relationship-type")
502        protected CodeableConcept relationshipType;
503
504        /**
505         * Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.
506         */
507        @Child(name = "therapy", type = {CodeableReference.class}, order=2, min=1, max=1, modifier=false, summary=true)
508        @Description(shortDefinition="Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication", formalDefinition="Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication." )
509        protected CodeableReference therapy;
510
511        private static final long serialVersionUID = -363440718L;
512
513    /**
514     * Constructor
515     */
516      public ClinicalUseDefinitionContraindicationOtherTherapyComponent() {
517        super();
518      }
519
520    /**
521     * Constructor
522     */
523      public ClinicalUseDefinitionContraindicationOtherTherapyComponent(CodeableConcept relationshipType, CodeableReference therapy) {
524        super();
525        this.setRelationshipType(relationshipType);
526        this.setTherapy(therapy);
527      }
528
529        /**
530         * @return {@link #relationshipType} (The type of relationship between the medicinal product indication or contraindication and another therapy.)
531         */
532        public CodeableConcept getRelationshipType() { 
533          if (this.relationshipType == null)
534            if (Configuration.errorOnAutoCreate())
535              throw new Error("Attempt to auto-create ClinicalUseDefinitionContraindicationOtherTherapyComponent.relationshipType");
536            else if (Configuration.doAutoCreate())
537              this.relationshipType = new CodeableConcept(); // cc
538          return this.relationshipType;
539        }
540
541        public boolean hasRelationshipType() { 
542          return this.relationshipType != null && !this.relationshipType.isEmpty();
543        }
544
545        /**
546         * @param value {@link #relationshipType} (The type of relationship between the medicinal product indication or contraindication and another therapy.)
547         */
548        public ClinicalUseDefinitionContraindicationOtherTherapyComponent setRelationshipType(CodeableConcept value) { 
549          this.relationshipType = value;
550          return this;
551        }
552
553        /**
554         * @return {@link #therapy} (Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.)
555         */
556        public CodeableReference getTherapy() { 
557          if (this.therapy == null)
558            if (Configuration.errorOnAutoCreate())
559              throw new Error("Attempt to auto-create ClinicalUseDefinitionContraindicationOtherTherapyComponent.therapy");
560            else if (Configuration.doAutoCreate())
561              this.therapy = new CodeableReference(); // cc
562          return this.therapy;
563        }
564
565        public boolean hasTherapy() { 
566          return this.therapy != null && !this.therapy.isEmpty();
567        }
568
569        /**
570         * @param value {@link #therapy} (Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.)
571         */
572        public ClinicalUseDefinitionContraindicationOtherTherapyComponent setTherapy(CodeableReference value) { 
573          this.therapy = value;
574          return this;
575        }
576
577        protected void listChildren(List<Property> children) {
578          super.listChildren(children);
579          children.add(new Property("relationshipType", "CodeableConcept", "The type of relationship between the medicinal product indication or contraindication and another therapy.", 0, 1, relationshipType));
580          children.add(new Property("therapy", "CodeableReference(MedicinalProductDefinition|Medication|Substance|SubstanceDefinition|ActivityDefinition)", "Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.", 0, 1, therapy));
581        }
582
583        @Override
584        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
585          switch (_hash) {
586          case -1602839150: /*relationshipType*/  return new Property("relationshipType", "CodeableConcept", "The type of relationship between the medicinal product indication or contraindication and another therapy.", 0, 1, relationshipType);
587          case -1349555095: /*therapy*/  return new Property("therapy", "CodeableReference(MedicinalProductDefinition|Medication|Substance|SubstanceDefinition|ActivityDefinition)", "Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.", 0, 1, therapy);
588          default: return super.getNamedProperty(_hash, _name, _checkValid);
589          }
590
591        }
592
593      @Override
594      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
595        switch (hash) {
596        case -1602839150: /*relationshipType*/ return this.relationshipType == null ? new Base[0] : new Base[] {this.relationshipType}; // CodeableConcept
597        case -1349555095: /*therapy*/ return this.therapy == null ? new Base[0] : new Base[] {this.therapy}; // CodeableReference
598        default: return super.getProperty(hash, name, checkValid);
599        }
600
601      }
602
603      @Override
604      public Base setProperty(int hash, String name, Base value) throws FHIRException {
605        switch (hash) {
606        case -1602839150: // relationshipType
607          this.relationshipType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
608          return value;
609        case -1349555095: // therapy
610          this.therapy = TypeConvertor.castToCodeableReference(value); // CodeableReference
611          return value;
612        default: return super.setProperty(hash, name, value);
613        }
614
615      }
616
617      @Override
618      public Base setProperty(String name, Base value) throws FHIRException {
619        if (name.equals("relationshipType")) {
620          this.relationshipType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
621        } else if (name.equals("therapy")) {
622          this.therapy = TypeConvertor.castToCodeableReference(value); // CodeableReference
623        } else
624          return super.setProperty(name, value);
625        return value;
626      }
627
628      @Override
629      public Base makeProperty(int hash, String name) throws FHIRException {
630        switch (hash) {
631        case -1602839150:  return getRelationshipType();
632        case -1349555095:  return getTherapy();
633        default: return super.makeProperty(hash, name);
634        }
635
636      }
637
638      @Override
639      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
640        switch (hash) {
641        case -1602839150: /*relationshipType*/ return new String[] {"CodeableConcept"};
642        case -1349555095: /*therapy*/ return new String[] {"CodeableReference"};
643        default: return super.getTypesForProperty(hash, name);
644        }
645
646      }
647
648      @Override
649      public Base addChild(String name) throws FHIRException {
650        if (name.equals("relationshipType")) {
651          this.relationshipType = new CodeableConcept();
652          return this.relationshipType;
653        }
654        else if (name.equals("therapy")) {
655          this.therapy = new CodeableReference();
656          return this.therapy;
657        }
658        else
659          return super.addChild(name);
660      }
661
662      public ClinicalUseDefinitionContraindicationOtherTherapyComponent copy() {
663        ClinicalUseDefinitionContraindicationOtherTherapyComponent dst = new ClinicalUseDefinitionContraindicationOtherTherapyComponent();
664        copyValues(dst);
665        return dst;
666      }
667
668      public void copyValues(ClinicalUseDefinitionContraindicationOtherTherapyComponent dst) {
669        super.copyValues(dst);
670        dst.relationshipType = relationshipType == null ? null : relationshipType.copy();
671        dst.therapy = therapy == null ? null : therapy.copy();
672      }
673
674      @Override
675      public boolean equalsDeep(Base other_) {
676        if (!super.equalsDeep(other_))
677          return false;
678        if (!(other_ instanceof ClinicalUseDefinitionContraindicationOtherTherapyComponent))
679          return false;
680        ClinicalUseDefinitionContraindicationOtherTherapyComponent o = (ClinicalUseDefinitionContraindicationOtherTherapyComponent) other_;
681        return compareDeep(relationshipType, o.relationshipType, true) && compareDeep(therapy, o.therapy, true)
682          ;
683      }
684
685      @Override
686      public boolean equalsShallow(Base other_) {
687        if (!super.equalsShallow(other_))
688          return false;
689        if (!(other_ instanceof ClinicalUseDefinitionContraindicationOtherTherapyComponent))
690          return false;
691        ClinicalUseDefinitionContraindicationOtherTherapyComponent o = (ClinicalUseDefinitionContraindicationOtherTherapyComponent) other_;
692        return true;
693      }
694
695      public boolean isEmpty() {
696        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(relationshipType, therapy
697          );
698      }
699
700  public String fhirType() {
701    return "ClinicalUseDefinition.contraindication.otherTherapy";
702
703  }
704
705  }
706
707    @Block()
708    public static class ClinicalUseDefinitionIndicationComponent extends BackboneElement implements IBaseBackboneElement {
709        /**
710         * The situation that is being documented as an indicaton for this item.
711         */
712        @Child(name = "diseaseSymptomProcedure", type = {CodeableReference.class}, order=1, min=0, max=1, modifier=false, summary=true)
713        @Description(shortDefinition="The situation that is being documented as an indicaton for this item", formalDefinition="The situation that is being documented as an indicaton for this item." )
714        protected CodeableReference diseaseSymptomProcedure;
715
716        /**
717         * The status of the disease or symptom for the indication.
718         */
719        @Child(name = "diseaseStatus", type = {CodeableReference.class}, order=2, min=0, max=1, modifier=false, summary=true)
720        @Description(shortDefinition="The status of the disease or symptom for the indication", formalDefinition="The status of the disease or symptom for the indication." )
721        protected CodeableReference diseaseStatus;
722
723        /**
724         * A comorbidity (concurrent condition) or coinfection as part of the indication.
725         */
726        @Child(name = "comorbidity", type = {CodeableReference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
727        @Description(shortDefinition="A comorbidity (concurrent condition) or coinfection as part of the indication", formalDefinition="A comorbidity (concurrent condition) or coinfection as part of the indication." )
728        protected List<CodeableReference> comorbidity;
729
730        /**
731         * The intended effect, aim or strategy to be achieved.
732         */
733        @Child(name = "intendedEffect", type = {CodeableReference.class}, order=4, min=0, max=1, modifier=false, summary=true)
734        @Description(shortDefinition="The intended effect, aim or strategy to be achieved", formalDefinition="The intended effect, aim or strategy to be achieved." )
735        protected CodeableReference intendedEffect;
736
737        /**
738         * Timing or duration information.
739         */
740        @Child(name = "duration", type = {Quantity.class}, order=5, min=0, max=1, modifier=false, summary=true)
741        @Description(shortDefinition="Timing or duration information", formalDefinition="Timing or duration information." )
742        protected Quantity duration;
743
744        /**
745         * The specific undesirable effects of the medicinal product.
746         */
747        @Child(name = "undesirableEffect", type = {ClinicalUseDefinition.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
748        @Description(shortDefinition="The specific undesirable effects of the medicinal product", formalDefinition="The specific undesirable effects of the medicinal product." )
749        protected List<Reference> undesirableEffect;
750
751        /**
752         * Information about the use of the medicinal product in relation to other therapies described as part of the indication.
753         */
754        @Child(name = "otherTherapy", type = {ClinicalUseDefinitionContraindicationOtherTherapyComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
755        @Description(shortDefinition="Information about the use of the medicinal product in relation to other therapies described as part of the indication", formalDefinition="Information about the use of the medicinal product in relation to other therapies described as part of the indication." )
756        protected List<ClinicalUseDefinitionContraindicationOtherTherapyComponent> otherTherapy;
757
758        private static final long serialVersionUID = 1882904823L;
759
760    /**
761     * Constructor
762     */
763      public ClinicalUseDefinitionIndicationComponent() {
764        super();
765      }
766
767        /**
768         * @return {@link #diseaseSymptomProcedure} (The situation that is being documented as an indicaton for this item.)
769         */
770        public CodeableReference getDiseaseSymptomProcedure() { 
771          if (this.diseaseSymptomProcedure == null)
772            if (Configuration.errorOnAutoCreate())
773              throw new Error("Attempt to auto-create ClinicalUseDefinitionIndicationComponent.diseaseSymptomProcedure");
774            else if (Configuration.doAutoCreate())
775              this.diseaseSymptomProcedure = new CodeableReference(); // cc
776          return this.diseaseSymptomProcedure;
777        }
778
779        public boolean hasDiseaseSymptomProcedure() { 
780          return this.diseaseSymptomProcedure != null && !this.diseaseSymptomProcedure.isEmpty();
781        }
782
783        /**
784         * @param value {@link #diseaseSymptomProcedure} (The situation that is being documented as an indicaton for this item.)
785         */
786        public ClinicalUseDefinitionIndicationComponent setDiseaseSymptomProcedure(CodeableReference value) { 
787          this.diseaseSymptomProcedure = value;
788          return this;
789        }
790
791        /**
792         * @return {@link #diseaseStatus} (The status of the disease or symptom for the indication.)
793         */
794        public CodeableReference getDiseaseStatus() { 
795          if (this.diseaseStatus == null)
796            if (Configuration.errorOnAutoCreate())
797              throw new Error("Attempt to auto-create ClinicalUseDefinitionIndicationComponent.diseaseStatus");
798            else if (Configuration.doAutoCreate())
799              this.diseaseStatus = new CodeableReference(); // cc
800          return this.diseaseStatus;
801        }
802
803        public boolean hasDiseaseStatus() { 
804          return this.diseaseStatus != null && !this.diseaseStatus.isEmpty();
805        }
806
807        /**
808         * @param value {@link #diseaseStatus} (The status of the disease or symptom for the indication.)
809         */
810        public ClinicalUseDefinitionIndicationComponent setDiseaseStatus(CodeableReference value) { 
811          this.diseaseStatus = value;
812          return this;
813        }
814
815        /**
816         * @return {@link #comorbidity} (A comorbidity (concurrent condition) or coinfection as part of the indication.)
817         */
818        public List<CodeableReference> getComorbidity() { 
819          if (this.comorbidity == null)
820            this.comorbidity = new ArrayList<CodeableReference>();
821          return this.comorbidity;
822        }
823
824        /**
825         * @return Returns a reference to <code>this</code> for easy method chaining
826         */
827        public ClinicalUseDefinitionIndicationComponent setComorbidity(List<CodeableReference> theComorbidity) { 
828          this.comorbidity = theComorbidity;
829          return this;
830        }
831
832        public boolean hasComorbidity() { 
833          if (this.comorbidity == null)
834            return false;
835          for (CodeableReference item : this.comorbidity)
836            if (!item.isEmpty())
837              return true;
838          return false;
839        }
840
841        public CodeableReference addComorbidity() { //3
842          CodeableReference t = new CodeableReference();
843          if (this.comorbidity == null)
844            this.comorbidity = new ArrayList<CodeableReference>();
845          this.comorbidity.add(t);
846          return t;
847        }
848
849        public ClinicalUseDefinitionIndicationComponent addComorbidity(CodeableReference t) { //3
850          if (t == null)
851            return this;
852          if (this.comorbidity == null)
853            this.comorbidity = new ArrayList<CodeableReference>();
854          this.comorbidity.add(t);
855          return this;
856        }
857
858        /**
859         * @return The first repetition of repeating field {@link #comorbidity}, creating it if it does not already exist {3}
860         */
861        public CodeableReference getComorbidityFirstRep() { 
862          if (getComorbidity().isEmpty()) {
863            addComorbidity();
864          }
865          return getComorbidity().get(0);
866        }
867
868        /**
869         * @return {@link #intendedEffect} (The intended effect, aim or strategy to be achieved.)
870         */
871        public CodeableReference getIntendedEffect() { 
872          if (this.intendedEffect == null)
873            if (Configuration.errorOnAutoCreate())
874              throw new Error("Attempt to auto-create ClinicalUseDefinitionIndicationComponent.intendedEffect");
875            else if (Configuration.doAutoCreate())
876              this.intendedEffect = new CodeableReference(); // cc
877          return this.intendedEffect;
878        }
879
880        public boolean hasIntendedEffect() { 
881          return this.intendedEffect != null && !this.intendedEffect.isEmpty();
882        }
883
884        /**
885         * @param value {@link #intendedEffect} (The intended effect, aim or strategy to be achieved.)
886         */
887        public ClinicalUseDefinitionIndicationComponent setIntendedEffect(CodeableReference value) { 
888          this.intendedEffect = value;
889          return this;
890        }
891
892        /**
893         * @return {@link #duration} (Timing or duration information.)
894         */
895        public Quantity getDuration() { 
896          if (this.duration == null)
897            if (Configuration.errorOnAutoCreate())
898              throw new Error("Attempt to auto-create ClinicalUseDefinitionIndicationComponent.duration");
899            else if (Configuration.doAutoCreate())
900              this.duration = new Quantity(); // cc
901          return this.duration;
902        }
903
904        public boolean hasDuration() { 
905          return this.duration != null && !this.duration.isEmpty();
906        }
907
908        /**
909         * @param value {@link #duration} (Timing or duration information.)
910         */
911        public ClinicalUseDefinitionIndicationComponent setDuration(Quantity value) { 
912          this.duration = value;
913          return this;
914        }
915
916        /**
917         * @return {@link #undesirableEffect} (The specific undesirable effects of the medicinal product.)
918         */
919        public List<Reference> getUndesirableEffect() { 
920          if (this.undesirableEffect == null)
921            this.undesirableEffect = new ArrayList<Reference>();
922          return this.undesirableEffect;
923        }
924
925        /**
926         * @return Returns a reference to <code>this</code> for easy method chaining
927         */
928        public ClinicalUseDefinitionIndicationComponent setUndesirableEffect(List<Reference> theUndesirableEffect) { 
929          this.undesirableEffect = theUndesirableEffect;
930          return this;
931        }
932
933        public boolean hasUndesirableEffect() { 
934          if (this.undesirableEffect == null)
935            return false;
936          for (Reference item : this.undesirableEffect)
937            if (!item.isEmpty())
938              return true;
939          return false;
940        }
941
942        public Reference addUndesirableEffect() { //3
943          Reference t = new Reference();
944          if (this.undesirableEffect == null)
945            this.undesirableEffect = new ArrayList<Reference>();
946          this.undesirableEffect.add(t);
947          return t;
948        }
949
950        public ClinicalUseDefinitionIndicationComponent addUndesirableEffect(Reference t) { //3
951          if (t == null)
952            return this;
953          if (this.undesirableEffect == null)
954            this.undesirableEffect = new ArrayList<Reference>();
955          this.undesirableEffect.add(t);
956          return this;
957        }
958
959        /**
960         * @return The first repetition of repeating field {@link #undesirableEffect}, creating it if it does not already exist {3}
961         */
962        public Reference getUndesirableEffectFirstRep() { 
963          if (getUndesirableEffect().isEmpty()) {
964            addUndesirableEffect();
965          }
966          return getUndesirableEffect().get(0);
967        }
968
969        /**
970         * @return {@link #otherTherapy} (Information about the use of the medicinal product in relation to other therapies described as part of the indication.)
971         */
972        public List<ClinicalUseDefinitionContraindicationOtherTherapyComponent> getOtherTherapy() { 
973          if (this.otherTherapy == null)
974            this.otherTherapy = new ArrayList<ClinicalUseDefinitionContraindicationOtherTherapyComponent>();
975          return this.otherTherapy;
976        }
977
978        /**
979         * @return Returns a reference to <code>this</code> for easy method chaining
980         */
981        public ClinicalUseDefinitionIndicationComponent setOtherTherapy(List<ClinicalUseDefinitionContraindicationOtherTherapyComponent> theOtherTherapy) { 
982          this.otherTherapy = theOtherTherapy;
983          return this;
984        }
985
986        public boolean hasOtherTherapy() { 
987          if (this.otherTherapy == null)
988            return false;
989          for (ClinicalUseDefinitionContraindicationOtherTherapyComponent item : this.otherTherapy)
990            if (!item.isEmpty())
991              return true;
992          return false;
993        }
994
995        public ClinicalUseDefinitionContraindicationOtherTherapyComponent addOtherTherapy() { //3
996          ClinicalUseDefinitionContraindicationOtherTherapyComponent t = new ClinicalUseDefinitionContraindicationOtherTherapyComponent();
997          if (this.otherTherapy == null)
998            this.otherTherapy = new ArrayList<ClinicalUseDefinitionContraindicationOtherTherapyComponent>();
999          this.otherTherapy.add(t);
1000          return t;
1001        }
1002
1003        public ClinicalUseDefinitionIndicationComponent addOtherTherapy(ClinicalUseDefinitionContraindicationOtherTherapyComponent t) { //3
1004          if (t == null)
1005            return this;
1006          if (this.otherTherapy == null)
1007            this.otherTherapy = new ArrayList<ClinicalUseDefinitionContraindicationOtherTherapyComponent>();
1008          this.otherTherapy.add(t);
1009          return this;
1010        }
1011
1012        /**
1013         * @return The first repetition of repeating field {@link #otherTherapy}, creating it if it does not already exist {3}
1014         */
1015        public ClinicalUseDefinitionContraindicationOtherTherapyComponent getOtherTherapyFirstRep() { 
1016          if (getOtherTherapy().isEmpty()) {
1017            addOtherTherapy();
1018          }
1019          return getOtherTherapy().get(0);
1020        }
1021
1022        protected void listChildren(List<Property> children) {
1023          super.listChildren(children);
1024          children.add(new Property("diseaseSymptomProcedure", "CodeableReference(ObservationDefinition)", "The situation that is being documented as an indicaton for this item.", 0, 1, diseaseSymptomProcedure));
1025          children.add(new Property("diseaseStatus", "CodeableReference(ObservationDefinition)", "The status of the disease or symptom for the indication.", 0, 1, diseaseStatus));
1026          children.add(new Property("comorbidity", "CodeableReference(ObservationDefinition)", "A comorbidity (concurrent condition) or coinfection as part of the indication.", 0, java.lang.Integer.MAX_VALUE, comorbidity));
1027          children.add(new Property("intendedEffect", "CodeableReference(ObservationDefinition)", "The intended effect, aim or strategy to be achieved.", 0, 1, intendedEffect));
1028          children.add(new Property("duration", "Quantity", "Timing or duration information.", 0, 1, duration));
1029          children.add(new Property("undesirableEffect", "Reference(ClinicalUseDefinition)", "The specific undesirable effects of the medicinal product.", 0, java.lang.Integer.MAX_VALUE, undesirableEffect));
1030          children.add(new Property("otherTherapy", "@ClinicalUseDefinition.contraindication.otherTherapy", "Information about the use of the medicinal product in relation to other therapies described as part of the indication.", 0, java.lang.Integer.MAX_VALUE, otherTherapy));
1031        }
1032
1033        @Override
1034        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1035          switch (_hash) {
1036          case -1497395130: /*diseaseSymptomProcedure*/  return new Property("diseaseSymptomProcedure", "CodeableReference(ObservationDefinition)", "The situation that is being documented as an indicaton for this item.", 0, 1, diseaseSymptomProcedure);
1037          case -505503602: /*diseaseStatus*/  return new Property("diseaseStatus", "CodeableReference(ObservationDefinition)", "The status of the disease or symptom for the indication.", 0, 1, diseaseStatus);
1038          case -406395211: /*comorbidity*/  return new Property("comorbidity", "CodeableReference(ObservationDefinition)", "A comorbidity (concurrent condition) or coinfection as part of the indication.", 0, java.lang.Integer.MAX_VALUE, comorbidity);
1039          case 1587112348: /*intendedEffect*/  return new Property("intendedEffect", "CodeableReference(ObservationDefinition)", "The intended effect, aim or strategy to be achieved.", 0, 1, intendedEffect);
1040          case -1992012396: /*duration*/  return new Property("duration", "Quantity", "Timing or duration information.", 0, 1, duration);
1041          case 444367565: /*undesirableEffect*/  return new Property("undesirableEffect", "Reference(ClinicalUseDefinition)", "The specific undesirable effects of the medicinal product.", 0, java.lang.Integer.MAX_VALUE, undesirableEffect);
1042          case -544509127: /*otherTherapy*/  return new Property("otherTherapy", "@ClinicalUseDefinition.contraindication.otherTherapy", "Information about the use of the medicinal product in relation to other therapies described as part of the indication.", 0, java.lang.Integer.MAX_VALUE, otherTherapy);
1043          default: return super.getNamedProperty(_hash, _name, _checkValid);
1044          }
1045
1046        }
1047
1048      @Override
1049      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1050        switch (hash) {
1051        case -1497395130: /*diseaseSymptomProcedure*/ return this.diseaseSymptomProcedure == null ? new Base[0] : new Base[] {this.diseaseSymptomProcedure}; // CodeableReference
1052        case -505503602: /*diseaseStatus*/ return this.diseaseStatus == null ? new Base[0] : new Base[] {this.diseaseStatus}; // CodeableReference
1053        case -406395211: /*comorbidity*/ return this.comorbidity == null ? new Base[0] : this.comorbidity.toArray(new Base[this.comorbidity.size()]); // CodeableReference
1054        case 1587112348: /*intendedEffect*/ return this.intendedEffect == null ? new Base[0] : new Base[] {this.intendedEffect}; // CodeableReference
1055        case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // Quantity
1056        case 444367565: /*undesirableEffect*/ return this.undesirableEffect == null ? new Base[0] : this.undesirableEffect.toArray(new Base[this.undesirableEffect.size()]); // Reference
1057        case -544509127: /*otherTherapy*/ return this.otherTherapy == null ? new Base[0] : this.otherTherapy.toArray(new Base[this.otherTherapy.size()]); // ClinicalUseDefinitionContraindicationOtherTherapyComponent
1058        default: return super.getProperty(hash, name, checkValid);
1059        }
1060
1061      }
1062
1063      @Override
1064      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1065        switch (hash) {
1066        case -1497395130: // diseaseSymptomProcedure
1067          this.diseaseSymptomProcedure = TypeConvertor.castToCodeableReference(value); // CodeableReference
1068          return value;
1069        case -505503602: // diseaseStatus
1070          this.diseaseStatus = TypeConvertor.castToCodeableReference(value); // CodeableReference
1071          return value;
1072        case -406395211: // comorbidity
1073          this.getComorbidity().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
1074          return value;
1075        case 1587112348: // intendedEffect
1076          this.intendedEffect = TypeConvertor.castToCodeableReference(value); // CodeableReference
1077          return value;
1078        case -1992012396: // duration
1079          this.duration = TypeConvertor.castToQuantity(value); // Quantity
1080          return value;
1081        case 444367565: // undesirableEffect
1082          this.getUndesirableEffect().add(TypeConvertor.castToReference(value)); // Reference
1083          return value;
1084        case -544509127: // otherTherapy
1085          this.getOtherTherapy().add((ClinicalUseDefinitionContraindicationOtherTherapyComponent) value); // ClinicalUseDefinitionContraindicationOtherTherapyComponent
1086          return value;
1087        default: return super.setProperty(hash, name, value);
1088        }
1089
1090      }
1091
1092      @Override
1093      public Base setProperty(String name, Base value) throws FHIRException {
1094        if (name.equals("diseaseSymptomProcedure")) {
1095          this.diseaseSymptomProcedure = TypeConvertor.castToCodeableReference(value); // CodeableReference
1096        } else if (name.equals("diseaseStatus")) {
1097          this.diseaseStatus = TypeConvertor.castToCodeableReference(value); // CodeableReference
1098        } else if (name.equals("comorbidity")) {
1099          this.getComorbidity().add(TypeConvertor.castToCodeableReference(value));
1100        } else if (name.equals("intendedEffect")) {
1101          this.intendedEffect = TypeConvertor.castToCodeableReference(value); // CodeableReference
1102        } else if (name.equals("duration")) {
1103          this.duration = TypeConvertor.castToQuantity(value); // Quantity
1104        } else if (name.equals("undesirableEffect")) {
1105          this.getUndesirableEffect().add(TypeConvertor.castToReference(value));
1106        } else if (name.equals("otherTherapy")) {
1107          this.getOtherTherapy().add((ClinicalUseDefinitionContraindicationOtherTherapyComponent) value);
1108        } else
1109          return super.setProperty(name, value);
1110        return value;
1111      }
1112
1113      @Override
1114      public Base makeProperty(int hash, String name) throws FHIRException {
1115        switch (hash) {
1116        case -1497395130:  return getDiseaseSymptomProcedure();
1117        case -505503602:  return getDiseaseStatus();
1118        case -406395211:  return addComorbidity(); 
1119        case 1587112348:  return getIntendedEffect();
1120        case -1992012396:  return getDuration();
1121        case 444367565:  return addUndesirableEffect(); 
1122        case -544509127:  return addOtherTherapy(); 
1123        default: return super.makeProperty(hash, name);
1124        }
1125
1126      }
1127
1128      @Override
1129      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1130        switch (hash) {
1131        case -1497395130: /*diseaseSymptomProcedure*/ return new String[] {"CodeableReference"};
1132        case -505503602: /*diseaseStatus*/ return new String[] {"CodeableReference"};
1133        case -406395211: /*comorbidity*/ return new String[] {"CodeableReference"};
1134        case 1587112348: /*intendedEffect*/ return new String[] {"CodeableReference"};
1135        case -1992012396: /*duration*/ return new String[] {"Quantity"};
1136        case 444367565: /*undesirableEffect*/ return new String[] {"Reference"};
1137        case -544509127: /*otherTherapy*/ return new String[] {"@ClinicalUseDefinition.contraindication.otherTherapy"};
1138        default: return super.getTypesForProperty(hash, name);
1139        }
1140
1141      }
1142
1143      @Override
1144      public Base addChild(String name) throws FHIRException {
1145        if (name.equals("diseaseSymptomProcedure")) {
1146          this.diseaseSymptomProcedure = new CodeableReference();
1147          return this.diseaseSymptomProcedure;
1148        }
1149        else if (name.equals("diseaseStatus")) {
1150          this.diseaseStatus = new CodeableReference();
1151          return this.diseaseStatus;
1152        }
1153        else if (name.equals("comorbidity")) {
1154          return addComorbidity();
1155        }
1156        else if (name.equals("intendedEffect")) {
1157          this.intendedEffect = new CodeableReference();
1158          return this.intendedEffect;
1159        }
1160        else if (name.equals("duration")) {
1161          this.duration = new Quantity();
1162          return this.duration;
1163        }
1164        else if (name.equals("undesirableEffect")) {
1165          return addUndesirableEffect();
1166        }
1167        else if (name.equals("otherTherapy")) {
1168          return addOtherTherapy();
1169        }
1170        else
1171          return super.addChild(name);
1172      }
1173
1174      public ClinicalUseDefinitionIndicationComponent copy() {
1175        ClinicalUseDefinitionIndicationComponent dst = new ClinicalUseDefinitionIndicationComponent();
1176        copyValues(dst);
1177        return dst;
1178      }
1179
1180      public void copyValues(ClinicalUseDefinitionIndicationComponent dst) {
1181        super.copyValues(dst);
1182        dst.diseaseSymptomProcedure = diseaseSymptomProcedure == null ? null : diseaseSymptomProcedure.copy();
1183        dst.diseaseStatus = diseaseStatus == null ? null : diseaseStatus.copy();
1184        if (comorbidity != null) {
1185          dst.comorbidity = new ArrayList<CodeableReference>();
1186          for (CodeableReference i : comorbidity)
1187            dst.comorbidity.add(i.copy());
1188        };
1189        dst.intendedEffect = intendedEffect == null ? null : intendedEffect.copy();
1190        dst.duration = duration == null ? null : duration.copy();
1191        if (undesirableEffect != null) {
1192          dst.undesirableEffect = new ArrayList<Reference>();
1193          for (Reference i : undesirableEffect)
1194            dst.undesirableEffect.add(i.copy());
1195        };
1196        if (otherTherapy != null) {
1197          dst.otherTherapy = new ArrayList<ClinicalUseDefinitionContraindicationOtherTherapyComponent>();
1198          for (ClinicalUseDefinitionContraindicationOtherTherapyComponent i : otherTherapy)
1199            dst.otherTherapy.add(i.copy());
1200        };
1201      }
1202
1203      @Override
1204      public boolean equalsDeep(Base other_) {
1205        if (!super.equalsDeep(other_))
1206          return false;
1207        if (!(other_ instanceof ClinicalUseDefinitionIndicationComponent))
1208          return false;
1209        ClinicalUseDefinitionIndicationComponent o = (ClinicalUseDefinitionIndicationComponent) other_;
1210        return compareDeep(diseaseSymptomProcedure, o.diseaseSymptomProcedure, true) && compareDeep(diseaseStatus, o.diseaseStatus, true)
1211           && compareDeep(comorbidity, o.comorbidity, true) && compareDeep(intendedEffect, o.intendedEffect, true)
1212           && compareDeep(duration, o.duration, true) && compareDeep(undesirableEffect, o.undesirableEffect, true)
1213           && compareDeep(otherTherapy, o.otherTherapy, true);
1214      }
1215
1216      @Override
1217      public boolean equalsShallow(Base other_) {
1218        if (!super.equalsShallow(other_))
1219          return false;
1220        if (!(other_ instanceof ClinicalUseDefinitionIndicationComponent))
1221          return false;
1222        ClinicalUseDefinitionIndicationComponent o = (ClinicalUseDefinitionIndicationComponent) other_;
1223        return true;
1224      }
1225
1226      public boolean isEmpty() {
1227        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(diseaseSymptomProcedure, diseaseStatus
1228          , comorbidity, intendedEffect, duration, undesirableEffect, otherTherapy);
1229      }
1230
1231  public String fhirType() {
1232    return "ClinicalUseDefinition.indication";
1233
1234  }
1235
1236  }
1237
1238    @Block()
1239    public static class ClinicalUseDefinitionInteractionComponent extends BackboneElement implements IBaseBackboneElement {
1240        /**
1241         * The specific medication, food, substance or laboratory test that interacts.
1242         */
1243        @Child(name = "interactant", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1244        @Description(shortDefinition="The specific medication, food, substance or laboratory test that interacts", formalDefinition="The specific medication, food, substance or laboratory test that interacts." )
1245        protected List<ClinicalUseDefinitionInteractionInteractantComponent> interactant;
1246
1247        /**
1248         * The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction.
1249         */
1250        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1251        @Description(shortDefinition="The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction", formalDefinition="The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction." )
1252        protected CodeableConcept type;
1253
1254        /**
1255         * The effect of the interaction, for example "reduced gastric absorption of primary medication".
1256         */
1257        @Child(name = "effect", type = {CodeableReference.class}, order=3, min=0, max=1, modifier=false, summary=true)
1258        @Description(shortDefinition="The effect of the interaction, for example \"reduced gastric absorption of primary medication\"", formalDefinition="The effect of the interaction, for example \"reduced gastric absorption of primary medication\"." )
1259        protected CodeableReference effect;
1260
1261        /**
1262         * The incidence of the interaction, e.g. theoretical, observed.
1263         */
1264        @Child(name = "incidence", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
1265        @Description(shortDefinition="The incidence of the interaction, e.g. theoretical, observed", formalDefinition="The incidence of the interaction, e.g. theoretical, observed." )
1266        protected CodeableConcept incidence;
1267
1268        /**
1269         * Actions for managing the interaction.
1270         */
1271        @Child(name = "management", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1272        @Description(shortDefinition="Actions for managing the interaction", formalDefinition="Actions for managing the interaction." )
1273        protected List<CodeableConcept> management;
1274
1275        private static final long serialVersionUID = 2072955553L;
1276
1277    /**
1278     * Constructor
1279     */
1280      public ClinicalUseDefinitionInteractionComponent() {
1281        super();
1282      }
1283
1284        /**
1285         * @return {@link #interactant} (The specific medication, food, substance or laboratory test that interacts.)
1286         */
1287        public List<ClinicalUseDefinitionInteractionInteractantComponent> getInteractant() { 
1288          if (this.interactant == null)
1289            this.interactant = new ArrayList<ClinicalUseDefinitionInteractionInteractantComponent>();
1290          return this.interactant;
1291        }
1292
1293        /**
1294         * @return Returns a reference to <code>this</code> for easy method chaining
1295         */
1296        public ClinicalUseDefinitionInteractionComponent setInteractant(List<ClinicalUseDefinitionInteractionInteractantComponent> theInteractant) { 
1297          this.interactant = theInteractant;
1298          return this;
1299        }
1300
1301        public boolean hasInteractant() { 
1302          if (this.interactant == null)
1303            return false;
1304          for (ClinicalUseDefinitionInteractionInteractantComponent item : this.interactant)
1305            if (!item.isEmpty())
1306              return true;
1307          return false;
1308        }
1309
1310        public ClinicalUseDefinitionInteractionInteractantComponent addInteractant() { //3
1311          ClinicalUseDefinitionInteractionInteractantComponent t = new ClinicalUseDefinitionInteractionInteractantComponent();
1312          if (this.interactant == null)
1313            this.interactant = new ArrayList<ClinicalUseDefinitionInteractionInteractantComponent>();
1314          this.interactant.add(t);
1315          return t;
1316        }
1317
1318        public ClinicalUseDefinitionInteractionComponent addInteractant(ClinicalUseDefinitionInteractionInteractantComponent t) { //3
1319          if (t == null)
1320            return this;
1321          if (this.interactant == null)
1322            this.interactant = new ArrayList<ClinicalUseDefinitionInteractionInteractantComponent>();
1323          this.interactant.add(t);
1324          return this;
1325        }
1326
1327        /**
1328         * @return The first repetition of repeating field {@link #interactant}, creating it if it does not already exist {3}
1329         */
1330        public ClinicalUseDefinitionInteractionInteractantComponent getInteractantFirstRep() { 
1331          if (getInteractant().isEmpty()) {
1332            addInteractant();
1333          }
1334          return getInteractant().get(0);
1335        }
1336
1337        /**
1338         * @return {@link #type} (The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction.)
1339         */
1340        public CodeableConcept getType() { 
1341          if (this.type == null)
1342            if (Configuration.errorOnAutoCreate())
1343              throw new Error("Attempt to auto-create ClinicalUseDefinitionInteractionComponent.type");
1344            else if (Configuration.doAutoCreate())
1345              this.type = new CodeableConcept(); // cc
1346          return this.type;
1347        }
1348
1349        public boolean hasType() { 
1350          return this.type != null && !this.type.isEmpty();
1351        }
1352
1353        /**
1354         * @param value {@link #type} (The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction.)
1355         */
1356        public ClinicalUseDefinitionInteractionComponent setType(CodeableConcept value) { 
1357          this.type = value;
1358          return this;
1359        }
1360
1361        /**
1362         * @return {@link #effect} (The effect of the interaction, for example "reduced gastric absorption of primary medication".)
1363         */
1364        public CodeableReference getEffect() { 
1365          if (this.effect == null)
1366            if (Configuration.errorOnAutoCreate())
1367              throw new Error("Attempt to auto-create ClinicalUseDefinitionInteractionComponent.effect");
1368            else if (Configuration.doAutoCreate())
1369              this.effect = new CodeableReference(); // cc
1370          return this.effect;
1371        }
1372
1373        public boolean hasEffect() { 
1374          return this.effect != null && !this.effect.isEmpty();
1375        }
1376
1377        /**
1378         * @param value {@link #effect} (The effect of the interaction, for example "reduced gastric absorption of primary medication".)
1379         */
1380        public ClinicalUseDefinitionInteractionComponent setEffect(CodeableReference value) { 
1381          this.effect = value;
1382          return this;
1383        }
1384
1385        /**
1386         * @return {@link #incidence} (The incidence of the interaction, e.g. theoretical, observed.)
1387         */
1388        public CodeableConcept getIncidence() { 
1389          if (this.incidence == null)
1390            if (Configuration.errorOnAutoCreate())
1391              throw new Error("Attempt to auto-create ClinicalUseDefinitionInteractionComponent.incidence");
1392            else if (Configuration.doAutoCreate())
1393              this.incidence = new CodeableConcept(); // cc
1394          return this.incidence;
1395        }
1396
1397        public boolean hasIncidence() { 
1398          return this.incidence != null && !this.incidence.isEmpty();
1399        }
1400
1401        /**
1402         * @param value {@link #incidence} (The incidence of the interaction, e.g. theoretical, observed.)
1403         */
1404        public ClinicalUseDefinitionInteractionComponent setIncidence(CodeableConcept value) { 
1405          this.incidence = value;
1406          return this;
1407        }
1408
1409        /**
1410         * @return {@link #management} (Actions for managing the interaction.)
1411         */
1412        public List<CodeableConcept> getManagement() { 
1413          if (this.management == null)
1414            this.management = new ArrayList<CodeableConcept>();
1415          return this.management;
1416        }
1417
1418        /**
1419         * @return Returns a reference to <code>this</code> for easy method chaining
1420         */
1421        public ClinicalUseDefinitionInteractionComponent setManagement(List<CodeableConcept> theManagement) { 
1422          this.management = theManagement;
1423          return this;
1424        }
1425
1426        public boolean hasManagement() { 
1427          if (this.management == null)
1428            return false;
1429          for (CodeableConcept item : this.management)
1430            if (!item.isEmpty())
1431              return true;
1432          return false;
1433        }
1434
1435        public CodeableConcept addManagement() { //3
1436          CodeableConcept t = new CodeableConcept();
1437          if (this.management == null)
1438            this.management = new ArrayList<CodeableConcept>();
1439          this.management.add(t);
1440          return t;
1441        }
1442
1443        public ClinicalUseDefinitionInteractionComponent addManagement(CodeableConcept t) { //3
1444          if (t == null)
1445            return this;
1446          if (this.management == null)
1447            this.management = new ArrayList<CodeableConcept>();
1448          this.management.add(t);
1449          return this;
1450        }
1451
1452        /**
1453         * @return The first repetition of repeating field {@link #management}, creating it if it does not already exist {3}
1454         */
1455        public CodeableConcept getManagementFirstRep() { 
1456          if (getManagement().isEmpty()) {
1457            addManagement();
1458          }
1459          return getManagement().get(0);
1460        }
1461
1462        protected void listChildren(List<Property> children) {
1463          super.listChildren(children);
1464          children.add(new Property("interactant", "", "The specific medication, food, substance or laboratory test that interacts.", 0, java.lang.Integer.MAX_VALUE, interactant));
1465          children.add(new Property("type", "CodeableConcept", "The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction.", 0, 1, type));
1466          children.add(new Property("effect", "CodeableReference(ObservationDefinition)", "The effect of the interaction, for example \"reduced gastric absorption of primary medication\".", 0, 1, effect));
1467          children.add(new Property("incidence", "CodeableConcept", "The incidence of the interaction, e.g. theoretical, observed.", 0, 1, incidence));
1468          children.add(new Property("management", "CodeableConcept", "Actions for managing the interaction.", 0, java.lang.Integer.MAX_VALUE, management));
1469        }
1470
1471        @Override
1472        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1473          switch (_hash) {
1474          case 1844097009: /*interactant*/  return new Property("interactant", "", "The specific medication, food, substance or laboratory test that interacts.", 0, java.lang.Integer.MAX_VALUE, interactant);
1475          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction.", 0, 1, type);
1476          case -1306084975: /*effect*/  return new Property("effect", "CodeableReference(ObservationDefinition)", "The effect of the interaction, for example \"reduced gastric absorption of primary medication\".", 0, 1, effect);
1477          case -1598467132: /*incidence*/  return new Property("incidence", "CodeableConcept", "The incidence of the interaction, e.g. theoretical, observed.", 0, 1, incidence);
1478          case -1799980989: /*management*/  return new Property("management", "CodeableConcept", "Actions for managing the interaction.", 0, java.lang.Integer.MAX_VALUE, management);
1479          default: return super.getNamedProperty(_hash, _name, _checkValid);
1480          }
1481
1482        }
1483
1484      @Override
1485      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1486        switch (hash) {
1487        case 1844097009: /*interactant*/ return this.interactant == null ? new Base[0] : this.interactant.toArray(new Base[this.interactant.size()]); // ClinicalUseDefinitionInteractionInteractantComponent
1488        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1489        case -1306084975: /*effect*/ return this.effect == null ? new Base[0] : new Base[] {this.effect}; // CodeableReference
1490        case -1598467132: /*incidence*/ return this.incidence == null ? new Base[0] : new Base[] {this.incidence}; // CodeableConcept
1491        case -1799980989: /*management*/ return this.management == null ? new Base[0] : this.management.toArray(new Base[this.management.size()]); // CodeableConcept
1492        default: return super.getProperty(hash, name, checkValid);
1493        }
1494
1495      }
1496
1497      @Override
1498      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1499        switch (hash) {
1500        case 1844097009: // interactant
1501          this.getInteractant().add((ClinicalUseDefinitionInteractionInteractantComponent) value); // ClinicalUseDefinitionInteractionInteractantComponent
1502          return value;
1503        case 3575610: // type
1504          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1505          return value;
1506        case -1306084975: // effect
1507          this.effect = TypeConvertor.castToCodeableReference(value); // CodeableReference
1508          return value;
1509        case -1598467132: // incidence
1510          this.incidence = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1511          return value;
1512        case -1799980989: // management
1513          this.getManagement().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1514          return value;
1515        default: return super.setProperty(hash, name, value);
1516        }
1517
1518      }
1519
1520      @Override
1521      public Base setProperty(String name, Base value) throws FHIRException {
1522        if (name.equals("interactant")) {
1523          this.getInteractant().add((ClinicalUseDefinitionInteractionInteractantComponent) value);
1524        } else if (name.equals("type")) {
1525          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1526        } else if (name.equals("effect")) {
1527          this.effect = TypeConvertor.castToCodeableReference(value); // CodeableReference
1528        } else if (name.equals("incidence")) {
1529          this.incidence = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1530        } else if (name.equals("management")) {
1531          this.getManagement().add(TypeConvertor.castToCodeableConcept(value));
1532        } else
1533          return super.setProperty(name, value);
1534        return value;
1535      }
1536
1537      @Override
1538      public Base makeProperty(int hash, String name) throws FHIRException {
1539        switch (hash) {
1540        case 1844097009:  return addInteractant(); 
1541        case 3575610:  return getType();
1542        case -1306084975:  return getEffect();
1543        case -1598467132:  return getIncidence();
1544        case -1799980989:  return addManagement(); 
1545        default: return super.makeProperty(hash, name);
1546        }
1547
1548      }
1549
1550      @Override
1551      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1552        switch (hash) {
1553        case 1844097009: /*interactant*/ return new String[] {};
1554        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1555        case -1306084975: /*effect*/ return new String[] {"CodeableReference"};
1556        case -1598467132: /*incidence*/ return new String[] {"CodeableConcept"};
1557        case -1799980989: /*management*/ return new String[] {"CodeableConcept"};
1558        default: return super.getTypesForProperty(hash, name);
1559        }
1560
1561      }
1562
1563      @Override
1564      public Base addChild(String name) throws FHIRException {
1565        if (name.equals("interactant")) {
1566          return addInteractant();
1567        }
1568        else if (name.equals("type")) {
1569          this.type = new CodeableConcept();
1570          return this.type;
1571        }
1572        else if (name.equals("effect")) {
1573          this.effect = new CodeableReference();
1574          return this.effect;
1575        }
1576        else if (name.equals("incidence")) {
1577          this.incidence = new CodeableConcept();
1578          return this.incidence;
1579        }
1580        else if (name.equals("management")) {
1581          return addManagement();
1582        }
1583        else
1584          return super.addChild(name);
1585      }
1586
1587      public ClinicalUseDefinitionInteractionComponent copy() {
1588        ClinicalUseDefinitionInteractionComponent dst = new ClinicalUseDefinitionInteractionComponent();
1589        copyValues(dst);
1590        return dst;
1591      }
1592
1593      public void copyValues(ClinicalUseDefinitionInteractionComponent dst) {
1594        super.copyValues(dst);
1595        if (interactant != null) {
1596          dst.interactant = new ArrayList<ClinicalUseDefinitionInteractionInteractantComponent>();
1597          for (ClinicalUseDefinitionInteractionInteractantComponent i : interactant)
1598            dst.interactant.add(i.copy());
1599        };
1600        dst.type = type == null ? null : type.copy();
1601        dst.effect = effect == null ? null : effect.copy();
1602        dst.incidence = incidence == null ? null : incidence.copy();
1603        if (management != null) {
1604          dst.management = new ArrayList<CodeableConcept>();
1605          for (CodeableConcept i : management)
1606            dst.management.add(i.copy());
1607        };
1608      }
1609
1610      @Override
1611      public boolean equalsDeep(Base other_) {
1612        if (!super.equalsDeep(other_))
1613          return false;
1614        if (!(other_ instanceof ClinicalUseDefinitionInteractionComponent))
1615          return false;
1616        ClinicalUseDefinitionInteractionComponent o = (ClinicalUseDefinitionInteractionComponent) other_;
1617        return compareDeep(interactant, o.interactant, true) && compareDeep(type, o.type, true) && compareDeep(effect, o.effect, true)
1618           && compareDeep(incidence, o.incidence, true) && compareDeep(management, o.management, true);
1619      }
1620
1621      @Override
1622      public boolean equalsShallow(Base other_) {
1623        if (!super.equalsShallow(other_))
1624          return false;
1625        if (!(other_ instanceof ClinicalUseDefinitionInteractionComponent))
1626          return false;
1627        ClinicalUseDefinitionInteractionComponent o = (ClinicalUseDefinitionInteractionComponent) other_;
1628        return true;
1629      }
1630
1631      public boolean isEmpty() {
1632        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(interactant, type, effect
1633          , incidence, management);
1634      }
1635
1636  public String fhirType() {
1637    return "ClinicalUseDefinition.interaction";
1638
1639  }
1640
1641  }
1642
1643    @Block()
1644    public static class ClinicalUseDefinitionInteractionInteractantComponent extends BackboneElement implements IBaseBackboneElement {
1645        /**
1646         * The specific medication, food or laboratory test that interacts.
1647         */
1648        @Child(name = "item", type = {MedicinalProductDefinition.class, Medication.class, Substance.class, ObservationDefinition.class, CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
1649        @Description(shortDefinition="The specific medication, food or laboratory test that interacts", formalDefinition="The specific medication, food or laboratory test that interacts." )
1650        protected DataType item;
1651
1652        private static final long serialVersionUID = 1847936859L;
1653
1654    /**
1655     * Constructor
1656     */
1657      public ClinicalUseDefinitionInteractionInteractantComponent() {
1658        super();
1659      }
1660
1661    /**
1662     * Constructor
1663     */
1664      public ClinicalUseDefinitionInteractionInteractantComponent(DataType item) {
1665        super();
1666        this.setItem(item);
1667      }
1668
1669        /**
1670         * @return {@link #item} (The specific medication, food or laboratory test that interacts.)
1671         */
1672        public DataType getItem() { 
1673          return this.item;
1674        }
1675
1676        /**
1677         * @return {@link #item} (The specific medication, food or laboratory test that interacts.)
1678         */
1679        public Reference getItemReference() throws FHIRException { 
1680          if (this.item == null)
1681            this.item = new Reference();
1682          if (!(this.item instanceof Reference))
1683            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.item.getClass().getName()+" was encountered");
1684          return (Reference) this.item;
1685        }
1686
1687        public boolean hasItemReference() { 
1688          return this != null && this.item instanceof Reference;
1689        }
1690
1691        /**
1692         * @return {@link #item} (The specific medication, food or laboratory test that interacts.)
1693         */
1694        public CodeableConcept getItemCodeableConcept() throws FHIRException { 
1695          if (this.item == null)
1696            this.item = new CodeableConcept();
1697          if (!(this.item instanceof CodeableConcept))
1698            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.item.getClass().getName()+" was encountered");
1699          return (CodeableConcept) this.item;
1700        }
1701
1702        public boolean hasItemCodeableConcept() { 
1703          return this != null && this.item instanceof CodeableConcept;
1704        }
1705
1706        public boolean hasItem() { 
1707          return this.item != null && !this.item.isEmpty();
1708        }
1709
1710        /**
1711         * @param value {@link #item} (The specific medication, food or laboratory test that interacts.)
1712         */
1713        public ClinicalUseDefinitionInteractionInteractantComponent setItem(DataType value) { 
1714          if (value != null && !(value instanceof Reference || value instanceof CodeableConcept))
1715            throw new Error("Not the right type for ClinicalUseDefinition.interaction.interactant.item[x]: "+value.fhirType());
1716          this.item = value;
1717          return this;
1718        }
1719
1720        protected void listChildren(List<Property> children) {
1721          super.listChildren(children);
1722          children.add(new Property("item[x]", "Reference(MedicinalProductDefinition|Medication|Substance|ObservationDefinition)|CodeableConcept", "The specific medication, food or laboratory test that interacts.", 0, 1, item));
1723        }
1724
1725        @Override
1726        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1727          switch (_hash) {
1728          case 2116201613: /*item[x]*/  return new Property("item[x]", "Reference(MedicinalProductDefinition|Medication|Substance|ObservationDefinition)|CodeableConcept", "The specific medication, food or laboratory test that interacts.", 0, 1, item);
1729          case 3242771: /*item*/  return new Property("item[x]", "Reference(MedicinalProductDefinition|Medication|Substance|ObservationDefinition)|CodeableConcept", "The specific medication, food or laboratory test that interacts.", 0, 1, item);
1730          case 1376364920: /*itemReference*/  return new Property("item[x]", "Reference(MedicinalProductDefinition|Medication|Substance|ObservationDefinition)", "The specific medication, food or laboratory test that interacts.", 0, 1, item);
1731          case 106644494: /*itemCodeableConcept*/  return new Property("item[x]", "CodeableConcept", "The specific medication, food or laboratory test that interacts.", 0, 1, item);
1732          default: return super.getNamedProperty(_hash, _name, _checkValid);
1733          }
1734
1735        }
1736
1737      @Override
1738      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1739        switch (hash) {
1740        case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // DataType
1741        default: return super.getProperty(hash, name, checkValid);
1742        }
1743
1744      }
1745
1746      @Override
1747      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1748        switch (hash) {
1749        case 3242771: // item
1750          this.item = TypeConvertor.castToType(value); // DataType
1751          return value;
1752        default: return super.setProperty(hash, name, value);
1753        }
1754
1755      }
1756
1757      @Override
1758      public Base setProperty(String name, Base value) throws FHIRException {
1759        if (name.equals("item[x]")) {
1760          this.item = TypeConvertor.castToType(value); // DataType
1761        } else
1762          return super.setProperty(name, value);
1763        return value;
1764      }
1765
1766      @Override
1767      public Base makeProperty(int hash, String name) throws FHIRException {
1768        switch (hash) {
1769        case 2116201613:  return getItem();
1770        case 3242771:  return getItem();
1771        default: return super.makeProperty(hash, name);
1772        }
1773
1774      }
1775
1776      @Override
1777      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1778        switch (hash) {
1779        case 3242771: /*item*/ return new String[] {"Reference", "CodeableConcept"};
1780        default: return super.getTypesForProperty(hash, name);
1781        }
1782
1783      }
1784
1785      @Override
1786      public Base addChild(String name) throws FHIRException {
1787        if (name.equals("itemReference")) {
1788          this.item = new Reference();
1789          return this.item;
1790        }
1791        else if (name.equals("itemCodeableConcept")) {
1792          this.item = new CodeableConcept();
1793          return this.item;
1794        }
1795        else
1796          return super.addChild(name);
1797      }
1798
1799      public ClinicalUseDefinitionInteractionInteractantComponent copy() {
1800        ClinicalUseDefinitionInteractionInteractantComponent dst = new ClinicalUseDefinitionInteractionInteractantComponent();
1801        copyValues(dst);
1802        return dst;
1803      }
1804
1805      public void copyValues(ClinicalUseDefinitionInteractionInteractantComponent dst) {
1806        super.copyValues(dst);
1807        dst.item = item == null ? null : item.copy();
1808      }
1809
1810      @Override
1811      public boolean equalsDeep(Base other_) {
1812        if (!super.equalsDeep(other_))
1813          return false;
1814        if (!(other_ instanceof ClinicalUseDefinitionInteractionInteractantComponent))
1815          return false;
1816        ClinicalUseDefinitionInteractionInteractantComponent o = (ClinicalUseDefinitionInteractionInteractantComponent) other_;
1817        return compareDeep(item, o.item, true);
1818      }
1819
1820      @Override
1821      public boolean equalsShallow(Base other_) {
1822        if (!super.equalsShallow(other_))
1823          return false;
1824        if (!(other_ instanceof ClinicalUseDefinitionInteractionInteractantComponent))
1825          return false;
1826        ClinicalUseDefinitionInteractionInteractantComponent o = (ClinicalUseDefinitionInteractionInteractantComponent) other_;
1827        return true;
1828      }
1829
1830      public boolean isEmpty() {
1831        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(item);
1832      }
1833
1834  public String fhirType() {
1835    return "ClinicalUseDefinition.interaction.interactant";
1836
1837  }
1838
1839  }
1840
1841    @Block()
1842    public static class ClinicalUseDefinitionUndesirableEffectComponent extends BackboneElement implements IBaseBackboneElement {
1843        /**
1844         * The situation in which the undesirable effect may manifest.
1845         */
1846        @Child(name = "symptomConditionEffect", type = {CodeableReference.class}, order=1, min=0, max=1, modifier=false, summary=true)
1847        @Description(shortDefinition="The situation in which the undesirable effect may manifest", formalDefinition="The situation in which the undesirable effect may manifest." )
1848        protected CodeableReference symptomConditionEffect;
1849
1850        /**
1851         * High level classification of the effect.
1852         */
1853        @Child(name = "classification", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1854        @Description(shortDefinition="High level classification of the effect", formalDefinition="High level classification of the effect." )
1855        protected CodeableConcept classification;
1856
1857        /**
1858         * How often the effect is seen.
1859         */
1860        @Child(name = "frequencyOfOccurrence", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
1861        @Description(shortDefinition="How often the effect is seen", formalDefinition="How often the effect is seen." )
1862        protected CodeableConcept frequencyOfOccurrence;
1863
1864        private static final long serialVersionUID = -55472609L;
1865
1866    /**
1867     * Constructor
1868     */
1869      public ClinicalUseDefinitionUndesirableEffectComponent() {
1870        super();
1871      }
1872
1873        /**
1874         * @return {@link #symptomConditionEffect} (The situation in which the undesirable effect may manifest.)
1875         */
1876        public CodeableReference getSymptomConditionEffect() { 
1877          if (this.symptomConditionEffect == null)
1878            if (Configuration.errorOnAutoCreate())
1879              throw new Error("Attempt to auto-create ClinicalUseDefinitionUndesirableEffectComponent.symptomConditionEffect");
1880            else if (Configuration.doAutoCreate())
1881              this.symptomConditionEffect = new CodeableReference(); // cc
1882          return this.symptomConditionEffect;
1883        }
1884
1885        public boolean hasSymptomConditionEffect() { 
1886          return this.symptomConditionEffect != null && !this.symptomConditionEffect.isEmpty();
1887        }
1888
1889        /**
1890         * @param value {@link #symptomConditionEffect} (The situation in which the undesirable effect may manifest.)
1891         */
1892        public ClinicalUseDefinitionUndesirableEffectComponent setSymptomConditionEffect(CodeableReference value) { 
1893          this.symptomConditionEffect = value;
1894          return this;
1895        }
1896
1897        /**
1898         * @return {@link #classification} (High level classification of the effect.)
1899         */
1900        public CodeableConcept getClassification() { 
1901          if (this.classification == null)
1902            if (Configuration.errorOnAutoCreate())
1903              throw new Error("Attempt to auto-create ClinicalUseDefinitionUndesirableEffectComponent.classification");
1904            else if (Configuration.doAutoCreate())
1905              this.classification = new CodeableConcept(); // cc
1906          return this.classification;
1907        }
1908
1909        public boolean hasClassification() { 
1910          return this.classification != null && !this.classification.isEmpty();
1911        }
1912
1913        /**
1914         * @param value {@link #classification} (High level classification of the effect.)
1915         */
1916        public ClinicalUseDefinitionUndesirableEffectComponent setClassification(CodeableConcept value) { 
1917          this.classification = value;
1918          return this;
1919        }
1920
1921        /**
1922         * @return {@link #frequencyOfOccurrence} (How often the effect is seen.)
1923         */
1924        public CodeableConcept getFrequencyOfOccurrence() { 
1925          if (this.frequencyOfOccurrence == null)
1926            if (Configuration.errorOnAutoCreate())
1927              throw new Error("Attempt to auto-create ClinicalUseDefinitionUndesirableEffectComponent.frequencyOfOccurrence");
1928            else if (Configuration.doAutoCreate())
1929              this.frequencyOfOccurrence = new CodeableConcept(); // cc
1930          return this.frequencyOfOccurrence;
1931        }
1932
1933        public boolean hasFrequencyOfOccurrence() { 
1934          return this.frequencyOfOccurrence != null && !this.frequencyOfOccurrence.isEmpty();
1935        }
1936
1937        /**
1938         * @param value {@link #frequencyOfOccurrence} (How often the effect is seen.)
1939         */
1940        public ClinicalUseDefinitionUndesirableEffectComponent setFrequencyOfOccurrence(CodeableConcept value) { 
1941          this.frequencyOfOccurrence = value;
1942          return this;
1943        }
1944
1945        protected void listChildren(List<Property> children) {
1946          super.listChildren(children);
1947          children.add(new Property("symptomConditionEffect", "CodeableReference(ObservationDefinition)", "The situation in which the undesirable effect may manifest.", 0, 1, symptomConditionEffect));
1948          children.add(new Property("classification", "CodeableConcept", "High level classification of the effect.", 0, 1, classification));
1949          children.add(new Property("frequencyOfOccurrence", "CodeableConcept", "How often the effect is seen.", 0, 1, frequencyOfOccurrence));
1950        }
1951
1952        @Override
1953        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1954          switch (_hash) {
1955          case -650549981: /*symptomConditionEffect*/  return new Property("symptomConditionEffect", "CodeableReference(ObservationDefinition)", "The situation in which the undesirable effect may manifest.", 0, 1, symptomConditionEffect);
1956          case 382350310: /*classification*/  return new Property("classification", "CodeableConcept", "High level classification of the effect.", 0, 1, classification);
1957          case 791175812: /*frequencyOfOccurrence*/  return new Property("frequencyOfOccurrence", "CodeableConcept", "How often the effect is seen.", 0, 1, frequencyOfOccurrence);
1958          default: return super.getNamedProperty(_hash, _name, _checkValid);
1959          }
1960
1961        }
1962
1963      @Override
1964      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1965        switch (hash) {
1966        case -650549981: /*symptomConditionEffect*/ return this.symptomConditionEffect == null ? new Base[0] : new Base[] {this.symptomConditionEffect}; // CodeableReference
1967        case 382350310: /*classification*/ return this.classification == null ? new Base[0] : new Base[] {this.classification}; // CodeableConcept
1968        case 791175812: /*frequencyOfOccurrence*/ return this.frequencyOfOccurrence == null ? new Base[0] : new Base[] {this.frequencyOfOccurrence}; // CodeableConcept
1969        default: return super.getProperty(hash, name, checkValid);
1970        }
1971
1972      }
1973
1974      @Override
1975      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1976        switch (hash) {
1977        case -650549981: // symptomConditionEffect
1978          this.symptomConditionEffect = TypeConvertor.castToCodeableReference(value); // CodeableReference
1979          return value;
1980        case 382350310: // classification
1981          this.classification = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1982          return value;
1983        case 791175812: // frequencyOfOccurrence
1984          this.frequencyOfOccurrence = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1985          return value;
1986        default: return super.setProperty(hash, name, value);
1987        }
1988
1989      }
1990
1991      @Override
1992      public Base setProperty(String name, Base value) throws FHIRException {
1993        if (name.equals("symptomConditionEffect")) {
1994          this.symptomConditionEffect = TypeConvertor.castToCodeableReference(value); // CodeableReference
1995        } else if (name.equals("classification")) {
1996          this.classification = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1997        } else if (name.equals("frequencyOfOccurrence")) {
1998          this.frequencyOfOccurrence = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1999        } else
2000          return super.setProperty(name, value);
2001        return value;
2002      }
2003
2004      @Override
2005      public Base makeProperty(int hash, String name) throws FHIRException {
2006        switch (hash) {
2007        case -650549981:  return getSymptomConditionEffect();
2008        case 382350310:  return getClassification();
2009        case 791175812:  return getFrequencyOfOccurrence();
2010        default: return super.makeProperty(hash, name);
2011        }
2012
2013      }
2014
2015      @Override
2016      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2017        switch (hash) {
2018        case -650549981: /*symptomConditionEffect*/ return new String[] {"CodeableReference"};
2019        case 382350310: /*classification*/ return new String[] {"CodeableConcept"};
2020        case 791175812: /*frequencyOfOccurrence*/ return new String[] {"CodeableConcept"};
2021        default: return super.getTypesForProperty(hash, name);
2022        }
2023
2024      }
2025
2026      @Override
2027      public Base addChild(String name) throws FHIRException {
2028        if (name.equals("symptomConditionEffect")) {
2029          this.symptomConditionEffect = new CodeableReference();
2030          return this.symptomConditionEffect;
2031        }
2032        else if (name.equals("classification")) {
2033          this.classification = new CodeableConcept();
2034          return this.classification;
2035        }
2036        else if (name.equals("frequencyOfOccurrence")) {
2037          this.frequencyOfOccurrence = new CodeableConcept();
2038          return this.frequencyOfOccurrence;
2039        }
2040        else
2041          return super.addChild(name);
2042      }
2043
2044      public ClinicalUseDefinitionUndesirableEffectComponent copy() {
2045        ClinicalUseDefinitionUndesirableEffectComponent dst = new ClinicalUseDefinitionUndesirableEffectComponent();
2046        copyValues(dst);
2047        return dst;
2048      }
2049
2050      public void copyValues(ClinicalUseDefinitionUndesirableEffectComponent dst) {
2051        super.copyValues(dst);
2052        dst.symptomConditionEffect = symptomConditionEffect == null ? null : symptomConditionEffect.copy();
2053        dst.classification = classification == null ? null : classification.copy();
2054        dst.frequencyOfOccurrence = frequencyOfOccurrence == null ? null : frequencyOfOccurrence.copy();
2055      }
2056
2057      @Override
2058      public boolean equalsDeep(Base other_) {
2059        if (!super.equalsDeep(other_))
2060          return false;
2061        if (!(other_ instanceof ClinicalUseDefinitionUndesirableEffectComponent))
2062          return false;
2063        ClinicalUseDefinitionUndesirableEffectComponent o = (ClinicalUseDefinitionUndesirableEffectComponent) other_;
2064        return compareDeep(symptomConditionEffect, o.symptomConditionEffect, true) && compareDeep(classification, o.classification, true)
2065           && compareDeep(frequencyOfOccurrence, o.frequencyOfOccurrence, true);
2066      }
2067
2068      @Override
2069      public boolean equalsShallow(Base other_) {
2070        if (!super.equalsShallow(other_))
2071          return false;
2072        if (!(other_ instanceof ClinicalUseDefinitionUndesirableEffectComponent))
2073          return false;
2074        ClinicalUseDefinitionUndesirableEffectComponent o = (ClinicalUseDefinitionUndesirableEffectComponent) other_;
2075        return true;
2076      }
2077
2078      public boolean isEmpty() {
2079        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(symptomConditionEffect, classification
2080          , frequencyOfOccurrence);
2081      }
2082
2083  public String fhirType() {
2084    return "ClinicalUseDefinition.undesirableEffect";
2085
2086  }
2087
2088  }
2089
2090    @Block()
2091    public static class ClinicalUseDefinitionWarningComponent extends BackboneElement implements IBaseBackboneElement {
2092        /**
2093         * A textual definition of this warning, with formatting.
2094         */
2095        @Child(name = "description", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=true)
2096        @Description(shortDefinition="A textual definition of this warning, with formatting", formalDefinition="A textual definition of this warning, with formatting." )
2097        protected MarkdownType description;
2098
2099        /**
2100         * A coded or unformatted textual definition of this warning.
2101         */
2102        @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
2103        @Description(shortDefinition="A coded or unformatted textual definition of this warning", formalDefinition="A coded or unformatted textual definition of this warning." )
2104        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/warning-type")
2105        protected CodeableConcept code;
2106
2107        private static final long serialVersionUID = 213710553L;
2108
2109    /**
2110     * Constructor
2111     */
2112      public ClinicalUseDefinitionWarningComponent() {
2113        super();
2114      }
2115
2116        /**
2117         * @return {@link #description} (A textual definition of this warning, with formatting.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2118         */
2119        public MarkdownType getDescriptionElement() { 
2120          if (this.description == null)
2121            if (Configuration.errorOnAutoCreate())
2122              throw new Error("Attempt to auto-create ClinicalUseDefinitionWarningComponent.description");
2123            else if (Configuration.doAutoCreate())
2124              this.description = new MarkdownType(); // bb
2125          return this.description;
2126        }
2127
2128        public boolean hasDescriptionElement() { 
2129          return this.description != null && !this.description.isEmpty();
2130        }
2131
2132        public boolean hasDescription() { 
2133          return this.description != null && !this.description.isEmpty();
2134        }
2135
2136        /**
2137         * @param value {@link #description} (A textual definition of this warning, with formatting.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2138         */
2139        public ClinicalUseDefinitionWarningComponent setDescriptionElement(MarkdownType value) { 
2140          this.description = value;
2141          return this;
2142        }
2143
2144        /**
2145         * @return A textual definition of this warning, with formatting.
2146         */
2147        public String getDescription() { 
2148          return this.description == null ? null : this.description.getValue();
2149        }
2150
2151        /**
2152         * @param value A textual definition of this warning, with formatting.
2153         */
2154        public ClinicalUseDefinitionWarningComponent setDescription(String value) { 
2155          if (value == null)
2156            this.description = null;
2157          else {
2158            if (this.description == null)
2159              this.description = new MarkdownType();
2160            this.description.setValue(value);
2161          }
2162          return this;
2163        }
2164
2165        /**
2166         * @return {@link #code} (A coded or unformatted textual definition of this warning.)
2167         */
2168        public CodeableConcept getCode() { 
2169          if (this.code == null)
2170            if (Configuration.errorOnAutoCreate())
2171              throw new Error("Attempt to auto-create ClinicalUseDefinitionWarningComponent.code");
2172            else if (Configuration.doAutoCreate())
2173              this.code = new CodeableConcept(); // cc
2174          return this.code;
2175        }
2176
2177        public boolean hasCode() { 
2178          return this.code != null && !this.code.isEmpty();
2179        }
2180
2181        /**
2182         * @param value {@link #code} (A coded or unformatted textual definition of this warning.)
2183         */
2184        public ClinicalUseDefinitionWarningComponent setCode(CodeableConcept value) { 
2185          this.code = value;
2186          return this;
2187        }
2188
2189        protected void listChildren(List<Property> children) {
2190          super.listChildren(children);
2191          children.add(new Property("description", "markdown", "A textual definition of this warning, with formatting.", 0, 1, description));
2192          children.add(new Property("code", "CodeableConcept", "A coded or unformatted textual definition of this warning.", 0, 1, code));
2193        }
2194
2195        @Override
2196        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2197          switch (_hash) {
2198          case -1724546052: /*description*/  return new Property("description", "markdown", "A textual definition of this warning, with formatting.", 0, 1, description);
2199          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A coded or unformatted textual definition of this warning.", 0, 1, code);
2200          default: return super.getNamedProperty(_hash, _name, _checkValid);
2201          }
2202
2203        }
2204
2205      @Override
2206      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2207        switch (hash) {
2208        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2209        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
2210        default: return super.getProperty(hash, name, checkValid);
2211        }
2212
2213      }
2214
2215      @Override
2216      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2217        switch (hash) {
2218        case -1724546052: // description
2219          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2220          return value;
2221        case 3059181: // code
2222          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2223          return value;
2224        default: return super.setProperty(hash, name, value);
2225        }
2226
2227      }
2228
2229      @Override
2230      public Base setProperty(String name, Base value) throws FHIRException {
2231        if (name.equals("description")) {
2232          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2233        } else if (name.equals("code")) {
2234          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2235        } else
2236          return super.setProperty(name, value);
2237        return value;
2238      }
2239
2240      @Override
2241      public Base makeProperty(int hash, String name) throws FHIRException {
2242        switch (hash) {
2243        case -1724546052:  return getDescriptionElement();
2244        case 3059181:  return getCode();
2245        default: return super.makeProperty(hash, name);
2246        }
2247
2248      }
2249
2250      @Override
2251      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2252        switch (hash) {
2253        case -1724546052: /*description*/ return new String[] {"markdown"};
2254        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2255        default: return super.getTypesForProperty(hash, name);
2256        }
2257
2258      }
2259
2260      @Override
2261      public Base addChild(String name) throws FHIRException {
2262        if (name.equals("description")) {
2263          throw new FHIRException("Cannot call addChild on a primitive type ClinicalUseDefinition.warning.description");
2264        }
2265        else if (name.equals("code")) {
2266          this.code = new CodeableConcept();
2267          return this.code;
2268        }
2269        else
2270          return super.addChild(name);
2271      }
2272
2273      public ClinicalUseDefinitionWarningComponent copy() {
2274        ClinicalUseDefinitionWarningComponent dst = new ClinicalUseDefinitionWarningComponent();
2275        copyValues(dst);
2276        return dst;
2277      }
2278
2279      public void copyValues(ClinicalUseDefinitionWarningComponent dst) {
2280        super.copyValues(dst);
2281        dst.description = description == null ? null : description.copy();
2282        dst.code = code == null ? null : code.copy();
2283      }
2284
2285      @Override
2286      public boolean equalsDeep(Base other_) {
2287        if (!super.equalsDeep(other_))
2288          return false;
2289        if (!(other_ instanceof ClinicalUseDefinitionWarningComponent))
2290          return false;
2291        ClinicalUseDefinitionWarningComponent o = (ClinicalUseDefinitionWarningComponent) other_;
2292        return compareDeep(description, o.description, true) && compareDeep(code, o.code, true);
2293      }
2294
2295      @Override
2296      public boolean equalsShallow(Base other_) {
2297        if (!super.equalsShallow(other_))
2298          return false;
2299        if (!(other_ instanceof ClinicalUseDefinitionWarningComponent))
2300          return false;
2301        ClinicalUseDefinitionWarningComponent o = (ClinicalUseDefinitionWarningComponent) other_;
2302        return compareValues(description, o.description, true);
2303      }
2304
2305      public boolean isEmpty() {
2306        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(description, code);
2307      }
2308
2309  public String fhirType() {
2310    return "ClinicalUseDefinition.warning";
2311
2312  }
2313
2314  }
2315
2316    /**
2317     * Business identifier for this issue.
2318     */
2319    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2320    @Description(shortDefinition="Business identifier for this issue", formalDefinition="Business identifier for this issue." )
2321    protected List<Identifier> identifier;
2322
2323    /**
2324     * indication | contraindication | interaction | undesirable-effect | warning.
2325     */
2326    @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2327    @Description(shortDefinition="indication | contraindication | interaction | undesirable-effect | warning", formalDefinition="indication | contraindication | interaction | undesirable-effect | warning." )
2328    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-use-issue-type")
2329    protected Enumeration<ClinicalUseIssueType> type;
2330
2331    /**
2332     * A categorisation of the issue, primarily for dividing warnings into subject heading areas such as "Pregnancy and Lactation", "Overdose", "Effects on Ability to Drive and Use Machines".
2333     */
2334    @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2335    @Description(shortDefinition="A categorisation of the issue, primarily for dividing warnings into subject heading areas such as \"Pregnancy and Lactation\", \"Overdose\", \"Effects on Ability to Drive and Use Machines\"", formalDefinition="A categorisation of the issue, primarily for dividing warnings into subject heading areas such as \"Pregnancy and Lactation\", \"Overdose\", \"Effects on Ability to Drive and Use Machines\"." )
2336    protected List<CodeableConcept> category;
2337
2338    /**
2339     * The medication or procedure for which this is an indication.
2340     */
2341    @Child(name = "subject", type = {MedicinalProductDefinition.class, Medication.class, ActivityDefinition.class, PlanDefinition.class, Device.class, DeviceDefinition.class, Substance.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2342    @Description(shortDefinition="The medication or procedure for which this is an indication", formalDefinition="The medication or procedure for which this is an indication." )
2343    protected List<Reference> subject;
2344
2345    /**
2346     * Whether this is a current issue or one that has been retired etc.
2347     */
2348    @Child(name = "status", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
2349    @Description(shortDefinition="Whether this is a current issue or one that has been retired etc", formalDefinition="Whether this is a current issue or one that has been retired etc." )
2350    protected CodeableConcept status;
2351
2352    /**
2353     * Specifics for when this is a contraindication.
2354     */
2355    @Child(name = "contraindication", type = {}, order=5, min=0, max=1, modifier=false, summary=true)
2356    @Description(shortDefinition="Specifics for when this is a contraindication", formalDefinition="Specifics for when this is a contraindication." )
2357    protected ClinicalUseDefinitionContraindicationComponent contraindication;
2358
2359    /**
2360     * Specifics for when this is an indication.
2361     */
2362    @Child(name = "indication", type = {}, order=6, min=0, max=1, modifier=false, summary=true)
2363    @Description(shortDefinition="Specifics for when this is an indication", formalDefinition="Specifics for when this is an indication." )
2364    protected ClinicalUseDefinitionIndicationComponent indication;
2365
2366    /**
2367     * Specifics for when this is an interaction.
2368     */
2369    @Child(name = "interaction", type = {}, order=7, min=0, max=1, modifier=false, summary=true)
2370    @Description(shortDefinition="Specifics for when this is an interaction", formalDefinition="Specifics for when this is an interaction." )
2371    protected ClinicalUseDefinitionInteractionComponent interaction;
2372
2373    /**
2374     * The population group to which this applies.
2375     */
2376    @Child(name = "population", type = {Group.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2377    @Description(shortDefinition="The population group to which this applies", formalDefinition="The population group to which this applies." )
2378    protected List<Reference> population;
2379
2380    /**
2381     * Describe the undesirable effects of the medicinal product.
2382     */
2383    @Child(name = "undesirableEffect", type = {}, order=9, min=0, max=1, modifier=false, summary=true)
2384    @Description(shortDefinition="A possible negative outcome from the use of this treatment", formalDefinition="Describe the undesirable effects of the medicinal product." )
2385    protected ClinicalUseDefinitionUndesirableEffectComponent undesirableEffect;
2386
2387    /**
2388     * A critical piece of information about environmental, health or physical risks or hazards that serve as caution to the user. For example 'Do not operate heavy machinery', 'May cause drowsiness', or 'Get medical advice/attention if you feel unwell'.
2389     */
2390    @Child(name = "warning", type = {}, order=10, min=0, max=1, modifier=false, summary=true)
2391    @Description(shortDefinition="A critical piece of information about environmental, health or physical risks or hazards that serve as caution to the user. For example 'Do not operate heavy machinery', 'May cause drowsiness' or 'Get medical advice/attention if you feel unwell'", formalDefinition="A critical piece of information about environmental, health or physical risks or hazards that serve as caution to the user. For example 'Do not operate heavy machinery', 'May cause drowsiness', or 'Get medical advice/attention if you feel unwell'." )
2392    protected ClinicalUseDefinitionWarningComponent warning;
2393
2394    private static final long serialVersionUID = 258286207L;
2395
2396  /**
2397   * Constructor
2398   */
2399    public ClinicalUseDefinition() {
2400      super();
2401    }
2402
2403  /**
2404   * Constructor
2405   */
2406    public ClinicalUseDefinition(ClinicalUseIssueType type) {
2407      super();
2408      this.setType(type);
2409    }
2410
2411    /**
2412     * @return {@link #identifier} (Business identifier for this issue.)
2413     */
2414    public List<Identifier> getIdentifier() { 
2415      if (this.identifier == null)
2416        this.identifier = new ArrayList<Identifier>();
2417      return this.identifier;
2418    }
2419
2420    /**
2421     * @return Returns a reference to <code>this</code> for easy method chaining
2422     */
2423    public ClinicalUseDefinition setIdentifier(List<Identifier> theIdentifier) { 
2424      this.identifier = theIdentifier;
2425      return this;
2426    }
2427
2428    public boolean hasIdentifier() { 
2429      if (this.identifier == null)
2430        return false;
2431      for (Identifier item : this.identifier)
2432        if (!item.isEmpty())
2433          return true;
2434      return false;
2435    }
2436
2437    public Identifier addIdentifier() { //3
2438      Identifier t = new Identifier();
2439      if (this.identifier == null)
2440        this.identifier = new ArrayList<Identifier>();
2441      this.identifier.add(t);
2442      return t;
2443    }
2444
2445    public ClinicalUseDefinition addIdentifier(Identifier t) { //3
2446      if (t == null)
2447        return this;
2448      if (this.identifier == null)
2449        this.identifier = new ArrayList<Identifier>();
2450      this.identifier.add(t);
2451      return this;
2452    }
2453
2454    /**
2455     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2456     */
2457    public Identifier getIdentifierFirstRep() { 
2458      if (getIdentifier().isEmpty()) {
2459        addIdentifier();
2460      }
2461      return getIdentifier().get(0);
2462    }
2463
2464    /**
2465     * @return {@link #type} (indication | contraindication | interaction | undesirable-effect | warning.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2466     */
2467    public Enumeration<ClinicalUseIssueType> getTypeElement() { 
2468      if (this.type == null)
2469        if (Configuration.errorOnAutoCreate())
2470          throw new Error("Attempt to auto-create ClinicalUseDefinition.type");
2471        else if (Configuration.doAutoCreate())
2472          this.type = new Enumeration<ClinicalUseIssueType>(new ClinicalUseIssueTypeEnumFactory()); // bb
2473      return this.type;
2474    }
2475
2476    public boolean hasTypeElement() { 
2477      return this.type != null && !this.type.isEmpty();
2478    }
2479
2480    public boolean hasType() { 
2481      return this.type != null && !this.type.isEmpty();
2482    }
2483
2484    /**
2485     * @param value {@link #type} (indication | contraindication | interaction | undesirable-effect | warning.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
2486     */
2487    public ClinicalUseDefinition setTypeElement(Enumeration<ClinicalUseIssueType> value) { 
2488      this.type = value;
2489      return this;
2490    }
2491
2492    /**
2493     * @return indication | contraindication | interaction | undesirable-effect | warning.
2494     */
2495    public ClinicalUseIssueType getType() { 
2496      return this.type == null ? null : this.type.getValue();
2497    }
2498
2499    /**
2500     * @param value indication | contraindication | interaction | undesirable-effect | warning.
2501     */
2502    public ClinicalUseDefinition setType(ClinicalUseIssueType value) { 
2503        if (this.type == null)
2504          this.type = new Enumeration<ClinicalUseIssueType>(new ClinicalUseIssueTypeEnumFactory());
2505        this.type.setValue(value);
2506      return this;
2507    }
2508
2509    /**
2510     * @return {@link #category} (A categorisation of the issue, primarily for dividing warnings into subject heading areas such as "Pregnancy and Lactation", "Overdose", "Effects on Ability to Drive and Use Machines".)
2511     */
2512    public List<CodeableConcept> getCategory() { 
2513      if (this.category == null)
2514        this.category = new ArrayList<CodeableConcept>();
2515      return this.category;
2516    }
2517
2518    /**
2519     * @return Returns a reference to <code>this</code> for easy method chaining
2520     */
2521    public ClinicalUseDefinition setCategory(List<CodeableConcept> theCategory) { 
2522      this.category = theCategory;
2523      return this;
2524    }
2525
2526    public boolean hasCategory() { 
2527      if (this.category == null)
2528        return false;
2529      for (CodeableConcept item : this.category)
2530        if (!item.isEmpty())
2531          return true;
2532      return false;
2533    }
2534
2535    public CodeableConcept addCategory() { //3
2536      CodeableConcept t = new CodeableConcept();
2537      if (this.category == null)
2538        this.category = new ArrayList<CodeableConcept>();
2539      this.category.add(t);
2540      return t;
2541    }
2542
2543    public ClinicalUseDefinition addCategory(CodeableConcept t) { //3
2544      if (t == null)
2545        return this;
2546      if (this.category == null)
2547        this.category = new ArrayList<CodeableConcept>();
2548      this.category.add(t);
2549      return this;
2550    }
2551
2552    /**
2553     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
2554     */
2555    public CodeableConcept getCategoryFirstRep() { 
2556      if (getCategory().isEmpty()) {
2557        addCategory();
2558      }
2559      return getCategory().get(0);
2560    }
2561
2562    /**
2563     * @return {@link #subject} (The medication or procedure for which this is an indication.)
2564     */
2565    public List<Reference> getSubject() { 
2566      if (this.subject == null)
2567        this.subject = new ArrayList<Reference>();
2568      return this.subject;
2569    }
2570
2571    /**
2572     * @return Returns a reference to <code>this</code> for easy method chaining
2573     */
2574    public ClinicalUseDefinition setSubject(List<Reference> theSubject) { 
2575      this.subject = theSubject;
2576      return this;
2577    }
2578
2579    public boolean hasSubject() { 
2580      if (this.subject == null)
2581        return false;
2582      for (Reference item : this.subject)
2583        if (!item.isEmpty())
2584          return true;
2585      return false;
2586    }
2587
2588    public Reference addSubject() { //3
2589      Reference t = new Reference();
2590      if (this.subject == null)
2591        this.subject = new ArrayList<Reference>();
2592      this.subject.add(t);
2593      return t;
2594    }
2595
2596    public ClinicalUseDefinition addSubject(Reference t) { //3
2597      if (t == null)
2598        return this;
2599      if (this.subject == null)
2600        this.subject = new ArrayList<Reference>();
2601      this.subject.add(t);
2602      return this;
2603    }
2604
2605    /**
2606     * @return The first repetition of repeating field {@link #subject}, creating it if it does not already exist {3}
2607     */
2608    public Reference getSubjectFirstRep() { 
2609      if (getSubject().isEmpty()) {
2610        addSubject();
2611      }
2612      return getSubject().get(0);
2613    }
2614
2615    /**
2616     * @return {@link #status} (Whether this is a current issue or one that has been retired etc.)
2617     */
2618    public CodeableConcept getStatus() { 
2619      if (this.status == null)
2620        if (Configuration.errorOnAutoCreate())
2621          throw new Error("Attempt to auto-create ClinicalUseDefinition.status");
2622        else if (Configuration.doAutoCreate())
2623          this.status = new CodeableConcept(); // cc
2624      return this.status;
2625    }
2626
2627    public boolean hasStatus() { 
2628      return this.status != null && !this.status.isEmpty();
2629    }
2630
2631    /**
2632     * @param value {@link #status} (Whether this is a current issue or one that has been retired etc.)
2633     */
2634    public ClinicalUseDefinition setStatus(CodeableConcept value) { 
2635      this.status = value;
2636      return this;
2637    }
2638
2639    /**
2640     * @return {@link #contraindication} (Specifics for when this is a contraindication.)
2641     */
2642    public ClinicalUseDefinitionContraindicationComponent getContraindication() { 
2643      if (this.contraindication == null)
2644        if (Configuration.errorOnAutoCreate())
2645          throw new Error("Attempt to auto-create ClinicalUseDefinition.contraindication");
2646        else if (Configuration.doAutoCreate())
2647          this.contraindication = new ClinicalUseDefinitionContraindicationComponent(); // cc
2648      return this.contraindication;
2649    }
2650
2651    public boolean hasContraindication() { 
2652      return this.contraindication != null && !this.contraindication.isEmpty();
2653    }
2654
2655    /**
2656     * @param value {@link #contraindication} (Specifics for when this is a contraindication.)
2657     */
2658    public ClinicalUseDefinition setContraindication(ClinicalUseDefinitionContraindicationComponent value) { 
2659      this.contraindication = value;
2660      return this;
2661    }
2662
2663    /**
2664     * @return {@link #indication} (Specifics for when this is an indication.)
2665     */
2666    public ClinicalUseDefinitionIndicationComponent getIndication() { 
2667      if (this.indication == null)
2668        if (Configuration.errorOnAutoCreate())
2669          throw new Error("Attempt to auto-create ClinicalUseDefinition.indication");
2670        else if (Configuration.doAutoCreate())
2671          this.indication = new ClinicalUseDefinitionIndicationComponent(); // cc
2672      return this.indication;
2673    }
2674
2675    public boolean hasIndication() { 
2676      return this.indication != null && !this.indication.isEmpty();
2677    }
2678
2679    /**
2680     * @param value {@link #indication} (Specifics for when this is an indication.)
2681     */
2682    public ClinicalUseDefinition setIndication(ClinicalUseDefinitionIndicationComponent value) { 
2683      this.indication = value;
2684      return this;
2685    }
2686
2687    /**
2688     * @return {@link #interaction} (Specifics for when this is an interaction.)
2689     */
2690    public ClinicalUseDefinitionInteractionComponent getInteraction() { 
2691      if (this.interaction == null)
2692        if (Configuration.errorOnAutoCreate())
2693          throw new Error("Attempt to auto-create ClinicalUseDefinition.interaction");
2694        else if (Configuration.doAutoCreate())
2695          this.interaction = new ClinicalUseDefinitionInteractionComponent(); // cc
2696      return this.interaction;
2697    }
2698
2699    public boolean hasInteraction() { 
2700      return this.interaction != null && !this.interaction.isEmpty();
2701    }
2702
2703    /**
2704     * @param value {@link #interaction} (Specifics for when this is an interaction.)
2705     */
2706    public ClinicalUseDefinition setInteraction(ClinicalUseDefinitionInteractionComponent value) { 
2707      this.interaction = value;
2708      return this;
2709    }
2710
2711    /**
2712     * @return {@link #population} (The population group to which this applies.)
2713     */
2714    public List<Reference> getPopulation() { 
2715      if (this.population == null)
2716        this.population = new ArrayList<Reference>();
2717      return this.population;
2718    }
2719
2720    /**
2721     * @return Returns a reference to <code>this</code> for easy method chaining
2722     */
2723    public ClinicalUseDefinition setPopulation(List<Reference> thePopulation) { 
2724      this.population = thePopulation;
2725      return this;
2726    }
2727
2728    public boolean hasPopulation() { 
2729      if (this.population == null)
2730        return false;
2731      for (Reference item : this.population)
2732        if (!item.isEmpty())
2733          return true;
2734      return false;
2735    }
2736
2737    public Reference addPopulation() { //3
2738      Reference t = new Reference();
2739      if (this.population == null)
2740        this.population = new ArrayList<Reference>();
2741      this.population.add(t);
2742      return t;
2743    }
2744
2745    public ClinicalUseDefinition addPopulation(Reference t) { //3
2746      if (t == null)
2747        return this;
2748      if (this.population == null)
2749        this.population = new ArrayList<Reference>();
2750      this.population.add(t);
2751      return this;
2752    }
2753
2754    /**
2755     * @return The first repetition of repeating field {@link #population}, creating it if it does not already exist {3}
2756     */
2757    public Reference getPopulationFirstRep() { 
2758      if (getPopulation().isEmpty()) {
2759        addPopulation();
2760      }
2761      return getPopulation().get(0);
2762    }
2763
2764    /**
2765     * @return {@link #undesirableEffect} (Describe the undesirable effects of the medicinal product.)
2766     */
2767    public ClinicalUseDefinitionUndesirableEffectComponent getUndesirableEffect() { 
2768      if (this.undesirableEffect == null)
2769        if (Configuration.errorOnAutoCreate())
2770          throw new Error("Attempt to auto-create ClinicalUseDefinition.undesirableEffect");
2771        else if (Configuration.doAutoCreate())
2772          this.undesirableEffect = new ClinicalUseDefinitionUndesirableEffectComponent(); // cc
2773      return this.undesirableEffect;
2774    }
2775
2776    public boolean hasUndesirableEffect() { 
2777      return this.undesirableEffect != null && !this.undesirableEffect.isEmpty();
2778    }
2779
2780    /**
2781     * @param value {@link #undesirableEffect} (Describe the undesirable effects of the medicinal product.)
2782     */
2783    public ClinicalUseDefinition setUndesirableEffect(ClinicalUseDefinitionUndesirableEffectComponent value) { 
2784      this.undesirableEffect = value;
2785      return this;
2786    }
2787
2788    /**
2789     * @return {@link #warning} (A critical piece of information about environmental, health or physical risks or hazards that serve as caution to the user. For example 'Do not operate heavy machinery', 'May cause drowsiness', or 'Get medical advice/attention if you feel unwell'.)
2790     */
2791    public ClinicalUseDefinitionWarningComponent getWarning() { 
2792      if (this.warning == null)
2793        if (Configuration.errorOnAutoCreate())
2794          throw new Error("Attempt to auto-create ClinicalUseDefinition.warning");
2795        else if (Configuration.doAutoCreate())
2796          this.warning = new ClinicalUseDefinitionWarningComponent(); // cc
2797      return this.warning;
2798    }
2799
2800    public boolean hasWarning() { 
2801      return this.warning != null && !this.warning.isEmpty();
2802    }
2803
2804    /**
2805     * @param value {@link #warning} (A critical piece of information about environmental, health or physical risks or hazards that serve as caution to the user. For example 'Do not operate heavy machinery', 'May cause drowsiness', or 'Get medical advice/attention if you feel unwell'.)
2806     */
2807    public ClinicalUseDefinition setWarning(ClinicalUseDefinitionWarningComponent value) { 
2808      this.warning = value;
2809      return this;
2810    }
2811
2812      protected void listChildren(List<Property> children) {
2813        super.listChildren(children);
2814        children.add(new Property("identifier", "Identifier", "Business identifier for this issue.", 0, java.lang.Integer.MAX_VALUE, identifier));
2815        children.add(new Property("type", "code", "indication | contraindication | interaction | undesirable-effect | warning.", 0, 1, type));
2816        children.add(new Property("category", "CodeableConcept", "A categorisation of the issue, primarily for dividing warnings into subject heading areas such as \"Pregnancy and Lactation\", \"Overdose\", \"Effects on Ability to Drive and Use Machines\".", 0, java.lang.Integer.MAX_VALUE, category));
2817        children.add(new Property("subject", "Reference(MedicinalProductDefinition|Medication|ActivityDefinition|PlanDefinition|Device|DeviceDefinition|Substance)", "The medication or procedure for which this is an indication.", 0, java.lang.Integer.MAX_VALUE, subject));
2818        children.add(new Property("status", "CodeableConcept", "Whether this is a current issue or one that has been retired etc.", 0, 1, status));
2819        children.add(new Property("contraindication", "", "Specifics for when this is a contraindication.", 0, 1, contraindication));
2820        children.add(new Property("indication", "", "Specifics for when this is an indication.", 0, 1, indication));
2821        children.add(new Property("interaction", "", "Specifics for when this is an interaction.", 0, 1, interaction));
2822        children.add(new Property("population", "Reference(Group)", "The population group to which this applies.", 0, java.lang.Integer.MAX_VALUE, population));
2823        children.add(new Property("undesirableEffect", "", "Describe the undesirable effects of the medicinal product.", 0, 1, undesirableEffect));
2824        children.add(new Property("warning", "", "A critical piece of information about environmental, health or physical risks or hazards that serve as caution to the user. For example 'Do not operate heavy machinery', 'May cause drowsiness', or 'Get medical advice/attention if you feel unwell'.", 0, 1, warning));
2825      }
2826
2827      @Override
2828      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2829        switch (_hash) {
2830        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifier for this issue.", 0, java.lang.Integer.MAX_VALUE, identifier);
2831        case 3575610: /*type*/  return new Property("type", "code", "indication | contraindication | interaction | undesirable-effect | warning.", 0, 1, type);
2832        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "A categorisation of the issue, primarily for dividing warnings into subject heading areas such as \"Pregnancy and Lactation\", \"Overdose\", \"Effects on Ability to Drive and Use Machines\".", 0, java.lang.Integer.MAX_VALUE, category);
2833        case -1867885268: /*subject*/  return new Property("subject", "Reference(MedicinalProductDefinition|Medication|ActivityDefinition|PlanDefinition|Device|DeviceDefinition|Substance)", "The medication or procedure for which this is an indication.", 0, java.lang.Integer.MAX_VALUE, subject);
2834        case -892481550: /*status*/  return new Property("status", "CodeableConcept", "Whether this is a current issue or one that has been retired etc.", 0, 1, status);
2835        case 107135229: /*contraindication*/  return new Property("contraindication", "", "Specifics for when this is a contraindication.", 0, 1, contraindication);
2836        case -597168804: /*indication*/  return new Property("indication", "", "Specifics for when this is an indication.", 0, 1, indication);
2837        case 1844104722: /*interaction*/  return new Property("interaction", "", "Specifics for when this is an interaction.", 0, 1, interaction);
2838        case -2023558323: /*population*/  return new Property("population", "Reference(Group)", "The population group to which this applies.", 0, java.lang.Integer.MAX_VALUE, population);
2839        case 444367565: /*undesirableEffect*/  return new Property("undesirableEffect", "", "Describe the undesirable effects of the medicinal product.", 0, 1, undesirableEffect);
2840        case 1124446108: /*warning*/  return new Property("warning", "", "A critical piece of information about environmental, health or physical risks or hazards that serve as caution to the user. For example 'Do not operate heavy machinery', 'May cause drowsiness', or 'Get medical advice/attention if you feel unwell'.", 0, 1, warning);
2841        default: return super.getNamedProperty(_hash, _name, _checkValid);
2842        }
2843
2844      }
2845
2846      @Override
2847      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2848        switch (hash) {
2849        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2850        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<ClinicalUseIssueType>
2851        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2852        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // Reference
2853        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept
2854        case 107135229: /*contraindication*/ return this.contraindication == null ? new Base[0] : new Base[] {this.contraindication}; // ClinicalUseDefinitionContraindicationComponent
2855        case -597168804: /*indication*/ return this.indication == null ? new Base[0] : new Base[] {this.indication}; // ClinicalUseDefinitionIndicationComponent
2856        case 1844104722: /*interaction*/ return this.interaction == null ? new Base[0] : new Base[] {this.interaction}; // ClinicalUseDefinitionInteractionComponent
2857        case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // Reference
2858        case 444367565: /*undesirableEffect*/ return this.undesirableEffect == null ? new Base[0] : new Base[] {this.undesirableEffect}; // ClinicalUseDefinitionUndesirableEffectComponent
2859        case 1124446108: /*warning*/ return this.warning == null ? new Base[0] : new Base[] {this.warning}; // ClinicalUseDefinitionWarningComponent
2860        default: return super.getProperty(hash, name, checkValid);
2861        }
2862
2863      }
2864
2865      @Override
2866      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2867        switch (hash) {
2868        case -1618432855: // identifier
2869          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2870          return value;
2871        case 3575610: // type
2872          value = new ClinicalUseIssueTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
2873          this.type = (Enumeration) value; // Enumeration<ClinicalUseIssueType>
2874          return value;
2875        case 50511102: // category
2876          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2877          return value;
2878        case -1867885268: // subject
2879          this.getSubject().add(TypeConvertor.castToReference(value)); // Reference
2880          return value;
2881        case -892481550: // status
2882          this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2883          return value;
2884        case 107135229: // contraindication
2885          this.contraindication = (ClinicalUseDefinitionContraindicationComponent) value; // ClinicalUseDefinitionContraindicationComponent
2886          return value;
2887        case -597168804: // indication
2888          this.indication = (ClinicalUseDefinitionIndicationComponent) value; // ClinicalUseDefinitionIndicationComponent
2889          return value;
2890        case 1844104722: // interaction
2891          this.interaction = (ClinicalUseDefinitionInteractionComponent) value; // ClinicalUseDefinitionInteractionComponent
2892          return value;
2893        case -2023558323: // population
2894          this.getPopulation().add(TypeConvertor.castToReference(value)); // Reference
2895          return value;
2896        case 444367565: // undesirableEffect
2897          this.undesirableEffect = (ClinicalUseDefinitionUndesirableEffectComponent) value; // ClinicalUseDefinitionUndesirableEffectComponent
2898          return value;
2899        case 1124446108: // warning
2900          this.warning = (ClinicalUseDefinitionWarningComponent) value; // ClinicalUseDefinitionWarningComponent
2901          return value;
2902        default: return super.setProperty(hash, name, value);
2903        }
2904
2905      }
2906
2907      @Override
2908      public Base setProperty(String name, Base value) throws FHIRException {
2909        if (name.equals("identifier")) {
2910          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2911        } else if (name.equals("type")) {
2912          value = new ClinicalUseIssueTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
2913          this.type = (Enumeration) value; // Enumeration<ClinicalUseIssueType>
2914        } else if (name.equals("category")) {
2915          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
2916        } else if (name.equals("subject")) {
2917          this.getSubject().add(TypeConvertor.castToReference(value));
2918        } else if (name.equals("status")) {
2919          this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2920        } else if (name.equals("contraindication")) {
2921          this.contraindication = (ClinicalUseDefinitionContraindicationComponent) value; // ClinicalUseDefinitionContraindicationComponent
2922        } else if (name.equals("indication")) {
2923          this.indication = (ClinicalUseDefinitionIndicationComponent) value; // ClinicalUseDefinitionIndicationComponent
2924        } else if (name.equals("interaction")) {
2925          this.interaction = (ClinicalUseDefinitionInteractionComponent) value; // ClinicalUseDefinitionInteractionComponent
2926        } else if (name.equals("population")) {
2927          this.getPopulation().add(TypeConvertor.castToReference(value));
2928        } else if (name.equals("undesirableEffect")) {
2929          this.undesirableEffect = (ClinicalUseDefinitionUndesirableEffectComponent) value; // ClinicalUseDefinitionUndesirableEffectComponent
2930        } else if (name.equals("warning")) {
2931          this.warning = (ClinicalUseDefinitionWarningComponent) value; // ClinicalUseDefinitionWarningComponent
2932        } else
2933          return super.setProperty(name, value);
2934        return value;
2935      }
2936
2937      @Override
2938      public Base makeProperty(int hash, String name) throws FHIRException {
2939        switch (hash) {
2940        case -1618432855:  return addIdentifier(); 
2941        case 3575610:  return getTypeElement();
2942        case 50511102:  return addCategory(); 
2943        case -1867885268:  return addSubject(); 
2944        case -892481550:  return getStatus();
2945        case 107135229:  return getContraindication();
2946        case -597168804:  return getIndication();
2947        case 1844104722:  return getInteraction();
2948        case -2023558323:  return addPopulation(); 
2949        case 444367565:  return getUndesirableEffect();
2950        case 1124446108:  return getWarning();
2951        default: return super.makeProperty(hash, name);
2952        }
2953
2954      }
2955
2956      @Override
2957      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2958        switch (hash) {
2959        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2960        case 3575610: /*type*/ return new String[] {"code"};
2961        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2962        case -1867885268: /*subject*/ return new String[] {"Reference"};
2963        case -892481550: /*status*/ return new String[] {"CodeableConcept"};
2964        case 107135229: /*contraindication*/ return new String[] {};
2965        case -597168804: /*indication*/ return new String[] {};
2966        case 1844104722: /*interaction*/ return new String[] {};
2967        case -2023558323: /*population*/ return new String[] {"Reference"};
2968        case 444367565: /*undesirableEffect*/ return new String[] {};
2969        case 1124446108: /*warning*/ return new String[] {};
2970        default: return super.getTypesForProperty(hash, name);
2971        }
2972
2973      }
2974
2975      @Override
2976      public Base addChild(String name) throws FHIRException {
2977        if (name.equals("identifier")) {
2978          return addIdentifier();
2979        }
2980        else if (name.equals("type")) {
2981          throw new FHIRException("Cannot call addChild on a primitive type ClinicalUseDefinition.type");
2982        }
2983        else if (name.equals("category")) {
2984          return addCategory();
2985        }
2986        else if (name.equals("subject")) {
2987          return addSubject();
2988        }
2989        else if (name.equals("status")) {
2990          this.status = new CodeableConcept();
2991          return this.status;
2992        }
2993        else if (name.equals("contraindication")) {
2994          this.contraindication = new ClinicalUseDefinitionContraindicationComponent();
2995          return this.contraindication;
2996        }
2997        else if (name.equals("indication")) {
2998          this.indication = new ClinicalUseDefinitionIndicationComponent();
2999          return this.indication;
3000        }
3001        else if (name.equals("interaction")) {
3002          this.interaction = new ClinicalUseDefinitionInteractionComponent();
3003          return this.interaction;
3004        }
3005        else if (name.equals("population")) {
3006          return addPopulation();
3007        }
3008        else if (name.equals("undesirableEffect")) {
3009          this.undesirableEffect = new ClinicalUseDefinitionUndesirableEffectComponent();
3010          return this.undesirableEffect;
3011        }
3012        else if (name.equals("warning")) {
3013          this.warning = new ClinicalUseDefinitionWarningComponent();
3014          return this.warning;
3015        }
3016        else
3017          return super.addChild(name);
3018      }
3019
3020  public String fhirType() {
3021    return "ClinicalUseDefinition";
3022
3023  }
3024
3025      public ClinicalUseDefinition copy() {
3026        ClinicalUseDefinition dst = new ClinicalUseDefinition();
3027        copyValues(dst);
3028        return dst;
3029      }
3030
3031      public void copyValues(ClinicalUseDefinition dst) {
3032        super.copyValues(dst);
3033        if (identifier != null) {
3034          dst.identifier = new ArrayList<Identifier>();
3035          for (Identifier i : identifier)
3036            dst.identifier.add(i.copy());
3037        };
3038        dst.type = type == null ? null : type.copy();
3039        if (category != null) {
3040          dst.category = new ArrayList<CodeableConcept>();
3041          for (CodeableConcept i : category)
3042            dst.category.add(i.copy());
3043        };
3044        if (subject != null) {
3045          dst.subject = new ArrayList<Reference>();
3046          for (Reference i : subject)
3047            dst.subject.add(i.copy());
3048        };
3049        dst.status = status == null ? null : status.copy();
3050        dst.contraindication = contraindication == null ? null : contraindication.copy();
3051        dst.indication = indication == null ? null : indication.copy();
3052        dst.interaction = interaction == null ? null : interaction.copy();
3053        if (population != null) {
3054          dst.population = new ArrayList<Reference>();
3055          for (Reference i : population)
3056            dst.population.add(i.copy());
3057        };
3058        dst.undesirableEffect = undesirableEffect == null ? null : undesirableEffect.copy();
3059        dst.warning = warning == null ? null : warning.copy();
3060      }
3061
3062      protected ClinicalUseDefinition typedCopy() {
3063        return copy();
3064      }
3065
3066      @Override
3067      public boolean equalsDeep(Base other_) {
3068        if (!super.equalsDeep(other_))
3069          return false;
3070        if (!(other_ instanceof ClinicalUseDefinition))
3071          return false;
3072        ClinicalUseDefinition o = (ClinicalUseDefinition) other_;
3073        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(category, o.category, true)
3074           && compareDeep(subject, o.subject, true) && compareDeep(status, o.status, true) && compareDeep(contraindication, o.contraindication, true)
3075           && compareDeep(indication, o.indication, true) && compareDeep(interaction, o.interaction, true)
3076           && compareDeep(population, o.population, true) && compareDeep(undesirableEffect, o.undesirableEffect, true)
3077           && compareDeep(warning, o.warning, true);
3078      }
3079
3080      @Override
3081      public boolean equalsShallow(Base other_) {
3082        if (!super.equalsShallow(other_))
3083          return false;
3084        if (!(other_ instanceof ClinicalUseDefinition))
3085          return false;
3086        ClinicalUseDefinition o = (ClinicalUseDefinition) other_;
3087        return compareValues(type, o.type, true);
3088      }
3089
3090      public boolean isEmpty() {
3091        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, category
3092          , subject, status, contraindication, indication, interaction, population, undesirableEffect
3093          , warning);
3094      }
3095
3096  @Override
3097  public ResourceType getResourceType() {
3098    return ResourceType.ClinicalUseDefinition;
3099   }
3100
3101 /**
3102   * Search parameter: <b>contraindication-reference</b>
3103   * <p>
3104   * Description: <b>The situation that is being documented as contraindicating against this item, as a reference</b><br>
3105   * Type: <b>reference</b><br>
3106   * Path: <b>ClinicalUseDefinition.contraindication.diseaseSymptomProcedure</b><br>
3107   * </p>
3108   */
3109  @SearchParamDefinition(name="contraindication-reference", path="ClinicalUseDefinition.contraindication.diseaseSymptomProcedure", description="The situation that is being documented as contraindicating against this item, as a reference", type="reference" )
3110  public static final String SP_CONTRAINDICATION_REFERENCE = "contraindication-reference";
3111 /**
3112   * <b>Fluent Client</b> search parameter constant for <b>contraindication-reference</b>
3113   * <p>
3114   * Description: <b>The situation that is being documented as contraindicating against this item, as a reference</b><br>
3115   * Type: <b>reference</b><br>
3116   * Path: <b>ClinicalUseDefinition.contraindication.diseaseSymptomProcedure</b><br>
3117   * </p>
3118   */
3119  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTRAINDICATION_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTRAINDICATION_REFERENCE);
3120
3121/**
3122   * Constant for fluent queries to be used to add include statements. Specifies
3123   * the path value of "<b>ClinicalUseDefinition:contraindication-reference</b>".
3124   */
3125  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTRAINDICATION_REFERENCE = new ca.uhn.fhir.model.api.Include("ClinicalUseDefinition:contraindication-reference").toLocked();
3126
3127 /**
3128   * Search parameter: <b>contraindication</b>
3129   * <p>
3130   * Description: <b>The situation that is being documented as contraindicating against this item, as a code</b><br>
3131   * Type: <b>token</b><br>
3132   * Path: <b>ClinicalUseDefinition.contraindication.diseaseSymptomProcedure</b><br>
3133   * </p>
3134   */
3135  @SearchParamDefinition(name="contraindication", path="ClinicalUseDefinition.contraindication.diseaseSymptomProcedure", description="The situation that is being documented as contraindicating against this item, as a code", type="token" )
3136  public static final String SP_CONTRAINDICATION = "contraindication";
3137 /**
3138   * <b>Fluent Client</b> search parameter constant for <b>contraindication</b>
3139   * <p>
3140   * Description: <b>The situation that is being documented as contraindicating against this item, as a code</b><br>
3141   * Type: <b>token</b><br>
3142   * Path: <b>ClinicalUseDefinition.contraindication.diseaseSymptomProcedure</b><br>
3143   * </p>
3144   */
3145  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTRAINDICATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTRAINDICATION);
3146
3147 /**
3148   * Search parameter: <b>effect-reference</b>
3149   * <p>
3150   * Description: <b>The situation in which the undesirable effect may manifest, as a reference</b><br>
3151   * Type: <b>reference</b><br>
3152   * Path: <b>ClinicalUseDefinition.undesirableEffect.symptomConditionEffect</b><br>
3153   * </p>
3154   */
3155  @SearchParamDefinition(name="effect-reference", path="ClinicalUseDefinition.undesirableEffect.symptomConditionEffect", description="The situation in which the undesirable effect may manifest, as a reference", type="reference" )
3156  public static final String SP_EFFECT_REFERENCE = "effect-reference";
3157 /**
3158   * <b>Fluent Client</b> search parameter constant for <b>effect-reference</b>
3159   * <p>
3160   * Description: <b>The situation in which the undesirable effect may manifest, as a reference</b><br>
3161   * Type: <b>reference</b><br>
3162   * Path: <b>ClinicalUseDefinition.undesirableEffect.symptomConditionEffect</b><br>
3163   * </p>
3164   */
3165  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam EFFECT_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_EFFECT_REFERENCE);
3166
3167/**
3168   * Constant for fluent queries to be used to add include statements. Specifies
3169   * the path value of "<b>ClinicalUseDefinition:effect-reference</b>".
3170   */
3171  public static final ca.uhn.fhir.model.api.Include INCLUDE_EFFECT_REFERENCE = new ca.uhn.fhir.model.api.Include("ClinicalUseDefinition:effect-reference").toLocked();
3172
3173 /**
3174   * Search parameter: <b>effect</b>
3175   * <p>
3176   * Description: <b>The situation in which the undesirable effect may manifest, as a code</b><br>
3177   * Type: <b>token</b><br>
3178   * Path: <b>ClinicalUseDefinition.undesirableEffect.symptomConditionEffect</b><br>
3179   * </p>
3180   */
3181  @SearchParamDefinition(name="effect", path="ClinicalUseDefinition.undesirableEffect.symptomConditionEffect", description="The situation in which the undesirable effect may manifest, as a code", type="token" )
3182  public static final String SP_EFFECT = "effect";
3183 /**
3184   * <b>Fluent Client</b> search parameter constant for <b>effect</b>
3185   * <p>
3186   * Description: <b>The situation in which the undesirable effect may manifest, as a code</b><br>
3187   * Type: <b>token</b><br>
3188   * Path: <b>ClinicalUseDefinition.undesirableEffect.symptomConditionEffect</b><br>
3189   * </p>
3190   */
3191  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EFFECT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EFFECT);
3192
3193 /**
3194   * Search parameter: <b>identifier</b>
3195   * <p>
3196   * Description: <b>Business identifier for this issue</b><br>
3197   * Type: <b>token</b><br>
3198   * Path: <b>ClinicalUseDefinition.identifier</b><br>
3199   * </p>
3200   */
3201  @SearchParamDefinition(name="identifier", path="ClinicalUseDefinition.identifier", description="Business identifier for this issue", type="token" )
3202  public static final String SP_IDENTIFIER = "identifier";
3203 /**
3204   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3205   * <p>
3206   * Description: <b>Business identifier for this issue</b><br>
3207   * Type: <b>token</b><br>
3208   * Path: <b>ClinicalUseDefinition.identifier</b><br>
3209   * </p>
3210   */
3211  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3212
3213 /**
3214   * Search parameter: <b>indication-reference</b>
3215   * <p>
3216   * Description: <b>The situation that is being documented as an indicaton for this item, as a reference</b><br>
3217   * Type: <b>reference</b><br>
3218   * Path: <b>ClinicalUseDefinition.indication.diseaseSymptomProcedure</b><br>
3219   * </p>
3220   */
3221  @SearchParamDefinition(name="indication-reference", path="ClinicalUseDefinition.indication.diseaseSymptomProcedure", description="The situation that is being documented as an indicaton for this item, as a reference", type="reference" )
3222  public static final String SP_INDICATION_REFERENCE = "indication-reference";
3223 /**
3224   * <b>Fluent Client</b> search parameter constant for <b>indication-reference</b>
3225   * <p>
3226   * Description: <b>The situation that is being documented as an indicaton for this item, as a reference</b><br>
3227   * Type: <b>reference</b><br>
3228   * Path: <b>ClinicalUseDefinition.indication.diseaseSymptomProcedure</b><br>
3229   * </p>
3230   */
3231  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INDICATION_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INDICATION_REFERENCE);
3232
3233/**
3234   * Constant for fluent queries to be used to add include statements. Specifies
3235   * the path value of "<b>ClinicalUseDefinition:indication-reference</b>".
3236   */
3237  public static final ca.uhn.fhir.model.api.Include INCLUDE_INDICATION_REFERENCE = new ca.uhn.fhir.model.api.Include("ClinicalUseDefinition:indication-reference").toLocked();
3238
3239 /**
3240   * Search parameter: <b>indication</b>
3241   * <p>
3242   * Description: <b>The situation that is being documented as an indicaton for this item, as a code</b><br>
3243   * Type: <b>token</b><br>
3244   * Path: <b>ClinicalUseDefinition.indication.diseaseSymptomProcedure</b><br>
3245   * </p>
3246   */
3247  @SearchParamDefinition(name="indication", path="ClinicalUseDefinition.indication.diseaseSymptomProcedure", description="The situation that is being documented as an indicaton for this item, as a code", type="token" )
3248  public static final String SP_INDICATION = "indication";
3249 /**
3250   * <b>Fluent Client</b> search parameter constant for <b>indication</b>
3251   * <p>
3252   * Description: <b>The situation that is being documented as an indicaton for this item, as a code</b><br>
3253   * Type: <b>token</b><br>
3254   * Path: <b>ClinicalUseDefinition.indication.diseaseSymptomProcedure</b><br>
3255   * </p>
3256   */
3257  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INDICATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INDICATION);
3258
3259 /**
3260   * Search parameter: <b>interaction</b>
3261   * <p>
3262   * Description: <b>The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction</b><br>
3263   * Type: <b>token</b><br>
3264   * Path: <b>ClinicalUseDefinition.interaction.type</b><br>
3265   * </p>
3266   */
3267  @SearchParamDefinition(name="interaction", path="ClinicalUseDefinition.interaction.type", description="The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction", type="token" )
3268  public static final String SP_INTERACTION = "interaction";
3269 /**
3270   * <b>Fluent Client</b> search parameter constant for <b>interaction</b>
3271   * <p>
3272   * Description: <b>The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction</b><br>
3273   * Type: <b>token</b><br>
3274   * Path: <b>ClinicalUseDefinition.interaction.type</b><br>
3275   * </p>
3276   */
3277  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INTERACTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INTERACTION);
3278
3279 /**
3280   * Search parameter: <b>product</b>
3281   * <p>
3282   * Description: <b>The medicinal product for which this is a clinical usage issue</b><br>
3283   * Type: <b>reference</b><br>
3284   * Path: <b>ClinicalUseDefinition.subject.where(resolve() is MedicinalProductDefinition)</b><br>
3285   * </p>
3286   */
3287  @SearchParamDefinition(name="product", path="ClinicalUseDefinition.subject.where(resolve() is MedicinalProductDefinition)", description="The medicinal product for which this is a clinical usage issue", type="reference", target={ActivityDefinition.class, Device.class, DeviceDefinition.class, Medication.class, MedicinalProductDefinition.class, PlanDefinition.class, Substance.class } )
3288  public static final String SP_PRODUCT = "product";
3289 /**
3290   * <b>Fluent Client</b> search parameter constant for <b>product</b>
3291   * <p>
3292   * Description: <b>The medicinal product for which this is a clinical usage issue</b><br>
3293   * Type: <b>reference</b><br>
3294   * Path: <b>ClinicalUseDefinition.subject.where(resolve() is MedicinalProductDefinition)</b><br>
3295   * </p>
3296   */
3297  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRODUCT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRODUCT);
3298
3299/**
3300   * Constant for fluent queries to be used to add include statements. Specifies
3301   * the path value of "<b>ClinicalUseDefinition:product</b>".
3302   */
3303  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRODUCT = new ca.uhn.fhir.model.api.Include("ClinicalUseDefinition:product").toLocked();
3304
3305 /**
3306   * Search parameter: <b>subject</b>
3307   * <p>
3308   * Description: <b>The resource for which this is a clinical usage issue</b><br>
3309   * Type: <b>reference</b><br>
3310   * Path: <b>ClinicalUseDefinition.subject</b><br>
3311   * </p>
3312   */
3313  @SearchParamDefinition(name="subject", path="ClinicalUseDefinition.subject", description="The resource for which this is a clinical usage issue", type="reference", target={ActivityDefinition.class, Device.class, DeviceDefinition.class, Medication.class, MedicinalProductDefinition.class, PlanDefinition.class, Substance.class } )
3314  public static final String SP_SUBJECT = "subject";
3315 /**
3316   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3317   * <p>
3318   * Description: <b>The resource for which this is a clinical usage issue</b><br>
3319   * Type: <b>reference</b><br>
3320   * Path: <b>ClinicalUseDefinition.subject</b><br>
3321   * </p>
3322   */
3323  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3324
3325/**
3326   * Constant for fluent queries to be used to add include statements. Specifies
3327   * the path value of "<b>ClinicalUseDefinition:subject</b>".
3328   */
3329  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("ClinicalUseDefinition:subject").toLocked();
3330
3331 /**
3332   * Search parameter: <b>type</b>
3333   * <p>
3334   * Description: <b>indication | contraindication | interaction | undesirable-effect | warning</b><br>
3335   * Type: <b>token</b><br>
3336   * Path: <b>ClinicalUseDefinition.type</b><br>
3337   * </p>
3338   */
3339  @SearchParamDefinition(name="type", path="ClinicalUseDefinition.type", description="indication | contraindication | interaction | undesirable-effect | warning", type="token" )
3340  public static final String SP_TYPE = "type";
3341 /**
3342   * <b>Fluent Client</b> search parameter constant for <b>type</b>
3343   * <p>
3344   * Description: <b>indication | contraindication | interaction | undesirable-effect | warning</b><br>
3345   * Type: <b>token</b><br>
3346   * Path: <b>ClinicalUseDefinition.type</b><br>
3347   * </p>
3348   */
3349  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
3350
3351
3352}
3353