001package org.hl7.fhir.r5.model;
002
003
004/*
005 * #%L
006 * org.hl7.fhir.r5
007 * %%
008 * Copyright (C) 2014 - 2019 Health Level 7
009 * %%
010 * Licensed under the Apache License, Version 2.0 (the \"License\");
011 * you may not use this file except in compliance with the License.
012 * You may obtain a copy of the License at
013 * 
014 *      http://www.apache.org/licenses/LICENSE-2.0
015 * 
016 * Unless required by applicable law or agreed to in writing, software
017 * distributed under the License is distributed on an \"AS IS\" BASIS,
018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
019 * See the License for the specific language governing permissions and
020 * limitations under the License.
021 * #L%
022 */
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, \
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this \
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, \
034     this list of conditions and the following disclaimer in the documentation \
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
049  POSSIBILITY OF SUCH DAMAGE.
050  */
051
052// Generated on Tue, Dec 31, 2019 12:12+1100 for FHIR vcurrent
053
054import java.util.ArrayList;
055import java.util.Date;
056import java.util.List;
057import org.hl7.fhir.utilities.Utilities;
058import org.hl7.fhir.r5.model.Enumerations.*;
059import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
060import org.hl7.fhir.exceptions.FHIRException;
061import org.hl7.fhir.instance.model.api.ICompositeType;
062import ca.uhn.fhir.model.api.annotation.ResourceDef;
063import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
064import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
065import ca.uhn.fhir.model.api.annotation.Child;
066import ca.uhn.fhir.model.api.annotation.ChildOrder;
067import ca.uhn.fhir.model.api.annotation.Description;
068import ca.uhn.fhir.model.api.annotation.Block;
069
070/**
071 * An ingredient of a manufactured item or pharmaceutical product.
072 */
073@ResourceDef(name="Ingredient", profile="http://hl7.org/fhir/StructureDefinition/Ingredient")
074public class Ingredient extends DomainResource {
075
076    @Block()
077    public static class IngredientSpecifiedSubstanceComponent extends BackboneElement implements IBaseBackboneElement {
078        /**
079         * Substance as a 'specified substance', implying extra substance related characteristics.
080         */
081        @Child(name = "code", type = {CodeableConcept.class, SubstanceDefinition.class, Substance.class}, order=1, min=1, max=1, modifier=false, summary=true)
082        @Description(shortDefinition="Substance as a 'specified substance', implying extra substance related characteristics", formalDefinition="Substance as a 'specified substance', implying extra substance related characteristics." )
083        protected DataType code;
084
085        /**
086         * The group of specified substance, e.g. group 1 to 4.
087         */
088        @Child(name = "group", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true)
089        @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." )
090        protected CodeableConcept group;
091
092        /**
093         * Confidentiality level of the specified substance as the ingredient.
094         */
095        @Child(name = "confidentiality", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
096        @Description(shortDefinition="Confidentiality level of the specified substance as the ingredient", formalDefinition="Confidentiality level of the specified substance as the ingredient." )
097        protected CodeableConcept confidentiality;
098
099        /**
100         * Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.
101         */
102        @Child(name = "strength", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
103        @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." )
104        protected List<IngredientSpecifiedSubstanceStrengthComponent> strength;
105
106        private static final long serialVersionUID = -972862616L;
107
108    /**
109     * Constructor
110     */
111      public IngredientSpecifiedSubstanceComponent() {
112        super();
113      }
114
115    /**
116     * Constructor
117     */
118      public IngredientSpecifiedSubstanceComponent(DataType code, CodeableConcept group) {
119        super();
120        this.setCode(code);
121        this.setGroup(group);
122      }
123
124        /**
125         * @return {@link #code} (Substance as a 'specified substance', implying extra substance related characteristics.)
126         */
127        public DataType getCode() { 
128          return this.code;
129        }
130
131        /**
132         * @return {@link #code} (Substance as a 'specified substance', implying extra substance related characteristics.)
133         */
134        public CodeableConcept getCodeCodeableConcept() throws FHIRException { 
135          if (this.code == null)
136            this.code = new CodeableConcept();
137          if (!(this.code instanceof CodeableConcept))
138            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.code.getClass().getName()+" was encountered");
139          return (CodeableConcept) this.code;
140        }
141
142        public boolean hasCodeCodeableConcept() { 
143          return this != null && this.code instanceof CodeableConcept;
144        }
145
146        /**
147         * @return {@link #code} (Substance as a 'specified substance', implying extra substance related characteristics.)
148         */
149        public Reference getCodeReference() throws FHIRException { 
150          if (this.code == null)
151            this.code = new Reference();
152          if (!(this.code instanceof Reference))
153            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.code.getClass().getName()+" was encountered");
154          return (Reference) this.code;
155        }
156
157        public boolean hasCodeReference() { 
158          return this != null && this.code instanceof Reference;
159        }
160
161        public boolean hasCode() { 
162          return this.code != null && !this.code.isEmpty();
163        }
164
165        /**
166         * @param value {@link #code} (Substance as a 'specified substance', implying extra substance related characteristics.)
167         */
168        public IngredientSpecifiedSubstanceComponent setCode(DataType value) { 
169          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
170            throw new Error("Not the right type for Ingredient.specifiedSubstance.code[x]: "+value.fhirType());
171          this.code = value;
172          return this;
173        }
174
175        /**
176         * @return {@link #group} (The group of specified substance, e.g. group 1 to 4.)
177         */
178        public CodeableConcept getGroup() { 
179          if (this.group == null)
180            if (Configuration.errorOnAutoCreate())
181              throw new Error("Attempt to auto-create IngredientSpecifiedSubstanceComponent.group");
182            else if (Configuration.doAutoCreate())
183              this.group = new CodeableConcept(); // cc
184          return this.group;
185        }
186
187        public boolean hasGroup() { 
188          return this.group != null && !this.group.isEmpty();
189        }
190
191        /**
192         * @param value {@link #group} (The group of specified substance, e.g. group 1 to 4.)
193         */
194        public IngredientSpecifiedSubstanceComponent setGroup(CodeableConcept value) { 
195          this.group = value;
196          return this;
197        }
198
199        /**
200         * @return {@link #confidentiality} (Confidentiality level of the specified substance as the ingredient.)
201         */
202        public CodeableConcept getConfidentiality() { 
203          if (this.confidentiality == null)
204            if (Configuration.errorOnAutoCreate())
205              throw new Error("Attempt to auto-create IngredientSpecifiedSubstanceComponent.confidentiality");
206            else if (Configuration.doAutoCreate())
207              this.confidentiality = new CodeableConcept(); // cc
208          return this.confidentiality;
209        }
210
211        public boolean hasConfidentiality() { 
212          return this.confidentiality != null && !this.confidentiality.isEmpty();
213        }
214
215        /**
216         * @param value {@link #confidentiality} (Confidentiality level of the specified substance as the ingredient.)
217         */
218        public IngredientSpecifiedSubstanceComponent setConfidentiality(CodeableConcept value) { 
219          this.confidentiality = value;
220          return this;
221        }
222
223        /**
224         * @return {@link #strength} (Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.)
225         */
226        public List<IngredientSpecifiedSubstanceStrengthComponent> getStrength() { 
227          if (this.strength == null)
228            this.strength = new ArrayList<IngredientSpecifiedSubstanceStrengthComponent>();
229          return this.strength;
230        }
231
232        /**
233         * @return Returns a reference to <code>this</code> for easy method chaining
234         */
235        public IngredientSpecifiedSubstanceComponent setStrength(List<IngredientSpecifiedSubstanceStrengthComponent> theStrength) { 
236          this.strength = theStrength;
237          return this;
238        }
239
240        public boolean hasStrength() { 
241          if (this.strength == null)
242            return false;
243          for (IngredientSpecifiedSubstanceStrengthComponent item : this.strength)
244            if (!item.isEmpty())
245              return true;
246          return false;
247        }
248
249        public IngredientSpecifiedSubstanceStrengthComponent addStrength() { //3
250          IngredientSpecifiedSubstanceStrengthComponent t = new IngredientSpecifiedSubstanceStrengthComponent();
251          if (this.strength == null)
252            this.strength = new ArrayList<IngredientSpecifiedSubstanceStrengthComponent>();
253          this.strength.add(t);
254          return t;
255        }
256
257        public IngredientSpecifiedSubstanceComponent addStrength(IngredientSpecifiedSubstanceStrengthComponent t) { //3
258          if (t == null)
259            return this;
260          if (this.strength == null)
261            this.strength = new ArrayList<IngredientSpecifiedSubstanceStrengthComponent>();
262          this.strength.add(t);
263          return this;
264        }
265
266        /**
267         * @return The first repetition of repeating field {@link #strength}, creating it if it does not already exist {3}
268         */
269        public IngredientSpecifiedSubstanceStrengthComponent getStrengthFirstRep() { 
270          if (getStrength().isEmpty()) {
271            addStrength();
272          }
273          return getStrength().get(0);
274        }
275
276        protected void listChildren(List<Property> children) {
277          super.listChildren(children);
278          children.add(new Property("code[x]", "CodeableConcept|Reference(SubstanceDefinition|Substance)", "Substance as a 'specified substance', implying extra substance related characteristics.", 0, 1, code));
279          children.add(new Property("group", "CodeableConcept", "The group of specified substance, e.g. group 1 to 4.", 0, 1, group));
280          children.add(new Property("confidentiality", "CodeableConcept", "Confidentiality level of the specified substance as the ingredient.", 0, 1, confidentiality));
281          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));
282        }
283
284        @Override
285        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
286          switch (_hash) {
287          case 941839219: /*code[x]*/  return new Property("code[x]", "CodeableConcept|Reference(SubstanceDefinition|Substance)", "Substance as a 'specified substance', implying extra substance related characteristics.", 0, 1, code);
288          case 3059181: /*code*/  return new Property("code[x]", "CodeableConcept|Reference(SubstanceDefinition|Substance)", "Substance as a 'specified substance', implying extra substance related characteristics.", 0, 1, code);
289          case 4899316: /*codeCodeableConcept*/  return new Property("code[x]", "CodeableConcept", "Substance as a 'specified substance', implying extra substance related characteristics.", 0, 1, code);
290          case 1565461470: /*codeReference*/  return new Property("code[x]", "Reference(SubstanceDefinition|Substance)", "Substance as a 'specified substance', implying extra substance related characteristics.", 0, 1, code);
291          case 98629247: /*group*/  return new Property("group", "CodeableConcept", "The group of specified substance, e.g. group 1 to 4.", 0, 1, group);
292          case -1923018202: /*confidentiality*/  return new Property("confidentiality", "CodeableConcept", "Confidentiality level of the specified substance as the ingredient.", 0, 1, confidentiality);
293          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);
294          default: return super.getNamedProperty(_hash, _name, _checkValid);
295          }
296
297        }
298
299      @Override
300      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
301        switch (hash) {
302        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // DataType
303        case 98629247: /*group*/ return this.group == null ? new Base[0] : new Base[] {this.group}; // CodeableConcept
304        case -1923018202: /*confidentiality*/ return this.confidentiality == null ? new Base[0] : new Base[] {this.confidentiality}; // CodeableConcept
305        case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : this.strength.toArray(new Base[this.strength.size()]); // IngredientSpecifiedSubstanceStrengthComponent
306        default: return super.getProperty(hash, name, checkValid);
307        }
308
309      }
310
311      @Override
312      public Base setProperty(int hash, String name, Base value) throws FHIRException {
313        switch (hash) {
314        case 3059181: // code
315          this.code = TypeConvertor.castToType(value); // DataType
316          return value;
317        case 98629247: // group
318          this.group = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
319          return value;
320        case -1923018202: // confidentiality
321          this.confidentiality = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
322          return value;
323        case 1791316033: // strength
324          this.getStrength().add((IngredientSpecifiedSubstanceStrengthComponent) value); // IngredientSpecifiedSubstanceStrengthComponent
325          return value;
326        default: return super.setProperty(hash, name, value);
327        }
328
329      }
330
331      @Override
332      public Base setProperty(String name, Base value) throws FHIRException {
333        if (name.equals("code[x]")) {
334          this.code = TypeConvertor.castToType(value); // DataType
335        } else if (name.equals("group")) {
336          this.group = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
337        } else if (name.equals("confidentiality")) {
338          this.confidentiality = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
339        } else if (name.equals("strength")) {
340          this.getStrength().add((IngredientSpecifiedSubstanceStrengthComponent) value);
341        } else
342          return super.setProperty(name, value);
343        return value;
344      }
345
346      @Override
347      public Base makeProperty(int hash, String name) throws FHIRException {
348        switch (hash) {
349        case 941839219:  return getCode();
350        case 3059181:  return getCode();
351        case 98629247:  return getGroup();
352        case -1923018202:  return getConfidentiality();
353        case 1791316033:  return addStrength(); 
354        default: return super.makeProperty(hash, name);
355        }
356
357      }
358
359      @Override
360      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
361        switch (hash) {
362        case 3059181: /*code*/ return new String[] {"CodeableConcept", "Reference"};
363        case 98629247: /*group*/ return new String[] {"CodeableConcept"};
364        case -1923018202: /*confidentiality*/ return new String[] {"CodeableConcept"};
365        case 1791316033: /*strength*/ return new String[] {};
366        default: return super.getTypesForProperty(hash, name);
367        }
368
369      }
370
371      @Override
372      public Base addChild(String name) throws FHIRException {
373        if (name.equals("codeCodeableConcept")) {
374          this.code = new CodeableConcept();
375          return this.code;
376        }
377        else if (name.equals("codeReference")) {
378          this.code = new Reference();
379          return this.code;
380        }
381        else if (name.equals("group")) {
382          this.group = new CodeableConcept();
383          return this.group;
384        }
385        else if (name.equals("confidentiality")) {
386          this.confidentiality = new CodeableConcept();
387          return this.confidentiality;
388        }
389        else if (name.equals("strength")) {
390          return addStrength();
391        }
392        else
393          return super.addChild(name);
394      }
395
396      public IngredientSpecifiedSubstanceComponent copy() {
397        IngredientSpecifiedSubstanceComponent dst = new IngredientSpecifiedSubstanceComponent();
398        copyValues(dst);
399        return dst;
400      }
401
402      public void copyValues(IngredientSpecifiedSubstanceComponent dst) {
403        super.copyValues(dst);
404        dst.code = code == null ? null : code.copy();
405        dst.group = group == null ? null : group.copy();
406        dst.confidentiality = confidentiality == null ? null : confidentiality.copy();
407        if (strength != null) {
408          dst.strength = new ArrayList<IngredientSpecifiedSubstanceStrengthComponent>();
409          for (IngredientSpecifiedSubstanceStrengthComponent i : strength)
410            dst.strength.add(i.copy());
411        };
412      }
413
414      @Override
415      public boolean equalsDeep(Base other_) {
416        if (!super.equalsDeep(other_))
417          return false;
418        if (!(other_ instanceof IngredientSpecifiedSubstanceComponent))
419          return false;
420        IngredientSpecifiedSubstanceComponent o = (IngredientSpecifiedSubstanceComponent) other_;
421        return compareDeep(code, o.code, true) && compareDeep(group, o.group, true) && compareDeep(confidentiality, o.confidentiality, true)
422           && compareDeep(strength, o.strength, true);
423      }
424
425      @Override
426      public boolean equalsShallow(Base other_) {
427        if (!super.equalsShallow(other_))
428          return false;
429        if (!(other_ instanceof IngredientSpecifiedSubstanceComponent))
430          return false;
431        IngredientSpecifiedSubstanceComponent o = (IngredientSpecifiedSubstanceComponent) other_;
432        return true;
433      }
434
435      public boolean isEmpty() {
436        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, group, confidentiality
437          , strength);
438      }
439
440  public String fhirType() {
441    return "Ingredient.specifiedSubstance";
442
443  }
444
445  }
446
447    @Block()
448    public static class IngredientSpecifiedSubstanceStrengthComponent extends BackboneElement implements IBaseBackboneElement {
449        /**
450         * The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item.
451         */
452        @Child(name = "presentation", type = {Ratio.class}, order=1, min=0, max=1, modifier=false, summary=true)
453        @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." )
454        protected Ratio presentation;
455
456        /**
457         * An upper limit for the quantity of substance in the unit of presentation. For use when there is a range of strengths, this is the high limit, with the presentation attribute becoming the lower limit.
458         */
459        @Child(name = "presentationHighLimit", type = {Ratio.class}, order=2, min=0, max=1, modifier=true, summary=true)
460        @Description(shortDefinition="An upper limit for the quantity of substance in the unit of presentation. For use when there is a range of strengths, this is the high limit, with the presentation attribute becoming the lower limit", formalDefinition="An upper limit for the quantity of substance in the unit of presentation. For use when there is a range of strengths, this is the high limit, with the presentation attribute becoming the lower limit." )
461        protected Ratio presentationHighLimit;
462
463        /**
464         * The strength per unitary volume (or mass).
465         */
466        @Child(name = "concentration", type = {Ratio.class}, order=3, min=0, max=1, modifier=false, summary=true)
467        @Description(shortDefinition="The strength per unitary volume (or mass)", formalDefinition="The strength per unitary volume (or mass)." )
468        protected Ratio concentration;
469
470        /**
471         * An upper limit for the strength per unitary volume (or mass), for when there is a range. The concentration attribute then becomes the lower limit.
472         */
473        @Child(name = "concentrationHighLimit", type = {Ratio.class}, order=4, min=0, max=1, modifier=true, summary=true)
474        @Description(shortDefinition="An upper limit for the strength per unitary volume (or mass), for when there is a range. The concentration attribute then becomes the lower limit", formalDefinition="An upper limit for the strength per unitary volume (or mass), for when there is a range. The concentration attribute then becomes the lower limit." )
475        protected Ratio concentrationHighLimit;
476
477        /**
478         * For when strength is measured at a particular point or distance.
479         */
480        @Child(name = "measurementPoint", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
481        @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." )
482        protected StringType measurementPoint;
483
484        /**
485         * The country or countries for which the strength range applies.
486         */
487        @Child(name = "country", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
488        @Description(shortDefinition="The country or countries for which the strength range applies", formalDefinition="The country or countries for which the strength range applies." )
489        protected List<CodeableConcept> country;
490
491        /**
492         * Strength expressed in terms of a reference substance.
493         */
494        @Child(name = "referenceStrength", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
495        @Description(shortDefinition="Strength expressed in terms of a reference substance", formalDefinition="Strength expressed in terms of a reference substance." )
496        protected List<IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent> referenceStrength;
497
498        private static final long serialVersionUID = 790266823L;
499
500    /**
501     * Constructor
502     */
503      public IngredientSpecifiedSubstanceStrengthComponent() {
504        super();
505      }
506
507        /**
508         * @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.)
509         */
510        public Ratio getPresentation() { 
511          if (this.presentation == null)
512            if (Configuration.errorOnAutoCreate())
513              throw new Error("Attempt to auto-create IngredientSpecifiedSubstanceStrengthComponent.presentation");
514            else if (Configuration.doAutoCreate())
515              this.presentation = new Ratio(); // cc
516          return this.presentation;
517        }
518
519        public boolean hasPresentation() { 
520          return this.presentation != null && !this.presentation.isEmpty();
521        }
522
523        /**
524         * @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.)
525         */
526        public IngredientSpecifiedSubstanceStrengthComponent setPresentation(Ratio value) { 
527          this.presentation = value;
528          return this;
529        }
530
531        /**
532         * @return {@link #presentationHighLimit} (An upper limit for the quantity of substance in the unit of presentation. For use when there is a range of strengths, this is the high limit, with the presentation attribute becoming the lower limit.)
533         */
534        public Ratio getPresentationHighLimit() { 
535          if (this.presentationHighLimit == null)
536            if (Configuration.errorOnAutoCreate())
537              throw new Error("Attempt to auto-create IngredientSpecifiedSubstanceStrengthComponent.presentationHighLimit");
538            else if (Configuration.doAutoCreate())
539              this.presentationHighLimit = new Ratio(); // cc
540          return this.presentationHighLimit;
541        }
542
543        public boolean hasPresentationHighLimit() { 
544          return this.presentationHighLimit != null && !this.presentationHighLimit.isEmpty();
545        }
546
547        /**
548         * @param value {@link #presentationHighLimit} (An upper limit for the quantity of substance in the unit of presentation. For use when there is a range of strengths, this is the high limit, with the presentation attribute becoming the lower limit.)
549         */
550        public IngredientSpecifiedSubstanceStrengthComponent setPresentationHighLimit(Ratio value) { 
551          this.presentationHighLimit = value;
552          return this;
553        }
554
555        /**
556         * @return {@link #concentration} (The strength per unitary volume (or mass).)
557         */
558        public Ratio getConcentration() { 
559          if (this.concentration == null)
560            if (Configuration.errorOnAutoCreate())
561              throw new Error("Attempt to auto-create IngredientSpecifiedSubstanceStrengthComponent.concentration");
562            else if (Configuration.doAutoCreate())
563              this.concentration = new Ratio(); // cc
564          return this.concentration;
565        }
566
567        public boolean hasConcentration() { 
568          return this.concentration != null && !this.concentration.isEmpty();
569        }
570
571        /**
572         * @param value {@link #concentration} (The strength per unitary volume (or mass).)
573         */
574        public IngredientSpecifiedSubstanceStrengthComponent setConcentration(Ratio value) { 
575          this.concentration = value;
576          return this;
577        }
578
579        /**
580         * @return {@link #concentrationHighLimit} (An upper limit for the strength per unitary volume (or mass), for when there is a range. The concentration attribute then becomes the lower limit.)
581         */
582        public Ratio getConcentrationHighLimit() { 
583          if (this.concentrationHighLimit == null)
584            if (Configuration.errorOnAutoCreate())
585              throw new Error("Attempt to auto-create IngredientSpecifiedSubstanceStrengthComponent.concentrationHighLimit");
586            else if (Configuration.doAutoCreate())
587              this.concentrationHighLimit = new Ratio(); // cc
588          return this.concentrationHighLimit;
589        }
590
591        public boolean hasConcentrationHighLimit() { 
592          return this.concentrationHighLimit != null && !this.concentrationHighLimit.isEmpty();
593        }
594
595        /**
596         * @param value {@link #concentrationHighLimit} (An upper limit for the strength per unitary volume (or mass), for when there is a range. The concentration attribute then becomes the lower limit.)
597         */
598        public IngredientSpecifiedSubstanceStrengthComponent setConcentrationHighLimit(Ratio value) { 
599          this.concentrationHighLimit = value;
600          return this;
601        }
602
603        /**
604         * @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
605         */
606        public StringType getMeasurementPointElement() { 
607          if (this.measurementPoint == null)
608            if (Configuration.errorOnAutoCreate())
609              throw new Error("Attempt to auto-create IngredientSpecifiedSubstanceStrengthComponent.measurementPoint");
610            else if (Configuration.doAutoCreate())
611              this.measurementPoint = new StringType(); // bb
612          return this.measurementPoint;
613        }
614
615        public boolean hasMeasurementPointElement() { 
616          return this.measurementPoint != null && !this.measurementPoint.isEmpty();
617        }
618
619        public boolean hasMeasurementPoint() { 
620          return this.measurementPoint != null && !this.measurementPoint.isEmpty();
621        }
622
623        /**
624         * @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
625         */
626        public IngredientSpecifiedSubstanceStrengthComponent setMeasurementPointElement(StringType value) { 
627          this.measurementPoint = value;
628          return this;
629        }
630
631        /**
632         * @return For when strength is measured at a particular point or distance.
633         */
634        public String getMeasurementPoint() { 
635          return this.measurementPoint == null ? null : this.measurementPoint.getValue();
636        }
637
638        /**
639         * @param value For when strength is measured at a particular point or distance.
640         */
641        public IngredientSpecifiedSubstanceStrengthComponent setMeasurementPoint(String value) { 
642          if (Utilities.noString(value))
643            this.measurementPoint = null;
644          else {
645            if (this.measurementPoint == null)
646              this.measurementPoint = new StringType();
647            this.measurementPoint.setValue(value);
648          }
649          return this;
650        }
651
652        /**
653         * @return {@link #country} (The country or countries for which the strength range applies.)
654         */
655        public List<CodeableConcept> getCountry() { 
656          if (this.country == null)
657            this.country = new ArrayList<CodeableConcept>();
658          return this.country;
659        }
660
661        /**
662         * @return Returns a reference to <code>this</code> for easy method chaining
663         */
664        public IngredientSpecifiedSubstanceStrengthComponent setCountry(List<CodeableConcept> theCountry) { 
665          this.country = theCountry;
666          return this;
667        }
668
669        public boolean hasCountry() { 
670          if (this.country == null)
671            return false;
672          for (CodeableConcept item : this.country)
673            if (!item.isEmpty())
674              return true;
675          return false;
676        }
677
678        public CodeableConcept addCountry() { //3
679          CodeableConcept t = new CodeableConcept();
680          if (this.country == null)
681            this.country = new ArrayList<CodeableConcept>();
682          this.country.add(t);
683          return t;
684        }
685
686        public IngredientSpecifiedSubstanceStrengthComponent addCountry(CodeableConcept t) { //3
687          if (t == null)
688            return this;
689          if (this.country == null)
690            this.country = new ArrayList<CodeableConcept>();
691          this.country.add(t);
692          return this;
693        }
694
695        /**
696         * @return The first repetition of repeating field {@link #country}, creating it if it does not already exist {3}
697         */
698        public CodeableConcept getCountryFirstRep() { 
699          if (getCountry().isEmpty()) {
700            addCountry();
701          }
702          return getCountry().get(0);
703        }
704
705        /**
706         * @return {@link #referenceStrength} (Strength expressed in terms of a reference substance.)
707         */
708        public List<IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent> getReferenceStrength() { 
709          if (this.referenceStrength == null)
710            this.referenceStrength = new ArrayList<IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent>();
711          return this.referenceStrength;
712        }
713
714        /**
715         * @return Returns a reference to <code>this</code> for easy method chaining
716         */
717        public IngredientSpecifiedSubstanceStrengthComponent setReferenceStrength(List<IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent> theReferenceStrength) { 
718          this.referenceStrength = theReferenceStrength;
719          return this;
720        }
721
722        public boolean hasReferenceStrength() { 
723          if (this.referenceStrength == null)
724            return false;
725          for (IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent item : this.referenceStrength)
726            if (!item.isEmpty())
727              return true;
728          return false;
729        }
730
731        public IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent addReferenceStrength() { //3
732          IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent t = new IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent();
733          if (this.referenceStrength == null)
734            this.referenceStrength = new ArrayList<IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent>();
735          this.referenceStrength.add(t);
736          return t;
737        }
738
739        public IngredientSpecifiedSubstanceStrengthComponent addReferenceStrength(IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent t) { //3
740          if (t == null)
741            return this;
742          if (this.referenceStrength == null)
743            this.referenceStrength = new ArrayList<IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent>();
744          this.referenceStrength.add(t);
745          return this;
746        }
747
748        /**
749         * @return The first repetition of repeating field {@link #referenceStrength}, creating it if it does not already exist {3}
750         */
751        public IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent getReferenceStrengthFirstRep() { 
752          if (getReferenceStrength().isEmpty()) {
753            addReferenceStrength();
754          }
755          return getReferenceStrength().get(0);
756        }
757
758        protected void listChildren(List<Property> children) {
759          super.listChildren(children);
760          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));
761          children.add(new Property("presentationHighLimit", "Ratio", "An upper limit for the quantity of substance in the unit of presentation. For use when there is a range of strengths, this is the high limit, with the presentation attribute becoming the lower limit.", 0, 1, presentationHighLimit));
762          children.add(new Property("concentration", "Ratio", "The strength per unitary volume (or mass).", 0, 1, concentration));
763          children.add(new Property("concentrationHighLimit", "Ratio", "An upper limit for the strength per unitary volume (or mass), for when there is a range. The concentration attribute then becomes the lower limit.", 0, 1, concentrationHighLimit));
764          children.add(new Property("measurementPoint", "string", "For when strength is measured at a particular point or distance.", 0, 1, measurementPoint));
765          children.add(new Property("country", "CodeableConcept", "The country or countries for which the strength range applies.", 0, java.lang.Integer.MAX_VALUE, country));
766          children.add(new Property("referenceStrength", "", "Strength expressed in terms of a reference substance.", 0, java.lang.Integer.MAX_VALUE, referenceStrength));
767        }
768
769        @Override
770        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
771          switch (_hash) {
772          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);
773          case 904802623: /*presentationHighLimit*/  return new Property("presentationHighLimit", "Ratio", "An upper limit for the quantity of substance in the unit of presentation. For use when there is a range of strengths, this is the high limit, with the presentation attribute becoming the lower limit.", 0, 1, presentationHighLimit);
774          case -410557331: /*concentration*/  return new Property("concentration", "Ratio", "The strength per unitary volume (or mass).", 0, 1, concentration);
775          case -1595729588: /*concentrationHighLimit*/  return new Property("concentrationHighLimit", "Ratio", "An upper limit for the strength per unitary volume (or mass), for when there is a range. The concentration attribute then becomes the lower limit.", 0, 1, concentrationHighLimit);
776          case 235437876: /*measurementPoint*/  return new Property("measurementPoint", "string", "For when strength is measured at a particular point or distance.", 0, 1, measurementPoint);
777          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);
778          case 1943566508: /*referenceStrength*/  return new Property("referenceStrength", "", "Strength expressed in terms of a reference substance.", 0, java.lang.Integer.MAX_VALUE, referenceStrength);
779          default: return super.getNamedProperty(_hash, _name, _checkValid);
780          }
781
782        }
783
784      @Override
785      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
786        switch (hash) {
787        case 696975130: /*presentation*/ return this.presentation == null ? new Base[0] : new Base[] {this.presentation}; // Ratio
788        case 904802623: /*presentationHighLimit*/ return this.presentationHighLimit == null ? new Base[0] : new Base[] {this.presentationHighLimit}; // Ratio
789        case -410557331: /*concentration*/ return this.concentration == null ? new Base[0] : new Base[] {this.concentration}; // Ratio
790        case -1595729588: /*concentrationHighLimit*/ return this.concentrationHighLimit == null ? new Base[0] : new Base[] {this.concentrationHighLimit}; // Ratio
791        case 235437876: /*measurementPoint*/ return this.measurementPoint == null ? new Base[0] : new Base[] {this.measurementPoint}; // StringType
792        case 957831062: /*country*/ return this.country == null ? new Base[0] : this.country.toArray(new Base[this.country.size()]); // CodeableConcept
793        case 1943566508: /*referenceStrength*/ return this.referenceStrength == null ? new Base[0] : this.referenceStrength.toArray(new Base[this.referenceStrength.size()]); // IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent
794        default: return super.getProperty(hash, name, checkValid);
795        }
796
797      }
798
799      @Override
800      public Base setProperty(int hash, String name, Base value) throws FHIRException {
801        switch (hash) {
802        case 696975130: // presentation
803          this.presentation = TypeConvertor.castToRatio(value); // Ratio
804          return value;
805        case 904802623: // presentationHighLimit
806          this.presentationHighLimit = TypeConvertor.castToRatio(value); // Ratio
807          return value;
808        case -410557331: // concentration
809          this.concentration = TypeConvertor.castToRatio(value); // Ratio
810          return value;
811        case -1595729588: // concentrationHighLimit
812          this.concentrationHighLimit = TypeConvertor.castToRatio(value); // Ratio
813          return value;
814        case 235437876: // measurementPoint
815          this.measurementPoint = TypeConvertor.castToString(value); // StringType
816          return value;
817        case 957831062: // country
818          this.getCountry().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
819          return value;
820        case 1943566508: // referenceStrength
821          this.getReferenceStrength().add((IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent) value); // IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent
822          return value;
823        default: return super.setProperty(hash, name, value);
824        }
825
826      }
827
828      @Override
829      public Base setProperty(String name, Base value) throws FHIRException {
830        if (name.equals("presentation")) {
831          this.presentation = TypeConvertor.castToRatio(value); // Ratio
832        } else if (name.equals("presentationHighLimit")) {
833          this.presentationHighLimit = TypeConvertor.castToRatio(value); // Ratio
834        } else if (name.equals("concentration")) {
835          this.concentration = TypeConvertor.castToRatio(value); // Ratio
836        } else if (name.equals("concentrationHighLimit")) {
837          this.concentrationHighLimit = TypeConvertor.castToRatio(value); // Ratio
838        } else if (name.equals("measurementPoint")) {
839          this.measurementPoint = TypeConvertor.castToString(value); // StringType
840        } else if (name.equals("country")) {
841          this.getCountry().add(TypeConvertor.castToCodeableConcept(value));
842        } else if (name.equals("referenceStrength")) {
843          this.getReferenceStrength().add((IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent) value);
844        } else
845          return super.setProperty(name, value);
846        return value;
847      }
848
849      @Override
850      public Base makeProperty(int hash, String name) throws FHIRException {
851        switch (hash) {
852        case 696975130:  return getPresentation();
853        case 904802623:  return getPresentationHighLimit();
854        case -410557331:  return getConcentration();
855        case -1595729588:  return getConcentrationHighLimit();
856        case 235437876:  return getMeasurementPointElement();
857        case 957831062:  return addCountry(); 
858        case 1943566508:  return addReferenceStrength(); 
859        default: return super.makeProperty(hash, name);
860        }
861
862      }
863
864      @Override
865      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
866        switch (hash) {
867        case 696975130: /*presentation*/ return new String[] {"Ratio"};
868        case 904802623: /*presentationHighLimit*/ return new String[] {"Ratio"};
869        case -410557331: /*concentration*/ return new String[] {"Ratio"};
870        case -1595729588: /*concentrationHighLimit*/ return new String[] {"Ratio"};
871        case 235437876: /*measurementPoint*/ return new String[] {"string"};
872        case 957831062: /*country*/ return new String[] {"CodeableConcept"};
873        case 1943566508: /*referenceStrength*/ return new String[] {};
874        default: return super.getTypesForProperty(hash, name);
875        }
876
877      }
878
879      @Override
880      public Base addChild(String name) throws FHIRException {
881        if (name.equals("presentation")) {
882          this.presentation = new Ratio();
883          return this.presentation;
884        }
885        else if (name.equals("presentationHighLimit")) {
886          this.presentationHighLimit = new Ratio();
887          return this.presentationHighLimit;
888        }
889        else if (name.equals("concentration")) {
890          this.concentration = new Ratio();
891          return this.concentration;
892        }
893        else if (name.equals("concentrationHighLimit")) {
894          this.concentrationHighLimit = new Ratio();
895          return this.concentrationHighLimit;
896        }
897        else if (name.equals("measurementPoint")) {
898          throw new FHIRException("Cannot call addChild on a primitive type Ingredient.specifiedSubstance.strength.measurementPoint");
899        }
900        else if (name.equals("country")) {
901          return addCountry();
902        }
903        else if (name.equals("referenceStrength")) {
904          return addReferenceStrength();
905        }
906        else
907          return super.addChild(name);
908      }
909
910      public IngredientSpecifiedSubstanceStrengthComponent copy() {
911        IngredientSpecifiedSubstanceStrengthComponent dst = new IngredientSpecifiedSubstanceStrengthComponent();
912        copyValues(dst);
913        return dst;
914      }
915
916      public void copyValues(IngredientSpecifiedSubstanceStrengthComponent dst) {
917        super.copyValues(dst);
918        dst.presentation = presentation == null ? null : presentation.copy();
919        dst.presentationHighLimit = presentationHighLimit == null ? null : presentationHighLimit.copy();
920        dst.concentration = concentration == null ? null : concentration.copy();
921        dst.concentrationHighLimit = concentrationHighLimit == null ? null : concentrationHighLimit.copy();
922        dst.measurementPoint = measurementPoint == null ? null : measurementPoint.copy();
923        if (country != null) {
924          dst.country = new ArrayList<CodeableConcept>();
925          for (CodeableConcept i : country)
926            dst.country.add(i.copy());
927        };
928        if (referenceStrength != null) {
929          dst.referenceStrength = new ArrayList<IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent>();
930          for (IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent i : referenceStrength)
931            dst.referenceStrength.add(i.copy());
932        };
933      }
934
935      @Override
936      public boolean equalsDeep(Base other_) {
937        if (!super.equalsDeep(other_))
938          return false;
939        if (!(other_ instanceof IngredientSpecifiedSubstanceStrengthComponent))
940          return false;
941        IngredientSpecifiedSubstanceStrengthComponent o = (IngredientSpecifiedSubstanceStrengthComponent) other_;
942        return compareDeep(presentation, o.presentation, true) && compareDeep(presentationHighLimit, o.presentationHighLimit, true)
943           && compareDeep(concentration, o.concentration, true) && compareDeep(concentrationHighLimit, o.concentrationHighLimit, true)
944           && compareDeep(measurementPoint, o.measurementPoint, true) && compareDeep(country, o.country, true)
945           && compareDeep(referenceStrength, o.referenceStrength, true);
946      }
947
948      @Override
949      public boolean equalsShallow(Base other_) {
950        if (!super.equalsShallow(other_))
951          return false;
952        if (!(other_ instanceof IngredientSpecifiedSubstanceStrengthComponent))
953          return false;
954        IngredientSpecifiedSubstanceStrengthComponent o = (IngredientSpecifiedSubstanceStrengthComponent) other_;
955        return compareValues(measurementPoint, o.measurementPoint, true);
956      }
957
958      public boolean isEmpty() {
959        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(presentation, presentationHighLimit
960          , concentration, concentrationHighLimit, measurementPoint, country, referenceStrength
961          );
962      }
963
964  public String fhirType() {
965    return "Ingredient.specifiedSubstance.strength";
966
967  }
968
969  }
970
971    @Block()
972    public static class IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent extends BackboneElement implements IBaseBackboneElement {
973        /**
974         * Relevant reference substance.
975         */
976        @Child(name = "substance", type = {CodeableConcept.class, SubstanceDefinition.class, Substance.class}, order=1, min=0, max=1, modifier=false, summary=true)
977        @Description(shortDefinition="Relevant reference substance", formalDefinition="Relevant reference substance." )
978        protected DataType substance;
979
980        /**
981         * Strength expressed in terms of a reference substance.
982         */
983        @Child(name = "strength", type = {Ratio.class}, order=2, min=1, max=1, modifier=false, summary=true)
984        @Description(shortDefinition="Strength expressed in terms of a reference substance", formalDefinition="Strength expressed in terms of a reference substance." )
985        protected Ratio strength;
986
987        /**
988         * Strength expressed in terms of a reference substance, upper limit.
989         */
990        @Child(name = "strengthHighLimit", type = {Ratio.class}, order=3, min=0, max=1, modifier=false, summary=true)
991        @Description(shortDefinition="Strength expressed in terms of a reference substance, upper limit", formalDefinition="Strength expressed in terms of a reference substance, upper limit." )
992        protected Ratio strengthHighLimit;
993
994        /**
995         * For when strength is measured at a particular point or distance.
996         */
997        @Child(name = "measurementPoint", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
998        @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." )
999        protected StringType measurementPoint;
1000
1001        /**
1002         * The country or countries for which the strength range applies.
1003         */
1004        @Child(name = "country", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1005        @Description(shortDefinition="The country or countries for which the strength range applies", formalDefinition="The country or countries for which the strength range applies." )
1006        protected List<CodeableConcept> country;
1007
1008        private static final long serialVersionUID = 1274073375L;
1009
1010    /**
1011     * Constructor
1012     */
1013      public IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent() {
1014        super();
1015      }
1016
1017    /**
1018     * Constructor
1019     */
1020      public IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent(Ratio strength) {
1021        super();
1022        this.setStrength(strength);
1023      }
1024
1025        /**
1026         * @return {@link #substance} (Relevant reference substance.)
1027         */
1028        public DataType getSubstance() { 
1029          return this.substance;
1030        }
1031
1032        /**
1033         * @return {@link #substance} (Relevant reference substance.)
1034         */
1035        public CodeableConcept getSubstanceCodeableConcept() throws FHIRException { 
1036          if (this.substance == null)
1037            this.substance = new CodeableConcept();
1038          if (!(this.substance instanceof CodeableConcept))
1039            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.substance.getClass().getName()+" was encountered");
1040          return (CodeableConcept) this.substance;
1041        }
1042
1043        public boolean hasSubstanceCodeableConcept() { 
1044          return this != null && this.substance instanceof CodeableConcept;
1045        }
1046
1047        /**
1048         * @return {@link #substance} (Relevant reference substance.)
1049         */
1050        public Reference getSubstanceReference() throws FHIRException { 
1051          if (this.substance == null)
1052            this.substance = new Reference();
1053          if (!(this.substance instanceof Reference))
1054            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.substance.getClass().getName()+" was encountered");
1055          return (Reference) this.substance;
1056        }
1057
1058        public boolean hasSubstanceReference() { 
1059          return this != null && this.substance instanceof Reference;
1060        }
1061
1062        public boolean hasSubstance() { 
1063          return this.substance != null && !this.substance.isEmpty();
1064        }
1065
1066        /**
1067         * @param value {@link #substance} (Relevant reference substance.)
1068         */
1069        public IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent setSubstance(DataType value) { 
1070          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
1071            throw new Error("Not the right type for Ingredient.specifiedSubstance.strength.referenceStrength.substance[x]: "+value.fhirType());
1072          this.substance = value;
1073          return this;
1074        }
1075
1076        /**
1077         * @return {@link #strength} (Strength expressed in terms of a reference substance.)
1078         */
1079        public Ratio getStrength() { 
1080          if (this.strength == null)
1081            if (Configuration.errorOnAutoCreate())
1082              throw new Error("Attempt to auto-create IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent.strength");
1083            else if (Configuration.doAutoCreate())
1084              this.strength = new Ratio(); // cc
1085          return this.strength;
1086        }
1087
1088        public boolean hasStrength() { 
1089          return this.strength != null && !this.strength.isEmpty();
1090        }
1091
1092        /**
1093         * @param value {@link #strength} (Strength expressed in terms of a reference substance.)
1094         */
1095        public IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent setStrength(Ratio value) { 
1096          this.strength = value;
1097          return this;
1098        }
1099
1100        /**
1101         * @return {@link #strengthHighLimit} (Strength expressed in terms of a reference substance, upper limit.)
1102         */
1103        public Ratio getStrengthHighLimit() { 
1104          if (this.strengthHighLimit == null)
1105            if (Configuration.errorOnAutoCreate())
1106              throw new Error("Attempt to auto-create IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent.strengthHighLimit");
1107            else if (Configuration.doAutoCreate())
1108              this.strengthHighLimit = new Ratio(); // cc
1109          return this.strengthHighLimit;
1110        }
1111
1112        public boolean hasStrengthHighLimit() { 
1113          return this.strengthHighLimit != null && !this.strengthHighLimit.isEmpty();
1114        }
1115
1116        /**
1117         * @param value {@link #strengthHighLimit} (Strength expressed in terms of a reference substance, upper limit.)
1118         */
1119        public IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent setStrengthHighLimit(Ratio value) { 
1120          this.strengthHighLimit = value;
1121          return this;
1122        }
1123
1124        /**
1125         * @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
1126         */
1127        public StringType getMeasurementPointElement() { 
1128          if (this.measurementPoint == null)
1129            if (Configuration.errorOnAutoCreate())
1130              throw new Error("Attempt to auto-create IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent.measurementPoint");
1131            else if (Configuration.doAutoCreate())
1132              this.measurementPoint = new StringType(); // bb
1133          return this.measurementPoint;
1134        }
1135
1136        public boolean hasMeasurementPointElement() { 
1137          return this.measurementPoint != null && !this.measurementPoint.isEmpty();
1138        }
1139
1140        public boolean hasMeasurementPoint() { 
1141          return this.measurementPoint != null && !this.measurementPoint.isEmpty();
1142        }
1143
1144        /**
1145         * @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
1146         */
1147        public IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent setMeasurementPointElement(StringType value) { 
1148          this.measurementPoint = value;
1149          return this;
1150        }
1151
1152        /**
1153         * @return For when strength is measured at a particular point or distance.
1154         */
1155        public String getMeasurementPoint() { 
1156          return this.measurementPoint == null ? null : this.measurementPoint.getValue();
1157        }
1158
1159        /**
1160         * @param value For when strength is measured at a particular point or distance.
1161         */
1162        public IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent setMeasurementPoint(String value) { 
1163          if (Utilities.noString(value))
1164            this.measurementPoint = null;
1165          else {
1166            if (this.measurementPoint == null)
1167              this.measurementPoint = new StringType();
1168            this.measurementPoint.setValue(value);
1169          }
1170          return this;
1171        }
1172
1173        /**
1174         * @return {@link #country} (The country or countries for which the strength range applies.)
1175         */
1176        public List<CodeableConcept> getCountry() { 
1177          if (this.country == null)
1178            this.country = new ArrayList<CodeableConcept>();
1179          return this.country;
1180        }
1181
1182        /**
1183         * @return Returns a reference to <code>this</code> for easy method chaining
1184         */
1185        public IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent setCountry(List<CodeableConcept> theCountry) { 
1186          this.country = theCountry;
1187          return this;
1188        }
1189
1190        public boolean hasCountry() { 
1191          if (this.country == null)
1192            return false;
1193          for (CodeableConcept item : this.country)
1194            if (!item.isEmpty())
1195              return true;
1196          return false;
1197        }
1198
1199        public CodeableConcept addCountry() { //3
1200          CodeableConcept t = new CodeableConcept();
1201          if (this.country == null)
1202            this.country = new ArrayList<CodeableConcept>();
1203          this.country.add(t);
1204          return t;
1205        }
1206
1207        public IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent addCountry(CodeableConcept t) { //3
1208          if (t == null)
1209            return this;
1210          if (this.country == null)
1211            this.country = new ArrayList<CodeableConcept>();
1212          this.country.add(t);
1213          return this;
1214        }
1215
1216        /**
1217         * @return The first repetition of repeating field {@link #country}, creating it if it does not already exist {3}
1218         */
1219        public CodeableConcept getCountryFirstRep() { 
1220          if (getCountry().isEmpty()) {
1221            addCountry();
1222          }
1223          return getCountry().get(0);
1224        }
1225
1226        protected void listChildren(List<Property> children) {
1227          super.listChildren(children);
1228          children.add(new Property("substance[x]", "CodeableConcept|Reference(SubstanceDefinition|Substance)", "Relevant reference substance.", 0, 1, substance));
1229          children.add(new Property("strength", "Ratio", "Strength expressed in terms of a reference substance.", 0, 1, strength));
1230          children.add(new Property("strengthHighLimit", "Ratio", "Strength expressed in terms of a reference substance, upper limit.", 0, 1, strengthHighLimit));
1231          children.add(new Property("measurementPoint", "string", "For when strength is measured at a particular point or distance.", 0, 1, measurementPoint));
1232          children.add(new Property("country", "CodeableConcept", "The country or countries for which the strength range applies.", 0, java.lang.Integer.MAX_VALUE, country));
1233        }
1234
1235        @Override
1236        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1237          switch (_hash) {
1238          case 2127194384: /*substance[x]*/  return new Property("substance[x]", "CodeableConcept|Reference(SubstanceDefinition|Substance)", "Relevant reference substance.", 0, 1, substance);
1239          case 530040176: /*substance*/  return new Property("substance[x]", "CodeableConcept|Reference(SubstanceDefinition|Substance)", "Relevant reference substance.", 0, 1, substance);
1240          case -1974119407: /*substanceCodeableConcept*/  return new Property("substance[x]", "CodeableConcept", "Relevant reference substance.", 0, 1, substance);
1241          case 516208571: /*substanceReference*/  return new Property("substance[x]", "Reference(SubstanceDefinition|Substance)", "Relevant reference substance.", 0, 1, substance);
1242          case 1791316033: /*strength*/  return new Property("strength", "Ratio", "Strength expressed in terms of a reference substance.", 0, 1, strength);
1243          case 703544312: /*strengthHighLimit*/  return new Property("strengthHighLimit", "Ratio", "Strength expressed in terms of a reference substance, upper limit.", 0, 1, strengthHighLimit);
1244          case 235437876: /*measurementPoint*/  return new Property("measurementPoint", "string", "For when strength is measured at a particular point or distance.", 0, 1, measurementPoint);
1245          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);
1246          default: return super.getNamedProperty(_hash, _name, _checkValid);
1247          }
1248
1249        }
1250
1251      @Override
1252      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1253        switch (hash) {
1254        case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // DataType
1255        case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : new Base[] {this.strength}; // Ratio
1256        case 703544312: /*strengthHighLimit*/ return this.strengthHighLimit == null ? new Base[0] : new Base[] {this.strengthHighLimit}; // Ratio
1257        case 235437876: /*measurementPoint*/ return this.measurementPoint == null ? new Base[0] : new Base[] {this.measurementPoint}; // StringType
1258        case 957831062: /*country*/ return this.country == null ? new Base[0] : this.country.toArray(new Base[this.country.size()]); // CodeableConcept
1259        default: return super.getProperty(hash, name, checkValid);
1260        }
1261
1262      }
1263
1264      @Override
1265      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1266        switch (hash) {
1267        case 530040176: // substance
1268          this.substance = TypeConvertor.castToType(value); // DataType
1269          return value;
1270        case 1791316033: // strength
1271          this.strength = TypeConvertor.castToRatio(value); // Ratio
1272          return value;
1273        case 703544312: // strengthHighLimit
1274          this.strengthHighLimit = TypeConvertor.castToRatio(value); // Ratio
1275          return value;
1276        case 235437876: // measurementPoint
1277          this.measurementPoint = TypeConvertor.castToString(value); // StringType
1278          return value;
1279        case 957831062: // country
1280          this.getCountry().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1281          return value;
1282        default: return super.setProperty(hash, name, value);
1283        }
1284
1285      }
1286
1287      @Override
1288      public Base setProperty(String name, Base value) throws FHIRException {
1289        if (name.equals("substance[x]")) {
1290          this.substance = TypeConvertor.castToType(value); // DataType
1291        } else if (name.equals("strength")) {
1292          this.strength = TypeConvertor.castToRatio(value); // Ratio
1293        } else if (name.equals("strengthHighLimit")) {
1294          this.strengthHighLimit = TypeConvertor.castToRatio(value); // Ratio
1295        } else if (name.equals("measurementPoint")) {
1296          this.measurementPoint = TypeConvertor.castToString(value); // StringType
1297        } else if (name.equals("country")) {
1298          this.getCountry().add(TypeConvertor.castToCodeableConcept(value));
1299        } else
1300          return super.setProperty(name, value);
1301        return value;
1302      }
1303
1304      @Override
1305      public Base makeProperty(int hash, String name) throws FHIRException {
1306        switch (hash) {
1307        case 2127194384:  return getSubstance();
1308        case 530040176:  return getSubstance();
1309        case 1791316033:  return getStrength();
1310        case 703544312:  return getStrengthHighLimit();
1311        case 235437876:  return getMeasurementPointElement();
1312        case 957831062:  return addCountry(); 
1313        default: return super.makeProperty(hash, name);
1314        }
1315
1316      }
1317
1318      @Override
1319      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1320        switch (hash) {
1321        case 530040176: /*substance*/ return new String[] {"CodeableConcept", "Reference"};
1322        case 1791316033: /*strength*/ return new String[] {"Ratio"};
1323        case 703544312: /*strengthHighLimit*/ return new String[] {"Ratio"};
1324        case 235437876: /*measurementPoint*/ return new String[] {"string"};
1325        case 957831062: /*country*/ return new String[] {"CodeableConcept"};
1326        default: return super.getTypesForProperty(hash, name);
1327        }
1328
1329      }
1330
1331      @Override
1332      public Base addChild(String name) throws FHIRException {
1333        if (name.equals("substanceCodeableConcept")) {
1334          this.substance = new CodeableConcept();
1335          return this.substance;
1336        }
1337        else if (name.equals("substanceReference")) {
1338          this.substance = new Reference();
1339          return this.substance;
1340        }
1341        else if (name.equals("strength")) {
1342          this.strength = new Ratio();
1343          return this.strength;
1344        }
1345        else if (name.equals("strengthHighLimit")) {
1346          this.strengthHighLimit = new Ratio();
1347          return this.strengthHighLimit;
1348        }
1349        else if (name.equals("measurementPoint")) {
1350          throw new FHIRException("Cannot call addChild on a primitive type Ingredient.specifiedSubstance.strength.referenceStrength.measurementPoint");
1351        }
1352        else if (name.equals("country")) {
1353          return addCountry();
1354        }
1355        else
1356          return super.addChild(name);
1357      }
1358
1359      public IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent copy() {
1360        IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent dst = new IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent();
1361        copyValues(dst);
1362        return dst;
1363      }
1364
1365      public void copyValues(IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent dst) {
1366        super.copyValues(dst);
1367        dst.substance = substance == null ? null : substance.copy();
1368        dst.strength = strength == null ? null : strength.copy();
1369        dst.strengthHighLimit = strengthHighLimit == null ? null : strengthHighLimit.copy();
1370        dst.measurementPoint = measurementPoint == null ? null : measurementPoint.copy();
1371        if (country != null) {
1372          dst.country = new ArrayList<CodeableConcept>();
1373          for (CodeableConcept i : country)
1374            dst.country.add(i.copy());
1375        };
1376      }
1377
1378      @Override
1379      public boolean equalsDeep(Base other_) {
1380        if (!super.equalsDeep(other_))
1381          return false;
1382        if (!(other_ instanceof IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent))
1383          return false;
1384        IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent o = (IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent) other_;
1385        return compareDeep(substance, o.substance, true) && compareDeep(strength, o.strength, true) && compareDeep(strengthHighLimit, o.strengthHighLimit, true)
1386           && compareDeep(measurementPoint, o.measurementPoint, true) && compareDeep(country, o.country, true)
1387          ;
1388      }
1389
1390      @Override
1391      public boolean equalsShallow(Base other_) {
1392        if (!super.equalsShallow(other_))
1393          return false;
1394        if (!(other_ instanceof IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent))
1395          return false;
1396        IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent o = (IngredientSpecifiedSubstanceStrengthReferenceStrengthComponent) other_;
1397        return compareValues(measurementPoint, o.measurementPoint, true);
1398      }
1399
1400      public boolean isEmpty() {
1401        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(substance, strength, strengthHighLimit
1402          , measurementPoint, country);
1403      }
1404
1405  public String fhirType() {
1406    return "Ingredient.specifiedSubstance.strength.referenceStrength";
1407
1408  }
1409
1410  }
1411
1412    @Block()
1413    public static class IngredientSubstanceComponent extends BackboneElement implements IBaseBackboneElement {
1414        /**
1415         * A code that represents the ingredient substance.
1416         */
1417        @Child(name = "code", type = {CodeableConcept.class, SubstanceDefinition.class, Substance.class}, order=1, min=1, max=1, modifier=false, summary=true)
1418        @Description(shortDefinition="A code that represents the ingredient substance", formalDefinition="A code that represents the ingredient substance." )
1419        protected DataType code;
1420
1421        /**
1422         * Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.
1423         */
1424        @Child(name = "strength", type = {IngredientSpecifiedSubstanceStrengthComponent.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1425        @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." )
1426        protected List<IngredientSpecifiedSubstanceStrengthComponent> strength;
1427
1428        private static final long serialVersionUID = -43161323L;
1429
1430    /**
1431     * Constructor
1432     */
1433      public IngredientSubstanceComponent() {
1434        super();
1435      }
1436
1437    /**
1438     * Constructor
1439     */
1440      public IngredientSubstanceComponent(DataType code) {
1441        super();
1442        this.setCode(code);
1443      }
1444
1445        /**
1446         * @return {@link #code} (A code that represents the ingredient substance.)
1447         */
1448        public DataType getCode() { 
1449          return this.code;
1450        }
1451
1452        /**
1453         * @return {@link #code} (A code that represents the ingredient substance.)
1454         */
1455        public CodeableConcept getCodeCodeableConcept() throws FHIRException { 
1456          if (this.code == null)
1457            this.code = new CodeableConcept();
1458          if (!(this.code instanceof CodeableConcept))
1459            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.code.getClass().getName()+" was encountered");
1460          return (CodeableConcept) this.code;
1461        }
1462
1463        public boolean hasCodeCodeableConcept() { 
1464          return this != null && this.code instanceof CodeableConcept;
1465        }
1466
1467        /**
1468         * @return {@link #code} (A code that represents the ingredient substance.)
1469         */
1470        public Reference getCodeReference() throws FHIRException { 
1471          if (this.code == null)
1472            this.code = new Reference();
1473          if (!(this.code instanceof Reference))
1474            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.code.getClass().getName()+" was encountered");
1475          return (Reference) this.code;
1476        }
1477
1478        public boolean hasCodeReference() { 
1479          return this != null && this.code instanceof Reference;
1480        }
1481
1482        public boolean hasCode() { 
1483          return this.code != null && !this.code.isEmpty();
1484        }
1485
1486        /**
1487         * @param value {@link #code} (A code that represents the ingredient substance.)
1488         */
1489        public IngredientSubstanceComponent setCode(DataType value) { 
1490          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
1491            throw new Error("Not the right type for Ingredient.substance.code[x]: "+value.fhirType());
1492          this.code = value;
1493          return this;
1494        }
1495
1496        /**
1497         * @return {@link #strength} (Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.)
1498         */
1499        public List<IngredientSpecifiedSubstanceStrengthComponent> getStrength() { 
1500          if (this.strength == null)
1501            this.strength = new ArrayList<IngredientSpecifiedSubstanceStrengthComponent>();
1502          return this.strength;
1503        }
1504
1505        /**
1506         * @return Returns a reference to <code>this</code> for easy method chaining
1507         */
1508        public IngredientSubstanceComponent setStrength(List<IngredientSpecifiedSubstanceStrengthComponent> theStrength) { 
1509          this.strength = theStrength;
1510          return this;
1511        }
1512
1513        public boolean hasStrength() { 
1514          if (this.strength == null)
1515            return false;
1516          for (IngredientSpecifiedSubstanceStrengthComponent item : this.strength)
1517            if (!item.isEmpty())
1518              return true;
1519          return false;
1520        }
1521
1522        public IngredientSpecifiedSubstanceStrengthComponent addStrength() { //3
1523          IngredientSpecifiedSubstanceStrengthComponent t = new IngredientSpecifiedSubstanceStrengthComponent();
1524          if (this.strength == null)
1525            this.strength = new ArrayList<IngredientSpecifiedSubstanceStrengthComponent>();
1526          this.strength.add(t);
1527          return t;
1528        }
1529
1530        public IngredientSubstanceComponent addStrength(IngredientSpecifiedSubstanceStrengthComponent t) { //3
1531          if (t == null)
1532            return this;
1533          if (this.strength == null)
1534            this.strength = new ArrayList<IngredientSpecifiedSubstanceStrengthComponent>();
1535          this.strength.add(t);
1536          return this;
1537        }
1538
1539        /**
1540         * @return The first repetition of repeating field {@link #strength}, creating it if it does not already exist {3}
1541         */
1542        public IngredientSpecifiedSubstanceStrengthComponent getStrengthFirstRep() { 
1543          if (getStrength().isEmpty()) {
1544            addStrength();
1545          }
1546          return getStrength().get(0);
1547        }
1548
1549        protected void listChildren(List<Property> children) {
1550          super.listChildren(children);
1551          children.add(new Property("code[x]", "CodeableConcept|Reference(SubstanceDefinition|Substance)", "A code that represents the ingredient substance.", 0, 1, code));
1552          children.add(new Property("strength", "@Ingredient.specifiedSubstance.strength", "Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.", 0, java.lang.Integer.MAX_VALUE, strength));
1553        }
1554
1555        @Override
1556        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1557          switch (_hash) {
1558          case 941839219: /*code[x]*/  return new Property("code[x]", "CodeableConcept|Reference(SubstanceDefinition|Substance)", "A code that represents the ingredient substance.", 0, 1, code);
1559          case 3059181: /*code*/  return new Property("code[x]", "CodeableConcept|Reference(SubstanceDefinition|Substance)", "A code that represents the ingredient substance.", 0, 1, code);
1560          case 4899316: /*codeCodeableConcept*/  return new Property("code[x]", "CodeableConcept", "A code that represents the ingredient substance.", 0, 1, code);
1561          case 1565461470: /*codeReference*/  return new Property("code[x]", "Reference(SubstanceDefinition|Substance)", "A code that represents the ingredient substance.", 0, 1, code);
1562          case 1791316033: /*strength*/  return new Property("strength", "@Ingredient.specifiedSubstance.strength", "Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.", 0, java.lang.Integer.MAX_VALUE, strength);
1563          default: return super.getNamedProperty(_hash, _name, _checkValid);
1564          }
1565
1566        }
1567
1568      @Override
1569      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1570        switch (hash) {
1571        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // DataType
1572        case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : this.strength.toArray(new Base[this.strength.size()]); // IngredientSpecifiedSubstanceStrengthComponent
1573        default: return super.getProperty(hash, name, checkValid);
1574        }
1575
1576      }
1577
1578      @Override
1579      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1580        switch (hash) {
1581        case 3059181: // code
1582          this.code = TypeConvertor.castToType(value); // DataType
1583          return value;
1584        case 1791316033: // strength
1585          this.getStrength().add((IngredientSpecifiedSubstanceStrengthComponent) value); // IngredientSpecifiedSubstanceStrengthComponent
1586          return value;
1587        default: return super.setProperty(hash, name, value);
1588        }
1589
1590      }
1591
1592      @Override
1593      public Base setProperty(String name, Base value) throws FHIRException {
1594        if (name.equals("code[x]")) {
1595          this.code = TypeConvertor.castToType(value); // DataType
1596        } else if (name.equals("strength")) {
1597          this.getStrength().add((IngredientSpecifiedSubstanceStrengthComponent) value);
1598        } else
1599          return super.setProperty(name, value);
1600        return value;
1601      }
1602
1603      @Override
1604      public Base makeProperty(int hash, String name) throws FHIRException {
1605        switch (hash) {
1606        case 941839219:  return getCode();
1607        case 3059181:  return getCode();
1608        case 1791316033:  return addStrength(); 
1609        default: return super.makeProperty(hash, name);
1610        }
1611
1612      }
1613
1614      @Override
1615      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1616        switch (hash) {
1617        case 3059181: /*code*/ return new String[] {"CodeableConcept", "Reference"};
1618        case 1791316033: /*strength*/ return new String[] {"@Ingredient.specifiedSubstance.strength"};
1619        default: return super.getTypesForProperty(hash, name);
1620        }
1621
1622      }
1623
1624      @Override
1625      public Base addChild(String name) throws FHIRException {
1626        if (name.equals("codeCodeableConcept")) {
1627          this.code = new CodeableConcept();
1628          return this.code;
1629        }
1630        else if (name.equals("codeReference")) {
1631          this.code = new Reference();
1632          return this.code;
1633        }
1634        else if (name.equals("strength")) {
1635          return addStrength();
1636        }
1637        else
1638          return super.addChild(name);
1639      }
1640
1641      public IngredientSubstanceComponent copy() {
1642        IngredientSubstanceComponent dst = new IngredientSubstanceComponent();
1643        copyValues(dst);
1644        return dst;
1645      }
1646
1647      public void copyValues(IngredientSubstanceComponent dst) {
1648        super.copyValues(dst);
1649        dst.code = code == null ? null : code.copy();
1650        if (strength != null) {
1651          dst.strength = new ArrayList<IngredientSpecifiedSubstanceStrengthComponent>();
1652          for (IngredientSpecifiedSubstanceStrengthComponent i : strength)
1653            dst.strength.add(i.copy());
1654        };
1655      }
1656
1657      @Override
1658      public boolean equalsDeep(Base other_) {
1659        if (!super.equalsDeep(other_))
1660          return false;
1661        if (!(other_ instanceof IngredientSubstanceComponent))
1662          return false;
1663        IngredientSubstanceComponent o = (IngredientSubstanceComponent) other_;
1664        return compareDeep(code, o.code, true) && compareDeep(strength, o.strength, true);
1665      }
1666
1667      @Override
1668      public boolean equalsShallow(Base other_) {
1669        if (!super.equalsShallow(other_))
1670          return false;
1671        if (!(other_ instanceof IngredientSubstanceComponent))
1672          return false;
1673        IngredientSubstanceComponent o = (IngredientSubstanceComponent) other_;
1674        return true;
1675      }
1676
1677      public boolean isEmpty() {
1678        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, strength);
1679      }
1680
1681  public String fhirType() {
1682    return "Ingredient.substance";
1683
1684  }
1685
1686  }
1687
1688    /**
1689     * The identifier(s) of this Ingredient 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.
1690     */
1691    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true)
1692    @Description(shortDefinition="An identifier or code by which the ingredient can be referenced", formalDefinition="The identifier(s) of this Ingredient 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." )
1693    protected Identifier identifier;
1694
1695    /**
1696     * Ingredient role e.g. Active ingredient, excipient.
1697     */
1698    @Child(name = "role", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
1699    @Description(shortDefinition="Ingredient role e.g. Active ingredient, excipient", formalDefinition="Ingredient role e.g. Active ingredient, excipient." )
1700    protected CodeableConcept role;
1701
1702    /**
1703     * If the ingredient is a known or suspected allergen.
1704     */
1705    @Child(name = "allergenicIndicator", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1706    @Description(shortDefinition="If the ingredient is a known or suspected allergen", formalDefinition="If the ingredient is a known or suspected allergen." )
1707    protected BooleanType allergenicIndicator;
1708
1709    /**
1710     * The organization that manufactures this ingredient.
1711     */
1712    @Child(name = "manufacturer", type = {Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1713    @Description(shortDefinition="The organization that manufactures this ingredient", formalDefinition="The organization that manufactures this ingredient." )
1714    protected List<Reference> manufacturer;
1715
1716    /**
1717     * A specified substance that comprises this ingredient.
1718     */
1719    @Child(name = "specifiedSubstance", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1720    @Description(shortDefinition="A specified substance that comprises this ingredient", formalDefinition="A specified substance that comprises this ingredient." )
1721    protected List<IngredientSpecifiedSubstanceComponent> specifiedSubstance;
1722
1723    /**
1724     * The substance that comprises this ingredient.
1725     */
1726    @Child(name = "substance", type = {}, order=5, min=0, max=1, modifier=false, summary=true)
1727    @Description(shortDefinition="The substance that comprises this ingredient", formalDefinition="The substance that comprises this ingredient." )
1728    protected IngredientSubstanceComponent substance;
1729
1730    private static final long serialVersionUID = 1070468172L;
1731
1732  /**
1733   * Constructor
1734   */
1735    public Ingredient() {
1736      super();
1737    }
1738
1739  /**
1740   * Constructor
1741   */
1742    public Ingredient(CodeableConcept role) {
1743      super();
1744      this.setRole(role);
1745    }
1746
1747    /**
1748     * @return {@link #identifier} (The identifier(s) of this Ingredient 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.)
1749     */
1750    public Identifier getIdentifier() { 
1751      if (this.identifier == null)
1752        if (Configuration.errorOnAutoCreate())
1753          throw new Error("Attempt to auto-create Ingredient.identifier");
1754        else if (Configuration.doAutoCreate())
1755          this.identifier = new Identifier(); // cc
1756      return this.identifier;
1757    }
1758
1759    public boolean hasIdentifier() { 
1760      return this.identifier != null && !this.identifier.isEmpty();
1761    }
1762
1763    /**
1764     * @param value {@link #identifier} (The identifier(s) of this Ingredient 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.)
1765     */
1766    public Ingredient setIdentifier(Identifier value) { 
1767      this.identifier = value;
1768      return this;
1769    }
1770
1771    /**
1772     * @return {@link #role} (Ingredient role e.g. Active ingredient, excipient.)
1773     */
1774    public CodeableConcept getRole() { 
1775      if (this.role == null)
1776        if (Configuration.errorOnAutoCreate())
1777          throw new Error("Attempt to auto-create Ingredient.role");
1778        else if (Configuration.doAutoCreate())
1779          this.role = new CodeableConcept(); // cc
1780      return this.role;
1781    }
1782
1783    public boolean hasRole() { 
1784      return this.role != null && !this.role.isEmpty();
1785    }
1786
1787    /**
1788     * @param value {@link #role} (Ingredient role e.g. Active ingredient, excipient.)
1789     */
1790    public Ingredient setRole(CodeableConcept value) { 
1791      this.role = value;
1792      return this;
1793    }
1794
1795    /**
1796     * @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
1797     */
1798    public BooleanType getAllergenicIndicatorElement() { 
1799      if (this.allergenicIndicator == null)
1800        if (Configuration.errorOnAutoCreate())
1801          throw new Error("Attempt to auto-create Ingredient.allergenicIndicator");
1802        else if (Configuration.doAutoCreate())
1803          this.allergenicIndicator = new BooleanType(); // bb
1804      return this.allergenicIndicator;
1805    }
1806
1807    public boolean hasAllergenicIndicatorElement() { 
1808      return this.allergenicIndicator != null && !this.allergenicIndicator.isEmpty();
1809    }
1810
1811    public boolean hasAllergenicIndicator() { 
1812      return this.allergenicIndicator != null && !this.allergenicIndicator.isEmpty();
1813    }
1814
1815    /**
1816     * @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
1817     */
1818    public Ingredient setAllergenicIndicatorElement(BooleanType value) { 
1819      this.allergenicIndicator = value;
1820      return this;
1821    }
1822
1823    /**
1824     * @return If the ingredient is a known or suspected allergen.
1825     */
1826    public boolean getAllergenicIndicator() { 
1827      return this.allergenicIndicator == null || this.allergenicIndicator.isEmpty() ? false : this.allergenicIndicator.getValue();
1828    }
1829
1830    /**
1831     * @param value If the ingredient is a known or suspected allergen.
1832     */
1833    public Ingredient setAllergenicIndicator(boolean value) { 
1834        if (this.allergenicIndicator == null)
1835          this.allergenicIndicator = new BooleanType();
1836        this.allergenicIndicator.setValue(value);
1837      return this;
1838    }
1839
1840    /**
1841     * @return {@link #manufacturer} (The organization that manufactures this ingredient.)
1842     */
1843    public List<Reference> getManufacturer() { 
1844      if (this.manufacturer == null)
1845        this.manufacturer = new ArrayList<Reference>();
1846      return this.manufacturer;
1847    }
1848
1849    /**
1850     * @return Returns a reference to <code>this</code> for easy method chaining
1851     */
1852    public Ingredient setManufacturer(List<Reference> theManufacturer) { 
1853      this.manufacturer = theManufacturer;
1854      return this;
1855    }
1856
1857    public boolean hasManufacturer() { 
1858      if (this.manufacturer == null)
1859        return false;
1860      for (Reference item : this.manufacturer)
1861        if (!item.isEmpty())
1862          return true;
1863      return false;
1864    }
1865
1866    public Reference addManufacturer() { //3
1867      Reference t = new Reference();
1868      if (this.manufacturer == null)
1869        this.manufacturer = new ArrayList<Reference>();
1870      this.manufacturer.add(t);
1871      return t;
1872    }
1873
1874    public Ingredient addManufacturer(Reference t) { //3
1875      if (t == null)
1876        return this;
1877      if (this.manufacturer == null)
1878        this.manufacturer = new ArrayList<Reference>();
1879      this.manufacturer.add(t);
1880      return this;
1881    }
1882
1883    /**
1884     * @return The first repetition of repeating field {@link #manufacturer}, creating it if it does not already exist {3}
1885     */
1886    public Reference getManufacturerFirstRep() { 
1887      if (getManufacturer().isEmpty()) {
1888        addManufacturer();
1889      }
1890      return getManufacturer().get(0);
1891    }
1892
1893    /**
1894     * @return {@link #specifiedSubstance} (A specified substance that comprises this ingredient.)
1895     */
1896    public List<IngredientSpecifiedSubstanceComponent> getSpecifiedSubstance() { 
1897      if (this.specifiedSubstance == null)
1898        this.specifiedSubstance = new ArrayList<IngredientSpecifiedSubstanceComponent>();
1899      return this.specifiedSubstance;
1900    }
1901
1902    /**
1903     * @return Returns a reference to <code>this</code> for easy method chaining
1904     */
1905    public Ingredient setSpecifiedSubstance(List<IngredientSpecifiedSubstanceComponent> theSpecifiedSubstance) { 
1906      this.specifiedSubstance = theSpecifiedSubstance;
1907      return this;
1908    }
1909
1910    public boolean hasSpecifiedSubstance() { 
1911      if (this.specifiedSubstance == null)
1912        return false;
1913      for (IngredientSpecifiedSubstanceComponent item : this.specifiedSubstance)
1914        if (!item.isEmpty())
1915          return true;
1916      return false;
1917    }
1918
1919    public IngredientSpecifiedSubstanceComponent addSpecifiedSubstance() { //3
1920      IngredientSpecifiedSubstanceComponent t = new IngredientSpecifiedSubstanceComponent();
1921      if (this.specifiedSubstance == null)
1922        this.specifiedSubstance = new ArrayList<IngredientSpecifiedSubstanceComponent>();
1923      this.specifiedSubstance.add(t);
1924      return t;
1925    }
1926
1927    public Ingredient addSpecifiedSubstance(IngredientSpecifiedSubstanceComponent t) { //3
1928      if (t == null)
1929        return this;
1930      if (this.specifiedSubstance == null)
1931        this.specifiedSubstance = new ArrayList<IngredientSpecifiedSubstanceComponent>();
1932      this.specifiedSubstance.add(t);
1933      return this;
1934    }
1935
1936    /**
1937     * @return The first repetition of repeating field {@link #specifiedSubstance}, creating it if it does not already exist {3}
1938     */
1939    public IngredientSpecifiedSubstanceComponent getSpecifiedSubstanceFirstRep() { 
1940      if (getSpecifiedSubstance().isEmpty()) {
1941        addSpecifiedSubstance();
1942      }
1943      return getSpecifiedSubstance().get(0);
1944    }
1945
1946    /**
1947     * @return {@link #substance} (The substance that comprises this ingredient.)
1948     */
1949    public IngredientSubstanceComponent getSubstance() { 
1950      if (this.substance == null)
1951        if (Configuration.errorOnAutoCreate())
1952          throw new Error("Attempt to auto-create Ingredient.substance");
1953        else if (Configuration.doAutoCreate())
1954          this.substance = new IngredientSubstanceComponent(); // cc
1955      return this.substance;
1956    }
1957
1958    public boolean hasSubstance() { 
1959      return this.substance != null && !this.substance.isEmpty();
1960    }
1961
1962    /**
1963     * @param value {@link #substance} (The substance that comprises this ingredient.)
1964     */
1965    public Ingredient setSubstance(IngredientSubstanceComponent value) { 
1966      this.substance = value;
1967      return this;
1968    }
1969
1970      protected void listChildren(List<Property> children) {
1971        super.listChildren(children);
1972        children.add(new Property("identifier", "Identifier", "The identifier(s) of this Ingredient 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));
1973        children.add(new Property("role", "CodeableConcept", "Ingredient role e.g. Active ingredient, excipient.", 0, 1, role));
1974        children.add(new Property("allergenicIndicator", "boolean", "If the ingredient is a known or suspected allergen.", 0, 1, allergenicIndicator));
1975        children.add(new Property("manufacturer", "Reference(Organization)", "The organization that manufactures this ingredient.", 0, java.lang.Integer.MAX_VALUE, manufacturer));
1976        children.add(new Property("specifiedSubstance", "", "A specified substance that comprises this ingredient.", 0, java.lang.Integer.MAX_VALUE, specifiedSubstance));
1977        children.add(new Property("substance", "", "The substance that comprises this ingredient.", 0, 1, substance));
1978      }
1979
1980      @Override
1981      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1982        switch (_hash) {
1983        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "The identifier(s) of this Ingredient 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);
1984        case 3506294: /*role*/  return new Property("role", "CodeableConcept", "Ingredient role e.g. Active ingredient, excipient.", 0, 1, role);
1985        case 75406931: /*allergenicIndicator*/  return new Property("allergenicIndicator", "boolean", "If the ingredient is a known or suspected allergen.", 0, 1, allergenicIndicator);
1986        case -1969347631: /*manufacturer*/  return new Property("manufacturer", "Reference(Organization)", "The organization that manufactures this ingredient.", 0, java.lang.Integer.MAX_VALUE, manufacturer);
1987        case -331477600: /*specifiedSubstance*/  return new Property("specifiedSubstance", "", "A specified substance that comprises this ingredient.", 0, java.lang.Integer.MAX_VALUE, specifiedSubstance);
1988        case 530040176: /*substance*/  return new Property("substance", "", "The substance that comprises this ingredient.", 0, 1, substance);
1989        default: return super.getNamedProperty(_hash, _name, _checkValid);
1990        }
1991
1992      }
1993
1994      @Override
1995      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1996        switch (hash) {
1997        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
1998        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
1999        case 75406931: /*allergenicIndicator*/ return this.allergenicIndicator == null ? new Base[0] : new Base[] {this.allergenicIndicator}; // BooleanType
2000        case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : this.manufacturer.toArray(new Base[this.manufacturer.size()]); // Reference
2001        case -331477600: /*specifiedSubstance*/ return this.specifiedSubstance == null ? new Base[0] : this.specifiedSubstance.toArray(new Base[this.specifiedSubstance.size()]); // IngredientSpecifiedSubstanceComponent
2002        case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // IngredientSubstanceComponent
2003        default: return super.getProperty(hash, name, checkValid);
2004        }
2005
2006      }
2007
2008      @Override
2009      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2010        switch (hash) {
2011        case -1618432855: // identifier
2012          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
2013          return value;
2014        case 3506294: // role
2015          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2016          return value;
2017        case 75406931: // allergenicIndicator
2018          this.allergenicIndicator = TypeConvertor.castToBoolean(value); // BooleanType
2019          return value;
2020        case -1969347631: // manufacturer
2021          this.getManufacturer().add(TypeConvertor.castToReference(value)); // Reference
2022          return value;
2023        case -331477600: // specifiedSubstance
2024          this.getSpecifiedSubstance().add((IngredientSpecifiedSubstanceComponent) value); // IngredientSpecifiedSubstanceComponent
2025          return value;
2026        case 530040176: // substance
2027          this.substance = (IngredientSubstanceComponent) value; // IngredientSubstanceComponent
2028          return value;
2029        default: return super.setProperty(hash, name, value);
2030        }
2031
2032      }
2033
2034      @Override
2035      public Base setProperty(String name, Base value) throws FHIRException {
2036        if (name.equals("identifier")) {
2037          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
2038        } else if (name.equals("role")) {
2039          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2040        } else if (name.equals("allergenicIndicator")) {
2041          this.allergenicIndicator = TypeConvertor.castToBoolean(value); // BooleanType
2042        } else if (name.equals("manufacturer")) {
2043          this.getManufacturer().add(TypeConvertor.castToReference(value));
2044        } else if (name.equals("specifiedSubstance")) {
2045          this.getSpecifiedSubstance().add((IngredientSpecifiedSubstanceComponent) value);
2046        } else if (name.equals("substance")) {
2047          this.substance = (IngredientSubstanceComponent) value; // IngredientSubstanceComponent
2048        } else
2049          return super.setProperty(name, value);
2050        return value;
2051      }
2052
2053      @Override
2054      public Base makeProperty(int hash, String name) throws FHIRException {
2055        switch (hash) {
2056        case -1618432855:  return getIdentifier();
2057        case 3506294:  return getRole();
2058        case 75406931:  return getAllergenicIndicatorElement();
2059        case -1969347631:  return addManufacturer(); 
2060        case -331477600:  return addSpecifiedSubstance(); 
2061        case 530040176:  return getSubstance();
2062        default: return super.makeProperty(hash, name);
2063        }
2064
2065      }
2066
2067      @Override
2068      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2069        switch (hash) {
2070        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2071        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
2072        case 75406931: /*allergenicIndicator*/ return new String[] {"boolean"};
2073        case -1969347631: /*manufacturer*/ return new String[] {"Reference"};
2074        case -331477600: /*specifiedSubstance*/ return new String[] {};
2075        case 530040176: /*substance*/ return new String[] {};
2076        default: return super.getTypesForProperty(hash, name);
2077        }
2078
2079      }
2080
2081      @Override
2082      public Base addChild(String name) throws FHIRException {
2083        if (name.equals("identifier")) {
2084          this.identifier = new Identifier();
2085          return this.identifier;
2086        }
2087        else if (name.equals("role")) {
2088          this.role = new CodeableConcept();
2089          return this.role;
2090        }
2091        else if (name.equals("allergenicIndicator")) {
2092          throw new FHIRException("Cannot call addChild on a primitive type Ingredient.allergenicIndicator");
2093        }
2094        else if (name.equals("manufacturer")) {
2095          return addManufacturer();
2096        }
2097        else if (name.equals("specifiedSubstance")) {
2098          return addSpecifiedSubstance();
2099        }
2100        else if (name.equals("substance")) {
2101          this.substance = new IngredientSubstanceComponent();
2102          return this.substance;
2103        }
2104        else
2105          return super.addChild(name);
2106      }
2107
2108  public String fhirType() {
2109    return "Ingredient";
2110
2111  }
2112
2113      public Ingredient copy() {
2114        Ingredient dst = new Ingredient();
2115        copyValues(dst);
2116        return dst;
2117      }
2118
2119      public void copyValues(Ingredient dst) {
2120        super.copyValues(dst);
2121        dst.identifier = identifier == null ? null : identifier.copy();
2122        dst.role = role == null ? null : role.copy();
2123        dst.allergenicIndicator = allergenicIndicator == null ? null : allergenicIndicator.copy();
2124        if (manufacturer != null) {
2125          dst.manufacturer = new ArrayList<Reference>();
2126          for (Reference i : manufacturer)
2127            dst.manufacturer.add(i.copy());
2128        };
2129        if (specifiedSubstance != null) {
2130          dst.specifiedSubstance = new ArrayList<IngredientSpecifiedSubstanceComponent>();
2131          for (IngredientSpecifiedSubstanceComponent i : specifiedSubstance)
2132            dst.specifiedSubstance.add(i.copy());
2133        };
2134        dst.substance = substance == null ? null : substance.copy();
2135      }
2136
2137      protected Ingredient typedCopy() {
2138        return copy();
2139      }
2140
2141      @Override
2142      public boolean equalsDeep(Base other_) {
2143        if (!super.equalsDeep(other_))
2144          return false;
2145        if (!(other_ instanceof Ingredient))
2146          return false;
2147        Ingredient o = (Ingredient) other_;
2148        return compareDeep(identifier, o.identifier, true) && compareDeep(role, o.role, true) && compareDeep(allergenicIndicator, o.allergenicIndicator, true)
2149           && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(specifiedSubstance, o.specifiedSubstance, true)
2150           && compareDeep(substance, o.substance, true);
2151      }
2152
2153      @Override
2154      public boolean equalsShallow(Base other_) {
2155        if (!super.equalsShallow(other_))
2156          return false;
2157        if (!(other_ instanceof Ingredient))
2158          return false;
2159        Ingredient o = (Ingredient) other_;
2160        return compareValues(allergenicIndicator, o.allergenicIndicator, true);
2161      }
2162
2163      public boolean isEmpty() {
2164        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, role, allergenicIndicator
2165          , manufacturer, specifiedSubstance, substance);
2166      }
2167
2168  @Override
2169  public ResourceType getResourceType() {
2170    return ResourceType.Ingredient;
2171   }
2172
2173 /**
2174   * Search parameter: <b>identifier</b>
2175   * <p>
2176   * Description: <b>An identifier or code by which the ingredient can be referenced</b><br>
2177   * Type: <b>token</b><br>
2178   * Path: <b>Ingredient.identifier</b><br>
2179   * </p>
2180   */
2181  @SearchParamDefinition(name="identifier", path="Ingredient.identifier", description="An identifier or code by which the ingredient can be referenced", type="token" )
2182  public static final String SP_IDENTIFIER = "identifier";
2183 /**
2184   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2185   * <p>
2186   * Description: <b>An identifier or code by which the ingredient can be referenced</b><br>
2187   * Type: <b>token</b><br>
2188   * Path: <b>Ingredient.identifier</b><br>
2189   * </p>
2190   */
2191  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2192
2193 /**
2194   * Search parameter: <b>specified-substance</b>
2195   * <p>
2196   * Description: <b>Substance as a 'specified substance', implying extra substance related characteristics</b><br>
2197   * Type: <b>token</b><br>
2198   * Path: <b>(Ingredient.specifiedSubstance.code as CodeableConcept)</b><br>
2199   * </p>
2200   */
2201  @SearchParamDefinition(name="specified-substance", path="(Ingredient.specifiedSubstance.code as CodeableConcept)", description="Substance as a 'specified substance', implying extra substance related characteristics", type="token" )
2202  public static final String SP_SPECIFIED_SUBSTANCE = "specified-substance";
2203 /**
2204   * <b>Fluent Client</b> search parameter constant for <b>specified-substance</b>
2205   * <p>
2206   * Description: <b>Substance as a 'specified substance', implying extra substance related characteristics</b><br>
2207   * Type: <b>token</b><br>
2208   * Path: <b>(Ingredient.specifiedSubstance.code as CodeableConcept)</b><br>
2209   * </p>
2210   */
2211  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIFIED_SUBSTANCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIFIED_SUBSTANCE);
2212
2213 /**
2214   * Search parameter: <b>substance</b>
2215   * <p>
2216   * Description: <b>A code that represents the ingredient substance</b><br>
2217   * Type: <b>token</b><br>
2218   * Path: <b>(Ingredient.substance.code as CodeableConcept)</b><br>
2219   * </p>
2220   */
2221  @SearchParamDefinition(name="substance", path="(Ingredient.substance.code as CodeableConcept)", description="A code that represents the ingredient substance", type="token" )
2222  public static final String SP_SUBSTANCE = "substance";
2223 /**
2224   * <b>Fluent Client</b> search parameter constant for <b>substance</b>
2225   * <p>
2226   * Description: <b>A code that represents the ingredient substance</b><br>
2227   * Type: <b>token</b><br>
2228   * Path: <b>(Ingredient.substance.code as CodeableConcept)</b><br>
2229   * </p>
2230   */
2231  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBSTANCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBSTANCE);
2232
2233
2234}
2235