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 org.hl7.fhir.utilities.Utilities;
037import ca.uhn.fhir.model.api.annotation.ResourceDef;
038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
039import ca.uhn.fhir.model.api.annotation.Child;
040import ca.uhn.fhir.model.api.annotation.ChildOrder;
041import ca.uhn.fhir.model.api.annotation.Description;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045/**
046 * An ingredient of a manufactured item or pharmaceutical product.
047 */
048@ResourceDef(name="MedicinalProductIngredient", profile="http://hl7.org/fhir/Profile/MedicinalProductIngredient")
049public class MedicinalProductIngredient extends DomainResource {
050
051    @Block()
052    public static class MedicinalProductIngredientSpecifiedSubstanceComponent extends BackboneElement implements IBaseBackboneElement {
053        /**
054         * The specified substance.
055         */
056        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
057        @Description(shortDefinition="The specified substance", formalDefinition="The specified substance." )
058        protected CodeableConcept code;
059
060        /**
061         * The group of specified substance, e.g. group 1 to 4.
062         */
063        @Child(name = "group", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true)
064        @Description(shortDefinition="The group of specified substance, e.g. group 1 to 4", formalDefinition="The group of specified substance, e.g. group 1 to 4." )
065        protected CodeableConcept group;
066
067        /**
068         * Confidentiality level of the specified substance as the ingredient.
069         */
070        @Child(name = "confidentiality", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
071        @Description(shortDefinition="Confidentiality level of the specified substance as the ingredient", formalDefinition="Confidentiality level of the specified substance as the ingredient." )
072        protected CodeableConcept confidentiality;
073
074        /**
075         * Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.
076         */
077        @Child(name = "strength", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
078        @Description(shortDefinition="Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product", formalDefinition="Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product." )
079        protected List<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent> strength;
080
081        private static final long serialVersionUID = -272590200L;
082
083    /**
084     * Constructor
085     */
086      public MedicinalProductIngredientSpecifiedSubstanceComponent() {
087        super();
088      }
089
090    /**
091     * Constructor
092     */
093      public MedicinalProductIngredientSpecifiedSubstanceComponent(CodeableConcept code, CodeableConcept group) {
094        super();
095        this.code = code;
096        this.group = group;
097      }
098
099        /**
100         * @return {@link #code} (The specified substance.)
101         */
102        public CodeableConcept getCode() { 
103          if (this.code == null)
104            if (Configuration.errorOnAutoCreate())
105              throw new Error("Attempt to auto-create MedicinalProductIngredientSpecifiedSubstanceComponent.code");
106            else if (Configuration.doAutoCreate())
107              this.code = new CodeableConcept(); // cc
108          return this.code;
109        }
110
111        public boolean hasCode() { 
112          return this.code != null && !this.code.isEmpty();
113        }
114
115        /**
116         * @param value {@link #code} (The specified substance.)
117         */
118        public MedicinalProductIngredientSpecifiedSubstanceComponent setCode(CodeableConcept value) { 
119          this.code = value;
120          return this;
121        }
122
123        /**
124         * @return {@link #group} (The group of specified substance, e.g. group 1 to 4.)
125         */
126        public CodeableConcept getGroup() { 
127          if (this.group == null)
128            if (Configuration.errorOnAutoCreate())
129              throw new Error("Attempt to auto-create MedicinalProductIngredientSpecifiedSubstanceComponent.group");
130            else if (Configuration.doAutoCreate())
131              this.group = new CodeableConcept(); // cc
132          return this.group;
133        }
134
135        public boolean hasGroup() { 
136          return this.group != null && !this.group.isEmpty();
137        }
138
139        /**
140         * @param value {@link #group} (The group of specified substance, e.g. group 1 to 4.)
141         */
142        public MedicinalProductIngredientSpecifiedSubstanceComponent setGroup(CodeableConcept value) { 
143          this.group = value;
144          return this;
145        }
146
147        /**
148         * @return {@link #confidentiality} (Confidentiality level of the specified substance as the ingredient.)
149         */
150        public CodeableConcept getConfidentiality() { 
151          if (this.confidentiality == null)
152            if (Configuration.errorOnAutoCreate())
153              throw new Error("Attempt to auto-create MedicinalProductIngredientSpecifiedSubstanceComponent.confidentiality");
154            else if (Configuration.doAutoCreate())
155              this.confidentiality = new CodeableConcept(); // cc
156          return this.confidentiality;
157        }
158
159        public boolean hasConfidentiality() { 
160          return this.confidentiality != null && !this.confidentiality.isEmpty();
161        }
162
163        /**
164         * @param value {@link #confidentiality} (Confidentiality level of the specified substance as the ingredient.)
165         */
166        public MedicinalProductIngredientSpecifiedSubstanceComponent setConfidentiality(CodeableConcept value) { 
167          this.confidentiality = value;
168          return this;
169        }
170
171        /**
172         * @return {@link #strength} (Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.)
173         */
174        public List<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent> getStrength() { 
175          if (this.strength == null)
176            this.strength = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent>();
177          return this.strength;
178        }
179
180        /**
181         * @return Returns a reference to <code>this</code> for easy method chaining
182         */
183        public MedicinalProductIngredientSpecifiedSubstanceComponent setStrength(List<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent> theStrength) { 
184          this.strength = theStrength;
185          return this;
186        }
187
188        public boolean hasStrength() { 
189          if (this.strength == null)
190            return false;
191          for (MedicinalProductIngredientSpecifiedSubstanceStrengthComponent item : this.strength)
192            if (!item.isEmpty())
193              return true;
194          return false;
195        }
196
197        public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent addStrength() { //3
198          MedicinalProductIngredientSpecifiedSubstanceStrengthComponent t = new MedicinalProductIngredientSpecifiedSubstanceStrengthComponent();
199          if (this.strength == null)
200            this.strength = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent>();
201          this.strength.add(t);
202          return t;
203        }
204
205        public MedicinalProductIngredientSpecifiedSubstanceComponent addStrength(MedicinalProductIngredientSpecifiedSubstanceStrengthComponent t) { //3
206          if (t == null)
207            return this;
208          if (this.strength == null)
209            this.strength = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent>();
210          this.strength.add(t);
211          return this;
212        }
213
214        /**
215         * @return The first repetition of repeating field {@link #strength}, creating it if it does not already exist
216         */
217        public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent getStrengthFirstRep() { 
218          if (getStrength().isEmpty()) {
219            addStrength();
220          }
221          return getStrength().get(0);
222        }
223
224        protected void listChildren(List<Property> children) {
225          super.listChildren(children);
226          children.add(new Property("code", "CodeableConcept", "The specified substance.", 0, 1, code));
227          children.add(new Property("group", "CodeableConcept", "The group of specified substance, e.g. group 1 to 4.", 0, 1, group));
228          children.add(new Property("confidentiality", "CodeableConcept", "Confidentiality level of the specified substance as the ingredient.", 0, 1, confidentiality));
229          children.add(new Property("strength", "", "Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.", 0, java.lang.Integer.MAX_VALUE, strength));
230        }
231
232        @Override
233        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
234          switch (_hash) {
235          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The specified substance.", 0, 1, code);
236          case 98629247: /*group*/  return new Property("group", "CodeableConcept", "The group of specified substance, e.g. group 1 to 4.", 0, 1, group);
237          case -1923018202: /*confidentiality*/  return new Property("confidentiality", "CodeableConcept", "Confidentiality level of the specified substance as the ingredient.", 0, 1, confidentiality);
238          case 1791316033: /*strength*/  return new Property("strength", "", "Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.", 0, java.lang.Integer.MAX_VALUE, strength);
239          default: return super.getNamedProperty(_hash, _name, _checkValid);
240          }
241
242        }
243
244      @Override
245      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
246        switch (hash) {
247        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
248        case 98629247: /*group*/ return this.group == null ? new Base[0] : new Base[] {this.group}; // CodeableConcept
249        case -1923018202: /*confidentiality*/ return this.confidentiality == null ? new Base[0] : new Base[] {this.confidentiality}; // CodeableConcept
250        case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : this.strength.toArray(new Base[this.strength.size()]); // MedicinalProductIngredientSpecifiedSubstanceStrengthComponent
251        default: return super.getProperty(hash, name, checkValid);
252        }
253
254      }
255
256      @Override
257      public Base setProperty(int hash, String name, Base value) throws FHIRException {
258        switch (hash) {
259        case 3059181: // code
260          this.code = castToCodeableConcept(value); // CodeableConcept
261          return value;
262        case 98629247: // group
263          this.group = castToCodeableConcept(value); // CodeableConcept
264          return value;
265        case -1923018202: // confidentiality
266          this.confidentiality = castToCodeableConcept(value); // CodeableConcept
267          return value;
268        case 1791316033: // strength
269          this.getStrength().add((MedicinalProductIngredientSpecifiedSubstanceStrengthComponent) value); // MedicinalProductIngredientSpecifiedSubstanceStrengthComponent
270          return value;
271        default: return super.setProperty(hash, name, value);
272        }
273
274      }
275
276      @Override
277      public Base setProperty(String name, Base value) throws FHIRException {
278        if (name.equals("code")) {
279          this.code = castToCodeableConcept(value); // CodeableConcept
280        } else if (name.equals("group")) {
281          this.group = castToCodeableConcept(value); // CodeableConcept
282        } else if (name.equals("confidentiality")) {
283          this.confidentiality = castToCodeableConcept(value); // CodeableConcept
284        } else if (name.equals("strength")) {
285          this.getStrength().add((MedicinalProductIngredientSpecifiedSubstanceStrengthComponent) value);
286        } else
287          return super.setProperty(name, value);
288        return value;
289      }
290
291      @Override
292      public Base makeProperty(int hash, String name) throws FHIRException {
293        switch (hash) {
294        case 3059181:  return getCode(); 
295        case 98629247:  return getGroup(); 
296        case -1923018202:  return getConfidentiality(); 
297        case 1791316033:  return addStrength(); 
298        default: return super.makeProperty(hash, name);
299        }
300
301      }
302
303      @Override
304      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
305        switch (hash) {
306        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
307        case 98629247: /*group*/ return new String[] {"CodeableConcept"};
308        case -1923018202: /*confidentiality*/ return new String[] {"CodeableConcept"};
309        case 1791316033: /*strength*/ return new String[] {};
310        default: return super.getTypesForProperty(hash, name);
311        }
312
313      }
314
315      @Override
316      public Base addChild(String name) throws FHIRException {
317        if (name.equals("code")) {
318          this.code = new CodeableConcept();
319          return this.code;
320        }
321        else if (name.equals("group")) {
322          this.group = new CodeableConcept();
323          return this.group;
324        }
325        else if (name.equals("confidentiality")) {
326          this.confidentiality = new CodeableConcept();
327          return this.confidentiality;
328        }
329        else if (name.equals("strength")) {
330          return addStrength();
331        }
332        else
333          return super.addChild(name);
334      }
335
336      public MedicinalProductIngredientSpecifiedSubstanceComponent copy() {
337        MedicinalProductIngredientSpecifiedSubstanceComponent dst = new MedicinalProductIngredientSpecifiedSubstanceComponent();
338        copyValues(dst);
339        dst.code = code == null ? null : code.copy();
340        dst.group = group == null ? null : group.copy();
341        dst.confidentiality = confidentiality == null ? null : confidentiality.copy();
342        if (strength != null) {
343          dst.strength = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent>();
344          for (MedicinalProductIngredientSpecifiedSubstanceStrengthComponent i : strength)
345            dst.strength.add(i.copy());
346        };
347        return dst;
348      }
349
350      @Override
351      public boolean equalsDeep(Base other_) {
352        if (!super.equalsDeep(other_))
353          return false;
354        if (!(other_ instanceof MedicinalProductIngredientSpecifiedSubstanceComponent))
355          return false;
356        MedicinalProductIngredientSpecifiedSubstanceComponent o = (MedicinalProductIngredientSpecifiedSubstanceComponent) other_;
357        return compareDeep(code, o.code, true) && compareDeep(group, o.group, true) && compareDeep(confidentiality, o.confidentiality, true)
358           && compareDeep(strength, o.strength, true);
359      }
360
361      @Override
362      public boolean equalsShallow(Base other_) {
363        if (!super.equalsShallow(other_))
364          return false;
365        if (!(other_ instanceof MedicinalProductIngredientSpecifiedSubstanceComponent))
366          return false;
367        MedicinalProductIngredientSpecifiedSubstanceComponent o = (MedicinalProductIngredientSpecifiedSubstanceComponent) other_;
368        return true;
369      }
370
371      public boolean isEmpty() {
372        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, group, confidentiality
373          , strength);
374      }
375
376  public String fhirType() {
377    return "MedicinalProductIngredient.specifiedSubstance";
378
379  }
380
381  }
382
383    @Block()
384    public static class MedicinalProductIngredientSpecifiedSubstanceStrengthComponent extends BackboneElement implements IBaseBackboneElement {
385        /**
386         * The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item.
387         */
388        @Child(name = "presentation", type = {Ratio.class}, order=1, min=1, max=1, modifier=false, summary=true)
389        @Description(shortDefinition="The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item", formalDefinition="The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item." )
390        protected Ratio presentation;
391
392        /**
393         * The strength per unitary volume (or mass).
394         */
395        @Child(name = "concentration", type = {Ratio.class}, order=2, min=0, max=1, modifier=false, summary=true)
396        @Description(shortDefinition="The strength per unitary volume (or mass)", formalDefinition="The strength per unitary volume (or mass)." )
397        protected Ratio concentration;
398
399        /**
400         * For when strength is measured at a particular point or distance.
401         */
402        @Child(name = "measurementPoint", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
403        @Description(shortDefinition="For when strength is measured at a particular point or distance", formalDefinition="For when strength is measured at a particular point or distance." )
404        protected StringType measurementPoint;
405
406        /**
407         * The country or countries for which the strength range applies.
408         */
409        @Child(name = "country", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
410        @Description(shortDefinition="The country or countries for which the strength range applies", formalDefinition="The country or countries for which the strength range applies." )
411        protected List<CodeableConcept> country;
412
413        /**
414         * Strength expressed in terms of a reference substance.
415         */
416        @Child(name = "referenceStrength", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
417        @Description(shortDefinition="Strength expressed in terms of a reference substance", formalDefinition="Strength expressed in terms of a reference substance." )
418        protected List<MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent> referenceStrength;
419
420        private static final long serialVersionUID = 7852307L;
421
422    /**
423     * Constructor
424     */
425      public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent() {
426        super();
427      }
428
429    /**
430     * Constructor
431     */
432      public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent(Ratio presentation) {
433        super();
434        this.presentation = presentation;
435      }
436
437        /**
438         * @return {@link #presentation} (The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item.)
439         */
440        public Ratio getPresentation() { 
441          if (this.presentation == null)
442            if (Configuration.errorOnAutoCreate())
443              throw new Error("Attempt to auto-create MedicinalProductIngredientSpecifiedSubstanceStrengthComponent.presentation");
444            else if (Configuration.doAutoCreate())
445              this.presentation = new Ratio(); // cc
446          return this.presentation;
447        }
448
449        public boolean hasPresentation() { 
450          return this.presentation != null && !this.presentation.isEmpty();
451        }
452
453        /**
454         * @param value {@link #presentation} (The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item.)
455         */
456        public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent setPresentation(Ratio value) { 
457          this.presentation = value;
458          return this;
459        }
460
461        /**
462         * @return {@link #concentration} (The strength per unitary volume (or mass).)
463         */
464        public Ratio getConcentration() { 
465          if (this.concentration == null)
466            if (Configuration.errorOnAutoCreate())
467              throw new Error("Attempt to auto-create MedicinalProductIngredientSpecifiedSubstanceStrengthComponent.concentration");
468            else if (Configuration.doAutoCreate())
469              this.concentration = new Ratio(); // cc
470          return this.concentration;
471        }
472
473        public boolean hasConcentration() { 
474          return this.concentration != null && !this.concentration.isEmpty();
475        }
476
477        /**
478         * @param value {@link #concentration} (The strength per unitary volume (or mass).)
479         */
480        public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent setConcentration(Ratio value) { 
481          this.concentration = value;
482          return this;
483        }
484
485        /**
486         * @return {@link #measurementPoint} (For when strength is measured at a particular point or distance.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPoint" gives direct access to the value
487         */
488        public StringType getMeasurementPointElement() { 
489          if (this.measurementPoint == null)
490            if (Configuration.errorOnAutoCreate())
491              throw new Error("Attempt to auto-create MedicinalProductIngredientSpecifiedSubstanceStrengthComponent.measurementPoint");
492            else if (Configuration.doAutoCreate())
493              this.measurementPoint = new StringType(); // bb
494          return this.measurementPoint;
495        }
496
497        public boolean hasMeasurementPointElement() { 
498          return this.measurementPoint != null && !this.measurementPoint.isEmpty();
499        }
500
501        public boolean hasMeasurementPoint() { 
502          return this.measurementPoint != null && !this.measurementPoint.isEmpty();
503        }
504
505        /**
506         * @param value {@link #measurementPoint} (For when strength is measured at a particular point or distance.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPoint" gives direct access to the value
507         */
508        public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent setMeasurementPointElement(StringType value) { 
509          this.measurementPoint = value;
510          return this;
511        }
512
513        /**
514         * @return For when strength is measured at a particular point or distance.
515         */
516        public String getMeasurementPoint() { 
517          return this.measurementPoint == null ? null : this.measurementPoint.getValue();
518        }
519
520        /**
521         * @param value For when strength is measured at a particular point or distance.
522         */
523        public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent setMeasurementPoint(String value) { 
524          if (Utilities.noString(value))
525            this.measurementPoint = null;
526          else {
527            if (this.measurementPoint == null)
528              this.measurementPoint = new StringType();
529            this.measurementPoint.setValue(value);
530          }
531          return this;
532        }
533
534        /**
535         * @return {@link #country} (The country or countries for which the strength range applies.)
536         */
537        public List<CodeableConcept> getCountry() { 
538          if (this.country == null)
539            this.country = new ArrayList<CodeableConcept>();
540          return this.country;
541        }
542
543        /**
544         * @return Returns a reference to <code>this</code> for easy method chaining
545         */
546        public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent setCountry(List<CodeableConcept> theCountry) { 
547          this.country = theCountry;
548          return this;
549        }
550
551        public boolean hasCountry() { 
552          if (this.country == null)
553            return false;
554          for (CodeableConcept item : this.country)
555            if (!item.isEmpty())
556              return true;
557          return false;
558        }
559
560        public CodeableConcept addCountry() { //3
561          CodeableConcept t = new CodeableConcept();
562          if (this.country == null)
563            this.country = new ArrayList<CodeableConcept>();
564          this.country.add(t);
565          return t;
566        }
567
568        public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent addCountry(CodeableConcept t) { //3
569          if (t == null)
570            return this;
571          if (this.country == null)
572            this.country = new ArrayList<CodeableConcept>();
573          this.country.add(t);
574          return this;
575        }
576
577        /**
578         * @return The first repetition of repeating field {@link #country}, creating it if it does not already exist
579         */
580        public CodeableConcept getCountryFirstRep() { 
581          if (getCountry().isEmpty()) {
582            addCountry();
583          }
584          return getCountry().get(0);
585        }
586
587        /**
588         * @return {@link #referenceStrength} (Strength expressed in terms of a reference substance.)
589         */
590        public List<MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent> getReferenceStrength() { 
591          if (this.referenceStrength == null)
592            this.referenceStrength = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent>();
593          return this.referenceStrength;
594        }
595
596        /**
597         * @return Returns a reference to <code>this</code> for easy method chaining
598         */
599        public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent setReferenceStrength(List<MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent> theReferenceStrength) { 
600          this.referenceStrength = theReferenceStrength;
601          return this;
602        }
603
604        public boolean hasReferenceStrength() { 
605          if (this.referenceStrength == null)
606            return false;
607          for (MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent item : this.referenceStrength)
608            if (!item.isEmpty())
609              return true;
610          return false;
611        }
612
613        public MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent addReferenceStrength() { //3
614          MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent t = new MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent();
615          if (this.referenceStrength == null)
616            this.referenceStrength = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent>();
617          this.referenceStrength.add(t);
618          return t;
619        }
620
621        public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent addReferenceStrength(MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent t) { //3
622          if (t == null)
623            return this;
624          if (this.referenceStrength == null)
625            this.referenceStrength = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent>();
626          this.referenceStrength.add(t);
627          return this;
628        }
629
630        /**
631         * @return The first repetition of repeating field {@link #referenceStrength}, creating it if it does not already exist
632         */
633        public MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent getReferenceStrengthFirstRep() { 
634          if (getReferenceStrength().isEmpty()) {
635            addReferenceStrength();
636          }
637          return getReferenceStrength().get(0);
638        }
639
640        protected void listChildren(List<Property> children) {
641          super.listChildren(children);
642          children.add(new Property("presentation", "Ratio", "The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item.", 0, 1, presentation));
643          children.add(new Property("concentration", "Ratio", "The strength per unitary volume (or mass).", 0, 1, concentration));
644          children.add(new Property("measurementPoint", "string", "For when strength is measured at a particular point or distance.", 0, 1, measurementPoint));
645          children.add(new Property("country", "CodeableConcept", "The country or countries for which the strength range applies.", 0, java.lang.Integer.MAX_VALUE, country));
646          children.add(new Property("referenceStrength", "", "Strength expressed in terms of a reference substance.", 0, java.lang.Integer.MAX_VALUE, referenceStrength));
647        }
648
649        @Override
650        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
651          switch (_hash) {
652          case 696975130: /*presentation*/  return new Property("presentation", "Ratio", "The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item.", 0, 1, presentation);
653          case -410557331: /*concentration*/  return new Property("concentration", "Ratio", "The strength per unitary volume (or mass).", 0, 1, concentration);
654          case 235437876: /*measurementPoint*/  return new Property("measurementPoint", "string", "For when strength is measured at a particular point or distance.", 0, 1, measurementPoint);
655          case 957831062: /*country*/  return new Property("country", "CodeableConcept", "The country or countries for which the strength range applies.", 0, java.lang.Integer.MAX_VALUE, country);
656          case 1943566508: /*referenceStrength*/  return new Property("referenceStrength", "", "Strength expressed in terms of a reference substance.", 0, java.lang.Integer.MAX_VALUE, referenceStrength);
657          default: return super.getNamedProperty(_hash, _name, _checkValid);
658          }
659
660        }
661
662      @Override
663      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
664        switch (hash) {
665        case 696975130: /*presentation*/ return this.presentation == null ? new Base[0] : new Base[] {this.presentation}; // Ratio
666        case -410557331: /*concentration*/ return this.concentration == null ? new Base[0] : new Base[] {this.concentration}; // Ratio
667        case 235437876: /*measurementPoint*/ return this.measurementPoint == null ? new Base[0] : new Base[] {this.measurementPoint}; // StringType
668        case 957831062: /*country*/ return this.country == null ? new Base[0] : this.country.toArray(new Base[this.country.size()]); // CodeableConcept
669        case 1943566508: /*referenceStrength*/ return this.referenceStrength == null ? new Base[0] : this.referenceStrength.toArray(new Base[this.referenceStrength.size()]); // MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent
670        default: return super.getProperty(hash, name, checkValid);
671        }
672
673      }
674
675      @Override
676      public Base setProperty(int hash, String name, Base value) throws FHIRException {
677        switch (hash) {
678        case 696975130: // presentation
679          this.presentation = castToRatio(value); // Ratio
680          return value;
681        case -410557331: // concentration
682          this.concentration = castToRatio(value); // Ratio
683          return value;
684        case 235437876: // measurementPoint
685          this.measurementPoint = castToString(value); // StringType
686          return value;
687        case 957831062: // country
688          this.getCountry().add(castToCodeableConcept(value)); // CodeableConcept
689          return value;
690        case 1943566508: // referenceStrength
691          this.getReferenceStrength().add((MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent) value); // MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent
692          return value;
693        default: return super.setProperty(hash, name, value);
694        }
695
696      }
697
698      @Override
699      public Base setProperty(String name, Base value) throws FHIRException {
700        if (name.equals("presentation")) {
701          this.presentation = castToRatio(value); // Ratio
702        } else if (name.equals("concentration")) {
703          this.concentration = castToRatio(value); // Ratio
704        } else if (name.equals("measurementPoint")) {
705          this.measurementPoint = castToString(value); // StringType
706        } else if (name.equals("country")) {
707          this.getCountry().add(castToCodeableConcept(value));
708        } else if (name.equals("referenceStrength")) {
709          this.getReferenceStrength().add((MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent) value);
710        } else
711          return super.setProperty(name, value);
712        return value;
713      }
714
715      @Override
716      public Base makeProperty(int hash, String name) throws FHIRException {
717        switch (hash) {
718        case 696975130:  return getPresentation(); 
719        case -410557331:  return getConcentration(); 
720        case 235437876:  return getMeasurementPointElement();
721        case 957831062:  return addCountry(); 
722        case 1943566508:  return addReferenceStrength(); 
723        default: return super.makeProperty(hash, name);
724        }
725
726      }
727
728      @Override
729      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
730        switch (hash) {
731        case 696975130: /*presentation*/ return new String[] {"Ratio"};
732        case -410557331: /*concentration*/ return new String[] {"Ratio"};
733        case 235437876: /*measurementPoint*/ return new String[] {"string"};
734        case 957831062: /*country*/ return new String[] {"CodeableConcept"};
735        case 1943566508: /*referenceStrength*/ return new String[] {};
736        default: return super.getTypesForProperty(hash, name);
737        }
738
739      }
740
741      @Override
742      public Base addChild(String name) throws FHIRException {
743        if (name.equals("presentation")) {
744          this.presentation = new Ratio();
745          return this.presentation;
746        }
747        else if (name.equals("concentration")) {
748          this.concentration = new Ratio();
749          return this.concentration;
750        }
751        else if (name.equals("measurementPoint")) {
752          throw new FHIRException("Cannot call addChild on a primitive type MedicinalProductIngredient.measurementPoint");
753        }
754        else if (name.equals("country")) {
755          return addCountry();
756        }
757        else if (name.equals("referenceStrength")) {
758          return addReferenceStrength();
759        }
760        else
761          return super.addChild(name);
762      }
763
764      public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent copy() {
765        MedicinalProductIngredientSpecifiedSubstanceStrengthComponent dst = new MedicinalProductIngredientSpecifiedSubstanceStrengthComponent();
766        copyValues(dst);
767        dst.presentation = presentation == null ? null : presentation.copy();
768        dst.concentration = concentration == null ? null : concentration.copy();
769        dst.measurementPoint = measurementPoint == null ? null : measurementPoint.copy();
770        if (country != null) {
771          dst.country = new ArrayList<CodeableConcept>();
772          for (CodeableConcept i : country)
773            dst.country.add(i.copy());
774        };
775        if (referenceStrength != null) {
776          dst.referenceStrength = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent>();
777          for (MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent i : referenceStrength)
778            dst.referenceStrength.add(i.copy());
779        };
780        return dst;
781      }
782
783      @Override
784      public boolean equalsDeep(Base other_) {
785        if (!super.equalsDeep(other_))
786          return false;
787        if (!(other_ instanceof MedicinalProductIngredientSpecifiedSubstanceStrengthComponent))
788          return false;
789        MedicinalProductIngredientSpecifiedSubstanceStrengthComponent o = (MedicinalProductIngredientSpecifiedSubstanceStrengthComponent) other_;
790        return compareDeep(presentation, o.presentation, true) && compareDeep(concentration, o.concentration, true)
791           && compareDeep(measurementPoint, o.measurementPoint, true) && compareDeep(country, o.country, true)
792           && compareDeep(referenceStrength, o.referenceStrength, true);
793      }
794
795      @Override
796      public boolean equalsShallow(Base other_) {
797        if (!super.equalsShallow(other_))
798          return false;
799        if (!(other_ instanceof MedicinalProductIngredientSpecifiedSubstanceStrengthComponent))
800          return false;
801        MedicinalProductIngredientSpecifiedSubstanceStrengthComponent o = (MedicinalProductIngredientSpecifiedSubstanceStrengthComponent) other_;
802        return compareValues(measurementPoint, o.measurementPoint, true);
803      }
804
805      public boolean isEmpty() {
806        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(presentation, concentration
807          , measurementPoint, country, referenceStrength);
808      }
809
810  public String fhirType() {
811    return "MedicinalProductIngredient.specifiedSubstance.strength";
812
813  }
814
815  }
816
817    @Block()
818    public static class MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent extends BackboneElement implements IBaseBackboneElement {
819        /**
820         * Relevent refrerence substance.
821         */
822        @Child(name = "substance", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
823        @Description(shortDefinition="Relevent refrerence substance", formalDefinition="Relevent refrerence substance." )
824        protected CodeableConcept substance;
825
826        private static final long serialVersionUID = 1457439001L;
827
828    /**
829     * Constructor
830     */
831      public MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent() {
832        super();
833      }
834
835        /**
836         * @return {@link #substance} (Relevent refrerence substance.)
837         */
838        public CodeableConcept getSubstance() { 
839          if (this.substance == null)
840            if (Configuration.errorOnAutoCreate())
841              throw new Error("Attempt to auto-create MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent.substance");
842            else if (Configuration.doAutoCreate())
843              this.substance = new CodeableConcept(); // cc
844          return this.substance;
845        }
846
847        public boolean hasSubstance() { 
848          return this.substance != null && !this.substance.isEmpty();
849        }
850
851        /**
852         * @param value {@link #substance} (Relevent refrerence substance.)
853         */
854        public MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent setSubstance(CodeableConcept value) { 
855          this.substance = value;
856          return this;
857        }
858
859        protected void listChildren(List<Property> children) {
860          super.listChildren(children);
861          children.add(new Property("substance", "CodeableConcept", "Relevent refrerence substance.", 0, 1, substance));
862        }
863
864        @Override
865        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
866          switch (_hash) {
867          case 530040176: /*substance*/  return new Property("substance", "CodeableConcept", "Relevent refrerence substance.", 0, 1, substance);
868          default: return super.getNamedProperty(_hash, _name, _checkValid);
869          }
870
871        }
872
873      @Override
874      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
875        switch (hash) {
876        case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // CodeableConcept
877        default: return super.getProperty(hash, name, checkValid);
878        }
879
880      }
881
882      @Override
883      public Base setProperty(int hash, String name, Base value) throws FHIRException {
884        switch (hash) {
885        case 530040176: // substance
886          this.substance = castToCodeableConcept(value); // CodeableConcept
887          return value;
888        default: return super.setProperty(hash, name, value);
889        }
890
891      }
892
893      @Override
894      public Base setProperty(String name, Base value) throws FHIRException {
895        if (name.equals("substance")) {
896          this.substance = castToCodeableConcept(value); // CodeableConcept
897        } else
898          return super.setProperty(name, value);
899        return value;
900      }
901
902      @Override
903      public Base makeProperty(int hash, String name) throws FHIRException {
904        switch (hash) {
905        case 530040176:  return getSubstance(); 
906        default: return super.makeProperty(hash, name);
907        }
908
909      }
910
911      @Override
912      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
913        switch (hash) {
914        case 530040176: /*substance*/ return new String[] {"CodeableConcept"};
915        default: return super.getTypesForProperty(hash, name);
916        }
917
918      }
919
920      @Override
921      public Base addChild(String name) throws FHIRException {
922        if (name.equals("substance")) {
923          this.substance = new CodeableConcept();
924          return this.substance;
925        }
926        else
927          return super.addChild(name);
928      }
929
930      public MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent copy() {
931        MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent dst = new MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent();
932        copyValues(dst);
933        dst.substance = substance == null ? null : substance.copy();
934        return dst;
935      }
936
937      @Override
938      public boolean equalsDeep(Base other_) {
939        if (!super.equalsDeep(other_))
940          return false;
941        if (!(other_ instanceof MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent))
942          return false;
943        MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent o = (MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent) other_;
944        return compareDeep(substance, o.substance, true);
945      }
946
947      @Override
948      public boolean equalsShallow(Base other_) {
949        if (!super.equalsShallow(other_))
950          return false;
951        if (!(other_ instanceof MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent))
952          return false;
953        MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent o = (MedicinalProductIngredientSpecifiedSubstanceStrengthReferenceStrengthComponent) other_;
954        return true;
955      }
956
957      public boolean isEmpty() {
958        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(substance);
959      }
960
961  public String fhirType() {
962    return "MedicinalProductIngredient.specifiedSubstance.strength.referenceStrength";
963
964  }
965
966  }
967
968    @Block()
969    public static class MedicinalProductIngredientSubstanceComponent extends BackboneElement implements IBaseBackboneElement {
970        /**
971         * The ingredient substance.
972         */
973        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
974        @Description(shortDefinition="The ingredient substance", formalDefinition="The ingredient substance." )
975        protected CodeableConcept code;
976
977        /**
978         * Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.
979         */
980        @Child(name = "strength", type = {MedicinalProductIngredientSpecifiedSubstanceStrengthComponent.class}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
981        @Description(shortDefinition="Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product", formalDefinition="Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product." )
982        protected List<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent> strength;
983
984        private static final long serialVersionUID = 1325868149L;
985
986    /**
987     * Constructor
988     */
989      public MedicinalProductIngredientSubstanceComponent() {
990        super();
991      }
992
993    /**
994     * Constructor
995     */
996      public MedicinalProductIngredientSubstanceComponent(CodeableConcept code) {
997        super();
998        this.code = code;
999      }
1000
1001        /**
1002         * @return {@link #code} (The ingredient substance.)
1003         */
1004        public CodeableConcept getCode() { 
1005          if (this.code == null)
1006            if (Configuration.errorOnAutoCreate())
1007              throw new Error("Attempt to auto-create MedicinalProductIngredientSubstanceComponent.code");
1008            else if (Configuration.doAutoCreate())
1009              this.code = new CodeableConcept(); // cc
1010          return this.code;
1011        }
1012
1013        public boolean hasCode() { 
1014          return this.code != null && !this.code.isEmpty();
1015        }
1016
1017        /**
1018         * @param value {@link #code} (The ingredient substance.)
1019         */
1020        public MedicinalProductIngredientSubstanceComponent setCode(CodeableConcept value) { 
1021          this.code = value;
1022          return this;
1023        }
1024
1025        /**
1026         * @return {@link #strength} (Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.)
1027         */
1028        public List<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent> getStrength() { 
1029          if (this.strength == null)
1030            this.strength = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent>();
1031          return this.strength;
1032        }
1033
1034        /**
1035         * @return Returns a reference to <code>this</code> for easy method chaining
1036         */
1037        public MedicinalProductIngredientSubstanceComponent setStrength(List<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent> theStrength) { 
1038          this.strength = theStrength;
1039          return this;
1040        }
1041
1042        public boolean hasStrength() { 
1043          if (this.strength == null)
1044            return false;
1045          for (MedicinalProductIngredientSpecifiedSubstanceStrengthComponent item : this.strength)
1046            if (!item.isEmpty())
1047              return true;
1048          return false;
1049        }
1050
1051        public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent addStrength() { //3
1052          MedicinalProductIngredientSpecifiedSubstanceStrengthComponent t = new MedicinalProductIngredientSpecifiedSubstanceStrengthComponent();
1053          if (this.strength == null)
1054            this.strength = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent>();
1055          this.strength.add(t);
1056          return t;
1057        }
1058
1059        public MedicinalProductIngredientSubstanceComponent addStrength(MedicinalProductIngredientSpecifiedSubstanceStrengthComponent t) { //3
1060          if (t == null)
1061            return this;
1062          if (this.strength == null)
1063            this.strength = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent>();
1064          this.strength.add(t);
1065          return this;
1066        }
1067
1068        /**
1069         * @return The first repetition of repeating field {@link #strength}, creating it if it does not already exist
1070         */
1071        public MedicinalProductIngredientSpecifiedSubstanceStrengthComponent getStrengthFirstRep() { 
1072          if (getStrength().isEmpty()) {
1073            addStrength();
1074          }
1075          return getStrength().get(0);
1076        }
1077
1078        protected void listChildren(List<Property> children) {
1079          super.listChildren(children);
1080          children.add(new Property("code", "CodeableConcept", "The ingredient substance.", 0, 1, code));
1081          children.add(new Property("strength", "@MedicinalProductIngredient.specifiedSubstance.strength", "Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.", 0, java.lang.Integer.MAX_VALUE, strength));
1082        }
1083
1084        @Override
1085        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1086          switch (_hash) {
1087          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The ingredient substance.", 0, 1, code);
1088          case 1791316033: /*strength*/  return new Property("strength", "@MedicinalProductIngredient.specifiedSubstance.strength", "Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.", 0, java.lang.Integer.MAX_VALUE, strength);
1089          default: return super.getNamedProperty(_hash, _name, _checkValid);
1090          }
1091
1092        }
1093
1094      @Override
1095      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1096        switch (hash) {
1097        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1098        case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : this.strength.toArray(new Base[this.strength.size()]); // MedicinalProductIngredientSpecifiedSubstanceStrengthComponent
1099        default: return super.getProperty(hash, name, checkValid);
1100        }
1101
1102      }
1103
1104      @Override
1105      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1106        switch (hash) {
1107        case 3059181: // code
1108          this.code = castToCodeableConcept(value); // CodeableConcept
1109          return value;
1110        case 1791316033: // strength
1111          this.getStrength().add((MedicinalProductIngredientSpecifiedSubstanceStrengthComponent) value); // MedicinalProductIngredientSpecifiedSubstanceStrengthComponent
1112          return value;
1113        default: return super.setProperty(hash, name, value);
1114        }
1115
1116      }
1117
1118      @Override
1119      public Base setProperty(String name, Base value) throws FHIRException {
1120        if (name.equals("code")) {
1121          this.code = castToCodeableConcept(value); // CodeableConcept
1122        } else if (name.equals("strength")) {
1123          this.getStrength().add((MedicinalProductIngredientSpecifiedSubstanceStrengthComponent) value);
1124        } else
1125          return super.setProperty(name, value);
1126        return value;
1127      }
1128
1129      @Override
1130      public Base makeProperty(int hash, String name) throws FHIRException {
1131        switch (hash) {
1132        case 3059181:  return getCode(); 
1133        case 1791316033:  return addStrength(); 
1134        default: return super.makeProperty(hash, name);
1135        }
1136
1137      }
1138
1139      @Override
1140      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1141        switch (hash) {
1142        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1143        case 1791316033: /*strength*/ return new String[] {"@MedicinalProductIngredient.specifiedSubstance.strength"};
1144        default: return super.getTypesForProperty(hash, name);
1145        }
1146
1147      }
1148
1149      @Override
1150      public Base addChild(String name) throws FHIRException {
1151        if (name.equals("code")) {
1152          this.code = new CodeableConcept();
1153          return this.code;
1154        }
1155        else if (name.equals("strength")) {
1156          return addStrength();
1157        }
1158        else
1159          return super.addChild(name);
1160      }
1161
1162      public MedicinalProductIngredientSubstanceComponent copy() {
1163        MedicinalProductIngredientSubstanceComponent dst = new MedicinalProductIngredientSubstanceComponent();
1164        copyValues(dst);
1165        dst.code = code == null ? null : code.copy();
1166        if (strength != null) {
1167          dst.strength = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceStrengthComponent>();
1168          for (MedicinalProductIngredientSpecifiedSubstanceStrengthComponent i : strength)
1169            dst.strength.add(i.copy());
1170        };
1171        return dst;
1172      }
1173
1174      @Override
1175      public boolean equalsDeep(Base other_) {
1176        if (!super.equalsDeep(other_))
1177          return false;
1178        if (!(other_ instanceof MedicinalProductIngredientSubstanceComponent))
1179          return false;
1180        MedicinalProductIngredientSubstanceComponent o = (MedicinalProductIngredientSubstanceComponent) other_;
1181        return compareDeep(code, o.code, true) && compareDeep(strength, o.strength, true);
1182      }
1183
1184      @Override
1185      public boolean equalsShallow(Base other_) {
1186        if (!super.equalsShallow(other_))
1187          return false;
1188        if (!(other_ instanceof MedicinalProductIngredientSubstanceComponent))
1189          return false;
1190        MedicinalProductIngredientSubstanceComponent o = (MedicinalProductIngredientSubstanceComponent) other_;
1191        return true;
1192      }
1193
1194      public boolean isEmpty() {
1195        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, strength);
1196      }
1197
1198  public String fhirType() {
1199    return "MedicinalProductIngredient.substance";
1200
1201  }
1202
1203  }
1204
1205    /**
1206     * The identifier(s) of this Ingredient t that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate.
1207     */
1208    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true)
1209    @Description(shortDefinition="Identifier for the ingredient", formalDefinition="The identifier(s) of this Ingredient t that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate." )
1210    protected Identifier identifier;
1211
1212    /**
1213     * Ingredient role e.g. Active ingredient, excipient.
1214     */
1215    @Child(name = "role", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
1216    @Description(shortDefinition="Ingredient role e.g. Active ingredient, excipient", formalDefinition="Ingredient role e.g. Active ingredient, excipient." )
1217    protected CodeableConcept role;
1218
1219    /**
1220     * If the ingredient is a known or suspected allergen.
1221     */
1222    @Child(name = "allergenicIndicator", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1223    @Description(shortDefinition="If the ingredient is a known or suspected allergen", formalDefinition="If the ingredient is a known or suspected allergen." )
1224    protected BooleanType allergenicIndicator;
1225
1226    /**
1227     * Manufacturer of this Ingredient.
1228     */
1229    @Child(name = "manufacturer", type = {Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1230    @Description(shortDefinition="Manufacturer of this Ingredient", formalDefinition="Manufacturer of this Ingredient." )
1231    protected List<Reference> manufacturer;
1232    /**
1233     * The actual objects that are the target of the reference (Manufacturer of this Ingredient.)
1234     */
1235    protected List<Organization> manufacturerTarget;
1236
1237
1238    /**
1239     * A specified substance that comprises this ingredient.
1240     */
1241    @Child(name = "specifiedSubstance", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1242    @Description(shortDefinition="A specified substance that comprises this ingredient", formalDefinition="A specified substance that comprises this ingredient." )
1243    protected List<MedicinalProductIngredientSpecifiedSubstanceComponent> specifiedSubstance;
1244
1245    /**
1246     * The ingredient substance.
1247     */
1248    @Child(name = "substance", type = {}, order=5, min=0, max=1, modifier=false, summary=true)
1249    @Description(shortDefinition="The ingredient substance", formalDefinition="The ingredient substance." )
1250    protected MedicinalProductIngredientSubstanceComponent substance;
1251
1252    private static final long serialVersionUID = -1454686641L;
1253
1254  /**
1255   * Constructor
1256   */
1257    public MedicinalProductIngredient() {
1258      super();
1259    }
1260
1261  /**
1262   * Constructor
1263   */
1264    public MedicinalProductIngredient(CodeableConcept role) {
1265      super();
1266      this.role = role;
1267    }
1268
1269    /**
1270     * @return {@link #identifier} (The identifier(s) of this Ingredient t that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate.)
1271     */
1272    public Identifier getIdentifier() { 
1273      if (this.identifier == null)
1274        if (Configuration.errorOnAutoCreate())
1275          throw new Error("Attempt to auto-create MedicinalProductIngredient.identifier");
1276        else if (Configuration.doAutoCreate())
1277          this.identifier = new Identifier(); // cc
1278      return this.identifier;
1279    }
1280
1281    public boolean hasIdentifier() { 
1282      return this.identifier != null && !this.identifier.isEmpty();
1283    }
1284
1285    /**
1286     * @param value {@link #identifier} (The identifier(s) of this Ingredient t that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate.)
1287     */
1288    public MedicinalProductIngredient setIdentifier(Identifier value) { 
1289      this.identifier = value;
1290      return this;
1291    }
1292
1293    /**
1294     * @return {@link #role} (Ingredient role e.g. Active ingredient, excipient.)
1295     */
1296    public CodeableConcept getRole() { 
1297      if (this.role == null)
1298        if (Configuration.errorOnAutoCreate())
1299          throw new Error("Attempt to auto-create MedicinalProductIngredient.role");
1300        else if (Configuration.doAutoCreate())
1301          this.role = new CodeableConcept(); // cc
1302      return this.role;
1303    }
1304
1305    public boolean hasRole() { 
1306      return this.role != null && !this.role.isEmpty();
1307    }
1308
1309    /**
1310     * @param value {@link #role} (Ingredient role e.g. Active ingredient, excipient.)
1311     */
1312    public MedicinalProductIngredient setRole(CodeableConcept value) { 
1313      this.role = value;
1314      return this;
1315    }
1316
1317    /**
1318     * @return {@link #allergenicIndicator} (If the ingredient is a known or suspected allergen.). This is the underlying object with id, value and extensions. The accessor "getAllergenicIndicator" gives direct access to the value
1319     */
1320    public BooleanType getAllergenicIndicatorElement() { 
1321      if (this.allergenicIndicator == null)
1322        if (Configuration.errorOnAutoCreate())
1323          throw new Error("Attempt to auto-create MedicinalProductIngredient.allergenicIndicator");
1324        else if (Configuration.doAutoCreate())
1325          this.allergenicIndicator = new BooleanType(); // bb
1326      return this.allergenicIndicator;
1327    }
1328
1329    public boolean hasAllergenicIndicatorElement() { 
1330      return this.allergenicIndicator != null && !this.allergenicIndicator.isEmpty();
1331    }
1332
1333    public boolean hasAllergenicIndicator() { 
1334      return this.allergenicIndicator != null && !this.allergenicIndicator.isEmpty();
1335    }
1336
1337    /**
1338     * @param value {@link #allergenicIndicator} (If the ingredient is a known or suspected allergen.). This is the underlying object with id, value and extensions. The accessor "getAllergenicIndicator" gives direct access to the value
1339     */
1340    public MedicinalProductIngredient setAllergenicIndicatorElement(BooleanType value) { 
1341      this.allergenicIndicator = value;
1342      return this;
1343    }
1344
1345    /**
1346     * @return If the ingredient is a known or suspected allergen.
1347     */
1348    public boolean getAllergenicIndicator() { 
1349      return this.allergenicIndicator == null || this.allergenicIndicator.isEmpty() ? false : this.allergenicIndicator.getValue();
1350    }
1351
1352    /**
1353     * @param value If the ingredient is a known or suspected allergen.
1354     */
1355    public MedicinalProductIngredient setAllergenicIndicator(boolean value) { 
1356        if (this.allergenicIndicator == null)
1357          this.allergenicIndicator = new BooleanType();
1358        this.allergenicIndicator.setValue(value);
1359      return this;
1360    }
1361
1362    /**
1363     * @return {@link #manufacturer} (Manufacturer of this Ingredient.)
1364     */
1365    public List<Reference> getManufacturer() { 
1366      if (this.manufacturer == null)
1367        this.manufacturer = new ArrayList<Reference>();
1368      return this.manufacturer;
1369    }
1370
1371    /**
1372     * @return Returns a reference to <code>this</code> for easy method chaining
1373     */
1374    public MedicinalProductIngredient setManufacturer(List<Reference> theManufacturer) { 
1375      this.manufacturer = theManufacturer;
1376      return this;
1377    }
1378
1379    public boolean hasManufacturer() { 
1380      if (this.manufacturer == null)
1381        return false;
1382      for (Reference item : this.manufacturer)
1383        if (!item.isEmpty())
1384          return true;
1385      return false;
1386    }
1387
1388    public Reference addManufacturer() { //3
1389      Reference t = new Reference();
1390      if (this.manufacturer == null)
1391        this.manufacturer = new ArrayList<Reference>();
1392      this.manufacturer.add(t);
1393      return t;
1394    }
1395
1396    public MedicinalProductIngredient addManufacturer(Reference t) { //3
1397      if (t == null)
1398        return this;
1399      if (this.manufacturer == null)
1400        this.manufacturer = new ArrayList<Reference>();
1401      this.manufacturer.add(t);
1402      return this;
1403    }
1404
1405    /**
1406     * @return The first repetition of repeating field {@link #manufacturer}, creating it if it does not already exist
1407     */
1408    public Reference getManufacturerFirstRep() { 
1409      if (getManufacturer().isEmpty()) {
1410        addManufacturer();
1411      }
1412      return getManufacturer().get(0);
1413    }
1414
1415    /**
1416     * @deprecated Use Reference#setResource(IBaseResource) instead
1417     */
1418    @Deprecated
1419    public List<Organization> getManufacturerTarget() { 
1420      if (this.manufacturerTarget == null)
1421        this.manufacturerTarget = new ArrayList<Organization>();
1422      return this.manufacturerTarget;
1423    }
1424
1425    /**
1426     * @deprecated Use Reference#setResource(IBaseResource) instead
1427     */
1428    @Deprecated
1429    public Organization addManufacturerTarget() { 
1430      Organization r = new Organization();
1431      if (this.manufacturerTarget == null)
1432        this.manufacturerTarget = new ArrayList<Organization>();
1433      this.manufacturerTarget.add(r);
1434      return r;
1435    }
1436
1437    /**
1438     * @return {@link #specifiedSubstance} (A specified substance that comprises this ingredient.)
1439     */
1440    public List<MedicinalProductIngredientSpecifiedSubstanceComponent> getSpecifiedSubstance() { 
1441      if (this.specifiedSubstance == null)
1442        this.specifiedSubstance = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceComponent>();
1443      return this.specifiedSubstance;
1444    }
1445
1446    /**
1447     * @return Returns a reference to <code>this</code> for easy method chaining
1448     */
1449    public MedicinalProductIngredient setSpecifiedSubstance(List<MedicinalProductIngredientSpecifiedSubstanceComponent> theSpecifiedSubstance) { 
1450      this.specifiedSubstance = theSpecifiedSubstance;
1451      return this;
1452    }
1453
1454    public boolean hasSpecifiedSubstance() { 
1455      if (this.specifiedSubstance == null)
1456        return false;
1457      for (MedicinalProductIngredientSpecifiedSubstanceComponent item : this.specifiedSubstance)
1458        if (!item.isEmpty())
1459          return true;
1460      return false;
1461    }
1462
1463    public MedicinalProductIngredientSpecifiedSubstanceComponent addSpecifiedSubstance() { //3
1464      MedicinalProductIngredientSpecifiedSubstanceComponent t = new MedicinalProductIngredientSpecifiedSubstanceComponent();
1465      if (this.specifiedSubstance == null)
1466        this.specifiedSubstance = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceComponent>();
1467      this.specifiedSubstance.add(t);
1468      return t;
1469    }
1470
1471    public MedicinalProductIngredient addSpecifiedSubstance(MedicinalProductIngredientSpecifiedSubstanceComponent t) { //3
1472      if (t == null)
1473        return this;
1474      if (this.specifiedSubstance == null)
1475        this.specifiedSubstance = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceComponent>();
1476      this.specifiedSubstance.add(t);
1477      return this;
1478    }
1479
1480    /**
1481     * @return The first repetition of repeating field {@link #specifiedSubstance}, creating it if it does not already exist
1482     */
1483    public MedicinalProductIngredientSpecifiedSubstanceComponent getSpecifiedSubstanceFirstRep() { 
1484      if (getSpecifiedSubstance().isEmpty()) {
1485        addSpecifiedSubstance();
1486      }
1487      return getSpecifiedSubstance().get(0);
1488    }
1489
1490    /**
1491     * @return {@link #substance} (The ingredient substance.)
1492     */
1493    public MedicinalProductIngredientSubstanceComponent getSubstance() { 
1494      if (this.substance == null)
1495        if (Configuration.errorOnAutoCreate())
1496          throw new Error("Attempt to auto-create MedicinalProductIngredient.substance");
1497        else if (Configuration.doAutoCreate())
1498          this.substance = new MedicinalProductIngredientSubstanceComponent(); // cc
1499      return this.substance;
1500    }
1501
1502    public boolean hasSubstance() { 
1503      return this.substance != null && !this.substance.isEmpty();
1504    }
1505
1506    /**
1507     * @param value {@link #substance} (The ingredient substance.)
1508     */
1509    public MedicinalProductIngredient setSubstance(MedicinalProductIngredientSubstanceComponent value) { 
1510      this.substance = value;
1511      return this;
1512    }
1513
1514      protected void listChildren(List<Property> children) {
1515        super.listChildren(children);
1516        children.add(new Property("identifier", "Identifier", "The identifier(s) of this Ingredient t that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate.", 0, 1, identifier));
1517        children.add(new Property("role", "CodeableConcept", "Ingredient role e.g. Active ingredient, excipient.", 0, 1, role));
1518        children.add(new Property("allergenicIndicator", "boolean", "If the ingredient is a known or suspected allergen.", 0, 1, allergenicIndicator));
1519        children.add(new Property("manufacturer", "Reference(Organization)", "Manufacturer of this Ingredient.", 0, java.lang.Integer.MAX_VALUE, manufacturer));
1520        children.add(new Property("specifiedSubstance", "", "A specified substance that comprises this ingredient.", 0, java.lang.Integer.MAX_VALUE, specifiedSubstance));
1521        children.add(new Property("substance", "", "The ingredient substance.", 0, 1, substance));
1522      }
1523
1524      @Override
1525      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1526        switch (_hash) {
1527        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "The identifier(s) of this Ingredient t that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate.", 0, 1, identifier);
1528        case 3506294: /*role*/  return new Property("role", "CodeableConcept", "Ingredient role e.g. Active ingredient, excipient.", 0, 1, role);
1529        case 75406931: /*allergenicIndicator*/  return new Property("allergenicIndicator", "boolean", "If the ingredient is a known or suspected allergen.", 0, 1, allergenicIndicator);
1530        case -1969347631: /*manufacturer*/  return new Property("manufacturer", "Reference(Organization)", "Manufacturer of this Ingredient.", 0, java.lang.Integer.MAX_VALUE, manufacturer);
1531        case -331477600: /*specifiedSubstance*/  return new Property("specifiedSubstance", "", "A specified substance that comprises this ingredient.", 0, java.lang.Integer.MAX_VALUE, specifiedSubstance);
1532        case 530040176: /*substance*/  return new Property("substance", "", "The ingredient substance.", 0, 1, substance);
1533        default: return super.getNamedProperty(_hash, _name, _checkValid);
1534        }
1535
1536      }
1537
1538      @Override
1539      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1540        switch (hash) {
1541        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
1542        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
1543        case 75406931: /*allergenicIndicator*/ return this.allergenicIndicator == null ? new Base[0] : new Base[] {this.allergenicIndicator}; // BooleanType
1544        case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : this.manufacturer.toArray(new Base[this.manufacturer.size()]); // Reference
1545        case -331477600: /*specifiedSubstance*/ return this.specifiedSubstance == null ? new Base[0] : this.specifiedSubstance.toArray(new Base[this.specifiedSubstance.size()]); // MedicinalProductIngredientSpecifiedSubstanceComponent
1546        case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // MedicinalProductIngredientSubstanceComponent
1547        default: return super.getProperty(hash, name, checkValid);
1548        }
1549
1550      }
1551
1552      @Override
1553      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1554        switch (hash) {
1555        case -1618432855: // identifier
1556          this.identifier = castToIdentifier(value); // Identifier
1557          return value;
1558        case 3506294: // role
1559          this.role = castToCodeableConcept(value); // CodeableConcept
1560          return value;
1561        case 75406931: // allergenicIndicator
1562          this.allergenicIndicator = castToBoolean(value); // BooleanType
1563          return value;
1564        case -1969347631: // manufacturer
1565          this.getManufacturer().add(castToReference(value)); // Reference
1566          return value;
1567        case -331477600: // specifiedSubstance
1568          this.getSpecifiedSubstance().add((MedicinalProductIngredientSpecifiedSubstanceComponent) value); // MedicinalProductIngredientSpecifiedSubstanceComponent
1569          return value;
1570        case 530040176: // substance
1571          this.substance = (MedicinalProductIngredientSubstanceComponent) value; // MedicinalProductIngredientSubstanceComponent
1572          return value;
1573        default: return super.setProperty(hash, name, value);
1574        }
1575
1576      }
1577
1578      @Override
1579      public Base setProperty(String name, Base value) throws FHIRException {
1580        if (name.equals("identifier")) {
1581          this.identifier = castToIdentifier(value); // Identifier
1582        } else if (name.equals("role")) {
1583          this.role = castToCodeableConcept(value); // CodeableConcept
1584        } else if (name.equals("allergenicIndicator")) {
1585          this.allergenicIndicator = castToBoolean(value); // BooleanType
1586        } else if (name.equals("manufacturer")) {
1587          this.getManufacturer().add(castToReference(value));
1588        } else if (name.equals("specifiedSubstance")) {
1589          this.getSpecifiedSubstance().add((MedicinalProductIngredientSpecifiedSubstanceComponent) value);
1590        } else if (name.equals("substance")) {
1591          this.substance = (MedicinalProductIngredientSubstanceComponent) value; // MedicinalProductIngredientSubstanceComponent
1592        } else
1593          return super.setProperty(name, value);
1594        return value;
1595      }
1596
1597      @Override
1598      public Base makeProperty(int hash, String name) throws FHIRException {
1599        switch (hash) {
1600        case -1618432855:  return getIdentifier(); 
1601        case 3506294:  return getRole(); 
1602        case 75406931:  return getAllergenicIndicatorElement();
1603        case -1969347631:  return addManufacturer(); 
1604        case -331477600:  return addSpecifiedSubstance(); 
1605        case 530040176:  return getSubstance(); 
1606        default: return super.makeProperty(hash, name);
1607        }
1608
1609      }
1610
1611      @Override
1612      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1613        switch (hash) {
1614        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1615        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
1616        case 75406931: /*allergenicIndicator*/ return new String[] {"boolean"};
1617        case -1969347631: /*manufacturer*/ return new String[] {"Reference"};
1618        case -331477600: /*specifiedSubstance*/ return new String[] {};
1619        case 530040176: /*substance*/ return new String[] {};
1620        default: return super.getTypesForProperty(hash, name);
1621        }
1622
1623      }
1624
1625      @Override
1626      public Base addChild(String name) throws FHIRException {
1627        if (name.equals("identifier")) {
1628          this.identifier = new Identifier();
1629          return this.identifier;
1630        }
1631        else if (name.equals("role")) {
1632          this.role = new CodeableConcept();
1633          return this.role;
1634        }
1635        else if (name.equals("allergenicIndicator")) {
1636          throw new FHIRException("Cannot call addChild on a primitive type MedicinalProductIngredient.allergenicIndicator");
1637        }
1638        else if (name.equals("manufacturer")) {
1639          return addManufacturer();
1640        }
1641        else if (name.equals("specifiedSubstance")) {
1642          return addSpecifiedSubstance();
1643        }
1644        else if (name.equals("substance")) {
1645          this.substance = new MedicinalProductIngredientSubstanceComponent();
1646          return this.substance;
1647        }
1648        else
1649          return super.addChild(name);
1650      }
1651
1652  public String fhirType() {
1653    return "MedicinalProductIngredient";
1654
1655  }
1656
1657      public MedicinalProductIngredient copy() {
1658        MedicinalProductIngredient dst = new MedicinalProductIngredient();
1659        copyValues(dst);
1660        dst.identifier = identifier == null ? null : identifier.copy();
1661        dst.role = role == null ? null : role.copy();
1662        dst.allergenicIndicator = allergenicIndicator == null ? null : allergenicIndicator.copy();
1663        if (manufacturer != null) {
1664          dst.manufacturer = new ArrayList<Reference>();
1665          for (Reference i : manufacturer)
1666            dst.manufacturer.add(i.copy());
1667        };
1668        if (specifiedSubstance != null) {
1669          dst.specifiedSubstance = new ArrayList<MedicinalProductIngredientSpecifiedSubstanceComponent>();
1670          for (MedicinalProductIngredientSpecifiedSubstanceComponent i : specifiedSubstance)
1671            dst.specifiedSubstance.add(i.copy());
1672        };
1673        dst.substance = substance == null ? null : substance.copy();
1674        return dst;
1675      }
1676
1677      protected MedicinalProductIngredient typedCopy() {
1678        return copy();
1679      }
1680
1681      @Override
1682      public boolean equalsDeep(Base other_) {
1683        if (!super.equalsDeep(other_))
1684          return false;
1685        if (!(other_ instanceof MedicinalProductIngredient))
1686          return false;
1687        MedicinalProductIngredient o = (MedicinalProductIngredient) other_;
1688        return compareDeep(identifier, o.identifier, true) && compareDeep(role, o.role, true) && compareDeep(allergenicIndicator, o.allergenicIndicator, true)
1689           && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(specifiedSubstance, o.specifiedSubstance, true)
1690           && compareDeep(substance, o.substance, true);
1691      }
1692
1693      @Override
1694      public boolean equalsShallow(Base other_) {
1695        if (!super.equalsShallow(other_))
1696          return false;
1697        if (!(other_ instanceof MedicinalProductIngredient))
1698          return false;
1699        MedicinalProductIngredient o = (MedicinalProductIngredient) other_;
1700        return compareValues(allergenicIndicator, o.allergenicIndicator, true);
1701      }
1702
1703      public boolean isEmpty() {
1704        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, role, allergenicIndicator
1705          , manufacturer, specifiedSubstance, substance);
1706      }
1707
1708  @Override
1709  public ResourceType getResourceType() {
1710    return ResourceType.MedicinalProductIngredient;
1711   }
1712
1713
1714}
1715