001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 13, 2022 17:53+1100 for FHIR vcurrent
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 * Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.
052 */
053@ResourceDef(name="MedicationAdministration", profile="http://hl7.org/fhir/StructureDefinition/MedicationAdministration")
054public class MedicationAdministration extends DomainResource {
055
056    public enum MedicationAdministrationStatusCodes {
057        /**
058         * The administration has started but has not yet completed.
059         */
060        INPROGRESS, 
061        /**
062         * The administration was terminated prior to any impact on the subject (though preparatory actions may have been taken)
063         */
064        NOTDONE, 
065        /**
066         * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called 'suspended'.
067         */
068        ONHOLD, 
069        /**
070         * All actions that are implied by the administration have occurred.
071         */
072        COMPLETED, 
073        /**
074         * The administration was entered in error and therefore nullified.
075         */
076        ENTEREDINERROR, 
077        /**
078         * Actions implied by the administration have been permanently halted, before all of them occurred.
079         */
080        STOPPED, 
081        /**
082         * The authoring system does not know which of the status values currently applies for this request. Note: This concept is not to be used for 'other' - one of the listed statuses is presumed to apply, it's just not known which one.
083         */
084        UNKNOWN, 
085        /**
086         * added to help the parsers with the generic types
087         */
088        NULL;
089        public static MedicationAdministrationStatusCodes fromCode(String codeString) throws FHIRException {
090            if (codeString == null || "".equals(codeString))
091                return null;
092        if ("in-progress".equals(codeString))
093          return INPROGRESS;
094        if ("not-done".equals(codeString))
095          return NOTDONE;
096        if ("on-hold".equals(codeString))
097          return ONHOLD;
098        if ("completed".equals(codeString))
099          return COMPLETED;
100        if ("entered-in-error".equals(codeString))
101          return ENTEREDINERROR;
102        if ("stopped".equals(codeString))
103          return STOPPED;
104        if ("unknown".equals(codeString))
105          return UNKNOWN;
106        if (Configuration.isAcceptInvalidEnums())
107          return null;
108        else
109          throw new FHIRException("Unknown MedicationAdministrationStatusCodes code '"+codeString+"'");
110        }
111        public String toCode() {
112          switch (this) {
113            case INPROGRESS: return "in-progress";
114            case NOTDONE: return "not-done";
115            case ONHOLD: return "on-hold";
116            case COMPLETED: return "completed";
117            case ENTEREDINERROR: return "entered-in-error";
118            case STOPPED: return "stopped";
119            case UNKNOWN: return "unknown";
120            case NULL: return null;
121            default: return "?";
122          }
123        }
124        public String getSystem() {
125          switch (this) {
126            case INPROGRESS: return "http://hl7.org/fhir/CodeSystem/medication-admin-status";
127            case NOTDONE: return "http://hl7.org/fhir/CodeSystem/medication-admin-status";
128            case ONHOLD: return "http://hl7.org/fhir/CodeSystem/medication-admin-status";
129            case COMPLETED: return "http://hl7.org/fhir/CodeSystem/medication-admin-status";
130            case ENTEREDINERROR: return "http://hl7.org/fhir/CodeSystem/medication-admin-status";
131            case STOPPED: return "http://hl7.org/fhir/CodeSystem/medication-admin-status";
132            case UNKNOWN: return "http://hl7.org/fhir/CodeSystem/medication-admin-status";
133            case NULL: return null;
134            default: return "?";
135          }
136        }
137        public String getDefinition() {
138          switch (this) {
139            case INPROGRESS: return "The administration has started but has not yet completed.";
140            case NOTDONE: return "The administration was terminated prior to any impact on the subject (though preparatory actions may have been taken)";
141            case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called 'suspended'.";
142            case COMPLETED: return "All actions that are implied by the administration have occurred.";
143            case ENTEREDINERROR: return "The administration was entered in error and therefore nullified.";
144            case STOPPED: return "Actions implied by the administration have been permanently halted, before all of them occurred.";
145            case UNKNOWN: return "The authoring system does not know which of the status values currently applies for this request. Note: This concept is not to be used for 'other' - one of the listed statuses is presumed to apply, it's just not known which one.";
146            case NULL: return null;
147            default: return "?";
148          }
149        }
150        public String getDisplay() {
151          switch (this) {
152            case INPROGRESS: return "In Progress";
153            case NOTDONE: return "Not Done";
154            case ONHOLD: return "On Hold";
155            case COMPLETED: return "Completed";
156            case ENTEREDINERROR: return "Entered in Error";
157            case STOPPED: return "Stopped";
158            case UNKNOWN: return "Unknown";
159            case NULL: return null;
160            default: return "?";
161          }
162        }
163    }
164
165  public static class MedicationAdministrationStatusCodesEnumFactory implements EnumFactory<MedicationAdministrationStatusCodes> {
166    public MedicationAdministrationStatusCodes fromCode(String codeString) throws IllegalArgumentException {
167      if (codeString == null || "".equals(codeString))
168            if (codeString == null || "".equals(codeString))
169                return null;
170        if ("in-progress".equals(codeString))
171          return MedicationAdministrationStatusCodes.INPROGRESS;
172        if ("not-done".equals(codeString))
173          return MedicationAdministrationStatusCodes.NOTDONE;
174        if ("on-hold".equals(codeString))
175          return MedicationAdministrationStatusCodes.ONHOLD;
176        if ("completed".equals(codeString))
177          return MedicationAdministrationStatusCodes.COMPLETED;
178        if ("entered-in-error".equals(codeString))
179          return MedicationAdministrationStatusCodes.ENTEREDINERROR;
180        if ("stopped".equals(codeString))
181          return MedicationAdministrationStatusCodes.STOPPED;
182        if ("unknown".equals(codeString))
183          return MedicationAdministrationStatusCodes.UNKNOWN;
184        throw new IllegalArgumentException("Unknown MedicationAdministrationStatusCodes code '"+codeString+"'");
185        }
186        public Enumeration<MedicationAdministrationStatusCodes> fromType(PrimitiveType<?> code) throws FHIRException {
187          if (code == null)
188            return null;
189          if (code.isEmpty())
190            return new Enumeration<MedicationAdministrationStatusCodes>(this, MedicationAdministrationStatusCodes.NULL, code);
191          String codeString = ((PrimitiveType) code).asStringValue();
192          if (codeString == null || "".equals(codeString))
193            return new Enumeration<MedicationAdministrationStatusCodes>(this, MedicationAdministrationStatusCodes.NULL, code);
194        if ("in-progress".equals(codeString))
195          return new Enumeration<MedicationAdministrationStatusCodes>(this, MedicationAdministrationStatusCodes.INPROGRESS, code);
196        if ("not-done".equals(codeString))
197          return new Enumeration<MedicationAdministrationStatusCodes>(this, MedicationAdministrationStatusCodes.NOTDONE, code);
198        if ("on-hold".equals(codeString))
199          return new Enumeration<MedicationAdministrationStatusCodes>(this, MedicationAdministrationStatusCodes.ONHOLD, code);
200        if ("completed".equals(codeString))
201          return new Enumeration<MedicationAdministrationStatusCodes>(this, MedicationAdministrationStatusCodes.COMPLETED, code);
202        if ("entered-in-error".equals(codeString))
203          return new Enumeration<MedicationAdministrationStatusCodes>(this, MedicationAdministrationStatusCodes.ENTEREDINERROR, code);
204        if ("stopped".equals(codeString))
205          return new Enumeration<MedicationAdministrationStatusCodes>(this, MedicationAdministrationStatusCodes.STOPPED, code);
206        if ("unknown".equals(codeString))
207          return new Enumeration<MedicationAdministrationStatusCodes>(this, MedicationAdministrationStatusCodes.UNKNOWN, code);
208        throw new FHIRException("Unknown MedicationAdministrationStatusCodes code '"+codeString+"'");
209        }
210    public String toCode(MedicationAdministrationStatusCodes code) {
211      if (code == MedicationAdministrationStatusCodes.INPROGRESS)
212        return "in-progress";
213      if (code == MedicationAdministrationStatusCodes.NOTDONE)
214        return "not-done";
215      if (code == MedicationAdministrationStatusCodes.ONHOLD)
216        return "on-hold";
217      if (code == MedicationAdministrationStatusCodes.COMPLETED)
218        return "completed";
219      if (code == MedicationAdministrationStatusCodes.ENTEREDINERROR)
220        return "entered-in-error";
221      if (code == MedicationAdministrationStatusCodes.STOPPED)
222        return "stopped";
223      if (code == MedicationAdministrationStatusCodes.UNKNOWN)
224        return "unknown";
225      return "?";
226      }
227    public String toSystem(MedicationAdministrationStatusCodes code) {
228      return code.getSystem();
229      }
230    }
231
232    @Block()
233    public static class MedicationAdministrationPerformerComponent extends BackboneElement implements IBaseBackboneElement {
234        /**
235         * Distinguishes the type of involvement of the performer in the medication administration.
236         */
237        @Child(name = "function", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
238        @Description(shortDefinition="Type of performance", formalDefinition="Distinguishes the type of involvement of the performer in the medication administration." )
239        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/med-admin-perform-function")
240        protected CodeableConcept function;
241
242        /**
243         * Indicates who or what performed the medication administration.
244         */
245        @Child(name = "actor", type = {Practitioner.class, PractitionerRole.class, Patient.class, RelatedPerson.class, Device.class}, order=2, min=1, max=1, modifier=false, summary=true)
246        @Description(shortDefinition="Who performed the medication administration", formalDefinition="Indicates who or what performed the medication administration." )
247        protected Reference actor;
248
249        private static final long serialVersionUID = -576943815L;
250
251    /**
252     * Constructor
253     */
254      public MedicationAdministrationPerformerComponent() {
255        super();
256      }
257
258    /**
259     * Constructor
260     */
261      public MedicationAdministrationPerformerComponent(Reference actor) {
262        super();
263        this.setActor(actor);
264      }
265
266        /**
267         * @return {@link #function} (Distinguishes the type of involvement of the performer in the medication administration.)
268         */
269        public CodeableConcept getFunction() { 
270          if (this.function == null)
271            if (Configuration.errorOnAutoCreate())
272              throw new Error("Attempt to auto-create MedicationAdministrationPerformerComponent.function");
273            else if (Configuration.doAutoCreate())
274              this.function = new CodeableConcept(); // cc
275          return this.function;
276        }
277
278        public boolean hasFunction() { 
279          return this.function != null && !this.function.isEmpty();
280        }
281
282        /**
283         * @param value {@link #function} (Distinguishes the type of involvement of the performer in the medication administration.)
284         */
285        public MedicationAdministrationPerformerComponent setFunction(CodeableConcept value) { 
286          this.function = value;
287          return this;
288        }
289
290        /**
291         * @return {@link #actor} (Indicates who or what performed the medication administration.)
292         */
293        public Reference getActor() { 
294          if (this.actor == null)
295            if (Configuration.errorOnAutoCreate())
296              throw new Error("Attempt to auto-create MedicationAdministrationPerformerComponent.actor");
297            else if (Configuration.doAutoCreate())
298              this.actor = new Reference(); // cc
299          return this.actor;
300        }
301
302        public boolean hasActor() { 
303          return this.actor != null && !this.actor.isEmpty();
304        }
305
306        /**
307         * @param value {@link #actor} (Indicates who or what performed the medication administration.)
308         */
309        public MedicationAdministrationPerformerComponent setActor(Reference value) { 
310          this.actor = value;
311          return this;
312        }
313
314        protected void listChildren(List<Property> children) {
315          super.listChildren(children);
316          children.add(new Property("function", "CodeableConcept", "Distinguishes the type of involvement of the performer in the medication administration.", 0, 1, function));
317          children.add(new Property("actor", "Reference(Practitioner|PractitionerRole|Patient|RelatedPerson|Device)", "Indicates who or what performed the medication administration.", 0, 1, actor));
318        }
319
320        @Override
321        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
322          switch (_hash) {
323          case 1380938712: /*function*/  return new Property("function", "CodeableConcept", "Distinguishes the type of involvement of the performer in the medication administration.", 0, 1, function);
324          case 92645877: /*actor*/  return new Property("actor", "Reference(Practitioner|PractitionerRole|Patient|RelatedPerson|Device)", "Indicates who or what performed the medication administration.", 0, 1, actor);
325          default: return super.getNamedProperty(_hash, _name, _checkValid);
326          }
327
328        }
329
330      @Override
331      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
332        switch (hash) {
333        case 1380938712: /*function*/ return this.function == null ? new Base[0] : new Base[] {this.function}; // CodeableConcept
334        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
335        default: return super.getProperty(hash, name, checkValid);
336        }
337
338      }
339
340      @Override
341      public Base setProperty(int hash, String name, Base value) throws FHIRException {
342        switch (hash) {
343        case 1380938712: // function
344          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
345          return value;
346        case 92645877: // actor
347          this.actor = TypeConvertor.castToReference(value); // Reference
348          return value;
349        default: return super.setProperty(hash, name, value);
350        }
351
352      }
353
354      @Override
355      public Base setProperty(String name, Base value) throws FHIRException {
356        if (name.equals("function")) {
357          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
358        } else if (name.equals("actor")) {
359          this.actor = TypeConvertor.castToReference(value); // Reference
360        } else
361          return super.setProperty(name, value);
362        return value;
363      }
364
365      @Override
366      public Base makeProperty(int hash, String name) throws FHIRException {
367        switch (hash) {
368        case 1380938712:  return getFunction();
369        case 92645877:  return getActor();
370        default: return super.makeProperty(hash, name);
371        }
372
373      }
374
375      @Override
376      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
377        switch (hash) {
378        case 1380938712: /*function*/ return new String[] {"CodeableConcept"};
379        case 92645877: /*actor*/ return new String[] {"Reference"};
380        default: return super.getTypesForProperty(hash, name);
381        }
382
383      }
384
385      @Override
386      public Base addChild(String name) throws FHIRException {
387        if (name.equals("function")) {
388          this.function = new CodeableConcept();
389          return this.function;
390        }
391        else if (name.equals("actor")) {
392          this.actor = new Reference();
393          return this.actor;
394        }
395        else
396          return super.addChild(name);
397      }
398
399      public MedicationAdministrationPerformerComponent copy() {
400        MedicationAdministrationPerformerComponent dst = new MedicationAdministrationPerformerComponent();
401        copyValues(dst);
402        return dst;
403      }
404
405      public void copyValues(MedicationAdministrationPerformerComponent dst) {
406        super.copyValues(dst);
407        dst.function = function == null ? null : function.copy();
408        dst.actor = actor == null ? null : actor.copy();
409      }
410
411      @Override
412      public boolean equalsDeep(Base other_) {
413        if (!super.equalsDeep(other_))
414          return false;
415        if (!(other_ instanceof MedicationAdministrationPerformerComponent))
416          return false;
417        MedicationAdministrationPerformerComponent o = (MedicationAdministrationPerformerComponent) other_;
418        return compareDeep(function, o.function, true) && compareDeep(actor, o.actor, true);
419      }
420
421      @Override
422      public boolean equalsShallow(Base other_) {
423        if (!super.equalsShallow(other_))
424          return false;
425        if (!(other_ instanceof MedicationAdministrationPerformerComponent))
426          return false;
427        MedicationAdministrationPerformerComponent o = (MedicationAdministrationPerformerComponent) other_;
428        return true;
429      }
430
431      public boolean isEmpty() {
432        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(function, actor);
433      }
434
435  public String fhirType() {
436    return "MedicationAdministration.performer";
437
438  }
439
440  }
441
442    @Block()
443    public static class MedicationAdministrationDosageComponent extends BackboneElement implements IBaseBackboneElement {
444        /**
445         * Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans.
446
447The dosage instructions should reflect the dosage of the medication that was administered.
448         */
449        @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
450        @Description(shortDefinition="Free text dosage instructions e.g. SIG", formalDefinition="Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans.\r\rThe dosage instructions should reflect the dosage of the medication that was administered." )
451        protected StringType text;
452
453        /**
454         * A coded specification of the anatomic site where the medication first entered the body.  For example, "left arm".
455         */
456        @Child(name = "site", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
457        @Description(shortDefinition="Body site administered to", formalDefinition="A coded specification of the anatomic site where the medication first entered the body.  For example, \"left arm\"." )
458        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/approach-site-codes")
459        protected CodeableConcept site;
460
461        /**
462         * A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient.  For example, topical, intravenous, etc.
463         */
464        @Child(name = "route", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
465        @Description(shortDefinition="Path of substance into body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient.  For example, topical, intravenous, etc." )
466        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/route-codes")
467        protected CodeableConcept route;
468
469        /**
470         * A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.  This attribute will most often NOT be populated.  It is most commonly used for injections.  For example, Slow Push, Deep IV.
471         */
472        @Child(name = "method", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
473        @Description(shortDefinition="How drug was administered", formalDefinition="A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.  This attribute will most often NOT be populated.  It is most commonly used for injections.  For example, Slow Push, Deep IV." )
474        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/administration-method-codes")
475        protected CodeableConcept method;
476
477        /**
478         * The amount of the medication given at one administration event.   Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.
479         */
480        @Child(name = "dose", type = {Quantity.class}, order=5, min=0, max=1, modifier=false, summary=false)
481        @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of the medication given at one administration event.   Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection." )
482        protected Quantity dose;
483
484        /**
485         * Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.
486         */
487        @Child(name = "rate", type = {Ratio.class, Quantity.class}, order=6, min=0, max=1, modifier=false, summary=false)
488        @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours." )
489        protected DataType rate;
490
491        private static final long serialVersionUID = -484090956L;
492
493    /**
494     * Constructor
495     */
496      public MedicationAdministrationDosageComponent() {
497        super();
498      }
499
500        /**
501         * @return {@link #text} (Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans.
502
503The dosage instructions should reflect the dosage of the medication that was administered.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
504         */
505        public StringType getTextElement() { 
506          if (this.text == null)
507            if (Configuration.errorOnAutoCreate())
508              throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.text");
509            else if (Configuration.doAutoCreate())
510              this.text = new StringType(); // bb
511          return this.text;
512        }
513
514        public boolean hasTextElement() { 
515          return this.text != null && !this.text.isEmpty();
516        }
517
518        public boolean hasText() { 
519          return this.text != null && !this.text.isEmpty();
520        }
521
522        /**
523         * @param value {@link #text} (Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans.
524
525The dosage instructions should reflect the dosage of the medication that was administered.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
526         */
527        public MedicationAdministrationDosageComponent setTextElement(StringType value) { 
528          this.text = value;
529          return this;
530        }
531
532        /**
533         * @return Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans.
534
535The dosage instructions should reflect the dosage of the medication that was administered.
536         */
537        public String getText() { 
538          return this.text == null ? null : this.text.getValue();
539        }
540
541        /**
542         * @param value Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans.
543
544The dosage instructions should reflect the dosage of the medication that was administered.
545         */
546        public MedicationAdministrationDosageComponent setText(String value) { 
547          if (Utilities.noString(value))
548            this.text = null;
549          else {
550            if (this.text == null)
551              this.text = new StringType();
552            this.text.setValue(value);
553          }
554          return this;
555        }
556
557        /**
558         * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body.  For example, "left arm".)
559         */
560        public CodeableConcept getSite() { 
561          if (this.site == null)
562            if (Configuration.errorOnAutoCreate())
563              throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.site");
564            else if (Configuration.doAutoCreate())
565              this.site = new CodeableConcept(); // cc
566          return this.site;
567        }
568
569        public boolean hasSite() { 
570          return this.site != null && !this.site.isEmpty();
571        }
572
573        /**
574         * @param value {@link #site} (A coded specification of the anatomic site where the medication first entered the body.  For example, "left arm".)
575         */
576        public MedicationAdministrationDosageComponent setSite(CodeableConcept value) { 
577          this.site = value;
578          return this;
579        }
580
581        /**
582         * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient.  For example, topical, intravenous, etc.)
583         */
584        public CodeableConcept getRoute() { 
585          if (this.route == null)
586            if (Configuration.errorOnAutoCreate())
587              throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.route");
588            else if (Configuration.doAutoCreate())
589              this.route = new CodeableConcept(); // cc
590          return this.route;
591        }
592
593        public boolean hasRoute() { 
594          return this.route != null && !this.route.isEmpty();
595        }
596
597        /**
598         * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient.  For example, topical, intravenous, etc.)
599         */
600        public MedicationAdministrationDosageComponent setRoute(CodeableConcept value) { 
601          this.route = value;
602          return this;
603        }
604
605        /**
606         * @return {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.  This attribute will most often NOT be populated.  It is most commonly used for injections.  For example, Slow Push, Deep IV.)
607         */
608        public CodeableConcept getMethod() { 
609          if (this.method == null)
610            if (Configuration.errorOnAutoCreate())
611              throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.method");
612            else if (Configuration.doAutoCreate())
613              this.method = new CodeableConcept(); // cc
614          return this.method;
615        }
616
617        public boolean hasMethod() { 
618          return this.method != null && !this.method.isEmpty();
619        }
620
621        /**
622         * @param value {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.  This attribute will most often NOT be populated.  It is most commonly used for injections.  For example, Slow Push, Deep IV.)
623         */
624        public MedicationAdministrationDosageComponent setMethod(CodeableConcept value) { 
625          this.method = value;
626          return this;
627        }
628
629        /**
630         * @return {@link #dose} (The amount of the medication given at one administration event.   Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.)
631         */
632        public Quantity getDose() { 
633          if (this.dose == null)
634            if (Configuration.errorOnAutoCreate())
635              throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.dose");
636            else if (Configuration.doAutoCreate())
637              this.dose = new Quantity(); // cc
638          return this.dose;
639        }
640
641        public boolean hasDose() { 
642          return this.dose != null && !this.dose.isEmpty();
643        }
644
645        /**
646         * @param value {@link #dose} (The amount of the medication given at one administration event.   Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.)
647         */
648        public MedicationAdministrationDosageComponent setDose(Quantity value) { 
649          this.dose = value;
650          return this;
651        }
652
653        /**
654         * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.)
655         */
656        public DataType getRate() { 
657          return this.rate;
658        }
659
660        /**
661         * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.)
662         */
663        public Ratio getRateRatio() throws FHIRException { 
664          if (this.rate == null)
665            this.rate = new Ratio();
666          if (!(this.rate instanceof Ratio))
667            throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered");
668          return (Ratio) this.rate;
669        }
670
671        public boolean hasRateRatio() { 
672          return this != null && this.rate instanceof Ratio;
673        }
674
675        /**
676         * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.)
677         */
678        public Quantity getRateQuantity() throws FHIRException { 
679          if (this.rate == null)
680            this.rate = new Quantity();
681          if (!(this.rate instanceof Quantity))
682            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.rate.getClass().getName()+" was encountered");
683          return (Quantity) this.rate;
684        }
685
686        public boolean hasRateQuantity() { 
687          return this != null && this.rate instanceof Quantity;
688        }
689
690        public boolean hasRate() { 
691          return this.rate != null && !this.rate.isEmpty();
692        }
693
694        /**
695         * @param value {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.)
696         */
697        public MedicationAdministrationDosageComponent setRate(DataType value) { 
698          if (value != null && !(value instanceof Ratio || value instanceof Quantity))
699            throw new Error("Not the right type for MedicationAdministration.dosage.rate[x]: "+value.fhirType());
700          this.rate = value;
701          return this;
702        }
703
704        protected void listChildren(List<Property> children) {
705          super.listChildren(children);
706          children.add(new Property("text", "string", "Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans.\r\rThe dosage instructions should reflect the dosage of the medication that was administered.", 0, 1, text));
707          children.add(new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first entered the body.  For example, \"left arm\".", 0, 1, site));
708          children.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient.  For example, topical, intravenous, etc.", 0, 1, route));
709          children.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.  This attribute will most often NOT be populated.  It is most commonly used for injections.  For example, Slow Push, Deep IV.", 0, 1, method));
710          children.add(new Property("dose", "Quantity", "The amount of the medication given at one administration event.   Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.", 0, 1, dose));
711          children.add(new Property("rate[x]", "Ratio|Quantity", "Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, 1, rate));
712        }
713
714        @Override
715        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
716          switch (_hash) {
717          case 3556653: /*text*/  return new Property("text", "string", "Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans.\r\rThe dosage instructions should reflect the dosage of the medication that was administered.", 0, 1, text);
718          case 3530567: /*site*/  return new Property("site", "CodeableConcept", "A coded specification of the anatomic site where the medication first entered the body.  For example, \"left arm\".", 0, 1, site);
719          case 108704329: /*route*/  return new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient.  For example, topical, intravenous, etc.", 0, 1, route);
720          case -1077554975: /*method*/  return new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.  This attribute will most often NOT be populated.  It is most commonly used for injections.  For example, Slow Push, Deep IV.", 0, 1, method);
721          case 3089437: /*dose*/  return new Property("dose", "Quantity", "The amount of the medication given at one administration event.   Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.", 0, 1, dose);
722          case 983460768: /*rate[x]*/  return new Property("rate[x]", "Ratio|Quantity", "Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, 1, rate);
723          case 3493088: /*rate*/  return new Property("rate[x]", "Ratio|Quantity", "Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, 1, rate);
724          case 204021515: /*rateRatio*/  return new Property("rate[x]", "Ratio", "Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, 1, rate);
725          case -1085459061: /*rateQuantity*/  return new Property("rate[x]", "Quantity", "Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, 1, rate);
726          default: return super.getNamedProperty(_hash, _name, _checkValid);
727          }
728
729        }
730
731      @Override
732      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
733        switch (hash) {
734        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
735        case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // CodeableConcept
736        case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept
737        case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept
738        case 3089437: /*dose*/ return this.dose == null ? new Base[0] : new Base[] {this.dose}; // Quantity
739        case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // DataType
740        default: return super.getProperty(hash, name, checkValid);
741        }
742
743      }
744
745      @Override
746      public Base setProperty(int hash, String name, Base value) throws FHIRException {
747        switch (hash) {
748        case 3556653: // text
749          this.text = TypeConvertor.castToString(value); // StringType
750          return value;
751        case 3530567: // site
752          this.site = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
753          return value;
754        case 108704329: // route
755          this.route = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
756          return value;
757        case -1077554975: // method
758          this.method = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
759          return value;
760        case 3089437: // dose
761          this.dose = TypeConvertor.castToQuantity(value); // Quantity
762          return value;
763        case 3493088: // rate
764          this.rate = TypeConvertor.castToType(value); // DataType
765          return value;
766        default: return super.setProperty(hash, name, value);
767        }
768
769      }
770
771      @Override
772      public Base setProperty(String name, Base value) throws FHIRException {
773        if (name.equals("text")) {
774          this.text = TypeConvertor.castToString(value); // StringType
775        } else if (name.equals("site")) {
776          this.site = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
777        } else if (name.equals("route")) {
778          this.route = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
779        } else if (name.equals("method")) {
780          this.method = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
781        } else if (name.equals("dose")) {
782          this.dose = TypeConvertor.castToQuantity(value); // Quantity
783        } else if (name.equals("rate[x]")) {
784          this.rate = TypeConvertor.castToType(value); // DataType
785        } else
786          return super.setProperty(name, value);
787        return value;
788      }
789
790      @Override
791      public Base makeProperty(int hash, String name) throws FHIRException {
792        switch (hash) {
793        case 3556653:  return getTextElement();
794        case 3530567:  return getSite();
795        case 108704329:  return getRoute();
796        case -1077554975:  return getMethod();
797        case 3089437:  return getDose();
798        case 983460768:  return getRate();
799        case 3493088:  return getRate();
800        default: return super.makeProperty(hash, name);
801        }
802
803      }
804
805      @Override
806      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
807        switch (hash) {
808        case 3556653: /*text*/ return new String[] {"string"};
809        case 3530567: /*site*/ return new String[] {"CodeableConcept"};
810        case 108704329: /*route*/ return new String[] {"CodeableConcept"};
811        case -1077554975: /*method*/ return new String[] {"CodeableConcept"};
812        case 3089437: /*dose*/ return new String[] {"Quantity"};
813        case 3493088: /*rate*/ return new String[] {"Ratio", "Quantity"};
814        default: return super.getTypesForProperty(hash, name);
815        }
816
817      }
818
819      @Override
820      public Base addChild(String name) throws FHIRException {
821        if (name.equals("text")) {
822          throw new FHIRException("Cannot call addChild on a primitive type MedicationAdministration.dosage.text");
823        }
824        else if (name.equals("site")) {
825          this.site = new CodeableConcept();
826          return this.site;
827        }
828        else if (name.equals("route")) {
829          this.route = new CodeableConcept();
830          return this.route;
831        }
832        else if (name.equals("method")) {
833          this.method = new CodeableConcept();
834          return this.method;
835        }
836        else if (name.equals("dose")) {
837          this.dose = new Quantity();
838          return this.dose;
839        }
840        else if (name.equals("rateRatio")) {
841          this.rate = new Ratio();
842          return this.rate;
843        }
844        else if (name.equals("rateQuantity")) {
845          this.rate = new Quantity();
846          return this.rate;
847        }
848        else
849          return super.addChild(name);
850      }
851
852      public MedicationAdministrationDosageComponent copy() {
853        MedicationAdministrationDosageComponent dst = new MedicationAdministrationDosageComponent();
854        copyValues(dst);
855        return dst;
856      }
857
858      public void copyValues(MedicationAdministrationDosageComponent dst) {
859        super.copyValues(dst);
860        dst.text = text == null ? null : text.copy();
861        dst.site = site == null ? null : site.copy();
862        dst.route = route == null ? null : route.copy();
863        dst.method = method == null ? null : method.copy();
864        dst.dose = dose == null ? null : dose.copy();
865        dst.rate = rate == null ? null : rate.copy();
866      }
867
868      @Override
869      public boolean equalsDeep(Base other_) {
870        if (!super.equalsDeep(other_))
871          return false;
872        if (!(other_ instanceof MedicationAdministrationDosageComponent))
873          return false;
874        MedicationAdministrationDosageComponent o = (MedicationAdministrationDosageComponent) other_;
875        return compareDeep(text, o.text, true) && compareDeep(site, o.site, true) && compareDeep(route, o.route, true)
876           && compareDeep(method, o.method, true) && compareDeep(dose, o.dose, true) && compareDeep(rate, o.rate, true)
877          ;
878      }
879
880      @Override
881      public boolean equalsShallow(Base other_) {
882        if (!super.equalsShallow(other_))
883          return false;
884        if (!(other_ instanceof MedicationAdministrationDosageComponent))
885          return false;
886        MedicationAdministrationDosageComponent o = (MedicationAdministrationDosageComponent) other_;
887        return compareValues(text, o.text, true);
888      }
889
890      public boolean isEmpty() {
891        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(text, site, route, method
892          , dose, rate);
893      }
894
895  public String fhirType() {
896    return "MedicationAdministration.dosage";
897
898  }
899
900  }
901
902    /**
903     * Identifiers associated with this Medication Administration that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.
904     */
905    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
906    @Description(shortDefinition="External identifier", formalDefinition="Identifiers associated with this Medication Administration that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server." )
907    protected List<Identifier> identifier;
908
909    /**
910     * A plan that is fulfilled in whole or in part by this MedicationAdministration.
911     */
912    @Child(name = "basedOn", type = {CarePlan.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
913    @Description(shortDefinition="Plan this is fulfilled by this administration", formalDefinition="A plan that is fulfilled in whole or in part by this MedicationAdministration." )
914    protected List<Reference> basedOn;
915
916    /**
917     * A larger event of which this particular event is a component or step.
918     */
919    @Child(name = "partOf", type = {MedicationAdministration.class, Procedure.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
920    @Description(shortDefinition="Part of referenced event", formalDefinition="A larger event of which this particular event is a component or step." )
921    protected List<Reference> partOf;
922
923    /**
924     * Will generally be set to show that the administration has been completed.  For some long running administrations such as infusions, it is possible for an administration to be started but not completed or it may be paused while some other process is under way.
925     */
926    @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true)
927    @Description(shortDefinition="in-progress | not-done | on-hold | completed | entered-in-error | stopped | unknown", formalDefinition="Will generally be set to show that the administration has been completed.  For some long running administrations such as infusions, it is possible for an administration to be started but not completed or it may be paused while some other process is under way." )
928    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-admin-status")
929    protected Enumeration<MedicationAdministrationStatusCodes> status;
930
931    /**
932     * A code indicating why the administration was not performed.
933     */
934    @Child(name = "statusReason", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
935    @Description(shortDefinition="Reason administration not performed", formalDefinition="A code indicating why the administration was not performed." )
936    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/reason-medication-not-given-codes")
937    protected List<CodeableConcept> statusReason;
938
939    /**
940     * The type of medication administration (for example, drug classification like ATC, where meds would be administered, legal category of the medication).
941     */
942    @Child(name = "category", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
943    @Description(shortDefinition="Type of medication administration", formalDefinition="The type of medication administration (for example, drug classification like ATC, where meds would be administered, legal category of the medication)." )
944    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-admin-location")
945    protected List<CodeableConcept> category;
946
947    /**
948     * Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.
949     */
950    @Child(name = "medication", type = {CodeableReference.class}, order=6, min=1, max=1, modifier=false, summary=true)
951    @Description(shortDefinition="What was administered", formalDefinition="Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." )
952    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-codes")
953    protected CodeableReference medication;
954
955    /**
956     * The person or animal or group receiving the medication.
957     */
958    @Child(name = "subject", type = {Patient.class, Group.class}, order=7, min=1, max=1, modifier=false, summary=true)
959    @Description(shortDefinition="Who received medication", formalDefinition="The person or animal or group receiving the medication." )
960    protected Reference subject;
961
962    /**
963     * The visit, admission, or other contact between patient and health care provider during which the medication administration was performed.
964     */
965    @Child(name = "encounter", type = {Encounter.class}, order=8, min=0, max=1, modifier=false, summary=false)
966    @Description(shortDefinition="Encounter administered as part of", formalDefinition="The visit, admission, or other contact between patient and health care provider during which the medication administration was performed." )
967    protected Reference encounter;
968
969    /**
970     * Additional information (for example, patient height and weight) that supports the administration of the medication.  This attribute can be used to provide documentation of specific characteristics of the patient present at the time of administration.  For example, if the dose says "give "x" if the heartrate exceeds "y"", then the heart rate can be included using this attribute.
971     */
972    @Child(name = "supportingInformation", type = {Reference.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
973    @Description(shortDefinition="Additional information to support administration", formalDefinition="Additional information (for example, patient height and weight) that supports the administration of the medication.  This attribute can be used to provide documentation of specific characteristics of the patient present at the time of administration.  For example, if the dose says \"give \"x\" if the heartrate exceeds \"y\"\", then the heart rate can be included using this attribute." )
974    protected List<Reference> supportingInformation;
975
976    /**
977     * A specific date/time or interval of time during which the administration took place (or did not take place). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.
978     */
979    @Child(name = "occurence", type = {DateTimeType.class, Period.class}, order=10, min=1, max=1, modifier=false, summary=true)
980    @Description(shortDefinition="Start and end time of administration", formalDefinition="A specific date/time or interval of time during which the administration took place (or did not take place). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate." )
981    protected DataType occurence;
982
983    /**
984     * The date the occurrence of the  MedicationAdministration was first captured in the record - potentially significantly after the occurrence of the event.
985     */
986    @Child(name = "recorded", type = {DateTimeType.class}, order=11, min=0, max=1, modifier=false, summary=true)
987    @Description(shortDefinition="When the MedicationAdministration was first captured in the subject's record", formalDefinition="The date the occurrence of the  MedicationAdministration was first captured in the record - potentially significantly after the occurrence of the event." )
988    protected DateTimeType recorded;
989
990    /**
991     * An indication that the full dose was not administered.
992     */
993    @Child(name = "isSubPotent", type = {BooleanType.class}, order=12, min=0, max=1, modifier=false, summary=false)
994    @Description(shortDefinition="Full dose was not administered", formalDefinition="An indication that the full dose was not administered." )
995    protected BooleanType isSubPotent;
996
997    /**
998     * The reason or reasons why the full dose was not administered.
999     */
1000    @Child(name = "subPotentReason", type = {CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1001    @Description(shortDefinition="Reason full dose was not administered", formalDefinition="The reason or reasons why the full dose was not administered." )
1002    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/administration-subpotent-reason")
1003    protected List<CodeableConcept> subPotentReason;
1004
1005    /**
1006     * Indicates who or what performed the medication administration and how they were involved. For devices, this is the device that is actually performing the administration of the medication.  An IV Pump would be an example of a device that is performing the administration.  Both the IV Pump and the practitioner that set the rate or bolus on the pump can be listed as performers.
1007     */
1008    @Child(name = "performer", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1009    @Description(shortDefinition="Who or what performed the medication administration and what type of performance they did", formalDefinition="Indicates who or what performed the medication administration and how they were involved. For devices, this is the device that is actually performing the administration of the medication.  An IV Pump would be an example of a device that is performing the administration.  Both the IV Pump and the practitioner that set the rate or bolus on the pump can be listed as performers." )
1010    protected List<MedicationAdministrationPerformerComponent> performer;
1011
1012    /**
1013     * A code, Condition or observation that supports why the medication was administered.
1014     */
1015    @Child(name = "reason", type = {CodeableReference.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1016    @Description(shortDefinition="Concept, condition or observation that supports why the medication was administered", formalDefinition="A code, Condition or observation that supports why the medication was administered." )
1017    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/reason-medication-given-codes")
1018    protected List<CodeableReference> reason;
1019
1020    /**
1021     * The original request, instruction or authority to perform the administration.
1022     */
1023    @Child(name = "request", type = {MedicationRequest.class}, order=16, min=0, max=1, modifier=false, summary=false)
1024    @Description(shortDefinition="Request administration performed against", formalDefinition="The original request, instruction or authority to perform the administration." )
1025    protected Reference request;
1026
1027    /**
1028     * The device used in administering the medication to the patient.  For example, a particular infusion pump.
1029     */
1030    @Child(name = "device", type = {Device.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1031    @Description(shortDefinition="Device used to administer", formalDefinition="The device used in administering the medication to the patient.  For example, a particular infusion pump." )
1032    protected List<Reference> device;
1033
1034    /**
1035     * Extra information about the medication administration that is not conveyed by the other attributes.
1036     */
1037    @Child(name = "note", type = {Annotation.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1038    @Description(shortDefinition="Information about the administration", formalDefinition="Extra information about the medication administration that is not conveyed by the other attributes." )
1039    protected List<Annotation> note;
1040
1041    /**
1042     * Describes the medication dosage information details e.g. dose, rate, site, route, etc.
1043     */
1044    @Child(name = "dosage", type = {}, order=19, min=0, max=1, modifier=false, summary=false)
1045    @Description(shortDefinition="Details of how medication was taken", formalDefinition="Describes the medication dosage information details e.g. dose, rate, site, route, etc." )
1046    protected MedicationAdministrationDosageComponent dosage;
1047
1048    /**
1049     * A summary of the events of interest that have occurred, such as when the administration was verified.
1050     */
1051    @Child(name = "eventHistory", type = {Provenance.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1052    @Description(shortDefinition="A list of events of interest in the lifecycle", formalDefinition="A summary of the events of interest that have occurred, such as when the administration was verified." )
1053    protected List<Reference> eventHistory;
1054
1055    private static final long serialVersionUID = 97286510L;
1056
1057  /**
1058   * Constructor
1059   */
1060    public MedicationAdministration() {
1061      super();
1062    }
1063
1064  /**
1065   * Constructor
1066   */
1067    public MedicationAdministration(MedicationAdministrationStatusCodes status, CodeableReference medication, Reference subject, DataType occurence) {
1068      super();
1069      this.setStatus(status);
1070      this.setMedication(medication);
1071      this.setSubject(subject);
1072      this.setOccurence(occurence);
1073    }
1074
1075    /**
1076     * @return {@link #identifier} (Identifiers associated with this Medication Administration that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.)
1077     */
1078    public List<Identifier> getIdentifier() { 
1079      if (this.identifier == null)
1080        this.identifier = new ArrayList<Identifier>();
1081      return this.identifier;
1082    }
1083
1084    /**
1085     * @return Returns a reference to <code>this</code> for easy method chaining
1086     */
1087    public MedicationAdministration setIdentifier(List<Identifier> theIdentifier) { 
1088      this.identifier = theIdentifier;
1089      return this;
1090    }
1091
1092    public boolean hasIdentifier() { 
1093      if (this.identifier == null)
1094        return false;
1095      for (Identifier item : this.identifier)
1096        if (!item.isEmpty())
1097          return true;
1098      return false;
1099    }
1100
1101    public Identifier addIdentifier() { //3
1102      Identifier t = new Identifier();
1103      if (this.identifier == null)
1104        this.identifier = new ArrayList<Identifier>();
1105      this.identifier.add(t);
1106      return t;
1107    }
1108
1109    public MedicationAdministration addIdentifier(Identifier t) { //3
1110      if (t == null)
1111        return this;
1112      if (this.identifier == null)
1113        this.identifier = new ArrayList<Identifier>();
1114      this.identifier.add(t);
1115      return this;
1116    }
1117
1118    /**
1119     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1120     */
1121    public Identifier getIdentifierFirstRep() { 
1122      if (getIdentifier().isEmpty()) {
1123        addIdentifier();
1124      }
1125      return getIdentifier().get(0);
1126    }
1127
1128    /**
1129     * @return {@link #basedOn} (A plan that is fulfilled in whole or in part by this MedicationAdministration.)
1130     */
1131    public List<Reference> getBasedOn() { 
1132      if (this.basedOn == null)
1133        this.basedOn = new ArrayList<Reference>();
1134      return this.basedOn;
1135    }
1136
1137    /**
1138     * @return Returns a reference to <code>this</code> for easy method chaining
1139     */
1140    public MedicationAdministration setBasedOn(List<Reference> theBasedOn) { 
1141      this.basedOn = theBasedOn;
1142      return this;
1143    }
1144
1145    public boolean hasBasedOn() { 
1146      if (this.basedOn == null)
1147        return false;
1148      for (Reference item : this.basedOn)
1149        if (!item.isEmpty())
1150          return true;
1151      return false;
1152    }
1153
1154    public Reference addBasedOn() { //3
1155      Reference t = new Reference();
1156      if (this.basedOn == null)
1157        this.basedOn = new ArrayList<Reference>();
1158      this.basedOn.add(t);
1159      return t;
1160    }
1161
1162    public MedicationAdministration addBasedOn(Reference t) { //3
1163      if (t == null)
1164        return this;
1165      if (this.basedOn == null)
1166        this.basedOn = new ArrayList<Reference>();
1167      this.basedOn.add(t);
1168      return this;
1169    }
1170
1171    /**
1172     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
1173     */
1174    public Reference getBasedOnFirstRep() { 
1175      if (getBasedOn().isEmpty()) {
1176        addBasedOn();
1177      }
1178      return getBasedOn().get(0);
1179    }
1180
1181    /**
1182     * @return {@link #partOf} (A larger event of which this particular event is a component or step.)
1183     */
1184    public List<Reference> getPartOf() { 
1185      if (this.partOf == null)
1186        this.partOf = new ArrayList<Reference>();
1187      return this.partOf;
1188    }
1189
1190    /**
1191     * @return Returns a reference to <code>this</code> for easy method chaining
1192     */
1193    public MedicationAdministration setPartOf(List<Reference> thePartOf) { 
1194      this.partOf = thePartOf;
1195      return this;
1196    }
1197
1198    public boolean hasPartOf() { 
1199      if (this.partOf == null)
1200        return false;
1201      for (Reference item : this.partOf)
1202        if (!item.isEmpty())
1203          return true;
1204      return false;
1205    }
1206
1207    public Reference addPartOf() { //3
1208      Reference t = new Reference();
1209      if (this.partOf == null)
1210        this.partOf = new ArrayList<Reference>();
1211      this.partOf.add(t);
1212      return t;
1213    }
1214
1215    public MedicationAdministration addPartOf(Reference t) { //3
1216      if (t == null)
1217        return this;
1218      if (this.partOf == null)
1219        this.partOf = new ArrayList<Reference>();
1220      this.partOf.add(t);
1221      return this;
1222    }
1223
1224    /**
1225     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist {3}
1226     */
1227    public Reference getPartOfFirstRep() { 
1228      if (getPartOf().isEmpty()) {
1229        addPartOf();
1230      }
1231      return getPartOf().get(0);
1232    }
1233
1234    /**
1235     * @return {@link #status} (Will generally be set to show that the administration has been completed.  For some long running administrations such as infusions, it is possible for an administration to be started but not completed or it may be paused while some other process is under way.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1236     */
1237    public Enumeration<MedicationAdministrationStatusCodes> getStatusElement() { 
1238      if (this.status == null)
1239        if (Configuration.errorOnAutoCreate())
1240          throw new Error("Attempt to auto-create MedicationAdministration.status");
1241        else if (Configuration.doAutoCreate())
1242          this.status = new Enumeration<MedicationAdministrationStatusCodes>(new MedicationAdministrationStatusCodesEnumFactory()); // bb
1243      return this.status;
1244    }
1245
1246    public boolean hasStatusElement() { 
1247      return this.status != null && !this.status.isEmpty();
1248    }
1249
1250    public boolean hasStatus() { 
1251      return this.status != null && !this.status.isEmpty();
1252    }
1253
1254    /**
1255     * @param value {@link #status} (Will generally be set to show that the administration has been completed.  For some long running administrations such as infusions, it is possible for an administration to be started but not completed or it may be paused while some other process is under way.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1256     */
1257    public MedicationAdministration setStatusElement(Enumeration<MedicationAdministrationStatusCodes> value) { 
1258      this.status = value;
1259      return this;
1260    }
1261
1262    /**
1263     * @return Will generally be set to show that the administration has been completed.  For some long running administrations such as infusions, it is possible for an administration to be started but not completed or it may be paused while some other process is under way.
1264     */
1265    public MedicationAdministrationStatusCodes getStatus() { 
1266      return this.status == null ? null : this.status.getValue();
1267    }
1268
1269    /**
1270     * @param value Will generally be set to show that the administration has been completed.  For some long running administrations such as infusions, it is possible for an administration to be started but not completed or it may be paused while some other process is under way.
1271     */
1272    public MedicationAdministration setStatus(MedicationAdministrationStatusCodes value) { 
1273        if (this.status == null)
1274          this.status = new Enumeration<MedicationAdministrationStatusCodes>(new MedicationAdministrationStatusCodesEnumFactory());
1275        this.status.setValue(value);
1276      return this;
1277    }
1278
1279    /**
1280     * @return {@link #statusReason} (A code indicating why the administration was not performed.)
1281     */
1282    public List<CodeableConcept> getStatusReason() { 
1283      if (this.statusReason == null)
1284        this.statusReason = new ArrayList<CodeableConcept>();
1285      return this.statusReason;
1286    }
1287
1288    /**
1289     * @return Returns a reference to <code>this</code> for easy method chaining
1290     */
1291    public MedicationAdministration setStatusReason(List<CodeableConcept> theStatusReason) { 
1292      this.statusReason = theStatusReason;
1293      return this;
1294    }
1295
1296    public boolean hasStatusReason() { 
1297      if (this.statusReason == null)
1298        return false;
1299      for (CodeableConcept item : this.statusReason)
1300        if (!item.isEmpty())
1301          return true;
1302      return false;
1303    }
1304
1305    public CodeableConcept addStatusReason() { //3
1306      CodeableConcept t = new CodeableConcept();
1307      if (this.statusReason == null)
1308        this.statusReason = new ArrayList<CodeableConcept>();
1309      this.statusReason.add(t);
1310      return t;
1311    }
1312
1313    public MedicationAdministration addStatusReason(CodeableConcept t) { //3
1314      if (t == null)
1315        return this;
1316      if (this.statusReason == null)
1317        this.statusReason = new ArrayList<CodeableConcept>();
1318      this.statusReason.add(t);
1319      return this;
1320    }
1321
1322    /**
1323     * @return The first repetition of repeating field {@link #statusReason}, creating it if it does not already exist {3}
1324     */
1325    public CodeableConcept getStatusReasonFirstRep() { 
1326      if (getStatusReason().isEmpty()) {
1327        addStatusReason();
1328      }
1329      return getStatusReason().get(0);
1330    }
1331
1332    /**
1333     * @return {@link #category} (The type of medication administration (for example, drug classification like ATC, where meds would be administered, legal category of the medication).)
1334     */
1335    public List<CodeableConcept> getCategory() { 
1336      if (this.category == null)
1337        this.category = new ArrayList<CodeableConcept>();
1338      return this.category;
1339    }
1340
1341    /**
1342     * @return Returns a reference to <code>this</code> for easy method chaining
1343     */
1344    public MedicationAdministration setCategory(List<CodeableConcept> theCategory) { 
1345      this.category = theCategory;
1346      return this;
1347    }
1348
1349    public boolean hasCategory() { 
1350      if (this.category == null)
1351        return false;
1352      for (CodeableConcept item : this.category)
1353        if (!item.isEmpty())
1354          return true;
1355      return false;
1356    }
1357
1358    public CodeableConcept addCategory() { //3
1359      CodeableConcept t = new CodeableConcept();
1360      if (this.category == null)
1361        this.category = new ArrayList<CodeableConcept>();
1362      this.category.add(t);
1363      return t;
1364    }
1365
1366    public MedicationAdministration addCategory(CodeableConcept t) { //3
1367      if (t == null)
1368        return this;
1369      if (this.category == null)
1370        this.category = new ArrayList<CodeableConcept>();
1371      this.category.add(t);
1372      return this;
1373    }
1374
1375    /**
1376     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
1377     */
1378    public CodeableConcept getCategoryFirstRep() { 
1379      if (getCategory().isEmpty()) {
1380        addCategory();
1381      }
1382      return getCategory().get(0);
1383    }
1384
1385    /**
1386     * @return {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.)
1387     */
1388    public CodeableReference getMedication() { 
1389      if (this.medication == null)
1390        if (Configuration.errorOnAutoCreate())
1391          throw new Error("Attempt to auto-create MedicationAdministration.medication");
1392        else if (Configuration.doAutoCreate())
1393          this.medication = new CodeableReference(); // cc
1394      return this.medication;
1395    }
1396
1397    public boolean hasMedication() { 
1398      return this.medication != null && !this.medication.isEmpty();
1399    }
1400
1401    /**
1402     * @param value {@link #medication} (Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.)
1403     */
1404    public MedicationAdministration setMedication(CodeableReference value) { 
1405      this.medication = value;
1406      return this;
1407    }
1408
1409    /**
1410     * @return {@link #subject} (The person or animal or group receiving the medication.)
1411     */
1412    public Reference getSubject() { 
1413      if (this.subject == null)
1414        if (Configuration.errorOnAutoCreate())
1415          throw new Error("Attempt to auto-create MedicationAdministration.subject");
1416        else if (Configuration.doAutoCreate())
1417          this.subject = new Reference(); // cc
1418      return this.subject;
1419    }
1420
1421    public boolean hasSubject() { 
1422      return this.subject != null && !this.subject.isEmpty();
1423    }
1424
1425    /**
1426     * @param value {@link #subject} (The person or animal or group receiving the medication.)
1427     */
1428    public MedicationAdministration setSubject(Reference value) { 
1429      this.subject = value;
1430      return this;
1431    }
1432
1433    /**
1434     * @return {@link #encounter} (The visit, admission, or other contact between patient and health care provider during which the medication administration was performed.)
1435     */
1436    public Reference getEncounter() { 
1437      if (this.encounter == null)
1438        if (Configuration.errorOnAutoCreate())
1439          throw new Error("Attempt to auto-create MedicationAdministration.encounter");
1440        else if (Configuration.doAutoCreate())
1441          this.encounter = new Reference(); // cc
1442      return this.encounter;
1443    }
1444
1445    public boolean hasEncounter() { 
1446      return this.encounter != null && !this.encounter.isEmpty();
1447    }
1448
1449    /**
1450     * @param value {@link #encounter} (The visit, admission, or other contact between patient and health care provider during which the medication administration was performed.)
1451     */
1452    public MedicationAdministration setEncounter(Reference value) { 
1453      this.encounter = value;
1454      return this;
1455    }
1456
1457    /**
1458     * @return {@link #supportingInformation} (Additional information (for example, patient height and weight) that supports the administration of the medication.  This attribute can be used to provide documentation of specific characteristics of the patient present at the time of administration.  For example, if the dose says "give "x" if the heartrate exceeds "y"", then the heart rate can be included using this attribute.)
1459     */
1460    public List<Reference> getSupportingInformation() { 
1461      if (this.supportingInformation == null)
1462        this.supportingInformation = new ArrayList<Reference>();
1463      return this.supportingInformation;
1464    }
1465
1466    /**
1467     * @return Returns a reference to <code>this</code> for easy method chaining
1468     */
1469    public MedicationAdministration setSupportingInformation(List<Reference> theSupportingInformation) { 
1470      this.supportingInformation = theSupportingInformation;
1471      return this;
1472    }
1473
1474    public boolean hasSupportingInformation() { 
1475      if (this.supportingInformation == null)
1476        return false;
1477      for (Reference item : this.supportingInformation)
1478        if (!item.isEmpty())
1479          return true;
1480      return false;
1481    }
1482
1483    public Reference addSupportingInformation() { //3
1484      Reference t = new Reference();
1485      if (this.supportingInformation == null)
1486        this.supportingInformation = new ArrayList<Reference>();
1487      this.supportingInformation.add(t);
1488      return t;
1489    }
1490
1491    public MedicationAdministration addSupportingInformation(Reference t) { //3
1492      if (t == null)
1493        return this;
1494      if (this.supportingInformation == null)
1495        this.supportingInformation = new ArrayList<Reference>();
1496      this.supportingInformation.add(t);
1497      return this;
1498    }
1499
1500    /**
1501     * @return The first repetition of repeating field {@link #supportingInformation}, creating it if it does not already exist {3}
1502     */
1503    public Reference getSupportingInformationFirstRep() { 
1504      if (getSupportingInformation().isEmpty()) {
1505        addSupportingInformation();
1506      }
1507      return getSupportingInformation().get(0);
1508    }
1509
1510    /**
1511     * @return {@link #occurence} (A specific date/time or interval of time during which the administration took place (or did not take place). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.)
1512     */
1513    public DataType getOccurence() { 
1514      return this.occurence;
1515    }
1516
1517    /**
1518     * @return {@link #occurence} (A specific date/time or interval of time during which the administration took place (or did not take place). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.)
1519     */
1520    public DateTimeType getOccurenceDateTimeType() throws FHIRException { 
1521      if (this.occurence == null)
1522        this.occurence = new DateTimeType();
1523      if (!(this.occurence instanceof DateTimeType))
1524        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurence.getClass().getName()+" was encountered");
1525      return (DateTimeType) this.occurence;
1526    }
1527
1528    public boolean hasOccurenceDateTimeType() { 
1529      return this != null && this.occurence instanceof DateTimeType;
1530    }
1531
1532    /**
1533     * @return {@link #occurence} (A specific date/time or interval of time during which the administration took place (or did not take place). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.)
1534     */
1535    public Period getOccurencePeriod() throws FHIRException { 
1536      if (this.occurence == null)
1537        this.occurence = new Period();
1538      if (!(this.occurence instanceof Period))
1539        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.occurence.getClass().getName()+" was encountered");
1540      return (Period) this.occurence;
1541    }
1542
1543    public boolean hasOccurencePeriod() { 
1544      return this != null && this.occurence instanceof Period;
1545    }
1546
1547    public boolean hasOccurence() { 
1548      return this.occurence != null && !this.occurence.isEmpty();
1549    }
1550
1551    /**
1552     * @param value {@link #occurence} (A specific date/time or interval of time during which the administration took place (or did not take place). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.)
1553     */
1554    public MedicationAdministration setOccurence(DataType value) { 
1555      if (value != null && !(value instanceof DateTimeType || value instanceof Period))
1556        throw new Error("Not the right type for MedicationAdministration.occurence[x]: "+value.fhirType());
1557      this.occurence = value;
1558      return this;
1559    }
1560
1561    /**
1562     * @return {@link #recorded} (The date the occurrence of the  MedicationAdministration was first captured in the record - potentially significantly after the occurrence of the event.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
1563     */
1564    public DateTimeType getRecordedElement() { 
1565      if (this.recorded == null)
1566        if (Configuration.errorOnAutoCreate())
1567          throw new Error("Attempt to auto-create MedicationAdministration.recorded");
1568        else if (Configuration.doAutoCreate())
1569          this.recorded = new DateTimeType(); // bb
1570      return this.recorded;
1571    }
1572
1573    public boolean hasRecordedElement() { 
1574      return this.recorded != null && !this.recorded.isEmpty();
1575    }
1576
1577    public boolean hasRecorded() { 
1578      return this.recorded != null && !this.recorded.isEmpty();
1579    }
1580
1581    /**
1582     * @param value {@link #recorded} (The date the occurrence of the  MedicationAdministration was first captured in the record - potentially significantly after the occurrence of the event.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
1583     */
1584    public MedicationAdministration setRecordedElement(DateTimeType value) { 
1585      this.recorded = value;
1586      return this;
1587    }
1588
1589    /**
1590     * @return The date the occurrence of the  MedicationAdministration was first captured in the record - potentially significantly after the occurrence of the event.
1591     */
1592    public Date getRecorded() { 
1593      return this.recorded == null ? null : this.recorded.getValue();
1594    }
1595
1596    /**
1597     * @param value The date the occurrence of the  MedicationAdministration was first captured in the record - potentially significantly after the occurrence of the event.
1598     */
1599    public MedicationAdministration setRecorded(Date value) { 
1600      if (value == null)
1601        this.recorded = null;
1602      else {
1603        if (this.recorded == null)
1604          this.recorded = new DateTimeType();
1605        this.recorded.setValue(value);
1606      }
1607      return this;
1608    }
1609
1610    /**
1611     * @return {@link #isSubPotent} (An indication that the full dose was not administered.). This is the underlying object with id, value and extensions. The accessor "getIsSubPotent" gives direct access to the value
1612     */
1613    public BooleanType getIsSubPotentElement() { 
1614      if (this.isSubPotent == null)
1615        if (Configuration.errorOnAutoCreate())
1616          throw new Error("Attempt to auto-create MedicationAdministration.isSubPotent");
1617        else if (Configuration.doAutoCreate())
1618          this.isSubPotent = new BooleanType(); // bb
1619      return this.isSubPotent;
1620    }
1621
1622    public boolean hasIsSubPotentElement() { 
1623      return this.isSubPotent != null && !this.isSubPotent.isEmpty();
1624    }
1625
1626    public boolean hasIsSubPotent() { 
1627      return this.isSubPotent != null && !this.isSubPotent.isEmpty();
1628    }
1629
1630    /**
1631     * @param value {@link #isSubPotent} (An indication that the full dose was not administered.). This is the underlying object with id, value and extensions. The accessor "getIsSubPotent" gives direct access to the value
1632     */
1633    public MedicationAdministration setIsSubPotentElement(BooleanType value) { 
1634      this.isSubPotent = value;
1635      return this;
1636    }
1637
1638    /**
1639     * @return An indication that the full dose was not administered.
1640     */
1641    public boolean getIsSubPotent() { 
1642      return this.isSubPotent == null || this.isSubPotent.isEmpty() ? false : this.isSubPotent.getValue();
1643    }
1644
1645    /**
1646     * @param value An indication that the full dose was not administered.
1647     */
1648    public MedicationAdministration setIsSubPotent(boolean value) { 
1649        if (this.isSubPotent == null)
1650          this.isSubPotent = new BooleanType();
1651        this.isSubPotent.setValue(value);
1652      return this;
1653    }
1654
1655    /**
1656     * @return {@link #subPotentReason} (The reason or reasons why the full dose was not administered.)
1657     */
1658    public List<CodeableConcept> getSubPotentReason() { 
1659      if (this.subPotentReason == null)
1660        this.subPotentReason = new ArrayList<CodeableConcept>();
1661      return this.subPotentReason;
1662    }
1663
1664    /**
1665     * @return Returns a reference to <code>this</code> for easy method chaining
1666     */
1667    public MedicationAdministration setSubPotentReason(List<CodeableConcept> theSubPotentReason) { 
1668      this.subPotentReason = theSubPotentReason;
1669      return this;
1670    }
1671
1672    public boolean hasSubPotentReason() { 
1673      if (this.subPotentReason == null)
1674        return false;
1675      for (CodeableConcept item : this.subPotentReason)
1676        if (!item.isEmpty())
1677          return true;
1678      return false;
1679    }
1680
1681    public CodeableConcept addSubPotentReason() { //3
1682      CodeableConcept t = new CodeableConcept();
1683      if (this.subPotentReason == null)
1684        this.subPotentReason = new ArrayList<CodeableConcept>();
1685      this.subPotentReason.add(t);
1686      return t;
1687    }
1688
1689    public MedicationAdministration addSubPotentReason(CodeableConcept t) { //3
1690      if (t == null)
1691        return this;
1692      if (this.subPotentReason == null)
1693        this.subPotentReason = new ArrayList<CodeableConcept>();
1694      this.subPotentReason.add(t);
1695      return this;
1696    }
1697
1698    /**
1699     * @return The first repetition of repeating field {@link #subPotentReason}, creating it if it does not already exist {3}
1700     */
1701    public CodeableConcept getSubPotentReasonFirstRep() { 
1702      if (getSubPotentReason().isEmpty()) {
1703        addSubPotentReason();
1704      }
1705      return getSubPotentReason().get(0);
1706    }
1707
1708    /**
1709     * @return {@link #performer} (Indicates who or what performed the medication administration and how they were involved. For devices, this is the device that is actually performing the administration of the medication.  An IV Pump would be an example of a device that is performing the administration.  Both the IV Pump and the practitioner that set the rate or bolus on the pump can be listed as performers.)
1710     */
1711    public List<MedicationAdministrationPerformerComponent> getPerformer() { 
1712      if (this.performer == null)
1713        this.performer = new ArrayList<MedicationAdministrationPerformerComponent>();
1714      return this.performer;
1715    }
1716
1717    /**
1718     * @return Returns a reference to <code>this</code> for easy method chaining
1719     */
1720    public MedicationAdministration setPerformer(List<MedicationAdministrationPerformerComponent> thePerformer) { 
1721      this.performer = thePerformer;
1722      return this;
1723    }
1724
1725    public boolean hasPerformer() { 
1726      if (this.performer == null)
1727        return false;
1728      for (MedicationAdministrationPerformerComponent item : this.performer)
1729        if (!item.isEmpty())
1730          return true;
1731      return false;
1732    }
1733
1734    public MedicationAdministrationPerformerComponent addPerformer() { //3
1735      MedicationAdministrationPerformerComponent t = new MedicationAdministrationPerformerComponent();
1736      if (this.performer == null)
1737        this.performer = new ArrayList<MedicationAdministrationPerformerComponent>();
1738      this.performer.add(t);
1739      return t;
1740    }
1741
1742    public MedicationAdministration addPerformer(MedicationAdministrationPerformerComponent t) { //3
1743      if (t == null)
1744        return this;
1745      if (this.performer == null)
1746        this.performer = new ArrayList<MedicationAdministrationPerformerComponent>();
1747      this.performer.add(t);
1748      return this;
1749    }
1750
1751    /**
1752     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist {3}
1753     */
1754    public MedicationAdministrationPerformerComponent getPerformerFirstRep() { 
1755      if (getPerformer().isEmpty()) {
1756        addPerformer();
1757      }
1758      return getPerformer().get(0);
1759    }
1760
1761    /**
1762     * @return {@link #reason} (A code, Condition or observation that supports why the medication was administered.)
1763     */
1764    public List<CodeableReference> getReason() { 
1765      if (this.reason == null)
1766        this.reason = new ArrayList<CodeableReference>();
1767      return this.reason;
1768    }
1769
1770    /**
1771     * @return Returns a reference to <code>this</code> for easy method chaining
1772     */
1773    public MedicationAdministration setReason(List<CodeableReference> theReason) { 
1774      this.reason = theReason;
1775      return this;
1776    }
1777
1778    public boolean hasReason() { 
1779      if (this.reason == null)
1780        return false;
1781      for (CodeableReference item : this.reason)
1782        if (!item.isEmpty())
1783          return true;
1784      return false;
1785    }
1786
1787    public CodeableReference addReason() { //3
1788      CodeableReference t = new CodeableReference();
1789      if (this.reason == null)
1790        this.reason = new ArrayList<CodeableReference>();
1791      this.reason.add(t);
1792      return t;
1793    }
1794
1795    public MedicationAdministration addReason(CodeableReference t) { //3
1796      if (t == null)
1797        return this;
1798      if (this.reason == null)
1799        this.reason = new ArrayList<CodeableReference>();
1800      this.reason.add(t);
1801      return this;
1802    }
1803
1804    /**
1805     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
1806     */
1807    public CodeableReference getReasonFirstRep() { 
1808      if (getReason().isEmpty()) {
1809        addReason();
1810      }
1811      return getReason().get(0);
1812    }
1813
1814    /**
1815     * @return {@link #request} (The original request, instruction or authority to perform the administration.)
1816     */
1817    public Reference getRequest() { 
1818      if (this.request == null)
1819        if (Configuration.errorOnAutoCreate())
1820          throw new Error("Attempt to auto-create MedicationAdministration.request");
1821        else if (Configuration.doAutoCreate())
1822          this.request = new Reference(); // cc
1823      return this.request;
1824    }
1825
1826    public boolean hasRequest() { 
1827      return this.request != null && !this.request.isEmpty();
1828    }
1829
1830    /**
1831     * @param value {@link #request} (The original request, instruction or authority to perform the administration.)
1832     */
1833    public MedicationAdministration setRequest(Reference value) { 
1834      this.request = value;
1835      return this;
1836    }
1837
1838    /**
1839     * @return {@link #device} (The device used in administering the medication to the patient.  For example, a particular infusion pump.)
1840     */
1841    public List<Reference> getDevice() { 
1842      if (this.device == null)
1843        this.device = new ArrayList<Reference>();
1844      return this.device;
1845    }
1846
1847    /**
1848     * @return Returns a reference to <code>this</code> for easy method chaining
1849     */
1850    public MedicationAdministration setDevice(List<Reference> theDevice) { 
1851      this.device = theDevice;
1852      return this;
1853    }
1854
1855    public boolean hasDevice() { 
1856      if (this.device == null)
1857        return false;
1858      for (Reference item : this.device)
1859        if (!item.isEmpty())
1860          return true;
1861      return false;
1862    }
1863
1864    public Reference addDevice() { //3
1865      Reference t = new Reference();
1866      if (this.device == null)
1867        this.device = new ArrayList<Reference>();
1868      this.device.add(t);
1869      return t;
1870    }
1871
1872    public MedicationAdministration addDevice(Reference t) { //3
1873      if (t == null)
1874        return this;
1875      if (this.device == null)
1876        this.device = new ArrayList<Reference>();
1877      this.device.add(t);
1878      return this;
1879    }
1880
1881    /**
1882     * @return The first repetition of repeating field {@link #device}, creating it if it does not already exist {3}
1883     */
1884    public Reference getDeviceFirstRep() { 
1885      if (getDevice().isEmpty()) {
1886        addDevice();
1887      }
1888      return getDevice().get(0);
1889    }
1890
1891    /**
1892     * @return {@link #note} (Extra information about the medication administration that is not conveyed by the other attributes.)
1893     */
1894    public List<Annotation> getNote() { 
1895      if (this.note == null)
1896        this.note = new ArrayList<Annotation>();
1897      return this.note;
1898    }
1899
1900    /**
1901     * @return Returns a reference to <code>this</code> for easy method chaining
1902     */
1903    public MedicationAdministration setNote(List<Annotation> theNote) { 
1904      this.note = theNote;
1905      return this;
1906    }
1907
1908    public boolean hasNote() { 
1909      if (this.note == null)
1910        return false;
1911      for (Annotation item : this.note)
1912        if (!item.isEmpty())
1913          return true;
1914      return false;
1915    }
1916
1917    public Annotation addNote() { //3
1918      Annotation t = new Annotation();
1919      if (this.note == null)
1920        this.note = new ArrayList<Annotation>();
1921      this.note.add(t);
1922      return t;
1923    }
1924
1925    public MedicationAdministration addNote(Annotation t) { //3
1926      if (t == null)
1927        return this;
1928      if (this.note == null)
1929        this.note = new ArrayList<Annotation>();
1930      this.note.add(t);
1931      return this;
1932    }
1933
1934    /**
1935     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
1936     */
1937    public Annotation getNoteFirstRep() { 
1938      if (getNote().isEmpty()) {
1939        addNote();
1940      }
1941      return getNote().get(0);
1942    }
1943
1944    /**
1945     * @return {@link #dosage} (Describes the medication dosage information details e.g. dose, rate, site, route, etc.)
1946     */
1947    public MedicationAdministrationDosageComponent getDosage() { 
1948      if (this.dosage == null)
1949        if (Configuration.errorOnAutoCreate())
1950          throw new Error("Attempt to auto-create MedicationAdministration.dosage");
1951        else if (Configuration.doAutoCreate())
1952          this.dosage = new MedicationAdministrationDosageComponent(); // cc
1953      return this.dosage;
1954    }
1955
1956    public boolean hasDosage() { 
1957      return this.dosage != null && !this.dosage.isEmpty();
1958    }
1959
1960    /**
1961     * @param value {@link #dosage} (Describes the medication dosage information details e.g. dose, rate, site, route, etc.)
1962     */
1963    public MedicationAdministration setDosage(MedicationAdministrationDosageComponent value) { 
1964      this.dosage = value;
1965      return this;
1966    }
1967
1968    /**
1969     * @return {@link #eventHistory} (A summary of the events of interest that have occurred, such as when the administration was verified.)
1970     */
1971    public List<Reference> getEventHistory() { 
1972      if (this.eventHistory == null)
1973        this.eventHistory = new ArrayList<Reference>();
1974      return this.eventHistory;
1975    }
1976
1977    /**
1978     * @return Returns a reference to <code>this</code> for easy method chaining
1979     */
1980    public MedicationAdministration setEventHistory(List<Reference> theEventHistory) { 
1981      this.eventHistory = theEventHistory;
1982      return this;
1983    }
1984
1985    public boolean hasEventHistory() { 
1986      if (this.eventHistory == null)
1987        return false;
1988      for (Reference item : this.eventHistory)
1989        if (!item.isEmpty())
1990          return true;
1991      return false;
1992    }
1993
1994    public Reference addEventHistory() { //3
1995      Reference t = new Reference();
1996      if (this.eventHistory == null)
1997        this.eventHistory = new ArrayList<Reference>();
1998      this.eventHistory.add(t);
1999      return t;
2000    }
2001
2002    public MedicationAdministration addEventHistory(Reference t) { //3
2003      if (t == null)
2004        return this;
2005      if (this.eventHistory == null)
2006        this.eventHistory = new ArrayList<Reference>();
2007      this.eventHistory.add(t);
2008      return this;
2009    }
2010
2011    /**
2012     * @return The first repetition of repeating field {@link #eventHistory}, creating it if it does not already exist {3}
2013     */
2014    public Reference getEventHistoryFirstRep() { 
2015      if (getEventHistory().isEmpty()) {
2016        addEventHistory();
2017      }
2018      return getEventHistory().get(0);
2019    }
2020
2021      protected void listChildren(List<Property> children) {
2022        super.listChildren(children);
2023        children.add(new Property("identifier", "Identifier", "Identifiers associated with this Medication Administration that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
2024        children.add(new Property("basedOn", "Reference(CarePlan)", "A plan that is fulfilled in whole or in part by this MedicationAdministration.", 0, java.lang.Integer.MAX_VALUE, basedOn));
2025        children.add(new Property("partOf", "Reference(MedicationAdministration|Procedure)", "A larger event of which this particular event is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf));
2026        children.add(new Property("status", "code", "Will generally be set to show that the administration has been completed.  For some long running administrations such as infusions, it is possible for an administration to be started but not completed or it may be paused while some other process is under way.", 0, 1, status));
2027        children.add(new Property("statusReason", "CodeableConcept", "A code indicating why the administration was not performed.", 0, java.lang.Integer.MAX_VALUE, statusReason));
2028        children.add(new Property("category", "CodeableConcept", "The type of medication administration (for example, drug classification like ATC, where meds would be administered, legal category of the medication).", 0, java.lang.Integer.MAX_VALUE, category));
2029        children.add(new Property("medication", "CodeableReference(Medication)", "Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, 1, medication));
2030        children.add(new Property("subject", "Reference(Patient|Group)", "The person or animal or group receiving the medication.", 0, 1, subject));
2031        children.add(new Property("encounter", "Reference(Encounter)", "The visit, admission, or other contact between patient and health care provider during which the medication administration was performed.", 0, 1, encounter));
2032        children.add(new Property("supportingInformation", "Reference(Any)", "Additional information (for example, patient height and weight) that supports the administration of the medication.  This attribute can be used to provide documentation of specific characteristics of the patient present at the time of administration.  For example, if the dose says \"give \"x\" if the heartrate exceeds \"y\"\", then the heart rate can be included using this attribute.", 0, java.lang.Integer.MAX_VALUE, supportingInformation));
2033        children.add(new Property("occurence[x]", "dateTime|Period", "A specific date/time or interval of time during which the administration took place (or did not take place). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.", 0, 1, occurence));
2034        children.add(new Property("recorded", "dateTime", "The date the occurrence of the  MedicationAdministration was first captured in the record - potentially significantly after the occurrence of the event.", 0, 1, recorded));
2035        children.add(new Property("isSubPotent", "boolean", "An indication that the full dose was not administered.", 0, 1, isSubPotent));
2036        children.add(new Property("subPotentReason", "CodeableConcept", "The reason or reasons why the full dose was not administered.", 0, java.lang.Integer.MAX_VALUE, subPotentReason));
2037        children.add(new Property("performer", "", "Indicates who or what performed the medication administration and how they were involved. For devices, this is the device that is actually performing the administration of the medication.  An IV Pump would be an example of a device that is performing the administration.  Both the IV Pump and the practitioner that set the rate or bolus on the pump can be listed as performers.", 0, java.lang.Integer.MAX_VALUE, performer));
2038        children.add(new Property("reason", "CodeableReference(Condition|Observation|DiagnosticReport)", "A code, Condition or observation that supports why the medication was administered.", 0, java.lang.Integer.MAX_VALUE, reason));
2039        children.add(new Property("request", "Reference(MedicationRequest)", "The original request, instruction or authority to perform the administration.", 0, 1, request));
2040        children.add(new Property("device", "Reference(Device)", "The device used in administering the medication to the patient.  For example, a particular infusion pump.", 0, java.lang.Integer.MAX_VALUE, device));
2041        children.add(new Property("note", "Annotation", "Extra information about the medication administration that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note));
2042        children.add(new Property("dosage", "", "Describes the medication dosage information details e.g. dose, rate, site, route, etc.", 0, 1, dosage));
2043        children.add(new Property("eventHistory", "Reference(Provenance)", "A summary of the events of interest that have occurred, such as when the administration was verified.", 0, java.lang.Integer.MAX_VALUE, eventHistory));
2044      }
2045
2046      @Override
2047      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2048        switch (_hash) {
2049        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers associated with this Medication Administration that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier);
2050        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(CarePlan)", "A plan that is fulfilled in whole or in part by this MedicationAdministration.", 0, java.lang.Integer.MAX_VALUE, basedOn);
2051        case -995410646: /*partOf*/  return new Property("partOf", "Reference(MedicationAdministration|Procedure)", "A larger event of which this particular event is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf);
2052        case -892481550: /*status*/  return new Property("status", "code", "Will generally be set to show that the administration has been completed.  For some long running administrations such as infusions, it is possible for an administration to be started but not completed or it may be paused while some other process is under way.", 0, 1, status);
2053        case 2051346646: /*statusReason*/  return new Property("statusReason", "CodeableConcept", "A code indicating why the administration was not performed.", 0, java.lang.Integer.MAX_VALUE, statusReason);
2054        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "The type of medication administration (for example, drug classification like ATC, where meds would be administered, legal category of the medication).", 0, java.lang.Integer.MAX_VALUE, category);
2055        case 1998965455: /*medication*/  return new Property("medication", "CodeableReference(Medication)", "Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.", 0, 1, medication);
2056        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "The person or animal or group receiving the medication.", 0, 1, subject);
2057        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The visit, admission, or other contact between patient and health care provider during which the medication administration was performed.", 0, 1, encounter);
2058        case -1248768647: /*supportingInformation*/  return new Property("supportingInformation", "Reference(Any)", "Additional information (for example, patient height and weight) that supports the administration of the medication.  This attribute can be used to provide documentation of specific characteristics of the patient present at the time of administration.  For example, if the dose says \"give \"x\" if the heartrate exceeds \"y\"\", then the heart rate can be included using this attribute.", 0, java.lang.Integer.MAX_VALUE, supportingInformation);
2059        case 144188521: /*occurence[x]*/  return new Property("occurence[x]", "dateTime|Period", "A specific date/time or interval of time during which the administration took place (or did not take place). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.", 0, 1, occurence);
2060        case -1192857417: /*occurence*/  return new Property("occurence[x]", "dateTime|Period", "A specific date/time or interval of time during which the administration took place (or did not take place). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.", 0, 1, occurence);
2061        case -820552334: /*occurenceDateTime*/  return new Property("occurence[x]", "dateTime", "A specific date/time or interval of time during which the administration took place (or did not take place). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.", 0, 1, occurence);
2062        case 221195608: /*occurencePeriod*/  return new Property("occurence[x]", "Period", "A specific date/time or interval of time during which the administration took place (or did not take place). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.", 0, 1, occurence);
2063        case -799233872: /*recorded*/  return new Property("recorded", "dateTime", "The date the occurrence of the  MedicationAdministration was first captured in the record - potentially significantly after the occurrence of the event.", 0, 1, recorded);
2064        case 702379724: /*isSubPotent*/  return new Property("isSubPotent", "boolean", "An indication that the full dose was not administered.", 0, 1, isSubPotent);
2065        case 969489082: /*subPotentReason*/  return new Property("subPotentReason", "CodeableConcept", "The reason or reasons why the full dose was not administered.", 0, java.lang.Integer.MAX_VALUE, subPotentReason);
2066        case 481140686: /*performer*/  return new Property("performer", "", "Indicates who or what performed the medication administration and how they were involved. For devices, this is the device that is actually performing the administration of the medication.  An IV Pump would be an example of a device that is performing the administration.  Both the IV Pump and the practitioner that set the rate or bolus on the pump can be listed as performers.", 0, java.lang.Integer.MAX_VALUE, performer);
2067        case -934964668: /*reason*/  return new Property("reason", "CodeableReference(Condition|Observation|DiagnosticReport)", "A code, Condition or observation that supports why the medication was administered.", 0, java.lang.Integer.MAX_VALUE, reason);
2068        case 1095692943: /*request*/  return new Property("request", "Reference(MedicationRequest)", "The original request, instruction or authority to perform the administration.", 0, 1, request);
2069        case -1335157162: /*device*/  return new Property("device", "Reference(Device)", "The device used in administering the medication to the patient.  For example, a particular infusion pump.", 0, java.lang.Integer.MAX_VALUE, device);
2070        case 3387378: /*note*/  return new Property("note", "Annotation", "Extra information about the medication administration that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note);
2071        case -1326018889: /*dosage*/  return new Property("dosage", "", "Describes the medication dosage information details e.g. dose, rate, site, route, etc.", 0, 1, dosage);
2072        case 1835190426: /*eventHistory*/  return new Property("eventHistory", "Reference(Provenance)", "A summary of the events of interest that have occurred, such as when the administration was verified.", 0, java.lang.Integer.MAX_VALUE, eventHistory);
2073        default: return super.getNamedProperty(_hash, _name, _checkValid);
2074        }
2075
2076      }
2077
2078      @Override
2079      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2080        switch (hash) {
2081        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2082        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2083        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
2084        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<MedicationAdministrationStatusCodes>
2085        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : this.statusReason.toArray(new Base[this.statusReason.size()]); // CodeableConcept
2086        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2087        case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // CodeableReference
2088        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2089        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
2090        case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference
2091        case -1192857417: /*occurence*/ return this.occurence == null ? new Base[0] : new Base[] {this.occurence}; // DataType
2092        case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // DateTimeType
2093        case 702379724: /*isSubPotent*/ return this.isSubPotent == null ? new Base[0] : new Base[] {this.isSubPotent}; // BooleanType
2094        case 969489082: /*subPotentReason*/ return this.subPotentReason == null ? new Base[0] : this.subPotentReason.toArray(new Base[this.subPotentReason.size()]); // CodeableConcept
2095        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // MedicationAdministrationPerformerComponent
2096        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableReference
2097        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
2098        case -1335157162: /*device*/ return this.device == null ? new Base[0] : this.device.toArray(new Base[this.device.size()]); // Reference
2099        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2100        case -1326018889: /*dosage*/ return this.dosage == null ? new Base[0] : new Base[] {this.dosage}; // MedicationAdministrationDosageComponent
2101        case 1835190426: /*eventHistory*/ return this.eventHistory == null ? new Base[0] : this.eventHistory.toArray(new Base[this.eventHistory.size()]); // Reference
2102        default: return super.getProperty(hash, name, checkValid);
2103        }
2104
2105      }
2106
2107      @Override
2108      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2109        switch (hash) {
2110        case -1618432855: // identifier
2111          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2112          return value;
2113        case -332612366: // basedOn
2114          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
2115          return value;
2116        case -995410646: // partOf
2117          this.getPartOf().add(TypeConvertor.castToReference(value)); // Reference
2118          return value;
2119        case -892481550: // status
2120          value = new MedicationAdministrationStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2121          this.status = (Enumeration) value; // Enumeration<MedicationAdministrationStatusCodes>
2122          return value;
2123        case 2051346646: // statusReason
2124          this.getStatusReason().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2125          return value;
2126        case 50511102: // category
2127          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2128          return value;
2129        case 1998965455: // medication
2130          this.medication = TypeConvertor.castToCodeableReference(value); // CodeableReference
2131          return value;
2132        case -1867885268: // subject
2133          this.subject = TypeConvertor.castToReference(value); // Reference
2134          return value;
2135        case 1524132147: // encounter
2136          this.encounter = TypeConvertor.castToReference(value); // Reference
2137          return value;
2138        case -1248768647: // supportingInformation
2139          this.getSupportingInformation().add(TypeConvertor.castToReference(value)); // Reference
2140          return value;
2141        case -1192857417: // occurence
2142          this.occurence = TypeConvertor.castToType(value); // DataType
2143          return value;
2144        case -799233872: // recorded
2145          this.recorded = TypeConvertor.castToDateTime(value); // DateTimeType
2146          return value;
2147        case 702379724: // isSubPotent
2148          this.isSubPotent = TypeConvertor.castToBoolean(value); // BooleanType
2149          return value;
2150        case 969489082: // subPotentReason
2151          this.getSubPotentReason().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2152          return value;
2153        case 481140686: // performer
2154          this.getPerformer().add((MedicationAdministrationPerformerComponent) value); // MedicationAdministrationPerformerComponent
2155          return value;
2156        case -934964668: // reason
2157          this.getReason().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
2158          return value;
2159        case 1095692943: // request
2160          this.request = TypeConvertor.castToReference(value); // Reference
2161          return value;
2162        case -1335157162: // device
2163          this.getDevice().add(TypeConvertor.castToReference(value)); // Reference
2164          return value;
2165        case 3387378: // note
2166          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
2167          return value;
2168        case -1326018889: // dosage
2169          this.dosage = (MedicationAdministrationDosageComponent) value; // MedicationAdministrationDosageComponent
2170          return value;
2171        case 1835190426: // eventHistory
2172          this.getEventHistory().add(TypeConvertor.castToReference(value)); // Reference
2173          return value;
2174        default: return super.setProperty(hash, name, value);
2175        }
2176
2177      }
2178
2179      @Override
2180      public Base setProperty(String name, Base value) throws FHIRException {
2181        if (name.equals("identifier")) {
2182          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2183        } else if (name.equals("basedOn")) {
2184          this.getBasedOn().add(TypeConvertor.castToReference(value));
2185        } else if (name.equals("partOf")) {
2186          this.getPartOf().add(TypeConvertor.castToReference(value));
2187        } else if (name.equals("status")) {
2188          value = new MedicationAdministrationStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2189          this.status = (Enumeration) value; // Enumeration<MedicationAdministrationStatusCodes>
2190        } else if (name.equals("statusReason")) {
2191          this.getStatusReason().add(TypeConvertor.castToCodeableConcept(value));
2192        } else if (name.equals("category")) {
2193          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
2194        } else if (name.equals("medication")) {
2195          this.medication = TypeConvertor.castToCodeableReference(value); // CodeableReference
2196        } else if (name.equals("subject")) {
2197          this.subject = TypeConvertor.castToReference(value); // Reference
2198        } else if (name.equals("encounter")) {
2199          this.encounter = TypeConvertor.castToReference(value); // Reference
2200        } else if (name.equals("supportingInformation")) {
2201          this.getSupportingInformation().add(TypeConvertor.castToReference(value));
2202        } else if (name.equals("occurence[x]")) {
2203          this.occurence = TypeConvertor.castToType(value); // DataType
2204        } else if (name.equals("recorded")) {
2205          this.recorded = TypeConvertor.castToDateTime(value); // DateTimeType
2206        } else if (name.equals("isSubPotent")) {
2207          this.isSubPotent = TypeConvertor.castToBoolean(value); // BooleanType
2208        } else if (name.equals("subPotentReason")) {
2209          this.getSubPotentReason().add(TypeConvertor.castToCodeableConcept(value));
2210        } else if (name.equals("performer")) {
2211          this.getPerformer().add((MedicationAdministrationPerformerComponent) value);
2212        } else if (name.equals("reason")) {
2213          this.getReason().add(TypeConvertor.castToCodeableReference(value));
2214        } else if (name.equals("request")) {
2215          this.request = TypeConvertor.castToReference(value); // Reference
2216        } else if (name.equals("device")) {
2217          this.getDevice().add(TypeConvertor.castToReference(value));
2218        } else if (name.equals("note")) {
2219          this.getNote().add(TypeConvertor.castToAnnotation(value));
2220        } else if (name.equals("dosage")) {
2221          this.dosage = (MedicationAdministrationDosageComponent) value; // MedicationAdministrationDosageComponent
2222        } else if (name.equals("eventHistory")) {
2223          this.getEventHistory().add(TypeConvertor.castToReference(value));
2224        } else
2225          return super.setProperty(name, value);
2226        return value;
2227      }
2228
2229      @Override
2230      public Base makeProperty(int hash, String name) throws FHIRException {
2231        switch (hash) {
2232        case -1618432855:  return addIdentifier(); 
2233        case -332612366:  return addBasedOn(); 
2234        case -995410646:  return addPartOf(); 
2235        case -892481550:  return getStatusElement();
2236        case 2051346646:  return addStatusReason(); 
2237        case 50511102:  return addCategory(); 
2238        case 1998965455:  return getMedication();
2239        case -1867885268:  return getSubject();
2240        case 1524132147:  return getEncounter();
2241        case -1248768647:  return addSupportingInformation(); 
2242        case 144188521:  return getOccurence();
2243        case -1192857417:  return getOccurence();
2244        case -799233872:  return getRecordedElement();
2245        case 702379724:  return getIsSubPotentElement();
2246        case 969489082:  return addSubPotentReason(); 
2247        case 481140686:  return addPerformer(); 
2248        case -934964668:  return addReason(); 
2249        case 1095692943:  return getRequest();
2250        case -1335157162:  return addDevice(); 
2251        case 3387378:  return addNote(); 
2252        case -1326018889:  return getDosage();
2253        case 1835190426:  return addEventHistory(); 
2254        default: return super.makeProperty(hash, name);
2255        }
2256
2257      }
2258
2259      @Override
2260      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2261        switch (hash) {
2262        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2263        case -332612366: /*basedOn*/ return new String[] {"Reference"};
2264        case -995410646: /*partOf*/ return new String[] {"Reference"};
2265        case -892481550: /*status*/ return new String[] {"code"};
2266        case 2051346646: /*statusReason*/ return new String[] {"CodeableConcept"};
2267        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2268        case 1998965455: /*medication*/ return new String[] {"CodeableReference"};
2269        case -1867885268: /*subject*/ return new String[] {"Reference"};
2270        case 1524132147: /*encounter*/ return new String[] {"Reference"};
2271        case -1248768647: /*supportingInformation*/ return new String[] {"Reference"};
2272        case -1192857417: /*occurence*/ return new String[] {"dateTime", "Period"};
2273        case -799233872: /*recorded*/ return new String[] {"dateTime"};
2274        case 702379724: /*isSubPotent*/ return new String[] {"boolean"};
2275        case 969489082: /*subPotentReason*/ return new String[] {"CodeableConcept"};
2276        case 481140686: /*performer*/ return new String[] {};
2277        case -934964668: /*reason*/ return new String[] {"CodeableReference"};
2278        case 1095692943: /*request*/ return new String[] {"Reference"};
2279        case -1335157162: /*device*/ return new String[] {"Reference"};
2280        case 3387378: /*note*/ return new String[] {"Annotation"};
2281        case -1326018889: /*dosage*/ return new String[] {};
2282        case 1835190426: /*eventHistory*/ return new String[] {"Reference"};
2283        default: return super.getTypesForProperty(hash, name);
2284        }
2285
2286      }
2287
2288      @Override
2289      public Base addChild(String name) throws FHIRException {
2290        if (name.equals("identifier")) {
2291          return addIdentifier();
2292        }
2293        else if (name.equals("basedOn")) {
2294          return addBasedOn();
2295        }
2296        else if (name.equals("partOf")) {
2297          return addPartOf();
2298        }
2299        else if (name.equals("status")) {
2300          throw new FHIRException("Cannot call addChild on a primitive type MedicationAdministration.status");
2301        }
2302        else if (name.equals("statusReason")) {
2303          return addStatusReason();
2304        }
2305        else if (name.equals("category")) {
2306          return addCategory();
2307        }
2308        else if (name.equals("medication")) {
2309          this.medication = new CodeableReference();
2310          return this.medication;
2311        }
2312        else if (name.equals("subject")) {
2313          this.subject = new Reference();
2314          return this.subject;
2315        }
2316        else if (name.equals("encounter")) {
2317          this.encounter = new Reference();
2318          return this.encounter;
2319        }
2320        else if (name.equals("supportingInformation")) {
2321          return addSupportingInformation();
2322        }
2323        else if (name.equals("occurenceDateTime")) {
2324          this.occurence = new DateTimeType();
2325          return this.occurence;
2326        }
2327        else if (name.equals("occurencePeriod")) {
2328          this.occurence = new Period();
2329          return this.occurence;
2330        }
2331        else if (name.equals("recorded")) {
2332          throw new FHIRException("Cannot call addChild on a primitive type MedicationAdministration.recorded");
2333        }
2334        else if (name.equals("isSubPotent")) {
2335          throw new FHIRException("Cannot call addChild on a primitive type MedicationAdministration.isSubPotent");
2336        }
2337        else if (name.equals("subPotentReason")) {
2338          return addSubPotentReason();
2339        }
2340        else if (name.equals("performer")) {
2341          return addPerformer();
2342        }
2343        else if (name.equals("reason")) {
2344          return addReason();
2345        }
2346        else if (name.equals("request")) {
2347          this.request = new Reference();
2348          return this.request;
2349        }
2350        else if (name.equals("device")) {
2351          return addDevice();
2352        }
2353        else if (name.equals("note")) {
2354          return addNote();
2355        }
2356        else if (name.equals("dosage")) {
2357          this.dosage = new MedicationAdministrationDosageComponent();
2358          return this.dosage;
2359        }
2360        else if (name.equals("eventHistory")) {
2361          return addEventHistory();
2362        }
2363        else
2364          return super.addChild(name);
2365      }
2366
2367  public String fhirType() {
2368    return "MedicationAdministration";
2369
2370  }
2371
2372      public MedicationAdministration copy() {
2373        MedicationAdministration dst = new MedicationAdministration();
2374        copyValues(dst);
2375        return dst;
2376      }
2377
2378      public void copyValues(MedicationAdministration dst) {
2379        super.copyValues(dst);
2380        if (identifier != null) {
2381          dst.identifier = new ArrayList<Identifier>();
2382          for (Identifier i : identifier)
2383            dst.identifier.add(i.copy());
2384        };
2385        if (basedOn != null) {
2386          dst.basedOn = new ArrayList<Reference>();
2387          for (Reference i : basedOn)
2388            dst.basedOn.add(i.copy());
2389        };
2390        if (partOf != null) {
2391          dst.partOf = new ArrayList<Reference>();
2392          for (Reference i : partOf)
2393            dst.partOf.add(i.copy());
2394        };
2395        dst.status = status == null ? null : status.copy();
2396        if (statusReason != null) {
2397          dst.statusReason = new ArrayList<CodeableConcept>();
2398          for (CodeableConcept i : statusReason)
2399            dst.statusReason.add(i.copy());
2400        };
2401        if (category != null) {
2402          dst.category = new ArrayList<CodeableConcept>();
2403          for (CodeableConcept i : category)
2404            dst.category.add(i.copy());
2405        };
2406        dst.medication = medication == null ? null : medication.copy();
2407        dst.subject = subject == null ? null : subject.copy();
2408        dst.encounter = encounter == null ? null : encounter.copy();
2409        if (supportingInformation != null) {
2410          dst.supportingInformation = new ArrayList<Reference>();
2411          for (Reference i : supportingInformation)
2412            dst.supportingInformation.add(i.copy());
2413        };
2414        dst.occurence = occurence == null ? null : occurence.copy();
2415        dst.recorded = recorded == null ? null : recorded.copy();
2416        dst.isSubPotent = isSubPotent == null ? null : isSubPotent.copy();
2417        if (subPotentReason != null) {
2418          dst.subPotentReason = new ArrayList<CodeableConcept>();
2419          for (CodeableConcept i : subPotentReason)
2420            dst.subPotentReason.add(i.copy());
2421        };
2422        if (performer != null) {
2423          dst.performer = new ArrayList<MedicationAdministrationPerformerComponent>();
2424          for (MedicationAdministrationPerformerComponent i : performer)
2425            dst.performer.add(i.copy());
2426        };
2427        if (reason != null) {
2428          dst.reason = new ArrayList<CodeableReference>();
2429          for (CodeableReference i : reason)
2430            dst.reason.add(i.copy());
2431        };
2432        dst.request = request == null ? null : request.copy();
2433        if (device != null) {
2434          dst.device = new ArrayList<Reference>();
2435          for (Reference i : device)
2436            dst.device.add(i.copy());
2437        };
2438        if (note != null) {
2439          dst.note = new ArrayList<Annotation>();
2440          for (Annotation i : note)
2441            dst.note.add(i.copy());
2442        };
2443        dst.dosage = dosage == null ? null : dosage.copy();
2444        if (eventHistory != null) {
2445          dst.eventHistory = new ArrayList<Reference>();
2446          for (Reference i : eventHistory)
2447            dst.eventHistory.add(i.copy());
2448        };
2449      }
2450
2451      protected MedicationAdministration typedCopy() {
2452        return copy();
2453      }
2454
2455      @Override
2456      public boolean equalsDeep(Base other_) {
2457        if (!super.equalsDeep(other_))
2458          return false;
2459        if (!(other_ instanceof MedicationAdministration))
2460          return false;
2461        MedicationAdministration o = (MedicationAdministration) other_;
2462        return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(partOf, o.partOf, true)
2463           && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true) && compareDeep(category, o.category, true)
2464           && compareDeep(medication, o.medication, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true)
2465           && compareDeep(supportingInformation, o.supportingInformation, true) && compareDeep(occurence, o.occurence, true)
2466           && compareDeep(recorded, o.recorded, true) && compareDeep(isSubPotent, o.isSubPotent, true) && compareDeep(subPotentReason, o.subPotentReason, true)
2467           && compareDeep(performer, o.performer, true) && compareDeep(reason, o.reason, true) && compareDeep(request, o.request, true)
2468           && compareDeep(device, o.device, true) && compareDeep(note, o.note, true) && compareDeep(dosage, o.dosage, true)
2469           && compareDeep(eventHistory, o.eventHistory, true);
2470      }
2471
2472      @Override
2473      public boolean equalsShallow(Base other_) {
2474        if (!super.equalsShallow(other_))
2475          return false;
2476        if (!(other_ instanceof MedicationAdministration))
2477          return false;
2478        MedicationAdministration o = (MedicationAdministration) other_;
2479        return compareValues(status, o.status, true) && compareValues(recorded, o.recorded, true) && compareValues(isSubPotent, o.isSubPotent, true)
2480          ;
2481      }
2482
2483      public boolean isEmpty() {
2484        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, partOf
2485          , status, statusReason, category, medication, subject, encounter, supportingInformation
2486          , occurence, recorded, isSubPotent, subPotentReason, performer, reason, request
2487          , device, note, dosage, eventHistory);
2488      }
2489
2490  @Override
2491  public ResourceType getResourceType() {
2492    return ResourceType.MedicationAdministration;
2493   }
2494
2495 /**
2496   * Search parameter: <b>device</b>
2497   * <p>
2498   * Description: <b>Return administrations with this administration device identity</b><br>
2499   * Type: <b>reference</b><br>
2500   * Path: <b>MedicationAdministration.device</b><br>
2501   * </p>
2502   */
2503  @SearchParamDefinition(name="device", path="MedicationAdministration.device", description="Return administrations with this administration device identity", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device") }, target={Device.class } )
2504  public static final String SP_DEVICE = "device";
2505 /**
2506   * <b>Fluent Client</b> search parameter constant for <b>device</b>
2507   * <p>
2508   * Description: <b>Return administrations with this administration device identity</b><br>
2509   * Type: <b>reference</b><br>
2510   * Path: <b>MedicationAdministration.device</b><br>
2511   * </p>
2512   */
2513  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE);
2514
2515/**
2516   * Constant for fluent queries to be used to add include statements. Specifies
2517   * the path value of "<b>MedicationAdministration:device</b>".
2518   */
2519  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("MedicationAdministration:device").toLocked();
2520
2521 /**
2522   * Search parameter: <b>performer</b>
2523   * <p>
2524   * Description: <b>The identity of the individual who administered the medication</b><br>
2525   * Type: <b>reference</b><br>
2526   * Path: <b>MedicationAdministration.performer.actor</b><br>
2527   * </p>
2528   */
2529  @SearchParamDefinition(name="performer", path="MedicationAdministration.performer.actor", description="The identity of the individual who administered the medication", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for RelatedPerson") }, target={Device.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2530  public static final String SP_PERFORMER = "performer";
2531 /**
2532   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
2533   * <p>
2534   * Description: <b>The identity of the individual who administered the medication</b><br>
2535   * Type: <b>reference</b><br>
2536   * Path: <b>MedicationAdministration.performer.actor</b><br>
2537   * </p>
2538   */
2539  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
2540
2541/**
2542   * Constant for fluent queries to be used to add include statements. Specifies
2543   * the path value of "<b>MedicationAdministration:performer</b>".
2544   */
2545  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("MedicationAdministration:performer").toLocked();
2546
2547 /**
2548   * Search parameter: <b>reason-given-code</b>
2549   * <p>
2550   * Description: <b>Reasons for administering the medication</b><br>
2551   * Type: <b>token</b><br>
2552   * Path: <b>MedicationAdministration.reason.concept</b><br>
2553   * </p>
2554   */
2555  @SearchParamDefinition(name="reason-given-code", path="MedicationAdministration.reason.concept", description="Reasons for administering the medication", type="token" )
2556  public static final String SP_REASON_GIVEN_CODE = "reason-given-code";
2557 /**
2558   * <b>Fluent Client</b> search parameter constant for <b>reason-given-code</b>
2559   * <p>
2560   * Description: <b>Reasons for administering the medication</b><br>
2561   * Type: <b>token</b><br>
2562   * Path: <b>MedicationAdministration.reason.concept</b><br>
2563   * </p>
2564   */
2565  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON_GIVEN_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REASON_GIVEN_CODE);
2566
2567 /**
2568   * Search parameter: <b>reason-given</b>
2569   * <p>
2570   * Description: <b>Reference to a resource (by instance)</b><br>
2571   * Type: <b>reference</b><br>
2572   * Path: <b>MedicationAdministration.reason.reference</b><br>
2573   * </p>
2574   */
2575  @SearchParamDefinition(name="reason-given", path="MedicationAdministration.reason.reference", description="Reference to a resource (by instance)", type="reference" )
2576  public static final String SP_REASON_GIVEN = "reason-given";
2577 /**
2578   * <b>Fluent Client</b> search parameter constant for <b>reason-given</b>
2579   * <p>
2580   * Description: <b>Reference to a resource (by instance)</b><br>
2581   * Type: <b>reference</b><br>
2582   * Path: <b>MedicationAdministration.reason.reference</b><br>
2583   * </p>
2584   */
2585  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REASON_GIVEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REASON_GIVEN);
2586
2587/**
2588   * Constant for fluent queries to be used to add include statements. Specifies
2589   * the path value of "<b>MedicationAdministration:reason-given</b>".
2590   */
2591  public static final ca.uhn.fhir.model.api.Include INCLUDE_REASON_GIVEN = new ca.uhn.fhir.model.api.Include("MedicationAdministration:reason-given").toLocked();
2592
2593 /**
2594   * Search parameter: <b>reason-not-given</b>
2595   * <p>
2596   * Description: <b>Reasons for not administering the medication</b><br>
2597   * Type: <b>token</b><br>
2598   * Path: <b>MedicationAdministration.statusReason</b><br>
2599   * </p>
2600   */
2601  @SearchParamDefinition(name="reason-not-given", path="MedicationAdministration.statusReason", description="Reasons for not administering the medication", type="token" )
2602  public static final String SP_REASON_NOT_GIVEN = "reason-not-given";
2603 /**
2604   * <b>Fluent Client</b> search parameter constant for <b>reason-not-given</b>
2605   * <p>
2606   * Description: <b>Reasons for not administering the medication</b><br>
2607   * Type: <b>token</b><br>
2608   * Path: <b>MedicationAdministration.statusReason</b><br>
2609   * </p>
2610   */
2611  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON_NOT_GIVEN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REASON_NOT_GIVEN);
2612
2613 /**
2614   * Search parameter: <b>request</b>
2615   * <p>
2616   * Description: <b>The identity of a request to list administrations from</b><br>
2617   * Type: <b>reference</b><br>
2618   * Path: <b>MedicationAdministration.request</b><br>
2619   * </p>
2620   */
2621  @SearchParamDefinition(name="request", path="MedicationAdministration.request", description="The identity of a request to list administrations from", type="reference", target={MedicationRequest.class } )
2622  public static final String SP_REQUEST = "request";
2623 /**
2624   * <b>Fluent Client</b> search parameter constant for <b>request</b>
2625   * <p>
2626   * Description: <b>The identity of a request to list administrations from</b><br>
2627   * Type: <b>reference</b><br>
2628   * Path: <b>MedicationAdministration.request</b><br>
2629   * </p>
2630   */
2631  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST);
2632
2633/**
2634   * Constant for fluent queries to be used to add include statements. Specifies
2635   * the path value of "<b>MedicationAdministration:request</b>".
2636   */
2637  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("MedicationAdministration:request").toLocked();
2638
2639 /**
2640   * Search parameter: <b>subject</b>
2641   * <p>
2642   * Description: <b>The identity of the individual or group to list administrations for</b><br>
2643   * Type: <b>reference</b><br>
2644   * Path: <b>MedicationAdministration.subject</b><br>
2645   * </p>
2646   */
2647  @SearchParamDefinition(name="subject", path="MedicationAdministration.subject", description="The identity of the individual or group to list administrations for", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Group.class, Patient.class } )
2648  public static final String SP_SUBJECT = "subject";
2649 /**
2650   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2651   * <p>
2652   * Description: <b>The identity of the individual or group to list administrations for</b><br>
2653   * Type: <b>reference</b><br>
2654   * Path: <b>MedicationAdministration.subject</b><br>
2655   * </p>
2656   */
2657  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2658
2659/**
2660   * Constant for fluent queries to be used to add include statements. Specifies
2661   * the path value of "<b>MedicationAdministration:subject</b>".
2662   */
2663  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("MedicationAdministration:subject").toLocked();
2664
2665 /**
2666   * Search parameter: <b>code</b>
2667   * <p>
2668   * Description: <b>Multiple Resources: 
2669
2670* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2671* [Condition](condition.html): Code for the condition
2672* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2673* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result
2674* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2675* [List](list.html): What the purpose of this list is
2676* [Medication](medication.html): Returns medications for a specific code
2677* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2678* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2679* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2680* [MedicationUsage](medicationusage.html): Return statements of this medication code
2681* [Observation](observation.html): The code of the observation type
2682* [Procedure](procedure.html): A code to identify a  procedure
2683</b><br>
2684   * Type: <b>token</b><br>
2685   * Path: <b>AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code</b><br>
2686   * </p>
2687   */
2688  @SearchParamDefinition(name="code", path="AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance\r\n* [Condition](condition.html): Code for the condition\r\n* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered\r\n* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code\r\n* [List](list.html): What the purpose of this list is\r\n* [Medication](medication.html): Returns medications for a specific code\r\n* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code\r\n* [MedicationUsage](medicationusage.html): Return statements of this medication code\r\n* [Observation](observation.html): The code of the observation type\r\n* [Procedure](procedure.html): A code to identify a  procedure\r\n", type="token" )
2689  public static final String SP_CODE = "code";
2690 /**
2691   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2692   * <p>
2693   * Description: <b>Multiple Resources: 
2694
2695* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2696* [Condition](condition.html): Code for the condition
2697* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2698* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result
2699* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2700* [List](list.html): What the purpose of this list is
2701* [Medication](medication.html): Returns medications for a specific code
2702* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2703* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2704* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2705* [MedicationUsage](medicationusage.html): Return statements of this medication code
2706* [Observation](observation.html): The code of the observation type
2707* [Procedure](procedure.html): A code to identify a  procedure
2708</b><br>
2709   * Type: <b>token</b><br>
2710   * Path: <b>AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code</b><br>
2711   * </p>
2712   */
2713  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2714
2715 /**
2716   * Search parameter: <b>identifier</b>
2717   * <p>
2718   * Description: <b>Multiple Resources: 
2719
2720* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2721* [CarePlan](careplan.html): External Ids for this plan
2722* [CareTeam](careteam.html): External Ids for this team
2723* [Composition](composition.html): Version-independent identifier for the Composition
2724* [Condition](condition.html): A unique identifier of the condition record
2725* [Consent](consent.html): Identifier for this record (external references)
2726* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2727* [DeviceRequest](devicerequest.html): Business identifier for request/order
2728* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2729* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2730* [DocumentReference](documentreference.html): Identifier of the attachment binary
2731* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2732* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2733* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2734* [Goal](goal.html): External Ids for this goal
2735* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2736* [Immunization](immunization.html): Business identifier
2737* [List](list.html): Business identifier
2738* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2739* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2740* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2741* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2742* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2743* [Observation](observation.html): The unique id for a particular observation
2744* [Procedure](procedure.html): A unique identifier for a procedure
2745* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2746* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2747* [SupplyDelivery](supplydelivery.html): External identifier
2748* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2749* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2750</b><br>
2751   * Type: <b>token</b><br>
2752   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2753   * </p>
2754   */
2755  @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [List](list.html): Business identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationUsage](medicationusage.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
2756  public static final String SP_IDENTIFIER = "identifier";
2757 /**
2758   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2759   * <p>
2760   * Description: <b>Multiple Resources: 
2761
2762* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2763* [CarePlan](careplan.html): External Ids for this plan
2764* [CareTeam](careteam.html): External Ids for this team
2765* [Composition](composition.html): Version-independent identifier for the Composition
2766* [Condition](condition.html): A unique identifier of the condition record
2767* [Consent](consent.html): Identifier for this record (external references)
2768* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2769* [DeviceRequest](devicerequest.html): Business identifier for request/order
2770* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2771* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2772* [DocumentReference](documentreference.html): Identifier of the attachment binary
2773* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2774* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2775* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2776* [Goal](goal.html): External Ids for this goal
2777* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2778* [Immunization](immunization.html): Business identifier
2779* [List](list.html): Business identifier
2780* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2781* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2782* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2783* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2784* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2785* [Observation](observation.html): The unique id for a particular observation
2786* [Procedure](procedure.html): A unique identifier for a procedure
2787* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2788* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2789* [SupplyDelivery](supplydelivery.html): External identifier
2790* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2791* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2792</b><br>
2793   * Type: <b>token</b><br>
2794   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2795   * </p>
2796   */
2797  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2798
2799 /**
2800   * Search parameter: <b>patient</b>
2801   * <p>
2802   * Description: <b>Multiple Resources: 
2803
2804* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2805* [CarePlan](careplan.html): Who the care plan is for
2806* [CareTeam](careteam.html): Who care team is for
2807* [ClinicalImpression](clinicalimpression.html): Patient assessed
2808* [Composition](composition.html): Who and/or what the composition is about
2809* [Condition](condition.html): Who has the condition?
2810* [Consent](consent.html): Who the consent applies to
2811* [DetectedIssue](detectedissue.html): Associated patient
2812* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2813* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2814* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2815* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2816* [DocumentReference](documentreference.html): Who/what is the subject of the document
2817* [Encounter](encounter.html): The patient present at the encounter
2818* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2819* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2820* [Flag](flag.html): The identity of a subject to list flags for
2821* [Goal](goal.html): Who this goal is intended for
2822* [ImagingStudy](imagingstudy.html): Who the study is about
2823* [Immunization](immunization.html): The patient for the vaccination record
2824* [List](list.html): If all resources have the same subject
2825* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2826* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2827* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2828* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2829* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
2830* [Observation](observation.html): The subject that the observation is about (if patient)
2831* [Procedure](procedure.html): Search by subject - a patient
2832* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2833* [ServiceRequest](servicerequest.html): Search by subject - a patient
2834* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2835* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
2836* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2837</b><br>
2838   * Type: <b>reference</b><br>
2839   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.subject | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | VisionPrescription.patient</b><br>
2840   * </p>
2841   */
2842  @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.subject | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentManifest](documentmanifest.html): The subject of the set of documents\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [List](list.html): If all resources have the same subject\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={BiologicallyDerivedProduct.class, Device.class, Group.class, Location.class, Medication.class, NutritionProduct.class, Organization.class, Patient.class, Practitioner.class, Procedure.class, Substance.class } )
2843  public static final String SP_PATIENT = "patient";
2844 /**
2845   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2846   * <p>
2847   * Description: <b>Multiple Resources: 
2848
2849* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2850* [CarePlan](careplan.html): Who the care plan is for
2851* [CareTeam](careteam.html): Who care team is for
2852* [ClinicalImpression](clinicalimpression.html): Patient assessed
2853* [Composition](composition.html): Who and/or what the composition is about
2854* [Condition](condition.html): Who has the condition?
2855* [Consent](consent.html): Who the consent applies to
2856* [DetectedIssue](detectedissue.html): Associated patient
2857* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2858* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2859* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2860* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2861* [DocumentReference](documentreference.html): Who/what is the subject of the document
2862* [Encounter](encounter.html): The patient present at the encounter
2863* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2864* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2865* [Flag](flag.html): The identity of a subject to list flags for
2866* [Goal](goal.html): Who this goal is intended for
2867* [ImagingStudy](imagingstudy.html): Who the study is about
2868* [Immunization](immunization.html): The patient for the vaccination record
2869* [List](list.html): If all resources have the same subject
2870* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2871* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2872* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2873* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2874* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
2875* [Observation](observation.html): The subject that the observation is about (if patient)
2876* [Procedure](procedure.html): Search by subject - a patient
2877* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2878* [ServiceRequest](servicerequest.html): Search by subject - a patient
2879* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2880* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
2881* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2882</b><br>
2883   * Type: <b>reference</b><br>
2884   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.subject | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | VisionPrescription.patient</b><br>
2885   * </p>
2886   */
2887  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2888
2889/**
2890   * Constant for fluent queries to be used to add include statements. Specifies
2891   * the path value of "<b>MedicationAdministration:patient</b>".
2892   */
2893  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MedicationAdministration:patient").toLocked();
2894
2895 /**
2896   * Search parameter: <b>date</b>
2897   * <p>
2898   * Description: <b>Multiple Resources: 
2899
2900* [MedicationAdministration](medicationadministration.html): Date administration happened (or did not happen)
2901</b><br>
2902   * Type: <b>date</b><br>
2903   * Path: <b>MedicationAdministration.occurence.as(dateTime) | MedicationAdministration.occurence.as(Period)</b><br>
2904   * </p>
2905   */
2906  @SearchParamDefinition(name="date", path="MedicationAdministration.occurence.as(dateTime) | MedicationAdministration.occurence.as(Period)", description="Multiple Resources: \r\n\r\n* [MedicationAdministration](medicationadministration.html): Date administration happened (or did not happen)\r\n", type="date" )
2907  public static final String SP_DATE = "date";
2908 /**
2909   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2910   * <p>
2911   * Description: <b>Multiple Resources: 
2912
2913* [MedicationAdministration](medicationadministration.html): Date administration happened (or did not happen)
2914</b><br>
2915   * Type: <b>date</b><br>
2916   * Path: <b>MedicationAdministration.occurence.as(dateTime) | MedicationAdministration.occurence.as(Period)</b><br>
2917   * </p>
2918   */
2919  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2920
2921 /**
2922   * Search parameter: <b>encounter</b>
2923   * <p>
2924   * Description: <b>Multiple Resources: 
2925
2926* [MedicationAdministration](medicationadministration.html): Return administrations that share this encounter
2927* [MedicationRequest](medicationrequest.html): Return prescriptions with this encounter identifier
2928</b><br>
2929   * Type: <b>reference</b><br>
2930   * Path: <b>MedicationAdministration.encounter | MedicationRequest.encounter</b><br>
2931   * </p>
2932   */
2933  @SearchParamDefinition(name="encounter", path="MedicationAdministration.encounter | MedicationRequest.encounter", description="Multiple Resources: \r\n\r\n* [MedicationAdministration](medicationadministration.html): Return administrations that share this encounter\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this encounter identifier\r\n", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Encounter") }, target={Encounter.class } )
2934  public static final String SP_ENCOUNTER = "encounter";
2935 /**
2936   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2937   * <p>
2938   * Description: <b>Multiple Resources: 
2939
2940* [MedicationAdministration](medicationadministration.html): Return administrations that share this encounter
2941* [MedicationRequest](medicationrequest.html): Return prescriptions with this encounter identifier
2942</b><br>
2943   * Type: <b>reference</b><br>
2944   * Path: <b>MedicationAdministration.encounter | MedicationRequest.encounter</b><br>
2945   * </p>
2946   */
2947  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
2948
2949/**
2950   * Constant for fluent queries to be used to add include statements. Specifies
2951   * the path value of "<b>MedicationAdministration:encounter</b>".
2952   */
2953  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("MedicationAdministration:encounter").toLocked();
2954
2955 /**
2956   * Search parameter: <b>medication</b>
2957   * <p>
2958   * Description: <b>Multiple Resources: 
2959
2960* [MedicationAdministration](medicationadministration.html): Return administrations of this medication reference
2961* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine resource
2962* [MedicationRequest](medicationrequest.html): Return prescriptions for this medication reference
2963* [MedicationUsage](medicationusage.html): Return statements of this medication reference
2964</b><br>
2965   * Type: <b>reference</b><br>
2966   * Path: <b>MedicationAdministration.medication.reference | MedicationDispense.medication.reference | MedicationRequest.medication.reference | MedicationUsage.medication.reference</b><br>
2967   * </p>
2968   */
2969  @SearchParamDefinition(name="medication", path="MedicationAdministration.medication.reference | MedicationDispense.medication.reference | MedicationRequest.medication.reference | MedicationUsage.medication.reference", description="Multiple Resources: \r\n\r\n* [MedicationAdministration](medicationadministration.html): Return administrations of this medication reference\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine resource\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions for this medication reference\r\n* [MedicationUsage](medicationusage.html): Return statements of this medication reference\r\n", type="reference" )
2970  public static final String SP_MEDICATION = "medication";
2971 /**
2972   * <b>Fluent Client</b> search parameter constant for <b>medication</b>
2973   * <p>
2974   * Description: <b>Multiple Resources: 
2975
2976* [MedicationAdministration](medicationadministration.html): Return administrations of this medication reference
2977* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine resource
2978* [MedicationRequest](medicationrequest.html): Return prescriptions for this medication reference
2979* [MedicationUsage](medicationusage.html): Return statements of this medication reference
2980</b><br>
2981   * Type: <b>reference</b><br>
2982   * Path: <b>MedicationAdministration.medication.reference | MedicationDispense.medication.reference | MedicationRequest.medication.reference | MedicationUsage.medication.reference</b><br>
2983   * </p>
2984   */
2985  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDICATION);
2986
2987/**
2988   * Constant for fluent queries to be used to add include statements. Specifies
2989   * the path value of "<b>MedicationAdministration:medication</b>".
2990   */
2991  public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("MedicationAdministration:medication").toLocked();
2992
2993 /**
2994   * Search parameter: <b>status</b>
2995   * <p>
2996   * Description: <b>Multiple Resources: 
2997
2998* [MedicationAdministration](medicationadministration.html): MedicationAdministration event status (for example one of active/paused/completed/nullified)
2999* [MedicationDispense](medicationdispense.html): Returns dispenses with a specified dispense status
3000* [MedicationRequest](medicationrequest.html): Status of the prescription
3001* [MedicationUsage](medicationusage.html): Return statements that match the given status
3002</b><br>
3003   * Type: <b>token</b><br>
3004   * Path: <b>MedicationAdministration.status | MedicationDispense.status | MedicationRequest.status | MedicationUsage.status</b><br>
3005   * </p>
3006   */
3007  @SearchParamDefinition(name="status", path="MedicationAdministration.status | MedicationDispense.status | MedicationRequest.status | MedicationUsage.status", description="Multiple Resources: \r\n\r\n* [MedicationAdministration](medicationadministration.html): MedicationAdministration event status (for example one of active/paused/completed/nullified)\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with a specified dispense status\r\n* [MedicationRequest](medicationrequest.html): Status of the prescription\r\n* [MedicationUsage](medicationusage.html): Return statements that match the given status\r\n", type="token" )
3008  public static final String SP_STATUS = "status";
3009 /**
3010   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3011   * <p>
3012   * Description: <b>Multiple Resources: 
3013
3014* [MedicationAdministration](medicationadministration.html): MedicationAdministration event status (for example one of active/paused/completed/nullified)
3015* [MedicationDispense](medicationdispense.html): Returns dispenses with a specified dispense status
3016* [MedicationRequest](medicationrequest.html): Status of the prescription
3017* [MedicationUsage](medicationusage.html): Return statements that match the given status
3018</b><br>
3019   * Type: <b>token</b><br>
3020   * Path: <b>MedicationAdministration.status | MedicationDispense.status | MedicationRequest.status | MedicationUsage.status</b><br>
3021   * </p>
3022   */
3023  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3024
3025
3026}