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