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 Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
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 * This resource is primarily used for the identification and definition of a medication, including ingredients, for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use.
052 */
053@ResourceDef(name="Medication", profile="http://hl7.org/fhir/StructureDefinition/Medication")
054public class Medication extends DomainResource {
055
056    public enum MedicationStatusCodes {
057        /**
058         * The medication record is current and is appropriate for reference in new instances.
059         */
060        ACTIVE, 
061        /**
062         * The medication record is not current and is not is appropriate for reference in new instances.
063         */
064        INACTIVE, 
065        /**
066         * The medication record was created erroneously and is not appropriated for reference in new instances.
067         */
068        ENTEREDINERROR, 
069        /**
070         * added to help the parsers with the generic types
071         */
072        NULL;
073        public static MedicationStatusCodes 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 MedicationStatusCodes 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            case NULL: return null;
093            default: return "?";
094          }
095        }
096        public String getSystem() {
097          switch (this) {
098            case ACTIVE: return "http://hl7.org/fhir/CodeSystem/medication-status";
099            case INACTIVE: return "http://hl7.org/fhir/CodeSystem/medication-status";
100            case ENTEREDINERROR: return "http://hl7.org/fhir/CodeSystem/medication-status";
101            case NULL: return null;
102            default: return "?";
103          }
104        }
105        public String getDefinition() {
106          switch (this) {
107            case ACTIVE: return "The medication record is current and is appropriate for reference in new instances.";
108            case INACTIVE: return "The medication record is not current and is not is appropriate for reference in new instances.";
109            case ENTEREDINERROR: return "The medication record was created erroneously and is not appropriated for reference in new instances.";
110            case NULL: return null;
111            default: return "?";
112          }
113        }
114        public String getDisplay() {
115          switch (this) {
116            case ACTIVE: return "Active";
117            case INACTIVE: return "Inactive";
118            case ENTEREDINERROR: return "Entered in Error";
119            case NULL: return null;
120            default: return "?";
121          }
122        }
123    }
124
125  public static class MedicationStatusCodesEnumFactory implements EnumFactory<MedicationStatusCodes> {
126    public MedicationStatusCodes fromCode(String codeString) throws IllegalArgumentException {
127      if (codeString == null || "".equals(codeString))
128            if (codeString == null || "".equals(codeString))
129                return null;
130        if ("active".equals(codeString))
131          return MedicationStatusCodes.ACTIVE;
132        if ("inactive".equals(codeString))
133          return MedicationStatusCodes.INACTIVE;
134        if ("entered-in-error".equals(codeString))
135          return MedicationStatusCodes.ENTEREDINERROR;
136        throw new IllegalArgumentException("Unknown MedicationStatusCodes code '"+codeString+"'");
137        }
138        public Enumeration<MedicationStatusCodes> fromType(Base code) throws FHIRException {
139          if (code == null)
140            return null;
141          if (code.isEmpty())
142            return new Enumeration<MedicationStatusCodes>(this);
143          String codeString = ((PrimitiveType) code).asStringValue();
144          if (codeString == null || "".equals(codeString))
145            return null;
146        if ("active".equals(codeString))
147          return new Enumeration<MedicationStatusCodes>(this, MedicationStatusCodes.ACTIVE);
148        if ("inactive".equals(codeString))
149          return new Enumeration<MedicationStatusCodes>(this, MedicationStatusCodes.INACTIVE);
150        if ("entered-in-error".equals(codeString))
151          return new Enumeration<MedicationStatusCodes>(this, MedicationStatusCodes.ENTEREDINERROR);
152        throw new FHIRException("Unknown MedicationStatusCodes code '"+codeString+"'");
153        }
154    public String toCode(MedicationStatusCodes code) {
155      if (code == MedicationStatusCodes.ACTIVE)
156        return "active";
157      if (code == MedicationStatusCodes.INACTIVE)
158        return "inactive";
159      if (code == MedicationStatusCodes.ENTEREDINERROR)
160        return "entered-in-error";
161      return "?";
162      }
163    public String toSystem(MedicationStatusCodes code) {
164      return code.getSystem();
165      }
166    }
167
168    @Block()
169    public static class MedicationIngredientComponent extends BackboneElement implements IBaseBackboneElement {
170        /**
171         * The ingredient (substance or medication) that the ingredient.strength relates to.  This is represented as a concept from a code system or described in another resource (Substance or Medication).
172         */
173        @Child(name = "item", type = {CodeableReference.class}, order=1, min=1, max=1, modifier=false, summary=false)
174        @Description(shortDefinition="The ingredient (substance or medication) that the ingredient.strength relates to", formalDefinition="The ingredient (substance or medication) that the ingredient.strength relates to.  This is represented as a concept from a code system or described in another resource (Substance or Medication)." )
175        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-codes")
176        protected CodeableReference item;
177
178        /**
179         * Indication of whether this ingredient affects the therapeutic action of the drug.
180         */
181        @Child(name = "isActive", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
182        @Description(shortDefinition="Active ingredient indicator", formalDefinition="Indication of whether this ingredient affects the therapeutic action of the drug." )
183        protected BooleanType isActive;
184
185        /**
186         * Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet.
187         */
188        @Child(name = "strength", type = {Ratio.class, CodeableConcept.class, Quantity.class}, order=3, min=0, max=1, modifier=false, summary=false)
189        @Description(shortDefinition="Quantity of ingredient present", formalDefinition="Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet." )
190        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-ingredientstrength")
191        protected DataType strength;
192
193        private static final long serialVersionUID = -979760018L;
194
195    /**
196     * Constructor
197     */
198      public MedicationIngredientComponent() {
199        super();
200      }
201
202    /**
203     * Constructor
204     */
205      public MedicationIngredientComponent(CodeableReference item) {
206        super();
207        this.setItem(item);
208      }
209
210        /**
211         * @return {@link #item} (The ingredient (substance or medication) that the ingredient.strength relates to.  This is represented as a concept from a code system or described in another resource (Substance or Medication).)
212         */
213        public CodeableReference getItem() { 
214          if (this.item == null)
215            if (Configuration.errorOnAutoCreate())
216              throw new Error("Attempt to auto-create MedicationIngredientComponent.item");
217            else if (Configuration.doAutoCreate())
218              this.item = new CodeableReference(); // cc
219          return this.item;
220        }
221
222        public boolean hasItem() { 
223          return this.item != null && !this.item.isEmpty();
224        }
225
226        /**
227         * @param value {@link #item} (The ingredient (substance or medication) that the ingredient.strength relates to.  This is represented as a concept from a code system or described in another resource (Substance or Medication).)
228         */
229        public MedicationIngredientComponent setItem(CodeableReference value) { 
230          this.item = value;
231          return this;
232        }
233
234        /**
235         * @return {@link #isActive} (Indication of whether this ingredient affects the therapeutic action of the drug.). This is the underlying object with id, value and extensions. The accessor "getIsActive" gives direct access to the value
236         */
237        public BooleanType getIsActiveElement() { 
238          if (this.isActive == null)
239            if (Configuration.errorOnAutoCreate())
240              throw new Error("Attempt to auto-create MedicationIngredientComponent.isActive");
241            else if (Configuration.doAutoCreate())
242              this.isActive = new BooleanType(); // bb
243          return this.isActive;
244        }
245
246        public boolean hasIsActiveElement() { 
247          return this.isActive != null && !this.isActive.isEmpty();
248        }
249
250        public boolean hasIsActive() { 
251          return this.isActive != null && !this.isActive.isEmpty();
252        }
253
254        /**
255         * @param value {@link #isActive} (Indication of whether this ingredient affects the therapeutic action of the drug.). This is the underlying object with id, value and extensions. The accessor "getIsActive" gives direct access to the value
256         */
257        public MedicationIngredientComponent setIsActiveElement(BooleanType value) { 
258          this.isActive = value;
259          return this;
260        }
261
262        /**
263         * @return Indication of whether this ingredient affects the therapeutic action of the drug.
264         */
265        public boolean getIsActive() { 
266          return this.isActive == null || this.isActive.isEmpty() ? false : this.isActive.getValue();
267        }
268
269        /**
270         * @param value Indication of whether this ingredient affects the therapeutic action of the drug.
271         */
272        public MedicationIngredientComponent setIsActive(boolean value) { 
273            if (this.isActive == null)
274              this.isActive = new BooleanType();
275            this.isActive.setValue(value);
276          return this;
277        }
278
279        /**
280         * @return {@link #strength} (Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet.)
281         */
282        public DataType getStrength() { 
283          return this.strength;
284        }
285
286        /**
287         * @return {@link #strength} (Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet.)
288         */
289        public Ratio getStrengthRatio() throws FHIRException { 
290          if (this.strength == null)
291            this.strength = new Ratio();
292          if (!(this.strength instanceof Ratio))
293            throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.strength.getClass().getName()+" was encountered");
294          return (Ratio) this.strength;
295        }
296
297        public boolean hasStrengthRatio() { 
298          return this != null && this.strength instanceof Ratio;
299        }
300
301        /**
302         * @return {@link #strength} (Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet.)
303         */
304        public CodeableConcept getStrengthCodeableConcept() throws FHIRException { 
305          if (this.strength == null)
306            this.strength = new CodeableConcept();
307          if (!(this.strength instanceof CodeableConcept))
308            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.strength.getClass().getName()+" was encountered");
309          return (CodeableConcept) this.strength;
310        }
311
312        public boolean hasStrengthCodeableConcept() { 
313          return this != null && this.strength instanceof CodeableConcept;
314        }
315
316        /**
317         * @return {@link #strength} (Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet.)
318         */
319        public Quantity getStrengthQuantity() throws FHIRException { 
320          if (this.strength == null)
321            this.strength = new Quantity();
322          if (!(this.strength instanceof Quantity))
323            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.strength.getClass().getName()+" was encountered");
324          return (Quantity) this.strength;
325        }
326
327        public boolean hasStrengthQuantity() { 
328          return this != null && this.strength instanceof Quantity;
329        }
330
331        public boolean hasStrength() { 
332          return this.strength != null && !this.strength.isEmpty();
333        }
334
335        /**
336         * @param value {@link #strength} (Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet.)
337         */
338        public MedicationIngredientComponent setStrength(DataType value) { 
339          if (value != null && !(value instanceof Ratio || value instanceof CodeableConcept || value instanceof Quantity))
340            throw new Error("Not the right type for Medication.ingredient.strength[x]: "+value.fhirType());
341          this.strength = value;
342          return this;
343        }
344
345        protected void listChildren(List<Property> children) {
346          super.listChildren(children);
347          children.add(new Property("item", "CodeableReference(Substance|Medication)", "The ingredient (substance or medication) that the ingredient.strength relates to.  This is represented as a concept from a code system or described in another resource (Substance or Medication).", 0, 1, item));
348          children.add(new Property("isActive", "boolean", "Indication of whether this ingredient affects the therapeutic action of the drug.", 0, 1, isActive));
349          children.add(new Property("strength[x]", "Ratio|CodeableConcept|Quantity", "Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet.", 0, 1, strength));
350        }
351
352        @Override
353        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
354          switch (_hash) {
355          case 3242771: /*item*/  return new Property("item", "CodeableReference(Substance|Medication)", "The ingredient (substance or medication) that the ingredient.strength relates to.  This is represented as a concept from a code system or described in another resource (Substance or Medication).", 0, 1, item);
356          case -748916528: /*isActive*/  return new Property("isActive", "boolean", "Indication of whether this ingredient affects the therapeutic action of the drug.", 0, 1, isActive);
357          case 127377567: /*strength[x]*/  return new Property("strength[x]", "Ratio|CodeableConcept|Quantity", "Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet.", 0, 1, strength);
358          case 1791316033: /*strength*/  return new Property("strength[x]", "Ratio|CodeableConcept|Quantity", "Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet.", 0, 1, strength);
359          case 2141786186: /*strengthRatio*/  return new Property("strength[x]", "Ratio", "Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet.", 0, 1, strength);
360          case -1455903456: /*strengthCodeableConcept*/  return new Property("strength[x]", "CodeableConcept", "Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet.", 0, 1, strength);
361          case -1793570836: /*strengthQuantity*/  return new Property("strength[x]", "Quantity", "Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet but can also be expressed a quantity when the denominator is assumed to be 1 tablet.", 0, 1, strength);
362          default: return super.getNamedProperty(_hash, _name, _checkValid);
363          }
364
365        }
366
367      @Override
368      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
369        switch (hash) {
370        case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // CodeableReference
371        case -748916528: /*isActive*/ return this.isActive == null ? new Base[0] : new Base[] {this.isActive}; // BooleanType
372        case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : new Base[] {this.strength}; // DataType
373        default: return super.getProperty(hash, name, checkValid);
374        }
375
376      }
377
378      @Override
379      public Base setProperty(int hash, String name, Base value) throws FHIRException {
380        switch (hash) {
381        case 3242771: // item
382          this.item = TypeConvertor.castToCodeableReference(value); // CodeableReference
383          return value;
384        case -748916528: // isActive
385          this.isActive = TypeConvertor.castToBoolean(value); // BooleanType
386          return value;
387        case 1791316033: // strength
388          this.strength = TypeConvertor.castToType(value); // DataType
389          return value;
390        default: return super.setProperty(hash, name, value);
391        }
392
393      }
394
395      @Override
396      public Base setProperty(String name, Base value) throws FHIRException {
397        if (name.equals("item")) {
398          this.item = TypeConvertor.castToCodeableReference(value); // CodeableReference
399        } else if (name.equals("isActive")) {
400          this.isActive = TypeConvertor.castToBoolean(value); // BooleanType
401        } else if (name.equals("strength[x]")) {
402          this.strength = TypeConvertor.castToType(value); // DataType
403        } else
404          return super.setProperty(name, value);
405        return value;
406      }
407
408      @Override
409      public Base makeProperty(int hash, String name) throws FHIRException {
410        switch (hash) {
411        case 3242771:  return getItem();
412        case -748916528:  return getIsActiveElement();
413        case 127377567:  return getStrength();
414        case 1791316033:  return getStrength();
415        default: return super.makeProperty(hash, name);
416        }
417
418      }
419
420      @Override
421      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
422        switch (hash) {
423        case 3242771: /*item*/ return new String[] {"CodeableReference"};
424        case -748916528: /*isActive*/ return new String[] {"boolean"};
425        case 1791316033: /*strength*/ return new String[] {"Ratio", "CodeableConcept", "Quantity"};
426        default: return super.getTypesForProperty(hash, name);
427        }
428
429      }
430
431      @Override
432      public Base addChild(String name) throws FHIRException {
433        if (name.equals("item")) {
434          this.item = new CodeableReference();
435          return this.item;
436        }
437        else if (name.equals("isActive")) {
438          throw new FHIRException("Cannot call addChild on a primitive type Medication.ingredient.isActive");
439        }
440        else if (name.equals("strengthRatio")) {
441          this.strength = new Ratio();
442          return this.strength;
443        }
444        else if (name.equals("strengthCodeableConcept")) {
445          this.strength = new CodeableConcept();
446          return this.strength;
447        }
448        else if (name.equals("strengthQuantity")) {
449          this.strength = new Quantity();
450          return this.strength;
451        }
452        else
453          return super.addChild(name);
454      }
455
456      public MedicationIngredientComponent copy() {
457        MedicationIngredientComponent dst = new MedicationIngredientComponent();
458        copyValues(dst);
459        return dst;
460      }
461
462      public void copyValues(MedicationIngredientComponent dst) {
463        super.copyValues(dst);
464        dst.item = item == null ? null : item.copy();
465        dst.isActive = isActive == null ? null : isActive.copy();
466        dst.strength = strength == null ? null : strength.copy();
467      }
468
469      @Override
470      public boolean equalsDeep(Base other_) {
471        if (!super.equalsDeep(other_))
472          return false;
473        if (!(other_ instanceof MedicationIngredientComponent))
474          return false;
475        MedicationIngredientComponent o = (MedicationIngredientComponent) other_;
476        return compareDeep(item, o.item, true) && compareDeep(isActive, o.isActive, true) && compareDeep(strength, o.strength, true)
477          ;
478      }
479
480      @Override
481      public boolean equalsShallow(Base other_) {
482        if (!super.equalsShallow(other_))
483          return false;
484        if (!(other_ instanceof MedicationIngredientComponent))
485          return false;
486        MedicationIngredientComponent o = (MedicationIngredientComponent) other_;
487        return compareValues(isActive, o.isActive, true);
488      }
489
490      public boolean isEmpty() {
491        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(item, isActive, strength
492          );
493      }
494
495  public String fhirType() {
496    return "Medication.ingredient";
497
498  }
499
500  }
501
502    @Block()
503    public static class MedicationBatchComponent extends BackboneElement implements IBaseBackboneElement {
504        /**
505         * The assigned lot number of a batch of the specified product.
506         */
507        @Child(name = "lotNumber", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
508        @Description(shortDefinition="Identifier assigned to batch", formalDefinition="The assigned lot number of a batch of the specified product." )
509        protected StringType lotNumber;
510
511        /**
512         * When this specific batch of product will expire.
513         */
514        @Child(name = "expirationDate", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
515        @Description(shortDefinition="When batch will expire", formalDefinition="When this specific batch of product will expire." )
516        protected DateTimeType expirationDate;
517
518        private static final long serialVersionUID = 1982738755L;
519
520    /**
521     * Constructor
522     */
523      public MedicationBatchComponent() {
524        super();
525      }
526
527        /**
528         * @return {@link #lotNumber} (The assigned lot number of a batch of the specified product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value
529         */
530        public StringType getLotNumberElement() { 
531          if (this.lotNumber == null)
532            if (Configuration.errorOnAutoCreate())
533              throw new Error("Attempt to auto-create MedicationBatchComponent.lotNumber");
534            else if (Configuration.doAutoCreate())
535              this.lotNumber = new StringType(); // bb
536          return this.lotNumber;
537        }
538
539        public boolean hasLotNumberElement() { 
540          return this.lotNumber != null && !this.lotNumber.isEmpty();
541        }
542
543        public boolean hasLotNumber() { 
544          return this.lotNumber != null && !this.lotNumber.isEmpty();
545        }
546
547        /**
548         * @param value {@link #lotNumber} (The assigned lot number of a batch of the specified product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value
549         */
550        public MedicationBatchComponent setLotNumberElement(StringType value) { 
551          this.lotNumber = value;
552          return this;
553        }
554
555        /**
556         * @return The assigned lot number of a batch of the specified product.
557         */
558        public String getLotNumber() { 
559          return this.lotNumber == null ? null : this.lotNumber.getValue();
560        }
561
562        /**
563         * @param value The assigned lot number of a batch of the specified product.
564         */
565        public MedicationBatchComponent setLotNumber(String value) { 
566          if (Utilities.noString(value))
567            this.lotNumber = null;
568          else {
569            if (this.lotNumber == null)
570              this.lotNumber = new StringType();
571            this.lotNumber.setValue(value);
572          }
573          return this;
574        }
575
576        /**
577         * @return {@link #expirationDate} (When this specific batch of product will expire.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value
578         */
579        public DateTimeType getExpirationDateElement() { 
580          if (this.expirationDate == null)
581            if (Configuration.errorOnAutoCreate())
582              throw new Error("Attempt to auto-create MedicationBatchComponent.expirationDate");
583            else if (Configuration.doAutoCreate())
584              this.expirationDate = new DateTimeType(); // bb
585          return this.expirationDate;
586        }
587
588        public boolean hasExpirationDateElement() { 
589          return this.expirationDate != null && !this.expirationDate.isEmpty();
590        }
591
592        public boolean hasExpirationDate() { 
593          return this.expirationDate != null && !this.expirationDate.isEmpty();
594        }
595
596        /**
597         * @param value {@link #expirationDate} (When this specific batch of product will expire.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value
598         */
599        public MedicationBatchComponent setExpirationDateElement(DateTimeType value) { 
600          this.expirationDate = value;
601          return this;
602        }
603
604        /**
605         * @return When this specific batch of product will expire.
606         */
607        public Date getExpirationDate() { 
608          return this.expirationDate == null ? null : this.expirationDate.getValue();
609        }
610
611        /**
612         * @param value When this specific batch of product will expire.
613         */
614        public MedicationBatchComponent setExpirationDate(Date value) { 
615          if (value == null)
616            this.expirationDate = null;
617          else {
618            if (this.expirationDate == null)
619              this.expirationDate = new DateTimeType();
620            this.expirationDate.setValue(value);
621          }
622          return this;
623        }
624
625        protected void listChildren(List<Property> children) {
626          super.listChildren(children);
627          children.add(new Property("lotNumber", "string", "The assigned lot number of a batch of the specified product.", 0, 1, lotNumber));
628          children.add(new Property("expirationDate", "dateTime", "When this specific batch of product will expire.", 0, 1, expirationDate));
629        }
630
631        @Override
632        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
633          switch (_hash) {
634          case 462547450: /*lotNumber*/  return new Property("lotNumber", "string", "The assigned lot number of a batch of the specified product.", 0, 1, lotNumber);
635          case -668811523: /*expirationDate*/  return new Property("expirationDate", "dateTime", "When this specific batch of product will expire.", 0, 1, expirationDate);
636          default: return super.getNamedProperty(_hash, _name, _checkValid);
637          }
638
639        }
640
641      @Override
642      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
643        switch (hash) {
644        case 462547450: /*lotNumber*/ return this.lotNumber == null ? new Base[0] : new Base[] {this.lotNumber}; // StringType
645        case -668811523: /*expirationDate*/ return this.expirationDate == null ? new Base[0] : new Base[] {this.expirationDate}; // DateTimeType
646        default: return super.getProperty(hash, name, checkValid);
647        }
648
649      }
650
651      @Override
652      public Base setProperty(int hash, String name, Base value) throws FHIRException {
653        switch (hash) {
654        case 462547450: // lotNumber
655          this.lotNumber = TypeConvertor.castToString(value); // StringType
656          return value;
657        case -668811523: // expirationDate
658          this.expirationDate = TypeConvertor.castToDateTime(value); // DateTimeType
659          return value;
660        default: return super.setProperty(hash, name, value);
661        }
662
663      }
664
665      @Override
666      public Base setProperty(String name, Base value) throws FHIRException {
667        if (name.equals("lotNumber")) {
668          this.lotNumber = TypeConvertor.castToString(value); // StringType
669        } else if (name.equals("expirationDate")) {
670          this.expirationDate = TypeConvertor.castToDateTime(value); // DateTimeType
671        } else
672          return super.setProperty(name, value);
673        return value;
674      }
675
676      @Override
677      public Base makeProperty(int hash, String name) throws FHIRException {
678        switch (hash) {
679        case 462547450:  return getLotNumberElement();
680        case -668811523:  return getExpirationDateElement();
681        default: return super.makeProperty(hash, name);
682        }
683
684      }
685
686      @Override
687      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
688        switch (hash) {
689        case 462547450: /*lotNumber*/ return new String[] {"string"};
690        case -668811523: /*expirationDate*/ return new String[] {"dateTime"};
691        default: return super.getTypesForProperty(hash, name);
692        }
693
694      }
695
696      @Override
697      public Base addChild(String name) throws FHIRException {
698        if (name.equals("lotNumber")) {
699          throw new FHIRException("Cannot call addChild on a primitive type Medication.batch.lotNumber");
700        }
701        else if (name.equals("expirationDate")) {
702          throw new FHIRException("Cannot call addChild on a primitive type Medication.batch.expirationDate");
703        }
704        else
705          return super.addChild(name);
706      }
707
708      public MedicationBatchComponent copy() {
709        MedicationBatchComponent dst = new MedicationBatchComponent();
710        copyValues(dst);
711        return dst;
712      }
713
714      public void copyValues(MedicationBatchComponent dst) {
715        super.copyValues(dst);
716        dst.lotNumber = lotNumber == null ? null : lotNumber.copy();
717        dst.expirationDate = expirationDate == null ? null : expirationDate.copy();
718      }
719
720      @Override
721      public boolean equalsDeep(Base other_) {
722        if (!super.equalsDeep(other_))
723          return false;
724        if (!(other_ instanceof MedicationBatchComponent))
725          return false;
726        MedicationBatchComponent o = (MedicationBatchComponent) other_;
727        return compareDeep(lotNumber, o.lotNumber, true) && compareDeep(expirationDate, o.expirationDate, true)
728          ;
729      }
730
731      @Override
732      public boolean equalsShallow(Base other_) {
733        if (!super.equalsShallow(other_))
734          return false;
735        if (!(other_ instanceof MedicationBatchComponent))
736          return false;
737        MedicationBatchComponent o = (MedicationBatchComponent) other_;
738        return compareValues(lotNumber, o.lotNumber, true) && compareValues(expirationDate, o.expirationDate, true)
739          ;
740      }
741
742      public boolean isEmpty() {
743        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(lotNumber, expirationDate
744          );
745      }
746
747  public String fhirType() {
748    return "Medication.batch";
749
750  }
751
752  }
753
754    /**
755     * Business identifier for this medication.
756     */
757    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
758    @Description(shortDefinition="Business identifier for this medication", formalDefinition="Business identifier for this medication." )
759    protected List<Identifier> identifier;
760
761    /**
762     * A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.
763     */
764    @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
765    @Description(shortDefinition="Codes that identify this medication", formalDefinition="A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems." )
766    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-codes")
767    protected CodeableConcept code;
768
769    /**
770     * A code to indicate if the medication is in active use.
771     */
772    @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true)
773    @Description(shortDefinition="active | inactive | entered-in-error", formalDefinition="A code to indicate if the medication is in active use." )
774    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-status")
775    protected Enumeration<MedicationStatusCodes> status;
776
777    /**
778     * The company or other legal entity that has authorization, from the appropriate drug regulatory authority,  to market a medicine in one or more jurisdictions.  Typically abbreviated MAH.Note:  The MAH may manufacture the product and may also contract the manufacturing of the product to one or more companies (organizations).
779     */
780    @Child(name = "marketingAuthorizationHolder", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=true)
781    @Description(shortDefinition="Organization that has authorization to market medication", formalDefinition="The company or other legal entity that has authorization, from the appropriate drug regulatory authority,  to market a medicine in one or more jurisdictions.  Typically abbreviated MAH.Note:  The MAH may manufacture the product and may also contract the manufacturing of the product to one or more companies (organizations)." )
782    protected Reference marketingAuthorizationHolder;
783
784    /**
785     * Describes the form of the item.  Powder; tablets; capsule.
786     */
787    @Child(name = "doseForm", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
788    @Description(shortDefinition="powder | tablets | capsule +", formalDefinition="Describes the form of the item.  Powder; tablets; capsule." )
789    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-form-codes")
790    protected CodeableConcept doseForm;
791
792    /**
793     * When the specified product code does not infer a package size, this is the specific amount of drug in the product.  For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.).
794     */
795    @Child(name = "totalVolume", type = {Ratio.class}, order=5, min=0, max=1, modifier=false, summary=true)
796    @Description(shortDefinition="When the specified product code does not infer a package size, this is the specific amount of drug in the product", formalDefinition="When the specified product code does not infer a package size, this is the specific amount of drug in the product.  For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.)." )
797    protected Ratio totalVolume;
798
799    /**
800     * Identifies a particular constituent of interest in the product.
801     */
802    @Child(name = "ingredient", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
803    @Description(shortDefinition="Active or inactive ingredient", formalDefinition="Identifies a particular constituent of interest in the product." )
804    protected List<MedicationIngredientComponent> ingredient;
805
806    /**
807     * Information that only applies to packages (not products).
808     */
809    @Child(name = "batch", type = {}, order=7, min=0, max=1, modifier=false, summary=false)
810    @Description(shortDefinition="Details about packaged medications", formalDefinition="Information that only applies to packages (not products)." )
811    protected MedicationBatchComponent batch;
812
813    private static final long serialVersionUID = -528893053L;
814
815  /**
816   * Constructor
817   */
818    public Medication() {
819      super();
820    }
821
822    /**
823     * @return {@link #identifier} (Business identifier for this medication.)
824     */
825    public List<Identifier> getIdentifier() { 
826      if (this.identifier == null)
827        this.identifier = new ArrayList<Identifier>();
828      return this.identifier;
829    }
830
831    /**
832     * @return Returns a reference to <code>this</code> for easy method chaining
833     */
834    public Medication setIdentifier(List<Identifier> theIdentifier) { 
835      this.identifier = theIdentifier;
836      return this;
837    }
838
839    public boolean hasIdentifier() { 
840      if (this.identifier == null)
841        return false;
842      for (Identifier item : this.identifier)
843        if (!item.isEmpty())
844          return true;
845      return false;
846    }
847
848    public Identifier addIdentifier() { //3
849      Identifier t = new Identifier();
850      if (this.identifier == null)
851        this.identifier = new ArrayList<Identifier>();
852      this.identifier.add(t);
853      return t;
854    }
855
856    public Medication addIdentifier(Identifier t) { //3
857      if (t == null)
858        return this;
859      if (this.identifier == null)
860        this.identifier = new ArrayList<Identifier>();
861      this.identifier.add(t);
862      return this;
863    }
864
865    /**
866     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
867     */
868    public Identifier getIdentifierFirstRep() { 
869      if (getIdentifier().isEmpty()) {
870        addIdentifier();
871      }
872      return getIdentifier().get(0);
873    }
874
875    /**
876     * @return {@link #code} (A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.)
877     */
878    public CodeableConcept getCode() { 
879      if (this.code == null)
880        if (Configuration.errorOnAutoCreate())
881          throw new Error("Attempt to auto-create Medication.code");
882        else if (Configuration.doAutoCreate())
883          this.code = new CodeableConcept(); // cc
884      return this.code;
885    }
886
887    public boolean hasCode() { 
888      return this.code != null && !this.code.isEmpty();
889    }
890
891    /**
892     * @param value {@link #code} (A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.)
893     */
894    public Medication setCode(CodeableConcept value) { 
895      this.code = value;
896      return this;
897    }
898
899    /**
900     * @return {@link #status} (A code to indicate if the medication is in active use.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
901     */
902    public Enumeration<MedicationStatusCodes> getStatusElement() { 
903      if (this.status == null)
904        if (Configuration.errorOnAutoCreate())
905          throw new Error("Attempt to auto-create Medication.status");
906        else if (Configuration.doAutoCreate())
907          this.status = new Enumeration<MedicationStatusCodes>(new MedicationStatusCodesEnumFactory()); // bb
908      return this.status;
909    }
910
911    public boolean hasStatusElement() { 
912      return this.status != null && !this.status.isEmpty();
913    }
914
915    public boolean hasStatus() { 
916      return this.status != null && !this.status.isEmpty();
917    }
918
919    /**
920     * @param value {@link #status} (A code to indicate if the medication is in active use.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
921     */
922    public Medication setStatusElement(Enumeration<MedicationStatusCodes> value) { 
923      this.status = value;
924      return this;
925    }
926
927    /**
928     * @return A code to indicate if the medication is in active use.
929     */
930    public MedicationStatusCodes getStatus() { 
931      return this.status == null ? null : this.status.getValue();
932    }
933
934    /**
935     * @param value A code to indicate if the medication is in active use.
936     */
937    public Medication setStatus(MedicationStatusCodes value) { 
938      if (value == null)
939        this.status = null;
940      else {
941        if (this.status == null)
942          this.status = new Enumeration<MedicationStatusCodes>(new MedicationStatusCodesEnumFactory());
943        this.status.setValue(value);
944      }
945      return this;
946    }
947
948    /**
949     * @return {@link #marketingAuthorizationHolder} (The company or other legal entity that has authorization, from the appropriate drug regulatory authority,  to market a medicine in one or more jurisdictions.  Typically abbreviated MAH.Note:  The MAH may manufacture the product and may also contract the manufacturing of the product to one or more companies (organizations).)
950     */
951    public Reference getMarketingAuthorizationHolder() { 
952      if (this.marketingAuthorizationHolder == null)
953        if (Configuration.errorOnAutoCreate())
954          throw new Error("Attempt to auto-create Medication.marketingAuthorizationHolder");
955        else if (Configuration.doAutoCreate())
956          this.marketingAuthorizationHolder = new Reference(); // cc
957      return this.marketingAuthorizationHolder;
958    }
959
960    public boolean hasMarketingAuthorizationHolder() { 
961      return this.marketingAuthorizationHolder != null && !this.marketingAuthorizationHolder.isEmpty();
962    }
963
964    /**
965     * @param value {@link #marketingAuthorizationHolder} (The company or other legal entity that has authorization, from the appropriate drug regulatory authority,  to market a medicine in one or more jurisdictions.  Typically abbreviated MAH.Note:  The MAH may manufacture the product and may also contract the manufacturing of the product to one or more companies (organizations).)
966     */
967    public Medication setMarketingAuthorizationHolder(Reference value) { 
968      this.marketingAuthorizationHolder = value;
969      return this;
970    }
971
972    /**
973     * @return {@link #doseForm} (Describes the form of the item.  Powder; tablets; capsule.)
974     */
975    public CodeableConcept getDoseForm() { 
976      if (this.doseForm == null)
977        if (Configuration.errorOnAutoCreate())
978          throw new Error("Attempt to auto-create Medication.doseForm");
979        else if (Configuration.doAutoCreate())
980          this.doseForm = new CodeableConcept(); // cc
981      return this.doseForm;
982    }
983
984    public boolean hasDoseForm() { 
985      return this.doseForm != null && !this.doseForm.isEmpty();
986    }
987
988    /**
989     * @param value {@link #doseForm} (Describes the form of the item.  Powder; tablets; capsule.)
990     */
991    public Medication setDoseForm(CodeableConcept value) { 
992      this.doseForm = value;
993      return this;
994    }
995
996    /**
997     * @return {@link #totalVolume} (When the specified product code does not infer a package size, this is the specific amount of drug in the product.  For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.).)
998     */
999    public Ratio getTotalVolume() { 
1000      if (this.totalVolume == null)
1001        if (Configuration.errorOnAutoCreate())
1002          throw new Error("Attempt to auto-create Medication.totalVolume");
1003        else if (Configuration.doAutoCreate())
1004          this.totalVolume = new Ratio(); // cc
1005      return this.totalVolume;
1006    }
1007
1008    public boolean hasTotalVolume() { 
1009      return this.totalVolume != null && !this.totalVolume.isEmpty();
1010    }
1011
1012    /**
1013     * @param value {@link #totalVolume} (When the specified product code does not infer a package size, this is the specific amount of drug in the product.  For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.).)
1014     */
1015    public Medication setTotalVolume(Ratio value) { 
1016      this.totalVolume = value;
1017      return this;
1018    }
1019
1020    /**
1021     * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.)
1022     */
1023    public List<MedicationIngredientComponent> getIngredient() { 
1024      if (this.ingredient == null)
1025        this.ingredient = new ArrayList<MedicationIngredientComponent>();
1026      return this.ingredient;
1027    }
1028
1029    /**
1030     * @return Returns a reference to <code>this</code> for easy method chaining
1031     */
1032    public Medication setIngredient(List<MedicationIngredientComponent> theIngredient) { 
1033      this.ingredient = theIngredient;
1034      return this;
1035    }
1036
1037    public boolean hasIngredient() { 
1038      if (this.ingredient == null)
1039        return false;
1040      for (MedicationIngredientComponent item : this.ingredient)
1041        if (!item.isEmpty())
1042          return true;
1043      return false;
1044    }
1045
1046    public MedicationIngredientComponent addIngredient() { //3
1047      MedicationIngredientComponent t = new MedicationIngredientComponent();
1048      if (this.ingredient == null)
1049        this.ingredient = new ArrayList<MedicationIngredientComponent>();
1050      this.ingredient.add(t);
1051      return t;
1052    }
1053
1054    public Medication addIngredient(MedicationIngredientComponent t) { //3
1055      if (t == null)
1056        return this;
1057      if (this.ingredient == null)
1058        this.ingredient = new ArrayList<MedicationIngredientComponent>();
1059      this.ingredient.add(t);
1060      return this;
1061    }
1062
1063    /**
1064     * @return The first repetition of repeating field {@link #ingredient}, creating it if it does not already exist {3}
1065     */
1066    public MedicationIngredientComponent getIngredientFirstRep() { 
1067      if (getIngredient().isEmpty()) {
1068        addIngredient();
1069      }
1070      return getIngredient().get(0);
1071    }
1072
1073    /**
1074     * @return {@link #batch} (Information that only applies to packages (not products).)
1075     */
1076    public MedicationBatchComponent getBatch() { 
1077      if (this.batch == null)
1078        if (Configuration.errorOnAutoCreate())
1079          throw new Error("Attempt to auto-create Medication.batch");
1080        else if (Configuration.doAutoCreate())
1081          this.batch = new MedicationBatchComponent(); // cc
1082      return this.batch;
1083    }
1084
1085    public boolean hasBatch() { 
1086      return this.batch != null && !this.batch.isEmpty();
1087    }
1088
1089    /**
1090     * @param value {@link #batch} (Information that only applies to packages (not products).)
1091     */
1092    public Medication setBatch(MedicationBatchComponent value) { 
1093      this.batch = value;
1094      return this;
1095    }
1096
1097      protected void listChildren(List<Property> children) {
1098        super.listChildren(children);
1099        children.add(new Property("identifier", "Identifier", "Business identifier for this medication.", 0, java.lang.Integer.MAX_VALUE, identifier));
1100        children.add(new Property("code", "CodeableConcept", "A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.", 0, 1, code));
1101        children.add(new Property("status", "code", "A code to indicate if the medication is in active use.", 0, 1, status));
1102        children.add(new Property("marketingAuthorizationHolder", "Reference(Organization)", "The company or other legal entity that has authorization, from the appropriate drug regulatory authority,  to market a medicine in one or more jurisdictions.  Typically abbreviated MAH.Note:  The MAH may manufacture the product and may also contract the manufacturing of the product to one or more companies (organizations).", 0, 1, marketingAuthorizationHolder));
1103        children.add(new Property("doseForm", "CodeableConcept", "Describes the form of the item.  Powder; tablets; capsule.", 0, 1, doseForm));
1104        children.add(new Property("totalVolume", "Ratio", "When the specified product code does not infer a package size, this is the specific amount of drug in the product.  For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.).", 0, 1, totalVolume));
1105        children.add(new Property("ingredient", "", "Identifies a particular constituent of interest in the product.", 0, java.lang.Integer.MAX_VALUE, ingredient));
1106        children.add(new Property("batch", "", "Information that only applies to packages (not products).", 0, 1, batch));
1107      }
1108
1109      @Override
1110      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1111        switch (_hash) {
1112        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifier for this medication.", 0, java.lang.Integer.MAX_VALUE, identifier);
1113        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.", 0, 1, code);
1114        case -892481550: /*status*/  return new Property("status", "code", "A code to indicate if the medication is in active use.", 0, 1, status);
1115        case -1565971585: /*marketingAuthorizationHolder*/  return new Property("marketingAuthorizationHolder", "Reference(Organization)", "The company or other legal entity that has authorization, from the appropriate drug regulatory authority,  to market a medicine in one or more jurisdictions.  Typically abbreviated MAH.Note:  The MAH may manufacture the product and may also contract the manufacturing of the product to one or more companies (organizations).", 0, 1, marketingAuthorizationHolder);
1116        case 1303858817: /*doseForm*/  return new Property("doseForm", "CodeableConcept", "Describes the form of the item.  Powder; tablets; capsule.", 0, 1, doseForm);
1117        case -654431362: /*totalVolume*/  return new Property("totalVolume", "Ratio", "When the specified product code does not infer a package size, this is the specific amount of drug in the product.  For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.).", 0, 1, totalVolume);
1118        case -206409263: /*ingredient*/  return new Property("ingredient", "", "Identifies a particular constituent of interest in the product.", 0, java.lang.Integer.MAX_VALUE, ingredient);
1119        case 93509434: /*batch*/  return new Property("batch", "", "Information that only applies to packages (not products).", 0, 1, batch);
1120        default: return super.getNamedProperty(_hash, _name, _checkValid);
1121        }
1122
1123      }
1124
1125      @Override
1126      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1127        switch (hash) {
1128        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1129        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1130        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<MedicationStatusCodes>
1131        case -1565971585: /*marketingAuthorizationHolder*/ return this.marketingAuthorizationHolder == null ? new Base[0] : new Base[] {this.marketingAuthorizationHolder}; // Reference
1132        case 1303858817: /*doseForm*/ return this.doseForm == null ? new Base[0] : new Base[] {this.doseForm}; // CodeableConcept
1133        case -654431362: /*totalVolume*/ return this.totalVolume == null ? new Base[0] : new Base[] {this.totalVolume}; // Ratio
1134        case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // MedicationIngredientComponent
1135        case 93509434: /*batch*/ return this.batch == null ? new Base[0] : new Base[] {this.batch}; // MedicationBatchComponent
1136        default: return super.getProperty(hash, name, checkValid);
1137        }
1138
1139      }
1140
1141      @Override
1142      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1143        switch (hash) {
1144        case -1618432855: // identifier
1145          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1146          return value;
1147        case 3059181: // code
1148          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1149          return value;
1150        case -892481550: // status
1151          value = new MedicationStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
1152          this.status = (Enumeration) value; // Enumeration<MedicationStatusCodes>
1153          return value;
1154        case -1565971585: // marketingAuthorizationHolder
1155          this.marketingAuthorizationHolder = TypeConvertor.castToReference(value); // Reference
1156          return value;
1157        case 1303858817: // doseForm
1158          this.doseForm = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1159          return value;
1160        case -654431362: // totalVolume
1161          this.totalVolume = TypeConvertor.castToRatio(value); // Ratio
1162          return value;
1163        case -206409263: // ingredient
1164          this.getIngredient().add((MedicationIngredientComponent) value); // MedicationIngredientComponent
1165          return value;
1166        case 93509434: // batch
1167          this.batch = (MedicationBatchComponent) value; // MedicationBatchComponent
1168          return value;
1169        default: return super.setProperty(hash, name, value);
1170        }
1171
1172      }
1173
1174      @Override
1175      public Base setProperty(String name, Base value) throws FHIRException {
1176        if (name.equals("identifier")) {
1177          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1178        } else if (name.equals("code")) {
1179          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1180        } else if (name.equals("status")) {
1181          value = new MedicationStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
1182          this.status = (Enumeration) value; // Enumeration<MedicationStatusCodes>
1183        } else if (name.equals("marketingAuthorizationHolder")) {
1184          this.marketingAuthorizationHolder = TypeConvertor.castToReference(value); // Reference
1185        } else if (name.equals("doseForm")) {
1186          this.doseForm = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1187        } else if (name.equals("totalVolume")) {
1188          this.totalVolume = TypeConvertor.castToRatio(value); // Ratio
1189        } else if (name.equals("ingredient")) {
1190          this.getIngredient().add((MedicationIngredientComponent) value);
1191        } else if (name.equals("batch")) {
1192          this.batch = (MedicationBatchComponent) value; // MedicationBatchComponent
1193        } else
1194          return super.setProperty(name, value);
1195        return value;
1196      }
1197
1198      @Override
1199      public Base makeProperty(int hash, String name) throws FHIRException {
1200        switch (hash) {
1201        case -1618432855:  return addIdentifier(); 
1202        case 3059181:  return getCode();
1203        case -892481550:  return getStatusElement();
1204        case -1565971585:  return getMarketingAuthorizationHolder();
1205        case 1303858817:  return getDoseForm();
1206        case -654431362:  return getTotalVolume();
1207        case -206409263:  return addIngredient(); 
1208        case 93509434:  return getBatch();
1209        default: return super.makeProperty(hash, name);
1210        }
1211
1212      }
1213
1214      @Override
1215      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1216        switch (hash) {
1217        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1218        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1219        case -892481550: /*status*/ return new String[] {"code"};
1220        case -1565971585: /*marketingAuthorizationHolder*/ return new String[] {"Reference"};
1221        case 1303858817: /*doseForm*/ return new String[] {"CodeableConcept"};
1222        case -654431362: /*totalVolume*/ return new String[] {"Ratio"};
1223        case -206409263: /*ingredient*/ return new String[] {};
1224        case 93509434: /*batch*/ return new String[] {};
1225        default: return super.getTypesForProperty(hash, name);
1226        }
1227
1228      }
1229
1230      @Override
1231      public Base addChild(String name) throws FHIRException {
1232        if (name.equals("identifier")) {
1233          return addIdentifier();
1234        }
1235        else if (name.equals("code")) {
1236          this.code = new CodeableConcept();
1237          return this.code;
1238        }
1239        else if (name.equals("status")) {
1240          throw new FHIRException("Cannot call addChild on a primitive type Medication.status");
1241        }
1242        else if (name.equals("marketingAuthorizationHolder")) {
1243          this.marketingAuthorizationHolder = new Reference();
1244          return this.marketingAuthorizationHolder;
1245        }
1246        else if (name.equals("doseForm")) {
1247          this.doseForm = new CodeableConcept();
1248          return this.doseForm;
1249        }
1250        else if (name.equals("totalVolume")) {
1251          this.totalVolume = new Ratio();
1252          return this.totalVolume;
1253        }
1254        else if (name.equals("ingredient")) {
1255          return addIngredient();
1256        }
1257        else if (name.equals("batch")) {
1258          this.batch = new MedicationBatchComponent();
1259          return this.batch;
1260        }
1261        else
1262          return super.addChild(name);
1263      }
1264
1265  public String fhirType() {
1266    return "Medication";
1267
1268  }
1269
1270      public Medication copy() {
1271        Medication dst = new Medication();
1272        copyValues(dst);
1273        return dst;
1274      }
1275
1276      public void copyValues(Medication dst) {
1277        super.copyValues(dst);
1278        if (identifier != null) {
1279          dst.identifier = new ArrayList<Identifier>();
1280          for (Identifier i : identifier)
1281            dst.identifier.add(i.copy());
1282        };
1283        dst.code = code == null ? null : code.copy();
1284        dst.status = status == null ? null : status.copy();
1285        dst.marketingAuthorizationHolder = marketingAuthorizationHolder == null ? null : marketingAuthorizationHolder.copy();
1286        dst.doseForm = doseForm == null ? null : doseForm.copy();
1287        dst.totalVolume = totalVolume == null ? null : totalVolume.copy();
1288        if (ingredient != null) {
1289          dst.ingredient = new ArrayList<MedicationIngredientComponent>();
1290          for (MedicationIngredientComponent i : ingredient)
1291            dst.ingredient.add(i.copy());
1292        };
1293        dst.batch = batch == null ? null : batch.copy();
1294      }
1295
1296      protected Medication typedCopy() {
1297        return copy();
1298      }
1299
1300      @Override
1301      public boolean equalsDeep(Base other_) {
1302        if (!super.equalsDeep(other_))
1303          return false;
1304        if (!(other_ instanceof Medication))
1305          return false;
1306        Medication o = (Medication) other_;
1307        return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(status, o.status, true)
1308           && compareDeep(marketingAuthorizationHolder, o.marketingAuthorizationHolder, true) && compareDeep(doseForm, o.doseForm, true)
1309           && compareDeep(totalVolume, o.totalVolume, true) && compareDeep(ingredient, o.ingredient, true)
1310           && compareDeep(batch, o.batch, true);
1311      }
1312
1313      @Override
1314      public boolean equalsShallow(Base other_) {
1315        if (!super.equalsShallow(other_))
1316          return false;
1317        if (!(other_ instanceof Medication))
1318          return false;
1319        Medication o = (Medication) other_;
1320        return compareValues(status, o.status, true);
1321      }
1322
1323      public boolean isEmpty() {
1324        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, code, status
1325          , marketingAuthorizationHolder, doseForm, totalVolume, ingredient, batch);
1326      }
1327
1328  @Override
1329  public ResourceType getResourceType() {
1330    return ResourceType.Medication;
1331   }
1332
1333 /**
1334   * Search parameter: <b>expiration-date</b>
1335   * <p>
1336   * Description: <b>Returns medications in a batch with this expiration date</b><br>
1337   * Type: <b>date</b><br>
1338   * Path: <b>Medication.batch.expirationDate</b><br>
1339   * </p>
1340   */
1341  @SearchParamDefinition(name="expiration-date", path="Medication.batch.expirationDate", description="Returns medications in a batch with this expiration date", type="date" )
1342  public static final String SP_EXPIRATION_DATE = "expiration-date";
1343 /**
1344   * <b>Fluent Client</b> search parameter constant for <b>expiration-date</b>
1345   * <p>
1346   * Description: <b>Returns medications in a batch with this expiration date</b><br>
1347   * Type: <b>date</b><br>
1348   * Path: <b>Medication.batch.expirationDate</b><br>
1349   * </p>
1350   */
1351  public static final ca.uhn.fhir.rest.gclient.DateClientParam EXPIRATION_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EXPIRATION_DATE);
1352
1353 /**
1354   * Search parameter: <b>form</b>
1355   * <p>
1356   * Description: <b>Returns medications for a specific dose form</b><br>
1357   * Type: <b>token</b><br>
1358   * Path: <b>null</b><br>
1359   * </p>
1360   */
1361  @SearchParamDefinition(name="form", path="", description="Returns medications for a specific dose form", type="token" )
1362  public static final String SP_FORM = "form";
1363 /**
1364   * <b>Fluent Client</b> search parameter constant for <b>form</b>
1365   * <p>
1366   * Description: <b>Returns medications for a specific dose form</b><br>
1367   * Type: <b>token</b><br>
1368   * Path: <b>null</b><br>
1369   * </p>
1370   */
1371  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORM);
1372
1373 /**
1374   * Search parameter: <b>identifier</b>
1375   * <p>
1376   * Description: <b>Returns medications with this external identifier</b><br>
1377   * Type: <b>token</b><br>
1378   * Path: <b>Medication.identifier</b><br>
1379   * </p>
1380   */
1381  @SearchParamDefinition(name="identifier", path="Medication.identifier", description="Returns medications with this external identifier", type="token" )
1382  public static final String SP_IDENTIFIER = "identifier";
1383 /**
1384   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1385   * <p>
1386   * Description: <b>Returns medications with this external identifier</b><br>
1387   * Type: <b>token</b><br>
1388   * Path: <b>Medication.identifier</b><br>
1389   * </p>
1390   */
1391  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1392
1393 /**
1394   * Search parameter: <b>ingredient-code</b>
1395   * <p>
1396   * Description: <b>Returns medications for this ingredient code</b><br>
1397   * Type: <b>token</b><br>
1398   * Path: <b>Medication.ingredient.item.concept</b><br>
1399   * </p>
1400   */
1401  @SearchParamDefinition(name="ingredient-code", path="Medication.ingredient.item.concept", description="Returns medications for this ingredient code", type="token" )
1402  public static final String SP_INGREDIENT_CODE = "ingredient-code";
1403 /**
1404   * <b>Fluent Client</b> search parameter constant for <b>ingredient-code</b>
1405   * <p>
1406   * Description: <b>Returns medications for this ingredient code</b><br>
1407   * Type: <b>token</b><br>
1408   * Path: <b>Medication.ingredient.item.concept</b><br>
1409   * </p>
1410   */
1411  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INGREDIENT_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INGREDIENT_CODE);
1412
1413 /**
1414   * Search parameter: <b>ingredient</b>
1415   * <p>
1416   * Description: <b>Returns medications for this ingredient reference</b><br>
1417   * Type: <b>reference</b><br>
1418   * Path: <b>Medication.ingredient.item.reference</b><br>
1419   * </p>
1420   */
1421  @SearchParamDefinition(name="ingredient", path="Medication.ingredient.item.reference", description="Returns medications for this ingredient reference", type="reference" )
1422  public static final String SP_INGREDIENT = "ingredient";
1423 /**
1424   * <b>Fluent Client</b> search parameter constant for <b>ingredient</b>
1425   * <p>
1426   * Description: <b>Returns medications for this ingredient reference</b><br>
1427   * Type: <b>reference</b><br>
1428   * Path: <b>Medication.ingredient.item.reference</b><br>
1429   * </p>
1430   */
1431  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INGREDIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INGREDIENT);
1432
1433/**
1434   * Constant for fluent queries to be used to add include statements. Specifies
1435   * the path value of "<b>Medication:ingredient</b>".
1436   */
1437  public static final ca.uhn.fhir.model.api.Include INCLUDE_INGREDIENT = new ca.uhn.fhir.model.api.Include("Medication:ingredient").toLocked();
1438
1439 /**
1440   * Search parameter: <b>lot-number</b>
1441   * <p>
1442   * Description: <b>Returns medications in a batch with this lot number</b><br>
1443   * Type: <b>token</b><br>
1444   * Path: <b>Medication.batch.lotNumber</b><br>
1445   * </p>
1446   */
1447  @SearchParamDefinition(name="lot-number", path="Medication.batch.lotNumber", description="Returns medications in a batch with this lot number", type="token" )
1448  public static final String SP_LOT_NUMBER = "lot-number";
1449 /**
1450   * <b>Fluent Client</b> search parameter constant for <b>lot-number</b>
1451   * <p>
1452   * Description: <b>Returns medications in a batch with this lot number</b><br>
1453   * Type: <b>token</b><br>
1454   * Path: <b>Medication.batch.lotNumber</b><br>
1455   * </p>
1456   */
1457  public static final ca.uhn.fhir.rest.gclient.TokenClientParam LOT_NUMBER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LOT_NUMBER);
1458
1459 /**
1460   * Search parameter: <b>marketingauthorizationholder</b>
1461   * <p>
1462   * Description: <b>Returns medications made or sold for this marketing authorization holder</b><br>
1463   * Type: <b>reference</b><br>
1464   * Path: <b>Medication.marketingAuthorizationHolder</b><br>
1465   * </p>
1466   */
1467  @SearchParamDefinition(name="marketingauthorizationholder", path="Medication.marketingAuthorizationHolder", description="Returns medications made or sold for this marketing authorization holder", type="reference", target={Organization.class } )
1468  public static final String SP_MARKETINGAUTHORIZATIONHOLDER = "marketingauthorizationholder";
1469 /**
1470   * <b>Fluent Client</b> search parameter constant for <b>marketingauthorizationholder</b>
1471   * <p>
1472   * Description: <b>Returns medications made or sold for this marketing authorization holder</b><br>
1473   * Type: <b>reference</b><br>
1474   * Path: <b>Medication.marketingAuthorizationHolder</b><br>
1475   * </p>
1476   */
1477  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MARKETINGAUTHORIZATIONHOLDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MARKETINGAUTHORIZATIONHOLDER);
1478
1479/**
1480   * Constant for fluent queries to be used to add include statements. Specifies
1481   * the path value of "<b>Medication:marketingauthorizationholder</b>".
1482   */
1483  public static final ca.uhn.fhir.model.api.Include INCLUDE_MARKETINGAUTHORIZATIONHOLDER = new ca.uhn.fhir.model.api.Include("Medication:marketingauthorizationholder").toLocked();
1484
1485 /**
1486   * Search parameter: <b>status</b>
1487   * <p>
1488   * Description: <b>Returns medications for this status</b><br>
1489   * Type: <b>token</b><br>
1490   * Path: <b>Medication.status</b><br>
1491   * </p>
1492   */
1493  @SearchParamDefinition(name="status", path="Medication.status", description="Returns medications for this status", type="token" )
1494  public static final String SP_STATUS = "status";
1495 /**
1496   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1497   * <p>
1498   * Description: <b>Returns medications for this status</b><br>
1499   * Type: <b>token</b><br>
1500   * Path: <b>Medication.status</b><br>
1501   * </p>
1502   */
1503  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1504
1505 /**
1506   * Search parameter: <b>code</b>
1507   * <p>
1508   * Description: <b>Multiple Resources: 
1509
1510* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
1511* [Condition](condition.html): Code for the condition
1512* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
1513* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result
1514* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
1515* [List](list.html): What the purpose of this list is
1516* [Medication](medication.html): Returns medications for a specific code
1517* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
1518* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
1519* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
1520* [MedicationUsage](medicationusage.html): Return statements of this medication code
1521* [Observation](observation.html): The code of the observation type
1522* [Procedure](procedure.html): A code to identify a  procedure
1523* [ServiceRequest](servicerequest.html): What is being requested/ordered
1524</b><br>
1525   * Type: <b>token</b><br>
1526   * Path: <b>AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code | ServiceRequest.code</b><br>
1527   * </p>
1528   */
1529  @SearchParamDefinition(name="code", path="AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code | ServiceRequest.code", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance\r\n* [Condition](condition.html): Code for the condition\r\n* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered\r\n* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code\r\n* [List](list.html): What the purpose of this list is\r\n* [Medication](medication.html): Returns medications for a specific code\r\n* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code\r\n* [MedicationUsage](medicationusage.html): Return statements of this medication code\r\n* [Observation](observation.html): The code of the observation type\r\n* [Procedure](procedure.html): A code to identify a  procedure\r\n* [ServiceRequest](servicerequest.html): What is being requested/ordered\r\n", type="token" )
1530  public static final String SP_CODE = "code";
1531 /**
1532   * <b>Fluent Client</b> search parameter constant for <b>code</b>
1533   * <p>
1534   * Description: <b>Multiple Resources: 
1535
1536* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
1537* [Condition](condition.html): Code for the condition
1538* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
1539* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result
1540* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
1541* [List](list.html): What the purpose of this list is
1542* [Medication](medication.html): Returns medications for a specific code
1543* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
1544* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
1545* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
1546* [MedicationUsage](medicationusage.html): Return statements of this medication code
1547* [Observation](observation.html): The code of the observation type
1548* [Procedure](procedure.html): A code to identify a  procedure
1549* [ServiceRequest](servicerequest.html): What is being requested/ordered
1550</b><br>
1551   * Type: <b>token</b><br>
1552   * Path: <b>AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code | ServiceRequest.code</b><br>
1553   * </p>
1554   */
1555  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
1556
1557
1558}
1559