001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * 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. This event can also be used to record waste using a status of not-done and the appropriate statusReason.
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 = {CodeableReference.class}, order=2, min=1, max=1, modifier=false, summary=true)
246        @Description(shortDefinition="Who or what performed the medication administration", formalDefinition="Indicates who or what performed the medication administration." )
247        protected CodeableReference actor;
248
249        private static final long serialVersionUID = -1725418144L;
250
251    /**
252     * Constructor
253     */
254      public MedicationAdministrationPerformerComponent() {
255        super();
256      }
257
258    /**
259     * Constructor
260     */
261      public MedicationAdministrationPerformerComponent(CodeableReference 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 CodeableReference 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 CodeableReference(); // 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(CodeableReference 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", "CodeableReference(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", "CodeableReference(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}; // CodeableReference
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.castToCodeableReference(value); // CodeableReference
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.castToCodeableReference(value); // CodeableReference
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[] {"CodeableReference"};
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 CodeableReference();
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 FHIRException("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 singleton property 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, MedicationDispense.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, Timing.class}, order=10, min=1, max=1, modifier=false, summary=true)
980    @Description(shortDefinition="Specific date/time or interval of time during which the administration took place (or did not take place)", 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     * The performer of the medication treatment.  For devices this is the device that performed 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="The performer of the medication treatment.  For devices this is the device that performed 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 that is to be used for the administration of the medication (for example, PCA Pump).
1029     */
1030    @Child(name = "device", type = {CodeableReference.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1031    @Description(shortDefinition="Device used to administer", formalDefinition="The device that is to be used for the administration of the medication (for example, PCA Pump)." )
1032    protected List<CodeableReference> 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 = 296165909L;
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    /**
1548     * @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.)
1549     */
1550    public Timing getOccurenceTiming() throws FHIRException { 
1551      if (this.occurence == null)
1552        this.occurence = new Timing();
1553      if (!(this.occurence instanceof Timing))
1554        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.occurence.getClass().getName()+" was encountered");
1555      return (Timing) this.occurence;
1556    }
1557
1558    public boolean hasOccurenceTiming() { 
1559      return this != null && this.occurence instanceof Timing;
1560    }
1561
1562    public boolean hasOccurence() { 
1563      return this.occurence != null && !this.occurence.isEmpty();
1564    }
1565
1566    /**
1567     * @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.)
1568     */
1569    public MedicationAdministration setOccurence(DataType value) { 
1570      if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof Timing))
1571        throw new FHIRException("Not the right type for MedicationAdministration.occurence[x]: "+value.fhirType());
1572      this.occurence = value;
1573      return this;
1574    }
1575
1576    /**
1577     * @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
1578     */
1579    public DateTimeType getRecordedElement() { 
1580      if (this.recorded == null)
1581        if (Configuration.errorOnAutoCreate())
1582          throw new Error("Attempt to auto-create MedicationAdministration.recorded");
1583        else if (Configuration.doAutoCreate())
1584          this.recorded = new DateTimeType(); // bb
1585      return this.recorded;
1586    }
1587
1588    public boolean hasRecordedElement() { 
1589      return this.recorded != null && !this.recorded.isEmpty();
1590    }
1591
1592    public boolean hasRecorded() { 
1593      return this.recorded != null && !this.recorded.isEmpty();
1594    }
1595
1596    /**
1597     * @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
1598     */
1599    public MedicationAdministration setRecordedElement(DateTimeType value) { 
1600      this.recorded = value;
1601      return this;
1602    }
1603
1604    /**
1605     * @return The date the occurrence of the  MedicationAdministration was first captured in the record - potentially significantly after the occurrence of the event.
1606     */
1607    public Date getRecorded() { 
1608      return this.recorded == null ? null : this.recorded.getValue();
1609    }
1610
1611    /**
1612     * @param value The date the occurrence of the  MedicationAdministration was first captured in the record - potentially significantly after the occurrence of the event.
1613     */
1614    public MedicationAdministration setRecorded(Date value) { 
1615      if (value == null)
1616        this.recorded = null;
1617      else {
1618        if (this.recorded == null)
1619          this.recorded = new DateTimeType();
1620        this.recorded.setValue(value);
1621      }
1622      return this;
1623    }
1624
1625    /**
1626     * @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
1627     */
1628    public BooleanType getIsSubPotentElement() { 
1629      if (this.isSubPotent == null)
1630        if (Configuration.errorOnAutoCreate())
1631          throw new Error("Attempt to auto-create MedicationAdministration.isSubPotent");
1632        else if (Configuration.doAutoCreate())
1633          this.isSubPotent = new BooleanType(); // bb
1634      return this.isSubPotent;
1635    }
1636
1637    public boolean hasIsSubPotentElement() { 
1638      return this.isSubPotent != null && !this.isSubPotent.isEmpty();
1639    }
1640
1641    public boolean hasIsSubPotent() { 
1642      return this.isSubPotent != null && !this.isSubPotent.isEmpty();
1643    }
1644
1645    /**
1646     * @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
1647     */
1648    public MedicationAdministration setIsSubPotentElement(BooleanType value) { 
1649      this.isSubPotent = value;
1650      return this;
1651    }
1652
1653    /**
1654     * @return An indication that the full dose was not administered.
1655     */
1656    public boolean getIsSubPotent() { 
1657      return this.isSubPotent == null || this.isSubPotent.isEmpty() ? false : this.isSubPotent.getValue();
1658    }
1659
1660    /**
1661     * @param value An indication that the full dose was not administered.
1662     */
1663    public MedicationAdministration setIsSubPotent(boolean value) { 
1664        if (this.isSubPotent == null)
1665          this.isSubPotent = new BooleanType();
1666        this.isSubPotent.setValue(value);
1667      return this;
1668    }
1669
1670    /**
1671     * @return {@link #subPotentReason} (The reason or reasons why the full dose was not administered.)
1672     */
1673    public List<CodeableConcept> getSubPotentReason() { 
1674      if (this.subPotentReason == null)
1675        this.subPotentReason = new ArrayList<CodeableConcept>();
1676      return this.subPotentReason;
1677    }
1678
1679    /**
1680     * @return Returns a reference to <code>this</code> for easy method chaining
1681     */
1682    public MedicationAdministration setSubPotentReason(List<CodeableConcept> theSubPotentReason) { 
1683      this.subPotentReason = theSubPotentReason;
1684      return this;
1685    }
1686
1687    public boolean hasSubPotentReason() { 
1688      if (this.subPotentReason == null)
1689        return false;
1690      for (CodeableConcept item : this.subPotentReason)
1691        if (!item.isEmpty())
1692          return true;
1693      return false;
1694    }
1695
1696    public CodeableConcept addSubPotentReason() { //3
1697      CodeableConcept t = new CodeableConcept();
1698      if (this.subPotentReason == null)
1699        this.subPotentReason = new ArrayList<CodeableConcept>();
1700      this.subPotentReason.add(t);
1701      return t;
1702    }
1703
1704    public MedicationAdministration addSubPotentReason(CodeableConcept t) { //3
1705      if (t == null)
1706        return this;
1707      if (this.subPotentReason == null)
1708        this.subPotentReason = new ArrayList<CodeableConcept>();
1709      this.subPotentReason.add(t);
1710      return this;
1711    }
1712
1713    /**
1714     * @return The first repetition of repeating field {@link #subPotentReason}, creating it if it does not already exist {3}
1715     */
1716    public CodeableConcept getSubPotentReasonFirstRep() { 
1717      if (getSubPotentReason().isEmpty()) {
1718        addSubPotentReason();
1719      }
1720      return getSubPotentReason().get(0);
1721    }
1722
1723    /**
1724     * @return {@link #performer} (The performer of the medication treatment.  For devices this is the device that performed 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.)
1725     */
1726    public List<MedicationAdministrationPerformerComponent> getPerformer() { 
1727      if (this.performer == null)
1728        this.performer = new ArrayList<MedicationAdministrationPerformerComponent>();
1729      return this.performer;
1730    }
1731
1732    /**
1733     * @return Returns a reference to <code>this</code> for easy method chaining
1734     */
1735    public MedicationAdministration setPerformer(List<MedicationAdministrationPerformerComponent> thePerformer) { 
1736      this.performer = thePerformer;
1737      return this;
1738    }
1739
1740    public boolean hasPerformer() { 
1741      if (this.performer == null)
1742        return false;
1743      for (MedicationAdministrationPerformerComponent item : this.performer)
1744        if (!item.isEmpty())
1745          return true;
1746      return false;
1747    }
1748
1749    public MedicationAdministrationPerformerComponent addPerformer() { //3
1750      MedicationAdministrationPerformerComponent t = new MedicationAdministrationPerformerComponent();
1751      if (this.performer == null)
1752        this.performer = new ArrayList<MedicationAdministrationPerformerComponent>();
1753      this.performer.add(t);
1754      return t;
1755    }
1756
1757    public MedicationAdministration addPerformer(MedicationAdministrationPerformerComponent t) { //3
1758      if (t == null)
1759        return this;
1760      if (this.performer == null)
1761        this.performer = new ArrayList<MedicationAdministrationPerformerComponent>();
1762      this.performer.add(t);
1763      return this;
1764    }
1765
1766    /**
1767     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist {3}
1768     */
1769    public MedicationAdministrationPerformerComponent getPerformerFirstRep() { 
1770      if (getPerformer().isEmpty()) {
1771        addPerformer();
1772      }
1773      return getPerformer().get(0);
1774    }
1775
1776    /**
1777     * @return {@link #reason} (A code, Condition or observation that supports why the medication was administered.)
1778     */
1779    public List<CodeableReference> getReason() { 
1780      if (this.reason == null)
1781        this.reason = new ArrayList<CodeableReference>();
1782      return this.reason;
1783    }
1784
1785    /**
1786     * @return Returns a reference to <code>this</code> for easy method chaining
1787     */
1788    public MedicationAdministration setReason(List<CodeableReference> theReason) { 
1789      this.reason = theReason;
1790      return this;
1791    }
1792
1793    public boolean hasReason() { 
1794      if (this.reason == null)
1795        return false;
1796      for (CodeableReference item : this.reason)
1797        if (!item.isEmpty())
1798          return true;
1799      return false;
1800    }
1801
1802    public CodeableReference addReason() { //3
1803      CodeableReference t = new CodeableReference();
1804      if (this.reason == null)
1805        this.reason = new ArrayList<CodeableReference>();
1806      this.reason.add(t);
1807      return t;
1808    }
1809
1810    public MedicationAdministration addReason(CodeableReference t) { //3
1811      if (t == null)
1812        return this;
1813      if (this.reason == null)
1814        this.reason = new ArrayList<CodeableReference>();
1815      this.reason.add(t);
1816      return this;
1817    }
1818
1819    /**
1820     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
1821     */
1822    public CodeableReference getReasonFirstRep() { 
1823      if (getReason().isEmpty()) {
1824        addReason();
1825      }
1826      return getReason().get(0);
1827    }
1828
1829    /**
1830     * @return {@link #request} (The original request, instruction or authority to perform the administration.)
1831     */
1832    public Reference getRequest() { 
1833      if (this.request == null)
1834        if (Configuration.errorOnAutoCreate())
1835          throw new Error("Attempt to auto-create MedicationAdministration.request");
1836        else if (Configuration.doAutoCreate())
1837          this.request = new Reference(); // cc
1838      return this.request;
1839    }
1840
1841    public boolean hasRequest() { 
1842      return this.request != null && !this.request.isEmpty();
1843    }
1844
1845    /**
1846     * @param value {@link #request} (The original request, instruction or authority to perform the administration.)
1847     */
1848    public MedicationAdministration setRequest(Reference value) { 
1849      this.request = value;
1850      return this;
1851    }
1852
1853    /**
1854     * @return {@link #device} (The device that is to be used for the administration of the medication (for example, PCA Pump).)
1855     */
1856    public List<CodeableReference> getDevice() { 
1857      if (this.device == null)
1858        this.device = new ArrayList<CodeableReference>();
1859      return this.device;
1860    }
1861
1862    /**
1863     * @return Returns a reference to <code>this</code> for easy method chaining
1864     */
1865    public MedicationAdministration setDevice(List<CodeableReference> theDevice) { 
1866      this.device = theDevice;
1867      return this;
1868    }
1869
1870    public boolean hasDevice() { 
1871      if (this.device == null)
1872        return false;
1873      for (CodeableReference item : this.device)
1874        if (!item.isEmpty())
1875          return true;
1876      return false;
1877    }
1878
1879    public CodeableReference addDevice() { //3
1880      CodeableReference t = new CodeableReference();
1881      if (this.device == null)
1882        this.device = new ArrayList<CodeableReference>();
1883      this.device.add(t);
1884      return t;
1885    }
1886
1887    public MedicationAdministration addDevice(CodeableReference t) { //3
1888      if (t == null)
1889        return this;
1890      if (this.device == null)
1891        this.device = new ArrayList<CodeableReference>();
1892      this.device.add(t);
1893      return this;
1894    }
1895
1896    /**
1897     * @return The first repetition of repeating field {@link #device}, creating it if it does not already exist {3}
1898     */
1899    public CodeableReference getDeviceFirstRep() { 
1900      if (getDevice().isEmpty()) {
1901        addDevice();
1902      }
1903      return getDevice().get(0);
1904    }
1905
1906    /**
1907     * @return {@link #note} (Extra information about the medication administration that is not conveyed by the other attributes.)
1908     */
1909    public List<Annotation> getNote() { 
1910      if (this.note == null)
1911        this.note = new ArrayList<Annotation>();
1912      return this.note;
1913    }
1914
1915    /**
1916     * @return Returns a reference to <code>this</code> for easy method chaining
1917     */
1918    public MedicationAdministration setNote(List<Annotation> theNote) { 
1919      this.note = theNote;
1920      return this;
1921    }
1922
1923    public boolean hasNote() { 
1924      if (this.note == null)
1925        return false;
1926      for (Annotation item : this.note)
1927        if (!item.isEmpty())
1928          return true;
1929      return false;
1930    }
1931
1932    public Annotation addNote() { //3
1933      Annotation t = new Annotation();
1934      if (this.note == null)
1935        this.note = new ArrayList<Annotation>();
1936      this.note.add(t);
1937      return t;
1938    }
1939
1940    public MedicationAdministration addNote(Annotation t) { //3
1941      if (t == null)
1942        return this;
1943      if (this.note == null)
1944        this.note = new ArrayList<Annotation>();
1945      this.note.add(t);
1946      return this;
1947    }
1948
1949    /**
1950     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
1951     */
1952    public Annotation getNoteFirstRep() { 
1953      if (getNote().isEmpty()) {
1954        addNote();
1955      }
1956      return getNote().get(0);
1957    }
1958
1959    /**
1960     * @return {@link #dosage} (Describes the medication dosage information details e.g. dose, rate, site, route, etc.)
1961     */
1962    public MedicationAdministrationDosageComponent getDosage() { 
1963      if (this.dosage == null)
1964        if (Configuration.errorOnAutoCreate())
1965          throw new Error("Attempt to auto-create MedicationAdministration.dosage");
1966        else if (Configuration.doAutoCreate())
1967          this.dosage = new MedicationAdministrationDosageComponent(); // cc
1968      return this.dosage;
1969    }
1970
1971    public boolean hasDosage() { 
1972      return this.dosage != null && !this.dosage.isEmpty();
1973    }
1974
1975    /**
1976     * @param value {@link #dosage} (Describes the medication dosage information details e.g. dose, rate, site, route, etc.)
1977     */
1978    public MedicationAdministration setDosage(MedicationAdministrationDosageComponent value) { 
1979      this.dosage = value;
1980      return this;
1981    }
1982
1983    /**
1984     * @return {@link #eventHistory} (A summary of the events of interest that have occurred, such as when the administration was verified.)
1985     */
1986    public List<Reference> getEventHistory() { 
1987      if (this.eventHistory == null)
1988        this.eventHistory = new ArrayList<Reference>();
1989      return this.eventHistory;
1990    }
1991
1992    /**
1993     * @return Returns a reference to <code>this</code> for easy method chaining
1994     */
1995    public MedicationAdministration setEventHistory(List<Reference> theEventHistory) { 
1996      this.eventHistory = theEventHistory;
1997      return this;
1998    }
1999
2000    public boolean hasEventHistory() { 
2001      if (this.eventHistory == null)
2002        return false;
2003      for (Reference item : this.eventHistory)
2004        if (!item.isEmpty())
2005          return true;
2006      return false;
2007    }
2008
2009    public Reference addEventHistory() { //3
2010      Reference t = new Reference();
2011      if (this.eventHistory == null)
2012        this.eventHistory = new ArrayList<Reference>();
2013      this.eventHistory.add(t);
2014      return t;
2015    }
2016
2017    public MedicationAdministration addEventHistory(Reference t) { //3
2018      if (t == null)
2019        return this;
2020      if (this.eventHistory == null)
2021        this.eventHistory = new ArrayList<Reference>();
2022      this.eventHistory.add(t);
2023      return this;
2024    }
2025
2026    /**
2027     * @return The first repetition of repeating field {@link #eventHistory}, creating it if it does not already exist {3}
2028     */
2029    public Reference getEventHistoryFirstRep() { 
2030      if (getEventHistory().isEmpty()) {
2031        addEventHistory();
2032      }
2033      return getEventHistory().get(0);
2034    }
2035
2036      protected void listChildren(List<Property> children) {
2037        super.listChildren(children);
2038        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));
2039        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));
2040        children.add(new Property("partOf", "Reference(MedicationAdministration|Procedure|MedicationDispense)", "A larger event of which this particular event is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf));
2041        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));
2042        children.add(new Property("statusReason", "CodeableConcept", "A code indicating why the administration was not performed.", 0, java.lang.Integer.MAX_VALUE, statusReason));
2043        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));
2044        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));
2045        children.add(new Property("subject", "Reference(Patient|Group)", "The person or animal or group receiving the medication.", 0, 1, subject));
2046        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));
2047        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));
2048        children.add(new Property("occurence[x]", "dateTime|Period|Timing", "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));
2049        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));
2050        children.add(new Property("isSubPotent", "boolean", "An indication that the full dose was not administered.", 0, 1, isSubPotent));
2051        children.add(new Property("subPotentReason", "CodeableConcept", "The reason or reasons why the full dose was not administered.", 0, java.lang.Integer.MAX_VALUE, subPotentReason));
2052        children.add(new Property("performer", "", "The performer of the medication treatment.  For devices this is the device that performed 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));
2053        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));
2054        children.add(new Property("request", "Reference(MedicationRequest)", "The original request, instruction or authority to perform the administration.", 0, 1, request));
2055        children.add(new Property("device", "CodeableReference(Device)", "The device that is to be used for the administration of the medication (for example, PCA Pump).", 0, java.lang.Integer.MAX_VALUE, device));
2056        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));
2057        children.add(new Property("dosage", "", "Describes the medication dosage information details e.g. dose, rate, site, route, etc.", 0, 1, dosage));
2058        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));
2059      }
2060
2061      @Override
2062      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2063        switch (_hash) {
2064        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);
2065        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);
2066        case -995410646: /*partOf*/  return new Property("partOf", "Reference(MedicationAdministration|Procedure|MedicationDispense)", "A larger event of which this particular event is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf);
2067        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);
2068        case 2051346646: /*statusReason*/  return new Property("statusReason", "CodeableConcept", "A code indicating why the administration was not performed.", 0, java.lang.Integer.MAX_VALUE, statusReason);
2069        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);
2070        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);
2071        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "The person or animal or group receiving the medication.", 0, 1, subject);
2072        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);
2073        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);
2074        case 144188521: /*occurence[x]*/  return new Property("occurence[x]", "dateTime|Period|Timing", "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);
2075        case -1192857417: /*occurence*/  return new Property("occurence[x]", "dateTime|Period|Timing", "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);
2076        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);
2077        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);
2078        case 339257313: /*occurenceTiming*/  return new Property("occurence[x]", "Timing", "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);
2079        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);
2080        case 702379724: /*isSubPotent*/  return new Property("isSubPotent", "boolean", "An indication that the full dose was not administered.", 0, 1, isSubPotent);
2081        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);
2082        case 481140686: /*performer*/  return new Property("performer", "", "The performer of the medication treatment.  For devices this is the device that performed 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);
2083        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);
2084        case 1095692943: /*request*/  return new Property("request", "Reference(MedicationRequest)", "The original request, instruction or authority to perform the administration.", 0, 1, request);
2085        case -1335157162: /*device*/  return new Property("device", "CodeableReference(Device)", "The device that is to be used for the administration of the medication (for example, PCA Pump).", 0, java.lang.Integer.MAX_VALUE, device);
2086        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);
2087        case -1326018889: /*dosage*/  return new Property("dosage", "", "Describes the medication dosage information details e.g. dose, rate, site, route, etc.", 0, 1, dosage);
2088        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);
2089        default: return super.getNamedProperty(_hash, _name, _checkValid);
2090        }
2091
2092      }
2093
2094      @Override
2095      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2096        switch (hash) {
2097        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2098        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2099        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
2100        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<MedicationAdministrationStatusCodes>
2101        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : this.statusReason.toArray(new Base[this.statusReason.size()]); // CodeableConcept
2102        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2103        case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // CodeableReference
2104        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2105        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
2106        case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference
2107        case -1192857417: /*occurence*/ return this.occurence == null ? new Base[0] : new Base[] {this.occurence}; // DataType
2108        case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // DateTimeType
2109        case 702379724: /*isSubPotent*/ return this.isSubPotent == null ? new Base[0] : new Base[] {this.isSubPotent}; // BooleanType
2110        case 969489082: /*subPotentReason*/ return this.subPotentReason == null ? new Base[0] : this.subPotentReason.toArray(new Base[this.subPotentReason.size()]); // CodeableConcept
2111        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // MedicationAdministrationPerformerComponent
2112        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableReference
2113        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
2114        case -1335157162: /*device*/ return this.device == null ? new Base[0] : this.device.toArray(new Base[this.device.size()]); // CodeableReference
2115        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2116        case -1326018889: /*dosage*/ return this.dosage == null ? new Base[0] : new Base[] {this.dosage}; // MedicationAdministrationDosageComponent
2117        case 1835190426: /*eventHistory*/ return this.eventHistory == null ? new Base[0] : this.eventHistory.toArray(new Base[this.eventHistory.size()]); // Reference
2118        default: return super.getProperty(hash, name, checkValid);
2119        }
2120
2121      }
2122
2123      @Override
2124      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2125        switch (hash) {
2126        case -1618432855: // identifier
2127          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2128          return value;
2129        case -332612366: // basedOn
2130          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
2131          return value;
2132        case -995410646: // partOf
2133          this.getPartOf().add(TypeConvertor.castToReference(value)); // Reference
2134          return value;
2135        case -892481550: // status
2136          value = new MedicationAdministrationStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2137          this.status = (Enumeration) value; // Enumeration<MedicationAdministrationStatusCodes>
2138          return value;
2139        case 2051346646: // statusReason
2140          this.getStatusReason().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2141          return value;
2142        case 50511102: // category
2143          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2144          return value;
2145        case 1998965455: // medication
2146          this.medication = TypeConvertor.castToCodeableReference(value); // CodeableReference
2147          return value;
2148        case -1867885268: // subject
2149          this.subject = TypeConvertor.castToReference(value); // Reference
2150          return value;
2151        case 1524132147: // encounter
2152          this.encounter = TypeConvertor.castToReference(value); // Reference
2153          return value;
2154        case -1248768647: // supportingInformation
2155          this.getSupportingInformation().add(TypeConvertor.castToReference(value)); // Reference
2156          return value;
2157        case -1192857417: // occurence
2158          this.occurence = TypeConvertor.castToType(value); // DataType
2159          return value;
2160        case -799233872: // recorded
2161          this.recorded = TypeConvertor.castToDateTime(value); // DateTimeType
2162          return value;
2163        case 702379724: // isSubPotent
2164          this.isSubPotent = TypeConvertor.castToBoolean(value); // BooleanType
2165          return value;
2166        case 969489082: // subPotentReason
2167          this.getSubPotentReason().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2168          return value;
2169        case 481140686: // performer
2170          this.getPerformer().add((MedicationAdministrationPerformerComponent) value); // MedicationAdministrationPerformerComponent
2171          return value;
2172        case -934964668: // reason
2173          this.getReason().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
2174          return value;
2175        case 1095692943: // request
2176          this.request = TypeConvertor.castToReference(value); // Reference
2177          return value;
2178        case -1335157162: // device
2179          this.getDevice().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
2180          return value;
2181        case 3387378: // note
2182          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
2183          return value;
2184        case -1326018889: // dosage
2185          this.dosage = (MedicationAdministrationDosageComponent) value; // MedicationAdministrationDosageComponent
2186          return value;
2187        case 1835190426: // eventHistory
2188          this.getEventHistory().add(TypeConvertor.castToReference(value)); // Reference
2189          return value;
2190        default: return super.setProperty(hash, name, value);
2191        }
2192
2193      }
2194
2195      @Override
2196      public Base setProperty(String name, Base value) throws FHIRException {
2197        if (name.equals("identifier")) {
2198          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2199        } else if (name.equals("basedOn")) {
2200          this.getBasedOn().add(TypeConvertor.castToReference(value));
2201        } else if (name.equals("partOf")) {
2202          this.getPartOf().add(TypeConvertor.castToReference(value));
2203        } else if (name.equals("status")) {
2204          value = new MedicationAdministrationStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2205          this.status = (Enumeration) value; // Enumeration<MedicationAdministrationStatusCodes>
2206        } else if (name.equals("statusReason")) {
2207          this.getStatusReason().add(TypeConvertor.castToCodeableConcept(value));
2208        } else if (name.equals("category")) {
2209          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
2210        } else if (name.equals("medication")) {
2211          this.medication = TypeConvertor.castToCodeableReference(value); // CodeableReference
2212        } else if (name.equals("subject")) {
2213          this.subject = TypeConvertor.castToReference(value); // Reference
2214        } else if (name.equals("encounter")) {
2215          this.encounter = TypeConvertor.castToReference(value); // Reference
2216        } else if (name.equals("supportingInformation")) {
2217          this.getSupportingInformation().add(TypeConvertor.castToReference(value));
2218        } else if (name.equals("occurence[x]")) {
2219          this.occurence = TypeConvertor.castToType(value); // DataType
2220        } else if (name.equals("recorded")) {
2221          this.recorded = TypeConvertor.castToDateTime(value); // DateTimeType
2222        } else if (name.equals("isSubPotent")) {
2223          this.isSubPotent = TypeConvertor.castToBoolean(value); // BooleanType
2224        } else if (name.equals("subPotentReason")) {
2225          this.getSubPotentReason().add(TypeConvertor.castToCodeableConcept(value));
2226        } else if (name.equals("performer")) {
2227          this.getPerformer().add((MedicationAdministrationPerformerComponent) value);
2228        } else if (name.equals("reason")) {
2229          this.getReason().add(TypeConvertor.castToCodeableReference(value));
2230        } else if (name.equals("request")) {
2231          this.request = TypeConvertor.castToReference(value); // Reference
2232        } else if (name.equals("device")) {
2233          this.getDevice().add(TypeConvertor.castToCodeableReference(value));
2234        } else if (name.equals("note")) {
2235          this.getNote().add(TypeConvertor.castToAnnotation(value));
2236        } else if (name.equals("dosage")) {
2237          this.dosage = (MedicationAdministrationDosageComponent) value; // MedicationAdministrationDosageComponent
2238        } else if (name.equals("eventHistory")) {
2239          this.getEventHistory().add(TypeConvertor.castToReference(value));
2240        } else
2241          return super.setProperty(name, value);
2242        return value;
2243      }
2244
2245      @Override
2246      public Base makeProperty(int hash, String name) throws FHIRException {
2247        switch (hash) {
2248        case -1618432855:  return addIdentifier(); 
2249        case -332612366:  return addBasedOn(); 
2250        case -995410646:  return addPartOf(); 
2251        case -892481550:  return getStatusElement();
2252        case 2051346646:  return addStatusReason(); 
2253        case 50511102:  return addCategory(); 
2254        case 1998965455:  return getMedication();
2255        case -1867885268:  return getSubject();
2256        case 1524132147:  return getEncounter();
2257        case -1248768647:  return addSupportingInformation(); 
2258        case 144188521:  return getOccurence();
2259        case -1192857417:  return getOccurence();
2260        case -799233872:  return getRecordedElement();
2261        case 702379724:  return getIsSubPotentElement();
2262        case 969489082:  return addSubPotentReason(); 
2263        case 481140686:  return addPerformer(); 
2264        case -934964668:  return addReason(); 
2265        case 1095692943:  return getRequest();
2266        case -1335157162:  return addDevice(); 
2267        case 3387378:  return addNote(); 
2268        case -1326018889:  return getDosage();
2269        case 1835190426:  return addEventHistory(); 
2270        default: return super.makeProperty(hash, name);
2271        }
2272
2273      }
2274
2275      @Override
2276      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2277        switch (hash) {
2278        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2279        case -332612366: /*basedOn*/ return new String[] {"Reference"};
2280        case -995410646: /*partOf*/ return new String[] {"Reference"};
2281        case -892481550: /*status*/ return new String[] {"code"};
2282        case 2051346646: /*statusReason*/ return new String[] {"CodeableConcept"};
2283        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2284        case 1998965455: /*medication*/ return new String[] {"CodeableReference"};
2285        case -1867885268: /*subject*/ return new String[] {"Reference"};
2286        case 1524132147: /*encounter*/ return new String[] {"Reference"};
2287        case -1248768647: /*supportingInformation*/ return new String[] {"Reference"};
2288        case -1192857417: /*occurence*/ return new String[] {"dateTime", "Period", "Timing"};
2289        case -799233872: /*recorded*/ return new String[] {"dateTime"};
2290        case 702379724: /*isSubPotent*/ return new String[] {"boolean"};
2291        case 969489082: /*subPotentReason*/ return new String[] {"CodeableConcept"};
2292        case 481140686: /*performer*/ return new String[] {};
2293        case -934964668: /*reason*/ return new String[] {"CodeableReference"};
2294        case 1095692943: /*request*/ return new String[] {"Reference"};
2295        case -1335157162: /*device*/ return new String[] {"CodeableReference"};
2296        case 3387378: /*note*/ return new String[] {"Annotation"};
2297        case -1326018889: /*dosage*/ return new String[] {};
2298        case 1835190426: /*eventHistory*/ return new String[] {"Reference"};
2299        default: return super.getTypesForProperty(hash, name);
2300        }
2301
2302      }
2303
2304      @Override
2305      public Base addChild(String name) throws FHIRException {
2306        if (name.equals("identifier")) {
2307          return addIdentifier();
2308        }
2309        else if (name.equals("basedOn")) {
2310          return addBasedOn();
2311        }
2312        else if (name.equals("partOf")) {
2313          return addPartOf();
2314        }
2315        else if (name.equals("status")) {
2316          throw new FHIRException("Cannot call addChild on a singleton property MedicationAdministration.status");
2317        }
2318        else if (name.equals("statusReason")) {
2319          return addStatusReason();
2320        }
2321        else if (name.equals("category")) {
2322          return addCategory();
2323        }
2324        else if (name.equals("medication")) {
2325          this.medication = new CodeableReference();
2326          return this.medication;
2327        }
2328        else if (name.equals("subject")) {
2329          this.subject = new Reference();
2330          return this.subject;
2331        }
2332        else if (name.equals("encounter")) {
2333          this.encounter = new Reference();
2334          return this.encounter;
2335        }
2336        else if (name.equals("supportingInformation")) {
2337          return addSupportingInformation();
2338        }
2339        else if (name.equals("occurenceDateTime")) {
2340          this.occurence = new DateTimeType();
2341          return this.occurence;
2342        }
2343        else if (name.equals("occurencePeriod")) {
2344          this.occurence = new Period();
2345          return this.occurence;
2346        }
2347        else if (name.equals("occurenceTiming")) {
2348          this.occurence = new Timing();
2349          return this.occurence;
2350        }
2351        else if (name.equals("recorded")) {
2352          throw new FHIRException("Cannot call addChild on a singleton property MedicationAdministration.recorded");
2353        }
2354        else if (name.equals("isSubPotent")) {
2355          throw new FHIRException("Cannot call addChild on a singleton property MedicationAdministration.isSubPotent");
2356        }
2357        else if (name.equals("subPotentReason")) {
2358          return addSubPotentReason();
2359        }
2360        else if (name.equals("performer")) {
2361          return addPerformer();
2362        }
2363        else if (name.equals("reason")) {
2364          return addReason();
2365        }
2366        else if (name.equals("request")) {
2367          this.request = new Reference();
2368          return this.request;
2369        }
2370        else if (name.equals("device")) {
2371          return addDevice();
2372        }
2373        else if (name.equals("note")) {
2374          return addNote();
2375        }
2376        else if (name.equals("dosage")) {
2377          this.dosage = new MedicationAdministrationDosageComponent();
2378          return this.dosage;
2379        }
2380        else if (name.equals("eventHistory")) {
2381          return addEventHistory();
2382        }
2383        else
2384          return super.addChild(name);
2385      }
2386
2387  public String fhirType() {
2388    return "MedicationAdministration";
2389
2390  }
2391
2392      public MedicationAdministration copy() {
2393        MedicationAdministration dst = new MedicationAdministration();
2394        copyValues(dst);
2395        return dst;
2396      }
2397
2398      public void copyValues(MedicationAdministration dst) {
2399        super.copyValues(dst);
2400        if (identifier != null) {
2401          dst.identifier = new ArrayList<Identifier>();
2402          for (Identifier i : identifier)
2403            dst.identifier.add(i.copy());
2404        };
2405        if (basedOn != null) {
2406          dst.basedOn = new ArrayList<Reference>();
2407          for (Reference i : basedOn)
2408            dst.basedOn.add(i.copy());
2409        };
2410        if (partOf != null) {
2411          dst.partOf = new ArrayList<Reference>();
2412          for (Reference i : partOf)
2413            dst.partOf.add(i.copy());
2414        };
2415        dst.status = status == null ? null : status.copy();
2416        if (statusReason != null) {
2417          dst.statusReason = new ArrayList<CodeableConcept>();
2418          for (CodeableConcept i : statusReason)
2419            dst.statusReason.add(i.copy());
2420        };
2421        if (category != null) {
2422          dst.category = new ArrayList<CodeableConcept>();
2423          for (CodeableConcept i : category)
2424            dst.category.add(i.copy());
2425        };
2426        dst.medication = medication == null ? null : medication.copy();
2427        dst.subject = subject == null ? null : subject.copy();
2428        dst.encounter = encounter == null ? null : encounter.copy();
2429        if (supportingInformation != null) {
2430          dst.supportingInformation = new ArrayList<Reference>();
2431          for (Reference i : supportingInformation)
2432            dst.supportingInformation.add(i.copy());
2433        };
2434        dst.occurence = occurence == null ? null : occurence.copy();
2435        dst.recorded = recorded == null ? null : recorded.copy();
2436        dst.isSubPotent = isSubPotent == null ? null : isSubPotent.copy();
2437        if (subPotentReason != null) {
2438          dst.subPotentReason = new ArrayList<CodeableConcept>();
2439          for (CodeableConcept i : subPotentReason)
2440            dst.subPotentReason.add(i.copy());
2441        };
2442        if (performer != null) {
2443          dst.performer = new ArrayList<MedicationAdministrationPerformerComponent>();
2444          for (MedicationAdministrationPerformerComponent i : performer)
2445            dst.performer.add(i.copy());
2446        };
2447        if (reason != null) {
2448          dst.reason = new ArrayList<CodeableReference>();
2449          for (CodeableReference i : reason)
2450            dst.reason.add(i.copy());
2451        };
2452        dst.request = request == null ? null : request.copy();
2453        if (device != null) {
2454          dst.device = new ArrayList<CodeableReference>();
2455          for (CodeableReference i : device)
2456            dst.device.add(i.copy());
2457        };
2458        if (note != null) {
2459          dst.note = new ArrayList<Annotation>();
2460          for (Annotation i : note)
2461            dst.note.add(i.copy());
2462        };
2463        dst.dosage = dosage == null ? null : dosage.copy();
2464        if (eventHistory != null) {
2465          dst.eventHistory = new ArrayList<Reference>();
2466          for (Reference i : eventHistory)
2467            dst.eventHistory.add(i.copy());
2468        };
2469      }
2470
2471      protected MedicationAdministration typedCopy() {
2472        return copy();
2473      }
2474
2475      @Override
2476      public boolean equalsDeep(Base other_) {
2477        if (!super.equalsDeep(other_))
2478          return false;
2479        if (!(other_ instanceof MedicationAdministration))
2480          return false;
2481        MedicationAdministration o = (MedicationAdministration) other_;
2482        return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(partOf, o.partOf, true)
2483           && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true) && compareDeep(category, o.category, true)
2484           && compareDeep(medication, o.medication, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true)
2485           && compareDeep(supportingInformation, o.supportingInformation, true) && compareDeep(occurence, o.occurence, true)
2486           && compareDeep(recorded, o.recorded, true) && compareDeep(isSubPotent, o.isSubPotent, true) && compareDeep(subPotentReason, o.subPotentReason, true)
2487           && compareDeep(performer, o.performer, true) && compareDeep(reason, o.reason, true) && compareDeep(request, o.request, true)
2488           && compareDeep(device, o.device, true) && compareDeep(note, o.note, true) && compareDeep(dosage, o.dosage, true)
2489           && compareDeep(eventHistory, o.eventHistory, true);
2490      }
2491
2492      @Override
2493      public boolean equalsShallow(Base other_) {
2494        if (!super.equalsShallow(other_))
2495          return false;
2496        if (!(other_ instanceof MedicationAdministration))
2497          return false;
2498        MedicationAdministration o = (MedicationAdministration) other_;
2499        return compareValues(status, o.status, true) && compareValues(recorded, o.recorded, true) && compareValues(isSubPotent, o.isSubPotent, true)
2500          ;
2501      }
2502
2503      public boolean isEmpty() {
2504        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, partOf
2505          , status, statusReason, category, medication, subject, encounter, supportingInformation
2506          , occurence, recorded, isSubPotent, subPotentReason, performer, reason, request
2507          , device, note, dosage, eventHistory);
2508      }
2509
2510  @Override
2511  public ResourceType getResourceType() {
2512    return ResourceType.MedicationAdministration;
2513   }
2514
2515 /**
2516   * Search parameter: <b>device</b>
2517   * <p>
2518   * Description: <b>Return administrations with this administration device identity</b><br>
2519   * Type: <b>reference</b><br>
2520   * Path: <b>MedicationAdministration.device.reference</b><br>
2521   * </p>
2522   */
2523  @SearchParamDefinition(name="device", path="MedicationAdministration.device.reference", description="Return administrations with this administration device identity", type="reference", target={Device.class } )
2524  public static final String SP_DEVICE = "device";
2525 /**
2526   * <b>Fluent Client</b> search parameter constant for <b>device</b>
2527   * <p>
2528   * Description: <b>Return administrations with this administration device identity</b><br>
2529   * Type: <b>reference</b><br>
2530   * Path: <b>MedicationAdministration.device.reference</b><br>
2531   * </p>
2532   */
2533  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE);
2534
2535/**
2536   * Constant for fluent queries to be used to add include statements. Specifies
2537   * the path value of "<b>MedicationAdministration:device</b>".
2538   */
2539  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("MedicationAdministration:device").toLocked();
2540
2541 /**
2542   * Search parameter: <b>performer-device-code</b>
2543   * <p>
2544   * Description: <b>The identity of the individual who administered the medication</b><br>
2545   * Type: <b>token</b><br>
2546   * Path: <b>MedicationAdministration.performer.actor.concept</b><br>
2547   * </p>
2548   */
2549  @SearchParamDefinition(name="performer-device-code", path="MedicationAdministration.performer.actor.concept", description="The identity of the individual who administered the medication", type="token" )
2550  public static final String SP_PERFORMER_DEVICE_CODE = "performer-device-code";
2551 /**
2552   * <b>Fluent Client</b> search parameter constant for <b>performer-device-code</b>
2553   * <p>
2554   * Description: <b>The identity of the individual who administered the medication</b><br>
2555   * Type: <b>token</b><br>
2556   * Path: <b>MedicationAdministration.performer.actor.concept</b><br>
2557   * </p>
2558   */
2559  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PERFORMER_DEVICE_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PERFORMER_DEVICE_CODE);
2560
2561 /**
2562   * Search parameter: <b>performer</b>
2563   * <p>
2564   * Description: <b>The identity of the individual who administered the medication</b><br>
2565   * Type: <b>reference</b><br>
2566   * Path: <b>MedicationAdministration.performer.actor.reference</b><br>
2567   * </p>
2568   */
2569  @SearchParamDefinition(name="performer", path="MedicationAdministration.performer.actor.reference", description="The identity of the individual who administered the medication", type="reference", target={Device.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2570  public static final String SP_PERFORMER = "performer";
2571 /**
2572   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
2573   * <p>
2574   * Description: <b>The identity of the individual who administered the medication</b><br>
2575   * Type: <b>reference</b><br>
2576   * Path: <b>MedicationAdministration.performer.actor.reference</b><br>
2577   * </p>
2578   */
2579  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
2580
2581/**
2582   * Constant for fluent queries to be used to add include statements. Specifies
2583   * the path value of "<b>MedicationAdministration:performer</b>".
2584   */
2585  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("MedicationAdministration:performer").toLocked();
2586
2587 /**
2588   * Search parameter: <b>reason-given-code</b>
2589   * <p>
2590   * Description: <b>Reasons for administering the medication</b><br>
2591   * Type: <b>token</b><br>
2592   * Path: <b>MedicationAdministration.reason.concept</b><br>
2593   * </p>
2594   */
2595  @SearchParamDefinition(name="reason-given-code", path="MedicationAdministration.reason.concept", description="Reasons for administering the medication", type="token" )
2596  public static final String SP_REASON_GIVEN_CODE = "reason-given-code";
2597 /**
2598   * <b>Fluent Client</b> search parameter constant for <b>reason-given-code</b>
2599   * <p>
2600   * Description: <b>Reasons for administering the medication</b><br>
2601   * Type: <b>token</b><br>
2602   * Path: <b>MedicationAdministration.reason.concept</b><br>
2603   * </p>
2604   */
2605  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON_GIVEN_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REASON_GIVEN_CODE);
2606
2607 /**
2608   * Search parameter: <b>reason-given</b>
2609   * <p>
2610   * Description: <b>Reference to a resource (by instance)</b><br>
2611   * Type: <b>reference</b><br>
2612   * Path: <b>MedicationAdministration.reason.reference</b><br>
2613   * </p>
2614   */
2615  @SearchParamDefinition(name="reason-given", path="MedicationAdministration.reason.reference", description="Reference to a resource (by instance)", type="reference", target={Condition.class, DiagnosticReport.class, Observation.class } )
2616  public static final String SP_REASON_GIVEN = "reason-given";
2617 /**
2618   * <b>Fluent Client</b> search parameter constant for <b>reason-given</b>
2619   * <p>
2620   * Description: <b>Reference to a resource (by instance)</b><br>
2621   * Type: <b>reference</b><br>
2622   * Path: <b>MedicationAdministration.reason.reference</b><br>
2623   * </p>
2624   */
2625  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REASON_GIVEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REASON_GIVEN);
2626
2627/**
2628   * Constant for fluent queries to be used to add include statements. Specifies
2629   * the path value of "<b>MedicationAdministration:reason-given</b>".
2630   */
2631  public static final ca.uhn.fhir.model.api.Include INCLUDE_REASON_GIVEN = new ca.uhn.fhir.model.api.Include("MedicationAdministration:reason-given").toLocked();
2632
2633 /**
2634   * Search parameter: <b>reason-not-given</b>
2635   * <p>
2636   * Description: <b>Reasons for not administering the medication</b><br>
2637   * Type: <b>token</b><br>
2638   * Path: <b>MedicationAdministration.statusReason</b><br>
2639   * </p>
2640   */
2641  @SearchParamDefinition(name="reason-not-given", path="MedicationAdministration.statusReason", description="Reasons for not administering the medication", type="token" )
2642  public static final String SP_REASON_NOT_GIVEN = "reason-not-given";
2643 /**
2644   * <b>Fluent Client</b> search parameter constant for <b>reason-not-given</b>
2645   * <p>
2646   * Description: <b>Reasons for not administering the medication</b><br>
2647   * Type: <b>token</b><br>
2648   * Path: <b>MedicationAdministration.statusReason</b><br>
2649   * </p>
2650   */
2651  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON_NOT_GIVEN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REASON_NOT_GIVEN);
2652
2653 /**
2654   * Search parameter: <b>request</b>
2655   * <p>
2656   * Description: <b>The identity of a request to list administrations from</b><br>
2657   * Type: <b>reference</b><br>
2658   * Path: <b>MedicationAdministration.request</b><br>
2659   * </p>
2660   */
2661  @SearchParamDefinition(name="request", path="MedicationAdministration.request", description="The identity of a request to list administrations from", type="reference", target={MedicationRequest.class } )
2662  public static final String SP_REQUEST = "request";
2663 /**
2664   * <b>Fluent Client</b> search parameter constant for <b>request</b>
2665   * <p>
2666   * Description: <b>The identity of a request to list administrations from</b><br>
2667   * Type: <b>reference</b><br>
2668   * Path: <b>MedicationAdministration.request</b><br>
2669   * </p>
2670   */
2671  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST);
2672
2673/**
2674   * Constant for fluent queries to be used to add include statements. Specifies
2675   * the path value of "<b>MedicationAdministration:request</b>".
2676   */
2677  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("MedicationAdministration:request").toLocked();
2678
2679 /**
2680   * Search parameter: <b>subject</b>
2681   * <p>
2682   * Description: <b>The identity of the individual or group to list administrations for</b><br>
2683   * Type: <b>reference</b><br>
2684   * Path: <b>MedicationAdministration.subject</b><br>
2685   * </p>
2686   */
2687  @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 } )
2688  public static final String SP_SUBJECT = "subject";
2689 /**
2690   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2691   * <p>
2692   * Description: <b>The identity of the individual or group to list administrations for</b><br>
2693   * Type: <b>reference</b><br>
2694   * Path: <b>MedicationAdministration.subject</b><br>
2695   * </p>
2696   */
2697  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2698
2699/**
2700   * Constant for fluent queries to be used to add include statements. Specifies
2701   * the path value of "<b>MedicationAdministration:subject</b>".
2702   */
2703  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("MedicationAdministration:subject").toLocked();
2704
2705 /**
2706   * Search parameter: <b>code</b>
2707   * <p>
2708   * Description: <b>Multiple Resources: 
2709
2710* [AdverseEvent](adverseevent.html): Event or incident that occurred or was averted
2711* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2712* [AuditEvent](auditevent.html): More specific code for the event
2713* [Basic](basic.html): Kind of Resource
2714* [ChargeItem](chargeitem.html): A code that identifies the charge, like a billing code
2715* [Condition](condition.html): Code for the condition
2716* [DetectedIssue](detectedissue.html): Issue Type, e.g. drug-drug, duplicate therapy, etc.
2717* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2718* [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
2719* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2720* [ImagingSelection](imagingselection.html): The imaging selection status
2721* [List](list.html): What the purpose of this list is
2722* [Medication](medication.html): Returns medications for a specific code
2723* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2724* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2725* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2726* [MedicationStatement](medicationstatement.html): Return statements of this medication code
2727* [NutritionIntake](nutritionintake.html): Returns statements of this code of NutritionIntake
2728* [Observation](observation.html): The code of the observation type
2729* [Procedure](procedure.html): A code to identify a  procedure
2730* [RequestOrchestration](requestorchestration.html): The code of the request orchestration
2731* [Task](task.html): Search by task code
2732</b><br>
2733   * Type: <b>token</b><br>
2734   * Path: <b>AdverseEvent.code | AllergyIntolerance.code | AllergyIntolerance.reaction.substance | AuditEvent.code | Basic.code | ChargeItem.code | Condition.code | DetectedIssue.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | ImagingSelection.status | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationStatement.medication.concept | NutritionIntake.code | Observation.code | Procedure.code | RequestOrchestration.code | Task.code</b><br>
2735   * </p>
2736   */
2737  @SearchParamDefinition(name="code", path="AdverseEvent.code | AllergyIntolerance.code | AllergyIntolerance.reaction.substance | AuditEvent.code | Basic.code | ChargeItem.code | Condition.code | DetectedIssue.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | ImagingSelection.status | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationStatement.medication.concept | NutritionIntake.code | Observation.code | Procedure.code | RequestOrchestration.code | Task.code", description="Multiple Resources: \r\n\r\n* [AdverseEvent](adverseevent.html): Event or incident that occurred or was averted\r\n* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance\r\n* [AuditEvent](auditevent.html): More specific code for the event\r\n* [Basic](basic.html): Kind of Resource\r\n* [ChargeItem](chargeitem.html): A code that identifies the charge, like a billing code\r\n* [Condition](condition.html): Code for the condition\r\n* [DetectedIssue](detectedissue.html): Issue Type, e.g. drug-drug, duplicate therapy, etc.\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* [ImagingSelection](imagingselection.html): The imaging selection status\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* [MedicationStatement](medicationstatement.html): Return statements of this medication code\r\n* [NutritionIntake](nutritionintake.html): Returns statements of this code of NutritionIntake\r\n* [Observation](observation.html): The code of the observation type\r\n* [Procedure](procedure.html): A code to identify a  procedure\r\n* [RequestOrchestration](requestorchestration.html): The code of the request orchestration\r\n* [Task](task.html): Search by task code\r\n", type="token" )
2738  public static final String SP_CODE = "code";
2739 /**
2740   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2741   * <p>
2742   * Description: <b>Multiple Resources: 
2743
2744* [AdverseEvent](adverseevent.html): Event or incident that occurred or was averted
2745* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2746* [AuditEvent](auditevent.html): More specific code for the event
2747* [Basic](basic.html): Kind of Resource
2748* [ChargeItem](chargeitem.html): A code that identifies the charge, like a billing code
2749* [Condition](condition.html): Code for the condition
2750* [DetectedIssue](detectedissue.html): Issue Type, e.g. drug-drug, duplicate therapy, etc.
2751* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2752* [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
2753* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2754* [ImagingSelection](imagingselection.html): The imaging selection status
2755* [List](list.html): What the purpose of this list is
2756* [Medication](medication.html): Returns medications for a specific code
2757* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2758* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2759* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2760* [MedicationStatement](medicationstatement.html): Return statements of this medication code
2761* [NutritionIntake](nutritionintake.html): Returns statements of this code of NutritionIntake
2762* [Observation](observation.html): The code of the observation type
2763* [Procedure](procedure.html): A code to identify a  procedure
2764* [RequestOrchestration](requestorchestration.html): The code of the request orchestration
2765* [Task](task.html): Search by task code
2766</b><br>
2767   * Type: <b>token</b><br>
2768   * Path: <b>AdverseEvent.code | AllergyIntolerance.code | AllergyIntolerance.reaction.substance | AuditEvent.code | Basic.code | ChargeItem.code | Condition.code | DetectedIssue.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | ImagingSelection.status | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationStatement.medication.concept | NutritionIntake.code | Observation.code | Procedure.code | RequestOrchestration.code | Task.code</b><br>
2769   * </p>
2770   */
2771  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2772
2773 /**
2774   * Search parameter: <b>identifier</b>
2775   * <p>
2776   * Description: <b>Multiple Resources: 
2777
2778* [Account](account.html): Account number
2779* [AdverseEvent](adverseevent.html): Business identifier for the event
2780* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2781* [Appointment](appointment.html): An Identifier of the Appointment
2782* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
2783* [Basic](basic.html): Business identifier
2784* [BodyStructure](bodystructure.html): Bodystructure identifier
2785* [CarePlan](careplan.html): External Ids for this plan
2786* [CareTeam](careteam.html): External Ids for this team
2787* [ChargeItem](chargeitem.html): Business Identifier for item
2788* [Claim](claim.html): The primary identifier of the financial resource
2789* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
2790* [ClinicalImpression](clinicalimpression.html): Business identifier
2791* [Communication](communication.html): Unique identifier
2792* [CommunicationRequest](communicationrequest.html): Unique identifier
2793* [Composition](composition.html): Version-independent identifier for the Composition
2794* [Condition](condition.html): A unique identifier of the condition record
2795* [Consent](consent.html): Identifier for this record (external references)
2796* [Contract](contract.html): The identity of the contract
2797* [Coverage](coverage.html): The primary identifier of the insured and the coverage
2798* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
2799* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
2800* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2801* [DeviceRequest](devicerequest.html): Business identifier for request/order
2802* [DeviceUsage](deviceusage.html): Search by identifier
2803* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2804* [DocumentReference](documentreference.html): Identifier of the attachment binary
2805* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2806* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
2807* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2808* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
2809* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2810* [Flag](flag.html): Business identifier
2811* [Goal](goal.html): External Ids for this goal
2812* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
2813* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
2814* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2815* [Immunization](immunization.html): Business identifier
2816* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
2817* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
2818* [Invoice](invoice.html): Business Identifier for item
2819* [List](list.html): Business identifier
2820* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
2821* [Medication](medication.html): Returns medications with this external identifier
2822* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2823* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2824* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2825* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
2826* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
2827* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
2828* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2829* [Observation](observation.html): The unique id for a particular observation
2830* [Person](person.html): A person Identifier
2831* [Procedure](procedure.html): A unique identifier for a procedure
2832* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
2833* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
2834* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
2835* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
2836* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2837* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2838* [Specimen](specimen.html): The unique identifier associated with the specimen
2839* [SupplyDelivery](supplydelivery.html): External identifier
2840* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2841* [Task](task.html): Search for a task instance by its business identifier
2842* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2843</b><br>
2844   * Type: <b>token</b><br>
2845   * Path: <b>Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier</b><br>
2846   * </p>
2847   */
2848  @SearchParamDefinition(name="identifier", path="Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [Account](account.html): Account number\r\n* [AdverseEvent](adverseevent.html): Business identifier for the event\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [Appointment](appointment.html): An Identifier of the Appointment\r\n* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response\r\n* [Basic](basic.html): Business identifier\r\n* [BodyStructure](bodystructure.html): Bodystructure identifier\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [ChargeItem](chargeitem.html): Business Identifier for item\r\n* [Claim](claim.html): The primary identifier of the financial resource\r\n* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse\r\n* [ClinicalImpression](clinicalimpression.html): Business identifier\r\n* [Communication](communication.html): Unique identifier\r\n* [CommunicationRequest](communicationrequest.html): Unique identifier\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* [Contract](contract.html): The identity of the contract\r\n* [Coverage](coverage.html): The primary identifier of the insured and the coverage\r\n* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility\r\n* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DeviceUsage](deviceusage.html): Search by identifier\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\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* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Flag](flag.html): Business identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response\r\n* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier\r\n* [Invoice](invoice.html): Business Identifier for item\r\n* [List](list.html): Business identifier\r\n* [MeasureReport](measurereport.html): External identifier of the measure report to be returned\r\n* [Medication](medication.html): Returns medications with this external 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* [MedicationStatement](medicationstatement.html): Return statements with this external identifier\r\n* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence\r\n* [NutritionIntake](nutritionintake.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* [Person](person.html): A person Identifier\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response\r\n* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson\r\n* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration\r\n* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [Specimen](specimen.html): The unique identifier associated with the specimen\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [Task](task.html): Search for a task instance by its business identifier\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
2849  public static final String SP_IDENTIFIER = "identifier";
2850 /**
2851   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2852   * <p>
2853   * Description: <b>Multiple Resources: 
2854
2855* [Account](account.html): Account number
2856* [AdverseEvent](adverseevent.html): Business identifier for the event
2857* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2858* [Appointment](appointment.html): An Identifier of the Appointment
2859* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
2860* [Basic](basic.html): Business identifier
2861* [BodyStructure](bodystructure.html): Bodystructure identifier
2862* [CarePlan](careplan.html): External Ids for this plan
2863* [CareTeam](careteam.html): External Ids for this team
2864* [ChargeItem](chargeitem.html): Business Identifier for item
2865* [Claim](claim.html): The primary identifier of the financial resource
2866* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
2867* [ClinicalImpression](clinicalimpression.html): Business identifier
2868* [Communication](communication.html): Unique identifier
2869* [CommunicationRequest](communicationrequest.html): Unique identifier
2870* [Composition](composition.html): Version-independent identifier for the Composition
2871* [Condition](condition.html): A unique identifier of the condition record
2872* [Consent](consent.html): Identifier for this record (external references)
2873* [Contract](contract.html): The identity of the contract
2874* [Coverage](coverage.html): The primary identifier of the insured and the coverage
2875* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
2876* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
2877* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2878* [DeviceRequest](devicerequest.html): Business identifier for request/order
2879* [DeviceUsage](deviceusage.html): Search by identifier
2880* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2881* [DocumentReference](documentreference.html): Identifier of the attachment binary
2882* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2883* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
2884* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2885* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
2886* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2887* [Flag](flag.html): Business identifier
2888* [Goal](goal.html): External Ids for this goal
2889* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
2890* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
2891* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2892* [Immunization](immunization.html): Business identifier
2893* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
2894* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
2895* [Invoice](invoice.html): Business Identifier for item
2896* [List](list.html): Business identifier
2897* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
2898* [Medication](medication.html): Returns medications with this external identifier
2899* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2900* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2901* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2902* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
2903* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
2904* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
2905* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2906* [Observation](observation.html): The unique id for a particular observation
2907* [Person](person.html): A person Identifier
2908* [Procedure](procedure.html): A unique identifier for a procedure
2909* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
2910* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
2911* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
2912* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
2913* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2914* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2915* [Specimen](specimen.html): The unique identifier associated with the specimen
2916* [SupplyDelivery](supplydelivery.html): External identifier
2917* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2918* [Task](task.html): Search for a task instance by its business identifier
2919* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2920</b><br>
2921   * Type: <b>token</b><br>
2922   * Path: <b>Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier</b><br>
2923   * </p>
2924   */
2925  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2926
2927 /**
2928   * Search parameter: <b>patient</b>
2929   * <p>
2930   * Description: <b>Multiple Resources: 
2931
2932* [Account](account.html): The entity that caused the expenses
2933* [AdverseEvent](adverseevent.html): Subject impacted by event
2934* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2935* [Appointment](appointment.html): One of the individuals of the appointment is this patient
2936* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
2937* [AuditEvent](auditevent.html): Where the activity involved patient data
2938* [Basic](basic.html): Identifies the focus of this resource
2939* [BodyStructure](bodystructure.html): Who this is about
2940* [CarePlan](careplan.html): Who the care plan is for
2941* [CareTeam](careteam.html): Who care team is for
2942* [ChargeItem](chargeitem.html): Individual service was done for/to
2943* [Claim](claim.html): Patient receiving the products or services
2944* [ClaimResponse](claimresponse.html): The subject of care
2945* [ClinicalImpression](clinicalimpression.html): Patient assessed
2946* [Communication](communication.html): Focus of message
2947* [CommunicationRequest](communicationrequest.html): Focus of message
2948* [Composition](composition.html): Who and/or what the composition is about
2949* [Condition](condition.html): Who has the condition?
2950* [Consent](consent.html): Who the consent applies to
2951* [Contract](contract.html): The identity of the subject of the contract (if a patient)
2952* [Coverage](coverage.html): Retrieve coverages for a patient
2953* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
2954* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
2955* [DetectedIssue](detectedissue.html): Associated patient
2956* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2957* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2958* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2959* [DocumentReference](documentreference.html): Who/what is the subject of the document
2960* [Encounter](encounter.html): The patient present at the encounter
2961* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
2962* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2963* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
2964* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2965* [Flag](flag.html): The identity of a subject to list flags for
2966* [Goal](goal.html): Who this goal is intended for
2967* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
2968* [ImagingSelection](imagingselection.html): Who the study is about
2969* [ImagingStudy](imagingstudy.html): Who the study is about
2970* [Immunization](immunization.html): The patient for the vaccination record
2971* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
2972* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
2973* [Invoice](invoice.html): Recipient(s) of goods and services
2974* [List](list.html): If all resources have the same subject
2975* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
2976* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2977* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2978* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2979* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
2980* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
2981* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
2982* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
2983* [Observation](observation.html): The subject that the observation is about (if patient)
2984* [Person](person.html): The Person links to this Patient
2985* [Procedure](procedure.html): Search by subject - a patient
2986* [Provenance](provenance.html): Where the activity involved patient data
2987* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
2988* [RelatedPerson](relatedperson.html): The patient this related person is related to
2989* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
2990* [ResearchSubject](researchsubject.html): Who or what is part of study
2991* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2992* [ServiceRequest](servicerequest.html): Search by subject - a patient
2993* [Specimen](specimen.html): The patient the specimen comes from
2994* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2995* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
2996* [Task](task.html): Search by patient
2997* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2998</b><br>
2999   * Type: <b>reference</b><br>
3000   * Path: <b>Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient</b><br>
3001   * </p>
3002   */
3003  @SearchParamDefinition(name="patient", path="Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [Account](account.html): The entity that caused the expenses\r\n* [AdverseEvent](adverseevent.html): Subject impacted by event\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [Appointment](appointment.html): One of the individuals of the appointment is this patient\r\n* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient\r\n* [AuditEvent](auditevent.html): Where the activity involved patient data\r\n* [Basic](basic.html): Identifies the focus of this resource\r\n* [BodyStructure](bodystructure.html): Who this is about\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ChargeItem](chargeitem.html): Individual service was done for/to\r\n* [Claim](claim.html): Patient receiving the products or services\r\n* [ClaimResponse](claimresponse.html): The subject of care\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Communication](communication.html): Focus of message\r\n* [CommunicationRequest](communicationrequest.html): Focus of message\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* [Contract](contract.html): The identity of the subject of the contract (if a patient)\r\n* [Coverage](coverage.html): Retrieve coverages for a patient\r\n* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient\r\n* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient\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* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient\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* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results\r\n* [ImagingSelection](imagingselection.html): Who the study is about\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for\r\n* [Invoice](invoice.html): Recipient(s) of goods and services\r\n* [List](list.html): If all resources have the same subject\r\n* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for\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* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.\r\n* [MolecularSequence](molecularsequence.html): The subject that the sequence is about\r\n* [NutritionIntake](nutritionintake.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* [Person](person.html): The Person links to this Patient\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [Provenance](provenance.html): Where the activity involved patient data\r\n* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response\r\n* [RelatedPerson](relatedperson.html): The patient this related person is related to\r\n* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations\r\n* [ResearchSubject](researchsubject.html): Who or what is part of study\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [Specimen](specimen.html): The patient the specimen comes from\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* [Task](task.html): Search by patient\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={Patient.class } )
3004  public static final String SP_PATIENT = "patient";
3005 /**
3006   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3007   * <p>
3008   * Description: <b>Multiple Resources: 
3009
3010* [Account](account.html): The entity that caused the expenses
3011* [AdverseEvent](adverseevent.html): Subject impacted by event
3012* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
3013* [Appointment](appointment.html): One of the individuals of the appointment is this patient
3014* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
3015* [AuditEvent](auditevent.html): Where the activity involved patient data
3016* [Basic](basic.html): Identifies the focus of this resource
3017* [BodyStructure](bodystructure.html): Who this is about
3018* [CarePlan](careplan.html): Who the care plan is for
3019* [CareTeam](careteam.html): Who care team is for
3020* [ChargeItem](chargeitem.html): Individual service was done for/to
3021* [Claim](claim.html): Patient receiving the products or services
3022* [ClaimResponse](claimresponse.html): The subject of care
3023* [ClinicalImpression](clinicalimpression.html): Patient assessed
3024* [Communication](communication.html): Focus of message
3025* [CommunicationRequest](communicationrequest.html): Focus of message
3026* [Composition](composition.html): Who and/or what the composition is about
3027* [Condition](condition.html): Who has the condition?
3028* [Consent](consent.html): Who the consent applies to
3029* [Contract](contract.html): The identity of the subject of the contract (if a patient)
3030* [Coverage](coverage.html): Retrieve coverages for a patient
3031* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
3032* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
3033* [DetectedIssue](detectedissue.html): Associated patient
3034* [DeviceRequest](devicerequest.html): Individual the service is ordered for
3035* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
3036* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
3037* [DocumentReference](documentreference.html): Who/what is the subject of the document
3038* [Encounter](encounter.html): The patient present at the encounter
3039* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
3040* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
3041* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
3042* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
3043* [Flag](flag.html): The identity of a subject to list flags for
3044* [Goal](goal.html): Who this goal is intended for
3045* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
3046* [ImagingSelection](imagingselection.html): Who the study is about
3047* [ImagingStudy](imagingstudy.html): Who the study is about
3048* [Immunization](immunization.html): The patient for the vaccination record
3049* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
3050* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
3051* [Invoice](invoice.html): Recipient(s) of goods and services
3052* [List](list.html): If all resources have the same subject
3053* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
3054* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
3055* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
3056* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
3057* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
3058* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
3059* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
3060* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
3061* [Observation](observation.html): The subject that the observation is about (if patient)
3062* [Person](person.html): The Person links to this Patient
3063* [Procedure](procedure.html): Search by subject - a patient
3064* [Provenance](provenance.html): Where the activity involved patient data
3065* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
3066* [RelatedPerson](relatedperson.html): The patient this related person is related to
3067* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
3068* [ResearchSubject](researchsubject.html): Who or what is part of study
3069* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
3070* [ServiceRequest](servicerequest.html): Search by subject - a patient
3071* [Specimen](specimen.html): The patient the specimen comes from
3072* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
3073* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
3074* [Task](task.html): Search by patient
3075* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
3076</b><br>
3077   * Type: <b>reference</b><br>
3078   * Path: <b>Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient</b><br>
3079   * </p>
3080   */
3081  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3082
3083/**
3084   * Constant for fluent queries to be used to add include statements. Specifies
3085   * the path value of "<b>MedicationAdministration:patient</b>".
3086   */
3087  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MedicationAdministration:patient").toLocked();
3088
3089 /**
3090   * Search parameter: <b>date</b>
3091   * <p>
3092   * Description: <b>Multiple Resources: 
3093
3094* [MedicationAdministration](medicationadministration.html): Date administration happened (or did not happen)
3095</b><br>
3096   * Type: <b>date</b><br>
3097   * Path: <b>MedicationAdministration.occurence.ofType(dateTime) | MedicationAdministration.occurence.ofType(Period)</b><br>
3098   * </p>
3099   */
3100  @SearchParamDefinition(name="date", path="MedicationAdministration.occurence.ofType(dateTime) | MedicationAdministration.occurence.ofType(Period)", description="Multiple Resources: \r\n\r\n* [MedicationAdministration](medicationadministration.html): Date administration happened (or did not happen)\r\n", type="date" )
3101  public static final String SP_DATE = "date";
3102 /**
3103   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3104   * <p>
3105   * Description: <b>Multiple Resources: 
3106
3107* [MedicationAdministration](medicationadministration.html): Date administration happened (or did not happen)
3108</b><br>
3109   * Type: <b>date</b><br>
3110   * Path: <b>MedicationAdministration.occurence.ofType(dateTime) | MedicationAdministration.occurence.ofType(Period)</b><br>
3111   * </p>
3112   */
3113  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
3114
3115 /**
3116   * Search parameter: <b>encounter</b>
3117   * <p>
3118   * Description: <b>Multiple Resources: 
3119
3120* [MedicationAdministration](medicationadministration.html): Return administrations that share this encounter
3121* [MedicationRequest](medicationrequest.html): Return prescriptions with this encounter identifier
3122</b><br>
3123   * Type: <b>reference</b><br>
3124   * Path: <b>MedicationAdministration.encounter | MedicationRequest.encounter</b><br>
3125   * </p>
3126   */
3127  @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 } )
3128  public static final String SP_ENCOUNTER = "encounter";
3129 /**
3130   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
3131   * <p>
3132   * Description: <b>Multiple Resources: 
3133
3134* [MedicationAdministration](medicationadministration.html): Return administrations that share this encounter
3135* [MedicationRequest](medicationrequest.html): Return prescriptions with this encounter identifier
3136</b><br>
3137   * Type: <b>reference</b><br>
3138   * Path: <b>MedicationAdministration.encounter | MedicationRequest.encounter</b><br>
3139   * </p>
3140   */
3141  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
3142
3143/**
3144   * Constant for fluent queries to be used to add include statements. Specifies
3145   * the path value of "<b>MedicationAdministration:encounter</b>".
3146   */
3147  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("MedicationAdministration:encounter").toLocked();
3148
3149 /**
3150   * Search parameter: <b>medication</b>
3151   * <p>
3152   * Description: <b>Multiple Resources: 
3153
3154* [MedicationAdministration](medicationadministration.html): Return administrations of this medication reference
3155* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine resource
3156* [MedicationRequest](medicationrequest.html): Return prescriptions for this medication reference
3157* [MedicationStatement](medicationstatement.html): Return statements of this medication reference
3158</b><br>
3159   * Type: <b>reference</b><br>
3160   * Path: <b>MedicationAdministration.medication.reference | MedicationDispense.medication.reference | MedicationRequest.medication.reference | MedicationStatement.medication.reference</b><br>
3161   * </p>
3162   */
3163  @SearchParamDefinition(name="medication", path="MedicationAdministration.medication.reference | MedicationDispense.medication.reference | MedicationRequest.medication.reference | MedicationStatement.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* [MedicationStatement](medicationstatement.html): Return statements of this medication reference\r\n", type="reference", target={Medication.class } )
3164  public static final String SP_MEDICATION = "medication";
3165 /**
3166   * <b>Fluent Client</b> search parameter constant for <b>medication</b>
3167   * <p>
3168   * Description: <b>Multiple Resources: 
3169
3170* [MedicationAdministration](medicationadministration.html): Return administrations of this medication reference
3171* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine resource
3172* [MedicationRequest](medicationrequest.html): Return prescriptions for this medication reference
3173* [MedicationStatement](medicationstatement.html): Return statements of this medication reference
3174</b><br>
3175   * Type: <b>reference</b><br>
3176   * Path: <b>MedicationAdministration.medication.reference | MedicationDispense.medication.reference | MedicationRequest.medication.reference | MedicationStatement.medication.reference</b><br>
3177   * </p>
3178   */
3179  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDICATION);
3180
3181/**
3182   * Constant for fluent queries to be used to add include statements. Specifies
3183   * the path value of "<b>MedicationAdministration:medication</b>".
3184   */
3185  public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("MedicationAdministration:medication").toLocked();
3186
3187 /**
3188   * Search parameter: <b>status</b>
3189   * <p>
3190   * Description: <b>Multiple Resources: 
3191
3192* [MedicationAdministration](medicationadministration.html): MedicationAdministration event status (for example one of active/paused/completed/nullified)
3193* [MedicationDispense](medicationdispense.html): Returns dispenses with a specified dispense status
3194* [MedicationRequest](medicationrequest.html): Status of the prescription
3195* [MedicationStatement](medicationstatement.html): Return statements that match the given status
3196</b><br>
3197   * Type: <b>token</b><br>
3198   * Path: <b>MedicationAdministration.status | MedicationDispense.status | MedicationRequest.status | MedicationStatement.status</b><br>
3199   * </p>
3200   */
3201  @SearchParamDefinition(name="status", path="MedicationAdministration.status | MedicationDispense.status | MedicationRequest.status | MedicationStatement.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* [MedicationStatement](medicationstatement.html): Return statements that match the given status\r\n", type="token" )
3202  public static final String SP_STATUS = "status";
3203 /**
3204   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3205   * <p>
3206   * Description: <b>Multiple Resources: 
3207
3208* [MedicationAdministration](medicationadministration.html): MedicationAdministration event status (for example one of active/paused/completed/nullified)
3209* [MedicationDispense](medicationdispense.html): Returns dispenses with a specified dispense status
3210* [MedicationRequest](medicationrequest.html): Status of the prescription
3211* [MedicationStatement](medicationstatement.html): Return statements that match the given status
3212</b><br>
3213   * Type: <b>token</b><br>
3214   * Path: <b>MedicationAdministration.status | MedicationDispense.status | MedicationRequest.status | MedicationStatement.status</b><br>
3215   * </p>
3216   */
3217  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3218
3219
3220}
3221