001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * A homogeneous material with a definite composition.
052 */
053@ResourceDef(name="Substance", profile="http://hl7.org/fhir/StructureDefinition/Substance")
054public class Substance extends DomainResource {
055
056    public enum FHIRSubstanceStatus {
057        /**
058         * The substance is considered for use or reference.
059         */
060        ACTIVE, 
061        /**
062         * The substance is considered for reference, but not for use.
063         */
064        INACTIVE, 
065        /**
066         * The substance was entered in error.
067         */
068        ENTEREDINERROR, 
069        /**
070         * added to help the parsers with the generic types
071         */
072        NULL;
073        public static FHIRSubstanceStatus fromCode(String codeString) throws FHIRException {
074            if (codeString == null || "".equals(codeString))
075                return null;
076        if ("active".equals(codeString))
077          return ACTIVE;
078        if ("inactive".equals(codeString))
079          return INACTIVE;
080        if ("entered-in-error".equals(codeString))
081          return ENTEREDINERROR;
082        if (Configuration.isAcceptInvalidEnums())
083          return null;
084        else
085          throw new FHIRException("Unknown FHIRSubstanceStatus code '"+codeString+"'");
086        }
087        public String toCode() {
088          switch (this) {
089            case ACTIVE: return "active";
090            case INACTIVE: return "inactive";
091            case ENTEREDINERROR: return "entered-in-error";
092            default: return "?";
093          }
094        }
095        public String getSystem() {
096          switch (this) {
097            case ACTIVE: return "http://hl7.org/fhir/substance-status";
098            case INACTIVE: return "http://hl7.org/fhir/substance-status";
099            case ENTEREDINERROR: return "http://hl7.org/fhir/substance-status";
100            default: return "?";
101          }
102        }
103        public String getDefinition() {
104          switch (this) {
105            case ACTIVE: return "The substance is considered for use or reference.";
106            case INACTIVE: return "The substance is considered for reference, but not for use.";
107            case ENTEREDINERROR: return "The substance was entered in error.";
108            default: return "?";
109          }
110        }
111        public String getDisplay() {
112          switch (this) {
113            case ACTIVE: return "Active";
114            case INACTIVE: return "Inactive";
115            case ENTEREDINERROR: return "Entered in Error";
116            default: return "?";
117          }
118        }
119    }
120
121  public static class FHIRSubstanceStatusEnumFactory implements EnumFactory<FHIRSubstanceStatus> {
122    public FHIRSubstanceStatus fromCode(String codeString) throws IllegalArgumentException {
123      if (codeString == null || "".equals(codeString))
124            if (codeString == null || "".equals(codeString))
125                return null;
126        if ("active".equals(codeString))
127          return FHIRSubstanceStatus.ACTIVE;
128        if ("inactive".equals(codeString))
129          return FHIRSubstanceStatus.INACTIVE;
130        if ("entered-in-error".equals(codeString))
131          return FHIRSubstanceStatus.ENTEREDINERROR;
132        throw new IllegalArgumentException("Unknown FHIRSubstanceStatus code '"+codeString+"'");
133        }
134        public Enumeration<FHIRSubstanceStatus> fromType(Base code) throws FHIRException {
135          if (code == null)
136            return null;
137          if (code.isEmpty())
138            return new Enumeration<FHIRSubstanceStatus>(this);
139          String codeString = ((PrimitiveType) code).asStringValue();
140          if (codeString == null || "".equals(codeString))
141            return null;
142        if ("active".equals(codeString))
143          return new Enumeration<FHIRSubstanceStatus>(this, FHIRSubstanceStatus.ACTIVE);
144        if ("inactive".equals(codeString))
145          return new Enumeration<FHIRSubstanceStatus>(this, FHIRSubstanceStatus.INACTIVE);
146        if ("entered-in-error".equals(codeString))
147          return new Enumeration<FHIRSubstanceStatus>(this, FHIRSubstanceStatus.ENTEREDINERROR);
148        throw new FHIRException("Unknown FHIRSubstanceStatus code '"+codeString+"'");
149        }
150    public String toCode(FHIRSubstanceStatus code) {
151      if (code == FHIRSubstanceStatus.ACTIVE)
152        return "active";
153      if (code == FHIRSubstanceStatus.INACTIVE)
154        return "inactive";
155      if (code == FHIRSubstanceStatus.ENTEREDINERROR)
156        return "entered-in-error";
157      return "?";
158      }
159    public String toSystem(FHIRSubstanceStatus code) {
160      return code.getSystem();
161      }
162    }
163
164    @Block()
165    public static class SubstanceIngredientComponent extends BackboneElement implements IBaseBackboneElement {
166        /**
167         * The amount of the ingredient in the substance - a concentration ratio.
168         */
169        @Child(name = "quantity", type = {Ratio.class}, order=1, min=0, max=1, modifier=false, summary=true)
170        @Description(shortDefinition="Optional amount (concentration)", formalDefinition="The amount of the ingredient in the substance - a concentration ratio." )
171        protected Ratio quantity;
172
173        /**
174         * Another substance that is a component of this substance.
175         */
176        @Child(name = "substance", type = {CodeableConcept.class, Substance.class}, order=2, min=1, max=1, modifier=false, summary=true)
177        @Description(shortDefinition="A component of the substance", formalDefinition="Another substance that is a component of this substance." )
178        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-code")
179        protected DataType substance;
180
181        private static final long serialVersionUID = 2068995180L;
182
183    /**
184     * Constructor
185     */
186      public SubstanceIngredientComponent() {
187        super();
188      }
189
190    /**
191     * Constructor
192     */
193      public SubstanceIngredientComponent(DataType substance) {
194        super();
195        this.setSubstance(substance);
196      }
197
198        /**
199         * @return {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.)
200         */
201        public Ratio getQuantity() { 
202          if (this.quantity == null)
203            if (Configuration.errorOnAutoCreate())
204              throw new Error("Attempt to auto-create SubstanceIngredientComponent.quantity");
205            else if (Configuration.doAutoCreate())
206              this.quantity = new Ratio(); // cc
207          return this.quantity;
208        }
209
210        public boolean hasQuantity() { 
211          return this.quantity != null && !this.quantity.isEmpty();
212        }
213
214        /**
215         * @param value {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.)
216         */
217        public SubstanceIngredientComponent setQuantity(Ratio value) { 
218          this.quantity = value;
219          return this;
220        }
221
222        /**
223         * @return {@link #substance} (Another substance that is a component of this substance.)
224         */
225        public DataType getSubstance() { 
226          return this.substance;
227        }
228
229        /**
230         * @return {@link #substance} (Another substance that is a component of this substance.)
231         */
232        public CodeableConcept getSubstanceCodeableConcept() throws FHIRException { 
233          if (this.substance == null)
234            this.substance = new CodeableConcept();
235          if (!(this.substance instanceof CodeableConcept))
236            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.substance.getClass().getName()+" was encountered");
237          return (CodeableConcept) this.substance;
238        }
239
240        public boolean hasSubstanceCodeableConcept() { 
241          return this != null && this.substance instanceof CodeableConcept;
242        }
243
244        /**
245         * @return {@link #substance} (Another substance that is a component of this substance.)
246         */
247        public Reference getSubstanceReference() throws FHIRException { 
248          if (this.substance == null)
249            this.substance = new Reference();
250          if (!(this.substance instanceof Reference))
251            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.substance.getClass().getName()+" was encountered");
252          return (Reference) this.substance;
253        }
254
255        public boolean hasSubstanceReference() { 
256          return this != null && this.substance instanceof Reference;
257        }
258
259        public boolean hasSubstance() { 
260          return this.substance != null && !this.substance.isEmpty();
261        }
262
263        /**
264         * @param value {@link #substance} (Another substance that is a component of this substance.)
265         */
266        public SubstanceIngredientComponent setSubstance(DataType value) { 
267          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
268            throw new Error("Not the right type for Substance.ingredient.substance[x]: "+value.fhirType());
269          this.substance = value;
270          return this;
271        }
272
273        protected void listChildren(List<Property> children) {
274          super.listChildren(children);
275          children.add(new Property("quantity", "Ratio", "The amount of the ingredient in the substance - a concentration ratio.", 0, 1, quantity));
276          children.add(new Property("substance[x]", "CodeableConcept|Reference(Substance)", "Another substance that is a component of this substance.", 0, 1, substance));
277        }
278
279        @Override
280        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
281          switch (_hash) {
282          case -1285004149: /*quantity*/  return new Property("quantity", "Ratio", "The amount of the ingredient in the substance - a concentration ratio.", 0, 1, quantity);
283          case 2127194384: /*substance[x]*/  return new Property("substance[x]", "CodeableConcept|Reference(Substance)", "Another substance that is a component of this substance.", 0, 1, substance);
284          case 530040176: /*substance*/  return new Property("substance[x]", "CodeableConcept|Reference(Substance)", "Another substance that is a component of this substance.", 0, 1, substance);
285          case -1974119407: /*substanceCodeableConcept*/  return new Property("substance[x]", "CodeableConcept", "Another substance that is a component of this substance.", 0, 1, substance);
286          case 516208571: /*substanceReference*/  return new Property("substance[x]", "Reference(Substance)", "Another substance that is a component of this substance.", 0, 1, substance);
287          default: return super.getNamedProperty(_hash, _name, _checkValid);
288          }
289
290        }
291
292      @Override
293      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
294        switch (hash) {
295        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Ratio
296        case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // DataType
297        default: return super.getProperty(hash, name, checkValid);
298        }
299
300      }
301
302      @Override
303      public Base setProperty(int hash, String name, Base value) throws FHIRException {
304        switch (hash) {
305        case -1285004149: // quantity
306          this.quantity = TypeConvertor.castToRatio(value); // Ratio
307          return value;
308        case 530040176: // substance
309          this.substance = TypeConvertor.castToType(value); // DataType
310          return value;
311        default: return super.setProperty(hash, name, value);
312        }
313
314      }
315
316      @Override
317      public Base setProperty(String name, Base value) throws FHIRException {
318        if (name.equals("quantity")) {
319          this.quantity = TypeConvertor.castToRatio(value); // Ratio
320        } else if (name.equals("substance[x]")) {
321          this.substance = TypeConvertor.castToType(value); // DataType
322        } else
323          return super.setProperty(name, value);
324        return value;
325      }
326
327      @Override
328      public Base makeProperty(int hash, String name) throws FHIRException {
329        switch (hash) {
330        case -1285004149:  return getQuantity();
331        case 2127194384:  return getSubstance();
332        case 530040176:  return getSubstance();
333        default: return super.makeProperty(hash, name);
334        }
335
336      }
337
338      @Override
339      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
340        switch (hash) {
341        case -1285004149: /*quantity*/ return new String[] {"Ratio"};
342        case 530040176: /*substance*/ return new String[] {"CodeableConcept", "Reference"};
343        default: return super.getTypesForProperty(hash, name);
344        }
345
346      }
347
348      @Override
349      public Base addChild(String name) throws FHIRException {
350        if (name.equals("quantity")) {
351          this.quantity = new Ratio();
352          return this.quantity;
353        }
354        else if (name.equals("substanceCodeableConcept")) {
355          this.substance = new CodeableConcept();
356          return this.substance;
357        }
358        else if (name.equals("substanceReference")) {
359          this.substance = new Reference();
360          return this.substance;
361        }
362        else
363          return super.addChild(name);
364      }
365
366      public SubstanceIngredientComponent copy() {
367        SubstanceIngredientComponent dst = new SubstanceIngredientComponent();
368        copyValues(dst);
369        return dst;
370      }
371
372      public void copyValues(SubstanceIngredientComponent dst) {
373        super.copyValues(dst);
374        dst.quantity = quantity == null ? null : quantity.copy();
375        dst.substance = substance == null ? null : substance.copy();
376      }
377
378      @Override
379      public boolean equalsDeep(Base other_) {
380        if (!super.equalsDeep(other_))
381          return false;
382        if (!(other_ instanceof SubstanceIngredientComponent))
383          return false;
384        SubstanceIngredientComponent o = (SubstanceIngredientComponent) other_;
385        return compareDeep(quantity, o.quantity, true) && compareDeep(substance, o.substance, true);
386      }
387
388      @Override
389      public boolean equalsShallow(Base other_) {
390        if (!super.equalsShallow(other_))
391          return false;
392        if (!(other_ instanceof SubstanceIngredientComponent))
393          return false;
394        SubstanceIngredientComponent o = (SubstanceIngredientComponent) other_;
395        return true;
396      }
397
398      public boolean isEmpty() {
399        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(quantity, substance);
400      }
401
402  public String fhirType() {
403    return "Substance.ingredient";
404
405  }
406
407  }
408
409    /**
410     * Unique identifier for the substance. For an instance, an identifier associated with the package/container (usually a label affixed directly).
411     */
412    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
413    @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier for the substance. For an instance, an identifier associated with the package/container (usually a label affixed directly)." )
414    protected List<Identifier> identifier;
415
416    /**
417     * A boolean to indicate if this an instance of a substance or a kind of one (a definition).
418     */
419    @Child(name = "instance", type = {BooleanType.class}, order=1, min=1, max=1, modifier=true, summary=true)
420    @Description(shortDefinition="Is this an instance of a substance or a kind of one", formalDefinition="A boolean to indicate if this an instance of a substance or a kind of one (a definition)." )
421    protected BooleanType instance;
422
423    /**
424     * A code to indicate if the substance is actively used.
425     */
426    @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true)
427    @Description(shortDefinition="active | inactive | entered-in-error", formalDefinition="A code to indicate if the substance is actively used." )
428    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-status")
429    protected Enumeration<FHIRSubstanceStatus> status;
430
431    /**
432     * A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.
433     */
434    @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
435    @Description(shortDefinition="What class/type of substance this is", formalDefinition="A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes." )
436    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-category")
437    protected List<CodeableConcept> category;
438
439    /**
440     * A code (or set of codes) that identify this substance.
441     */
442    @Child(name = "code", type = {CodeableReference.class}, order=4, min=1, max=1, modifier=false, summary=true)
443    @Description(shortDefinition="What substance this is", formalDefinition="A code (or set of codes) that identify this substance." )
444    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-code")
445    protected CodeableReference code;
446
447    /**
448     * A description of the substance - its appearance, handling requirements, and other usage notes.
449     */
450    @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
451    @Description(shortDefinition="Textual description of the substance, comments", formalDefinition="A description of the substance - its appearance, handling requirements, and other usage notes." )
452    protected StringType description;
453
454    /**
455     * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.
456     */
457    @Child(name = "expiry", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true)
458    @Description(shortDefinition="When no longer valid to use", formalDefinition="When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry." )
459    protected DateTimeType expiry;
460
461    /**
462     * The amount of the substance.
463     */
464    @Child(name = "quantity", type = {Quantity.class}, order=7, min=0, max=1, modifier=false, summary=true)
465    @Description(shortDefinition="Amount of substance in the package", formalDefinition="The amount of the substance." )
466    protected Quantity quantity;
467
468    /**
469     * A substance can be composed of other substances.
470     */
471    @Child(name = "ingredient", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
472    @Description(shortDefinition="Composition information about the substance", formalDefinition="A substance can be composed of other substances." )
473    protected List<SubstanceIngredientComponent> ingredient;
474
475    private static final long serialVersionUID = -15918775L;
476
477  /**
478   * Constructor
479   */
480    public Substance() {
481      super();
482    }
483
484  /**
485   * Constructor
486   */
487    public Substance(boolean instance, CodeableReference code) {
488      super();
489      this.setInstance(instance);
490      this.setCode(code);
491    }
492
493    /**
494     * @return {@link #identifier} (Unique identifier for the substance. For an instance, an identifier associated with the package/container (usually a label affixed directly).)
495     */
496    public List<Identifier> getIdentifier() { 
497      if (this.identifier == null)
498        this.identifier = new ArrayList<Identifier>();
499      return this.identifier;
500    }
501
502    /**
503     * @return Returns a reference to <code>this</code> for easy method chaining
504     */
505    public Substance setIdentifier(List<Identifier> theIdentifier) { 
506      this.identifier = theIdentifier;
507      return this;
508    }
509
510    public boolean hasIdentifier() { 
511      if (this.identifier == null)
512        return false;
513      for (Identifier item : this.identifier)
514        if (!item.isEmpty())
515          return true;
516      return false;
517    }
518
519    public Identifier addIdentifier() { //3
520      Identifier t = new Identifier();
521      if (this.identifier == null)
522        this.identifier = new ArrayList<Identifier>();
523      this.identifier.add(t);
524      return t;
525    }
526
527    public Substance addIdentifier(Identifier t) { //3
528      if (t == null)
529        return this;
530      if (this.identifier == null)
531        this.identifier = new ArrayList<Identifier>();
532      this.identifier.add(t);
533      return this;
534    }
535
536    /**
537     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
538     */
539    public Identifier getIdentifierFirstRep() { 
540      if (getIdentifier().isEmpty()) {
541        addIdentifier();
542      }
543      return getIdentifier().get(0);
544    }
545
546    /**
547     * @return {@link #instance} (A boolean to indicate if this an instance of a substance or a kind of one (a definition).). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value
548     */
549    public BooleanType getInstanceElement() { 
550      if (this.instance == null)
551        if (Configuration.errorOnAutoCreate())
552          throw new Error("Attempt to auto-create Substance.instance");
553        else if (Configuration.doAutoCreate())
554          this.instance = new BooleanType(); // bb
555      return this.instance;
556    }
557
558    public boolean hasInstanceElement() { 
559      return this.instance != null && !this.instance.isEmpty();
560    }
561
562    public boolean hasInstance() { 
563      return this.instance != null && !this.instance.isEmpty();
564    }
565
566    /**
567     * @param value {@link #instance} (A boolean to indicate if this an instance of a substance or a kind of one (a definition).). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value
568     */
569    public Substance setInstanceElement(BooleanType value) { 
570      this.instance = value;
571      return this;
572    }
573
574    /**
575     * @return A boolean to indicate if this an instance of a substance or a kind of one (a definition).
576     */
577    public boolean getInstance() { 
578      return this.instance == null || this.instance.isEmpty() ? false : this.instance.getValue();
579    }
580
581    /**
582     * @param value A boolean to indicate if this an instance of a substance or a kind of one (a definition).
583     */
584    public Substance setInstance(boolean value) { 
585        if (this.instance == null)
586          this.instance = new BooleanType();
587        this.instance.setValue(value);
588      return this;
589    }
590
591    /**
592     * @return {@link #status} (A code to indicate if the substance is actively used.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
593     */
594    public Enumeration<FHIRSubstanceStatus> getStatusElement() { 
595      if (this.status == null)
596        if (Configuration.errorOnAutoCreate())
597          throw new Error("Attempt to auto-create Substance.status");
598        else if (Configuration.doAutoCreate())
599          this.status = new Enumeration<FHIRSubstanceStatus>(new FHIRSubstanceStatusEnumFactory()); // bb
600      return this.status;
601    }
602
603    public boolean hasStatusElement() { 
604      return this.status != null && !this.status.isEmpty();
605    }
606
607    public boolean hasStatus() { 
608      return this.status != null && !this.status.isEmpty();
609    }
610
611    /**
612     * @param value {@link #status} (A code to indicate if the substance is actively used.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
613     */
614    public Substance setStatusElement(Enumeration<FHIRSubstanceStatus> value) { 
615      this.status = value;
616      return this;
617    }
618
619    /**
620     * @return A code to indicate if the substance is actively used.
621     */
622    public FHIRSubstanceStatus getStatus() { 
623      return this.status == null ? null : this.status.getValue();
624    }
625
626    /**
627     * @param value A code to indicate if the substance is actively used.
628     */
629    public Substance setStatus(FHIRSubstanceStatus value) { 
630      if (value == null)
631        this.status = null;
632      else {
633        if (this.status == null)
634          this.status = new Enumeration<FHIRSubstanceStatus>(new FHIRSubstanceStatusEnumFactory());
635        this.status.setValue(value);
636      }
637      return this;
638    }
639
640    /**
641     * @return {@link #category} (A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.)
642     */
643    public List<CodeableConcept> getCategory() { 
644      if (this.category == null)
645        this.category = new ArrayList<CodeableConcept>();
646      return this.category;
647    }
648
649    /**
650     * @return Returns a reference to <code>this</code> for easy method chaining
651     */
652    public Substance setCategory(List<CodeableConcept> theCategory) { 
653      this.category = theCategory;
654      return this;
655    }
656
657    public boolean hasCategory() { 
658      if (this.category == null)
659        return false;
660      for (CodeableConcept item : this.category)
661        if (!item.isEmpty())
662          return true;
663      return false;
664    }
665
666    public CodeableConcept addCategory() { //3
667      CodeableConcept t = new CodeableConcept();
668      if (this.category == null)
669        this.category = new ArrayList<CodeableConcept>();
670      this.category.add(t);
671      return t;
672    }
673
674    public Substance addCategory(CodeableConcept t) { //3
675      if (t == null)
676        return this;
677      if (this.category == null)
678        this.category = new ArrayList<CodeableConcept>();
679      this.category.add(t);
680      return this;
681    }
682
683    /**
684     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
685     */
686    public CodeableConcept getCategoryFirstRep() { 
687      if (getCategory().isEmpty()) {
688        addCategory();
689      }
690      return getCategory().get(0);
691    }
692
693    /**
694     * @return {@link #code} (A code (or set of codes) that identify this substance.)
695     */
696    public CodeableReference getCode() { 
697      if (this.code == null)
698        if (Configuration.errorOnAutoCreate())
699          throw new Error("Attempt to auto-create Substance.code");
700        else if (Configuration.doAutoCreate())
701          this.code = new CodeableReference(); // cc
702      return this.code;
703    }
704
705    public boolean hasCode() { 
706      return this.code != null && !this.code.isEmpty();
707    }
708
709    /**
710     * @param value {@link #code} (A code (or set of codes) that identify this substance.)
711     */
712    public Substance setCode(CodeableReference value) { 
713      this.code = value;
714      return this;
715    }
716
717    /**
718     * @return {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
719     */
720    public StringType getDescriptionElement() { 
721      if (this.description == null)
722        if (Configuration.errorOnAutoCreate())
723          throw new Error("Attempt to auto-create Substance.description");
724        else if (Configuration.doAutoCreate())
725          this.description = new StringType(); // bb
726      return this.description;
727    }
728
729    public boolean hasDescriptionElement() { 
730      return this.description != null && !this.description.isEmpty();
731    }
732
733    public boolean hasDescription() { 
734      return this.description != null && !this.description.isEmpty();
735    }
736
737    /**
738     * @param value {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
739     */
740    public Substance setDescriptionElement(StringType value) { 
741      this.description = value;
742      return this;
743    }
744
745    /**
746     * @return A description of the substance - its appearance, handling requirements, and other usage notes.
747     */
748    public String getDescription() { 
749      return this.description == null ? null : this.description.getValue();
750    }
751
752    /**
753     * @param value A description of the substance - its appearance, handling requirements, and other usage notes.
754     */
755    public Substance setDescription(String value) { 
756      if (Utilities.noString(value))
757        this.description = null;
758      else {
759        if (this.description == null)
760          this.description = new StringType();
761        this.description.setValue(value);
762      }
763      return this;
764    }
765
766    /**
767     * @return {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value
768     */
769    public DateTimeType getExpiryElement() { 
770      if (this.expiry == null)
771        if (Configuration.errorOnAutoCreate())
772          throw new Error("Attempt to auto-create Substance.expiry");
773        else if (Configuration.doAutoCreate())
774          this.expiry = new DateTimeType(); // bb
775      return this.expiry;
776    }
777
778    public boolean hasExpiryElement() { 
779      return this.expiry != null && !this.expiry.isEmpty();
780    }
781
782    public boolean hasExpiry() { 
783      return this.expiry != null && !this.expiry.isEmpty();
784    }
785
786    /**
787     * @param value {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value
788     */
789    public Substance setExpiryElement(DateTimeType value) { 
790      this.expiry = value;
791      return this;
792    }
793
794    /**
795     * @return When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.
796     */
797    public Date getExpiry() { 
798      return this.expiry == null ? null : this.expiry.getValue();
799    }
800
801    /**
802     * @param value When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.
803     */
804    public Substance setExpiry(Date value) { 
805      if (value == null)
806        this.expiry = null;
807      else {
808        if (this.expiry == null)
809          this.expiry = new DateTimeType();
810        this.expiry.setValue(value);
811      }
812      return this;
813    }
814
815    /**
816     * @return {@link #quantity} (The amount of the substance.)
817     */
818    public Quantity getQuantity() { 
819      if (this.quantity == null)
820        if (Configuration.errorOnAutoCreate())
821          throw new Error("Attempt to auto-create Substance.quantity");
822        else if (Configuration.doAutoCreate())
823          this.quantity = new Quantity(); // cc
824      return this.quantity;
825    }
826
827    public boolean hasQuantity() { 
828      return this.quantity != null && !this.quantity.isEmpty();
829    }
830
831    /**
832     * @param value {@link #quantity} (The amount of the substance.)
833     */
834    public Substance setQuantity(Quantity value) { 
835      this.quantity = value;
836      return this;
837    }
838
839    /**
840     * @return {@link #ingredient} (A substance can be composed of other substances.)
841     */
842    public List<SubstanceIngredientComponent> getIngredient() { 
843      if (this.ingredient == null)
844        this.ingredient = new ArrayList<SubstanceIngredientComponent>();
845      return this.ingredient;
846    }
847
848    /**
849     * @return Returns a reference to <code>this</code> for easy method chaining
850     */
851    public Substance setIngredient(List<SubstanceIngredientComponent> theIngredient) { 
852      this.ingredient = theIngredient;
853      return this;
854    }
855
856    public boolean hasIngredient() { 
857      if (this.ingredient == null)
858        return false;
859      for (SubstanceIngredientComponent item : this.ingredient)
860        if (!item.isEmpty())
861          return true;
862      return false;
863    }
864
865    public SubstanceIngredientComponent addIngredient() { //3
866      SubstanceIngredientComponent t = new SubstanceIngredientComponent();
867      if (this.ingredient == null)
868        this.ingredient = new ArrayList<SubstanceIngredientComponent>();
869      this.ingredient.add(t);
870      return t;
871    }
872
873    public Substance addIngredient(SubstanceIngredientComponent t) { //3
874      if (t == null)
875        return this;
876      if (this.ingredient == null)
877        this.ingredient = new ArrayList<SubstanceIngredientComponent>();
878      this.ingredient.add(t);
879      return this;
880    }
881
882    /**
883     * @return The first repetition of repeating field {@link #ingredient}, creating it if it does not already exist {3}
884     */
885    public SubstanceIngredientComponent getIngredientFirstRep() { 
886      if (getIngredient().isEmpty()) {
887        addIngredient();
888      }
889      return getIngredient().get(0);
890    }
891
892      protected void listChildren(List<Property> children) {
893        super.listChildren(children);
894        children.add(new Property("identifier", "Identifier", "Unique identifier for the substance. For an instance, an identifier associated with the package/container (usually a label affixed directly).", 0, java.lang.Integer.MAX_VALUE, identifier));
895        children.add(new Property("instance", "boolean", "A boolean to indicate if this an instance of a substance or a kind of one (a definition).", 0, 1, instance));
896        children.add(new Property("status", "code", "A code to indicate if the substance is actively used.", 0, 1, status));
897        children.add(new Property("category", "CodeableConcept", "A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category));
898        children.add(new Property("code", "CodeableReference(SubstanceDefinition)", "A code (or set of codes) that identify this substance.", 0, 1, code));
899        children.add(new Property("description", "string", "A description of the substance - its appearance, handling requirements, and other usage notes.", 0, 1, description));
900        children.add(new Property("expiry", "dateTime", "When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.", 0, 1, expiry));
901        children.add(new Property("quantity", "Quantity", "The amount of the substance.", 0, 1, quantity));
902        children.add(new Property("ingredient", "", "A substance can be composed of other substances.", 0, java.lang.Integer.MAX_VALUE, ingredient));
903      }
904
905      @Override
906      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
907        switch (_hash) {
908        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique identifier for the substance. For an instance, an identifier associated with the package/container (usually a label affixed directly).", 0, java.lang.Integer.MAX_VALUE, identifier);
909        case 555127957: /*instance*/  return new Property("instance", "boolean", "A boolean to indicate if this an instance of a substance or a kind of one (a definition).", 0, 1, instance);
910        case -892481550: /*status*/  return new Property("status", "code", "A code to indicate if the substance is actively used.", 0, 1, status);
911        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category);
912        case 3059181: /*code*/  return new Property("code", "CodeableReference(SubstanceDefinition)", "A code (or set of codes) that identify this substance.", 0, 1, code);
913        case -1724546052: /*description*/  return new Property("description", "string", "A description of the substance - its appearance, handling requirements, and other usage notes.", 0, 1, description);
914        case -1289159373: /*expiry*/  return new Property("expiry", "dateTime", "When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.", 0, 1, expiry);
915        case -1285004149: /*quantity*/  return new Property("quantity", "Quantity", "The amount of the substance.", 0, 1, quantity);
916        case -206409263: /*ingredient*/  return new Property("ingredient", "", "A substance can be composed of other substances.", 0, java.lang.Integer.MAX_VALUE, ingredient);
917        default: return super.getNamedProperty(_hash, _name, _checkValid);
918        }
919
920      }
921
922      @Override
923      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
924        switch (hash) {
925        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
926        case 555127957: /*instance*/ return this.instance == null ? new Base[0] : new Base[] {this.instance}; // BooleanType
927        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FHIRSubstanceStatus>
928        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
929        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableReference
930        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
931        case -1289159373: /*expiry*/ return this.expiry == null ? new Base[0] : new Base[] {this.expiry}; // DateTimeType
932        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
933        case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // SubstanceIngredientComponent
934        default: return super.getProperty(hash, name, checkValid);
935        }
936
937      }
938
939      @Override
940      public Base setProperty(int hash, String name, Base value) throws FHIRException {
941        switch (hash) {
942        case -1618432855: // identifier
943          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
944          return value;
945        case 555127957: // instance
946          this.instance = TypeConvertor.castToBoolean(value); // BooleanType
947          return value;
948        case -892481550: // status
949          value = new FHIRSubstanceStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
950          this.status = (Enumeration) value; // Enumeration<FHIRSubstanceStatus>
951          return value;
952        case 50511102: // category
953          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
954          return value;
955        case 3059181: // code
956          this.code = TypeConvertor.castToCodeableReference(value); // CodeableReference
957          return value;
958        case -1724546052: // description
959          this.description = TypeConvertor.castToString(value); // StringType
960          return value;
961        case -1289159373: // expiry
962          this.expiry = TypeConvertor.castToDateTime(value); // DateTimeType
963          return value;
964        case -1285004149: // quantity
965          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
966          return value;
967        case -206409263: // ingredient
968          this.getIngredient().add((SubstanceIngredientComponent) value); // SubstanceIngredientComponent
969          return value;
970        default: return super.setProperty(hash, name, value);
971        }
972
973      }
974
975      @Override
976      public Base setProperty(String name, Base value) throws FHIRException {
977        if (name.equals("identifier")) {
978          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
979        } else if (name.equals("instance")) {
980          this.instance = TypeConvertor.castToBoolean(value); // BooleanType
981        } else if (name.equals("status")) {
982          value = new FHIRSubstanceStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
983          this.status = (Enumeration) value; // Enumeration<FHIRSubstanceStatus>
984        } else if (name.equals("category")) {
985          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
986        } else if (name.equals("code")) {
987          this.code = TypeConvertor.castToCodeableReference(value); // CodeableReference
988        } else if (name.equals("description")) {
989          this.description = TypeConvertor.castToString(value); // StringType
990        } else if (name.equals("expiry")) {
991          this.expiry = TypeConvertor.castToDateTime(value); // DateTimeType
992        } else if (name.equals("quantity")) {
993          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
994        } else if (name.equals("ingredient")) {
995          this.getIngredient().add((SubstanceIngredientComponent) value);
996        } else
997          return super.setProperty(name, value);
998        return value;
999      }
1000
1001      @Override
1002      public Base makeProperty(int hash, String name) throws FHIRException {
1003        switch (hash) {
1004        case -1618432855:  return addIdentifier(); 
1005        case 555127957:  return getInstanceElement();
1006        case -892481550:  return getStatusElement();
1007        case 50511102:  return addCategory(); 
1008        case 3059181:  return getCode();
1009        case -1724546052:  return getDescriptionElement();
1010        case -1289159373:  return getExpiryElement();
1011        case -1285004149:  return getQuantity();
1012        case -206409263:  return addIngredient(); 
1013        default: return super.makeProperty(hash, name);
1014        }
1015
1016      }
1017
1018      @Override
1019      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1020        switch (hash) {
1021        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1022        case 555127957: /*instance*/ return new String[] {"boolean"};
1023        case -892481550: /*status*/ return new String[] {"code"};
1024        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
1025        case 3059181: /*code*/ return new String[] {"CodeableReference"};
1026        case -1724546052: /*description*/ return new String[] {"string"};
1027        case -1289159373: /*expiry*/ return new String[] {"dateTime"};
1028        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
1029        case -206409263: /*ingredient*/ return new String[] {};
1030        default: return super.getTypesForProperty(hash, name);
1031        }
1032
1033      }
1034
1035      @Override
1036      public Base addChild(String name) throws FHIRException {
1037        if (name.equals("identifier")) {
1038          return addIdentifier();
1039        }
1040        else if (name.equals("instance")) {
1041          throw new FHIRException("Cannot call addChild on a primitive type Substance.instance");
1042        }
1043        else if (name.equals("status")) {
1044          throw new FHIRException("Cannot call addChild on a primitive type Substance.status");
1045        }
1046        else if (name.equals("category")) {
1047          return addCategory();
1048        }
1049        else if (name.equals("code")) {
1050          this.code = new CodeableReference();
1051          return this.code;
1052        }
1053        else if (name.equals("description")) {
1054          throw new FHIRException("Cannot call addChild on a primitive type Substance.description");
1055        }
1056        else if (name.equals("expiry")) {
1057          throw new FHIRException("Cannot call addChild on a primitive type Substance.expiry");
1058        }
1059        else if (name.equals("quantity")) {
1060          this.quantity = new Quantity();
1061          return this.quantity;
1062        }
1063        else if (name.equals("ingredient")) {
1064          return addIngredient();
1065        }
1066        else
1067          return super.addChild(name);
1068      }
1069
1070  public String fhirType() {
1071    return "Substance";
1072
1073  }
1074
1075      public Substance copy() {
1076        Substance dst = new Substance();
1077        copyValues(dst);
1078        return dst;
1079      }
1080
1081      public void copyValues(Substance dst) {
1082        super.copyValues(dst);
1083        if (identifier != null) {
1084          dst.identifier = new ArrayList<Identifier>();
1085          for (Identifier i : identifier)
1086            dst.identifier.add(i.copy());
1087        };
1088        dst.instance = instance == null ? null : instance.copy();
1089        dst.status = status == null ? null : status.copy();
1090        if (category != null) {
1091          dst.category = new ArrayList<CodeableConcept>();
1092          for (CodeableConcept i : category)
1093            dst.category.add(i.copy());
1094        };
1095        dst.code = code == null ? null : code.copy();
1096        dst.description = description == null ? null : description.copy();
1097        dst.expiry = expiry == null ? null : expiry.copy();
1098        dst.quantity = quantity == null ? null : quantity.copy();
1099        if (ingredient != null) {
1100          dst.ingredient = new ArrayList<SubstanceIngredientComponent>();
1101          for (SubstanceIngredientComponent i : ingredient)
1102            dst.ingredient.add(i.copy());
1103        };
1104      }
1105
1106      protected Substance typedCopy() {
1107        return copy();
1108      }
1109
1110      @Override
1111      public boolean equalsDeep(Base other_) {
1112        if (!super.equalsDeep(other_))
1113          return false;
1114        if (!(other_ instanceof Substance))
1115          return false;
1116        Substance o = (Substance) other_;
1117        return compareDeep(identifier, o.identifier, true) && compareDeep(instance, o.instance, true) && compareDeep(status, o.status, true)
1118           && compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(description, o.description, true)
1119           && compareDeep(expiry, o.expiry, true) && compareDeep(quantity, o.quantity, true) && compareDeep(ingredient, o.ingredient, true)
1120          ;
1121      }
1122
1123      @Override
1124      public boolean equalsShallow(Base other_) {
1125        if (!super.equalsShallow(other_))
1126          return false;
1127        if (!(other_ instanceof Substance))
1128          return false;
1129        Substance o = (Substance) other_;
1130        return compareValues(instance, o.instance, true) && compareValues(status, o.status, true) && compareValues(description, o.description, true)
1131           && compareValues(expiry, o.expiry, true);
1132      }
1133
1134      public boolean isEmpty() {
1135        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instance, status
1136          , category, code, description, expiry, quantity, ingredient);
1137      }
1138
1139  @Override
1140  public ResourceType getResourceType() {
1141    return ResourceType.Substance;
1142   }
1143
1144 /**
1145   * Search parameter: <b>category</b>
1146   * <p>
1147   * Description: <b>The category of the substance</b><br>
1148   * Type: <b>token</b><br>
1149   * Path: <b>Substance.category</b><br>
1150   * </p>
1151   */
1152  @SearchParamDefinition(name="category", path="Substance.category", description="The category of the substance", type="token" )
1153  public static final String SP_CATEGORY = "category";
1154 /**
1155   * <b>Fluent Client</b> search parameter constant for <b>category</b>
1156   * <p>
1157   * Description: <b>The category of the substance</b><br>
1158   * Type: <b>token</b><br>
1159   * Path: <b>Substance.category</b><br>
1160   * </p>
1161   */
1162  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
1163
1164 /**
1165   * Search parameter: <b>code-reference</b>
1166   * <p>
1167   * Description: <b>A reference to the defining substance</b><br>
1168   * Type: <b>reference</b><br>
1169   * Path: <b>Substance.code.reference</b><br>
1170   * </p>
1171   */
1172  @SearchParamDefinition(name="code-reference", path="Substance.code.reference", description="A reference to the defining substance", type="reference" )
1173  public static final String SP_CODE_REFERENCE = "code-reference";
1174 /**
1175   * <b>Fluent Client</b> search parameter constant for <b>code-reference</b>
1176   * <p>
1177   * Description: <b>A reference to the defining substance</b><br>
1178   * Type: <b>reference</b><br>
1179   * Path: <b>Substance.code.reference</b><br>
1180   * </p>
1181   */
1182  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CODE_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CODE_REFERENCE);
1183
1184/**
1185   * Constant for fluent queries to be used to add include statements. Specifies
1186   * the path value of "<b>Substance:code-reference</b>".
1187   */
1188  public static final ca.uhn.fhir.model.api.Include INCLUDE_CODE_REFERENCE = new ca.uhn.fhir.model.api.Include("Substance:code-reference").toLocked();
1189
1190 /**
1191   * Search parameter: <b>code</b>
1192   * <p>
1193   * Description: <b>The code of the substance or ingredient</b><br>
1194   * Type: <b>token</b><br>
1195   * Path: <b>Substance.code.concept | (Substance.ingredient.substance as CodeableConcept)</b><br>
1196   * </p>
1197   */
1198  @SearchParamDefinition(name="code", path="Substance.code.concept | (Substance.ingredient.substance as CodeableConcept)", description="The code of the substance or ingredient", type="token" )
1199  public static final String SP_CODE = "code";
1200 /**
1201   * <b>Fluent Client</b> search parameter constant for <b>code</b>
1202   * <p>
1203   * Description: <b>The code of the substance or ingredient</b><br>
1204   * Type: <b>token</b><br>
1205   * Path: <b>Substance.code.concept | (Substance.ingredient.substance as CodeableConcept)</b><br>
1206   * </p>
1207   */
1208  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
1209
1210 /**
1211   * Search parameter: <b>expiry</b>
1212   * <p>
1213   * Description: <b>Expiry date of package or container of substance</b><br>
1214   * Type: <b>date</b><br>
1215   * Path: <b>Substance.expiry</b><br>
1216   * </p>
1217   */
1218  @SearchParamDefinition(name="expiry", path="Substance.expiry", description="Expiry date of package or container of substance", type="date" )
1219  public static final String SP_EXPIRY = "expiry";
1220 /**
1221   * <b>Fluent Client</b> search parameter constant for <b>expiry</b>
1222   * <p>
1223   * Description: <b>Expiry date of package or container of substance</b><br>
1224   * Type: <b>date</b><br>
1225   * Path: <b>Substance.expiry</b><br>
1226   * </p>
1227   */
1228  public static final ca.uhn.fhir.rest.gclient.DateClientParam EXPIRY = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EXPIRY);
1229
1230 /**
1231   * Search parameter: <b>identifier</b>
1232   * <p>
1233   * Description: <b>Unique identifier for the substance</b><br>
1234   * Type: <b>token</b><br>
1235   * Path: <b>Substance.identifier</b><br>
1236   * </p>
1237   */
1238  @SearchParamDefinition(name="identifier", path="Substance.identifier", description="Unique identifier for the substance", type="token" )
1239  public static final String SP_IDENTIFIER = "identifier";
1240 /**
1241   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1242   * <p>
1243   * Description: <b>Unique identifier for the substance</b><br>
1244   * Type: <b>token</b><br>
1245   * Path: <b>Substance.identifier</b><br>
1246   * </p>
1247   */
1248  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1249
1250 /**
1251   * Search parameter: <b>quantity</b>
1252   * <p>
1253   * Description: <b>Amount of substance in the package</b><br>
1254   * Type: <b>quantity</b><br>
1255   * Path: <b>Substance.quantity</b><br>
1256   * </p>
1257   */
1258  @SearchParamDefinition(name="quantity", path="Substance.quantity", description="Amount of substance in the package", type="quantity" )
1259  public static final String SP_QUANTITY = "quantity";
1260 /**
1261   * <b>Fluent Client</b> search parameter constant for <b>quantity</b>
1262   * <p>
1263   * Description: <b>Amount of substance in the package</b><br>
1264   * Type: <b>quantity</b><br>
1265   * Path: <b>Substance.quantity</b><br>
1266   * </p>
1267   */
1268  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_QUANTITY);
1269
1270 /**
1271   * Search parameter: <b>status</b>
1272   * <p>
1273   * Description: <b>active | inactive | entered-in-error</b><br>
1274   * Type: <b>token</b><br>
1275   * Path: <b>Substance.status</b><br>
1276   * </p>
1277   */
1278  @SearchParamDefinition(name="status", path="Substance.status", description="active | inactive | entered-in-error", type="token" )
1279  public static final String SP_STATUS = "status";
1280 /**
1281   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1282   * <p>
1283   * Description: <b>active | inactive | entered-in-error</b><br>
1284   * Type: <b>token</b><br>
1285   * Path: <b>Substance.status</b><br>
1286   * </p>
1287   */
1288  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1289
1290 /**
1291   * Search parameter: <b>substance-reference</b>
1292   * <p>
1293   * Description: <b>A component of the substance</b><br>
1294   * Type: <b>reference</b><br>
1295   * Path: <b>(Substance.ingredient.substance as Reference)</b><br>
1296   * </p>
1297   */
1298  @SearchParamDefinition(name="substance-reference", path="(Substance.ingredient.substance as Reference)", description="A component of the substance", type="reference", target={Substance.class } )
1299  public static final String SP_SUBSTANCE_REFERENCE = "substance-reference";
1300 /**
1301   * <b>Fluent Client</b> search parameter constant for <b>substance-reference</b>
1302   * <p>
1303   * Description: <b>A component of the substance</b><br>
1304   * Type: <b>reference</b><br>
1305   * Path: <b>(Substance.ingredient.substance as Reference)</b><br>
1306   * </p>
1307   */
1308  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBSTANCE_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBSTANCE_REFERENCE);
1309
1310/**
1311   * Constant for fluent queries to be used to add include statements. Specifies
1312   * the path value of "<b>Substance:substance-reference</b>".
1313   */
1314  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBSTANCE_REFERENCE = new ca.uhn.fhir.model.api.Include("Substance:substance-reference").toLocked();
1315
1316
1317}
1318