001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import ca.uhn.fhir.model.api.annotation.ResourceDef;
038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
039import ca.uhn.fhir.model.api.annotation.Child;
040import ca.uhn.fhir.model.api.annotation.ChildOrder;
041import ca.uhn.fhir.model.api.annotation.Description;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045/**
046 * Information about a medication that is used to support knowledge.
047 */
048@ResourceDef(name="MedicationKnowledge", profile="http://hl7.org/fhir/Profile/MedicationKnowledge")
049public class MedicationKnowledge extends DomainResource {
050
051    public enum MedicationKnowledgeStatus {
052        /**
053         * The medication is available for use
054         */
055        ACTIVE, 
056        /**
057         * The medication is not available for use
058         */
059        INACTIVE, 
060        /**
061         * The medication was entered in error
062         */
063        ENTEREDINERROR, 
064        /**
065         * added to help the parsers with the generic types
066         */
067        NULL;
068        public static MedicationKnowledgeStatus fromCode(String codeString) throws FHIRException {
069            if (codeString == null || "".equals(codeString))
070                return null;
071        if ("active".equals(codeString))
072          return ACTIVE;
073        if ("inactive".equals(codeString))
074          return INACTIVE;
075        if ("entered-in-error".equals(codeString))
076          return ENTEREDINERROR;
077        if (Configuration.isAcceptInvalidEnums())
078          return null;
079        else
080          throw new FHIRException("Unknown MedicationKnowledgeStatus code '"+codeString+"'");
081        }
082        public String toCode() {
083          switch (this) {
084            case ACTIVE: return "active";
085            case INACTIVE: return "inactive";
086            case ENTEREDINERROR: return "entered-in-error";
087            default: return "?";
088          }
089        }
090        public String getSystem() {
091          switch (this) {
092            case ACTIVE: return "http://hl7.org/fhir/medicationKnowledge-status";
093            case INACTIVE: return "http://hl7.org/fhir/medicationKnowledge-status";
094            case ENTEREDINERROR: return "http://hl7.org/fhir/medicationKnowledge-status";
095            default: return "?";
096          }
097        }
098        public String getDefinition() {
099          switch (this) {
100            case ACTIVE: return "The medication is available for use";
101            case INACTIVE: return "The medication is not available for use";
102            case ENTEREDINERROR: return "The medication was entered in error";
103            default: return "?";
104          }
105        }
106        public String getDisplay() {
107          switch (this) {
108            case ACTIVE: return "Active";
109            case INACTIVE: return "Inactive";
110            case ENTEREDINERROR: return "Entered in Error";
111            default: return "?";
112          }
113        }
114    }
115
116  public static class MedicationKnowledgeStatusEnumFactory implements EnumFactory<MedicationKnowledgeStatus> {
117    public MedicationKnowledgeStatus fromCode(String codeString) throws IllegalArgumentException {
118      if (codeString == null || "".equals(codeString))
119            if (codeString == null || "".equals(codeString))
120                return null;
121        if ("active".equals(codeString))
122          return MedicationKnowledgeStatus.ACTIVE;
123        if ("inactive".equals(codeString))
124          return MedicationKnowledgeStatus.INACTIVE;
125        if ("entered-in-error".equals(codeString))
126          return MedicationKnowledgeStatus.ENTEREDINERROR;
127        throw new IllegalArgumentException("Unknown MedicationKnowledgeStatus code '"+codeString+"'");
128        }
129        public Enumeration<MedicationKnowledgeStatus> fromType(Base code) throws FHIRException {
130          if (code == null)
131            return null;
132          if (code.isEmpty())
133            return new Enumeration<MedicationKnowledgeStatus>(this);
134          String codeString = ((PrimitiveType) code).asStringValue();
135          if (codeString == null || "".equals(codeString))
136            return null;
137        if ("active".equals(codeString))
138          return new Enumeration<MedicationKnowledgeStatus>(this, MedicationKnowledgeStatus.ACTIVE);
139        if ("inactive".equals(codeString))
140          return new Enumeration<MedicationKnowledgeStatus>(this, MedicationKnowledgeStatus.INACTIVE);
141        if ("entered-in-error".equals(codeString))
142          return new Enumeration<MedicationKnowledgeStatus>(this, MedicationKnowledgeStatus.ENTEREDINERROR);
143        throw new FHIRException("Unknown MedicationKnowledgeStatus code '"+codeString+"'");
144        }
145    public String toCode(MedicationKnowledgeStatus code) {
146      if (code == MedicationKnowledgeStatus.ACTIVE)
147        return "active";
148      if (code == MedicationKnowledgeStatus.INACTIVE)
149        return "inactive";
150      if (code == MedicationKnowledgeStatus.ENTEREDINERROR)
151        return "entered-in-error";
152      return "?";
153      }
154    public String toSystem(MedicationKnowledgeStatus code) {
155      return code.getSystem();
156      }
157    }
158
159    @Block()
160    public static class MedicationKnowledgeMonographComponent extends BackboneElement implements IBaseBackboneElement {
161        /**
162         * The category of documentation about the medication. (e.g. professional monograph, patient educaton monograph).
163         */
164        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
165        @Description(shortDefinition="The category of medication document", formalDefinition="The category of documentation about the medication. (e.g. professional monograph, patient educaton monograph)." )
166        protected CodeableConcept type;
167
168        /**
169         * Associated documentation about the medication.
170         */
171        @Child(name = "document", type = {DocumentReference.class}, order=2, min=0, max=1, modifier=false, summary=false)
172        @Description(shortDefinition="Associated documentation about the medication", formalDefinition="Associated documentation about the medication." )
173        protected Reference document;
174
175        /**
176         * The actual object that is the target of the reference (Associated documentation about the medication.)
177         */
178        protected DocumentReference documentTarget;
179
180        private static final long serialVersionUID = 2046517217L;
181
182    /**
183     * Constructor
184     */
185      public MedicationKnowledgeMonographComponent() {
186        super();
187      }
188
189        /**
190         * @return {@link #type} (The category of documentation about the medication. (e.g. professional monograph, patient educaton monograph).)
191         */
192        public CodeableConcept getType() { 
193          if (this.type == null)
194            if (Configuration.errorOnAutoCreate())
195              throw new Error("Attempt to auto-create MedicationKnowledgeMonographComponent.type");
196            else if (Configuration.doAutoCreate())
197              this.type = new CodeableConcept(); // cc
198          return this.type;
199        }
200
201        public boolean hasType() { 
202          return this.type != null && !this.type.isEmpty();
203        }
204
205        /**
206         * @param value {@link #type} (The category of documentation about the medication. (e.g. professional monograph, patient educaton monograph).)
207         */
208        public MedicationKnowledgeMonographComponent setType(CodeableConcept value) { 
209          this.type = value;
210          return this;
211        }
212
213        /**
214         * @return {@link #document} (Associated documentation about the medication.)
215         */
216        public Reference getDocument() { 
217          if (this.document == null)
218            if (Configuration.errorOnAutoCreate())
219              throw new Error("Attempt to auto-create MedicationKnowledgeMonographComponent.document");
220            else if (Configuration.doAutoCreate())
221              this.document = new Reference(); // cc
222          return this.document;
223        }
224
225        public boolean hasDocument() { 
226          return this.document != null && !this.document.isEmpty();
227        }
228
229        /**
230         * @param value {@link #document} (Associated documentation about the medication.)
231         */
232        public MedicationKnowledgeMonographComponent setDocument(Reference value) { 
233          this.document = value;
234          return this;
235        }
236
237        /**
238         * @return {@link #document} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Associated documentation about the medication.)
239         */
240        public DocumentReference getDocumentTarget() { 
241          if (this.documentTarget == null)
242            if (Configuration.errorOnAutoCreate())
243              throw new Error("Attempt to auto-create MedicationKnowledgeMonographComponent.document");
244            else if (Configuration.doAutoCreate())
245              this.documentTarget = new DocumentReference(); // aa
246          return this.documentTarget;
247        }
248
249        /**
250         * @param value {@link #document} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Associated documentation about the medication.)
251         */
252        public MedicationKnowledgeMonographComponent setDocumentTarget(DocumentReference value) { 
253          this.documentTarget = value;
254          return this;
255        }
256
257        protected void listChildren(List<Property> children) {
258          super.listChildren(children);
259          children.add(new Property("type", "CodeableConcept", "The category of documentation about the medication. (e.g. professional monograph, patient educaton monograph).", 0, 1, type));
260          children.add(new Property("document", "Reference(DocumentReference)", "Associated documentation about the medication.", 0, 1, document));
261        }
262
263        @Override
264        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
265          switch (_hash) {
266          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The category of documentation about the medication. (e.g. professional monograph, patient educaton monograph).", 0, 1, type);
267          case 861720859: /*document*/  return new Property("document", "Reference(DocumentReference)", "Associated documentation about the medication.", 0, 1, document);
268          default: return super.getNamedProperty(_hash, _name, _checkValid);
269          }
270
271        }
272
273      @Override
274      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
275        switch (hash) {
276        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
277        case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Reference
278        default: return super.getProperty(hash, name, checkValid);
279        }
280
281      }
282
283      @Override
284      public Base setProperty(int hash, String name, Base value) throws FHIRException {
285        switch (hash) {
286        case 3575610: // type
287          this.type = castToCodeableConcept(value); // CodeableConcept
288          return value;
289        case 861720859: // document
290          this.document = castToReference(value); // Reference
291          return value;
292        default: return super.setProperty(hash, name, value);
293        }
294
295      }
296
297      @Override
298      public Base setProperty(String name, Base value) throws FHIRException {
299        if (name.equals("type")) {
300          this.type = castToCodeableConcept(value); // CodeableConcept
301        } else if (name.equals("document")) {
302          this.document = castToReference(value); // Reference
303        } else
304          return super.setProperty(name, value);
305        return value;
306      }
307
308      @Override
309      public Base makeProperty(int hash, String name) throws FHIRException {
310        switch (hash) {
311        case 3575610:  return getType(); 
312        case 861720859:  return getDocument(); 
313        default: return super.makeProperty(hash, name);
314        }
315
316      }
317
318      @Override
319      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
320        switch (hash) {
321        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
322        case 861720859: /*document*/ return new String[] {"Reference"};
323        default: return super.getTypesForProperty(hash, name);
324        }
325
326      }
327
328      @Override
329      public Base addChild(String name) throws FHIRException {
330        if (name.equals("type")) {
331          this.type = new CodeableConcept();
332          return this.type;
333        }
334        else if (name.equals("document")) {
335          this.document = new Reference();
336          return this.document;
337        }
338        else
339          return super.addChild(name);
340      }
341
342      public MedicationKnowledgeMonographComponent copy() {
343        MedicationKnowledgeMonographComponent dst = new MedicationKnowledgeMonographComponent();
344        copyValues(dst);
345        dst.type = type == null ? null : type.copy();
346        dst.document = document == null ? null : document.copy();
347        return dst;
348      }
349
350      @Override
351      public boolean equalsDeep(Base other_) {
352        if (!super.equalsDeep(other_))
353          return false;
354        if (!(other_ instanceof MedicationKnowledgeMonographComponent))
355          return false;
356        MedicationKnowledgeMonographComponent o = (MedicationKnowledgeMonographComponent) other_;
357        return compareDeep(type, o.type, true) && compareDeep(document, o.document, true);
358      }
359
360      @Override
361      public boolean equalsShallow(Base other_) {
362        if (!super.equalsShallow(other_))
363          return false;
364        if (!(other_ instanceof MedicationKnowledgeMonographComponent))
365          return false;
366        MedicationKnowledgeMonographComponent o = (MedicationKnowledgeMonographComponent) other_;
367        return true;
368      }
369
370      public boolean isEmpty() {
371        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, document);
372      }
373
374  public String fhirType() {
375    return "MedicationKnowledge.monograph";
376
377  }
378
379  }
380
381    @Block()
382    public static class MedicationKnowledgeIngredientComponent extends BackboneElement implements IBaseBackboneElement {
383        /**
384         * The actual ingredient - either a substance (simple ingredient) or another medication.
385         */
386        @Child(name = "item", type = {CodeableConcept.class, Substance.class}, order=1, min=1, max=1, modifier=false, summary=false)
387        @Description(shortDefinition="Medication(s) or substance(s) contained in the medication", formalDefinition="The actual ingredient - either a substance (simple ingredient) or another medication." )
388        protected Type item;
389
390        /**
391         * Indication of whether this ingredient affects the therapeutic action of the drug.
392         */
393        @Child(name = "isActive", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
394        @Description(shortDefinition="Active ingredient indicator", formalDefinition="Indication of whether this ingredient affects the therapeutic action of the drug." )
395        protected BooleanType isActive;
396
397        /**
398         * 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.
399         */
400        @Child(name = "strength", type = {Ratio.class}, order=3, min=0, max=1, modifier=false, summary=false)
401        @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." )
402        protected Ratio strength;
403
404        private static final long serialVersionUID = 1365103497L;
405
406    /**
407     * Constructor
408     */
409      public MedicationKnowledgeIngredientComponent() {
410        super();
411      }
412
413    /**
414     * Constructor
415     */
416      public MedicationKnowledgeIngredientComponent(Type item) {
417        super();
418        this.item = item;
419      }
420
421        /**
422         * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.)
423         */
424        public Type getItem() { 
425          return this.item;
426        }
427
428        /**
429         * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.)
430         */
431        public CodeableConcept getItemCodeableConcept() throws FHIRException { 
432          if (this.item == null)
433            return null;
434          if (!(this.item instanceof CodeableConcept))
435            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.item.getClass().getName()+" was encountered");
436          return (CodeableConcept) this.item;
437        }
438
439        public boolean hasItemCodeableConcept() { 
440          return this != null && this.item instanceof CodeableConcept;
441        }
442
443        /**
444         * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.)
445         */
446        public Reference getItemReference() throws FHIRException { 
447          if (this.item == null)
448            return null;
449          if (!(this.item instanceof Reference))
450            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.item.getClass().getName()+" was encountered");
451          return (Reference) this.item;
452        }
453
454        public boolean hasItemReference() { 
455          return this != null && this.item instanceof Reference;
456        }
457
458        public boolean hasItem() { 
459          return this.item != null && !this.item.isEmpty();
460        }
461
462        /**
463         * @param value {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.)
464         */
465        public MedicationKnowledgeIngredientComponent setItem(Type value) { 
466          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
467            throw new Error("Not the right type for MedicationKnowledge.ingredient.item[x]: "+value.fhirType());
468          this.item = value;
469          return this;
470        }
471
472        /**
473         * @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
474         */
475        public BooleanType getIsActiveElement() { 
476          if (this.isActive == null)
477            if (Configuration.errorOnAutoCreate())
478              throw new Error("Attempt to auto-create MedicationKnowledgeIngredientComponent.isActive");
479            else if (Configuration.doAutoCreate())
480              this.isActive = new BooleanType(); // bb
481          return this.isActive;
482        }
483
484        public boolean hasIsActiveElement() { 
485          return this.isActive != null && !this.isActive.isEmpty();
486        }
487
488        public boolean hasIsActive() { 
489          return this.isActive != null && !this.isActive.isEmpty();
490        }
491
492        /**
493         * @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
494         */
495        public MedicationKnowledgeIngredientComponent setIsActiveElement(BooleanType value) { 
496          this.isActive = value;
497          return this;
498        }
499
500        /**
501         * @return Indication of whether this ingredient affects the therapeutic action of the drug.
502         */
503        public boolean getIsActive() { 
504          return this.isActive == null || this.isActive.isEmpty() ? false : this.isActive.getValue();
505        }
506
507        /**
508         * @param value Indication of whether this ingredient affects the therapeutic action of the drug.
509         */
510        public MedicationKnowledgeIngredientComponent setIsActive(boolean value) { 
511            if (this.isActive == null)
512              this.isActive = new BooleanType();
513            this.isActive.setValue(value);
514          return this;
515        }
516
517        /**
518         * @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.)
519         */
520        public Ratio getStrength() { 
521          if (this.strength == null)
522            if (Configuration.errorOnAutoCreate())
523              throw new Error("Attempt to auto-create MedicationKnowledgeIngredientComponent.strength");
524            else if (Configuration.doAutoCreate())
525              this.strength = new Ratio(); // cc
526          return this.strength;
527        }
528
529        public boolean hasStrength() { 
530          return this.strength != null && !this.strength.isEmpty();
531        }
532
533        /**
534         * @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.)
535         */
536        public MedicationKnowledgeIngredientComponent setStrength(Ratio value) { 
537          this.strength = value;
538          return this;
539        }
540
541        protected void listChildren(List<Property> children) {
542          super.listChildren(children);
543          children.add(new Property("item[x]", "CodeableConcept|Reference(Substance)", "The actual ingredient - either a substance (simple ingredient) or another medication.", 0, 1, item));
544          children.add(new Property("isActive", "boolean", "Indication of whether this ingredient affects the therapeutic action of the drug.", 0, 1, isActive));
545          children.add(new Property("strength", "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.", 0, 1, strength));
546        }
547
548        @Override
549        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
550          switch (_hash) {
551          case 2116201613: /*item[x]*/  return new Property("item[x]", "CodeableConcept|Reference(Substance)", "The actual ingredient - either a substance (simple ingredient) or another medication.", 0, 1, item);
552          case 3242771: /*item*/  return new Property("item[x]", "CodeableConcept|Reference(Substance)", "The actual ingredient - either a substance (simple ingredient) or another medication.", 0, 1, item);
553          case 106644494: /*itemCodeableConcept*/  return new Property("item[x]", "CodeableConcept|Reference(Substance)", "The actual ingredient - either a substance (simple ingredient) or another medication.", 0, 1, item);
554          case 1376364920: /*itemReference*/  return new Property("item[x]", "CodeableConcept|Reference(Substance)", "The actual ingredient - either a substance (simple ingredient) or another medication.", 0, 1, item);
555          case -748916528: /*isActive*/  return new Property("isActive", "boolean", "Indication of whether this ingredient affects the therapeutic action of the drug.", 0, 1, isActive);
556          case 1791316033: /*strength*/  return new Property("strength", "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.", 0, 1, strength);
557          default: return super.getNamedProperty(_hash, _name, _checkValid);
558          }
559
560        }
561
562      @Override
563      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
564        switch (hash) {
565        case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // Type
566        case -748916528: /*isActive*/ return this.isActive == null ? new Base[0] : new Base[] {this.isActive}; // BooleanType
567        case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : new Base[] {this.strength}; // Ratio
568        default: return super.getProperty(hash, name, checkValid);
569        }
570
571      }
572
573      @Override
574      public Base setProperty(int hash, String name, Base value) throws FHIRException {
575        switch (hash) {
576        case 3242771: // item
577          this.item = castToType(value); // Type
578          return value;
579        case -748916528: // isActive
580          this.isActive = castToBoolean(value); // BooleanType
581          return value;
582        case 1791316033: // strength
583          this.strength = castToRatio(value); // Ratio
584          return value;
585        default: return super.setProperty(hash, name, value);
586        }
587
588      }
589
590      @Override
591      public Base setProperty(String name, Base value) throws FHIRException {
592        if (name.equals("item[x]")) {
593          this.item = castToType(value); // Type
594        } else if (name.equals("isActive")) {
595          this.isActive = castToBoolean(value); // BooleanType
596        } else if (name.equals("strength")) {
597          this.strength = castToRatio(value); // Ratio
598        } else
599          return super.setProperty(name, value);
600        return value;
601      }
602
603      @Override
604      public Base makeProperty(int hash, String name) throws FHIRException {
605        switch (hash) {
606        case 2116201613:  return getItem(); 
607        case 3242771:  return getItem(); 
608        case -748916528:  return getIsActiveElement();
609        case 1791316033:  return getStrength(); 
610        default: return super.makeProperty(hash, name);
611        }
612
613      }
614
615      @Override
616      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
617        switch (hash) {
618        case 3242771: /*item*/ return new String[] {"CodeableConcept", "Reference"};
619        case -748916528: /*isActive*/ return new String[] {"boolean"};
620        case 1791316033: /*strength*/ return new String[] {"Ratio"};
621        default: return super.getTypesForProperty(hash, name);
622        }
623
624      }
625
626      @Override
627      public Base addChild(String name) throws FHIRException {
628        if (name.equals("itemCodeableConcept")) {
629          this.item = new CodeableConcept();
630          return this.item;
631        }
632        else if (name.equals("itemReference")) {
633          this.item = new Reference();
634          return this.item;
635        }
636        else if (name.equals("isActive")) {
637          throw new FHIRException("Cannot call addChild on a primitive type MedicationKnowledge.isActive");
638        }
639        else if (name.equals("strength")) {
640          this.strength = new Ratio();
641          return this.strength;
642        }
643        else
644          return super.addChild(name);
645      }
646
647      public MedicationKnowledgeIngredientComponent copy() {
648        MedicationKnowledgeIngredientComponent dst = new MedicationKnowledgeIngredientComponent();
649        copyValues(dst);
650        dst.item = item == null ? null : item.copy();
651        dst.isActive = isActive == null ? null : isActive.copy();
652        dst.strength = strength == null ? null : strength.copy();
653        return dst;
654      }
655
656      @Override
657      public boolean equalsDeep(Base other_) {
658        if (!super.equalsDeep(other_))
659          return false;
660        if (!(other_ instanceof MedicationKnowledgeIngredientComponent))
661          return false;
662        MedicationKnowledgeIngredientComponent o = (MedicationKnowledgeIngredientComponent) other_;
663        return compareDeep(item, o.item, true) && compareDeep(isActive, o.isActive, true) && compareDeep(strength, o.strength, true)
664          ;
665      }
666
667      @Override
668      public boolean equalsShallow(Base other_) {
669        if (!super.equalsShallow(other_))
670          return false;
671        if (!(other_ instanceof MedicationKnowledgeIngredientComponent))
672          return false;
673        MedicationKnowledgeIngredientComponent o = (MedicationKnowledgeIngredientComponent) other_;
674        return compareValues(isActive, o.isActive, true);
675      }
676
677      public boolean isEmpty() {
678        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(item, isActive, strength
679          );
680      }
681
682  public String fhirType() {
683    return "MedicationKnowledge.ingredient";
684
685  }
686
687  }
688
689    @Block()
690    public static class MedicationKnowledgeCostComponent extends BackboneElement implements IBaseBackboneElement {
691        /**
692         * The category of the cost information.  For example, manufacturers' cost, patient cost, claim reimbursement cost, actual acquisition cost.
693         */
694        @Child(name = "type", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
695        @Description(shortDefinition="The category of the cost information", formalDefinition="The category of the cost information.  For example, manufacturers' cost, patient cost, claim reimbursement cost, actual acquisition cost." )
696        protected StringType type;
697
698        /**
699         * The source or owner that assigns the price to the medication.
700         */
701        @Child(name = "source", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
702        @Description(shortDefinition="The source or owner for the price information", formalDefinition="The source or owner that assigns the price to the medication." )
703        protected StringType source;
704
705        /**
706         * The price of the medication.
707         */
708        @Child(name = "cost", type = {Money.class}, order=3, min=1, max=1, modifier=false, summary=false)
709        @Description(shortDefinition="The price of the medication", formalDefinition="The price of the medication." )
710        protected Money cost;
711
712        private static final long serialVersionUID = 1750634148L;
713
714    /**
715     * Constructor
716     */
717      public MedicationKnowledgeCostComponent() {
718        super();
719      }
720
721    /**
722     * Constructor
723     */
724      public MedicationKnowledgeCostComponent(StringType type, Money cost) {
725        super();
726        this.type = type;
727        this.cost = cost;
728      }
729
730        /**
731         * @return {@link #type} (The category of the cost information.  For example, manufacturers' cost, patient cost, claim reimbursement cost, actual acquisition cost.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
732         */
733        public StringType getTypeElement() { 
734          if (this.type == null)
735            if (Configuration.errorOnAutoCreate())
736              throw new Error("Attempt to auto-create MedicationKnowledgeCostComponent.type");
737            else if (Configuration.doAutoCreate())
738              this.type = new StringType(); // bb
739          return this.type;
740        }
741
742        public boolean hasTypeElement() { 
743          return this.type != null && !this.type.isEmpty();
744        }
745
746        public boolean hasType() { 
747          return this.type != null && !this.type.isEmpty();
748        }
749
750        /**
751         * @param value {@link #type} (The category of the cost information.  For example, manufacturers' cost, patient cost, claim reimbursement cost, actual acquisition cost.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
752         */
753        public MedicationKnowledgeCostComponent setTypeElement(StringType value) { 
754          this.type = value;
755          return this;
756        }
757
758        /**
759         * @return The category of the cost information.  For example, manufacturers' cost, patient cost, claim reimbursement cost, actual acquisition cost.
760         */
761        public String getType() { 
762          return this.type == null ? null : this.type.getValue();
763        }
764
765        /**
766         * @param value The category of the cost information.  For example, manufacturers' cost, patient cost, claim reimbursement cost, actual acquisition cost.
767         */
768        public MedicationKnowledgeCostComponent setType(String value) { 
769            if (this.type == null)
770              this.type = new StringType();
771            this.type.setValue(value);
772          return this;
773        }
774
775        /**
776         * @return {@link #source} (The source or owner that assigns the price to the medication.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value
777         */
778        public StringType getSourceElement() { 
779          if (this.source == null)
780            if (Configuration.errorOnAutoCreate())
781              throw new Error("Attempt to auto-create MedicationKnowledgeCostComponent.source");
782            else if (Configuration.doAutoCreate())
783              this.source = new StringType(); // bb
784          return this.source;
785        }
786
787        public boolean hasSourceElement() { 
788          return this.source != null && !this.source.isEmpty();
789        }
790
791        public boolean hasSource() { 
792          return this.source != null && !this.source.isEmpty();
793        }
794
795        /**
796         * @param value {@link #source} (The source or owner that assigns the price to the medication.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value
797         */
798        public MedicationKnowledgeCostComponent setSourceElement(StringType value) { 
799          this.source = value;
800          return this;
801        }
802
803        /**
804         * @return The source or owner that assigns the price to the medication.
805         */
806        public String getSource() { 
807          return this.source == null ? null : this.source.getValue();
808        }
809
810        /**
811         * @param value The source or owner that assigns the price to the medication.
812         */
813        public MedicationKnowledgeCostComponent setSource(String value) { 
814          if (Utilities.noString(value))
815            this.source = null;
816          else {
817            if (this.source == null)
818              this.source = new StringType();
819            this.source.setValue(value);
820          }
821          return this;
822        }
823
824        /**
825         * @return {@link #cost} (The price of the medication.)
826         */
827        public Money getCost() { 
828          if (this.cost == null)
829            if (Configuration.errorOnAutoCreate())
830              throw new Error("Attempt to auto-create MedicationKnowledgeCostComponent.cost");
831            else if (Configuration.doAutoCreate())
832              this.cost = new Money(); // cc
833          return this.cost;
834        }
835
836        public boolean hasCost() { 
837          return this.cost != null && !this.cost.isEmpty();
838        }
839
840        /**
841         * @param value {@link #cost} (The price of the medication.)
842         */
843        public MedicationKnowledgeCostComponent setCost(Money value) { 
844          this.cost = value;
845          return this;
846        }
847
848        protected void listChildren(List<Property> children) {
849          super.listChildren(children);
850          children.add(new Property("type", "string", "The category of the cost information.  For example, manufacturers' cost, patient cost, claim reimbursement cost, actual acquisition cost.", 0, 1, type));
851          children.add(new Property("source", "string", "The source or owner that assigns the price to the medication.", 0, 1, source));
852          children.add(new Property("cost", "Money", "The price of the medication.", 0, 1, cost));
853        }
854
855        @Override
856        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
857          switch (_hash) {
858          case 3575610: /*type*/  return new Property("type", "string", "The category of the cost information.  For example, manufacturers' cost, patient cost, claim reimbursement cost, actual acquisition cost.", 0, 1, type);
859          case -896505829: /*source*/  return new Property("source", "string", "The source or owner that assigns the price to the medication.", 0, 1, source);
860          case 3059661: /*cost*/  return new Property("cost", "Money", "The price of the medication.", 0, 1, cost);
861          default: return super.getNamedProperty(_hash, _name, _checkValid);
862          }
863
864        }
865
866      @Override
867      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
868        switch (hash) {
869        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // StringType
870        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // StringType
871        case 3059661: /*cost*/ return this.cost == null ? new Base[0] : new Base[] {this.cost}; // Money
872        default: return super.getProperty(hash, name, checkValid);
873        }
874
875      }
876
877      @Override
878      public Base setProperty(int hash, String name, Base value) throws FHIRException {
879        switch (hash) {
880        case 3575610: // type
881          this.type = castToString(value); // StringType
882          return value;
883        case -896505829: // source
884          this.source = castToString(value); // StringType
885          return value;
886        case 3059661: // cost
887          this.cost = castToMoney(value); // Money
888          return value;
889        default: return super.setProperty(hash, name, value);
890        }
891
892      }
893
894      @Override
895      public Base setProperty(String name, Base value) throws FHIRException {
896        if (name.equals("type")) {
897          this.type = castToString(value); // StringType
898        } else if (name.equals("source")) {
899          this.source = castToString(value); // StringType
900        } else if (name.equals("cost")) {
901          this.cost = castToMoney(value); // Money
902        } else
903          return super.setProperty(name, value);
904        return value;
905      }
906
907      @Override
908      public Base makeProperty(int hash, String name) throws FHIRException {
909        switch (hash) {
910        case 3575610:  return getTypeElement();
911        case -896505829:  return getSourceElement();
912        case 3059661:  return getCost(); 
913        default: return super.makeProperty(hash, name);
914        }
915
916      }
917
918      @Override
919      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
920        switch (hash) {
921        case 3575610: /*type*/ return new String[] {"string"};
922        case -896505829: /*source*/ return new String[] {"string"};
923        case 3059661: /*cost*/ return new String[] {"Money"};
924        default: return super.getTypesForProperty(hash, name);
925        }
926
927      }
928
929      @Override
930      public Base addChild(String name) throws FHIRException {
931        if (name.equals("type")) {
932          throw new FHIRException("Cannot call addChild on a primitive type MedicationKnowledge.type");
933        }
934        else if (name.equals("source")) {
935          throw new FHIRException("Cannot call addChild on a primitive type MedicationKnowledge.source");
936        }
937        else if (name.equals("cost")) {
938          this.cost = new Money();
939          return this.cost;
940        }
941        else
942          return super.addChild(name);
943      }
944
945      public MedicationKnowledgeCostComponent copy() {
946        MedicationKnowledgeCostComponent dst = new MedicationKnowledgeCostComponent();
947        copyValues(dst);
948        dst.type = type == null ? null : type.copy();
949        dst.source = source == null ? null : source.copy();
950        dst.cost = cost == null ? null : cost.copy();
951        return dst;
952      }
953
954      @Override
955      public boolean equalsDeep(Base other_) {
956        if (!super.equalsDeep(other_))
957          return false;
958        if (!(other_ instanceof MedicationKnowledgeCostComponent))
959          return false;
960        MedicationKnowledgeCostComponent o = (MedicationKnowledgeCostComponent) other_;
961        return compareDeep(type, o.type, true) && compareDeep(source, o.source, true) && compareDeep(cost, o.cost, true)
962          ;
963      }
964
965      @Override
966      public boolean equalsShallow(Base other_) {
967        if (!super.equalsShallow(other_))
968          return false;
969        if (!(other_ instanceof MedicationKnowledgeCostComponent))
970          return false;
971        MedicationKnowledgeCostComponent o = (MedicationKnowledgeCostComponent) other_;
972        return compareValues(type, o.type, true) && compareValues(source, o.source, true);
973      }
974
975      public boolean isEmpty() {
976        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, source, cost);
977      }
978
979  public String fhirType() {
980    return "MedicationKnowledge.cost";
981
982  }
983
984  }
985
986    @Block()
987    public static class MedicationKnowledgeMonitoringProgramComponent extends BackboneElement implements IBaseBackboneElement {
988        /**
989         * Type of program under which the medication is monitored.
990         */
991        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
992        @Description(shortDefinition="Type of program under which the medication is monitored", formalDefinition="Type of program under which the medication is monitored." )
993        protected CodeableConcept type;
994
995        /**
996         * Name of the reviewing program.
997         */
998        @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
999        @Description(shortDefinition="Name of the reviewing program", formalDefinition="Name of the reviewing program." )
1000        protected StringType name;
1001
1002        private static final long serialVersionUID = -280346281L;
1003
1004    /**
1005     * Constructor
1006     */
1007      public MedicationKnowledgeMonitoringProgramComponent() {
1008        super();
1009      }
1010
1011        /**
1012         * @return {@link #type} (Type of program under which the medication is monitored.)
1013         */
1014        public CodeableConcept getType() { 
1015          if (this.type == null)
1016            if (Configuration.errorOnAutoCreate())
1017              throw new Error("Attempt to auto-create MedicationKnowledgeMonitoringProgramComponent.type");
1018            else if (Configuration.doAutoCreate())
1019              this.type = new CodeableConcept(); // cc
1020          return this.type;
1021        }
1022
1023        public boolean hasType() { 
1024          return this.type != null && !this.type.isEmpty();
1025        }
1026
1027        /**
1028         * @param value {@link #type} (Type of program under which the medication is monitored.)
1029         */
1030        public MedicationKnowledgeMonitoringProgramComponent setType(CodeableConcept value) { 
1031          this.type = value;
1032          return this;
1033        }
1034
1035        /**
1036         * @return {@link #name} (Name of the reviewing program.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1037         */
1038        public StringType getNameElement() { 
1039          if (this.name == null)
1040            if (Configuration.errorOnAutoCreate())
1041              throw new Error("Attempt to auto-create MedicationKnowledgeMonitoringProgramComponent.name");
1042            else if (Configuration.doAutoCreate())
1043              this.name = new StringType(); // bb
1044          return this.name;
1045        }
1046
1047        public boolean hasNameElement() { 
1048          return this.name != null && !this.name.isEmpty();
1049        }
1050
1051        public boolean hasName() { 
1052          return this.name != null && !this.name.isEmpty();
1053        }
1054
1055        /**
1056         * @param value {@link #name} (Name of the reviewing program.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1057         */
1058        public MedicationKnowledgeMonitoringProgramComponent setNameElement(StringType value) { 
1059          this.name = value;
1060          return this;
1061        }
1062
1063        /**
1064         * @return Name of the reviewing program.
1065         */
1066        public String getName() { 
1067          return this.name == null ? null : this.name.getValue();
1068        }
1069
1070        /**
1071         * @param value Name of the reviewing program.
1072         */
1073        public MedicationKnowledgeMonitoringProgramComponent setName(String value) { 
1074          if (Utilities.noString(value))
1075            this.name = null;
1076          else {
1077            if (this.name == null)
1078              this.name = new StringType();
1079            this.name.setValue(value);
1080          }
1081          return this;
1082        }
1083
1084        protected void listChildren(List<Property> children) {
1085          super.listChildren(children);
1086          children.add(new Property("type", "CodeableConcept", "Type of program under which the medication is monitored.", 0, 1, type));
1087          children.add(new Property("name", "string", "Name of the reviewing program.", 0, 1, name));
1088        }
1089
1090        @Override
1091        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1092          switch (_hash) {
1093          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of program under which the medication is monitored.", 0, 1, type);
1094          case 3373707: /*name*/  return new Property("name", "string", "Name of the reviewing program.", 0, 1, name);
1095          default: return super.getNamedProperty(_hash, _name, _checkValid);
1096          }
1097
1098        }
1099
1100      @Override
1101      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1102        switch (hash) {
1103        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1104        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1105        default: return super.getProperty(hash, name, checkValid);
1106        }
1107
1108      }
1109
1110      @Override
1111      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1112        switch (hash) {
1113        case 3575610: // type
1114          this.type = castToCodeableConcept(value); // CodeableConcept
1115          return value;
1116        case 3373707: // name
1117          this.name = castToString(value); // StringType
1118          return value;
1119        default: return super.setProperty(hash, name, value);
1120        }
1121
1122      }
1123
1124      @Override
1125      public Base setProperty(String name, Base value) throws FHIRException {
1126        if (name.equals("type")) {
1127          this.type = castToCodeableConcept(value); // CodeableConcept
1128        } else if (name.equals("name")) {
1129          this.name = castToString(value); // StringType
1130        } else
1131          return super.setProperty(name, value);
1132        return value;
1133      }
1134
1135      @Override
1136      public Base makeProperty(int hash, String name) throws FHIRException {
1137        switch (hash) {
1138        case 3575610:  return getType(); 
1139        case 3373707:  return getNameElement();
1140        default: return super.makeProperty(hash, name);
1141        }
1142
1143      }
1144
1145      @Override
1146      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1147        switch (hash) {
1148        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1149        case 3373707: /*name*/ return new String[] {"string"};
1150        default: return super.getTypesForProperty(hash, name);
1151        }
1152
1153      }
1154
1155      @Override
1156      public Base addChild(String name) throws FHIRException {
1157        if (name.equals("type")) {
1158          this.type = new CodeableConcept();
1159          return this.type;
1160        }
1161        else if (name.equals("name")) {
1162          throw new FHIRException("Cannot call addChild on a primitive type MedicationKnowledge.name");
1163        }
1164        else
1165          return super.addChild(name);
1166      }
1167
1168      public MedicationKnowledgeMonitoringProgramComponent copy() {
1169        MedicationKnowledgeMonitoringProgramComponent dst = new MedicationKnowledgeMonitoringProgramComponent();
1170        copyValues(dst);
1171        dst.type = type == null ? null : type.copy();
1172        dst.name = name == null ? null : name.copy();
1173        return dst;
1174      }
1175
1176      @Override
1177      public boolean equalsDeep(Base other_) {
1178        if (!super.equalsDeep(other_))
1179          return false;
1180        if (!(other_ instanceof MedicationKnowledgeMonitoringProgramComponent))
1181          return false;
1182        MedicationKnowledgeMonitoringProgramComponent o = (MedicationKnowledgeMonitoringProgramComponent) other_;
1183        return compareDeep(type, o.type, true) && compareDeep(name, o.name, true);
1184      }
1185
1186      @Override
1187      public boolean equalsShallow(Base other_) {
1188        if (!super.equalsShallow(other_))
1189          return false;
1190        if (!(other_ instanceof MedicationKnowledgeMonitoringProgramComponent))
1191          return false;
1192        MedicationKnowledgeMonitoringProgramComponent o = (MedicationKnowledgeMonitoringProgramComponent) other_;
1193        return compareValues(name, o.name, true);
1194      }
1195
1196      public boolean isEmpty() {
1197        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, name);
1198      }
1199
1200  public String fhirType() {
1201    return "MedicationKnowledge.monitoringProgram";
1202
1203  }
1204
1205  }
1206
1207    @Block()
1208    public static class MedicationKnowledgeAdministrationGuidelinesComponent extends BackboneElement implements IBaseBackboneElement {
1209        /**
1210         * Dosage for the medication for the specific guidelines.
1211         */
1212        @Child(name = "dosage", type = {Dosage.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1213        @Description(shortDefinition="Dosage for the medication for the specific guidelines", formalDefinition="Dosage for the medication for the specific guidelines." )
1214        protected List<Dosage> dosage;
1215
1216        /**
1217         * Indication for use that apply to the specific administration guidelines.
1218         */
1219        @Child(name = "indication", type = {CodeableConcept.class, ObservationDefinition.class}, order=2, min=0, max=1, modifier=false, summary=false)
1220        @Description(shortDefinition="Indication for use that apply to the specific administration guidelines", formalDefinition="Indication for use that apply to the specific administration guidelines." )
1221        protected Type indication;
1222
1223        /**
1224         * Characteristics of the patient that are relevant to the administration guidelines (for example, height, weight,gender,  etc).
1225         */
1226        @Child(name = "patientCharacteristics", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1227        @Description(shortDefinition="Characteristics of the patient that are relevant to the administration guidelines", formalDefinition="Characteristics of the patient that are relevant to the administration guidelines (for example, height, weight,gender,  etc)." )
1228        protected List<MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent> patientCharacteristics;
1229
1230        private static final long serialVersionUID = -685386015L;
1231
1232    /**
1233     * Constructor
1234     */
1235      public MedicationKnowledgeAdministrationGuidelinesComponent() {
1236        super();
1237      }
1238
1239        /**
1240         * @return {@link #dosage} (Dosage for the medication for the specific guidelines.)
1241         */
1242        public List<Dosage> getDosage() { 
1243          if (this.dosage == null)
1244            this.dosage = new ArrayList<Dosage>();
1245          return this.dosage;
1246        }
1247
1248        /**
1249         * @return Returns a reference to <code>this</code> for easy method chaining
1250         */
1251        public MedicationKnowledgeAdministrationGuidelinesComponent setDosage(List<Dosage> theDosage) { 
1252          this.dosage = theDosage;
1253          return this;
1254        }
1255
1256        public boolean hasDosage() { 
1257          if (this.dosage == null)
1258            return false;
1259          for (Dosage item : this.dosage)
1260            if (!item.isEmpty())
1261              return true;
1262          return false;
1263        }
1264
1265        public Dosage addDosage() { //3
1266          Dosage t = new Dosage();
1267          if (this.dosage == null)
1268            this.dosage = new ArrayList<Dosage>();
1269          this.dosage.add(t);
1270          return t;
1271        }
1272
1273        public MedicationKnowledgeAdministrationGuidelinesComponent addDosage(Dosage t) { //3
1274          if (t == null)
1275            return this;
1276          if (this.dosage == null)
1277            this.dosage = new ArrayList<Dosage>();
1278          this.dosage.add(t);
1279          return this;
1280        }
1281
1282        /**
1283         * @return The first repetition of repeating field {@link #dosage}, creating it if it does not already exist
1284         */
1285        public Dosage getDosageFirstRep() { 
1286          if (getDosage().isEmpty()) {
1287            addDosage();
1288          }
1289          return getDosage().get(0);
1290        }
1291
1292        /**
1293         * @return {@link #indication} (Indication for use that apply to the specific administration guidelines.)
1294         */
1295        public Type getIndication() { 
1296          return this.indication;
1297        }
1298
1299        /**
1300         * @return {@link #indication} (Indication for use that apply to the specific administration guidelines.)
1301         */
1302        public CodeableConcept getIndicationCodeableConcept() throws FHIRException { 
1303          if (this.indication == null)
1304            return null;
1305          if (!(this.indication instanceof CodeableConcept))
1306            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.indication.getClass().getName()+" was encountered");
1307          return (CodeableConcept) this.indication;
1308        }
1309
1310        public boolean hasIndicationCodeableConcept() { 
1311          return this != null && this.indication instanceof CodeableConcept;
1312        }
1313
1314        /**
1315         * @return {@link #indication} (Indication for use that apply to the specific administration guidelines.)
1316         */
1317        public Reference getIndicationReference() throws FHIRException { 
1318          if (this.indication == null)
1319            return null;
1320          if (!(this.indication instanceof Reference))
1321            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.indication.getClass().getName()+" was encountered");
1322          return (Reference) this.indication;
1323        }
1324
1325        public boolean hasIndicationReference() { 
1326          return this != null && this.indication instanceof Reference;
1327        }
1328
1329        public boolean hasIndication() { 
1330          return this.indication != null && !this.indication.isEmpty();
1331        }
1332
1333        /**
1334         * @param value {@link #indication} (Indication for use that apply to the specific administration guidelines.)
1335         */
1336        public MedicationKnowledgeAdministrationGuidelinesComponent setIndication(Type value) { 
1337          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
1338            throw new Error("Not the right type for MedicationKnowledge.administrationGuidelines.indication[x]: "+value.fhirType());
1339          this.indication = value;
1340          return this;
1341        }
1342
1343        /**
1344         * @return {@link #patientCharacteristics} (Characteristics of the patient that are relevant to the administration guidelines (for example, height, weight,gender,  etc).)
1345         */
1346        public List<MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent> getPatientCharacteristics() { 
1347          if (this.patientCharacteristics == null)
1348            this.patientCharacteristics = new ArrayList<MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent>();
1349          return this.patientCharacteristics;
1350        }
1351
1352        /**
1353         * @return Returns a reference to <code>this</code> for easy method chaining
1354         */
1355        public MedicationKnowledgeAdministrationGuidelinesComponent setPatientCharacteristics(List<MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent> thePatientCharacteristics) { 
1356          this.patientCharacteristics = thePatientCharacteristics;
1357          return this;
1358        }
1359
1360        public boolean hasPatientCharacteristics() { 
1361          if (this.patientCharacteristics == null)
1362            return false;
1363          for (MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent item : this.patientCharacteristics)
1364            if (!item.isEmpty())
1365              return true;
1366          return false;
1367        }
1368
1369        public MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent addPatientCharacteristics() { //3
1370          MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent t = new MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent();
1371          if (this.patientCharacteristics == null)
1372            this.patientCharacteristics = new ArrayList<MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent>();
1373          this.patientCharacteristics.add(t);
1374          return t;
1375        }
1376
1377        public MedicationKnowledgeAdministrationGuidelinesComponent addPatientCharacteristics(MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent t) { //3
1378          if (t == null)
1379            return this;
1380          if (this.patientCharacteristics == null)
1381            this.patientCharacteristics = new ArrayList<MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent>();
1382          this.patientCharacteristics.add(t);
1383          return this;
1384        }
1385
1386        /**
1387         * @return The first repetition of repeating field {@link #patientCharacteristics}, creating it if it does not already exist
1388         */
1389        public MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent getPatientCharacteristicsFirstRep() { 
1390          if (getPatientCharacteristics().isEmpty()) {
1391            addPatientCharacteristics();
1392          }
1393          return getPatientCharacteristics().get(0);
1394        }
1395
1396        protected void listChildren(List<Property> children) {
1397          super.listChildren(children);
1398          children.add(new Property("dosage", "Dosage", "Dosage for the medication for the specific guidelines.", 0, java.lang.Integer.MAX_VALUE, dosage));
1399          children.add(new Property("indication[x]", "CodeableConcept|Reference(ObservationDefinition)", "Indication for use that apply to the specific administration guidelines.", 0, 1, indication));
1400          children.add(new Property("patientCharacteristics", "", "Characteristics of the patient that are relevant to the administration guidelines (for example, height, weight,gender,  etc).", 0, java.lang.Integer.MAX_VALUE, patientCharacteristics));
1401        }
1402
1403        @Override
1404        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1405          switch (_hash) {
1406          case -1326018889: /*dosage*/  return new Property("dosage", "Dosage", "Dosage for the medication for the specific guidelines.", 0, java.lang.Integer.MAX_VALUE, dosage);
1407          case -501208668: /*indication[x]*/  return new Property("indication[x]", "CodeableConcept|Reference(ObservationDefinition)", "Indication for use that apply to the specific administration guidelines.", 0, 1, indication);
1408          case -597168804: /*indication*/  return new Property("indication[x]", "CodeableConcept|Reference(ObservationDefinition)", "Indication for use that apply to the specific administration guidelines.", 0, 1, indication);
1409          case -1094003035: /*indicationCodeableConcept*/  return new Property("indication[x]", "CodeableConcept|Reference(ObservationDefinition)", "Indication for use that apply to the specific administration guidelines.", 0, 1, indication);
1410          case 803518799: /*indicationReference*/  return new Property("indication[x]", "CodeableConcept|Reference(ObservationDefinition)", "Indication for use that apply to the specific administration guidelines.", 0, 1, indication);
1411          case -960531341: /*patientCharacteristics*/  return new Property("patientCharacteristics", "", "Characteristics of the patient that are relevant to the administration guidelines (for example, height, weight,gender,  etc).", 0, java.lang.Integer.MAX_VALUE, patientCharacteristics);
1412          default: return super.getNamedProperty(_hash, _name, _checkValid);
1413          }
1414
1415        }
1416
1417      @Override
1418      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1419        switch (hash) {
1420        case -1326018889: /*dosage*/ return this.dosage == null ? new Base[0] : this.dosage.toArray(new Base[this.dosage.size()]); // Dosage
1421        case -597168804: /*indication*/ return this.indication == null ? new Base[0] : new Base[] {this.indication}; // Type
1422        case -960531341: /*patientCharacteristics*/ return this.patientCharacteristics == null ? new Base[0] : this.patientCharacteristics.toArray(new Base[this.patientCharacteristics.size()]); // MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent
1423        default: return super.getProperty(hash, name, checkValid);
1424        }
1425
1426      }
1427
1428      @Override
1429      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1430        switch (hash) {
1431        case -1326018889: // dosage
1432          this.getDosage().add(castToDosage(value)); // Dosage
1433          return value;
1434        case -597168804: // indication
1435          this.indication = castToType(value); // Type
1436          return value;
1437        case -960531341: // patientCharacteristics
1438          this.getPatientCharacteristics().add((MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent) value); // MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent
1439          return value;
1440        default: return super.setProperty(hash, name, value);
1441        }
1442
1443      }
1444
1445      @Override
1446      public Base setProperty(String name, Base value) throws FHIRException {
1447        if (name.equals("dosage")) {
1448          this.getDosage().add(castToDosage(value));
1449        } else if (name.equals("indication[x]")) {
1450          this.indication = castToType(value); // Type
1451        } else if (name.equals("patientCharacteristics")) {
1452          this.getPatientCharacteristics().add((MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent) value);
1453        } else
1454          return super.setProperty(name, value);
1455        return value;
1456      }
1457
1458      @Override
1459      public Base makeProperty(int hash, String name) throws FHIRException {
1460        switch (hash) {
1461        case -1326018889:  return addDosage(); 
1462        case -501208668:  return getIndication(); 
1463        case -597168804:  return getIndication(); 
1464        case -960531341:  return addPatientCharacteristics(); 
1465        default: return super.makeProperty(hash, name);
1466        }
1467
1468      }
1469
1470      @Override
1471      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1472        switch (hash) {
1473        case -1326018889: /*dosage*/ return new String[] {"Dosage"};
1474        case -597168804: /*indication*/ return new String[] {"CodeableConcept", "Reference"};
1475        case -960531341: /*patientCharacteristics*/ return new String[] {};
1476        default: return super.getTypesForProperty(hash, name);
1477        }
1478
1479      }
1480
1481      @Override
1482      public Base addChild(String name) throws FHIRException {
1483        if (name.equals("dosage")) {
1484          return addDosage();
1485        }
1486        else if (name.equals("indicationCodeableConcept")) {
1487          this.indication = new CodeableConcept();
1488          return this.indication;
1489        }
1490        else if (name.equals("indicationReference")) {
1491          this.indication = new Reference();
1492          return this.indication;
1493        }
1494        else if (name.equals("patientCharacteristics")) {
1495          return addPatientCharacteristics();
1496        }
1497        else
1498          return super.addChild(name);
1499      }
1500
1501      public MedicationKnowledgeAdministrationGuidelinesComponent copy() {
1502        MedicationKnowledgeAdministrationGuidelinesComponent dst = new MedicationKnowledgeAdministrationGuidelinesComponent();
1503        copyValues(dst);
1504        if (dosage != null) {
1505          dst.dosage = new ArrayList<Dosage>();
1506          for (Dosage i : dosage)
1507            dst.dosage.add(i.copy());
1508        };
1509        dst.indication = indication == null ? null : indication.copy();
1510        if (patientCharacteristics != null) {
1511          dst.patientCharacteristics = new ArrayList<MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent>();
1512          for (MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent i : patientCharacteristics)
1513            dst.patientCharacteristics.add(i.copy());
1514        };
1515        return dst;
1516      }
1517
1518      @Override
1519      public boolean equalsDeep(Base other_) {
1520        if (!super.equalsDeep(other_))
1521          return false;
1522        if (!(other_ instanceof MedicationKnowledgeAdministrationGuidelinesComponent))
1523          return false;
1524        MedicationKnowledgeAdministrationGuidelinesComponent o = (MedicationKnowledgeAdministrationGuidelinesComponent) other_;
1525        return compareDeep(dosage, o.dosage, true) && compareDeep(indication, o.indication, true) && compareDeep(patientCharacteristics, o.patientCharacteristics, true)
1526          ;
1527      }
1528
1529      @Override
1530      public boolean equalsShallow(Base other_) {
1531        if (!super.equalsShallow(other_))
1532          return false;
1533        if (!(other_ instanceof MedicationKnowledgeAdministrationGuidelinesComponent))
1534          return false;
1535        MedicationKnowledgeAdministrationGuidelinesComponent o = (MedicationKnowledgeAdministrationGuidelinesComponent) other_;
1536        return true;
1537      }
1538
1539      public boolean isEmpty() {
1540        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(dosage, indication, patientCharacteristics
1541          );
1542      }
1543
1544  public String fhirType() {
1545    return "MedicationKnowledge.administrationGuidelines";
1546
1547  }
1548
1549  }
1550
1551    @Block()
1552    public static class MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent extends BackboneElement implements IBaseBackboneElement {
1553        /**
1554         * Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender).
1555         */
1556        @Child(name = "characteristic", type = {CodeableConcept.class, SimpleQuantity.class}, order=1, min=1, max=1, modifier=false, summary=false)
1557        @Description(shortDefinition="Specific characteristic that is relevant to the administration guideline", formalDefinition="Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender)." )
1558        protected Type characteristic;
1559
1560        /**
1561         * The specific characteristic (e.g. height, weight, gender, etc).
1562         */
1563        @Child(name = "value", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1564        @Description(shortDefinition="The specific characteristic", formalDefinition="The specific characteristic (e.g. height, weight, gender, etc)." )
1565        protected List<StringType> value;
1566
1567        private static final long serialVersionUID = -133608297L;
1568
1569    /**
1570     * Constructor
1571     */
1572      public MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent() {
1573        super();
1574      }
1575
1576    /**
1577     * Constructor
1578     */
1579      public MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(Type characteristic) {
1580        super();
1581        this.characteristic = characteristic;
1582      }
1583
1584        /**
1585         * @return {@link #characteristic} (Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender).)
1586         */
1587        public Type getCharacteristic() { 
1588          return this.characteristic;
1589        }
1590
1591        /**
1592         * @return {@link #characteristic} (Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender).)
1593         */
1594        public CodeableConcept getCharacteristicCodeableConcept() throws FHIRException { 
1595          if (this.characteristic == null)
1596            return null;
1597          if (!(this.characteristic instanceof CodeableConcept))
1598            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.characteristic.getClass().getName()+" was encountered");
1599          return (CodeableConcept) this.characteristic;
1600        }
1601
1602        public boolean hasCharacteristicCodeableConcept() { 
1603          return this != null && this.characteristic instanceof CodeableConcept;
1604        }
1605
1606        /**
1607         * @return {@link #characteristic} (Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender).)
1608         */
1609        public SimpleQuantity getCharacteristicSimpleQuantity() throws FHIRException { 
1610          if (this.characteristic == null)
1611            return null;
1612          if (!(this.characteristic instanceof SimpleQuantity))
1613            throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.characteristic.getClass().getName()+" was encountered");
1614          return (SimpleQuantity) this.characteristic;
1615        }
1616
1617        public boolean hasCharacteristicSimpleQuantity() { 
1618          return this != null && this.characteristic instanceof SimpleQuantity;
1619        }
1620
1621        public boolean hasCharacteristic() { 
1622          return this.characteristic != null && !this.characteristic.isEmpty();
1623        }
1624
1625        /**
1626         * @param value {@link #characteristic} (Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender).)
1627         */
1628        public MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent setCharacteristic(Type value) { 
1629          if (value != null && !(value instanceof CodeableConcept || value instanceof SimpleQuantity))
1630            throw new Error("Not the right type for MedicationKnowledge.administrationGuidelines.patientCharacteristics.characteristic[x]: "+value.fhirType());
1631          this.characteristic = value;
1632          return this;
1633        }
1634
1635        /**
1636         * @return {@link #value} (The specific characteristic (e.g. height, weight, gender, etc).)
1637         */
1638        public List<StringType> getValue() { 
1639          if (this.value == null)
1640            this.value = new ArrayList<StringType>();
1641          return this.value;
1642        }
1643
1644        /**
1645         * @return Returns a reference to <code>this</code> for easy method chaining
1646         */
1647        public MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent setValue(List<StringType> theValue) { 
1648          this.value = theValue;
1649          return this;
1650        }
1651
1652        public boolean hasValue() { 
1653          if (this.value == null)
1654            return false;
1655          for (StringType item : this.value)
1656            if (!item.isEmpty())
1657              return true;
1658          return false;
1659        }
1660
1661        /**
1662         * @return {@link #value} (The specific characteristic (e.g. height, weight, gender, etc).)
1663         */
1664        public StringType addValueElement() {//2 
1665          StringType t = new StringType();
1666          if (this.value == null)
1667            this.value = new ArrayList<StringType>();
1668          this.value.add(t);
1669          return t;
1670        }
1671
1672        /**
1673         * @param value {@link #value} (The specific characteristic (e.g. height, weight, gender, etc).)
1674         */
1675        public MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent addValue(String value) { //1
1676          StringType t = new StringType();
1677          t.setValue(value);
1678          if (this.value == null)
1679            this.value = new ArrayList<StringType>();
1680          this.value.add(t);
1681          return this;
1682        }
1683
1684        /**
1685         * @param value {@link #value} (The specific characteristic (e.g. height, weight, gender, etc).)
1686         */
1687        public boolean hasValue(String value) { 
1688          if (this.value == null)
1689            return false;
1690          for (StringType v : this.value)
1691            if (v.getValue().equals(value)) // string
1692              return true;
1693          return false;
1694        }
1695
1696        protected void listChildren(List<Property> children) {
1697          super.listChildren(children);
1698          children.add(new Property("characteristic[x]", "CodeableConcept|SimpleQuantity", "Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender).", 0, 1, characteristic));
1699          children.add(new Property("value", "string", "The specific characteristic (e.g. height, weight, gender, etc).", 0, java.lang.Integer.MAX_VALUE, value));
1700        }
1701
1702        @Override
1703        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1704          switch (_hash) {
1705          case -654919419: /*characteristic[x]*/  return new Property("characteristic[x]", "CodeableConcept|SimpleQuantity", "Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender).", 0, 1, characteristic);
1706          case 366313883: /*characteristic*/  return new Property("characteristic[x]", "CodeableConcept|SimpleQuantity", "Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender).", 0, 1, characteristic);
1707          case -1259840378: /*characteristicCodeableConcept*/  return new Property("characteristic[x]", "CodeableConcept|SimpleQuantity", "Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender).", 0, 1, characteristic);
1708          case 1947142872: /*characteristicSimpleQuantity*/  return new Property("characteristic[x]", "CodeableConcept|SimpleQuantity", "Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender).", 0, 1, characteristic);
1709          case 111972721: /*value*/  return new Property("value", "string", "The specific characteristic (e.g. height, weight, gender, etc).", 0, java.lang.Integer.MAX_VALUE, value);
1710          default: return super.getNamedProperty(_hash, _name, _checkValid);
1711          }
1712
1713        }
1714
1715      @Override
1716      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1717        switch (hash) {
1718        case 366313883: /*characteristic*/ return this.characteristic == null ? new Base[0] : new Base[] {this.characteristic}; // Type
1719        case 111972721: /*value*/ return this.value == null ? new Base[0] : this.value.toArray(new Base[this.value.size()]); // StringType
1720        default: return super.getProperty(hash, name, checkValid);
1721        }
1722
1723      }
1724
1725      @Override
1726      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1727        switch (hash) {
1728        case 366313883: // characteristic
1729          this.characteristic = castToType(value); // Type
1730          return value;
1731        case 111972721: // value
1732          this.getValue().add(castToString(value)); // StringType
1733          return value;
1734        default: return super.setProperty(hash, name, value);
1735        }
1736
1737      }
1738
1739      @Override
1740      public Base setProperty(String name, Base value) throws FHIRException {
1741        if (name.equals("characteristic[x]")) {
1742          this.characteristic = castToType(value); // Type
1743        } else if (name.equals("value")) {
1744          this.getValue().add(castToString(value));
1745        } else
1746          return super.setProperty(name, value);
1747        return value;
1748      }
1749
1750      @Override
1751      public Base makeProperty(int hash, String name) throws FHIRException {
1752        switch (hash) {
1753        case -654919419:  return getCharacteristic(); 
1754        case 366313883:  return getCharacteristic(); 
1755        case 111972721:  return addValueElement();
1756        default: return super.makeProperty(hash, name);
1757        }
1758
1759      }
1760
1761      @Override
1762      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1763        switch (hash) {
1764        case 366313883: /*characteristic*/ return new String[] {"CodeableConcept", "SimpleQuantity"};
1765        case 111972721: /*value*/ return new String[] {"string"};
1766        default: return super.getTypesForProperty(hash, name);
1767        }
1768
1769      }
1770
1771      @Override
1772      public Base addChild(String name) throws FHIRException {
1773        if (name.equals("characteristicCodeableConcept")) {
1774          this.characteristic = new CodeableConcept();
1775          return this.characteristic;
1776        }
1777        else if (name.equals("characteristicSimpleQuantity")) {
1778          this.characteristic = new SimpleQuantity();
1779          return this.characteristic;
1780        }
1781        else if (name.equals("value")) {
1782          throw new FHIRException("Cannot call addChild on a primitive type MedicationKnowledge.value");
1783        }
1784        else
1785          return super.addChild(name);
1786      }
1787
1788      public MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent copy() {
1789        MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent dst = new MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent();
1790        copyValues(dst);
1791        dst.characteristic = characteristic == null ? null : characteristic.copy();
1792        if (value != null) {
1793          dst.value = new ArrayList<StringType>();
1794          for (StringType i : value)
1795            dst.value.add(i.copy());
1796        };
1797        return dst;
1798      }
1799
1800      @Override
1801      public boolean equalsDeep(Base other_) {
1802        if (!super.equalsDeep(other_))
1803          return false;
1804        if (!(other_ instanceof MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent))
1805          return false;
1806        MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent o = (MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent) other_;
1807        return compareDeep(characteristic, o.characteristic, true) && compareDeep(value, o.value, true)
1808          ;
1809      }
1810
1811      @Override
1812      public boolean equalsShallow(Base other_) {
1813        if (!super.equalsShallow(other_))
1814          return false;
1815        if (!(other_ instanceof MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent))
1816          return false;
1817        MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent o = (MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent) other_;
1818        return compareValues(value, o.value, true);
1819      }
1820
1821      public boolean isEmpty() {
1822        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(characteristic, value);
1823      }
1824
1825  public String fhirType() {
1826    return "MedicationKnowledge.administrationGuidelines.patientCharacteristics";
1827
1828  }
1829
1830  }
1831
1832    @Block()
1833    public static class MedicationKnowledgeMedicineClassificationComponent extends BackboneElement implements IBaseBackboneElement {
1834        /**
1835         * The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification).
1836         */
1837        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1838        @Description(shortDefinition="The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification)", formalDefinition="The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification)." )
1839        protected CodeableConcept type;
1840
1841        /**
1842         * Specific category assigned to the medication (e.g. anti-infective, anti-hypertensive, antibiotic, etc).
1843         */
1844        @Child(name = "classification", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1845        @Description(shortDefinition="Specific category assigned to the medication", formalDefinition="Specific category assigned to the medication (e.g. anti-infective, anti-hypertensive, antibiotic, etc)." )
1846        protected List<CodeableConcept> classification;
1847
1848        private static final long serialVersionUID = 1562996046L;
1849
1850    /**
1851     * Constructor
1852     */
1853      public MedicationKnowledgeMedicineClassificationComponent() {
1854        super();
1855      }
1856
1857    /**
1858     * Constructor
1859     */
1860      public MedicationKnowledgeMedicineClassificationComponent(CodeableConcept type) {
1861        super();
1862        this.type = type;
1863      }
1864
1865        /**
1866         * @return {@link #type} (The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification).)
1867         */
1868        public CodeableConcept getType() { 
1869          if (this.type == null)
1870            if (Configuration.errorOnAutoCreate())
1871              throw new Error("Attempt to auto-create MedicationKnowledgeMedicineClassificationComponent.type");
1872            else if (Configuration.doAutoCreate())
1873              this.type = new CodeableConcept(); // cc
1874          return this.type;
1875        }
1876
1877        public boolean hasType() { 
1878          return this.type != null && !this.type.isEmpty();
1879        }
1880
1881        /**
1882         * @param value {@link #type} (The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification).)
1883         */
1884        public MedicationKnowledgeMedicineClassificationComponent setType(CodeableConcept value) { 
1885          this.type = value;
1886          return this;
1887        }
1888
1889        /**
1890         * @return {@link #classification} (Specific category assigned to the medication (e.g. anti-infective, anti-hypertensive, antibiotic, etc).)
1891         */
1892        public List<CodeableConcept> getClassification() { 
1893          if (this.classification == null)
1894            this.classification = new ArrayList<CodeableConcept>();
1895          return this.classification;
1896        }
1897
1898        /**
1899         * @return Returns a reference to <code>this</code> for easy method chaining
1900         */
1901        public MedicationKnowledgeMedicineClassificationComponent setClassification(List<CodeableConcept> theClassification) { 
1902          this.classification = theClassification;
1903          return this;
1904        }
1905
1906        public boolean hasClassification() { 
1907          if (this.classification == null)
1908            return false;
1909          for (CodeableConcept item : this.classification)
1910            if (!item.isEmpty())
1911              return true;
1912          return false;
1913        }
1914
1915        public CodeableConcept addClassification() { //3
1916          CodeableConcept t = new CodeableConcept();
1917          if (this.classification == null)
1918            this.classification = new ArrayList<CodeableConcept>();
1919          this.classification.add(t);
1920          return t;
1921        }
1922
1923        public MedicationKnowledgeMedicineClassificationComponent addClassification(CodeableConcept t) { //3
1924          if (t == null)
1925            return this;
1926          if (this.classification == null)
1927            this.classification = new ArrayList<CodeableConcept>();
1928          this.classification.add(t);
1929          return this;
1930        }
1931
1932        /**
1933         * @return The first repetition of repeating field {@link #classification}, creating it if it does not already exist
1934         */
1935        public CodeableConcept getClassificationFirstRep() { 
1936          if (getClassification().isEmpty()) {
1937            addClassification();
1938          }
1939          return getClassification().get(0);
1940        }
1941
1942        protected void listChildren(List<Property> children) {
1943          super.listChildren(children);
1944          children.add(new Property("type", "CodeableConcept", "The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification).", 0, 1, type));
1945          children.add(new Property("classification", "CodeableConcept", "Specific category assigned to the medication (e.g. anti-infective, anti-hypertensive, antibiotic, etc).", 0, java.lang.Integer.MAX_VALUE, classification));
1946        }
1947
1948        @Override
1949        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1950          switch (_hash) {
1951          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification).", 0, 1, type);
1952          case 382350310: /*classification*/  return new Property("classification", "CodeableConcept", "Specific category assigned to the medication (e.g. anti-infective, anti-hypertensive, antibiotic, etc).", 0, java.lang.Integer.MAX_VALUE, classification);
1953          default: return super.getNamedProperty(_hash, _name, _checkValid);
1954          }
1955
1956        }
1957
1958      @Override
1959      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1960        switch (hash) {
1961        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1962        case 382350310: /*classification*/ return this.classification == null ? new Base[0] : this.classification.toArray(new Base[this.classification.size()]); // CodeableConcept
1963        default: return super.getProperty(hash, name, checkValid);
1964        }
1965
1966      }
1967
1968      @Override
1969      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1970        switch (hash) {
1971        case 3575610: // type
1972          this.type = castToCodeableConcept(value); // CodeableConcept
1973          return value;
1974        case 382350310: // classification
1975          this.getClassification().add(castToCodeableConcept(value)); // CodeableConcept
1976          return value;
1977        default: return super.setProperty(hash, name, value);
1978        }
1979
1980      }
1981
1982      @Override
1983      public Base setProperty(String name, Base value) throws FHIRException {
1984        if (name.equals("type")) {
1985          this.type = castToCodeableConcept(value); // CodeableConcept
1986        } else if (name.equals("classification")) {
1987          this.getClassification().add(castToCodeableConcept(value));
1988        } else
1989          return super.setProperty(name, value);
1990        return value;
1991      }
1992
1993      @Override
1994      public Base makeProperty(int hash, String name) throws FHIRException {
1995        switch (hash) {
1996        case 3575610:  return getType(); 
1997        case 382350310:  return addClassification(); 
1998        default: return super.makeProperty(hash, name);
1999        }
2000
2001      }
2002
2003      @Override
2004      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2005        switch (hash) {
2006        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2007        case 382350310: /*classification*/ return new String[] {"CodeableConcept"};
2008        default: return super.getTypesForProperty(hash, name);
2009        }
2010
2011      }
2012
2013      @Override
2014      public Base addChild(String name) throws FHIRException {
2015        if (name.equals("type")) {
2016          this.type = new CodeableConcept();
2017          return this.type;
2018        }
2019        else if (name.equals("classification")) {
2020          return addClassification();
2021        }
2022        else
2023          return super.addChild(name);
2024      }
2025
2026      public MedicationKnowledgeMedicineClassificationComponent copy() {
2027        MedicationKnowledgeMedicineClassificationComponent dst = new MedicationKnowledgeMedicineClassificationComponent();
2028        copyValues(dst);
2029        dst.type = type == null ? null : type.copy();
2030        if (classification != null) {
2031          dst.classification = new ArrayList<CodeableConcept>();
2032          for (CodeableConcept i : classification)
2033            dst.classification.add(i.copy());
2034        };
2035        return dst;
2036      }
2037
2038      @Override
2039      public boolean equalsDeep(Base other_) {
2040        if (!super.equalsDeep(other_))
2041          return false;
2042        if (!(other_ instanceof MedicationKnowledgeMedicineClassificationComponent))
2043          return false;
2044        MedicationKnowledgeMedicineClassificationComponent o = (MedicationKnowledgeMedicineClassificationComponent) other_;
2045        return compareDeep(type, o.type, true) && compareDeep(classification, o.classification, true);
2046      }
2047
2048      @Override
2049      public boolean equalsShallow(Base other_) {
2050        if (!super.equalsShallow(other_))
2051          return false;
2052        if (!(other_ instanceof MedicationKnowledgeMedicineClassificationComponent))
2053          return false;
2054        MedicationKnowledgeMedicineClassificationComponent o = (MedicationKnowledgeMedicineClassificationComponent) other_;
2055        return true;
2056      }
2057
2058      public boolean isEmpty() {
2059        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, classification);
2060      }
2061
2062  public String fhirType() {
2063    return "MedicationKnowledge.medicineClassification";
2064
2065  }
2066
2067  }
2068
2069    @Block()
2070    public static class MedicationKnowledgePackagingComponent extends BackboneElement implements IBaseBackboneElement {
2071        /**
2072         * A code that defines the specific type of packaging that the medication can be found in (e.g. blister sleeve, tube, bottle).
2073         */
2074        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
2075        @Description(shortDefinition="A code that defines the specific type of packaging that the medication can be found in", formalDefinition="A code that defines the specific type of packaging that the medication can be found in (e.g. blister sleeve, tube, bottle)." )
2076        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicationKnowledge-package")
2077        protected CodeableConcept type;
2078
2079        /**
2080         * The number of product units the package would contain if fully loaded.
2081         */
2082        @Child(name = "quantity", type = {SimpleQuantity.class}, order=2, min=0, max=1, modifier=false, summary=false)
2083        @Description(shortDefinition="The number of product units the package would contain if fully loaded", formalDefinition="The number of product units the package would contain if fully loaded." )
2084        protected SimpleQuantity quantity;
2085
2086        private static final long serialVersionUID = -216496823L;
2087
2088    /**
2089     * Constructor
2090     */
2091      public MedicationKnowledgePackagingComponent() {
2092        super();
2093      }
2094
2095        /**
2096         * @return {@link #type} (A code that defines the specific type of packaging that the medication can be found in (e.g. blister sleeve, tube, bottle).)
2097         */
2098        public CodeableConcept getType() { 
2099          if (this.type == null)
2100            if (Configuration.errorOnAutoCreate())
2101              throw new Error("Attempt to auto-create MedicationKnowledgePackagingComponent.type");
2102            else if (Configuration.doAutoCreate())
2103              this.type = new CodeableConcept(); // cc
2104          return this.type;
2105        }
2106
2107        public boolean hasType() { 
2108          return this.type != null && !this.type.isEmpty();
2109        }
2110
2111        /**
2112         * @param value {@link #type} (A code that defines the specific type of packaging that the medication can be found in (e.g. blister sleeve, tube, bottle).)
2113         */
2114        public MedicationKnowledgePackagingComponent setType(CodeableConcept value) { 
2115          this.type = value;
2116          return this;
2117        }
2118
2119        /**
2120         * @return {@link #quantity} (The number of product units the package would contain if fully loaded.)
2121         */
2122        public SimpleQuantity getQuantity() { 
2123          if (this.quantity == null)
2124            if (Configuration.errorOnAutoCreate())
2125              throw new Error("Attempt to auto-create MedicationKnowledgePackagingComponent.quantity");
2126            else if (Configuration.doAutoCreate())
2127              this.quantity = new SimpleQuantity(); // cc
2128          return this.quantity;
2129        }
2130
2131        public boolean hasQuantity() { 
2132          return this.quantity != null && !this.quantity.isEmpty();
2133        }
2134
2135        /**
2136         * @param value {@link #quantity} (The number of product units the package would contain if fully loaded.)
2137         */
2138        public MedicationKnowledgePackagingComponent setQuantity(SimpleQuantity value) { 
2139          this.quantity = value;
2140          return this;
2141        }
2142
2143        protected void listChildren(List<Property> children) {
2144          super.listChildren(children);
2145          children.add(new Property("type", "CodeableConcept", "A code that defines the specific type of packaging that the medication can be found in (e.g. blister sleeve, tube, bottle).", 0, 1, type));
2146          children.add(new Property("quantity", "SimpleQuantity", "The number of product units the package would contain if fully loaded.", 0, 1, quantity));
2147        }
2148
2149        @Override
2150        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2151          switch (_hash) {
2152          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A code that defines the specific type of packaging that the medication can be found in (e.g. blister sleeve, tube, bottle).", 0, 1, type);
2153          case -1285004149: /*quantity*/  return new Property("quantity", "SimpleQuantity", "The number of product units the package would contain if fully loaded.", 0, 1, quantity);
2154          default: return super.getNamedProperty(_hash, _name, _checkValid);
2155          }
2156
2157        }
2158
2159      @Override
2160      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2161        switch (hash) {
2162        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2163        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity
2164        default: return super.getProperty(hash, name, checkValid);
2165        }
2166
2167      }
2168
2169      @Override
2170      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2171        switch (hash) {
2172        case 3575610: // type
2173          this.type = castToCodeableConcept(value); // CodeableConcept
2174          return value;
2175        case -1285004149: // quantity
2176          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
2177          return value;
2178        default: return super.setProperty(hash, name, value);
2179        }
2180
2181      }
2182
2183      @Override
2184      public Base setProperty(String name, Base value) throws FHIRException {
2185        if (name.equals("type")) {
2186          this.type = castToCodeableConcept(value); // CodeableConcept
2187        } else if (name.equals("quantity")) {
2188          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
2189        } else
2190          return super.setProperty(name, value);
2191        return value;
2192      }
2193
2194      @Override
2195      public Base makeProperty(int hash, String name) throws FHIRException {
2196        switch (hash) {
2197        case 3575610:  return getType(); 
2198        case -1285004149:  return getQuantity(); 
2199        default: return super.makeProperty(hash, name);
2200        }
2201
2202      }
2203
2204      @Override
2205      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2206        switch (hash) {
2207        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2208        case -1285004149: /*quantity*/ return new String[] {"SimpleQuantity"};
2209        default: return super.getTypesForProperty(hash, name);
2210        }
2211
2212      }
2213
2214      @Override
2215      public Base addChild(String name) throws FHIRException {
2216        if (name.equals("type")) {
2217          this.type = new CodeableConcept();
2218          return this.type;
2219        }
2220        else if (name.equals("quantity")) {
2221          this.quantity = new SimpleQuantity();
2222          return this.quantity;
2223        }
2224        else
2225          return super.addChild(name);
2226      }
2227
2228      public MedicationKnowledgePackagingComponent copy() {
2229        MedicationKnowledgePackagingComponent dst = new MedicationKnowledgePackagingComponent();
2230        copyValues(dst);
2231        dst.type = type == null ? null : type.copy();
2232        dst.quantity = quantity == null ? null : quantity.copy();
2233        return dst;
2234      }
2235
2236      @Override
2237      public boolean equalsDeep(Base other_) {
2238        if (!super.equalsDeep(other_))
2239          return false;
2240        if (!(other_ instanceof MedicationKnowledgePackagingComponent))
2241          return false;
2242        MedicationKnowledgePackagingComponent o = (MedicationKnowledgePackagingComponent) other_;
2243        return compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true);
2244      }
2245
2246      @Override
2247      public boolean equalsShallow(Base other_) {
2248        if (!super.equalsShallow(other_))
2249          return false;
2250        if (!(other_ instanceof MedicationKnowledgePackagingComponent))
2251          return false;
2252        MedicationKnowledgePackagingComponent o = (MedicationKnowledgePackagingComponent) other_;
2253        return true;
2254      }
2255
2256      public boolean isEmpty() {
2257        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, quantity);
2258      }
2259
2260  public String fhirType() {
2261    return "MedicationKnowledge.packaging";
2262
2263  }
2264
2265  }
2266
2267    @Block()
2268    public static class MedicationKnowledgeDrugCharacteristicComponent extends BackboneElement implements IBaseBackboneElement {
2269        /**
2270         * A code specifying which characteristic of the medicine is being described (for example, colour, shape, imprint).
2271         */
2272        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
2273        @Description(shortDefinition="Code specifying the type of characteristic of medication", formalDefinition="A code specifying which characteristic of the medicine is being described (for example, colour, shape, imprint)." )
2274        protected CodeableConcept type;
2275
2276        /**
2277         * Description of the characteristic.
2278         */
2279        @Child(name = "value", type = {CodeableConcept.class, StringType.class, SimpleQuantity.class, Base64BinaryType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2280        @Description(shortDefinition="Description of the characteristic", formalDefinition="Description of the characteristic." )
2281        protected Type value;
2282
2283        private static final long serialVersionUID = -491121170L;
2284
2285    /**
2286     * Constructor
2287     */
2288      public MedicationKnowledgeDrugCharacteristicComponent() {
2289        super();
2290      }
2291
2292        /**
2293         * @return {@link #type} (A code specifying which characteristic of the medicine is being described (for example, colour, shape, imprint).)
2294         */
2295        public CodeableConcept getType() { 
2296          if (this.type == null)
2297            if (Configuration.errorOnAutoCreate())
2298              throw new Error("Attempt to auto-create MedicationKnowledgeDrugCharacteristicComponent.type");
2299            else if (Configuration.doAutoCreate())
2300              this.type = new CodeableConcept(); // cc
2301          return this.type;
2302        }
2303
2304        public boolean hasType() { 
2305          return this.type != null && !this.type.isEmpty();
2306        }
2307
2308        /**
2309         * @param value {@link #type} (A code specifying which characteristic of the medicine is being described (for example, colour, shape, imprint).)
2310         */
2311        public MedicationKnowledgeDrugCharacteristicComponent setType(CodeableConcept value) { 
2312          this.type = value;
2313          return this;
2314        }
2315
2316        /**
2317         * @return {@link #value} (Description of the characteristic.)
2318         */
2319        public Type getValue() { 
2320          return this.value;
2321        }
2322
2323        /**
2324         * @return {@link #value} (Description of the characteristic.)
2325         */
2326        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
2327          if (this.value == null)
2328            return null;
2329          if (!(this.value instanceof CodeableConcept))
2330            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
2331          return (CodeableConcept) this.value;
2332        }
2333
2334        public boolean hasValueCodeableConcept() { 
2335          return this != null && this.value instanceof CodeableConcept;
2336        }
2337
2338        /**
2339         * @return {@link #value} (Description of the characteristic.)
2340         */
2341        public StringType getValueStringType() throws FHIRException { 
2342          if (this.value == null)
2343            return null;
2344          if (!(this.value instanceof StringType))
2345            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
2346          return (StringType) this.value;
2347        }
2348
2349        public boolean hasValueStringType() { 
2350          return this != null && this.value instanceof StringType;
2351        }
2352
2353        /**
2354         * @return {@link #value} (Description of the characteristic.)
2355         */
2356        public SimpleQuantity getValueSimpleQuantity() throws FHIRException { 
2357          if (this.value == null)
2358            return null;
2359          if (!(this.value instanceof SimpleQuantity))
2360            throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.value.getClass().getName()+" was encountered");
2361          return (SimpleQuantity) this.value;
2362        }
2363
2364        public boolean hasValueSimpleQuantity() { 
2365          return this != null && this.value instanceof SimpleQuantity;
2366        }
2367
2368        /**
2369         * @return {@link #value} (Description of the characteristic.)
2370         */
2371        public Base64BinaryType getValueBase64BinaryType() throws FHIRException { 
2372          if (this.value == null)
2373            return null;
2374          if (!(this.value instanceof Base64BinaryType))
2375            throw new FHIRException("Type mismatch: the type Base64BinaryType was expected, but "+this.value.getClass().getName()+" was encountered");
2376          return (Base64BinaryType) this.value;
2377        }
2378
2379        public boolean hasValueBase64BinaryType() { 
2380          return this != null && this.value instanceof Base64BinaryType;
2381        }
2382
2383        public boolean hasValue() { 
2384          return this.value != null && !this.value.isEmpty();
2385        }
2386
2387        /**
2388         * @param value {@link #value} (Description of the characteristic.)
2389         */
2390        public MedicationKnowledgeDrugCharacteristicComponent setValue(Type value) { 
2391          if (value != null && !(value instanceof CodeableConcept || value instanceof StringType || value instanceof SimpleQuantity || value instanceof Base64BinaryType))
2392            throw new Error("Not the right type for MedicationKnowledge.drugCharacteristic.value[x]: "+value.fhirType());
2393          this.value = value;
2394          return this;
2395        }
2396
2397        protected void listChildren(List<Property> children) {
2398          super.listChildren(children);
2399          children.add(new Property("type", "CodeableConcept", "A code specifying which characteristic of the medicine is being described (for example, colour, shape, imprint).", 0, 1, type));
2400          children.add(new Property("value[x]", "CodeableConcept|string|SimpleQuantity|base64Binary", "Description of the characteristic.", 0, 1, value));
2401        }
2402
2403        @Override
2404        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2405          switch (_hash) {
2406          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A code specifying which characteristic of the medicine is being described (for example, colour, shape, imprint).", 0, 1, type);
2407          case -1410166417: /*value[x]*/  return new Property("value[x]", "CodeableConcept|string|SimpleQuantity|base64Binary", "Description of the characteristic.", 0, 1, value);
2408          case 111972721: /*value*/  return new Property("value[x]", "CodeableConcept|string|SimpleQuantity|base64Binary", "Description of the characteristic.", 0, 1, value);
2409          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept|string|SimpleQuantity|base64Binary", "Description of the characteristic.", 0, 1, value);
2410          case -1424603934: /*valueString*/  return new Property("value[x]", "CodeableConcept|string|SimpleQuantity|base64Binary", "Description of the characteristic.", 0, 1, value);
2411          case -1723159506: /*valueSimpleQuantity*/  return new Property("value[x]", "CodeableConcept|string|SimpleQuantity|base64Binary", "Description of the characteristic.", 0, 1, value);
2412          case -1535024575: /*valueBase64Binary*/  return new Property("value[x]", "CodeableConcept|string|SimpleQuantity|base64Binary", "Description of the characteristic.", 0, 1, value);
2413          default: return super.getNamedProperty(_hash, _name, _checkValid);
2414          }
2415
2416        }
2417
2418      @Override
2419      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2420        switch (hash) {
2421        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2422        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type
2423        default: return super.getProperty(hash, name, checkValid);
2424        }
2425
2426      }
2427
2428      @Override
2429      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2430        switch (hash) {
2431        case 3575610: // type
2432          this.type = castToCodeableConcept(value); // CodeableConcept
2433          return value;
2434        case 111972721: // value
2435          this.value = castToType(value); // Type
2436          return value;
2437        default: return super.setProperty(hash, name, value);
2438        }
2439
2440      }
2441
2442      @Override
2443      public Base setProperty(String name, Base value) throws FHIRException {
2444        if (name.equals("type")) {
2445          this.type = castToCodeableConcept(value); // CodeableConcept
2446        } else if (name.equals("value[x]")) {
2447          this.value = castToType(value); // Type
2448        } else
2449          return super.setProperty(name, value);
2450        return value;
2451      }
2452
2453      @Override
2454      public Base makeProperty(int hash, String name) throws FHIRException {
2455        switch (hash) {
2456        case 3575610:  return getType(); 
2457        case -1410166417:  return getValue(); 
2458        case 111972721:  return getValue(); 
2459        default: return super.makeProperty(hash, name);
2460        }
2461
2462      }
2463
2464      @Override
2465      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2466        switch (hash) {
2467        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2468        case 111972721: /*value*/ return new String[] {"CodeableConcept", "string", "SimpleQuantity", "base64Binary"};
2469        default: return super.getTypesForProperty(hash, name);
2470        }
2471
2472      }
2473
2474      @Override
2475      public Base addChild(String name) throws FHIRException {
2476        if (name.equals("type")) {
2477          this.type = new CodeableConcept();
2478          return this.type;
2479        }
2480        else if (name.equals("valueCodeableConcept")) {
2481          this.value = new CodeableConcept();
2482          return this.value;
2483        }
2484        else if (name.equals("valueString")) {
2485          this.value = new StringType();
2486          return this.value;
2487        }
2488        else if (name.equals("valueSimpleQuantity")) {
2489          this.value = new SimpleQuantity();
2490          return this.value;
2491        }
2492        else if (name.equals("valueBase64Binary")) {
2493          this.value = new Base64BinaryType();
2494          return this.value;
2495        }
2496        else
2497          return super.addChild(name);
2498      }
2499
2500      public MedicationKnowledgeDrugCharacteristicComponent copy() {
2501        MedicationKnowledgeDrugCharacteristicComponent dst = new MedicationKnowledgeDrugCharacteristicComponent();
2502        copyValues(dst);
2503        dst.type = type == null ? null : type.copy();
2504        dst.value = value == null ? null : value.copy();
2505        return dst;
2506      }
2507
2508      @Override
2509      public boolean equalsDeep(Base other_) {
2510        if (!super.equalsDeep(other_))
2511          return false;
2512        if (!(other_ instanceof MedicationKnowledgeDrugCharacteristicComponent))
2513          return false;
2514        MedicationKnowledgeDrugCharacteristicComponent o = (MedicationKnowledgeDrugCharacteristicComponent) other_;
2515        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true);
2516      }
2517
2518      @Override
2519      public boolean equalsShallow(Base other_) {
2520        if (!super.equalsShallow(other_))
2521          return false;
2522        if (!(other_ instanceof MedicationKnowledgeDrugCharacteristicComponent))
2523          return false;
2524        MedicationKnowledgeDrugCharacteristicComponent o = (MedicationKnowledgeDrugCharacteristicComponent) other_;
2525        return true;
2526      }
2527
2528      public boolean isEmpty() {
2529        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value);
2530      }
2531
2532  public String fhirType() {
2533    return "MedicationKnowledge.drugCharacteristic";
2534
2535  }
2536
2537  }
2538
2539    /**
2540     * A code that specifies 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.
2541     */
2542    @Child(name = "code", type = {CodeableConcept.class}, order=0, min=0, max=1, modifier=false, summary=true)
2543    @Description(shortDefinition="Code that identifies this medication", formalDefinition="A code that specifies 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." )
2544    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-codes")
2545    protected CodeableConcept code;
2546
2547    /**
2548     * A code to indicate if the medication is in active use.
2549     */
2550    @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true)
2551    @Description(shortDefinition="active | inactive | entered-in-error", formalDefinition="A code to indicate if the medication is in active use." )
2552    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicationKnowledge-status")
2553    protected Enumeration<MedicationKnowledgeStatus> status;
2554
2555    /**
2556     * Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.
2557     */
2558    @Child(name = "manufacturer", type = {Organization.class}, order=2, min=0, max=1, modifier=false, summary=true)
2559    @Description(shortDefinition="Manufacturer of the item", formalDefinition="Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product." )
2560    protected Reference manufacturer;
2561
2562    /**
2563     * The actual object that is the target of the reference (Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.)
2564     */
2565    protected Organization manufacturerTarget;
2566
2567    /**
2568     * Describes the form of the item.  Powder; tablets; capsule.
2569     */
2570    @Child(name = "form", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
2571    @Description(shortDefinition="powder | tablets | capsule +", formalDefinition="Describes the form of the item.  Powder; tablets; capsule." )
2572    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-form-codes")
2573    protected CodeableConcept form;
2574
2575    /**
2576     * Specific amount of the drug in the packaged 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).
2577     */
2578    @Child(name = "amount", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=true)
2579    @Description(shortDefinition="Amount of drug in package", formalDefinition="Specific amount of the drug in the packaged 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)." )
2580    protected SimpleQuantity amount;
2581
2582    /**
2583     * Additional names for a medication, for example, the name(s) given to a medication in different countries.  For example, acetaminophen and paracetamol or salbutamol and albuterol.
2584     */
2585    @Child(name = "synonym", type = {StringType.class}, order=5, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2586    @Description(shortDefinition="Additional names for a medication", formalDefinition="Additional names for a medication, for example, the name(s) given to a medication in different countries.  For example, acetaminophen and paracetamol or salbutamol and albuterol." )
2587    protected List<StringType> synonym;
2588
2589    /**
2590     * Associated or related knowledge about a medication.
2591     */
2592    @Child(name = "relatedMedicationKnowledge", type = {MedicationKnowledge.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2593    @Description(shortDefinition="Associated or related medication information", formalDefinition="Associated or related knowledge about a medication." )
2594    protected List<Reference> relatedMedicationKnowledge;
2595    /**
2596     * The actual objects that are the target of the reference (Associated or related knowledge about a medication.)
2597     */
2598    protected List<MedicationKnowledge> relatedMedicationKnowledgeTarget;
2599
2600
2601    /**
2602     * Associated or related medications.  For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor).
2603     */
2604    @Child(name = "associatedMedication", type = {Medication.class}, order=7, min=0, max=1, modifier=false, summary=false)
2605    @Description(shortDefinition="A medication resource that is associated with this medication", formalDefinition="Associated or related medications.  For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor)." )
2606    protected Reference associatedMedication;
2607
2608    /**
2609     * The actual object that is the target of the reference (Associated or related medications.  For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor).)
2610     */
2611    protected Medication associatedMedicationTarget;
2612
2613    /**
2614     * Category of the medication or product (e.g. branded product, therapeutic moeity, generic product, innovator product, etc).
2615     */
2616    @Child(name = "productType", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2617    @Description(shortDefinition="Category of the medication or product", formalDefinition="Category of the medication or product (e.g. branded product, therapeutic moeity, generic product, innovator product, etc)." )
2618    protected List<CodeableConcept> productType;
2619
2620    /**
2621     * Associated documentation about the medication.
2622     */
2623    @Child(name = "monograph", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2624    @Description(shortDefinition="Associated documentation about the medication", formalDefinition="Associated documentation about the medication." )
2625    protected List<MedicationKnowledgeMonographComponent> monograph;
2626
2627    /**
2628     * The time required for any specified property (e.g., the concentration of a substance in the body) to decrease by half.
2629     */
2630    @Child(name = "halfLifePeriod", type = {Duration.class}, order=10, min=0, max=1, modifier=false, summary=false)
2631    @Description(shortDefinition="Time required for concentration in the body to decrease by half", formalDefinition="The time required for any specified property (e.g., the concentration of a substance in the body) to decrease by half." )
2632    protected Duration halfLifePeriod;
2633
2634    /**
2635     * Identifies a particular constituent of interest in the product.
2636     */
2637    @Child(name = "ingredient", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2638    @Description(shortDefinition="Active or inactive ingredient", formalDefinition="Identifies a particular constituent of interest in the product." )
2639    protected List<MedicationKnowledgeIngredientComponent> ingredient;
2640
2641    /**
2642     * The instructions for preparing the medication.
2643     */
2644    @Child(name = "preparationInstruction", type = {MarkdownType.class}, order=12, min=0, max=1, modifier=false, summary=false)
2645    @Description(shortDefinition="The instructions for preparing the medication", formalDefinition="The instructions for preparing the medication." )
2646    protected MarkdownType preparationInstruction;
2647
2648    /**
2649     * The intended or approved route of administration.
2650     */
2651    @Child(name = "intendedRoute", type = {CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2652    @Description(shortDefinition="The intended or approved route of administration", formalDefinition="The intended or approved route of administration." )
2653    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/route-codes")
2654    protected List<CodeableConcept> intendedRoute;
2655
2656    /**
2657     * The price of the medication.
2658     */
2659    @Child(name = "cost", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2660    @Description(shortDefinition="The pricing of the medication", formalDefinition="The price of the medication." )
2661    protected List<MedicationKnowledgeCostComponent> cost;
2662
2663    /**
2664     * The program under which the medication is reviewed.
2665     */
2666    @Child(name = "monitoringProgram", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2667    @Description(shortDefinition="Program under which a medication is reviewed", formalDefinition="The program under which the medication is reviewed." )
2668    protected List<MedicationKnowledgeMonitoringProgramComponent> monitoringProgram;
2669
2670    /**
2671     * Guidelines for the administration of the medication.
2672     */
2673    @Child(name = "administrationGuidelines", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2674    @Description(shortDefinition="Gudelines for administration of the medication", formalDefinition="Guidelines for the administration of the medication." )
2675    protected List<MedicationKnowledgeAdministrationGuidelinesComponent> administrationGuidelines;
2676
2677    /**
2678     * Categorization of the medication within a formulary or classification system.
2679     */
2680    @Child(name = "medicineClassification", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2681    @Description(shortDefinition="Categorization of the medication within a formulary or classification system", formalDefinition="Categorization of the medication within a formulary or classification system." )
2682    protected List<MedicationKnowledgeMedicineClassificationComponent> medicineClassification;
2683
2684    /**
2685     * Information that only applies to packages (not products).
2686     */
2687    @Child(name = "packaging", type = {}, order=18, min=0, max=1, modifier=false, summary=false)
2688    @Description(shortDefinition="Details about packaged medications", formalDefinition="Information that only applies to packages (not products)." )
2689    protected MedicationKnowledgePackagingComponent packaging;
2690
2691    /**
2692     * Specifies descriptive properties of the medicine, such as color, shape, imprints, etc.
2693     */
2694    @Child(name = "drugCharacteristic", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2695    @Description(shortDefinition="Specifies descriptive properties of the medicine", formalDefinition="Specifies descriptive properties of the medicine, such as color, shape, imprints, etc." )
2696    protected List<MedicationKnowledgeDrugCharacteristicComponent> drugCharacteristic;
2697
2698    /**
2699     * Potential clinical issue with or between medication(s) (for example, drug-drug interaction, drug-disease contraindication, drug-allergy interaction, etc).
2700     */
2701    @Child(name = "contraindication", type = {DetectedIssue.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2702    @Description(shortDefinition="Potential clinical issue with or between medication(s)", formalDefinition="Potential clinical issue with or between medication(s) (for example, drug-drug interaction, drug-disease contraindication, drug-allergy interaction, etc)." )
2703    protected List<Reference> contraindication;
2704    /**
2705     * The actual objects that are the target of the reference (Potential clinical issue with or between medication(s) (for example, drug-drug interaction, drug-disease contraindication, drug-allergy interaction, etc).)
2706     */
2707    protected List<DetectedIssue> contraindicationTarget;
2708
2709
2710    private static final long serialVersionUID = 854168093L;
2711
2712  /**
2713   * Constructor
2714   */
2715    public MedicationKnowledge() {
2716      super();
2717    }
2718
2719    /**
2720     * @return {@link #code} (A code that specifies 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.)
2721     */
2722    public CodeableConcept getCode() { 
2723      if (this.code == null)
2724        if (Configuration.errorOnAutoCreate())
2725          throw new Error("Attempt to auto-create MedicationKnowledge.code");
2726        else if (Configuration.doAutoCreate())
2727          this.code = new CodeableConcept(); // cc
2728      return this.code;
2729    }
2730
2731    public boolean hasCode() { 
2732      return this.code != null && !this.code.isEmpty();
2733    }
2734
2735    /**
2736     * @param value {@link #code} (A code that specifies 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.)
2737     */
2738    public MedicationKnowledge setCode(CodeableConcept value) { 
2739      this.code = value;
2740      return this;
2741    }
2742
2743    /**
2744     * @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
2745     */
2746    public Enumeration<MedicationKnowledgeStatus> getStatusElement() { 
2747      if (this.status == null)
2748        if (Configuration.errorOnAutoCreate())
2749          throw new Error("Attempt to auto-create MedicationKnowledge.status");
2750        else if (Configuration.doAutoCreate())
2751          this.status = new Enumeration<MedicationKnowledgeStatus>(new MedicationKnowledgeStatusEnumFactory()); // bb
2752      return this.status;
2753    }
2754
2755    public boolean hasStatusElement() { 
2756      return this.status != null && !this.status.isEmpty();
2757    }
2758
2759    public boolean hasStatus() { 
2760      return this.status != null && !this.status.isEmpty();
2761    }
2762
2763    /**
2764     * @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
2765     */
2766    public MedicationKnowledge setStatusElement(Enumeration<MedicationKnowledgeStatus> value) { 
2767      this.status = value;
2768      return this;
2769    }
2770
2771    /**
2772     * @return A code to indicate if the medication is in active use.
2773     */
2774    public MedicationKnowledgeStatus getStatus() { 
2775      return this.status == null ? null : this.status.getValue();
2776    }
2777
2778    /**
2779     * @param value A code to indicate if the medication is in active use.
2780     */
2781    public MedicationKnowledge setStatus(MedicationKnowledgeStatus value) { 
2782      if (value == null)
2783        this.status = null;
2784      else {
2785        if (this.status == null)
2786          this.status = new Enumeration<MedicationKnowledgeStatus>(new MedicationKnowledgeStatusEnumFactory());
2787        this.status.setValue(value);
2788      }
2789      return this;
2790    }
2791
2792    /**
2793     * @return {@link #manufacturer} (Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.)
2794     */
2795    public Reference getManufacturer() { 
2796      if (this.manufacturer == null)
2797        if (Configuration.errorOnAutoCreate())
2798          throw new Error("Attempt to auto-create MedicationKnowledge.manufacturer");
2799        else if (Configuration.doAutoCreate())
2800          this.manufacturer = new Reference(); // cc
2801      return this.manufacturer;
2802    }
2803
2804    public boolean hasManufacturer() { 
2805      return this.manufacturer != null && !this.manufacturer.isEmpty();
2806    }
2807
2808    /**
2809     * @param value {@link #manufacturer} (Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.)
2810     */
2811    public MedicationKnowledge setManufacturer(Reference value) { 
2812      this.manufacturer = value;
2813      return this;
2814    }
2815
2816    /**
2817     * @return {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.)
2818     */
2819    public Organization getManufacturerTarget() { 
2820      if (this.manufacturerTarget == null)
2821        if (Configuration.errorOnAutoCreate())
2822          throw new Error("Attempt to auto-create MedicationKnowledge.manufacturer");
2823        else if (Configuration.doAutoCreate())
2824          this.manufacturerTarget = new Organization(); // aa
2825      return this.manufacturerTarget;
2826    }
2827
2828    /**
2829     * @param value {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.)
2830     */
2831    public MedicationKnowledge setManufacturerTarget(Organization value) { 
2832      this.manufacturerTarget = value;
2833      return this;
2834    }
2835
2836    /**
2837     * @return {@link #form} (Describes the form of the item.  Powder; tablets; capsule.)
2838     */
2839    public CodeableConcept getForm() { 
2840      if (this.form == null)
2841        if (Configuration.errorOnAutoCreate())
2842          throw new Error("Attempt to auto-create MedicationKnowledge.form");
2843        else if (Configuration.doAutoCreate())
2844          this.form = new CodeableConcept(); // cc
2845      return this.form;
2846    }
2847
2848    public boolean hasForm() { 
2849      return this.form != null && !this.form.isEmpty();
2850    }
2851
2852    /**
2853     * @param value {@link #form} (Describes the form of the item.  Powder; tablets; capsule.)
2854     */
2855    public MedicationKnowledge setForm(CodeableConcept value) { 
2856      this.form = value;
2857      return this;
2858    }
2859
2860    /**
2861     * @return {@link #amount} (Specific amount of the drug in the packaged 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).)
2862     */
2863    public SimpleQuantity getAmount() { 
2864      if (this.amount == null)
2865        if (Configuration.errorOnAutoCreate())
2866          throw new Error("Attempt to auto-create MedicationKnowledge.amount");
2867        else if (Configuration.doAutoCreate())
2868          this.amount = new SimpleQuantity(); // cc
2869      return this.amount;
2870    }
2871
2872    public boolean hasAmount() { 
2873      return this.amount != null && !this.amount.isEmpty();
2874    }
2875
2876    /**
2877     * @param value {@link #amount} (Specific amount of the drug in the packaged 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).)
2878     */
2879    public MedicationKnowledge setAmount(SimpleQuantity value) { 
2880      this.amount = value;
2881      return this;
2882    }
2883
2884    /**
2885     * @return {@link #synonym} (Additional names for a medication, for example, the name(s) given to a medication in different countries.  For example, acetaminophen and paracetamol or salbutamol and albuterol.)
2886     */
2887    public List<StringType> getSynonym() { 
2888      if (this.synonym == null)
2889        this.synonym = new ArrayList<StringType>();
2890      return this.synonym;
2891    }
2892
2893    /**
2894     * @return Returns a reference to <code>this</code> for easy method chaining
2895     */
2896    public MedicationKnowledge setSynonym(List<StringType> theSynonym) { 
2897      this.synonym = theSynonym;
2898      return this;
2899    }
2900
2901    public boolean hasSynonym() { 
2902      if (this.synonym == null)
2903        return false;
2904      for (StringType item : this.synonym)
2905        if (!item.isEmpty())
2906          return true;
2907      return false;
2908    }
2909
2910    /**
2911     * @return {@link #synonym} (Additional names for a medication, for example, the name(s) given to a medication in different countries.  For example, acetaminophen and paracetamol or salbutamol and albuterol.)
2912     */
2913    public StringType addSynonymElement() {//2 
2914      StringType t = new StringType();
2915      if (this.synonym == null)
2916        this.synonym = new ArrayList<StringType>();
2917      this.synonym.add(t);
2918      return t;
2919    }
2920
2921    /**
2922     * @param value {@link #synonym} (Additional names for a medication, for example, the name(s) given to a medication in different countries.  For example, acetaminophen and paracetamol or salbutamol and albuterol.)
2923     */
2924    public MedicationKnowledge addSynonym(String value) { //1
2925      StringType t = new StringType();
2926      t.setValue(value);
2927      if (this.synonym == null)
2928        this.synonym = new ArrayList<StringType>();
2929      this.synonym.add(t);
2930      return this;
2931    }
2932
2933    /**
2934     * @param value {@link #synonym} (Additional names for a medication, for example, the name(s) given to a medication in different countries.  For example, acetaminophen and paracetamol or salbutamol and albuterol.)
2935     */
2936    public boolean hasSynonym(String value) { 
2937      if (this.synonym == null)
2938        return false;
2939      for (StringType v : this.synonym)
2940        if (v.getValue().equals(value)) // string
2941          return true;
2942      return false;
2943    }
2944
2945    /**
2946     * @return {@link #relatedMedicationKnowledge} (Associated or related knowledge about a medication.)
2947     */
2948    public List<Reference> getRelatedMedicationKnowledge() { 
2949      if (this.relatedMedicationKnowledge == null)
2950        this.relatedMedicationKnowledge = new ArrayList<Reference>();
2951      return this.relatedMedicationKnowledge;
2952    }
2953
2954    /**
2955     * @return Returns a reference to <code>this</code> for easy method chaining
2956     */
2957    public MedicationKnowledge setRelatedMedicationKnowledge(List<Reference> theRelatedMedicationKnowledge) { 
2958      this.relatedMedicationKnowledge = theRelatedMedicationKnowledge;
2959      return this;
2960    }
2961
2962    public boolean hasRelatedMedicationKnowledge() { 
2963      if (this.relatedMedicationKnowledge == null)
2964        return false;
2965      for (Reference item : this.relatedMedicationKnowledge)
2966        if (!item.isEmpty())
2967          return true;
2968      return false;
2969    }
2970
2971    public Reference addRelatedMedicationKnowledge() { //3
2972      Reference t = new Reference();
2973      if (this.relatedMedicationKnowledge == null)
2974        this.relatedMedicationKnowledge = new ArrayList<Reference>();
2975      this.relatedMedicationKnowledge.add(t);
2976      return t;
2977    }
2978
2979    public MedicationKnowledge addRelatedMedicationKnowledge(Reference t) { //3
2980      if (t == null)
2981        return this;
2982      if (this.relatedMedicationKnowledge == null)
2983        this.relatedMedicationKnowledge = new ArrayList<Reference>();
2984      this.relatedMedicationKnowledge.add(t);
2985      return this;
2986    }
2987
2988    /**
2989     * @return The first repetition of repeating field {@link #relatedMedicationKnowledge}, creating it if it does not already exist
2990     */
2991    public Reference getRelatedMedicationKnowledgeFirstRep() { 
2992      if (getRelatedMedicationKnowledge().isEmpty()) {
2993        addRelatedMedicationKnowledge();
2994      }
2995      return getRelatedMedicationKnowledge().get(0);
2996    }
2997
2998    /**
2999     * @deprecated Use Reference#setResource(IBaseResource) instead
3000     */
3001    @Deprecated
3002    public List<MedicationKnowledge> getRelatedMedicationKnowledgeTarget() { 
3003      if (this.relatedMedicationKnowledgeTarget == null)
3004        this.relatedMedicationKnowledgeTarget = new ArrayList<MedicationKnowledge>();
3005      return this.relatedMedicationKnowledgeTarget;
3006    }
3007
3008    /**
3009     * @deprecated Use Reference#setResource(IBaseResource) instead
3010     */
3011    @Deprecated
3012    public MedicationKnowledge addRelatedMedicationKnowledgeTarget() { 
3013      MedicationKnowledge r = new MedicationKnowledge();
3014      if (this.relatedMedicationKnowledgeTarget == null)
3015        this.relatedMedicationKnowledgeTarget = new ArrayList<MedicationKnowledge>();
3016      this.relatedMedicationKnowledgeTarget.add(r);
3017      return r;
3018    }
3019
3020    /**
3021     * @return {@link #associatedMedication} (Associated or related medications.  For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor).)
3022     */
3023    public Reference getAssociatedMedication() { 
3024      if (this.associatedMedication == null)
3025        if (Configuration.errorOnAutoCreate())
3026          throw new Error("Attempt to auto-create MedicationKnowledge.associatedMedication");
3027        else if (Configuration.doAutoCreate())
3028          this.associatedMedication = new Reference(); // cc
3029      return this.associatedMedication;
3030    }
3031
3032    public boolean hasAssociatedMedication() { 
3033      return this.associatedMedication != null && !this.associatedMedication.isEmpty();
3034    }
3035
3036    /**
3037     * @param value {@link #associatedMedication} (Associated or related medications.  For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor).)
3038     */
3039    public MedicationKnowledge setAssociatedMedication(Reference value) { 
3040      this.associatedMedication = value;
3041      return this;
3042    }
3043
3044    /**
3045     * @return {@link #associatedMedication} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Associated or related medications.  For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor).)
3046     */
3047    public Medication getAssociatedMedicationTarget() { 
3048      if (this.associatedMedicationTarget == null)
3049        if (Configuration.errorOnAutoCreate())
3050          throw new Error("Attempt to auto-create MedicationKnowledge.associatedMedication");
3051        else if (Configuration.doAutoCreate())
3052          this.associatedMedicationTarget = new Medication(); // aa
3053      return this.associatedMedicationTarget;
3054    }
3055
3056    /**
3057     * @param value {@link #associatedMedication} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Associated or related medications.  For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor).)
3058     */
3059    public MedicationKnowledge setAssociatedMedicationTarget(Medication value) { 
3060      this.associatedMedicationTarget = value;
3061      return this;
3062    }
3063
3064    /**
3065     * @return {@link #productType} (Category of the medication or product (e.g. branded product, therapeutic moeity, generic product, innovator product, etc).)
3066     */
3067    public List<CodeableConcept> getProductType() { 
3068      if (this.productType == null)
3069        this.productType = new ArrayList<CodeableConcept>();
3070      return this.productType;
3071    }
3072
3073    /**
3074     * @return Returns a reference to <code>this</code> for easy method chaining
3075     */
3076    public MedicationKnowledge setProductType(List<CodeableConcept> theProductType) { 
3077      this.productType = theProductType;
3078      return this;
3079    }
3080
3081    public boolean hasProductType() { 
3082      if (this.productType == null)
3083        return false;
3084      for (CodeableConcept item : this.productType)
3085        if (!item.isEmpty())
3086          return true;
3087      return false;
3088    }
3089
3090    public CodeableConcept addProductType() { //3
3091      CodeableConcept t = new CodeableConcept();
3092      if (this.productType == null)
3093        this.productType = new ArrayList<CodeableConcept>();
3094      this.productType.add(t);
3095      return t;
3096    }
3097
3098    public MedicationKnowledge addProductType(CodeableConcept t) { //3
3099      if (t == null)
3100        return this;
3101      if (this.productType == null)
3102        this.productType = new ArrayList<CodeableConcept>();
3103      this.productType.add(t);
3104      return this;
3105    }
3106
3107    /**
3108     * @return The first repetition of repeating field {@link #productType}, creating it if it does not already exist
3109     */
3110    public CodeableConcept getProductTypeFirstRep() { 
3111      if (getProductType().isEmpty()) {
3112        addProductType();
3113      }
3114      return getProductType().get(0);
3115    }
3116
3117    /**
3118     * @return {@link #monograph} (Associated documentation about the medication.)
3119     */
3120    public List<MedicationKnowledgeMonographComponent> getMonograph() { 
3121      if (this.monograph == null)
3122        this.monograph = new ArrayList<MedicationKnowledgeMonographComponent>();
3123      return this.monograph;
3124    }
3125
3126    /**
3127     * @return Returns a reference to <code>this</code> for easy method chaining
3128     */
3129    public MedicationKnowledge setMonograph(List<MedicationKnowledgeMonographComponent> theMonograph) { 
3130      this.monograph = theMonograph;
3131      return this;
3132    }
3133
3134    public boolean hasMonograph() { 
3135      if (this.monograph == null)
3136        return false;
3137      for (MedicationKnowledgeMonographComponent item : this.monograph)
3138        if (!item.isEmpty())
3139          return true;
3140      return false;
3141    }
3142
3143    public MedicationKnowledgeMonographComponent addMonograph() { //3
3144      MedicationKnowledgeMonographComponent t = new MedicationKnowledgeMonographComponent();
3145      if (this.monograph == null)
3146        this.monograph = new ArrayList<MedicationKnowledgeMonographComponent>();
3147      this.monograph.add(t);
3148      return t;
3149    }
3150
3151    public MedicationKnowledge addMonograph(MedicationKnowledgeMonographComponent t) { //3
3152      if (t == null)
3153        return this;
3154      if (this.monograph == null)
3155        this.monograph = new ArrayList<MedicationKnowledgeMonographComponent>();
3156      this.monograph.add(t);
3157      return this;
3158    }
3159
3160    /**
3161     * @return The first repetition of repeating field {@link #monograph}, creating it if it does not already exist
3162     */
3163    public MedicationKnowledgeMonographComponent getMonographFirstRep() { 
3164      if (getMonograph().isEmpty()) {
3165        addMonograph();
3166      }
3167      return getMonograph().get(0);
3168    }
3169
3170    /**
3171     * @return {@link #halfLifePeriod} (The time required for any specified property (e.g., the concentration of a substance in the body) to decrease by half.)
3172     */
3173    public Duration getHalfLifePeriod() { 
3174      if (this.halfLifePeriod == null)
3175        if (Configuration.errorOnAutoCreate())
3176          throw new Error("Attempt to auto-create MedicationKnowledge.halfLifePeriod");
3177        else if (Configuration.doAutoCreate())
3178          this.halfLifePeriod = new Duration(); // cc
3179      return this.halfLifePeriod;
3180    }
3181
3182    public boolean hasHalfLifePeriod() { 
3183      return this.halfLifePeriod != null && !this.halfLifePeriod.isEmpty();
3184    }
3185
3186    /**
3187     * @param value {@link #halfLifePeriod} (The time required for any specified property (e.g., the concentration of a substance in the body) to decrease by half.)
3188     */
3189    public MedicationKnowledge setHalfLifePeriod(Duration value) { 
3190      this.halfLifePeriod = value;
3191      return this;
3192    }
3193
3194    /**
3195     * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.)
3196     */
3197    public List<MedicationKnowledgeIngredientComponent> getIngredient() { 
3198      if (this.ingredient == null)
3199        this.ingredient = new ArrayList<MedicationKnowledgeIngredientComponent>();
3200      return this.ingredient;
3201    }
3202
3203    /**
3204     * @return Returns a reference to <code>this</code> for easy method chaining
3205     */
3206    public MedicationKnowledge setIngredient(List<MedicationKnowledgeIngredientComponent> theIngredient) { 
3207      this.ingredient = theIngredient;
3208      return this;
3209    }
3210
3211    public boolean hasIngredient() { 
3212      if (this.ingredient == null)
3213        return false;
3214      for (MedicationKnowledgeIngredientComponent item : this.ingredient)
3215        if (!item.isEmpty())
3216          return true;
3217      return false;
3218    }
3219
3220    public MedicationKnowledgeIngredientComponent addIngredient() { //3
3221      MedicationKnowledgeIngredientComponent t = new MedicationKnowledgeIngredientComponent();
3222      if (this.ingredient == null)
3223        this.ingredient = new ArrayList<MedicationKnowledgeIngredientComponent>();
3224      this.ingredient.add(t);
3225      return t;
3226    }
3227
3228    public MedicationKnowledge addIngredient(MedicationKnowledgeIngredientComponent t) { //3
3229      if (t == null)
3230        return this;
3231      if (this.ingredient == null)
3232        this.ingredient = new ArrayList<MedicationKnowledgeIngredientComponent>();
3233      this.ingredient.add(t);
3234      return this;
3235    }
3236
3237    /**
3238     * @return The first repetition of repeating field {@link #ingredient}, creating it if it does not already exist
3239     */
3240    public MedicationKnowledgeIngredientComponent getIngredientFirstRep() { 
3241      if (getIngredient().isEmpty()) {
3242        addIngredient();
3243      }
3244      return getIngredient().get(0);
3245    }
3246
3247    /**
3248     * @return {@link #preparationInstruction} (The instructions for preparing the medication.). This is the underlying object with id, value and extensions. The accessor "getPreparationInstruction" gives direct access to the value
3249     */
3250    public MarkdownType getPreparationInstructionElement() { 
3251      if (this.preparationInstruction == null)
3252        if (Configuration.errorOnAutoCreate())
3253          throw new Error("Attempt to auto-create MedicationKnowledge.preparationInstruction");
3254        else if (Configuration.doAutoCreate())
3255          this.preparationInstruction = new MarkdownType(); // bb
3256      return this.preparationInstruction;
3257    }
3258
3259    public boolean hasPreparationInstructionElement() { 
3260      return this.preparationInstruction != null && !this.preparationInstruction.isEmpty();
3261    }
3262
3263    public boolean hasPreparationInstruction() { 
3264      return this.preparationInstruction != null && !this.preparationInstruction.isEmpty();
3265    }
3266
3267    /**
3268     * @param value {@link #preparationInstruction} (The instructions for preparing the medication.). This is the underlying object with id, value and extensions. The accessor "getPreparationInstruction" gives direct access to the value
3269     */
3270    public MedicationKnowledge setPreparationInstructionElement(MarkdownType value) { 
3271      this.preparationInstruction = value;
3272      return this;
3273    }
3274
3275    /**
3276     * @return The instructions for preparing the medication.
3277     */
3278    public String getPreparationInstruction() { 
3279      return this.preparationInstruction == null ? null : this.preparationInstruction.getValue();
3280    }
3281
3282    /**
3283     * @param value The instructions for preparing the medication.
3284     */
3285    public MedicationKnowledge setPreparationInstruction(String value) { 
3286      if (value == null)
3287        this.preparationInstruction = null;
3288      else {
3289        if (this.preparationInstruction == null)
3290          this.preparationInstruction = new MarkdownType();
3291        this.preparationInstruction.setValue(value);
3292      }
3293      return this;
3294    }
3295
3296    /**
3297     * @return {@link #intendedRoute} (The intended or approved route of administration.)
3298     */
3299    public List<CodeableConcept> getIntendedRoute() { 
3300      if (this.intendedRoute == null)
3301        this.intendedRoute = new ArrayList<CodeableConcept>();
3302      return this.intendedRoute;
3303    }
3304
3305    /**
3306     * @return Returns a reference to <code>this</code> for easy method chaining
3307     */
3308    public MedicationKnowledge setIntendedRoute(List<CodeableConcept> theIntendedRoute) { 
3309      this.intendedRoute = theIntendedRoute;
3310      return this;
3311    }
3312
3313    public boolean hasIntendedRoute() { 
3314      if (this.intendedRoute == null)
3315        return false;
3316      for (CodeableConcept item : this.intendedRoute)
3317        if (!item.isEmpty())
3318          return true;
3319      return false;
3320    }
3321
3322    public CodeableConcept addIntendedRoute() { //3
3323      CodeableConcept t = new CodeableConcept();
3324      if (this.intendedRoute == null)
3325        this.intendedRoute = new ArrayList<CodeableConcept>();
3326      this.intendedRoute.add(t);
3327      return t;
3328    }
3329
3330    public MedicationKnowledge addIntendedRoute(CodeableConcept t) { //3
3331      if (t == null)
3332        return this;
3333      if (this.intendedRoute == null)
3334        this.intendedRoute = new ArrayList<CodeableConcept>();
3335      this.intendedRoute.add(t);
3336      return this;
3337    }
3338
3339    /**
3340     * @return The first repetition of repeating field {@link #intendedRoute}, creating it if it does not already exist
3341     */
3342    public CodeableConcept getIntendedRouteFirstRep() { 
3343      if (getIntendedRoute().isEmpty()) {
3344        addIntendedRoute();
3345      }
3346      return getIntendedRoute().get(0);
3347    }
3348
3349    /**
3350     * @return {@link #cost} (The price of the medication.)
3351     */
3352    public List<MedicationKnowledgeCostComponent> getCost() { 
3353      if (this.cost == null)
3354        this.cost = new ArrayList<MedicationKnowledgeCostComponent>();
3355      return this.cost;
3356    }
3357
3358    /**
3359     * @return Returns a reference to <code>this</code> for easy method chaining
3360     */
3361    public MedicationKnowledge setCost(List<MedicationKnowledgeCostComponent> theCost) { 
3362      this.cost = theCost;
3363      return this;
3364    }
3365
3366    public boolean hasCost() { 
3367      if (this.cost == null)
3368        return false;
3369      for (MedicationKnowledgeCostComponent item : this.cost)
3370        if (!item.isEmpty())
3371          return true;
3372      return false;
3373    }
3374
3375    public MedicationKnowledgeCostComponent addCost() { //3
3376      MedicationKnowledgeCostComponent t = new MedicationKnowledgeCostComponent();
3377      if (this.cost == null)
3378        this.cost = new ArrayList<MedicationKnowledgeCostComponent>();
3379      this.cost.add(t);
3380      return t;
3381    }
3382
3383    public MedicationKnowledge addCost(MedicationKnowledgeCostComponent t) { //3
3384      if (t == null)
3385        return this;
3386      if (this.cost == null)
3387        this.cost = new ArrayList<MedicationKnowledgeCostComponent>();
3388      this.cost.add(t);
3389      return this;
3390    }
3391
3392    /**
3393     * @return The first repetition of repeating field {@link #cost}, creating it if it does not already exist
3394     */
3395    public MedicationKnowledgeCostComponent getCostFirstRep() { 
3396      if (getCost().isEmpty()) {
3397        addCost();
3398      }
3399      return getCost().get(0);
3400    }
3401
3402    /**
3403     * @return {@link #monitoringProgram} (The program under which the medication is reviewed.)
3404     */
3405    public List<MedicationKnowledgeMonitoringProgramComponent> getMonitoringProgram() { 
3406      if (this.monitoringProgram == null)
3407        this.monitoringProgram = new ArrayList<MedicationKnowledgeMonitoringProgramComponent>();
3408      return this.monitoringProgram;
3409    }
3410
3411    /**
3412     * @return Returns a reference to <code>this</code> for easy method chaining
3413     */
3414    public MedicationKnowledge setMonitoringProgram(List<MedicationKnowledgeMonitoringProgramComponent> theMonitoringProgram) { 
3415      this.monitoringProgram = theMonitoringProgram;
3416      return this;
3417    }
3418
3419    public boolean hasMonitoringProgram() { 
3420      if (this.monitoringProgram == null)
3421        return false;
3422      for (MedicationKnowledgeMonitoringProgramComponent item : this.monitoringProgram)
3423        if (!item.isEmpty())
3424          return true;
3425      return false;
3426    }
3427
3428    public MedicationKnowledgeMonitoringProgramComponent addMonitoringProgram() { //3
3429      MedicationKnowledgeMonitoringProgramComponent t = new MedicationKnowledgeMonitoringProgramComponent();
3430      if (this.monitoringProgram == null)
3431        this.monitoringProgram = new ArrayList<MedicationKnowledgeMonitoringProgramComponent>();
3432      this.monitoringProgram.add(t);
3433      return t;
3434    }
3435
3436    public MedicationKnowledge addMonitoringProgram(MedicationKnowledgeMonitoringProgramComponent t) { //3
3437      if (t == null)
3438        return this;
3439      if (this.monitoringProgram == null)
3440        this.monitoringProgram = new ArrayList<MedicationKnowledgeMonitoringProgramComponent>();
3441      this.monitoringProgram.add(t);
3442      return this;
3443    }
3444
3445    /**
3446     * @return The first repetition of repeating field {@link #monitoringProgram}, creating it if it does not already exist
3447     */
3448    public MedicationKnowledgeMonitoringProgramComponent getMonitoringProgramFirstRep() { 
3449      if (getMonitoringProgram().isEmpty()) {
3450        addMonitoringProgram();
3451      }
3452      return getMonitoringProgram().get(0);
3453    }
3454
3455    /**
3456     * @return {@link #administrationGuidelines} (Guidelines for the administration of the medication.)
3457     */
3458    public List<MedicationKnowledgeAdministrationGuidelinesComponent> getAdministrationGuidelines() { 
3459      if (this.administrationGuidelines == null)
3460        this.administrationGuidelines = new ArrayList<MedicationKnowledgeAdministrationGuidelinesComponent>();
3461      return this.administrationGuidelines;
3462    }
3463
3464    /**
3465     * @return Returns a reference to <code>this</code> for easy method chaining
3466     */
3467    public MedicationKnowledge setAdministrationGuidelines(List<MedicationKnowledgeAdministrationGuidelinesComponent> theAdministrationGuidelines) { 
3468      this.administrationGuidelines = theAdministrationGuidelines;
3469      return this;
3470    }
3471
3472    public boolean hasAdministrationGuidelines() { 
3473      if (this.administrationGuidelines == null)
3474        return false;
3475      for (MedicationKnowledgeAdministrationGuidelinesComponent item : this.administrationGuidelines)
3476        if (!item.isEmpty())
3477          return true;
3478      return false;
3479    }
3480
3481    public MedicationKnowledgeAdministrationGuidelinesComponent addAdministrationGuidelines() { //3
3482      MedicationKnowledgeAdministrationGuidelinesComponent t = new MedicationKnowledgeAdministrationGuidelinesComponent();
3483      if (this.administrationGuidelines == null)
3484        this.administrationGuidelines = new ArrayList<MedicationKnowledgeAdministrationGuidelinesComponent>();
3485      this.administrationGuidelines.add(t);
3486      return t;
3487    }
3488
3489    public MedicationKnowledge addAdministrationGuidelines(MedicationKnowledgeAdministrationGuidelinesComponent t) { //3
3490      if (t == null)
3491        return this;
3492      if (this.administrationGuidelines == null)
3493        this.administrationGuidelines = new ArrayList<MedicationKnowledgeAdministrationGuidelinesComponent>();
3494      this.administrationGuidelines.add(t);
3495      return this;
3496    }
3497
3498    /**
3499     * @return The first repetition of repeating field {@link #administrationGuidelines}, creating it if it does not already exist
3500     */
3501    public MedicationKnowledgeAdministrationGuidelinesComponent getAdministrationGuidelinesFirstRep() { 
3502      if (getAdministrationGuidelines().isEmpty()) {
3503        addAdministrationGuidelines();
3504      }
3505      return getAdministrationGuidelines().get(0);
3506    }
3507
3508    /**
3509     * @return {@link #medicineClassification} (Categorization of the medication within a formulary or classification system.)
3510     */
3511    public List<MedicationKnowledgeMedicineClassificationComponent> getMedicineClassification() { 
3512      if (this.medicineClassification == null)
3513        this.medicineClassification = new ArrayList<MedicationKnowledgeMedicineClassificationComponent>();
3514      return this.medicineClassification;
3515    }
3516
3517    /**
3518     * @return Returns a reference to <code>this</code> for easy method chaining
3519     */
3520    public MedicationKnowledge setMedicineClassification(List<MedicationKnowledgeMedicineClassificationComponent> theMedicineClassification) { 
3521      this.medicineClassification = theMedicineClassification;
3522      return this;
3523    }
3524
3525    public boolean hasMedicineClassification() { 
3526      if (this.medicineClassification == null)
3527        return false;
3528      for (MedicationKnowledgeMedicineClassificationComponent item : this.medicineClassification)
3529        if (!item.isEmpty())
3530          return true;
3531      return false;
3532    }
3533
3534    public MedicationKnowledgeMedicineClassificationComponent addMedicineClassification() { //3
3535      MedicationKnowledgeMedicineClassificationComponent t = new MedicationKnowledgeMedicineClassificationComponent();
3536      if (this.medicineClassification == null)
3537        this.medicineClassification = new ArrayList<MedicationKnowledgeMedicineClassificationComponent>();
3538      this.medicineClassification.add(t);
3539      return t;
3540    }
3541
3542    public MedicationKnowledge addMedicineClassification(MedicationKnowledgeMedicineClassificationComponent t) { //3
3543      if (t == null)
3544        return this;
3545      if (this.medicineClassification == null)
3546        this.medicineClassification = new ArrayList<MedicationKnowledgeMedicineClassificationComponent>();
3547      this.medicineClassification.add(t);
3548      return this;
3549    }
3550
3551    /**
3552     * @return The first repetition of repeating field {@link #medicineClassification}, creating it if it does not already exist
3553     */
3554    public MedicationKnowledgeMedicineClassificationComponent getMedicineClassificationFirstRep() { 
3555      if (getMedicineClassification().isEmpty()) {
3556        addMedicineClassification();
3557      }
3558      return getMedicineClassification().get(0);
3559    }
3560
3561    /**
3562     * @return {@link #packaging} (Information that only applies to packages (not products).)
3563     */
3564    public MedicationKnowledgePackagingComponent getPackaging() { 
3565      if (this.packaging == null)
3566        if (Configuration.errorOnAutoCreate())
3567          throw new Error("Attempt to auto-create MedicationKnowledge.packaging");
3568        else if (Configuration.doAutoCreate())
3569          this.packaging = new MedicationKnowledgePackagingComponent(); // cc
3570      return this.packaging;
3571    }
3572
3573    public boolean hasPackaging() { 
3574      return this.packaging != null && !this.packaging.isEmpty();
3575    }
3576
3577    /**
3578     * @param value {@link #packaging} (Information that only applies to packages (not products).)
3579     */
3580    public MedicationKnowledge setPackaging(MedicationKnowledgePackagingComponent value) { 
3581      this.packaging = value;
3582      return this;
3583    }
3584
3585    /**
3586     * @return {@link #drugCharacteristic} (Specifies descriptive properties of the medicine, such as color, shape, imprints, etc.)
3587     */
3588    public List<MedicationKnowledgeDrugCharacteristicComponent> getDrugCharacteristic() { 
3589      if (this.drugCharacteristic == null)
3590        this.drugCharacteristic = new ArrayList<MedicationKnowledgeDrugCharacteristicComponent>();
3591      return this.drugCharacteristic;
3592    }
3593
3594    /**
3595     * @return Returns a reference to <code>this</code> for easy method chaining
3596     */
3597    public MedicationKnowledge setDrugCharacteristic(List<MedicationKnowledgeDrugCharacteristicComponent> theDrugCharacteristic) { 
3598      this.drugCharacteristic = theDrugCharacteristic;
3599      return this;
3600    }
3601
3602    public boolean hasDrugCharacteristic() { 
3603      if (this.drugCharacteristic == null)
3604        return false;
3605      for (MedicationKnowledgeDrugCharacteristicComponent item : this.drugCharacteristic)
3606        if (!item.isEmpty())
3607          return true;
3608      return false;
3609    }
3610
3611    public MedicationKnowledgeDrugCharacteristicComponent addDrugCharacteristic() { //3
3612      MedicationKnowledgeDrugCharacteristicComponent t = new MedicationKnowledgeDrugCharacteristicComponent();
3613      if (this.drugCharacteristic == null)
3614        this.drugCharacteristic = new ArrayList<MedicationKnowledgeDrugCharacteristicComponent>();
3615      this.drugCharacteristic.add(t);
3616      return t;
3617    }
3618
3619    public MedicationKnowledge addDrugCharacteristic(MedicationKnowledgeDrugCharacteristicComponent t) { //3
3620      if (t == null)
3621        return this;
3622      if (this.drugCharacteristic == null)
3623        this.drugCharacteristic = new ArrayList<MedicationKnowledgeDrugCharacteristicComponent>();
3624      this.drugCharacteristic.add(t);
3625      return this;
3626    }
3627
3628    /**
3629     * @return The first repetition of repeating field {@link #drugCharacteristic}, creating it if it does not already exist
3630     */
3631    public MedicationKnowledgeDrugCharacteristicComponent getDrugCharacteristicFirstRep() { 
3632      if (getDrugCharacteristic().isEmpty()) {
3633        addDrugCharacteristic();
3634      }
3635      return getDrugCharacteristic().get(0);
3636    }
3637
3638    /**
3639     * @return {@link #contraindication} (Potential clinical issue with or between medication(s) (for example, drug-drug interaction, drug-disease contraindication, drug-allergy interaction, etc).)
3640     */
3641    public List<Reference> getContraindication() { 
3642      if (this.contraindication == null)
3643        this.contraindication = new ArrayList<Reference>();
3644      return this.contraindication;
3645    }
3646
3647    /**
3648     * @return Returns a reference to <code>this</code> for easy method chaining
3649     */
3650    public MedicationKnowledge setContraindication(List<Reference> theContraindication) { 
3651      this.contraindication = theContraindication;
3652      return this;
3653    }
3654
3655    public boolean hasContraindication() { 
3656      if (this.contraindication == null)
3657        return false;
3658      for (Reference item : this.contraindication)
3659        if (!item.isEmpty())
3660          return true;
3661      return false;
3662    }
3663
3664    public Reference addContraindication() { //3
3665      Reference t = new Reference();
3666      if (this.contraindication == null)
3667        this.contraindication = new ArrayList<Reference>();
3668      this.contraindication.add(t);
3669      return t;
3670    }
3671
3672    public MedicationKnowledge addContraindication(Reference t) { //3
3673      if (t == null)
3674        return this;
3675      if (this.contraindication == null)
3676        this.contraindication = new ArrayList<Reference>();
3677      this.contraindication.add(t);
3678      return this;
3679    }
3680
3681    /**
3682     * @return The first repetition of repeating field {@link #contraindication}, creating it if it does not already exist
3683     */
3684    public Reference getContraindicationFirstRep() { 
3685      if (getContraindication().isEmpty()) {
3686        addContraindication();
3687      }
3688      return getContraindication().get(0);
3689    }
3690
3691    /**
3692     * @deprecated Use Reference#setResource(IBaseResource) instead
3693     */
3694    @Deprecated
3695    public List<DetectedIssue> getContraindicationTarget() { 
3696      if (this.contraindicationTarget == null)
3697        this.contraindicationTarget = new ArrayList<DetectedIssue>();
3698      return this.contraindicationTarget;
3699    }
3700
3701    /**
3702     * @deprecated Use Reference#setResource(IBaseResource) instead
3703     */
3704    @Deprecated
3705    public DetectedIssue addContraindicationTarget() { 
3706      DetectedIssue r = new DetectedIssue();
3707      if (this.contraindicationTarget == null)
3708        this.contraindicationTarget = new ArrayList<DetectedIssue>();
3709      this.contraindicationTarget.add(r);
3710      return r;
3711    }
3712
3713      protected void listChildren(List<Property> children) {
3714        super.listChildren(children);
3715        children.add(new Property("code", "CodeableConcept", "A code that specifies 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));
3716        children.add(new Property("status", "code", "A code to indicate if the medication is in active use.", 0, 1, status));
3717        children.add(new Property("manufacturer", "Reference(Organization)", "Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.", 0, 1, manufacturer));
3718        children.add(new Property("form", "CodeableConcept", "Describes the form of the item.  Powder; tablets; capsule.", 0, 1, form));
3719        children.add(new Property("amount", "SimpleQuantity", "Specific amount of the drug in the packaged 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, amount));
3720        children.add(new Property("synonym", "string", "Additional names for a medication, for example, the name(s) given to a medication in different countries.  For example, acetaminophen and paracetamol or salbutamol and albuterol.", 0, java.lang.Integer.MAX_VALUE, synonym));
3721        children.add(new Property("relatedMedicationKnowledge", "Reference(MedicationKnowledge)", "Associated or related knowledge about a medication.", 0, java.lang.Integer.MAX_VALUE, relatedMedicationKnowledge));
3722        children.add(new Property("associatedMedication", "Reference(Medication)", "Associated or related medications.  For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor).", 0, 1, associatedMedication));
3723        children.add(new Property("productType", "CodeableConcept", "Category of the medication or product (e.g. branded product, therapeutic moeity, generic product, innovator product, etc).", 0, java.lang.Integer.MAX_VALUE, productType));
3724        children.add(new Property("monograph", "", "Associated documentation about the medication.", 0, java.lang.Integer.MAX_VALUE, monograph));
3725        children.add(new Property("halfLifePeriod", "Duration", "The time required for any specified property (e.g., the concentration of a substance in the body) to decrease by half.", 0, 1, halfLifePeriod));
3726        children.add(new Property("ingredient", "", "Identifies a particular constituent of interest in the product.", 0, java.lang.Integer.MAX_VALUE, ingredient));
3727        children.add(new Property("preparationInstruction", "markdown", "The instructions for preparing the medication.", 0, 1, preparationInstruction));
3728        children.add(new Property("intendedRoute", "CodeableConcept", "The intended or approved route of administration.", 0, java.lang.Integer.MAX_VALUE, intendedRoute));
3729        children.add(new Property("cost", "", "The price of the medication.", 0, java.lang.Integer.MAX_VALUE, cost));
3730        children.add(new Property("monitoringProgram", "", "The program under which the medication is reviewed.", 0, java.lang.Integer.MAX_VALUE, monitoringProgram));
3731        children.add(new Property("administrationGuidelines", "", "Guidelines for the administration of the medication.", 0, java.lang.Integer.MAX_VALUE, administrationGuidelines));
3732        children.add(new Property("medicineClassification", "", "Categorization of the medication within a formulary or classification system.", 0, java.lang.Integer.MAX_VALUE, medicineClassification));
3733        children.add(new Property("packaging", "", "Information that only applies to packages (not products).", 0, 1, packaging));
3734        children.add(new Property("drugCharacteristic", "", "Specifies descriptive properties of the medicine, such as color, shape, imprints, etc.", 0, java.lang.Integer.MAX_VALUE, drugCharacteristic));
3735        children.add(new Property("contraindication", "Reference(DetectedIssue)", "Potential clinical issue with or between medication(s) (for example, drug-drug interaction, drug-disease contraindication, drug-allergy interaction, etc).", 0, java.lang.Integer.MAX_VALUE, contraindication));
3736      }
3737
3738      @Override
3739      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3740        switch (_hash) {
3741        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A code that specifies 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);
3742        case -892481550: /*status*/  return new Property("status", "code", "A code to indicate if the medication is in active use.", 0, 1, status);
3743        case -1969347631: /*manufacturer*/  return new Property("manufacturer", "Reference(Organization)", "Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.", 0, 1, manufacturer);
3744        case 3148996: /*form*/  return new Property("form", "CodeableConcept", "Describes the form of the item.  Powder; tablets; capsule.", 0, 1, form);
3745        case -1413853096: /*amount*/  return new Property("amount", "SimpleQuantity", "Specific amount of the drug in the packaged 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, amount);
3746        case -1742128133: /*synonym*/  return new Property("synonym", "string", "Additional names for a medication, for example, the name(s) given to a medication in different countries.  For example, acetaminophen and paracetamol or salbutamol and albuterol.", 0, java.lang.Integer.MAX_VALUE, synonym);
3747        case 723067972: /*relatedMedicationKnowledge*/  return new Property("relatedMedicationKnowledge", "Reference(MedicationKnowledge)", "Associated or related knowledge about a medication.", 0, java.lang.Integer.MAX_VALUE, relatedMedicationKnowledge);
3748        case 1312779381: /*associatedMedication*/  return new Property("associatedMedication", "Reference(Medication)", "Associated or related medications.  For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor).", 0, 1, associatedMedication);
3749        case -1491615543: /*productType*/  return new Property("productType", "CodeableConcept", "Category of the medication or product (e.g. branded product, therapeutic moeity, generic product, innovator product, etc).", 0, java.lang.Integer.MAX_VALUE, productType);
3750        case -1442980789: /*monograph*/  return new Property("monograph", "", "Associated documentation about the medication.", 0, java.lang.Integer.MAX_VALUE, monograph);
3751        case -628810640: /*halfLifePeriod*/  return new Property("halfLifePeriod", "Duration", "The time required for any specified property (e.g., the concentration of a substance in the body) to decrease by half.", 0, 1, halfLifePeriod);
3752        case -206409263: /*ingredient*/  return new Property("ingredient", "", "Identifies a particular constituent of interest in the product.", 0, java.lang.Integer.MAX_VALUE, ingredient);
3753        case 1025456503: /*preparationInstruction*/  return new Property("preparationInstruction", "markdown", "The instructions for preparing the medication.", 0, 1, preparationInstruction);
3754        case -767798050: /*intendedRoute*/  return new Property("intendedRoute", "CodeableConcept", "The intended or approved route of administration.", 0, java.lang.Integer.MAX_VALUE, intendedRoute);
3755        case 3059661: /*cost*/  return new Property("cost", "", "The price of the medication.", 0, java.lang.Integer.MAX_VALUE, cost);
3756        case 569848092: /*monitoringProgram*/  return new Property("monitoringProgram", "", "The program under which the medication is reviewed.", 0, java.lang.Integer.MAX_VALUE, monitoringProgram);
3757        case 496930945: /*administrationGuidelines*/  return new Property("administrationGuidelines", "", "Guidelines for the administration of the medication.", 0, java.lang.Integer.MAX_VALUE, administrationGuidelines);
3758        case 1791551680: /*medicineClassification*/  return new Property("medicineClassification", "", "Categorization of the medication within a formulary or classification system.", 0, java.lang.Integer.MAX_VALUE, medicineClassification);
3759        case 1802065795: /*packaging*/  return new Property("packaging", "", "Information that only applies to packages (not products).", 0, 1, packaging);
3760        case -844126885: /*drugCharacteristic*/  return new Property("drugCharacteristic", "", "Specifies descriptive properties of the medicine, such as color, shape, imprints, etc.", 0, java.lang.Integer.MAX_VALUE, drugCharacteristic);
3761        case 107135229: /*contraindication*/  return new Property("contraindication", "Reference(DetectedIssue)", "Potential clinical issue with or between medication(s) (for example, drug-drug interaction, drug-disease contraindication, drug-allergy interaction, etc).", 0, java.lang.Integer.MAX_VALUE, contraindication);
3762        default: return super.getNamedProperty(_hash, _name, _checkValid);
3763        }
3764
3765      }
3766
3767      @Override
3768      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3769        switch (hash) {
3770        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
3771        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<MedicationKnowledgeStatus>
3772        case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // Reference
3773        case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // CodeableConcept
3774        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // SimpleQuantity
3775        case -1742128133: /*synonym*/ return this.synonym == null ? new Base[0] : this.synonym.toArray(new Base[this.synonym.size()]); // StringType
3776        case 723067972: /*relatedMedicationKnowledge*/ return this.relatedMedicationKnowledge == null ? new Base[0] : this.relatedMedicationKnowledge.toArray(new Base[this.relatedMedicationKnowledge.size()]); // Reference
3777        case 1312779381: /*associatedMedication*/ return this.associatedMedication == null ? new Base[0] : new Base[] {this.associatedMedication}; // Reference
3778        case -1491615543: /*productType*/ return this.productType == null ? new Base[0] : this.productType.toArray(new Base[this.productType.size()]); // CodeableConcept
3779        case -1442980789: /*monograph*/ return this.monograph == null ? new Base[0] : this.monograph.toArray(new Base[this.monograph.size()]); // MedicationKnowledgeMonographComponent
3780        case -628810640: /*halfLifePeriod*/ return this.halfLifePeriod == null ? new Base[0] : new Base[] {this.halfLifePeriod}; // Duration
3781        case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // MedicationKnowledgeIngredientComponent
3782        case 1025456503: /*preparationInstruction*/ return this.preparationInstruction == null ? new Base[0] : new Base[] {this.preparationInstruction}; // MarkdownType
3783        case -767798050: /*intendedRoute*/ return this.intendedRoute == null ? new Base[0] : this.intendedRoute.toArray(new Base[this.intendedRoute.size()]); // CodeableConcept
3784        case 3059661: /*cost*/ return this.cost == null ? new Base[0] : this.cost.toArray(new Base[this.cost.size()]); // MedicationKnowledgeCostComponent
3785        case 569848092: /*monitoringProgram*/ return this.monitoringProgram == null ? new Base[0] : this.monitoringProgram.toArray(new Base[this.monitoringProgram.size()]); // MedicationKnowledgeMonitoringProgramComponent
3786        case 496930945: /*administrationGuidelines*/ return this.administrationGuidelines == null ? new Base[0] : this.administrationGuidelines.toArray(new Base[this.administrationGuidelines.size()]); // MedicationKnowledgeAdministrationGuidelinesComponent
3787        case 1791551680: /*medicineClassification*/ return this.medicineClassification == null ? new Base[0] : this.medicineClassification.toArray(new Base[this.medicineClassification.size()]); // MedicationKnowledgeMedicineClassificationComponent
3788        case 1802065795: /*packaging*/ return this.packaging == null ? new Base[0] : new Base[] {this.packaging}; // MedicationKnowledgePackagingComponent
3789        case -844126885: /*drugCharacteristic*/ return this.drugCharacteristic == null ? new Base[0] : this.drugCharacteristic.toArray(new Base[this.drugCharacteristic.size()]); // MedicationKnowledgeDrugCharacteristicComponent
3790        case 107135229: /*contraindication*/ return this.contraindication == null ? new Base[0] : this.contraindication.toArray(new Base[this.contraindication.size()]); // Reference
3791        default: return super.getProperty(hash, name, checkValid);
3792        }
3793
3794      }
3795
3796      @Override
3797      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3798        switch (hash) {
3799        case 3059181: // code
3800          this.code = castToCodeableConcept(value); // CodeableConcept
3801          return value;
3802        case -892481550: // status
3803          value = new MedicationKnowledgeStatusEnumFactory().fromType(castToCode(value));
3804          this.status = (Enumeration) value; // Enumeration<MedicationKnowledgeStatus>
3805          return value;
3806        case -1969347631: // manufacturer
3807          this.manufacturer = castToReference(value); // Reference
3808          return value;
3809        case 3148996: // form
3810          this.form = castToCodeableConcept(value); // CodeableConcept
3811          return value;
3812        case -1413853096: // amount
3813          this.amount = castToSimpleQuantity(value); // SimpleQuantity
3814          return value;
3815        case -1742128133: // synonym
3816          this.getSynonym().add(castToString(value)); // StringType
3817          return value;
3818        case 723067972: // relatedMedicationKnowledge
3819          this.getRelatedMedicationKnowledge().add(castToReference(value)); // Reference
3820          return value;
3821        case 1312779381: // associatedMedication
3822          this.associatedMedication = castToReference(value); // Reference
3823          return value;
3824        case -1491615543: // productType
3825          this.getProductType().add(castToCodeableConcept(value)); // CodeableConcept
3826          return value;
3827        case -1442980789: // monograph
3828          this.getMonograph().add((MedicationKnowledgeMonographComponent) value); // MedicationKnowledgeMonographComponent
3829          return value;
3830        case -628810640: // halfLifePeriod
3831          this.halfLifePeriod = castToDuration(value); // Duration
3832          return value;
3833        case -206409263: // ingredient
3834          this.getIngredient().add((MedicationKnowledgeIngredientComponent) value); // MedicationKnowledgeIngredientComponent
3835          return value;
3836        case 1025456503: // preparationInstruction
3837          this.preparationInstruction = castToMarkdown(value); // MarkdownType
3838          return value;
3839        case -767798050: // intendedRoute
3840          this.getIntendedRoute().add(castToCodeableConcept(value)); // CodeableConcept
3841          return value;
3842        case 3059661: // cost
3843          this.getCost().add((MedicationKnowledgeCostComponent) value); // MedicationKnowledgeCostComponent
3844          return value;
3845        case 569848092: // monitoringProgram
3846          this.getMonitoringProgram().add((MedicationKnowledgeMonitoringProgramComponent) value); // MedicationKnowledgeMonitoringProgramComponent
3847          return value;
3848        case 496930945: // administrationGuidelines
3849          this.getAdministrationGuidelines().add((MedicationKnowledgeAdministrationGuidelinesComponent) value); // MedicationKnowledgeAdministrationGuidelinesComponent
3850          return value;
3851        case 1791551680: // medicineClassification
3852          this.getMedicineClassification().add((MedicationKnowledgeMedicineClassificationComponent) value); // MedicationKnowledgeMedicineClassificationComponent
3853          return value;
3854        case 1802065795: // packaging
3855          this.packaging = (MedicationKnowledgePackagingComponent) value; // MedicationKnowledgePackagingComponent
3856          return value;
3857        case -844126885: // drugCharacteristic
3858          this.getDrugCharacteristic().add((MedicationKnowledgeDrugCharacteristicComponent) value); // MedicationKnowledgeDrugCharacteristicComponent
3859          return value;
3860        case 107135229: // contraindication
3861          this.getContraindication().add(castToReference(value)); // Reference
3862          return value;
3863        default: return super.setProperty(hash, name, value);
3864        }
3865
3866      }
3867
3868      @Override
3869      public Base setProperty(String name, Base value) throws FHIRException {
3870        if (name.equals("code")) {
3871          this.code = castToCodeableConcept(value); // CodeableConcept
3872        } else if (name.equals("status")) {
3873          value = new MedicationKnowledgeStatusEnumFactory().fromType(castToCode(value));
3874          this.status = (Enumeration) value; // Enumeration<MedicationKnowledgeStatus>
3875        } else if (name.equals("manufacturer")) {
3876          this.manufacturer = castToReference(value); // Reference
3877        } else if (name.equals("form")) {
3878          this.form = castToCodeableConcept(value); // CodeableConcept
3879        } else if (name.equals("amount")) {
3880          this.amount = castToSimpleQuantity(value); // SimpleQuantity
3881        } else if (name.equals("synonym")) {
3882          this.getSynonym().add(castToString(value));
3883        } else if (name.equals("relatedMedicationKnowledge")) {
3884          this.getRelatedMedicationKnowledge().add(castToReference(value));
3885        } else if (name.equals("associatedMedication")) {
3886          this.associatedMedication = castToReference(value); // Reference
3887        } else if (name.equals("productType")) {
3888          this.getProductType().add(castToCodeableConcept(value));
3889        } else if (name.equals("monograph")) {
3890          this.getMonograph().add((MedicationKnowledgeMonographComponent) value);
3891        } else if (name.equals("halfLifePeriod")) {
3892          this.halfLifePeriod = castToDuration(value); // Duration
3893        } else if (name.equals("ingredient")) {
3894          this.getIngredient().add((MedicationKnowledgeIngredientComponent) value);
3895        } else if (name.equals("preparationInstruction")) {
3896          this.preparationInstruction = castToMarkdown(value); // MarkdownType
3897        } else if (name.equals("intendedRoute")) {
3898          this.getIntendedRoute().add(castToCodeableConcept(value));
3899        } else if (name.equals("cost")) {
3900          this.getCost().add((MedicationKnowledgeCostComponent) value);
3901        } else if (name.equals("monitoringProgram")) {
3902          this.getMonitoringProgram().add((MedicationKnowledgeMonitoringProgramComponent) value);
3903        } else if (name.equals("administrationGuidelines")) {
3904          this.getAdministrationGuidelines().add((MedicationKnowledgeAdministrationGuidelinesComponent) value);
3905        } else if (name.equals("medicineClassification")) {
3906          this.getMedicineClassification().add((MedicationKnowledgeMedicineClassificationComponent) value);
3907        } else if (name.equals("packaging")) {
3908          this.packaging = (MedicationKnowledgePackagingComponent) value; // MedicationKnowledgePackagingComponent
3909        } else if (name.equals("drugCharacteristic")) {
3910          this.getDrugCharacteristic().add((MedicationKnowledgeDrugCharacteristicComponent) value);
3911        } else if (name.equals("contraindication")) {
3912          this.getContraindication().add(castToReference(value));
3913        } else
3914          return super.setProperty(name, value);
3915        return value;
3916      }
3917
3918      @Override
3919      public Base makeProperty(int hash, String name) throws FHIRException {
3920        switch (hash) {
3921        case 3059181:  return getCode(); 
3922        case -892481550:  return getStatusElement();
3923        case -1969347631:  return getManufacturer(); 
3924        case 3148996:  return getForm(); 
3925        case -1413853096:  return getAmount(); 
3926        case -1742128133:  return addSynonymElement();
3927        case 723067972:  return addRelatedMedicationKnowledge(); 
3928        case 1312779381:  return getAssociatedMedication(); 
3929        case -1491615543:  return addProductType(); 
3930        case -1442980789:  return addMonograph(); 
3931        case -628810640:  return getHalfLifePeriod(); 
3932        case -206409263:  return addIngredient(); 
3933        case 1025456503:  return getPreparationInstructionElement();
3934        case -767798050:  return addIntendedRoute(); 
3935        case 3059661:  return addCost(); 
3936        case 569848092:  return addMonitoringProgram(); 
3937        case 496930945:  return addAdministrationGuidelines(); 
3938        case 1791551680:  return addMedicineClassification(); 
3939        case 1802065795:  return getPackaging(); 
3940        case -844126885:  return addDrugCharacteristic(); 
3941        case 107135229:  return addContraindication(); 
3942        default: return super.makeProperty(hash, name);
3943        }
3944
3945      }
3946
3947      @Override
3948      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3949        switch (hash) {
3950        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
3951        case -892481550: /*status*/ return new String[] {"code"};
3952        case -1969347631: /*manufacturer*/ return new String[] {"Reference"};
3953        case 3148996: /*form*/ return new String[] {"CodeableConcept"};
3954        case -1413853096: /*amount*/ return new String[] {"SimpleQuantity"};
3955        case -1742128133: /*synonym*/ return new String[] {"string"};
3956        case 723067972: /*relatedMedicationKnowledge*/ return new String[] {"Reference"};
3957        case 1312779381: /*associatedMedication*/ return new String[] {"Reference"};
3958        case -1491615543: /*productType*/ return new String[] {"CodeableConcept"};
3959        case -1442980789: /*monograph*/ return new String[] {};
3960        case -628810640: /*halfLifePeriod*/ return new String[] {"Duration"};
3961        case -206409263: /*ingredient*/ return new String[] {};
3962        case 1025456503: /*preparationInstruction*/ return new String[] {"markdown"};
3963        case -767798050: /*intendedRoute*/ return new String[] {"CodeableConcept"};
3964        case 3059661: /*cost*/ return new String[] {};
3965        case 569848092: /*monitoringProgram*/ return new String[] {};
3966        case 496930945: /*administrationGuidelines*/ return new String[] {};
3967        case 1791551680: /*medicineClassification*/ return new String[] {};
3968        case 1802065795: /*packaging*/ return new String[] {};
3969        case -844126885: /*drugCharacteristic*/ return new String[] {};
3970        case 107135229: /*contraindication*/ return new String[] {"Reference"};
3971        default: return super.getTypesForProperty(hash, name);
3972        }
3973
3974      }
3975
3976      @Override
3977      public Base addChild(String name) throws FHIRException {
3978        if (name.equals("code")) {
3979          this.code = new CodeableConcept();
3980          return this.code;
3981        }
3982        else if (name.equals("status")) {
3983          throw new FHIRException("Cannot call addChild on a primitive type MedicationKnowledge.status");
3984        }
3985        else if (name.equals("manufacturer")) {
3986          this.manufacturer = new Reference();
3987          return this.manufacturer;
3988        }
3989        else if (name.equals("form")) {
3990          this.form = new CodeableConcept();
3991          return this.form;
3992        }
3993        else if (name.equals("amount")) {
3994          this.amount = new SimpleQuantity();
3995          return this.amount;
3996        }
3997        else if (name.equals("synonym")) {
3998          throw new FHIRException("Cannot call addChild on a primitive type MedicationKnowledge.synonym");
3999        }
4000        else if (name.equals("relatedMedicationKnowledge")) {
4001          return addRelatedMedicationKnowledge();
4002        }
4003        else if (name.equals("associatedMedication")) {
4004          this.associatedMedication = new Reference();
4005          return this.associatedMedication;
4006        }
4007        else if (name.equals("productType")) {
4008          return addProductType();
4009        }
4010        else if (name.equals("monograph")) {
4011          return addMonograph();
4012        }
4013        else if (name.equals("halfLifePeriod")) {
4014          this.halfLifePeriod = new Duration();
4015          return this.halfLifePeriod;
4016        }
4017        else if (name.equals("ingredient")) {
4018          return addIngredient();
4019        }
4020        else if (name.equals("preparationInstruction")) {
4021          throw new FHIRException("Cannot call addChild on a primitive type MedicationKnowledge.preparationInstruction");
4022        }
4023        else if (name.equals("intendedRoute")) {
4024          return addIntendedRoute();
4025        }
4026        else if (name.equals("cost")) {
4027          return addCost();
4028        }
4029        else if (name.equals("monitoringProgram")) {
4030          return addMonitoringProgram();
4031        }
4032        else if (name.equals("administrationGuidelines")) {
4033          return addAdministrationGuidelines();
4034        }
4035        else if (name.equals("medicineClassification")) {
4036          return addMedicineClassification();
4037        }
4038        else if (name.equals("packaging")) {
4039          this.packaging = new MedicationKnowledgePackagingComponent();
4040          return this.packaging;
4041        }
4042        else if (name.equals("drugCharacteristic")) {
4043          return addDrugCharacteristic();
4044        }
4045        else if (name.equals("contraindication")) {
4046          return addContraindication();
4047        }
4048        else
4049          return super.addChild(name);
4050      }
4051
4052  public String fhirType() {
4053    return "MedicationKnowledge";
4054
4055  }
4056
4057      public MedicationKnowledge copy() {
4058        MedicationKnowledge dst = new MedicationKnowledge();
4059        copyValues(dst);
4060        dst.code = code == null ? null : code.copy();
4061        dst.status = status == null ? null : status.copy();
4062        dst.manufacturer = manufacturer == null ? null : manufacturer.copy();
4063        dst.form = form == null ? null : form.copy();
4064        dst.amount = amount == null ? null : amount.copy();
4065        if (synonym != null) {
4066          dst.synonym = new ArrayList<StringType>();
4067          for (StringType i : synonym)
4068            dst.synonym.add(i.copy());
4069        };
4070        if (relatedMedicationKnowledge != null) {
4071          dst.relatedMedicationKnowledge = new ArrayList<Reference>();
4072          for (Reference i : relatedMedicationKnowledge)
4073            dst.relatedMedicationKnowledge.add(i.copy());
4074        };
4075        dst.associatedMedication = associatedMedication == null ? null : associatedMedication.copy();
4076        if (productType != null) {
4077          dst.productType = new ArrayList<CodeableConcept>();
4078          for (CodeableConcept i : productType)
4079            dst.productType.add(i.copy());
4080        };
4081        if (monograph != null) {
4082          dst.monograph = new ArrayList<MedicationKnowledgeMonographComponent>();
4083          for (MedicationKnowledgeMonographComponent i : monograph)
4084            dst.monograph.add(i.copy());
4085        };
4086        dst.halfLifePeriod = halfLifePeriod == null ? null : halfLifePeriod.copy();
4087        if (ingredient != null) {
4088          dst.ingredient = new ArrayList<MedicationKnowledgeIngredientComponent>();
4089          for (MedicationKnowledgeIngredientComponent i : ingredient)
4090            dst.ingredient.add(i.copy());
4091        };
4092        dst.preparationInstruction = preparationInstruction == null ? null : preparationInstruction.copy();
4093        if (intendedRoute != null) {
4094          dst.intendedRoute = new ArrayList<CodeableConcept>();
4095          for (CodeableConcept i : intendedRoute)
4096            dst.intendedRoute.add(i.copy());
4097        };
4098        if (cost != null) {
4099          dst.cost = new ArrayList<MedicationKnowledgeCostComponent>();
4100          for (MedicationKnowledgeCostComponent i : cost)
4101            dst.cost.add(i.copy());
4102        };
4103        if (monitoringProgram != null) {
4104          dst.monitoringProgram = new ArrayList<MedicationKnowledgeMonitoringProgramComponent>();
4105          for (MedicationKnowledgeMonitoringProgramComponent i : monitoringProgram)
4106            dst.monitoringProgram.add(i.copy());
4107        };
4108        if (administrationGuidelines != null) {
4109          dst.administrationGuidelines = new ArrayList<MedicationKnowledgeAdministrationGuidelinesComponent>();
4110          for (MedicationKnowledgeAdministrationGuidelinesComponent i : administrationGuidelines)
4111            dst.administrationGuidelines.add(i.copy());
4112        };
4113        if (medicineClassification != null) {
4114          dst.medicineClassification = new ArrayList<MedicationKnowledgeMedicineClassificationComponent>();
4115          for (MedicationKnowledgeMedicineClassificationComponent i : medicineClassification)
4116            dst.medicineClassification.add(i.copy());
4117        };
4118        dst.packaging = packaging == null ? null : packaging.copy();
4119        if (drugCharacteristic != null) {
4120          dst.drugCharacteristic = new ArrayList<MedicationKnowledgeDrugCharacteristicComponent>();
4121          for (MedicationKnowledgeDrugCharacteristicComponent i : drugCharacteristic)
4122            dst.drugCharacteristic.add(i.copy());
4123        };
4124        if (contraindication != null) {
4125          dst.contraindication = new ArrayList<Reference>();
4126          for (Reference i : contraindication)
4127            dst.contraindication.add(i.copy());
4128        };
4129        return dst;
4130      }
4131
4132      protected MedicationKnowledge typedCopy() {
4133        return copy();
4134      }
4135
4136      @Override
4137      public boolean equalsDeep(Base other_) {
4138        if (!super.equalsDeep(other_))
4139          return false;
4140        if (!(other_ instanceof MedicationKnowledge))
4141          return false;
4142        MedicationKnowledge o = (MedicationKnowledge) other_;
4143        return compareDeep(code, o.code, true) && compareDeep(status, o.status, true) && compareDeep(manufacturer, o.manufacturer, true)
4144           && compareDeep(form, o.form, true) && compareDeep(amount, o.amount, true) && compareDeep(synonym, o.synonym, true)
4145           && compareDeep(relatedMedicationKnowledge, o.relatedMedicationKnowledge, true) && compareDeep(associatedMedication, o.associatedMedication, true)
4146           && compareDeep(productType, o.productType, true) && compareDeep(monograph, o.monograph, true) && compareDeep(halfLifePeriod, o.halfLifePeriod, true)
4147           && compareDeep(ingredient, o.ingredient, true) && compareDeep(preparationInstruction, o.preparationInstruction, true)
4148           && compareDeep(intendedRoute, o.intendedRoute, true) && compareDeep(cost, o.cost, true) && compareDeep(monitoringProgram, o.monitoringProgram, true)
4149           && compareDeep(administrationGuidelines, o.administrationGuidelines, true) && compareDeep(medicineClassification, o.medicineClassification, true)
4150           && compareDeep(packaging, o.packaging, true) && compareDeep(drugCharacteristic, o.drugCharacteristic, true)
4151           && compareDeep(contraindication, o.contraindication, true);
4152      }
4153
4154      @Override
4155      public boolean equalsShallow(Base other_) {
4156        if (!super.equalsShallow(other_))
4157          return false;
4158        if (!(other_ instanceof MedicationKnowledge))
4159          return false;
4160        MedicationKnowledge o = (MedicationKnowledge) other_;
4161        return compareValues(status, o.status, true) && compareValues(synonym, o.synonym, true) && compareValues(preparationInstruction, o.preparationInstruction, true)
4162          ;
4163      }
4164
4165      public boolean isEmpty() {
4166        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, status, manufacturer
4167          , form, amount, synonym, relatedMedicationKnowledge, associatedMedication, productType
4168          , monograph, halfLifePeriod, ingredient, preparationInstruction, intendedRoute, cost
4169          , monitoringProgram, administrationGuidelines, medicineClassification, packaging, drugCharacteristic
4170          , contraindication);
4171      }
4172
4173  @Override
4174  public ResourceType getResourceType() {
4175    return ResourceType.MedicationKnowledge;
4176   }
4177
4178 /**
4179   * Search parameter: <b>code</b>
4180   * <p>
4181   * Description: <b>Code that identifies this medication</b><br>
4182   * Type: <b>token</b><br>
4183   * Path: <b>MedicationKnowledge.code</b><br>
4184   * </p>
4185   */
4186  @SearchParamDefinition(name="code", path="MedicationKnowledge.code", description="Code that identifies this medication", type="token" )
4187  public static final String SP_CODE = "code";
4188 /**
4189   * <b>Fluent Client</b> search parameter constant for <b>code</b>
4190   * <p>
4191   * Description: <b>Code that identifies this medication</b><br>
4192   * Type: <b>token</b><br>
4193   * Path: <b>MedicationKnowledge.code</b><br>
4194   * </p>
4195   */
4196  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
4197
4198 /**
4199   * Search parameter: <b>ingredient</b>
4200   * <p>
4201   * Description: <b>Medication(s) or substance(s) contained in the medication</b><br>
4202   * Type: <b>reference</b><br>
4203   * Path: <b>MedicationKnowledge.ingredient.itemReference</b><br>
4204   * </p>
4205   */
4206  @SearchParamDefinition(name="ingredient", path="MedicationKnowledge.ingredient.item.as(Reference)", description="Medication(s) or substance(s) contained in the medication", type="reference", target={Substance.class } )
4207  public static final String SP_INGREDIENT = "ingredient";
4208 /**
4209   * <b>Fluent Client</b> search parameter constant for <b>ingredient</b>
4210   * <p>
4211   * Description: <b>Medication(s) or substance(s) contained in the medication</b><br>
4212   * Type: <b>reference</b><br>
4213   * Path: <b>MedicationKnowledge.ingredient.itemReference</b><br>
4214   * </p>
4215   */
4216  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INGREDIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INGREDIENT);
4217
4218/**
4219   * Constant for fluent queries to be used to add include statements. Specifies
4220   * the path value of "<b>MedicationKnowledge:ingredient</b>".
4221   */
4222  public static final ca.uhn.fhir.model.api.Include INCLUDE_INGREDIENT = new ca.uhn.fhir.model.api.Include("MedicationKnowledge:ingredient").toLocked();
4223
4224 /**
4225   * Search parameter: <b>classification-type</b>
4226   * <p>
4227   * Description: <b>The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification)</b><br>
4228   * Type: <b>token</b><br>
4229   * Path: <b>MedicationKnowledge.medicineClassification.type</b><br>
4230   * </p>
4231   */
4232  @SearchParamDefinition(name="classification-type", path="MedicationKnowledge.medicineClassification.type", description="The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification)", type="token" )
4233  public static final String SP_CLASSIFICATION_TYPE = "classification-type";
4234 /**
4235   * <b>Fluent Client</b> search parameter constant for <b>classification-type</b>
4236   * <p>
4237   * Description: <b>The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification)</b><br>
4238   * Type: <b>token</b><br>
4239   * Path: <b>MedicationKnowledge.medicineClassification.type</b><br>
4240   * </p>
4241   */
4242  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLASSIFICATION_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLASSIFICATION_TYPE);
4243
4244 /**
4245   * Search parameter: <b>monograph-type</b>
4246   * <p>
4247   * Description: <b>The category of medication document</b><br>
4248   * Type: <b>token</b><br>
4249   * Path: <b>MedicationKnowledge.monograph.type</b><br>
4250   * </p>
4251   */
4252  @SearchParamDefinition(name="monograph-type", path="MedicationKnowledge.monograph.type", description="The category of medication document", type="token" )
4253  public static final String SP_MONOGRAPH_TYPE = "monograph-type";
4254 /**
4255   * <b>Fluent Client</b> search parameter constant for <b>monograph-type</b>
4256   * <p>
4257   * Description: <b>The category of medication document</b><br>
4258   * Type: <b>token</b><br>
4259   * Path: <b>MedicationKnowledge.monograph.type</b><br>
4260   * </p>
4261   */
4262  public static final ca.uhn.fhir.rest.gclient.TokenClientParam MONOGRAPH_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MONOGRAPH_TYPE);
4263
4264 /**
4265   * Search parameter: <b>classification</b>
4266   * <p>
4267   * Description: <b>Specific category assigned to the medication</b><br>
4268   * Type: <b>token</b><br>
4269   * Path: <b>MedicationKnowledge.medicineClassification.classification</b><br>
4270   * </p>
4271   */
4272  @SearchParamDefinition(name="classification", path="MedicationKnowledge.medicineClassification.classification", description="Specific category assigned to the medication", type="token" )
4273  public static final String SP_CLASSIFICATION = "classification";
4274 /**
4275   * <b>Fluent Client</b> search parameter constant for <b>classification</b>
4276   * <p>
4277   * Description: <b>Specific category assigned to the medication</b><br>
4278   * Type: <b>token</b><br>
4279   * Path: <b>MedicationKnowledge.medicineClassification.classification</b><br>
4280   * </p>
4281   */
4282  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLASSIFICATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLASSIFICATION);
4283
4284 /**
4285   * Search parameter: <b>manufacturer</b>
4286   * <p>
4287   * Description: <b>Manufacturer of the item</b><br>
4288   * Type: <b>reference</b><br>
4289   * Path: <b>MedicationKnowledge.manufacturer</b><br>
4290   * </p>
4291   */
4292  @SearchParamDefinition(name="manufacturer", path="MedicationKnowledge.manufacturer", description="Manufacturer of the item", type="reference", target={Organization.class } )
4293  public static final String SP_MANUFACTURER = "manufacturer";
4294 /**
4295   * <b>Fluent Client</b> search parameter constant for <b>manufacturer</b>
4296   * <p>
4297   * Description: <b>Manufacturer of the item</b><br>
4298   * Type: <b>reference</b><br>
4299   * Path: <b>MedicationKnowledge.manufacturer</b><br>
4300   * </p>
4301   */
4302  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MANUFACTURER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MANUFACTURER);
4303
4304/**
4305   * Constant for fluent queries to be used to add include statements. Specifies
4306   * the path value of "<b>MedicationKnowledge:manufacturer</b>".
4307   */
4308  public static final ca.uhn.fhir.model.api.Include INCLUDE_MANUFACTURER = new ca.uhn.fhir.model.api.Include("MedicationKnowledge:manufacturer").toLocked();
4309
4310 /**
4311   * Search parameter: <b>ingredient-code</b>
4312   * <p>
4313   * Description: <b>Medication(s) or substance(s) contained in the medication</b><br>
4314   * Type: <b>token</b><br>
4315   * Path: <b>MedicationKnowledge.ingredient.itemCodeableConcept</b><br>
4316   * </p>
4317   */
4318  @SearchParamDefinition(name="ingredient-code", path="MedicationKnowledge.ingredient.item.as(CodeableConcept)", description="Medication(s) or substance(s) contained in the medication", type="token" )
4319  public static final String SP_INGREDIENT_CODE = "ingredient-code";
4320 /**
4321   * <b>Fluent Client</b> search parameter constant for <b>ingredient-code</b>
4322   * <p>
4323   * Description: <b>Medication(s) or substance(s) contained in the medication</b><br>
4324   * Type: <b>token</b><br>
4325   * Path: <b>MedicationKnowledge.ingredient.itemCodeableConcept</b><br>
4326   * </p>
4327   */
4328  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INGREDIENT_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INGREDIENT_CODE);
4329
4330 /**
4331   * Search parameter: <b>source-cost</b>
4332   * <p>
4333   * Description: <b>The source or owner for the price information</b><br>
4334   * Type: <b>token</b><br>
4335   * Path: <b>MedicationKnowledge.cost.source</b><br>
4336   * </p>
4337   */
4338  @SearchParamDefinition(name="source-cost", path="MedicationKnowledge.cost.source", description="The source or owner for the price information", type="token" )
4339  public static final String SP_SOURCE_COST = "source-cost";
4340 /**
4341   * <b>Fluent Client</b> search parameter constant for <b>source-cost</b>
4342   * <p>
4343   * Description: <b>The source or owner for the price information</b><br>
4344   * Type: <b>token</b><br>
4345   * Path: <b>MedicationKnowledge.cost.source</b><br>
4346   * </p>
4347   */
4348  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SOURCE_COST = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SOURCE_COST);
4349
4350 /**
4351   * Search parameter: <b>form</b>
4352   * <p>
4353   * Description: <b>powder | tablets | capsule +</b><br>
4354   * Type: <b>token</b><br>
4355   * Path: <b>MedicationKnowledge.form</b><br>
4356   * </p>
4357   */
4358  @SearchParamDefinition(name="form", path="MedicationKnowledge.form", description="powder | tablets | capsule +", type="token" )
4359  public static final String SP_FORM = "form";
4360 /**
4361   * <b>Fluent Client</b> search parameter constant for <b>form</b>
4362   * <p>
4363   * Description: <b>powder | tablets | capsule +</b><br>
4364   * Type: <b>token</b><br>
4365   * Path: <b>MedicationKnowledge.form</b><br>
4366   * </p>
4367   */
4368  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORM);
4369
4370 /**
4371   * Search parameter: <b>monograph</b>
4372   * <p>
4373   * Description: <b>Associated documentation about the medication</b><br>
4374   * Type: <b>reference</b><br>
4375   * Path: <b>MedicationKnowledge.monograph.document</b><br>
4376   * </p>
4377   */
4378  @SearchParamDefinition(name="monograph", path="MedicationKnowledge.monograph.document", description="Associated documentation about the medication", type="reference", target={DocumentReference.class } )
4379  public static final String SP_MONOGRAPH = "monograph";
4380 /**
4381   * <b>Fluent Client</b> search parameter constant for <b>monograph</b>
4382   * <p>
4383   * Description: <b>Associated documentation about the medication</b><br>
4384   * Type: <b>reference</b><br>
4385   * Path: <b>MedicationKnowledge.monograph.document</b><br>
4386   * </p>
4387   */
4388  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MONOGRAPH = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MONOGRAPH);
4389
4390/**
4391   * Constant for fluent queries to be used to add include statements. Specifies
4392   * the path value of "<b>MedicationKnowledge:monograph</b>".
4393   */
4394  public static final ca.uhn.fhir.model.api.Include INCLUDE_MONOGRAPH = new ca.uhn.fhir.model.api.Include("MedicationKnowledge:monograph").toLocked();
4395
4396 /**
4397   * Search parameter: <b>monitoring-program-name</b>
4398   * <p>
4399   * Description: <b>Name of the reviewing program</b><br>
4400   * Type: <b>token</b><br>
4401   * Path: <b>MedicationKnowledge.monitoringProgram.name</b><br>
4402   * </p>
4403   */
4404  @SearchParamDefinition(name="monitoring-program-name", path="MedicationKnowledge.monitoringProgram.name", description="Name of the reviewing program", type="token" )
4405  public static final String SP_MONITORING_PROGRAM_NAME = "monitoring-program-name";
4406 /**
4407   * <b>Fluent Client</b> search parameter constant for <b>monitoring-program-name</b>
4408   * <p>
4409   * Description: <b>Name of the reviewing program</b><br>
4410   * Type: <b>token</b><br>
4411   * Path: <b>MedicationKnowledge.monitoringProgram.name</b><br>
4412   * </p>
4413   */
4414  public static final ca.uhn.fhir.rest.gclient.TokenClientParam MONITORING_PROGRAM_NAME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MONITORING_PROGRAM_NAME);
4415
4416 /**
4417   * Search parameter: <b>monitoring-program-type</b>
4418   * <p>
4419   * Description: <b>Type of program under which the medication is monitored</b><br>
4420   * Type: <b>token</b><br>
4421   * Path: <b>MedicationKnowledge.monitoringProgram.type</b><br>
4422   * </p>
4423   */
4424  @SearchParamDefinition(name="monitoring-program-type", path="MedicationKnowledge.monitoringProgram.type", description="Type of program under which the medication is monitored", type="token" )
4425  public static final String SP_MONITORING_PROGRAM_TYPE = "monitoring-program-type";
4426 /**
4427   * <b>Fluent Client</b> search parameter constant for <b>monitoring-program-type</b>
4428   * <p>
4429   * Description: <b>Type of program under which the medication is monitored</b><br>
4430   * Type: <b>token</b><br>
4431   * Path: <b>MedicationKnowledge.monitoringProgram.type</b><br>
4432   * </p>
4433   */
4434  public static final ca.uhn.fhir.rest.gclient.TokenClientParam MONITORING_PROGRAM_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MONITORING_PROGRAM_TYPE);
4435
4436 /**
4437   * Search parameter: <b>status</b>
4438   * <p>
4439   * Description: <b>active | inactive | entered-in-error</b><br>
4440   * Type: <b>token</b><br>
4441   * Path: <b>MedicationKnowledge.status</b><br>
4442   * </p>
4443   */
4444  @SearchParamDefinition(name="status", path="MedicationKnowledge.status", description="active | inactive | entered-in-error", type="token" )
4445  public static final String SP_STATUS = "status";
4446 /**
4447   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4448   * <p>
4449   * Description: <b>active | inactive | entered-in-error</b><br>
4450   * Type: <b>token</b><br>
4451   * Path: <b>MedicationKnowledge.status</b><br>
4452   * </p>
4453   */
4454  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4455
4456
4457}
4458