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