001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * A medicinal product in the final form which is suitable for administering to a patient (after any mixing of multiple components, dissolution etc. has been performed).
052 */
053@ResourceDef(name="AdministrableProductDefinition", profile="http://hl7.org/fhir/StructureDefinition/AdministrableProductDefinition")
054public class AdministrableProductDefinition extends DomainResource {
055
056    @Block()
057    public static class AdministrableProductDefinitionPropertyComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * A code expressing the type of characteristic.
060         */
061        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
062        @Description(shortDefinition="A code expressing the type of characteristic", formalDefinition="A code expressing the type of characteristic." )
063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/product-characteristic-codes")
064        protected CodeableConcept type;
065
066        /**
067         * A value for the characteristic.
068         */
069        @Child(name = "value", type = {CodeableConcept.class, Quantity.class, DateType.class, BooleanType.class, MarkdownType.class, Attachment.class, Binary.class}, order=2, min=0, max=1, modifier=false, summary=true)
070        @Description(shortDefinition="A value for the characteristic", formalDefinition="A value for the characteristic." )
071        protected DataType value;
072
073        /**
074         * The status of characteristic e.g. assigned or pending.
075         */
076        @Child(name = "status", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
077        @Description(shortDefinition="The status of characteristic e.g. assigned or pending", formalDefinition="The status of characteristic e.g. assigned or pending." )
078        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
079        protected CodeableConcept status;
080
081        private static final long serialVersionUID = -872048207L;
082
083    /**
084     * Constructor
085     */
086      public AdministrableProductDefinitionPropertyComponent() {
087        super();
088      }
089
090    /**
091     * Constructor
092     */
093      public AdministrableProductDefinitionPropertyComponent(CodeableConcept type) {
094        super();
095        this.setType(type);
096      }
097
098        /**
099         * @return {@link #type} (A code expressing the type of characteristic.)
100         */
101        public CodeableConcept getType() { 
102          if (this.type == null)
103            if (Configuration.errorOnAutoCreate())
104              throw new Error("Attempt to auto-create AdministrableProductDefinitionPropertyComponent.type");
105            else if (Configuration.doAutoCreate())
106              this.type = new CodeableConcept(); // cc
107          return this.type;
108        }
109
110        public boolean hasType() { 
111          return this.type != null && !this.type.isEmpty();
112        }
113
114        /**
115         * @param value {@link #type} (A code expressing the type of characteristic.)
116         */
117        public AdministrableProductDefinitionPropertyComponent setType(CodeableConcept value) { 
118          this.type = value;
119          return this;
120        }
121
122        /**
123         * @return {@link #value} (A value for the characteristic.)
124         */
125        public DataType getValue() { 
126          return this.value;
127        }
128
129        /**
130         * @return {@link #value} (A value for the characteristic.)
131         */
132        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
133          if (this.value == null)
134            this.value = new CodeableConcept();
135          if (!(this.value instanceof CodeableConcept))
136            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
137          return (CodeableConcept) this.value;
138        }
139
140        public boolean hasValueCodeableConcept() { 
141          return this != null && this.value instanceof CodeableConcept;
142        }
143
144        /**
145         * @return {@link #value} (A value for the characteristic.)
146         */
147        public Quantity getValueQuantity() throws FHIRException { 
148          if (this.value == null)
149            this.value = new Quantity();
150          if (!(this.value instanceof Quantity))
151            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
152          return (Quantity) this.value;
153        }
154
155        public boolean hasValueQuantity() { 
156          return this != null && this.value instanceof Quantity;
157        }
158
159        /**
160         * @return {@link #value} (A value for the characteristic.)
161         */
162        public DateType getValueDateType() throws FHIRException { 
163          if (this.value == null)
164            this.value = new DateType();
165          if (!(this.value instanceof DateType))
166            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered");
167          return (DateType) this.value;
168        }
169
170        public boolean hasValueDateType() { 
171          return this != null && this.value instanceof DateType;
172        }
173
174        /**
175         * @return {@link #value} (A value for the characteristic.)
176         */
177        public BooleanType getValueBooleanType() throws FHIRException { 
178          if (this.value == null)
179            this.value = new BooleanType();
180          if (!(this.value instanceof BooleanType))
181            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
182          return (BooleanType) this.value;
183        }
184
185        public boolean hasValueBooleanType() { 
186          return this != null && this.value instanceof BooleanType;
187        }
188
189        /**
190         * @return {@link #value} (A value for the characteristic.)
191         */
192        public MarkdownType getValueMarkdownType() throws FHIRException { 
193          if (this.value == null)
194            this.value = new MarkdownType();
195          if (!(this.value instanceof MarkdownType))
196            throw new FHIRException("Type mismatch: the type MarkdownType was expected, but "+this.value.getClass().getName()+" was encountered");
197          return (MarkdownType) this.value;
198        }
199
200        public boolean hasValueMarkdownType() { 
201          return this != null && this.value instanceof MarkdownType;
202        }
203
204        /**
205         * @return {@link #value} (A value for the characteristic.)
206         */
207        public Attachment getValueAttachment() throws FHIRException { 
208          if (this.value == null)
209            this.value = new Attachment();
210          if (!(this.value instanceof Attachment))
211            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
212          return (Attachment) this.value;
213        }
214
215        public boolean hasValueAttachment() { 
216          return this != null && this.value instanceof Attachment;
217        }
218
219        /**
220         * @return {@link #value} (A value for the characteristic.)
221         */
222        public Reference getValueReference() throws FHIRException { 
223          if (this.value == null)
224            this.value = new Reference();
225          if (!(this.value instanceof Reference))
226            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
227          return (Reference) this.value;
228        }
229
230        public boolean hasValueReference() { 
231          return this != null && this.value instanceof Reference;
232        }
233
234        public boolean hasValue() { 
235          return this.value != null && !this.value.isEmpty();
236        }
237
238        /**
239         * @param value {@link #value} (A value for the characteristic.)
240         */
241        public AdministrableProductDefinitionPropertyComponent setValue(DataType value) { 
242          if (value != null && !(value instanceof CodeableConcept || value instanceof Quantity || value instanceof DateType || value instanceof BooleanType || value instanceof MarkdownType || value instanceof Attachment || value instanceof Reference))
243            throw new FHIRException("Not the right type for AdministrableProductDefinition.property.value[x]: "+value.fhirType());
244          this.value = value;
245          return this;
246        }
247
248        /**
249         * @return {@link #status} (The status of characteristic e.g. assigned or pending.)
250         */
251        public CodeableConcept getStatus() { 
252          if (this.status == null)
253            if (Configuration.errorOnAutoCreate())
254              throw new Error("Attempt to auto-create AdministrableProductDefinitionPropertyComponent.status");
255            else if (Configuration.doAutoCreate())
256              this.status = new CodeableConcept(); // cc
257          return this.status;
258        }
259
260        public boolean hasStatus() { 
261          return this.status != null && !this.status.isEmpty();
262        }
263
264        /**
265         * @param value {@link #status} (The status of characteristic e.g. assigned or pending.)
266         */
267        public AdministrableProductDefinitionPropertyComponent setStatus(CodeableConcept value) { 
268          this.status = value;
269          return this;
270        }
271
272        protected void listChildren(List<Property> children) {
273          super.listChildren(children);
274          children.add(new Property("type", "CodeableConcept", "A code expressing the type of characteristic.", 0, 1, type));
275          children.add(new Property("value[x]", "CodeableConcept|Quantity|date|boolean|markdown|Attachment|Reference(Binary)", "A value for the characteristic.", 0, 1, value));
276          children.add(new Property("status", "CodeableConcept", "The status of characteristic e.g. assigned or pending.", 0, 1, status));
277        }
278
279        @Override
280        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
281          switch (_hash) {
282          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A code expressing the type of characteristic.", 0, 1, type);
283          case -1410166417: /*value[x]*/  return new Property("value[x]", "CodeableConcept|Quantity|date|boolean|markdown|Attachment|Reference(Binary)", "A value for the characteristic.", 0, 1, value);
284          case 111972721: /*value*/  return new Property("value[x]", "CodeableConcept|Quantity|date|boolean|markdown|Attachment|Reference(Binary)", "A value for the characteristic.", 0, 1, value);
285          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "A value for the characteristic.", 0, 1, value);
286          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "A value for the characteristic.", 0, 1, value);
287          case -766192449: /*valueDate*/  return new Property("value[x]", "date", "A value for the characteristic.", 0, 1, value);
288          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "A value for the characteristic.", 0, 1, value);
289          case -497880704: /*valueMarkdown*/  return new Property("value[x]", "markdown", "A value for the characteristic.", 0, 1, value);
290          case -475566732: /*valueAttachment*/  return new Property("value[x]", "Attachment", "A value for the characteristic.", 0, 1, value);
291          case 1755241690: /*valueReference*/  return new Property("value[x]", "Reference(Binary)", "A value for the characteristic.", 0, 1, value);
292          case -892481550: /*status*/  return new Property("status", "CodeableConcept", "The status of characteristic e.g. assigned or pending.", 0, 1, status);
293          default: return super.getNamedProperty(_hash, _name, _checkValid);
294          }
295
296        }
297
298      @Override
299      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
300        switch (hash) {
301        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
302        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
303        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept
304        default: return super.getProperty(hash, name, checkValid);
305        }
306
307      }
308
309      @Override
310      public Base setProperty(int hash, String name, Base value) throws FHIRException {
311        switch (hash) {
312        case 3575610: // type
313          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
314          return value;
315        case 111972721: // value
316          this.value = TypeConvertor.castToType(value); // DataType
317          return value;
318        case -892481550: // status
319          this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
320          return value;
321        default: return super.setProperty(hash, name, value);
322        }
323
324      }
325
326      @Override
327      public Base setProperty(String name, Base value) throws FHIRException {
328        if (name.equals("type")) {
329          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
330        } else if (name.equals("value[x]")) {
331          this.value = TypeConvertor.castToType(value); // DataType
332        } else if (name.equals("status")) {
333          this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
334        } else
335          return super.setProperty(name, value);
336        return value;
337      }
338
339      @Override
340      public Base makeProperty(int hash, String name) throws FHIRException {
341        switch (hash) {
342        case 3575610:  return getType();
343        case -1410166417:  return getValue();
344        case 111972721:  return getValue();
345        case -892481550:  return getStatus();
346        default: return super.makeProperty(hash, name);
347        }
348
349      }
350
351      @Override
352      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
353        switch (hash) {
354        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
355        case 111972721: /*value*/ return new String[] {"CodeableConcept", "Quantity", "date", "boolean", "markdown", "Attachment", "Reference"};
356        case -892481550: /*status*/ return new String[] {"CodeableConcept"};
357        default: return super.getTypesForProperty(hash, name);
358        }
359
360      }
361
362      @Override
363      public Base addChild(String name) throws FHIRException {
364        if (name.equals("type")) {
365          this.type = new CodeableConcept();
366          return this.type;
367        }
368        else if (name.equals("valueCodeableConcept")) {
369          this.value = new CodeableConcept();
370          return this.value;
371        }
372        else if (name.equals("valueQuantity")) {
373          this.value = new Quantity();
374          return this.value;
375        }
376        else if (name.equals("valueDate")) {
377          this.value = new DateType();
378          return this.value;
379        }
380        else if (name.equals("valueBoolean")) {
381          this.value = new BooleanType();
382          return this.value;
383        }
384        else if (name.equals("valueMarkdown")) {
385          this.value = new MarkdownType();
386          return this.value;
387        }
388        else if (name.equals("valueAttachment")) {
389          this.value = new Attachment();
390          return this.value;
391        }
392        else if (name.equals("valueReference")) {
393          this.value = new Reference();
394          return this.value;
395        }
396        else if (name.equals("status")) {
397          this.status = new CodeableConcept();
398          return this.status;
399        }
400        else
401          return super.addChild(name);
402      }
403
404      public AdministrableProductDefinitionPropertyComponent copy() {
405        AdministrableProductDefinitionPropertyComponent dst = new AdministrableProductDefinitionPropertyComponent();
406        copyValues(dst);
407        return dst;
408      }
409
410      public void copyValues(AdministrableProductDefinitionPropertyComponent dst) {
411        super.copyValues(dst);
412        dst.type = type == null ? null : type.copy();
413        dst.value = value == null ? null : value.copy();
414        dst.status = status == null ? null : status.copy();
415      }
416
417      @Override
418      public boolean equalsDeep(Base other_) {
419        if (!super.equalsDeep(other_))
420          return false;
421        if (!(other_ instanceof AdministrableProductDefinitionPropertyComponent))
422          return false;
423        AdministrableProductDefinitionPropertyComponent o = (AdministrableProductDefinitionPropertyComponent) other_;
424        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true) && compareDeep(status, o.status, true)
425          ;
426      }
427
428      @Override
429      public boolean equalsShallow(Base other_) {
430        if (!super.equalsShallow(other_))
431          return false;
432        if (!(other_ instanceof AdministrableProductDefinitionPropertyComponent))
433          return false;
434        AdministrableProductDefinitionPropertyComponent o = (AdministrableProductDefinitionPropertyComponent) other_;
435        return true;
436      }
437
438      public boolean isEmpty() {
439        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value, status);
440      }
441
442  public String fhirType() {
443    return "AdministrableProductDefinition.property";
444
445  }
446
447  }
448
449    @Block()
450    public static class AdministrableProductDefinitionRouteOfAdministrationComponent extends BackboneElement implements IBaseBackboneElement {
451        /**
452         * Coded expression for the route.
453         */
454        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
455        @Description(shortDefinition="Coded expression for the route", formalDefinition="Coded expression for the route." )
456        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/route-codes")
457        protected CodeableConcept code;
458
459        /**
460         * The first dose (dose quantity) administered can be specified for the product, using a numerical value and its unit of measurement.
461         */
462        @Child(name = "firstDose", type = {Quantity.class}, order=2, min=0, max=1, modifier=false, summary=true)
463        @Description(shortDefinition="The first dose (dose quantity) administered can be specified for the product", formalDefinition="The first dose (dose quantity) administered can be specified for the product, using a numerical value and its unit of measurement." )
464        protected Quantity firstDose;
465
466        /**
467         * The maximum single dose that can be administered, specified using a numerical value and its unit of measurement.
468         */
469        @Child(name = "maxSingleDose", type = {Quantity.class}, order=3, min=0, max=1, modifier=false, summary=true)
470        @Description(shortDefinition="The maximum single dose that can be administered", formalDefinition="The maximum single dose that can be administered, specified using a numerical value and its unit of measurement." )
471        protected Quantity maxSingleDose;
472
473        /**
474         * The maximum dose per day (maximum dose quantity to be administered in any one 24-h period) that can be administered.
475         */
476        @Child(name = "maxDosePerDay", type = {Quantity.class}, order=4, min=0, max=1, modifier=false, summary=true)
477        @Description(shortDefinition="The maximum dose quantity to be administered in any one 24-h period", formalDefinition="The maximum dose per day (maximum dose quantity to be administered in any one 24-h period) that can be administered." )
478        protected Quantity maxDosePerDay;
479
480        /**
481         * The maximum dose per treatment period that can be administered.
482         */
483        @Child(name = "maxDosePerTreatmentPeriod", type = {Ratio.class}, order=5, min=0, max=1, modifier=false, summary=true)
484        @Description(shortDefinition="The maximum dose per treatment period that can be administered", formalDefinition="The maximum dose per treatment period that can be administered." )
485        protected Ratio maxDosePerTreatmentPeriod;
486
487        /**
488         * The maximum treatment period during which the product can be administered.
489         */
490        @Child(name = "maxTreatmentPeriod", type = {Duration.class}, order=6, min=0, max=1, modifier=false, summary=true)
491        @Description(shortDefinition="The maximum treatment period during which the product can be administered", formalDefinition="The maximum treatment period during which the product can be administered." )
492        protected Duration maxTreatmentPeriod;
493
494        /**
495         * A species for which this route applies.
496         */
497        @Child(name = "targetSpecies", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
498        @Description(shortDefinition="A species for which this route applies", formalDefinition="A species for which this route applies." )
499        protected List<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent> targetSpecies;
500
501        private static final long serialVersionUID = 322274730L;
502
503    /**
504     * Constructor
505     */
506      public AdministrableProductDefinitionRouteOfAdministrationComponent() {
507        super();
508      }
509
510    /**
511     * Constructor
512     */
513      public AdministrableProductDefinitionRouteOfAdministrationComponent(CodeableConcept code) {
514        super();
515        this.setCode(code);
516      }
517
518        /**
519         * @return {@link #code} (Coded expression for the route.)
520         */
521        public CodeableConcept getCode() { 
522          if (this.code == null)
523            if (Configuration.errorOnAutoCreate())
524              throw new Error("Attempt to auto-create AdministrableProductDefinitionRouteOfAdministrationComponent.code");
525            else if (Configuration.doAutoCreate())
526              this.code = new CodeableConcept(); // cc
527          return this.code;
528        }
529
530        public boolean hasCode() { 
531          return this.code != null && !this.code.isEmpty();
532        }
533
534        /**
535         * @param value {@link #code} (Coded expression for the route.)
536         */
537        public AdministrableProductDefinitionRouteOfAdministrationComponent setCode(CodeableConcept value) { 
538          this.code = value;
539          return this;
540        }
541
542        /**
543         * @return {@link #firstDose} (The first dose (dose quantity) administered can be specified for the product, using a numerical value and its unit of measurement.)
544         */
545        public Quantity getFirstDose() { 
546          if (this.firstDose == null)
547            if (Configuration.errorOnAutoCreate())
548              throw new Error("Attempt to auto-create AdministrableProductDefinitionRouteOfAdministrationComponent.firstDose");
549            else if (Configuration.doAutoCreate())
550              this.firstDose = new Quantity(); // cc
551          return this.firstDose;
552        }
553
554        public boolean hasFirstDose() { 
555          return this.firstDose != null && !this.firstDose.isEmpty();
556        }
557
558        /**
559         * @param value {@link #firstDose} (The first dose (dose quantity) administered can be specified for the product, using a numerical value and its unit of measurement.)
560         */
561        public AdministrableProductDefinitionRouteOfAdministrationComponent setFirstDose(Quantity value) { 
562          this.firstDose = value;
563          return this;
564        }
565
566        /**
567         * @return {@link #maxSingleDose} (The maximum single dose that can be administered, specified using a numerical value and its unit of measurement.)
568         */
569        public Quantity getMaxSingleDose() { 
570          if (this.maxSingleDose == null)
571            if (Configuration.errorOnAutoCreate())
572              throw new Error("Attempt to auto-create AdministrableProductDefinitionRouteOfAdministrationComponent.maxSingleDose");
573            else if (Configuration.doAutoCreate())
574              this.maxSingleDose = new Quantity(); // cc
575          return this.maxSingleDose;
576        }
577
578        public boolean hasMaxSingleDose() { 
579          return this.maxSingleDose != null && !this.maxSingleDose.isEmpty();
580        }
581
582        /**
583         * @param value {@link #maxSingleDose} (The maximum single dose that can be administered, specified using a numerical value and its unit of measurement.)
584         */
585        public AdministrableProductDefinitionRouteOfAdministrationComponent setMaxSingleDose(Quantity value) { 
586          this.maxSingleDose = value;
587          return this;
588        }
589
590        /**
591         * @return {@link #maxDosePerDay} (The maximum dose per day (maximum dose quantity to be administered in any one 24-h period) that can be administered.)
592         */
593        public Quantity getMaxDosePerDay() { 
594          if (this.maxDosePerDay == null)
595            if (Configuration.errorOnAutoCreate())
596              throw new Error("Attempt to auto-create AdministrableProductDefinitionRouteOfAdministrationComponent.maxDosePerDay");
597            else if (Configuration.doAutoCreate())
598              this.maxDosePerDay = new Quantity(); // cc
599          return this.maxDosePerDay;
600        }
601
602        public boolean hasMaxDosePerDay() { 
603          return this.maxDosePerDay != null && !this.maxDosePerDay.isEmpty();
604        }
605
606        /**
607         * @param value {@link #maxDosePerDay} (The maximum dose per day (maximum dose quantity to be administered in any one 24-h period) that can be administered.)
608         */
609        public AdministrableProductDefinitionRouteOfAdministrationComponent setMaxDosePerDay(Quantity value) { 
610          this.maxDosePerDay = value;
611          return this;
612        }
613
614        /**
615         * @return {@link #maxDosePerTreatmentPeriod} (The maximum dose per treatment period that can be administered.)
616         */
617        public Ratio getMaxDosePerTreatmentPeriod() { 
618          if (this.maxDosePerTreatmentPeriod == null)
619            if (Configuration.errorOnAutoCreate())
620              throw new Error("Attempt to auto-create AdministrableProductDefinitionRouteOfAdministrationComponent.maxDosePerTreatmentPeriod");
621            else if (Configuration.doAutoCreate())
622              this.maxDosePerTreatmentPeriod = new Ratio(); // cc
623          return this.maxDosePerTreatmentPeriod;
624        }
625
626        public boolean hasMaxDosePerTreatmentPeriod() { 
627          return this.maxDosePerTreatmentPeriod != null && !this.maxDosePerTreatmentPeriod.isEmpty();
628        }
629
630        /**
631         * @param value {@link #maxDosePerTreatmentPeriod} (The maximum dose per treatment period that can be administered.)
632         */
633        public AdministrableProductDefinitionRouteOfAdministrationComponent setMaxDosePerTreatmentPeriod(Ratio value) { 
634          this.maxDosePerTreatmentPeriod = value;
635          return this;
636        }
637
638        /**
639         * @return {@link #maxTreatmentPeriod} (The maximum treatment period during which the product can be administered.)
640         */
641        public Duration getMaxTreatmentPeriod() { 
642          if (this.maxTreatmentPeriod == null)
643            if (Configuration.errorOnAutoCreate())
644              throw new Error("Attempt to auto-create AdministrableProductDefinitionRouteOfAdministrationComponent.maxTreatmentPeriod");
645            else if (Configuration.doAutoCreate())
646              this.maxTreatmentPeriod = new Duration(); // cc
647          return this.maxTreatmentPeriod;
648        }
649
650        public boolean hasMaxTreatmentPeriod() { 
651          return this.maxTreatmentPeriod != null && !this.maxTreatmentPeriod.isEmpty();
652        }
653
654        /**
655         * @param value {@link #maxTreatmentPeriod} (The maximum treatment period during which the product can be administered.)
656         */
657        public AdministrableProductDefinitionRouteOfAdministrationComponent setMaxTreatmentPeriod(Duration value) { 
658          this.maxTreatmentPeriod = value;
659          return this;
660        }
661
662        /**
663         * @return {@link #targetSpecies} (A species for which this route applies.)
664         */
665        public List<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent> getTargetSpecies() { 
666          if (this.targetSpecies == null)
667            this.targetSpecies = new ArrayList<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent>();
668          return this.targetSpecies;
669        }
670
671        /**
672         * @return Returns a reference to <code>this</code> for easy method chaining
673         */
674        public AdministrableProductDefinitionRouteOfAdministrationComponent setTargetSpecies(List<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent> theTargetSpecies) { 
675          this.targetSpecies = theTargetSpecies;
676          return this;
677        }
678
679        public boolean hasTargetSpecies() { 
680          if (this.targetSpecies == null)
681            return false;
682          for (AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent item : this.targetSpecies)
683            if (!item.isEmpty())
684              return true;
685          return false;
686        }
687
688        public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent addTargetSpecies() { //3
689          AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent t = new AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent();
690          if (this.targetSpecies == null)
691            this.targetSpecies = new ArrayList<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent>();
692          this.targetSpecies.add(t);
693          return t;
694        }
695
696        public AdministrableProductDefinitionRouteOfAdministrationComponent addTargetSpecies(AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent t) { //3
697          if (t == null)
698            return this;
699          if (this.targetSpecies == null)
700            this.targetSpecies = new ArrayList<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent>();
701          this.targetSpecies.add(t);
702          return this;
703        }
704
705        /**
706         * @return The first repetition of repeating field {@link #targetSpecies}, creating it if it does not already exist {3}
707         */
708        public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent getTargetSpeciesFirstRep() { 
709          if (getTargetSpecies().isEmpty()) {
710            addTargetSpecies();
711          }
712          return getTargetSpecies().get(0);
713        }
714
715        protected void listChildren(List<Property> children) {
716          super.listChildren(children);
717          children.add(new Property("code", "CodeableConcept", "Coded expression for the route.", 0, 1, code));
718          children.add(new Property("firstDose", "Quantity", "The first dose (dose quantity) administered can be specified for the product, using a numerical value and its unit of measurement.", 0, 1, firstDose));
719          children.add(new Property("maxSingleDose", "Quantity", "The maximum single dose that can be administered, specified using a numerical value and its unit of measurement.", 0, 1, maxSingleDose));
720          children.add(new Property("maxDosePerDay", "Quantity", "The maximum dose per day (maximum dose quantity to be administered in any one 24-h period) that can be administered.", 0, 1, maxDosePerDay));
721          children.add(new Property("maxDosePerTreatmentPeriod", "Ratio", "The maximum dose per treatment period that can be administered.", 0, 1, maxDosePerTreatmentPeriod));
722          children.add(new Property("maxTreatmentPeriod", "Duration", "The maximum treatment period during which the product can be administered.", 0, 1, maxTreatmentPeriod));
723          children.add(new Property("targetSpecies", "", "A species for which this route applies.", 0, java.lang.Integer.MAX_VALUE, targetSpecies));
724        }
725
726        @Override
727        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
728          switch (_hash) {
729          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Coded expression for the route.", 0, 1, code);
730          case 132551405: /*firstDose*/  return new Property("firstDose", "Quantity", "The first dose (dose quantity) administered can be specified for the product, using a numerical value and its unit of measurement.", 0, 1, firstDose);
731          case -259207927: /*maxSingleDose*/  return new Property("maxSingleDose", "Quantity", "The maximum single dose that can be administered, specified using a numerical value and its unit of measurement.", 0, 1, maxSingleDose);
732          case -2017475520: /*maxDosePerDay*/  return new Property("maxDosePerDay", "Quantity", "The maximum dose per day (maximum dose quantity to be administered in any one 24-h period) that can be administered.", 0, 1, maxDosePerDay);
733          case -608040195: /*maxDosePerTreatmentPeriod*/  return new Property("maxDosePerTreatmentPeriod", "Ratio", "The maximum dose per treatment period that can be administered.", 0, 1, maxDosePerTreatmentPeriod);
734          case 920698453: /*maxTreatmentPeriod*/  return new Property("maxTreatmentPeriod", "Duration", "The maximum treatment period during which the product can be administered.", 0, 1, maxTreatmentPeriod);
735          case 295481963: /*targetSpecies*/  return new Property("targetSpecies", "", "A species for which this route applies.", 0, java.lang.Integer.MAX_VALUE, targetSpecies);
736          default: return super.getNamedProperty(_hash, _name, _checkValid);
737          }
738
739        }
740
741      @Override
742      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
743        switch (hash) {
744        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
745        case 132551405: /*firstDose*/ return this.firstDose == null ? new Base[0] : new Base[] {this.firstDose}; // Quantity
746        case -259207927: /*maxSingleDose*/ return this.maxSingleDose == null ? new Base[0] : new Base[] {this.maxSingleDose}; // Quantity
747        case -2017475520: /*maxDosePerDay*/ return this.maxDosePerDay == null ? new Base[0] : new Base[] {this.maxDosePerDay}; // Quantity
748        case -608040195: /*maxDosePerTreatmentPeriod*/ return this.maxDosePerTreatmentPeriod == null ? new Base[0] : new Base[] {this.maxDosePerTreatmentPeriod}; // Ratio
749        case 920698453: /*maxTreatmentPeriod*/ return this.maxTreatmentPeriod == null ? new Base[0] : new Base[] {this.maxTreatmentPeriod}; // Duration
750        case 295481963: /*targetSpecies*/ return this.targetSpecies == null ? new Base[0] : this.targetSpecies.toArray(new Base[this.targetSpecies.size()]); // AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent
751        default: return super.getProperty(hash, name, checkValid);
752        }
753
754      }
755
756      @Override
757      public Base setProperty(int hash, String name, Base value) throws FHIRException {
758        switch (hash) {
759        case 3059181: // code
760          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
761          return value;
762        case 132551405: // firstDose
763          this.firstDose = TypeConvertor.castToQuantity(value); // Quantity
764          return value;
765        case -259207927: // maxSingleDose
766          this.maxSingleDose = TypeConvertor.castToQuantity(value); // Quantity
767          return value;
768        case -2017475520: // maxDosePerDay
769          this.maxDosePerDay = TypeConvertor.castToQuantity(value); // Quantity
770          return value;
771        case -608040195: // maxDosePerTreatmentPeriod
772          this.maxDosePerTreatmentPeriod = TypeConvertor.castToRatio(value); // Ratio
773          return value;
774        case 920698453: // maxTreatmentPeriod
775          this.maxTreatmentPeriod = TypeConvertor.castToDuration(value); // Duration
776          return value;
777        case 295481963: // targetSpecies
778          this.getTargetSpecies().add((AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent) value); // AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent
779          return value;
780        default: return super.setProperty(hash, name, value);
781        }
782
783      }
784
785      @Override
786      public Base setProperty(String name, Base value) throws FHIRException {
787        if (name.equals("code")) {
788          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
789        } else if (name.equals("firstDose")) {
790          this.firstDose = TypeConvertor.castToQuantity(value); // Quantity
791        } else if (name.equals("maxSingleDose")) {
792          this.maxSingleDose = TypeConvertor.castToQuantity(value); // Quantity
793        } else if (name.equals("maxDosePerDay")) {
794          this.maxDosePerDay = TypeConvertor.castToQuantity(value); // Quantity
795        } else if (name.equals("maxDosePerTreatmentPeriod")) {
796          this.maxDosePerTreatmentPeriod = TypeConvertor.castToRatio(value); // Ratio
797        } else if (name.equals("maxTreatmentPeriod")) {
798          this.maxTreatmentPeriod = TypeConvertor.castToDuration(value); // Duration
799        } else if (name.equals("targetSpecies")) {
800          this.getTargetSpecies().add((AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent) value);
801        } else
802          return super.setProperty(name, value);
803        return value;
804      }
805
806      @Override
807      public Base makeProperty(int hash, String name) throws FHIRException {
808        switch (hash) {
809        case 3059181:  return getCode();
810        case 132551405:  return getFirstDose();
811        case -259207927:  return getMaxSingleDose();
812        case -2017475520:  return getMaxDosePerDay();
813        case -608040195:  return getMaxDosePerTreatmentPeriod();
814        case 920698453:  return getMaxTreatmentPeriod();
815        case 295481963:  return addTargetSpecies(); 
816        default: return super.makeProperty(hash, name);
817        }
818
819      }
820
821      @Override
822      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
823        switch (hash) {
824        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
825        case 132551405: /*firstDose*/ return new String[] {"Quantity"};
826        case -259207927: /*maxSingleDose*/ return new String[] {"Quantity"};
827        case -2017475520: /*maxDosePerDay*/ return new String[] {"Quantity"};
828        case -608040195: /*maxDosePerTreatmentPeriod*/ return new String[] {"Ratio"};
829        case 920698453: /*maxTreatmentPeriod*/ return new String[] {"Duration"};
830        case 295481963: /*targetSpecies*/ return new String[] {};
831        default: return super.getTypesForProperty(hash, name);
832        }
833
834      }
835
836      @Override
837      public Base addChild(String name) throws FHIRException {
838        if (name.equals("code")) {
839          this.code = new CodeableConcept();
840          return this.code;
841        }
842        else if (name.equals("firstDose")) {
843          this.firstDose = new Quantity();
844          return this.firstDose;
845        }
846        else if (name.equals("maxSingleDose")) {
847          this.maxSingleDose = new Quantity();
848          return this.maxSingleDose;
849        }
850        else if (name.equals("maxDosePerDay")) {
851          this.maxDosePerDay = new Quantity();
852          return this.maxDosePerDay;
853        }
854        else if (name.equals("maxDosePerTreatmentPeriod")) {
855          this.maxDosePerTreatmentPeriod = new Ratio();
856          return this.maxDosePerTreatmentPeriod;
857        }
858        else if (name.equals("maxTreatmentPeriod")) {
859          this.maxTreatmentPeriod = new Duration();
860          return this.maxTreatmentPeriod;
861        }
862        else if (name.equals("targetSpecies")) {
863          return addTargetSpecies();
864        }
865        else
866          return super.addChild(name);
867      }
868
869      public AdministrableProductDefinitionRouteOfAdministrationComponent copy() {
870        AdministrableProductDefinitionRouteOfAdministrationComponent dst = new AdministrableProductDefinitionRouteOfAdministrationComponent();
871        copyValues(dst);
872        return dst;
873      }
874
875      public void copyValues(AdministrableProductDefinitionRouteOfAdministrationComponent dst) {
876        super.copyValues(dst);
877        dst.code = code == null ? null : code.copy();
878        dst.firstDose = firstDose == null ? null : firstDose.copy();
879        dst.maxSingleDose = maxSingleDose == null ? null : maxSingleDose.copy();
880        dst.maxDosePerDay = maxDosePerDay == null ? null : maxDosePerDay.copy();
881        dst.maxDosePerTreatmentPeriod = maxDosePerTreatmentPeriod == null ? null : maxDosePerTreatmentPeriod.copy();
882        dst.maxTreatmentPeriod = maxTreatmentPeriod == null ? null : maxTreatmentPeriod.copy();
883        if (targetSpecies != null) {
884          dst.targetSpecies = new ArrayList<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent>();
885          for (AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent i : targetSpecies)
886            dst.targetSpecies.add(i.copy());
887        };
888      }
889
890      @Override
891      public boolean equalsDeep(Base other_) {
892        if (!super.equalsDeep(other_))
893          return false;
894        if (!(other_ instanceof AdministrableProductDefinitionRouteOfAdministrationComponent))
895          return false;
896        AdministrableProductDefinitionRouteOfAdministrationComponent o = (AdministrableProductDefinitionRouteOfAdministrationComponent) other_;
897        return compareDeep(code, o.code, true) && compareDeep(firstDose, o.firstDose, true) && compareDeep(maxSingleDose, o.maxSingleDose, true)
898           && compareDeep(maxDosePerDay, o.maxDosePerDay, true) && compareDeep(maxDosePerTreatmentPeriod, o.maxDosePerTreatmentPeriod, true)
899           && compareDeep(maxTreatmentPeriod, o.maxTreatmentPeriod, true) && compareDeep(targetSpecies, o.targetSpecies, true)
900          ;
901      }
902
903      @Override
904      public boolean equalsShallow(Base other_) {
905        if (!super.equalsShallow(other_))
906          return false;
907        if (!(other_ instanceof AdministrableProductDefinitionRouteOfAdministrationComponent))
908          return false;
909        AdministrableProductDefinitionRouteOfAdministrationComponent o = (AdministrableProductDefinitionRouteOfAdministrationComponent) other_;
910        return true;
911      }
912
913      public boolean isEmpty() {
914        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, firstDose, maxSingleDose
915          , maxDosePerDay, maxDosePerTreatmentPeriod, maxTreatmentPeriod, targetSpecies);
916      }
917
918  public String fhirType() {
919    return "AdministrableProductDefinition.routeOfAdministration";
920
921  }
922
923  }
924
925    @Block()
926    public static class AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent extends BackboneElement implements IBaseBackboneElement {
927        /**
928         * Coded expression for the species.
929         */
930        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
931        @Description(shortDefinition="Coded expression for the species", formalDefinition="Coded expression for the species." )
932        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/target-species")
933        protected CodeableConcept code;
934
935        /**
936         * A species specific time during which consumption of animal product is not appropriate.
937         */
938        @Child(name = "withdrawalPeriod", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
939        @Description(shortDefinition="A species specific time during which consumption of animal product is not appropriate", formalDefinition="A species specific time during which consumption of animal product is not appropriate." )
940        protected List<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent> withdrawalPeriod;
941
942        private static final long serialVersionUID = -560311351L;
943
944    /**
945     * Constructor
946     */
947      public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent() {
948        super();
949      }
950
951    /**
952     * Constructor
953     */
954      public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent(CodeableConcept code) {
955        super();
956        this.setCode(code);
957      }
958
959        /**
960         * @return {@link #code} (Coded expression for the species.)
961         */
962        public CodeableConcept getCode() { 
963          if (this.code == null)
964            if (Configuration.errorOnAutoCreate())
965              throw new Error("Attempt to auto-create AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent.code");
966            else if (Configuration.doAutoCreate())
967              this.code = new CodeableConcept(); // cc
968          return this.code;
969        }
970
971        public boolean hasCode() { 
972          return this.code != null && !this.code.isEmpty();
973        }
974
975        /**
976         * @param value {@link #code} (Coded expression for the species.)
977         */
978        public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent setCode(CodeableConcept value) { 
979          this.code = value;
980          return this;
981        }
982
983        /**
984         * @return {@link #withdrawalPeriod} (A species specific time during which consumption of animal product is not appropriate.)
985         */
986        public List<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent> getWithdrawalPeriod() { 
987          if (this.withdrawalPeriod == null)
988            this.withdrawalPeriod = new ArrayList<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent>();
989          return this.withdrawalPeriod;
990        }
991
992        /**
993         * @return Returns a reference to <code>this</code> for easy method chaining
994         */
995        public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent setWithdrawalPeriod(List<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent> theWithdrawalPeriod) { 
996          this.withdrawalPeriod = theWithdrawalPeriod;
997          return this;
998        }
999
1000        public boolean hasWithdrawalPeriod() { 
1001          if (this.withdrawalPeriod == null)
1002            return false;
1003          for (AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent item : this.withdrawalPeriod)
1004            if (!item.isEmpty())
1005              return true;
1006          return false;
1007        }
1008
1009        public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent addWithdrawalPeriod() { //3
1010          AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent t = new AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent();
1011          if (this.withdrawalPeriod == null)
1012            this.withdrawalPeriod = new ArrayList<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent>();
1013          this.withdrawalPeriod.add(t);
1014          return t;
1015        }
1016
1017        public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent addWithdrawalPeriod(AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent t) { //3
1018          if (t == null)
1019            return this;
1020          if (this.withdrawalPeriod == null)
1021            this.withdrawalPeriod = new ArrayList<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent>();
1022          this.withdrawalPeriod.add(t);
1023          return this;
1024        }
1025
1026        /**
1027         * @return The first repetition of repeating field {@link #withdrawalPeriod}, creating it if it does not already exist {3}
1028         */
1029        public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent getWithdrawalPeriodFirstRep() { 
1030          if (getWithdrawalPeriod().isEmpty()) {
1031            addWithdrawalPeriod();
1032          }
1033          return getWithdrawalPeriod().get(0);
1034        }
1035
1036        protected void listChildren(List<Property> children) {
1037          super.listChildren(children);
1038          children.add(new Property("code", "CodeableConcept", "Coded expression for the species.", 0, 1, code));
1039          children.add(new Property("withdrawalPeriod", "", "A species specific time during which consumption of animal product is not appropriate.", 0, java.lang.Integer.MAX_VALUE, withdrawalPeriod));
1040        }
1041
1042        @Override
1043        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1044          switch (_hash) {
1045          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Coded expression for the species.", 0, 1, code);
1046          case -98450730: /*withdrawalPeriod*/  return new Property("withdrawalPeriod", "", "A species specific time during which consumption of animal product is not appropriate.", 0, java.lang.Integer.MAX_VALUE, withdrawalPeriod);
1047          default: return super.getNamedProperty(_hash, _name, _checkValid);
1048          }
1049
1050        }
1051
1052      @Override
1053      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1054        switch (hash) {
1055        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1056        case -98450730: /*withdrawalPeriod*/ return this.withdrawalPeriod == null ? new Base[0] : this.withdrawalPeriod.toArray(new Base[this.withdrawalPeriod.size()]); // AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent
1057        default: return super.getProperty(hash, name, checkValid);
1058        }
1059
1060      }
1061
1062      @Override
1063      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1064        switch (hash) {
1065        case 3059181: // code
1066          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1067          return value;
1068        case -98450730: // withdrawalPeriod
1069          this.getWithdrawalPeriod().add((AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent) value); // AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent
1070          return value;
1071        default: return super.setProperty(hash, name, value);
1072        }
1073
1074      }
1075
1076      @Override
1077      public Base setProperty(String name, Base value) throws FHIRException {
1078        if (name.equals("code")) {
1079          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1080        } else if (name.equals("withdrawalPeriod")) {
1081          this.getWithdrawalPeriod().add((AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent) value);
1082        } else
1083          return super.setProperty(name, value);
1084        return value;
1085      }
1086
1087      @Override
1088      public Base makeProperty(int hash, String name) throws FHIRException {
1089        switch (hash) {
1090        case 3059181:  return getCode();
1091        case -98450730:  return addWithdrawalPeriod(); 
1092        default: return super.makeProperty(hash, name);
1093        }
1094
1095      }
1096
1097      @Override
1098      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1099        switch (hash) {
1100        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1101        case -98450730: /*withdrawalPeriod*/ return new String[] {};
1102        default: return super.getTypesForProperty(hash, name);
1103        }
1104
1105      }
1106
1107      @Override
1108      public Base addChild(String name) throws FHIRException {
1109        if (name.equals("code")) {
1110          this.code = new CodeableConcept();
1111          return this.code;
1112        }
1113        else if (name.equals("withdrawalPeriod")) {
1114          return addWithdrawalPeriod();
1115        }
1116        else
1117          return super.addChild(name);
1118      }
1119
1120      public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent copy() {
1121        AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent dst = new AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent();
1122        copyValues(dst);
1123        return dst;
1124      }
1125
1126      public void copyValues(AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent dst) {
1127        super.copyValues(dst);
1128        dst.code = code == null ? null : code.copy();
1129        if (withdrawalPeriod != null) {
1130          dst.withdrawalPeriod = new ArrayList<AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent>();
1131          for (AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent i : withdrawalPeriod)
1132            dst.withdrawalPeriod.add(i.copy());
1133        };
1134      }
1135
1136      @Override
1137      public boolean equalsDeep(Base other_) {
1138        if (!super.equalsDeep(other_))
1139          return false;
1140        if (!(other_ instanceof AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent))
1141          return false;
1142        AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent o = (AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent) other_;
1143        return compareDeep(code, o.code, true) && compareDeep(withdrawalPeriod, o.withdrawalPeriod, true)
1144          ;
1145      }
1146
1147      @Override
1148      public boolean equalsShallow(Base other_) {
1149        if (!super.equalsShallow(other_))
1150          return false;
1151        if (!(other_ instanceof AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent))
1152          return false;
1153        AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent o = (AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent) other_;
1154        return true;
1155      }
1156
1157      public boolean isEmpty() {
1158        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, withdrawalPeriod);
1159      }
1160
1161  public String fhirType() {
1162    return "AdministrableProductDefinition.routeOfAdministration.targetSpecies";
1163
1164  }
1165
1166  }
1167
1168    @Block()
1169    public static class AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent extends BackboneElement implements IBaseBackboneElement {
1170        /**
1171         * Coded expression for the type of tissue for which the withdrawal period applies, e.g. meat, milk.
1172         */
1173        @Child(name = "tissue", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
1174        @Description(shortDefinition="The type of tissue for which the withdrawal period applies, e.g. meat, milk", formalDefinition="Coded expression for the type of tissue for which the withdrawal period applies, e.g. meat, milk." )
1175        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/animal-tissue-type")
1176        protected CodeableConcept tissue;
1177
1178        /**
1179         * A value for the time.
1180         */
1181        @Child(name = "value", type = {Quantity.class}, order=2, min=1, max=1, modifier=false, summary=true)
1182        @Description(shortDefinition="A value for the time", formalDefinition="A value for the time." )
1183        protected Quantity value;
1184
1185        /**
1186         * Extra information about the withdrawal period.
1187         */
1188        @Child(name = "supportingInformation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1189        @Description(shortDefinition="Extra information about the withdrawal period", formalDefinition="Extra information about the withdrawal period." )
1190        protected StringType supportingInformation;
1191
1192        private static final long serialVersionUID = -1113691238L;
1193
1194    /**
1195     * Constructor
1196     */
1197      public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent() {
1198        super();
1199      }
1200
1201    /**
1202     * Constructor
1203     */
1204      public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent(CodeableConcept tissue, Quantity value) {
1205        super();
1206        this.setTissue(tissue);
1207        this.setValue(value);
1208      }
1209
1210        /**
1211         * @return {@link #tissue} (Coded expression for the type of tissue for which the withdrawal period applies, e.g. meat, milk.)
1212         */
1213        public CodeableConcept getTissue() { 
1214          if (this.tissue == null)
1215            if (Configuration.errorOnAutoCreate())
1216              throw new Error("Attempt to auto-create AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent.tissue");
1217            else if (Configuration.doAutoCreate())
1218              this.tissue = new CodeableConcept(); // cc
1219          return this.tissue;
1220        }
1221
1222        public boolean hasTissue() { 
1223          return this.tissue != null && !this.tissue.isEmpty();
1224        }
1225
1226        /**
1227         * @param value {@link #tissue} (Coded expression for the type of tissue for which the withdrawal period applies, e.g. meat, milk.)
1228         */
1229        public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent setTissue(CodeableConcept value) { 
1230          this.tissue = value;
1231          return this;
1232        }
1233
1234        /**
1235         * @return {@link #value} (A value for the time.)
1236         */
1237        public Quantity getValue() { 
1238          if (this.value == null)
1239            if (Configuration.errorOnAutoCreate())
1240              throw new Error("Attempt to auto-create AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent.value");
1241            else if (Configuration.doAutoCreate())
1242              this.value = new Quantity(); // cc
1243          return this.value;
1244        }
1245
1246        public boolean hasValue() { 
1247          return this.value != null && !this.value.isEmpty();
1248        }
1249
1250        /**
1251         * @param value {@link #value} (A value for the time.)
1252         */
1253        public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent setValue(Quantity value) { 
1254          this.value = value;
1255          return this;
1256        }
1257
1258        /**
1259         * @return {@link #supportingInformation} (Extra information about the withdrawal period.). This is the underlying object with id, value and extensions. The accessor "getSupportingInformation" gives direct access to the value
1260         */
1261        public StringType getSupportingInformationElement() { 
1262          if (this.supportingInformation == null)
1263            if (Configuration.errorOnAutoCreate())
1264              throw new Error("Attempt to auto-create AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent.supportingInformation");
1265            else if (Configuration.doAutoCreate())
1266              this.supportingInformation = new StringType(); // bb
1267          return this.supportingInformation;
1268        }
1269
1270        public boolean hasSupportingInformationElement() { 
1271          return this.supportingInformation != null && !this.supportingInformation.isEmpty();
1272        }
1273
1274        public boolean hasSupportingInformation() { 
1275          return this.supportingInformation != null && !this.supportingInformation.isEmpty();
1276        }
1277
1278        /**
1279         * @param value {@link #supportingInformation} (Extra information about the withdrawal period.). This is the underlying object with id, value and extensions. The accessor "getSupportingInformation" gives direct access to the value
1280         */
1281        public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent setSupportingInformationElement(StringType value) { 
1282          this.supportingInformation = value;
1283          return this;
1284        }
1285
1286        /**
1287         * @return Extra information about the withdrawal period.
1288         */
1289        public String getSupportingInformation() { 
1290          return this.supportingInformation == null ? null : this.supportingInformation.getValue();
1291        }
1292
1293        /**
1294         * @param value Extra information about the withdrawal period.
1295         */
1296        public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent setSupportingInformation(String value) { 
1297          if (Utilities.noString(value))
1298            this.supportingInformation = null;
1299          else {
1300            if (this.supportingInformation == null)
1301              this.supportingInformation = new StringType();
1302            this.supportingInformation.setValue(value);
1303          }
1304          return this;
1305        }
1306
1307        protected void listChildren(List<Property> children) {
1308          super.listChildren(children);
1309          children.add(new Property("tissue", "CodeableConcept", "Coded expression for the type of tissue for which the withdrawal period applies, e.g. meat, milk.", 0, 1, tissue));
1310          children.add(new Property("value", "Quantity", "A value for the time.", 0, 1, value));
1311          children.add(new Property("supportingInformation", "string", "Extra information about the withdrawal period.", 0, 1, supportingInformation));
1312        }
1313
1314        @Override
1315        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1316          switch (_hash) {
1317          case -873475867: /*tissue*/  return new Property("tissue", "CodeableConcept", "Coded expression for the type of tissue for which the withdrawal period applies, e.g. meat, milk.", 0, 1, tissue);
1318          case 111972721: /*value*/  return new Property("value", "Quantity", "A value for the time.", 0, 1, value);
1319          case -1248768647: /*supportingInformation*/  return new Property("supportingInformation", "string", "Extra information about the withdrawal period.", 0, 1, supportingInformation);
1320          default: return super.getNamedProperty(_hash, _name, _checkValid);
1321          }
1322
1323        }
1324
1325      @Override
1326      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1327        switch (hash) {
1328        case -873475867: /*tissue*/ return this.tissue == null ? new Base[0] : new Base[] {this.tissue}; // CodeableConcept
1329        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Quantity
1330        case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : new Base[] {this.supportingInformation}; // StringType
1331        default: return super.getProperty(hash, name, checkValid);
1332        }
1333
1334      }
1335
1336      @Override
1337      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1338        switch (hash) {
1339        case -873475867: // tissue
1340          this.tissue = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1341          return value;
1342        case 111972721: // value
1343          this.value = TypeConvertor.castToQuantity(value); // Quantity
1344          return value;
1345        case -1248768647: // supportingInformation
1346          this.supportingInformation = TypeConvertor.castToString(value); // StringType
1347          return value;
1348        default: return super.setProperty(hash, name, value);
1349        }
1350
1351      }
1352
1353      @Override
1354      public Base setProperty(String name, Base value) throws FHIRException {
1355        if (name.equals("tissue")) {
1356          this.tissue = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1357        } else if (name.equals("value")) {
1358          this.value = TypeConvertor.castToQuantity(value); // Quantity
1359        } else if (name.equals("supportingInformation")) {
1360          this.supportingInformation = TypeConvertor.castToString(value); // StringType
1361        } else
1362          return super.setProperty(name, value);
1363        return value;
1364      }
1365
1366      @Override
1367      public Base makeProperty(int hash, String name) throws FHIRException {
1368        switch (hash) {
1369        case -873475867:  return getTissue();
1370        case 111972721:  return getValue();
1371        case -1248768647:  return getSupportingInformationElement();
1372        default: return super.makeProperty(hash, name);
1373        }
1374
1375      }
1376
1377      @Override
1378      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1379        switch (hash) {
1380        case -873475867: /*tissue*/ return new String[] {"CodeableConcept"};
1381        case 111972721: /*value*/ return new String[] {"Quantity"};
1382        case -1248768647: /*supportingInformation*/ return new String[] {"string"};
1383        default: return super.getTypesForProperty(hash, name);
1384        }
1385
1386      }
1387
1388      @Override
1389      public Base addChild(String name) throws FHIRException {
1390        if (name.equals("tissue")) {
1391          this.tissue = new CodeableConcept();
1392          return this.tissue;
1393        }
1394        else if (name.equals("value")) {
1395          this.value = new Quantity();
1396          return this.value;
1397        }
1398        else if (name.equals("supportingInformation")) {
1399          throw new FHIRException("Cannot call addChild on a singleton property AdministrableProductDefinition.routeOfAdministration.targetSpecies.withdrawalPeriod.supportingInformation");
1400        }
1401        else
1402          return super.addChild(name);
1403      }
1404
1405      public AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent copy() {
1406        AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent dst = new AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent();
1407        copyValues(dst);
1408        return dst;
1409      }
1410
1411      public void copyValues(AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent dst) {
1412        super.copyValues(dst);
1413        dst.tissue = tissue == null ? null : tissue.copy();
1414        dst.value = value == null ? null : value.copy();
1415        dst.supportingInformation = supportingInformation == null ? null : supportingInformation.copy();
1416      }
1417
1418      @Override
1419      public boolean equalsDeep(Base other_) {
1420        if (!super.equalsDeep(other_))
1421          return false;
1422        if (!(other_ instanceof AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent))
1423          return false;
1424        AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent o = (AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent) other_;
1425        return compareDeep(tissue, o.tissue, true) && compareDeep(value, o.value, true) && compareDeep(supportingInformation, o.supportingInformation, true)
1426          ;
1427      }
1428
1429      @Override
1430      public boolean equalsShallow(Base other_) {
1431        if (!super.equalsShallow(other_))
1432          return false;
1433        if (!(other_ instanceof AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent))
1434          return false;
1435        AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent o = (AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent) other_;
1436        return compareValues(supportingInformation, o.supportingInformation, true);
1437      }
1438
1439      public boolean isEmpty() {
1440        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(tissue, value, supportingInformation
1441          );
1442      }
1443
1444  public String fhirType() {
1445    return "AdministrableProductDefinition.routeOfAdministration.targetSpecies.withdrawalPeriod";
1446
1447  }
1448
1449  }
1450
1451    /**
1452     * An identifier for the administrable product.
1453     */
1454    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1455    @Description(shortDefinition="An identifier for the administrable product", formalDefinition="An identifier for the administrable product." )
1456    protected List<Identifier> identifier;
1457
1458    /**
1459     * The status of this administrable product. Enables tracking the life-cycle of the content.
1460     */
1461    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
1462    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The status of this administrable product. Enables tracking the life-cycle of the content." )
1463    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
1464    protected Enumeration<PublicationStatus> status;
1465
1466    /**
1467     * References a product from which one or more of the constituent parts of that product can be prepared and used as described by this administrable product.  If this administrable product describes the administration of a crushed tablet, the 'formOf' would be the product representing a distribution containing tablets and possibly also a cream.  This is distinct from the 'producedFrom' which refers to the specific components of the product that are used in this preparation, rather than the product as a whole.
1468     */
1469    @Child(name = "formOf", type = {MedicinalProductDefinition.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1470    @Description(shortDefinition="References a product from which one or more of the constituent parts of that product can be prepared and used as described by this administrable product", formalDefinition="References a product from which one or more of the constituent parts of that product can be prepared and used as described by this administrable product.  If this administrable product describes the administration of a crushed tablet, the 'formOf' would be the product representing a distribution containing tablets and possibly also a cream.  This is distinct from the 'producedFrom' which refers to the specific components of the product that are used in this preparation, rather than the product as a whole." )
1471    protected List<Reference> formOf;
1472
1473    /**
1474     * The dose form of the final product after necessary reconstitution or processing. Contrasts to the manufactured dose form (see ManufacturedItemDefinition). If the manufactured form was 'powder for solution for injection', the administrable dose form could be 'solution for injection' (once mixed with another item having manufactured form 'solvent for solution for injection').
1475     */
1476    @Child(name = "administrableDoseForm", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
1477    @Description(shortDefinition="The dose form of the final product after necessary reconstitution or processing", formalDefinition="The dose form of the final product after necessary reconstitution or processing. Contrasts to the manufactured dose form (see ManufacturedItemDefinition). If the manufactured form was 'powder for solution for injection', the administrable dose form could be 'solution for injection' (once mixed with another item having manufactured form 'solvent for solution for injection')." )
1478    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/administrable-dose-form")
1479    protected CodeableConcept administrableDoseForm;
1480
1481    /**
1482     * The presentation type in which this item is given to a patient. e.g. for a spray - 'puff' (as in 'contains 100 mcg per puff'), or for a liquid - 'vial' (as in 'contains 5 ml per vial').
1483     */
1484    @Child(name = "unitOfPresentation", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
1485    @Description(shortDefinition="The presentation type in which this item is given to a patient. e.g. for a spray - 'puff'", formalDefinition="The presentation type in which this item is given to a patient. e.g. for a spray - 'puff' (as in 'contains 100 mcg per puff'), or for a liquid - 'vial' (as in 'contains 5 ml per vial')." )
1486    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/unit-of-presentation")
1487    protected CodeableConcept unitOfPresentation;
1488
1489    /**
1490     * Indicates the specific manufactured items that are part of the 'formOf' product that are used in the preparation of this specific administrable form.  In some cases, an administrable form might use all of the items from the overall product (or there might only be one item), while in other cases, an administrable form might use only a subset of the items available in the overall product.  For example, an administrable form might involve combining a liquid and a powder available as part of an overall product, but not involve applying the also supplied cream.
1491     */
1492    @Child(name = "producedFrom", type = {ManufacturedItemDefinition.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1493    @Description(shortDefinition="Indicates the specific manufactured items that are part of the 'formOf' product that are used in the preparation of this specific administrable form", formalDefinition="Indicates the specific manufactured items that are part of the 'formOf' product that are used in the preparation of this specific administrable form.  In some cases, an administrable form might use all of the items from the overall product (or there might only be one item), while in other cases, an administrable form might use only a subset of the items available in the overall product.  For example, an administrable form might involve combining a liquid and a powder available as part of an overall product, but not involve applying the also supplied cream." )
1494    protected List<Reference> producedFrom;
1495
1496    /**
1497     * The ingredients of this administrable medicinal product. This is only needed if the ingredients are not specified either using ManufacturedItemDefiniton (via AdministrableProductDefinition.producedFrom) to state which component items are used to make this, or using by incoming references from the Ingredient resource, to state in detail which substances exist within this. This element allows a basic coded ingredient to be used.
1498     */
1499    @Child(name = "ingredient", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1500    @Description(shortDefinition="The ingredients of this administrable medicinal product. This is only needed if the ingredients are not specified either using ManufacturedItemDefiniton, or using by incoming references from the Ingredient resource", formalDefinition="The ingredients of this administrable medicinal product. This is only needed if the ingredients are not specified either using ManufacturedItemDefiniton (via AdministrableProductDefinition.producedFrom) to state which component items are used to make this, or using by incoming references from the Ingredient resource, to state in detail which substances exist within this. This element allows a basic coded ingredient to be used." )
1501    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-codes")
1502    protected List<CodeableConcept> ingredient;
1503
1504    /**
1505     * A device that is integral to the medicinal product, in effect being considered as an "ingredient" of the medicinal product. This is not intended for devices that are just co-packaged.
1506     */
1507    @Child(name = "device", type = {DeviceDefinition.class}, order=7, min=0, max=1, modifier=false, summary=true)
1508    @Description(shortDefinition="A device that is integral to the medicinal product, in effect being considered as an \"ingredient\" of the medicinal product", formalDefinition="A device that is integral to the medicinal product, in effect being considered as an \"ingredient\" of the medicinal product. This is not intended for devices that are just co-packaged." )
1509    protected Reference device;
1510
1511    /**
1512     * A general description of the product, when in its final form, suitable for administration e.g. effervescent blue liquid, to be swallowed. Intended to be used when the other structured properties of this resource are insufficient or cannot be supported. It is not intended to duplicate information already carried elswehere.
1513     */
1514    @Child(name = "description", type = {MarkdownType.class}, order=8, min=0, max=1, modifier=false, summary=false)
1515    @Description(shortDefinition="A general description of the product, when in its final form, suitable for administration e.g. effervescent blue liquid, to be swallowed", formalDefinition="A general description of the product, when in its final form, suitable for administration e.g. effervescent blue liquid, to be swallowed. Intended to be used when the other structured properties of this resource are insufficient or cannot be supported. It is not intended to duplicate information already carried elswehere." )
1516    protected MarkdownType description;
1517
1518    /**
1519     * Characteristics e.g. a product's onset of action.
1520     */
1521    @Child(name = "property", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1522    @Description(shortDefinition="Characteristics e.g. a product's onset of action", formalDefinition="Characteristics e.g. a product's onset of action." )
1523    protected List<AdministrableProductDefinitionPropertyComponent> property;
1524
1525    /**
1526     * The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. RouteOfAdministration cannot be used when the 'formOf' product already uses MedicinalProductDefinition.route (and vice versa).
1527     */
1528    @Child(name = "routeOfAdministration", type = {}, order=10, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1529    @Description(shortDefinition="The path by which the product is taken into or makes contact with the body", formalDefinition="The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. RouteOfAdministration cannot be used when the 'formOf' product already uses MedicinalProductDefinition.route (and vice versa)." )
1530    protected List<AdministrableProductDefinitionRouteOfAdministrationComponent> routeOfAdministration;
1531
1532    private static final long serialVersionUID = -487805677L;
1533
1534  /**
1535   * Constructor
1536   */
1537    public AdministrableProductDefinition() {
1538      super();
1539    }
1540
1541  /**
1542   * Constructor
1543   */
1544    public AdministrableProductDefinition(PublicationStatus status, AdministrableProductDefinitionRouteOfAdministrationComponent routeOfAdministration) {
1545      super();
1546      this.setStatus(status);
1547      this.addRouteOfAdministration(routeOfAdministration);
1548    }
1549
1550    /**
1551     * @return {@link #identifier} (An identifier for the administrable product.)
1552     */
1553    public List<Identifier> getIdentifier() { 
1554      if (this.identifier == null)
1555        this.identifier = new ArrayList<Identifier>();
1556      return this.identifier;
1557    }
1558
1559    /**
1560     * @return Returns a reference to <code>this</code> for easy method chaining
1561     */
1562    public AdministrableProductDefinition setIdentifier(List<Identifier> theIdentifier) { 
1563      this.identifier = theIdentifier;
1564      return this;
1565    }
1566
1567    public boolean hasIdentifier() { 
1568      if (this.identifier == null)
1569        return false;
1570      for (Identifier item : this.identifier)
1571        if (!item.isEmpty())
1572          return true;
1573      return false;
1574    }
1575
1576    public Identifier addIdentifier() { //3
1577      Identifier t = new Identifier();
1578      if (this.identifier == null)
1579        this.identifier = new ArrayList<Identifier>();
1580      this.identifier.add(t);
1581      return t;
1582    }
1583
1584    public AdministrableProductDefinition addIdentifier(Identifier t) { //3
1585      if (t == null)
1586        return this;
1587      if (this.identifier == null)
1588        this.identifier = new ArrayList<Identifier>();
1589      this.identifier.add(t);
1590      return this;
1591    }
1592
1593    /**
1594     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1595     */
1596    public Identifier getIdentifierFirstRep() { 
1597      if (getIdentifier().isEmpty()) {
1598        addIdentifier();
1599      }
1600      return getIdentifier().get(0);
1601    }
1602
1603    /**
1604     * @return {@link #status} (The status of this administrable product. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1605     */
1606    public Enumeration<PublicationStatus> getStatusElement() { 
1607      if (this.status == null)
1608        if (Configuration.errorOnAutoCreate())
1609          throw new Error("Attempt to auto-create AdministrableProductDefinition.status");
1610        else if (Configuration.doAutoCreate())
1611          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
1612      return this.status;
1613    }
1614
1615    public boolean hasStatusElement() { 
1616      return this.status != null && !this.status.isEmpty();
1617    }
1618
1619    public boolean hasStatus() { 
1620      return this.status != null && !this.status.isEmpty();
1621    }
1622
1623    /**
1624     * @param value {@link #status} (The status of this administrable product. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1625     */
1626    public AdministrableProductDefinition setStatusElement(Enumeration<PublicationStatus> value) { 
1627      this.status = value;
1628      return this;
1629    }
1630
1631    /**
1632     * @return The status of this administrable product. Enables tracking the life-cycle of the content.
1633     */
1634    public PublicationStatus getStatus() { 
1635      return this.status == null ? null : this.status.getValue();
1636    }
1637
1638    /**
1639     * @param value The status of this administrable product. Enables tracking the life-cycle of the content.
1640     */
1641    public AdministrableProductDefinition setStatus(PublicationStatus value) { 
1642        if (this.status == null)
1643          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
1644        this.status.setValue(value);
1645      return this;
1646    }
1647
1648    /**
1649     * @return {@link #formOf} (References a product from which one or more of the constituent parts of that product can be prepared and used as described by this administrable product.  If this administrable product describes the administration of a crushed tablet, the 'formOf' would be the product representing a distribution containing tablets and possibly also a cream.  This is distinct from the 'producedFrom' which refers to the specific components of the product that are used in this preparation, rather than the product as a whole.)
1650     */
1651    public List<Reference> getFormOf() { 
1652      if (this.formOf == null)
1653        this.formOf = new ArrayList<Reference>();
1654      return this.formOf;
1655    }
1656
1657    /**
1658     * @return Returns a reference to <code>this</code> for easy method chaining
1659     */
1660    public AdministrableProductDefinition setFormOf(List<Reference> theFormOf) { 
1661      this.formOf = theFormOf;
1662      return this;
1663    }
1664
1665    public boolean hasFormOf() { 
1666      if (this.formOf == null)
1667        return false;
1668      for (Reference item : this.formOf)
1669        if (!item.isEmpty())
1670          return true;
1671      return false;
1672    }
1673
1674    public Reference addFormOf() { //3
1675      Reference t = new Reference();
1676      if (this.formOf == null)
1677        this.formOf = new ArrayList<Reference>();
1678      this.formOf.add(t);
1679      return t;
1680    }
1681
1682    public AdministrableProductDefinition addFormOf(Reference t) { //3
1683      if (t == null)
1684        return this;
1685      if (this.formOf == null)
1686        this.formOf = new ArrayList<Reference>();
1687      this.formOf.add(t);
1688      return this;
1689    }
1690
1691    /**
1692     * @return The first repetition of repeating field {@link #formOf}, creating it if it does not already exist {3}
1693     */
1694    public Reference getFormOfFirstRep() { 
1695      if (getFormOf().isEmpty()) {
1696        addFormOf();
1697      }
1698      return getFormOf().get(0);
1699    }
1700
1701    /**
1702     * @return {@link #administrableDoseForm} (The dose form of the final product after necessary reconstitution or processing. Contrasts to the manufactured dose form (see ManufacturedItemDefinition). If the manufactured form was 'powder for solution for injection', the administrable dose form could be 'solution for injection' (once mixed with another item having manufactured form 'solvent for solution for injection').)
1703     */
1704    public CodeableConcept getAdministrableDoseForm() { 
1705      if (this.administrableDoseForm == null)
1706        if (Configuration.errorOnAutoCreate())
1707          throw new Error("Attempt to auto-create AdministrableProductDefinition.administrableDoseForm");
1708        else if (Configuration.doAutoCreate())
1709          this.administrableDoseForm = new CodeableConcept(); // cc
1710      return this.administrableDoseForm;
1711    }
1712
1713    public boolean hasAdministrableDoseForm() { 
1714      return this.administrableDoseForm != null && !this.administrableDoseForm.isEmpty();
1715    }
1716
1717    /**
1718     * @param value {@link #administrableDoseForm} (The dose form of the final product after necessary reconstitution or processing. Contrasts to the manufactured dose form (see ManufacturedItemDefinition). If the manufactured form was 'powder for solution for injection', the administrable dose form could be 'solution for injection' (once mixed with another item having manufactured form 'solvent for solution for injection').)
1719     */
1720    public AdministrableProductDefinition setAdministrableDoseForm(CodeableConcept value) { 
1721      this.administrableDoseForm = value;
1722      return this;
1723    }
1724
1725    /**
1726     * @return {@link #unitOfPresentation} (The presentation type in which this item is given to a patient. e.g. for a spray - 'puff' (as in 'contains 100 mcg per puff'), or for a liquid - 'vial' (as in 'contains 5 ml per vial').)
1727     */
1728    public CodeableConcept getUnitOfPresentation() { 
1729      if (this.unitOfPresentation == null)
1730        if (Configuration.errorOnAutoCreate())
1731          throw new Error("Attempt to auto-create AdministrableProductDefinition.unitOfPresentation");
1732        else if (Configuration.doAutoCreate())
1733          this.unitOfPresentation = new CodeableConcept(); // cc
1734      return this.unitOfPresentation;
1735    }
1736
1737    public boolean hasUnitOfPresentation() { 
1738      return this.unitOfPresentation != null && !this.unitOfPresentation.isEmpty();
1739    }
1740
1741    /**
1742     * @param value {@link #unitOfPresentation} (The presentation type in which this item is given to a patient. e.g. for a spray - 'puff' (as in 'contains 100 mcg per puff'), or for a liquid - 'vial' (as in 'contains 5 ml per vial').)
1743     */
1744    public AdministrableProductDefinition setUnitOfPresentation(CodeableConcept value) { 
1745      this.unitOfPresentation = value;
1746      return this;
1747    }
1748
1749    /**
1750     * @return {@link #producedFrom} (Indicates the specific manufactured items that are part of the 'formOf' product that are used in the preparation of this specific administrable form.  In some cases, an administrable form might use all of the items from the overall product (or there might only be one item), while in other cases, an administrable form might use only a subset of the items available in the overall product.  For example, an administrable form might involve combining a liquid and a powder available as part of an overall product, but not involve applying the also supplied cream.)
1751     */
1752    public List<Reference> getProducedFrom() { 
1753      if (this.producedFrom == null)
1754        this.producedFrom = new ArrayList<Reference>();
1755      return this.producedFrom;
1756    }
1757
1758    /**
1759     * @return Returns a reference to <code>this</code> for easy method chaining
1760     */
1761    public AdministrableProductDefinition setProducedFrom(List<Reference> theProducedFrom) { 
1762      this.producedFrom = theProducedFrom;
1763      return this;
1764    }
1765
1766    public boolean hasProducedFrom() { 
1767      if (this.producedFrom == null)
1768        return false;
1769      for (Reference item : this.producedFrom)
1770        if (!item.isEmpty())
1771          return true;
1772      return false;
1773    }
1774
1775    public Reference addProducedFrom() { //3
1776      Reference t = new Reference();
1777      if (this.producedFrom == null)
1778        this.producedFrom = new ArrayList<Reference>();
1779      this.producedFrom.add(t);
1780      return t;
1781    }
1782
1783    public AdministrableProductDefinition addProducedFrom(Reference t) { //3
1784      if (t == null)
1785        return this;
1786      if (this.producedFrom == null)
1787        this.producedFrom = new ArrayList<Reference>();
1788      this.producedFrom.add(t);
1789      return this;
1790    }
1791
1792    /**
1793     * @return The first repetition of repeating field {@link #producedFrom}, creating it if it does not already exist {3}
1794     */
1795    public Reference getProducedFromFirstRep() { 
1796      if (getProducedFrom().isEmpty()) {
1797        addProducedFrom();
1798      }
1799      return getProducedFrom().get(0);
1800    }
1801
1802    /**
1803     * @return {@link #ingredient} (The ingredients of this administrable medicinal product. This is only needed if the ingredients are not specified either using ManufacturedItemDefiniton (via AdministrableProductDefinition.producedFrom) to state which component items are used to make this, or using by incoming references from the Ingredient resource, to state in detail which substances exist within this. This element allows a basic coded ingredient to be used.)
1804     */
1805    public List<CodeableConcept> getIngredient() { 
1806      if (this.ingredient == null)
1807        this.ingredient = new ArrayList<CodeableConcept>();
1808      return this.ingredient;
1809    }
1810
1811    /**
1812     * @return Returns a reference to <code>this</code> for easy method chaining
1813     */
1814    public AdministrableProductDefinition setIngredient(List<CodeableConcept> theIngredient) { 
1815      this.ingredient = theIngredient;
1816      return this;
1817    }
1818
1819    public boolean hasIngredient() { 
1820      if (this.ingredient == null)
1821        return false;
1822      for (CodeableConcept item : this.ingredient)
1823        if (!item.isEmpty())
1824          return true;
1825      return false;
1826    }
1827
1828    public CodeableConcept addIngredient() { //3
1829      CodeableConcept t = new CodeableConcept();
1830      if (this.ingredient == null)
1831        this.ingredient = new ArrayList<CodeableConcept>();
1832      this.ingredient.add(t);
1833      return t;
1834    }
1835
1836    public AdministrableProductDefinition addIngredient(CodeableConcept t) { //3
1837      if (t == null)
1838        return this;
1839      if (this.ingredient == null)
1840        this.ingredient = new ArrayList<CodeableConcept>();
1841      this.ingredient.add(t);
1842      return this;
1843    }
1844
1845    /**
1846     * @return The first repetition of repeating field {@link #ingredient}, creating it if it does not already exist {3}
1847     */
1848    public CodeableConcept getIngredientFirstRep() { 
1849      if (getIngredient().isEmpty()) {
1850        addIngredient();
1851      }
1852      return getIngredient().get(0);
1853    }
1854
1855    /**
1856     * @return {@link #device} (A device that is integral to the medicinal product, in effect being considered as an "ingredient" of the medicinal product. This is not intended for devices that are just co-packaged.)
1857     */
1858    public Reference getDevice() { 
1859      if (this.device == null)
1860        if (Configuration.errorOnAutoCreate())
1861          throw new Error("Attempt to auto-create AdministrableProductDefinition.device");
1862        else if (Configuration.doAutoCreate())
1863          this.device = new Reference(); // cc
1864      return this.device;
1865    }
1866
1867    public boolean hasDevice() { 
1868      return this.device != null && !this.device.isEmpty();
1869    }
1870
1871    /**
1872     * @param value {@link #device} (A device that is integral to the medicinal product, in effect being considered as an "ingredient" of the medicinal product. This is not intended for devices that are just co-packaged.)
1873     */
1874    public AdministrableProductDefinition setDevice(Reference value) { 
1875      this.device = value;
1876      return this;
1877    }
1878
1879    /**
1880     * @return {@link #description} (A general description of the product, when in its final form, suitable for administration e.g. effervescent blue liquid, to be swallowed. Intended to be used when the other structured properties of this resource are insufficient or cannot be supported. It is not intended to duplicate information already carried elswehere.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1881     */
1882    public MarkdownType getDescriptionElement() { 
1883      if (this.description == null)
1884        if (Configuration.errorOnAutoCreate())
1885          throw new Error("Attempt to auto-create AdministrableProductDefinition.description");
1886        else if (Configuration.doAutoCreate())
1887          this.description = new MarkdownType(); // bb
1888      return this.description;
1889    }
1890
1891    public boolean hasDescriptionElement() { 
1892      return this.description != null && !this.description.isEmpty();
1893    }
1894
1895    public boolean hasDescription() { 
1896      return this.description != null && !this.description.isEmpty();
1897    }
1898
1899    /**
1900     * @param value {@link #description} (A general description of the product, when in its final form, suitable for administration e.g. effervescent blue liquid, to be swallowed. Intended to be used when the other structured properties of this resource are insufficient or cannot be supported. It is not intended to duplicate information already carried elswehere.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1901     */
1902    public AdministrableProductDefinition setDescriptionElement(MarkdownType value) { 
1903      this.description = value;
1904      return this;
1905    }
1906
1907    /**
1908     * @return A general description of the product, when in its final form, suitable for administration e.g. effervescent blue liquid, to be swallowed. Intended to be used when the other structured properties of this resource are insufficient or cannot be supported. It is not intended to duplicate information already carried elswehere.
1909     */
1910    public String getDescription() { 
1911      return this.description == null ? null : this.description.getValue();
1912    }
1913
1914    /**
1915     * @param value A general description of the product, when in its final form, suitable for administration e.g. effervescent blue liquid, to be swallowed. Intended to be used when the other structured properties of this resource are insufficient or cannot be supported. It is not intended to duplicate information already carried elswehere.
1916     */
1917    public AdministrableProductDefinition setDescription(String value) { 
1918      if (Utilities.noString(value))
1919        this.description = null;
1920      else {
1921        if (this.description == null)
1922          this.description = new MarkdownType();
1923        this.description.setValue(value);
1924      }
1925      return this;
1926    }
1927
1928    /**
1929     * @return {@link #property} (Characteristics e.g. a product's onset of action.)
1930     */
1931    public List<AdministrableProductDefinitionPropertyComponent> getProperty() { 
1932      if (this.property == null)
1933        this.property = new ArrayList<AdministrableProductDefinitionPropertyComponent>();
1934      return this.property;
1935    }
1936
1937    /**
1938     * @return Returns a reference to <code>this</code> for easy method chaining
1939     */
1940    public AdministrableProductDefinition setProperty(List<AdministrableProductDefinitionPropertyComponent> theProperty) { 
1941      this.property = theProperty;
1942      return this;
1943    }
1944
1945    public boolean hasProperty() { 
1946      if (this.property == null)
1947        return false;
1948      for (AdministrableProductDefinitionPropertyComponent item : this.property)
1949        if (!item.isEmpty())
1950          return true;
1951      return false;
1952    }
1953
1954    public AdministrableProductDefinitionPropertyComponent addProperty() { //3
1955      AdministrableProductDefinitionPropertyComponent t = new AdministrableProductDefinitionPropertyComponent();
1956      if (this.property == null)
1957        this.property = new ArrayList<AdministrableProductDefinitionPropertyComponent>();
1958      this.property.add(t);
1959      return t;
1960    }
1961
1962    public AdministrableProductDefinition addProperty(AdministrableProductDefinitionPropertyComponent t) { //3
1963      if (t == null)
1964        return this;
1965      if (this.property == null)
1966        this.property = new ArrayList<AdministrableProductDefinitionPropertyComponent>();
1967      this.property.add(t);
1968      return this;
1969    }
1970
1971    /**
1972     * @return The first repetition of repeating field {@link #property}, creating it if it does not already exist {3}
1973     */
1974    public AdministrableProductDefinitionPropertyComponent getPropertyFirstRep() { 
1975      if (getProperty().isEmpty()) {
1976        addProperty();
1977      }
1978      return getProperty().get(0);
1979    }
1980
1981    /**
1982     * @return {@link #routeOfAdministration} (The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. RouteOfAdministration cannot be used when the 'formOf' product already uses MedicinalProductDefinition.route (and vice versa).)
1983     */
1984    public List<AdministrableProductDefinitionRouteOfAdministrationComponent> getRouteOfAdministration() { 
1985      if (this.routeOfAdministration == null)
1986        this.routeOfAdministration = new ArrayList<AdministrableProductDefinitionRouteOfAdministrationComponent>();
1987      return this.routeOfAdministration;
1988    }
1989
1990    /**
1991     * @return Returns a reference to <code>this</code> for easy method chaining
1992     */
1993    public AdministrableProductDefinition setRouteOfAdministration(List<AdministrableProductDefinitionRouteOfAdministrationComponent> theRouteOfAdministration) { 
1994      this.routeOfAdministration = theRouteOfAdministration;
1995      return this;
1996    }
1997
1998    public boolean hasRouteOfAdministration() { 
1999      if (this.routeOfAdministration == null)
2000        return false;
2001      for (AdministrableProductDefinitionRouteOfAdministrationComponent item : this.routeOfAdministration)
2002        if (!item.isEmpty())
2003          return true;
2004      return false;
2005    }
2006
2007    public AdministrableProductDefinitionRouteOfAdministrationComponent addRouteOfAdministration() { //3
2008      AdministrableProductDefinitionRouteOfAdministrationComponent t = new AdministrableProductDefinitionRouteOfAdministrationComponent();
2009      if (this.routeOfAdministration == null)
2010        this.routeOfAdministration = new ArrayList<AdministrableProductDefinitionRouteOfAdministrationComponent>();
2011      this.routeOfAdministration.add(t);
2012      return t;
2013    }
2014
2015    public AdministrableProductDefinition addRouteOfAdministration(AdministrableProductDefinitionRouteOfAdministrationComponent t) { //3
2016      if (t == null)
2017        return this;
2018      if (this.routeOfAdministration == null)
2019        this.routeOfAdministration = new ArrayList<AdministrableProductDefinitionRouteOfAdministrationComponent>();
2020      this.routeOfAdministration.add(t);
2021      return this;
2022    }
2023
2024    /**
2025     * @return The first repetition of repeating field {@link #routeOfAdministration}, creating it if it does not already exist {3}
2026     */
2027    public AdministrableProductDefinitionRouteOfAdministrationComponent getRouteOfAdministrationFirstRep() { 
2028      if (getRouteOfAdministration().isEmpty()) {
2029        addRouteOfAdministration();
2030      }
2031      return getRouteOfAdministration().get(0);
2032    }
2033
2034      protected void listChildren(List<Property> children) {
2035        super.listChildren(children);
2036        children.add(new Property("identifier", "Identifier", "An identifier for the administrable product.", 0, java.lang.Integer.MAX_VALUE, identifier));
2037        children.add(new Property("status", "code", "The status of this administrable product. Enables tracking the life-cycle of the content.", 0, 1, status));
2038        children.add(new Property("formOf", "Reference(MedicinalProductDefinition)", "References a product from which one or more of the constituent parts of that product can be prepared and used as described by this administrable product.  If this administrable product describes the administration of a crushed tablet, the 'formOf' would be the product representing a distribution containing tablets and possibly also a cream.  This is distinct from the 'producedFrom' which refers to the specific components of the product that are used in this preparation, rather than the product as a whole.", 0, java.lang.Integer.MAX_VALUE, formOf));
2039        children.add(new Property("administrableDoseForm", "CodeableConcept", "The dose form of the final product after necessary reconstitution or processing. Contrasts to the manufactured dose form (see ManufacturedItemDefinition). If the manufactured form was 'powder for solution for injection', the administrable dose form could be 'solution for injection' (once mixed with another item having manufactured form 'solvent for solution for injection').", 0, 1, administrableDoseForm));
2040        children.add(new Property("unitOfPresentation", "CodeableConcept", "The presentation type in which this item is given to a patient. e.g. for a spray - 'puff' (as in 'contains 100 mcg per puff'), or for a liquid - 'vial' (as in 'contains 5 ml per vial').", 0, 1, unitOfPresentation));
2041        children.add(new Property("producedFrom", "Reference(ManufacturedItemDefinition)", "Indicates the specific manufactured items that are part of the 'formOf' product that are used in the preparation of this specific administrable form.  In some cases, an administrable form might use all of the items from the overall product (or there might only be one item), while in other cases, an administrable form might use only a subset of the items available in the overall product.  For example, an administrable form might involve combining a liquid and a powder available as part of an overall product, but not involve applying the also supplied cream.", 0, java.lang.Integer.MAX_VALUE, producedFrom));
2042        children.add(new Property("ingredient", "CodeableConcept", "The ingredients of this administrable medicinal product. This is only needed if the ingredients are not specified either using ManufacturedItemDefiniton (via AdministrableProductDefinition.producedFrom) to state which component items are used to make this, or using by incoming references from the Ingredient resource, to state in detail which substances exist within this. This element allows a basic coded ingredient to be used.", 0, java.lang.Integer.MAX_VALUE, ingredient));
2043        children.add(new Property("device", "Reference(DeviceDefinition)", "A device that is integral to the medicinal product, in effect being considered as an \"ingredient\" of the medicinal product. This is not intended for devices that are just co-packaged.", 0, 1, device));
2044        children.add(new Property("description", "markdown", "A general description of the product, when in its final form, suitable for administration e.g. effervescent blue liquid, to be swallowed. Intended to be used when the other structured properties of this resource are insufficient or cannot be supported. It is not intended to duplicate information already carried elswehere.", 0, 1, description));
2045        children.add(new Property("property", "", "Characteristics e.g. a product's onset of action.", 0, java.lang.Integer.MAX_VALUE, property));
2046        children.add(new Property("routeOfAdministration", "", "The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. RouteOfAdministration cannot be used when the 'formOf' product already uses MedicinalProductDefinition.route (and vice versa).", 0, java.lang.Integer.MAX_VALUE, routeOfAdministration));
2047      }
2048
2049      @Override
2050      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2051        switch (_hash) {
2052        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "An identifier for the administrable product.", 0, java.lang.Integer.MAX_VALUE, identifier);
2053        case -892481550: /*status*/  return new Property("status", "code", "The status of this administrable product. Enables tracking the life-cycle of the content.", 0, 1, status);
2054        case -1268779589: /*formOf*/  return new Property("formOf", "Reference(MedicinalProductDefinition)", "References a product from which one or more of the constituent parts of that product can be prepared and used as described by this administrable product.  If this administrable product describes the administration of a crushed tablet, the 'formOf' would be the product representing a distribution containing tablets and possibly also a cream.  This is distinct from the 'producedFrom' which refers to the specific components of the product that are used in this preparation, rather than the product as a whole.", 0, java.lang.Integer.MAX_VALUE, formOf);
2055        case 1446105202: /*administrableDoseForm*/  return new Property("administrableDoseForm", "CodeableConcept", "The dose form of the final product after necessary reconstitution or processing. Contrasts to the manufactured dose form (see ManufacturedItemDefinition). If the manufactured form was 'powder for solution for injection', the administrable dose form could be 'solution for injection' (once mixed with another item having manufactured form 'solvent for solution for injection').", 0, 1, administrableDoseForm);
2056        case -1427765963: /*unitOfPresentation*/  return new Property("unitOfPresentation", "CodeableConcept", "The presentation type in which this item is given to a patient. e.g. for a spray - 'puff' (as in 'contains 100 mcg per puff'), or for a liquid - 'vial' (as in 'contains 5 ml per vial').", 0, 1, unitOfPresentation);
2057        case 588380494: /*producedFrom*/  return new Property("producedFrom", "Reference(ManufacturedItemDefinition)", "Indicates the specific manufactured items that are part of the 'formOf' product that are used in the preparation of this specific administrable form.  In some cases, an administrable form might use all of the items from the overall product (or there might only be one item), while in other cases, an administrable form might use only a subset of the items available in the overall product.  For example, an administrable form might involve combining a liquid and a powder available as part of an overall product, but not involve applying the also supplied cream.", 0, java.lang.Integer.MAX_VALUE, producedFrom);
2058        case -206409263: /*ingredient*/  return new Property("ingredient", "CodeableConcept", "The ingredients of this administrable medicinal product. This is only needed if the ingredients are not specified either using ManufacturedItemDefiniton (via AdministrableProductDefinition.producedFrom) to state which component items are used to make this, or using by incoming references from the Ingredient resource, to state in detail which substances exist within this. This element allows a basic coded ingredient to be used.", 0, java.lang.Integer.MAX_VALUE, ingredient);
2059        case -1335157162: /*device*/  return new Property("device", "Reference(DeviceDefinition)", "A device that is integral to the medicinal product, in effect being considered as an \"ingredient\" of the medicinal product. This is not intended for devices that are just co-packaged.", 0, 1, device);
2060        case -1724546052: /*description*/  return new Property("description", "markdown", "A general description of the product, when in its final form, suitable for administration e.g. effervescent blue liquid, to be swallowed. Intended to be used when the other structured properties of this resource are insufficient or cannot be supported. It is not intended to duplicate information already carried elswehere.", 0, 1, description);
2061        case -993141291: /*property*/  return new Property("property", "", "Characteristics e.g. a product's onset of action.", 0, java.lang.Integer.MAX_VALUE, property);
2062        case 1742084734: /*routeOfAdministration*/  return new Property("routeOfAdministration", "", "The path by which the product is taken into or makes contact with the body. In some regions this is referred to as the licenced or approved route. RouteOfAdministration cannot be used when the 'formOf' product already uses MedicinalProductDefinition.route (and vice versa).", 0, java.lang.Integer.MAX_VALUE, routeOfAdministration);
2063        default: return super.getNamedProperty(_hash, _name, _checkValid);
2064        }
2065
2066      }
2067
2068      @Override
2069      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2070        switch (hash) {
2071        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2072        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
2073        case -1268779589: /*formOf*/ return this.formOf == null ? new Base[0] : this.formOf.toArray(new Base[this.formOf.size()]); // Reference
2074        case 1446105202: /*administrableDoseForm*/ return this.administrableDoseForm == null ? new Base[0] : new Base[] {this.administrableDoseForm}; // CodeableConcept
2075        case -1427765963: /*unitOfPresentation*/ return this.unitOfPresentation == null ? new Base[0] : new Base[] {this.unitOfPresentation}; // CodeableConcept
2076        case 588380494: /*producedFrom*/ return this.producedFrom == null ? new Base[0] : this.producedFrom.toArray(new Base[this.producedFrom.size()]); // Reference
2077        case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // CodeableConcept
2078        case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference
2079        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2080        case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // AdministrableProductDefinitionPropertyComponent
2081        case 1742084734: /*routeOfAdministration*/ return this.routeOfAdministration == null ? new Base[0] : this.routeOfAdministration.toArray(new Base[this.routeOfAdministration.size()]); // AdministrableProductDefinitionRouteOfAdministrationComponent
2082        default: return super.getProperty(hash, name, checkValid);
2083        }
2084
2085      }
2086
2087      @Override
2088      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2089        switch (hash) {
2090        case -1618432855: // identifier
2091          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2092          return value;
2093        case -892481550: // status
2094          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2095          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
2096          return value;
2097        case -1268779589: // formOf
2098          this.getFormOf().add(TypeConvertor.castToReference(value)); // Reference
2099          return value;
2100        case 1446105202: // administrableDoseForm
2101          this.administrableDoseForm = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2102          return value;
2103        case -1427765963: // unitOfPresentation
2104          this.unitOfPresentation = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2105          return value;
2106        case 588380494: // producedFrom
2107          this.getProducedFrom().add(TypeConvertor.castToReference(value)); // Reference
2108          return value;
2109        case -206409263: // ingredient
2110          this.getIngredient().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2111          return value;
2112        case -1335157162: // device
2113          this.device = TypeConvertor.castToReference(value); // Reference
2114          return value;
2115        case -1724546052: // description
2116          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2117          return value;
2118        case -993141291: // property
2119          this.getProperty().add((AdministrableProductDefinitionPropertyComponent) value); // AdministrableProductDefinitionPropertyComponent
2120          return value;
2121        case 1742084734: // routeOfAdministration
2122          this.getRouteOfAdministration().add((AdministrableProductDefinitionRouteOfAdministrationComponent) value); // AdministrableProductDefinitionRouteOfAdministrationComponent
2123          return value;
2124        default: return super.setProperty(hash, name, value);
2125        }
2126
2127      }
2128
2129      @Override
2130      public Base setProperty(String name, Base value) throws FHIRException {
2131        if (name.equals("identifier")) {
2132          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2133        } else if (name.equals("status")) {
2134          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2135          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
2136        } else if (name.equals("formOf")) {
2137          this.getFormOf().add(TypeConvertor.castToReference(value));
2138        } else if (name.equals("administrableDoseForm")) {
2139          this.administrableDoseForm = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2140        } else if (name.equals("unitOfPresentation")) {
2141          this.unitOfPresentation = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2142        } else if (name.equals("producedFrom")) {
2143          this.getProducedFrom().add(TypeConvertor.castToReference(value));
2144        } else if (name.equals("ingredient")) {
2145          this.getIngredient().add(TypeConvertor.castToCodeableConcept(value));
2146        } else if (name.equals("device")) {
2147          this.device = TypeConvertor.castToReference(value); // Reference
2148        } else if (name.equals("description")) {
2149          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
2150        } else if (name.equals("property")) {
2151          this.getProperty().add((AdministrableProductDefinitionPropertyComponent) value);
2152        } else if (name.equals("routeOfAdministration")) {
2153          this.getRouteOfAdministration().add((AdministrableProductDefinitionRouteOfAdministrationComponent) value);
2154        } else
2155          return super.setProperty(name, value);
2156        return value;
2157      }
2158
2159      @Override
2160      public Base makeProperty(int hash, String name) throws FHIRException {
2161        switch (hash) {
2162        case -1618432855:  return addIdentifier(); 
2163        case -892481550:  return getStatusElement();
2164        case -1268779589:  return addFormOf(); 
2165        case 1446105202:  return getAdministrableDoseForm();
2166        case -1427765963:  return getUnitOfPresentation();
2167        case 588380494:  return addProducedFrom(); 
2168        case -206409263:  return addIngredient(); 
2169        case -1335157162:  return getDevice();
2170        case -1724546052:  return getDescriptionElement();
2171        case -993141291:  return addProperty(); 
2172        case 1742084734:  return addRouteOfAdministration(); 
2173        default: return super.makeProperty(hash, name);
2174        }
2175
2176      }
2177
2178      @Override
2179      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2180        switch (hash) {
2181        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2182        case -892481550: /*status*/ return new String[] {"code"};
2183        case -1268779589: /*formOf*/ return new String[] {"Reference"};
2184        case 1446105202: /*administrableDoseForm*/ return new String[] {"CodeableConcept"};
2185        case -1427765963: /*unitOfPresentation*/ return new String[] {"CodeableConcept"};
2186        case 588380494: /*producedFrom*/ return new String[] {"Reference"};
2187        case -206409263: /*ingredient*/ return new String[] {"CodeableConcept"};
2188        case -1335157162: /*device*/ return new String[] {"Reference"};
2189        case -1724546052: /*description*/ return new String[] {"markdown"};
2190        case -993141291: /*property*/ return new String[] {};
2191        case 1742084734: /*routeOfAdministration*/ return new String[] {};
2192        default: return super.getTypesForProperty(hash, name);
2193        }
2194
2195      }
2196
2197      @Override
2198      public Base addChild(String name) throws FHIRException {
2199        if (name.equals("identifier")) {
2200          return addIdentifier();
2201        }
2202        else if (name.equals("status")) {
2203          throw new FHIRException("Cannot call addChild on a singleton property AdministrableProductDefinition.status");
2204        }
2205        else if (name.equals("formOf")) {
2206          return addFormOf();
2207        }
2208        else if (name.equals("administrableDoseForm")) {
2209          this.administrableDoseForm = new CodeableConcept();
2210          return this.administrableDoseForm;
2211        }
2212        else if (name.equals("unitOfPresentation")) {
2213          this.unitOfPresentation = new CodeableConcept();
2214          return this.unitOfPresentation;
2215        }
2216        else if (name.equals("producedFrom")) {
2217          return addProducedFrom();
2218        }
2219        else if (name.equals("ingredient")) {
2220          return addIngredient();
2221        }
2222        else if (name.equals("device")) {
2223          this.device = new Reference();
2224          return this.device;
2225        }
2226        else if (name.equals("description")) {
2227          throw new FHIRException("Cannot call addChild on a singleton property AdministrableProductDefinition.description");
2228        }
2229        else if (name.equals("property")) {
2230          return addProperty();
2231        }
2232        else if (name.equals("routeOfAdministration")) {
2233          return addRouteOfAdministration();
2234        }
2235        else
2236          return super.addChild(name);
2237      }
2238
2239  public String fhirType() {
2240    return "AdministrableProductDefinition";
2241
2242  }
2243
2244      public AdministrableProductDefinition copy() {
2245        AdministrableProductDefinition dst = new AdministrableProductDefinition();
2246        copyValues(dst);
2247        return dst;
2248      }
2249
2250      public void copyValues(AdministrableProductDefinition dst) {
2251        super.copyValues(dst);
2252        if (identifier != null) {
2253          dst.identifier = new ArrayList<Identifier>();
2254          for (Identifier i : identifier)
2255            dst.identifier.add(i.copy());
2256        };
2257        dst.status = status == null ? null : status.copy();
2258        if (formOf != null) {
2259          dst.formOf = new ArrayList<Reference>();
2260          for (Reference i : formOf)
2261            dst.formOf.add(i.copy());
2262        };
2263        dst.administrableDoseForm = administrableDoseForm == null ? null : administrableDoseForm.copy();
2264        dst.unitOfPresentation = unitOfPresentation == null ? null : unitOfPresentation.copy();
2265        if (producedFrom != null) {
2266          dst.producedFrom = new ArrayList<Reference>();
2267          for (Reference i : producedFrom)
2268            dst.producedFrom.add(i.copy());
2269        };
2270        if (ingredient != null) {
2271          dst.ingredient = new ArrayList<CodeableConcept>();
2272          for (CodeableConcept i : ingredient)
2273            dst.ingredient.add(i.copy());
2274        };
2275        dst.device = device == null ? null : device.copy();
2276        dst.description = description == null ? null : description.copy();
2277        if (property != null) {
2278          dst.property = new ArrayList<AdministrableProductDefinitionPropertyComponent>();
2279          for (AdministrableProductDefinitionPropertyComponent i : property)
2280            dst.property.add(i.copy());
2281        };
2282        if (routeOfAdministration != null) {
2283          dst.routeOfAdministration = new ArrayList<AdministrableProductDefinitionRouteOfAdministrationComponent>();
2284          for (AdministrableProductDefinitionRouteOfAdministrationComponent i : routeOfAdministration)
2285            dst.routeOfAdministration.add(i.copy());
2286        };
2287      }
2288
2289      protected AdministrableProductDefinition typedCopy() {
2290        return copy();
2291      }
2292
2293      @Override
2294      public boolean equalsDeep(Base other_) {
2295        if (!super.equalsDeep(other_))
2296          return false;
2297        if (!(other_ instanceof AdministrableProductDefinition))
2298          return false;
2299        AdministrableProductDefinition o = (AdministrableProductDefinition) other_;
2300        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(formOf, o.formOf, true)
2301           && compareDeep(administrableDoseForm, o.administrableDoseForm, true) && compareDeep(unitOfPresentation, o.unitOfPresentation, true)
2302           && compareDeep(producedFrom, o.producedFrom, true) && compareDeep(ingredient, o.ingredient, true)
2303           && compareDeep(device, o.device, true) && compareDeep(description, o.description, true) && compareDeep(property, o.property, true)
2304           && compareDeep(routeOfAdministration, o.routeOfAdministration, true);
2305      }
2306
2307      @Override
2308      public boolean equalsShallow(Base other_) {
2309        if (!super.equalsShallow(other_))
2310          return false;
2311        if (!(other_ instanceof AdministrableProductDefinition))
2312          return false;
2313        AdministrableProductDefinition o = (AdministrableProductDefinition) other_;
2314        return compareValues(status, o.status, true) && compareValues(description, o.description, true);
2315      }
2316
2317      public boolean isEmpty() {
2318        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, formOf
2319          , administrableDoseForm, unitOfPresentation, producedFrom, ingredient, device, description
2320          , property, routeOfAdministration);
2321      }
2322
2323  @Override
2324  public ResourceType getResourceType() {
2325    return ResourceType.AdministrableProductDefinition;
2326   }
2327
2328 /**
2329   * Search parameter: <b>device</b>
2330   * <p>
2331   * Description: <b>A device that is integral to the medicinal product, in effect being considered as an "ingredient" of the medicinal product. This is not intended for devices that are just co-packaged</b><br>
2332   * Type: <b>reference</b><br>
2333   * Path: <b>AdministrableProductDefinition.device</b><br>
2334   * </p>
2335   */
2336  @SearchParamDefinition(name="device", path="AdministrableProductDefinition.device", description="A device that is integral to the medicinal product, in effect being considered as an \"ingredient\" of the medicinal product. This is not intended for devices that are just co-packaged", type="reference", target={DeviceDefinition.class } )
2337  public static final String SP_DEVICE = "device";
2338 /**
2339   * <b>Fluent Client</b> search parameter constant for <b>device</b>
2340   * <p>
2341   * Description: <b>A device that is integral to the medicinal product, in effect being considered as an "ingredient" of the medicinal product. This is not intended for devices that are just co-packaged</b><br>
2342   * Type: <b>reference</b><br>
2343   * Path: <b>AdministrableProductDefinition.device</b><br>
2344   * </p>
2345   */
2346  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE);
2347
2348/**
2349   * Constant for fluent queries to be used to add include statements. Specifies
2350   * the path value of "<b>AdministrableProductDefinition:device</b>".
2351   */
2352  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("AdministrableProductDefinition:device").toLocked();
2353
2354 /**
2355   * Search parameter: <b>dose-form</b>
2356   * <p>
2357   * Description: <b>The administrable dose form, i.e. the dose form of the final product after necessary reconstitution or processing</b><br>
2358   * Type: <b>token</b><br>
2359   * Path: <b>AdministrableProductDefinition.administrableDoseForm</b><br>
2360   * </p>
2361   */
2362  @SearchParamDefinition(name="dose-form", path="AdministrableProductDefinition.administrableDoseForm", description="The administrable dose form, i.e. the dose form of the final product after necessary reconstitution or processing", type="token" )
2363  public static final String SP_DOSE_FORM = "dose-form";
2364 /**
2365   * <b>Fluent Client</b> search parameter constant for <b>dose-form</b>
2366   * <p>
2367   * Description: <b>The administrable dose form, i.e. the dose form of the final product after necessary reconstitution or processing</b><br>
2368   * Type: <b>token</b><br>
2369   * Path: <b>AdministrableProductDefinition.administrableDoseForm</b><br>
2370   * </p>
2371   */
2372  public static final ca.uhn.fhir.rest.gclient.TokenClientParam DOSE_FORM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DOSE_FORM);
2373
2374 /**
2375   * Search parameter: <b>form-of</b>
2376   * <p>
2377   * Description: <b>The medicinal product that this is an administrable form of. This is not a reference to the item(s) that make up this administrable form - it is the whole product</b><br>
2378   * Type: <b>reference</b><br>
2379   * Path: <b>AdministrableProductDefinition.formOf</b><br>
2380   * </p>
2381   */
2382  @SearchParamDefinition(name="form-of", path="AdministrableProductDefinition.formOf", description="The medicinal product that this is an administrable form of. This is not a reference to the item(s) that make up this administrable form - it is the whole product", type="reference", target={MedicinalProductDefinition.class } )
2383  public static final String SP_FORM_OF = "form-of";
2384 /**
2385   * <b>Fluent Client</b> search parameter constant for <b>form-of</b>
2386   * <p>
2387   * Description: <b>The medicinal product that this is an administrable form of. This is not a reference to the item(s) that make up this administrable form - it is the whole product</b><br>
2388   * Type: <b>reference</b><br>
2389   * Path: <b>AdministrableProductDefinition.formOf</b><br>
2390   * </p>
2391   */
2392  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FORM_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FORM_OF);
2393
2394/**
2395   * Constant for fluent queries to be used to add include statements. Specifies
2396   * the path value of "<b>AdministrableProductDefinition:form-of</b>".
2397   */
2398  public static final ca.uhn.fhir.model.api.Include INCLUDE_FORM_OF = new ca.uhn.fhir.model.api.Include("AdministrableProductDefinition:form-of").toLocked();
2399
2400 /**
2401   * Search parameter: <b>identifier</b>
2402   * <p>
2403   * Description: <b>An identifier for the administrable product</b><br>
2404   * Type: <b>token</b><br>
2405   * Path: <b>AdministrableProductDefinition.identifier</b><br>
2406   * </p>
2407   */
2408  @SearchParamDefinition(name="identifier", path="AdministrableProductDefinition.identifier", description="An identifier for the administrable product", type="token" )
2409  public static final String SP_IDENTIFIER = "identifier";
2410 /**
2411   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2412   * <p>
2413   * Description: <b>An identifier for the administrable product</b><br>
2414   * Type: <b>token</b><br>
2415   * Path: <b>AdministrableProductDefinition.identifier</b><br>
2416   * </p>
2417   */
2418  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2419
2420 /**
2421   * Search parameter: <b>ingredient</b>
2422   * <p>
2423   * Description: <b>The ingredients of this administrable medicinal product</b><br>
2424   * Type: <b>token</b><br>
2425   * Path: <b>AdministrableProductDefinition.ingredient</b><br>
2426   * </p>
2427   */
2428  @SearchParamDefinition(name="ingredient", path="AdministrableProductDefinition.ingredient", description="The ingredients of this administrable medicinal product", type="token" )
2429  public static final String SP_INGREDIENT = "ingredient";
2430 /**
2431   * <b>Fluent Client</b> search parameter constant for <b>ingredient</b>
2432   * <p>
2433   * Description: <b>The ingredients of this administrable medicinal product</b><br>
2434   * Type: <b>token</b><br>
2435   * Path: <b>AdministrableProductDefinition.ingredient</b><br>
2436   * </p>
2437   */
2438  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INGREDIENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INGREDIENT);
2439
2440 /**
2441   * Search parameter: <b>manufactured-item</b>
2442   * <p>
2443   * Description: <b>The manufactured item(s) that this administrable product is produced from. Either a single item, or several that are mixed before administration (e.g. a power item and a solution item). Note that these are not raw ingredients</b><br>
2444   * Type: <b>reference</b><br>
2445   * Path: <b>AdministrableProductDefinition.producedFrom</b><br>
2446   * </p>
2447   */
2448  @SearchParamDefinition(name="manufactured-item", path="AdministrableProductDefinition.producedFrom", description="The manufactured item(s) that this administrable product is produced from. Either a single item, or several that are mixed before administration (e.g. a power item and a solution item). Note that these are not raw ingredients", type="reference", target={ManufacturedItemDefinition.class } )
2449  public static final String SP_MANUFACTURED_ITEM = "manufactured-item";
2450 /**
2451   * <b>Fluent Client</b> search parameter constant for <b>manufactured-item</b>
2452   * <p>
2453   * Description: <b>The manufactured item(s) that this administrable product is produced from. Either a single item, or several that are mixed before administration (e.g. a power item and a solution item). Note that these are not raw ingredients</b><br>
2454   * Type: <b>reference</b><br>
2455   * Path: <b>AdministrableProductDefinition.producedFrom</b><br>
2456   * </p>
2457   */
2458  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MANUFACTURED_ITEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MANUFACTURED_ITEM);
2459
2460/**
2461   * Constant for fluent queries to be used to add include statements. Specifies
2462   * the path value of "<b>AdministrableProductDefinition:manufactured-item</b>".
2463   */
2464  public static final ca.uhn.fhir.model.api.Include INCLUDE_MANUFACTURED_ITEM = new ca.uhn.fhir.model.api.Include("AdministrableProductDefinition:manufactured-item").toLocked();
2465
2466 /**
2467   * Search parameter: <b>route</b>
2468   * <p>
2469   * Description: <b>Coded expression for the route</b><br>
2470   * Type: <b>token</b><br>
2471   * Path: <b>AdministrableProductDefinition.routeOfAdministration.code</b><br>
2472   * </p>
2473   */
2474  @SearchParamDefinition(name="route", path="AdministrableProductDefinition.routeOfAdministration.code", description="Coded expression for the route", type="token" )
2475  public static final String SP_ROUTE = "route";
2476 /**
2477   * <b>Fluent Client</b> search parameter constant for <b>route</b>
2478   * <p>
2479   * Description: <b>Coded expression for the route</b><br>
2480   * Type: <b>token</b><br>
2481   * Path: <b>AdministrableProductDefinition.routeOfAdministration.code</b><br>
2482   * </p>
2483   */
2484  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ROUTE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ROUTE);
2485
2486 /**
2487   * Search parameter: <b>status</b>
2488   * <p>
2489   * Description: <b>The status of this administrable product. Enables tracking the life-cycle of the content.</b><br>
2490   * Type: <b>token</b><br>
2491   * Path: <b>AdministrableProductDefinition.status</b><br>
2492   * </p>
2493   */
2494  @SearchParamDefinition(name="status", path="AdministrableProductDefinition.status", description="The status of this administrable product. Enables tracking the life-cycle of the content.", type="token" )
2495  public static final String SP_STATUS = "status";
2496 /**
2497   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2498   * <p>
2499   * Description: <b>The status of this administrable product. Enables tracking the life-cycle of the content.</b><br>
2500   * Type: <b>token</b><br>
2501   * Path: <b>AdministrableProductDefinition.status</b><br>
2502   * </p>
2503   */
2504  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2505
2506 /**
2507   * Search parameter: <b>target-species</b>
2508   * <p>
2509   * Description: <b>Coded expression for the species</b><br>
2510   * Type: <b>token</b><br>
2511   * Path: <b>AdministrableProductDefinition.routeOfAdministration.targetSpecies.code</b><br>
2512   * </p>
2513   */
2514  @SearchParamDefinition(name="target-species", path="AdministrableProductDefinition.routeOfAdministration.targetSpecies.code", description="Coded expression for the species", type="token" )
2515  public static final String SP_TARGET_SPECIES = "target-species";
2516 /**
2517   * <b>Fluent Client</b> search parameter constant for <b>target-species</b>
2518   * <p>
2519   * Description: <b>Coded expression for the species</b><br>
2520   * Type: <b>token</b><br>
2521   * Path: <b>AdministrableProductDefinition.routeOfAdministration.targetSpecies.code</b><br>
2522   * </p>
2523   */
2524  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TARGET_SPECIES = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TARGET_SPECIES);
2525
2526
2527}
2528