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