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