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 * Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.
052 */
053@ResourceDef(name="MedicationDispense", profile="http://hl7.org/fhir/StructureDefinition/MedicationDispense")
054public class MedicationDispense extends DomainResource {
055
056    public enum MedicationDispenseStatusCodes {
057        /**
058         * The core event has not started yet, but some staging activities have begun (e.g. initial compounding or packaging of medication). Preparation stages may be tracked for billing purposes.
059         */
060        PREPARATION, 
061        /**
062         * The dispensed product is ready for pickup.
063         */
064        INPROGRESS, 
065        /**
066         * The dispensed product was not and will never be picked up by the patient.
067         */
068        CANCELLED, 
069        /**
070         * The dispense process is paused while waiting for an external event to reactivate the dispense.  For example, new stock has arrived or the prescriber has called.
071         */
072        ONHOLD, 
073        /**
074         * The dispensed product has been picked up.
075         */
076        COMPLETED, 
077        /**
078         * The dispense was entered in error and therefore nullified.
079         */
080        ENTEREDINERROR, 
081        /**
082         * Actions implied by the dispense have been permanently halted, before all of them occurred.
083         */
084        STOPPED, 
085        /**
086         * The dispense was declined and not performed.
087         */
088        DECLINED, 
089        /**
090         * The authoring system does not know which of the status values applies for this medication dispense.  Note: this concept is not to be used for other - one of the listed statuses is presumed to apply, it's just now known which one.
091         */
092        UNKNOWN, 
093        /**
094         * added to help the parsers with the generic types
095         */
096        NULL;
097        public static MedicationDispenseStatusCodes fromCode(String codeString) throws FHIRException {
098            if (codeString == null || "".equals(codeString))
099                return null;
100        if ("preparation".equals(codeString))
101          return PREPARATION;
102        if ("in-progress".equals(codeString))
103          return INPROGRESS;
104        if ("cancelled".equals(codeString))
105          return CANCELLED;
106        if ("on-hold".equals(codeString))
107          return ONHOLD;
108        if ("completed".equals(codeString))
109          return COMPLETED;
110        if ("entered-in-error".equals(codeString))
111          return ENTEREDINERROR;
112        if ("stopped".equals(codeString))
113          return STOPPED;
114        if ("declined".equals(codeString))
115          return DECLINED;
116        if ("unknown".equals(codeString))
117          return UNKNOWN;
118        if (Configuration.isAcceptInvalidEnums())
119          return null;
120        else
121          throw new FHIRException("Unknown MedicationDispenseStatusCodes code '"+codeString+"'");
122        }
123        public String toCode() {
124          switch (this) {
125            case PREPARATION: return "preparation";
126            case INPROGRESS: return "in-progress";
127            case CANCELLED: return "cancelled";
128            case ONHOLD: return "on-hold";
129            case COMPLETED: return "completed";
130            case ENTEREDINERROR: return "entered-in-error";
131            case STOPPED: return "stopped";
132            case DECLINED: return "declined";
133            case UNKNOWN: return "unknown";
134            case NULL: return null;
135            default: return "?";
136          }
137        }
138        public String getSystem() {
139          switch (this) {
140            case PREPARATION: return "http://hl7.org/fhir/CodeSystem/medicationdispense-status";
141            case INPROGRESS: return "http://hl7.org/fhir/CodeSystem/medicationdispense-status";
142            case CANCELLED: return "http://hl7.org/fhir/CodeSystem/medicationdispense-status";
143            case ONHOLD: return "http://hl7.org/fhir/CodeSystem/medicationdispense-status";
144            case COMPLETED: return "http://hl7.org/fhir/CodeSystem/medicationdispense-status";
145            case ENTEREDINERROR: return "http://hl7.org/fhir/CodeSystem/medicationdispense-status";
146            case STOPPED: return "http://hl7.org/fhir/CodeSystem/medicationdispense-status";
147            case DECLINED: return "http://hl7.org/fhir/CodeSystem/medicationdispense-status";
148            case UNKNOWN: return "http://hl7.org/fhir/CodeSystem/medicationdispense-status";
149            case NULL: return null;
150            default: return "?";
151          }
152        }
153        public String getDefinition() {
154          switch (this) {
155            case PREPARATION: return "The core event has not started yet, but some staging activities have begun (e.g. initial compounding or packaging of medication). Preparation stages may be tracked for billing purposes.";
156            case INPROGRESS: return "The dispensed product is ready for pickup.";
157            case CANCELLED: return "The dispensed product was not and will never be picked up by the patient.";
158            case ONHOLD: return "The dispense process is paused while waiting for an external event to reactivate the dispense.  For example, new stock has arrived or the prescriber has called.";
159            case COMPLETED: return "The dispensed product has been picked up.";
160            case ENTEREDINERROR: return "The dispense was entered in error and therefore nullified.";
161            case STOPPED: return "Actions implied by the dispense have been permanently halted, before all of them occurred.";
162            case DECLINED: return "The dispense was declined and not performed.";
163            case UNKNOWN: return "The authoring system does not know which of the status values applies for this medication dispense.  Note: this concept is not to be used for other - one of the listed statuses is presumed to apply, it's just now known which one.";
164            case NULL: return null;
165            default: return "?";
166          }
167        }
168        public String getDisplay() {
169          switch (this) {
170            case PREPARATION: return "Preparation";
171            case INPROGRESS: return "In Progress";
172            case CANCELLED: return "Cancelled";
173            case ONHOLD: return "On Hold";
174            case COMPLETED: return "Completed";
175            case ENTEREDINERROR: return "Entered in Error";
176            case STOPPED: return "Stopped";
177            case DECLINED: return "Declined";
178            case UNKNOWN: return "Unknown";
179            case NULL: return null;
180            default: return "?";
181          }
182        }
183    }
184
185  public static class MedicationDispenseStatusCodesEnumFactory implements EnumFactory<MedicationDispenseStatusCodes> {
186    public MedicationDispenseStatusCodes fromCode(String codeString) throws IllegalArgumentException {
187      if (codeString == null || "".equals(codeString))
188            if (codeString == null || "".equals(codeString))
189                return null;
190        if ("preparation".equals(codeString))
191          return MedicationDispenseStatusCodes.PREPARATION;
192        if ("in-progress".equals(codeString))
193          return MedicationDispenseStatusCodes.INPROGRESS;
194        if ("cancelled".equals(codeString))
195          return MedicationDispenseStatusCodes.CANCELLED;
196        if ("on-hold".equals(codeString))
197          return MedicationDispenseStatusCodes.ONHOLD;
198        if ("completed".equals(codeString))
199          return MedicationDispenseStatusCodes.COMPLETED;
200        if ("entered-in-error".equals(codeString))
201          return MedicationDispenseStatusCodes.ENTEREDINERROR;
202        if ("stopped".equals(codeString))
203          return MedicationDispenseStatusCodes.STOPPED;
204        if ("declined".equals(codeString))
205          return MedicationDispenseStatusCodes.DECLINED;
206        if ("unknown".equals(codeString))
207          return MedicationDispenseStatusCodes.UNKNOWN;
208        throw new IllegalArgumentException("Unknown MedicationDispenseStatusCodes code '"+codeString+"'");
209        }
210        public Enumeration<MedicationDispenseStatusCodes> fromType(PrimitiveType<?> code) throws FHIRException {
211          if (code == null)
212            return null;
213          if (code.isEmpty())
214            return new Enumeration<MedicationDispenseStatusCodes>(this, MedicationDispenseStatusCodes.NULL, code);
215          String codeString = ((PrimitiveType) code).asStringValue();
216          if (codeString == null || "".equals(codeString))
217            return new Enumeration<MedicationDispenseStatusCodes>(this, MedicationDispenseStatusCodes.NULL, code);
218        if ("preparation".equals(codeString))
219          return new Enumeration<MedicationDispenseStatusCodes>(this, MedicationDispenseStatusCodes.PREPARATION, code);
220        if ("in-progress".equals(codeString))
221          return new Enumeration<MedicationDispenseStatusCodes>(this, MedicationDispenseStatusCodes.INPROGRESS, code);
222        if ("cancelled".equals(codeString))
223          return new Enumeration<MedicationDispenseStatusCodes>(this, MedicationDispenseStatusCodes.CANCELLED, code);
224        if ("on-hold".equals(codeString))
225          return new Enumeration<MedicationDispenseStatusCodes>(this, MedicationDispenseStatusCodes.ONHOLD, code);
226        if ("completed".equals(codeString))
227          return new Enumeration<MedicationDispenseStatusCodes>(this, MedicationDispenseStatusCodes.COMPLETED, code);
228        if ("entered-in-error".equals(codeString))
229          return new Enumeration<MedicationDispenseStatusCodes>(this, MedicationDispenseStatusCodes.ENTEREDINERROR, code);
230        if ("stopped".equals(codeString))
231          return new Enumeration<MedicationDispenseStatusCodes>(this, MedicationDispenseStatusCodes.STOPPED, code);
232        if ("declined".equals(codeString))
233          return new Enumeration<MedicationDispenseStatusCodes>(this, MedicationDispenseStatusCodes.DECLINED, code);
234        if ("unknown".equals(codeString))
235          return new Enumeration<MedicationDispenseStatusCodes>(this, MedicationDispenseStatusCodes.UNKNOWN, code);
236        throw new FHIRException("Unknown MedicationDispenseStatusCodes code '"+codeString+"'");
237        }
238    public String toCode(MedicationDispenseStatusCodes code) {
239      if (code == MedicationDispenseStatusCodes.PREPARATION)
240        return "preparation";
241      if (code == MedicationDispenseStatusCodes.INPROGRESS)
242        return "in-progress";
243      if (code == MedicationDispenseStatusCodes.CANCELLED)
244        return "cancelled";
245      if (code == MedicationDispenseStatusCodes.ONHOLD)
246        return "on-hold";
247      if (code == MedicationDispenseStatusCodes.COMPLETED)
248        return "completed";
249      if (code == MedicationDispenseStatusCodes.ENTEREDINERROR)
250        return "entered-in-error";
251      if (code == MedicationDispenseStatusCodes.STOPPED)
252        return "stopped";
253      if (code == MedicationDispenseStatusCodes.DECLINED)
254        return "declined";
255      if (code == MedicationDispenseStatusCodes.UNKNOWN)
256        return "unknown";
257      return "?";
258      }
259    public String toSystem(MedicationDispenseStatusCodes code) {
260      return code.getSystem();
261      }
262    }
263
264    @Block()
265    public static class MedicationDispensePerformerComponent extends BackboneElement implements IBaseBackboneElement {
266        /**
267         * Distinguishes the type of performer in the dispense.  For example, date enterer, packager, final checker.
268         */
269        @Child(name = "function", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
270        @Description(shortDefinition="Who performed the dispense and what they did", formalDefinition="Distinguishes the type of performer in the dispense.  For example, date enterer, packager, final checker." )
271        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicationdispense-performer-function")
272        protected CodeableConcept function;
273
274        /**
275         * The device, practitioner, etc. who performed the action.  It should be assumed that the actor is the dispenser of the medication.
276         */
277        @Child(name = "actor", type = {Practitioner.class, PractitionerRole.class, Organization.class, Patient.class, Device.class, RelatedPerson.class, CareTeam.class}, order=2, min=1, max=1, modifier=false, summary=false)
278        @Description(shortDefinition="Individual who was performing", formalDefinition="The device, practitioner, etc. who performed the action.  It should be assumed that the actor is the dispenser of the medication." )
279        protected Reference actor;
280
281        private static final long serialVersionUID = -576943815L;
282
283    /**
284     * Constructor
285     */
286      public MedicationDispensePerformerComponent() {
287        super();
288      }
289
290    /**
291     * Constructor
292     */
293      public MedicationDispensePerformerComponent(Reference actor) {
294        super();
295        this.setActor(actor);
296      }
297
298        /**
299         * @return {@link #function} (Distinguishes the type of performer in the dispense.  For example, date enterer, packager, final checker.)
300         */
301        public CodeableConcept getFunction() { 
302          if (this.function == null)
303            if (Configuration.errorOnAutoCreate())
304              throw new Error("Attempt to auto-create MedicationDispensePerformerComponent.function");
305            else if (Configuration.doAutoCreate())
306              this.function = new CodeableConcept(); // cc
307          return this.function;
308        }
309
310        public boolean hasFunction() { 
311          return this.function != null && !this.function.isEmpty();
312        }
313
314        /**
315         * @param value {@link #function} (Distinguishes the type of performer in the dispense.  For example, date enterer, packager, final checker.)
316         */
317        public MedicationDispensePerformerComponent setFunction(CodeableConcept value) { 
318          this.function = value;
319          return this;
320        }
321
322        /**
323         * @return {@link #actor} (The device, practitioner, etc. who performed the action.  It should be assumed that the actor is the dispenser of the medication.)
324         */
325        public Reference getActor() { 
326          if (this.actor == null)
327            if (Configuration.errorOnAutoCreate())
328              throw new Error("Attempt to auto-create MedicationDispensePerformerComponent.actor");
329            else if (Configuration.doAutoCreate())
330              this.actor = new Reference(); // cc
331          return this.actor;
332        }
333
334        public boolean hasActor() { 
335          return this.actor != null && !this.actor.isEmpty();
336        }
337
338        /**
339         * @param value {@link #actor} (The device, practitioner, etc. who performed the action.  It should be assumed that the actor is the dispenser of the medication.)
340         */
341        public MedicationDispensePerformerComponent setActor(Reference value) { 
342          this.actor = value;
343          return this;
344        }
345
346        protected void listChildren(List<Property> children) {
347          super.listChildren(children);
348          children.add(new Property("function", "CodeableConcept", "Distinguishes the type of performer in the dispense.  For example, date enterer, packager, final checker.", 0, 1, function));
349          children.add(new Property("actor", "Reference(Practitioner|PractitionerRole|Organization|Patient|Device|RelatedPerson|CareTeam)", "The device, practitioner, etc. who performed the action.  It should be assumed that the actor is the dispenser of the medication.", 0, 1, actor));
350        }
351
352        @Override
353        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
354          switch (_hash) {
355          case 1380938712: /*function*/  return new Property("function", "CodeableConcept", "Distinguishes the type of performer in the dispense.  For example, date enterer, packager, final checker.", 0, 1, function);
356          case 92645877: /*actor*/  return new Property("actor", "Reference(Practitioner|PractitionerRole|Organization|Patient|Device|RelatedPerson|CareTeam)", "The device, practitioner, etc. who performed the action.  It should be assumed that the actor is the dispenser of the medication.", 0, 1, actor);
357          default: return super.getNamedProperty(_hash, _name, _checkValid);
358          }
359
360        }
361
362      @Override
363      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
364        switch (hash) {
365        case 1380938712: /*function*/ return this.function == null ? new Base[0] : new Base[] {this.function}; // CodeableConcept
366        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
367        default: return super.getProperty(hash, name, checkValid);
368        }
369
370      }
371
372      @Override
373      public Base setProperty(int hash, String name, Base value) throws FHIRException {
374        switch (hash) {
375        case 1380938712: // function
376          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
377          return value;
378        case 92645877: // actor
379          this.actor = TypeConvertor.castToReference(value); // Reference
380          return value;
381        default: return super.setProperty(hash, name, value);
382        }
383
384      }
385
386      @Override
387      public Base setProperty(String name, Base value) throws FHIRException {
388        if (name.equals("function")) {
389          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
390        } else if (name.equals("actor")) {
391          this.actor = TypeConvertor.castToReference(value); // Reference
392        } else
393          return super.setProperty(name, value);
394        return value;
395      }
396
397      @Override
398      public Base makeProperty(int hash, String name) throws FHIRException {
399        switch (hash) {
400        case 1380938712:  return getFunction();
401        case 92645877:  return getActor();
402        default: return super.makeProperty(hash, name);
403        }
404
405      }
406
407      @Override
408      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
409        switch (hash) {
410        case 1380938712: /*function*/ return new String[] {"CodeableConcept"};
411        case 92645877: /*actor*/ return new String[] {"Reference"};
412        default: return super.getTypesForProperty(hash, name);
413        }
414
415      }
416
417      @Override
418      public Base addChild(String name) throws FHIRException {
419        if (name.equals("function")) {
420          this.function = new CodeableConcept();
421          return this.function;
422        }
423        else if (name.equals("actor")) {
424          this.actor = new Reference();
425          return this.actor;
426        }
427        else
428          return super.addChild(name);
429      }
430
431      public MedicationDispensePerformerComponent copy() {
432        MedicationDispensePerformerComponent dst = new MedicationDispensePerformerComponent();
433        copyValues(dst);
434        return dst;
435      }
436
437      public void copyValues(MedicationDispensePerformerComponent dst) {
438        super.copyValues(dst);
439        dst.function = function == null ? null : function.copy();
440        dst.actor = actor == null ? null : actor.copy();
441      }
442
443      @Override
444      public boolean equalsDeep(Base other_) {
445        if (!super.equalsDeep(other_))
446          return false;
447        if (!(other_ instanceof MedicationDispensePerformerComponent))
448          return false;
449        MedicationDispensePerformerComponent o = (MedicationDispensePerformerComponent) other_;
450        return compareDeep(function, o.function, true) && compareDeep(actor, o.actor, true);
451      }
452
453      @Override
454      public boolean equalsShallow(Base other_) {
455        if (!super.equalsShallow(other_))
456          return false;
457        if (!(other_ instanceof MedicationDispensePerformerComponent))
458          return false;
459        MedicationDispensePerformerComponent o = (MedicationDispensePerformerComponent) other_;
460        return true;
461      }
462
463      public boolean isEmpty() {
464        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(function, actor);
465      }
466
467  public String fhirType() {
468    return "MedicationDispense.performer";
469
470  }
471
472  }
473
474    @Block()
475    public static class MedicationDispenseSubstitutionComponent extends BackboneElement implements IBaseBackboneElement {
476        /**
477         * True if the dispenser dispensed a different drug or product from what was prescribed.
478         */
479        @Child(name = "wasSubstituted", type = {BooleanType.class}, order=1, min=1, max=1, modifier=false, summary=false)
480        @Description(shortDefinition="Whether a substitution was or was not performed on the dispense", formalDefinition="True if the dispenser dispensed a different drug or product from what was prescribed." )
481        protected BooleanType wasSubstituted;
482
483        /**
484         * A code signifying whether a different drug was dispensed from what was prescribed.
485         */
486        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
487        @Description(shortDefinition="Code signifying whether a different drug was dispensed from what was prescribed", formalDefinition="A code signifying whether a different drug was dispensed from what was prescribed." )
488        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-ActSubstanceAdminSubstitutionCode")
489        protected CodeableConcept type;
490
491        /**
492         * Indicates the reason for the substitution (or lack of substitution) from what was prescribed.
493         */
494        @Child(name = "reason", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
495        @Description(shortDefinition="Why was substitution made", formalDefinition="Indicates the reason for the substitution (or lack of substitution) from what was prescribed." )
496        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-SubstanceAdminSubstitutionReason")
497        protected List<CodeableConcept> reason;
498
499        /**
500         * The person or organization that has primary responsibility for the substitution.
501         */
502        @Child(name = "responsibleParty", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=4, min=0, max=1, modifier=false, summary=false)
503        @Description(shortDefinition="Who is responsible for the substitution", formalDefinition="The person or organization that has primary responsibility for the substitution." )
504        protected Reference responsibleParty;
505
506        private static final long serialVersionUID = 431402218L;
507
508    /**
509     * Constructor
510     */
511      public MedicationDispenseSubstitutionComponent() {
512        super();
513      }
514
515    /**
516     * Constructor
517     */
518      public MedicationDispenseSubstitutionComponent(boolean wasSubstituted) {
519        super();
520        this.setWasSubstituted(wasSubstituted);
521      }
522
523        /**
524         * @return {@link #wasSubstituted} (True if the dispenser dispensed a different drug or product from what was prescribed.). This is the underlying object with id, value and extensions. The accessor "getWasSubstituted" gives direct access to the value
525         */
526        public BooleanType getWasSubstitutedElement() { 
527          if (this.wasSubstituted == null)
528            if (Configuration.errorOnAutoCreate())
529              throw new Error("Attempt to auto-create MedicationDispenseSubstitutionComponent.wasSubstituted");
530            else if (Configuration.doAutoCreate())
531              this.wasSubstituted = new BooleanType(); // bb
532          return this.wasSubstituted;
533        }
534
535        public boolean hasWasSubstitutedElement() { 
536          return this.wasSubstituted != null && !this.wasSubstituted.isEmpty();
537        }
538
539        public boolean hasWasSubstituted() { 
540          return this.wasSubstituted != null && !this.wasSubstituted.isEmpty();
541        }
542
543        /**
544         * @param value {@link #wasSubstituted} (True if the dispenser dispensed a different drug or product from what was prescribed.). This is the underlying object with id, value and extensions. The accessor "getWasSubstituted" gives direct access to the value
545         */
546        public MedicationDispenseSubstitutionComponent setWasSubstitutedElement(BooleanType value) { 
547          this.wasSubstituted = value;
548          return this;
549        }
550
551        /**
552         * @return True if the dispenser dispensed a different drug or product from what was prescribed.
553         */
554        public boolean getWasSubstituted() { 
555          return this.wasSubstituted == null || this.wasSubstituted.isEmpty() ? false : this.wasSubstituted.getValue();
556        }
557
558        /**
559         * @param value True if the dispenser dispensed a different drug or product from what was prescribed.
560         */
561        public MedicationDispenseSubstitutionComponent setWasSubstituted(boolean value) { 
562            if (this.wasSubstituted == null)
563              this.wasSubstituted = new BooleanType();
564            this.wasSubstituted.setValue(value);
565          return this;
566        }
567
568        /**
569         * @return {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.)
570         */
571        public CodeableConcept getType() { 
572          if (this.type == null)
573            if (Configuration.errorOnAutoCreate())
574              throw new Error("Attempt to auto-create MedicationDispenseSubstitutionComponent.type");
575            else if (Configuration.doAutoCreate())
576              this.type = new CodeableConcept(); // cc
577          return this.type;
578        }
579
580        public boolean hasType() { 
581          return this.type != null && !this.type.isEmpty();
582        }
583
584        /**
585         * @param value {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.)
586         */
587        public MedicationDispenseSubstitutionComponent setType(CodeableConcept value) { 
588          this.type = value;
589          return this;
590        }
591
592        /**
593         * @return {@link #reason} (Indicates the reason for the substitution (or lack of substitution) from what was prescribed.)
594         */
595        public List<CodeableConcept> getReason() { 
596          if (this.reason == null)
597            this.reason = new ArrayList<CodeableConcept>();
598          return this.reason;
599        }
600
601        /**
602         * @return Returns a reference to <code>this</code> for easy method chaining
603         */
604        public MedicationDispenseSubstitutionComponent setReason(List<CodeableConcept> theReason) { 
605          this.reason = theReason;
606          return this;
607        }
608
609        public boolean hasReason() { 
610          if (this.reason == null)
611            return false;
612          for (CodeableConcept item : this.reason)
613            if (!item.isEmpty())
614              return true;
615          return false;
616        }
617
618        public CodeableConcept addReason() { //3
619          CodeableConcept t = new CodeableConcept();
620          if (this.reason == null)
621            this.reason = new ArrayList<CodeableConcept>();
622          this.reason.add(t);
623          return t;
624        }
625
626        public MedicationDispenseSubstitutionComponent addReason(CodeableConcept t) { //3
627          if (t == null)
628            return this;
629          if (this.reason == null)
630            this.reason = new ArrayList<CodeableConcept>();
631          this.reason.add(t);
632          return this;
633        }
634
635        /**
636         * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
637         */
638        public CodeableConcept getReasonFirstRep() { 
639          if (getReason().isEmpty()) {
640            addReason();
641          }
642          return getReason().get(0);
643        }
644
645        /**
646         * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.)
647         */
648        public Reference getResponsibleParty() { 
649          if (this.responsibleParty == null)
650            if (Configuration.errorOnAutoCreate())
651              throw new Error("Attempt to auto-create MedicationDispenseSubstitutionComponent.responsibleParty");
652            else if (Configuration.doAutoCreate())
653              this.responsibleParty = new Reference(); // cc
654          return this.responsibleParty;
655        }
656
657        public boolean hasResponsibleParty() { 
658          return this.responsibleParty != null && !this.responsibleParty.isEmpty();
659        }
660
661        /**
662         * @param value {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.)
663         */
664        public MedicationDispenseSubstitutionComponent setResponsibleParty(Reference value) { 
665          this.responsibleParty = value;
666          return this;
667        }
668
669        protected void listChildren(List<Property> children) {
670          super.listChildren(children);
671          children.add(new Property("wasSubstituted", "boolean", "True if the dispenser dispensed a different drug or product from what was prescribed.", 0, 1, wasSubstituted));
672          children.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug was dispensed from what was prescribed.", 0, 1, type));
673          children.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution (or lack of substitution) from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, reason));
674          children.add(new Property("responsibleParty", "Reference(Practitioner|PractitionerRole|Organization)", "The person or organization that has primary responsibility for the substitution.", 0, 1, responsibleParty));
675        }
676
677        @Override
678        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
679          switch (_hash) {
680          case -592113567: /*wasSubstituted*/  return new Property("wasSubstituted", "boolean", "True if the dispenser dispensed a different drug or product from what was prescribed.", 0, 1, wasSubstituted);
681          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A code signifying whether a different drug was dispensed from what was prescribed.", 0, 1, type);
682          case -934964668: /*reason*/  return new Property("reason", "CodeableConcept", "Indicates the reason for the substitution (or lack of substitution) from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, reason);
683          case 1511509392: /*responsibleParty*/  return new Property("responsibleParty", "Reference(Practitioner|PractitionerRole|Organization)", "The person or organization that has primary responsibility for the substitution.", 0, 1, responsibleParty);
684          default: return super.getNamedProperty(_hash, _name, _checkValid);
685          }
686
687        }
688
689      @Override
690      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
691        switch (hash) {
692        case -592113567: /*wasSubstituted*/ return this.wasSubstituted == null ? new Base[0] : new Base[] {this.wasSubstituted}; // BooleanType
693        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
694        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept
695        case 1511509392: /*responsibleParty*/ return this.responsibleParty == null ? new Base[0] : new Base[] {this.responsibleParty}; // Reference
696        default: return super.getProperty(hash, name, checkValid);
697        }
698
699      }
700
701      @Override
702      public Base setProperty(int hash, String name, Base value) throws FHIRException {
703        switch (hash) {
704        case -592113567: // wasSubstituted
705          this.wasSubstituted = TypeConvertor.castToBoolean(value); // BooleanType
706          return value;
707        case 3575610: // type
708          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
709          return value;
710        case -934964668: // reason
711          this.getReason().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
712          return value;
713        case 1511509392: // responsibleParty
714          this.responsibleParty = TypeConvertor.castToReference(value); // Reference
715          return value;
716        default: return super.setProperty(hash, name, value);
717        }
718
719      }
720
721      @Override
722      public Base setProperty(String name, Base value) throws FHIRException {
723        if (name.equals("wasSubstituted")) {
724          this.wasSubstituted = TypeConvertor.castToBoolean(value); // BooleanType
725        } else if (name.equals("type")) {
726          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
727        } else if (name.equals("reason")) {
728          this.getReason().add(TypeConvertor.castToCodeableConcept(value));
729        } else if (name.equals("responsibleParty")) {
730          this.responsibleParty = TypeConvertor.castToReference(value); // Reference
731        } else
732          return super.setProperty(name, value);
733        return value;
734      }
735
736      @Override
737      public Base makeProperty(int hash, String name) throws FHIRException {
738        switch (hash) {
739        case -592113567:  return getWasSubstitutedElement();
740        case 3575610:  return getType();
741        case -934964668:  return addReason(); 
742        case 1511509392:  return getResponsibleParty();
743        default: return super.makeProperty(hash, name);
744        }
745
746      }
747
748      @Override
749      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
750        switch (hash) {
751        case -592113567: /*wasSubstituted*/ return new String[] {"boolean"};
752        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
753        case -934964668: /*reason*/ return new String[] {"CodeableConcept"};
754        case 1511509392: /*responsibleParty*/ return new String[] {"Reference"};
755        default: return super.getTypesForProperty(hash, name);
756        }
757
758      }
759
760      @Override
761      public Base addChild(String name) throws FHIRException {
762        if (name.equals("wasSubstituted")) {
763          throw new FHIRException("Cannot call addChild on a singleton property MedicationDispense.substitution.wasSubstituted");
764        }
765        else if (name.equals("type")) {
766          this.type = new CodeableConcept();
767          return this.type;
768        }
769        else if (name.equals("reason")) {
770          return addReason();
771        }
772        else if (name.equals("responsibleParty")) {
773          this.responsibleParty = new Reference();
774          return this.responsibleParty;
775        }
776        else
777          return super.addChild(name);
778      }
779
780      public MedicationDispenseSubstitutionComponent copy() {
781        MedicationDispenseSubstitutionComponent dst = new MedicationDispenseSubstitutionComponent();
782        copyValues(dst);
783        return dst;
784      }
785
786      public void copyValues(MedicationDispenseSubstitutionComponent dst) {
787        super.copyValues(dst);
788        dst.wasSubstituted = wasSubstituted == null ? null : wasSubstituted.copy();
789        dst.type = type == null ? null : type.copy();
790        if (reason != null) {
791          dst.reason = new ArrayList<CodeableConcept>();
792          for (CodeableConcept i : reason)
793            dst.reason.add(i.copy());
794        };
795        dst.responsibleParty = responsibleParty == null ? null : responsibleParty.copy();
796      }
797
798      @Override
799      public boolean equalsDeep(Base other_) {
800        if (!super.equalsDeep(other_))
801          return false;
802        if (!(other_ instanceof MedicationDispenseSubstitutionComponent))
803          return false;
804        MedicationDispenseSubstitutionComponent o = (MedicationDispenseSubstitutionComponent) other_;
805        return compareDeep(wasSubstituted, o.wasSubstituted, true) && compareDeep(type, o.type, true) && compareDeep(reason, o.reason, true)
806           && compareDeep(responsibleParty, o.responsibleParty, true);
807      }
808
809      @Override
810      public boolean equalsShallow(Base other_) {
811        if (!super.equalsShallow(other_))
812          return false;
813        if (!(other_ instanceof MedicationDispenseSubstitutionComponent))
814          return false;
815        MedicationDispenseSubstitutionComponent o = (MedicationDispenseSubstitutionComponent) other_;
816        return compareValues(wasSubstituted, o.wasSubstituted, true);
817      }
818
819      public boolean isEmpty() {
820        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(wasSubstituted, type, reason
821          , responsibleParty);
822      }
823
824  public String fhirType() {
825    return "MedicationDispense.substitution";
826
827  }
828
829  }
830
831    /**
832     * Identifiers associated with this Medication Dispense 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.
833     */
834    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
835    @Description(shortDefinition="External identifier", formalDefinition="Identifiers associated with this Medication Dispense 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." )
836    protected List<Identifier> identifier;
837
838    /**
839     * A plan that is fulfilled in whole or in part by this MedicationDispense.
840     */
841    @Child(name = "basedOn", type = {CarePlan.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
842    @Description(shortDefinition="Plan that is fulfilled by this dispense", formalDefinition="A plan that is fulfilled in whole or in part by this MedicationDispense." )
843    protected List<Reference> basedOn;
844
845    /**
846     * The procedure or medication administration that triggered the dispense.
847     */
848    @Child(name = "partOf", type = {Procedure.class, MedicationAdministration.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
849    @Description(shortDefinition="Event that dispense is part of", formalDefinition="The procedure or medication administration that triggered the dispense." )
850    protected List<Reference> partOf;
851
852    /**
853     * A code specifying the state of the set of dispense events.
854     */
855    @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true)
856    @Description(shortDefinition="preparation | in-progress | cancelled | on-hold | completed | entered-in-error | stopped | declined | unknown", formalDefinition="A code specifying the state of the set of dispense events." )
857    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicationdispense-status")
858    protected Enumeration<MedicationDispenseStatusCodes> status;
859
860    /**
861     * Indicates the reason why a dispense was not performed.
862     */
863    @Child(name = "notPerformedReason", type = {CodeableReference.class}, order=4, min=0, max=1, modifier=false, summary=false)
864    @Description(shortDefinition="Why a dispense was not performed", formalDefinition="Indicates the reason why a dispense was not performed." )
865    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicationdispense-status-reason")
866    protected CodeableReference notPerformedReason;
867
868    /**
869     * The date (and maybe time) when the status of the dispense record changed.
870     */
871    @Child(name = "statusChanged", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
872    @Description(shortDefinition="When the status changed", formalDefinition="The date (and maybe time) when the status of the dispense record changed." )
873    protected DateTimeType statusChanged;
874
875    /**
876     * Indicates the type of medication dispense (for example, drug classification like ATC, where meds would be administered, legal category of the medication.).
877     */
878    @Child(name = "category", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
879    @Description(shortDefinition="Type of medication dispense", formalDefinition="Indicates the type of medication dispense (for example, drug classification like ATC, where meds would be administered, legal category of the medication.)." )
880    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicationdispense-admin-location")
881    protected List<CodeableConcept> category;
882
883    /**
884     * Identifies the medication supplied. 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.
885     */
886    @Child(name = "medication", type = {CodeableReference.class}, order=7, min=1, max=1, modifier=false, summary=true)
887    @Description(shortDefinition="What medication was supplied", formalDefinition="Identifies the medication supplied. 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." )
888    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-codes")
889    protected CodeableReference medication;
890
891    /**
892     * A link to a resource representing the person or the group to whom the medication will be given.
893     */
894    @Child(name = "subject", type = {Patient.class, Group.class}, order=8, min=1, max=1, modifier=false, summary=true)
895    @Description(shortDefinition="Who the dispense is for", formalDefinition="A link to a resource representing the person or the group to whom the medication will be given." )
896    protected Reference subject;
897
898    /**
899     * The encounter that establishes the context for this event.
900     */
901    @Child(name = "encounter", type = {Encounter.class}, order=9, min=0, max=1, modifier=false, summary=false)
902    @Description(shortDefinition="Encounter associated with event", formalDefinition="The encounter that establishes the context for this event." )
903    protected Reference encounter;
904
905    /**
906     * Additional information that supports the medication being dispensed.  For example, there may be requirements that a specific lab test has been completed prior to dispensing or the patient's weight at the time of dispensing is documented.
907     */
908    @Child(name = "supportingInformation", type = {Reference.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
909    @Description(shortDefinition="Information that supports the dispensing of the medication", formalDefinition="Additional information that supports the medication being dispensed.  For example, there may be requirements that a specific lab test has been completed prior to dispensing or the patient's weight at the time of dispensing is documented." )
910    protected List<Reference> supportingInformation;
911
912    /**
913     * Indicates who or what performed the event.
914     */
915    @Child(name = "performer", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
916    @Description(shortDefinition="Who performed event", formalDefinition="Indicates who or what performed the event." )
917    protected List<MedicationDispensePerformerComponent> performer;
918
919    /**
920     * The principal physical location where the dispense was performed.
921     */
922    @Child(name = "location", type = {Location.class}, order=12, min=0, max=1, modifier=false, summary=false)
923    @Description(shortDefinition="Where the dispense occurred", formalDefinition="The principal physical location where the dispense was performed." )
924    protected Reference location;
925
926    /**
927     * Indicates the medication order that is being dispensed against.
928     */
929    @Child(name = "authorizingPrescription", type = {MedicationRequest.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
930    @Description(shortDefinition="Medication order that authorizes the dispense", formalDefinition="Indicates the medication order that is being dispensed against." )
931    protected List<Reference> authorizingPrescription;
932
933    /**
934     * Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.
935     */
936    @Child(name = "type", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=false)
937    @Description(shortDefinition="Trial fill, partial fill, emergency fill, etc", formalDefinition="Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." )
938    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-ActPharmacySupplyType")
939    protected CodeableConcept type;
940
941    /**
942     * The amount of medication that has been dispensed. Includes unit of measure.
943     */
944    @Child(name = "quantity", type = {Quantity.class}, order=15, min=0, max=1, modifier=false, summary=false)
945    @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of medication that has been dispensed. Includes unit of measure." )
946    protected Quantity quantity;
947
948    /**
949     * The amount of medication expressed as a timing amount.
950     */
951    @Child(name = "daysSupply", type = {Quantity.class}, order=16, min=0, max=1, modifier=false, summary=false)
952    @Description(shortDefinition="Amount of medication expressed as a timing amount", formalDefinition="The amount of medication expressed as a timing amount." )
953    protected Quantity daysSupply;
954
955    /**
956     * The date (and maybe time) when the dispense activity started if whenPrepared or whenHandedOver is not populated.
957     */
958    @Child(name = "recorded", type = {DateTimeType.class}, order=17, min=0, max=1, modifier=false, summary=false)
959    @Description(shortDefinition="When the recording of the dispense started", formalDefinition="The date (and maybe time) when the dispense activity started if whenPrepared or whenHandedOver is not populated." )
960    protected DateTimeType recorded;
961
962    /**
963     * The time when the dispensed product was packaged and reviewed.
964     */
965    @Child(name = "whenPrepared", type = {DateTimeType.class}, order=18, min=0, max=1, modifier=false, summary=true)
966    @Description(shortDefinition="When product was packaged and reviewed", formalDefinition="The time when the dispensed product was packaged and reviewed." )
967    protected DateTimeType whenPrepared;
968
969    /**
970     * The time the dispensed product was provided to the patient or their representative.
971     */
972    @Child(name = "whenHandedOver", type = {DateTimeType.class}, order=19, min=0, max=1, modifier=false, summary=false)
973    @Description(shortDefinition="When product was given out", formalDefinition="The time the dispensed product was provided to the patient or their representative." )
974    protected DateTimeType whenHandedOver;
975
976    /**
977     * Identification of the facility/location where the medication was/will be shipped to, as part of the dispense event.
978     */
979    @Child(name = "destination", type = {Location.class}, order=20, min=0, max=1, modifier=false, summary=false)
980    @Description(shortDefinition="Where the medication was/will be sent", formalDefinition="Identification of the facility/location where the medication was/will be shipped to, as part of the dispense event." )
981    protected Reference destination;
982
983    /**
984     * Identifies the person who picked up the medication or the location of where the medication was delivered.  This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional or a location.
985     */
986    @Child(name = "receiver", type = {Patient.class, Practitioner.class, RelatedPerson.class, Location.class, PractitionerRole.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
987    @Description(shortDefinition="Who collected the medication or where the medication was delivered", formalDefinition="Identifies the person who picked up the medication or the location of where the medication was delivered.  This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional or a location." )
988    protected List<Reference> receiver;
989
990    /**
991     * Extra information about the dispense that could not be conveyed in the other attributes.
992     */
993    @Child(name = "note", type = {Annotation.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
994    @Description(shortDefinition="Information about the dispense", formalDefinition="Extra information about the dispense that could not be conveyed in the other attributes." )
995    protected List<Annotation> note;
996
997    /**
998     * The full representation of the dose of the medication included in all dosage instructions.  To be used when multiple dosage instructions are included to represent complex dosing such as increasing or tapering doses.
999     */
1000    @Child(name = "renderedDosageInstruction", type = {MarkdownType.class}, order=23, min=0, max=1, modifier=false, summary=false)
1001    @Description(shortDefinition="Full representation of the dosage instructions", formalDefinition="The full representation of the dose of the medication included in all dosage instructions.  To be used when multiple dosage instructions are included to represent complex dosing such as increasing or tapering doses." )
1002    protected MarkdownType renderedDosageInstruction;
1003
1004    /**
1005     * Indicates how the medication is to be used by the patient.
1006     */
1007    @Child(name = "dosageInstruction", type = {Dosage.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1008    @Description(shortDefinition="How the medication is to be used by the patient or administered by the caregiver", formalDefinition="Indicates how the medication is to be used by the patient." )
1009    protected List<Dosage> dosageInstruction;
1010
1011    /**
1012     * Indicates whether or not substitution was made as part of the dispense.  In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen.  This block explains what substitution did or did not happen and why.  If nothing is specified, substitution was not done.
1013     */
1014    @Child(name = "substitution", type = {}, order=25, min=0, max=1, modifier=false, summary=false)
1015    @Description(shortDefinition="Whether a substitution was performed on the dispense", formalDefinition="Indicates whether or not substitution was made as part of the dispense.  In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen.  This block explains what substitution did or did not happen and why.  If nothing is specified, substitution was not done." )
1016    protected MedicationDispenseSubstitutionComponent substitution;
1017
1018    /**
1019     * A summary of the events of interest that have occurred, such as when the dispense was verified.
1020     */
1021    @Child(name = "eventHistory", type = {Provenance.class}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1022    @Description(shortDefinition="A list of relevant lifecycle events", formalDefinition="A summary of the events of interest that have occurred, such as when the dispense was verified." )
1023    protected List<Reference> eventHistory;
1024
1025    private static final long serialVersionUID = 88138059L;
1026
1027  /**
1028   * Constructor
1029   */
1030    public MedicationDispense() {
1031      super();
1032    }
1033
1034  /**
1035   * Constructor
1036   */
1037    public MedicationDispense(MedicationDispenseStatusCodes status, CodeableReference medication, Reference subject) {
1038      super();
1039      this.setStatus(status);
1040      this.setMedication(medication);
1041      this.setSubject(subject);
1042    }
1043
1044    /**
1045     * @return {@link #identifier} (Identifiers associated with this Medication Dispense 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.)
1046     */
1047    public List<Identifier> getIdentifier() { 
1048      if (this.identifier == null)
1049        this.identifier = new ArrayList<Identifier>();
1050      return this.identifier;
1051    }
1052
1053    /**
1054     * @return Returns a reference to <code>this</code> for easy method chaining
1055     */
1056    public MedicationDispense setIdentifier(List<Identifier> theIdentifier) { 
1057      this.identifier = theIdentifier;
1058      return this;
1059    }
1060
1061    public boolean hasIdentifier() { 
1062      if (this.identifier == null)
1063        return false;
1064      for (Identifier item : this.identifier)
1065        if (!item.isEmpty())
1066          return true;
1067      return false;
1068    }
1069
1070    public Identifier addIdentifier() { //3
1071      Identifier t = new Identifier();
1072      if (this.identifier == null)
1073        this.identifier = new ArrayList<Identifier>();
1074      this.identifier.add(t);
1075      return t;
1076    }
1077
1078    public MedicationDispense addIdentifier(Identifier t) { //3
1079      if (t == null)
1080        return this;
1081      if (this.identifier == null)
1082        this.identifier = new ArrayList<Identifier>();
1083      this.identifier.add(t);
1084      return this;
1085    }
1086
1087    /**
1088     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1089     */
1090    public Identifier getIdentifierFirstRep() { 
1091      if (getIdentifier().isEmpty()) {
1092        addIdentifier();
1093      }
1094      return getIdentifier().get(0);
1095    }
1096
1097    /**
1098     * @return {@link #basedOn} (A plan that is fulfilled in whole or in part by this MedicationDispense.)
1099     */
1100    public List<Reference> getBasedOn() { 
1101      if (this.basedOn == null)
1102        this.basedOn = new ArrayList<Reference>();
1103      return this.basedOn;
1104    }
1105
1106    /**
1107     * @return Returns a reference to <code>this</code> for easy method chaining
1108     */
1109    public MedicationDispense setBasedOn(List<Reference> theBasedOn) { 
1110      this.basedOn = theBasedOn;
1111      return this;
1112    }
1113
1114    public boolean hasBasedOn() { 
1115      if (this.basedOn == null)
1116        return false;
1117      for (Reference item : this.basedOn)
1118        if (!item.isEmpty())
1119          return true;
1120      return false;
1121    }
1122
1123    public Reference addBasedOn() { //3
1124      Reference t = new Reference();
1125      if (this.basedOn == null)
1126        this.basedOn = new ArrayList<Reference>();
1127      this.basedOn.add(t);
1128      return t;
1129    }
1130
1131    public MedicationDispense addBasedOn(Reference t) { //3
1132      if (t == null)
1133        return this;
1134      if (this.basedOn == null)
1135        this.basedOn = new ArrayList<Reference>();
1136      this.basedOn.add(t);
1137      return this;
1138    }
1139
1140    /**
1141     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
1142     */
1143    public Reference getBasedOnFirstRep() { 
1144      if (getBasedOn().isEmpty()) {
1145        addBasedOn();
1146      }
1147      return getBasedOn().get(0);
1148    }
1149
1150    /**
1151     * @return {@link #partOf} (The procedure or medication administration that triggered the dispense.)
1152     */
1153    public List<Reference> getPartOf() { 
1154      if (this.partOf == null)
1155        this.partOf = new ArrayList<Reference>();
1156      return this.partOf;
1157    }
1158
1159    /**
1160     * @return Returns a reference to <code>this</code> for easy method chaining
1161     */
1162    public MedicationDispense setPartOf(List<Reference> thePartOf) { 
1163      this.partOf = thePartOf;
1164      return this;
1165    }
1166
1167    public boolean hasPartOf() { 
1168      if (this.partOf == null)
1169        return false;
1170      for (Reference item : this.partOf)
1171        if (!item.isEmpty())
1172          return true;
1173      return false;
1174    }
1175
1176    public Reference addPartOf() { //3
1177      Reference t = new Reference();
1178      if (this.partOf == null)
1179        this.partOf = new ArrayList<Reference>();
1180      this.partOf.add(t);
1181      return t;
1182    }
1183
1184    public MedicationDispense addPartOf(Reference t) { //3
1185      if (t == null)
1186        return this;
1187      if (this.partOf == null)
1188        this.partOf = new ArrayList<Reference>();
1189      this.partOf.add(t);
1190      return this;
1191    }
1192
1193    /**
1194     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist {3}
1195     */
1196    public Reference getPartOfFirstRep() { 
1197      if (getPartOf().isEmpty()) {
1198        addPartOf();
1199      }
1200      return getPartOf().get(0);
1201    }
1202
1203    /**
1204     * @return {@link #status} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1205     */
1206    public Enumeration<MedicationDispenseStatusCodes> getStatusElement() { 
1207      if (this.status == null)
1208        if (Configuration.errorOnAutoCreate())
1209          throw new Error("Attempt to auto-create MedicationDispense.status");
1210        else if (Configuration.doAutoCreate())
1211          this.status = new Enumeration<MedicationDispenseStatusCodes>(new MedicationDispenseStatusCodesEnumFactory()); // bb
1212      return this.status;
1213    }
1214
1215    public boolean hasStatusElement() { 
1216      return this.status != null && !this.status.isEmpty();
1217    }
1218
1219    public boolean hasStatus() { 
1220      return this.status != null && !this.status.isEmpty();
1221    }
1222
1223    /**
1224     * @param value {@link #status} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1225     */
1226    public MedicationDispense setStatusElement(Enumeration<MedicationDispenseStatusCodes> value) { 
1227      this.status = value;
1228      return this;
1229    }
1230
1231    /**
1232     * @return A code specifying the state of the set of dispense events.
1233     */
1234    public MedicationDispenseStatusCodes getStatus() { 
1235      return this.status == null ? null : this.status.getValue();
1236    }
1237
1238    /**
1239     * @param value A code specifying the state of the set of dispense events.
1240     */
1241    public MedicationDispense setStatus(MedicationDispenseStatusCodes value) { 
1242        if (this.status == null)
1243          this.status = new Enumeration<MedicationDispenseStatusCodes>(new MedicationDispenseStatusCodesEnumFactory());
1244        this.status.setValue(value);
1245      return this;
1246    }
1247
1248    /**
1249     * @return {@link #notPerformedReason} (Indicates the reason why a dispense was not performed.)
1250     */
1251    public CodeableReference getNotPerformedReason() { 
1252      if (this.notPerformedReason == null)
1253        if (Configuration.errorOnAutoCreate())
1254          throw new Error("Attempt to auto-create MedicationDispense.notPerformedReason");
1255        else if (Configuration.doAutoCreate())
1256          this.notPerformedReason = new CodeableReference(); // cc
1257      return this.notPerformedReason;
1258    }
1259
1260    public boolean hasNotPerformedReason() { 
1261      return this.notPerformedReason != null && !this.notPerformedReason.isEmpty();
1262    }
1263
1264    /**
1265     * @param value {@link #notPerformedReason} (Indicates the reason why a dispense was not performed.)
1266     */
1267    public MedicationDispense setNotPerformedReason(CodeableReference value) { 
1268      this.notPerformedReason = value;
1269      return this;
1270    }
1271
1272    /**
1273     * @return {@link #statusChanged} (The date (and maybe time) when the status of the dispense record changed.). This is the underlying object with id, value and extensions. The accessor "getStatusChanged" gives direct access to the value
1274     */
1275    public DateTimeType getStatusChangedElement() { 
1276      if (this.statusChanged == null)
1277        if (Configuration.errorOnAutoCreate())
1278          throw new Error("Attempt to auto-create MedicationDispense.statusChanged");
1279        else if (Configuration.doAutoCreate())
1280          this.statusChanged = new DateTimeType(); // bb
1281      return this.statusChanged;
1282    }
1283
1284    public boolean hasStatusChangedElement() { 
1285      return this.statusChanged != null && !this.statusChanged.isEmpty();
1286    }
1287
1288    public boolean hasStatusChanged() { 
1289      return this.statusChanged != null && !this.statusChanged.isEmpty();
1290    }
1291
1292    /**
1293     * @param value {@link #statusChanged} (The date (and maybe time) when the status of the dispense record changed.). This is the underlying object with id, value and extensions. The accessor "getStatusChanged" gives direct access to the value
1294     */
1295    public MedicationDispense setStatusChangedElement(DateTimeType value) { 
1296      this.statusChanged = value;
1297      return this;
1298    }
1299
1300    /**
1301     * @return The date (and maybe time) when the status of the dispense record changed.
1302     */
1303    public Date getStatusChanged() { 
1304      return this.statusChanged == null ? null : this.statusChanged.getValue();
1305    }
1306
1307    /**
1308     * @param value The date (and maybe time) when the status of the dispense record changed.
1309     */
1310    public MedicationDispense setStatusChanged(Date value) { 
1311      if (value == null)
1312        this.statusChanged = null;
1313      else {
1314        if (this.statusChanged == null)
1315          this.statusChanged = new DateTimeType();
1316        this.statusChanged.setValue(value);
1317      }
1318      return this;
1319    }
1320
1321    /**
1322     * @return {@link #category} (Indicates the type of medication dispense (for example, drug classification like ATC, where meds would be administered, legal category of the medication.).)
1323     */
1324    public List<CodeableConcept> getCategory() { 
1325      if (this.category == null)
1326        this.category = new ArrayList<CodeableConcept>();
1327      return this.category;
1328    }
1329
1330    /**
1331     * @return Returns a reference to <code>this</code> for easy method chaining
1332     */
1333    public MedicationDispense setCategory(List<CodeableConcept> theCategory) { 
1334      this.category = theCategory;
1335      return this;
1336    }
1337
1338    public boolean hasCategory() { 
1339      if (this.category == null)
1340        return false;
1341      for (CodeableConcept item : this.category)
1342        if (!item.isEmpty())
1343          return true;
1344      return false;
1345    }
1346
1347    public CodeableConcept addCategory() { //3
1348      CodeableConcept t = new CodeableConcept();
1349      if (this.category == null)
1350        this.category = new ArrayList<CodeableConcept>();
1351      this.category.add(t);
1352      return t;
1353    }
1354
1355    public MedicationDispense addCategory(CodeableConcept t) { //3
1356      if (t == null)
1357        return this;
1358      if (this.category == null)
1359        this.category = new ArrayList<CodeableConcept>();
1360      this.category.add(t);
1361      return this;
1362    }
1363
1364    /**
1365     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
1366     */
1367    public CodeableConcept getCategoryFirstRep() { 
1368      if (getCategory().isEmpty()) {
1369        addCategory();
1370      }
1371      return getCategory().get(0);
1372    }
1373
1374    /**
1375     * @return {@link #medication} (Identifies the medication supplied. 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.)
1376     */
1377    public CodeableReference getMedication() { 
1378      if (this.medication == null)
1379        if (Configuration.errorOnAutoCreate())
1380          throw new Error("Attempt to auto-create MedicationDispense.medication");
1381        else if (Configuration.doAutoCreate())
1382          this.medication = new CodeableReference(); // cc
1383      return this.medication;
1384    }
1385
1386    public boolean hasMedication() { 
1387      return this.medication != null && !this.medication.isEmpty();
1388    }
1389
1390    /**
1391     * @param value {@link #medication} (Identifies the medication supplied. 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.)
1392     */
1393    public MedicationDispense setMedication(CodeableReference value) { 
1394      this.medication = value;
1395      return this;
1396    }
1397
1398    /**
1399     * @return {@link #subject} (A link to a resource representing the person or the group to whom the medication will be given.)
1400     */
1401    public Reference getSubject() { 
1402      if (this.subject == null)
1403        if (Configuration.errorOnAutoCreate())
1404          throw new Error("Attempt to auto-create MedicationDispense.subject");
1405        else if (Configuration.doAutoCreate())
1406          this.subject = new Reference(); // cc
1407      return this.subject;
1408    }
1409
1410    public boolean hasSubject() { 
1411      return this.subject != null && !this.subject.isEmpty();
1412    }
1413
1414    /**
1415     * @param value {@link #subject} (A link to a resource representing the person or the group to whom the medication will be given.)
1416     */
1417    public MedicationDispense setSubject(Reference value) { 
1418      this.subject = value;
1419      return this;
1420    }
1421
1422    /**
1423     * @return {@link #encounter} (The encounter that establishes the context for this event.)
1424     */
1425    public Reference getEncounter() { 
1426      if (this.encounter == null)
1427        if (Configuration.errorOnAutoCreate())
1428          throw new Error("Attempt to auto-create MedicationDispense.encounter");
1429        else if (Configuration.doAutoCreate())
1430          this.encounter = new Reference(); // cc
1431      return this.encounter;
1432    }
1433
1434    public boolean hasEncounter() { 
1435      return this.encounter != null && !this.encounter.isEmpty();
1436    }
1437
1438    /**
1439     * @param value {@link #encounter} (The encounter that establishes the context for this event.)
1440     */
1441    public MedicationDispense setEncounter(Reference value) { 
1442      this.encounter = value;
1443      return this;
1444    }
1445
1446    /**
1447     * @return {@link #supportingInformation} (Additional information that supports the medication being dispensed.  For example, there may be requirements that a specific lab test has been completed prior to dispensing or the patient's weight at the time of dispensing is documented.)
1448     */
1449    public List<Reference> getSupportingInformation() { 
1450      if (this.supportingInformation == null)
1451        this.supportingInformation = new ArrayList<Reference>();
1452      return this.supportingInformation;
1453    }
1454
1455    /**
1456     * @return Returns a reference to <code>this</code> for easy method chaining
1457     */
1458    public MedicationDispense setSupportingInformation(List<Reference> theSupportingInformation) { 
1459      this.supportingInformation = theSupportingInformation;
1460      return this;
1461    }
1462
1463    public boolean hasSupportingInformation() { 
1464      if (this.supportingInformation == null)
1465        return false;
1466      for (Reference item : this.supportingInformation)
1467        if (!item.isEmpty())
1468          return true;
1469      return false;
1470    }
1471
1472    public Reference addSupportingInformation() { //3
1473      Reference t = new Reference();
1474      if (this.supportingInformation == null)
1475        this.supportingInformation = new ArrayList<Reference>();
1476      this.supportingInformation.add(t);
1477      return t;
1478    }
1479
1480    public MedicationDispense addSupportingInformation(Reference t) { //3
1481      if (t == null)
1482        return this;
1483      if (this.supportingInformation == null)
1484        this.supportingInformation = new ArrayList<Reference>();
1485      this.supportingInformation.add(t);
1486      return this;
1487    }
1488
1489    /**
1490     * @return The first repetition of repeating field {@link #supportingInformation}, creating it if it does not already exist {3}
1491     */
1492    public Reference getSupportingInformationFirstRep() { 
1493      if (getSupportingInformation().isEmpty()) {
1494        addSupportingInformation();
1495      }
1496      return getSupportingInformation().get(0);
1497    }
1498
1499    /**
1500     * @return {@link #performer} (Indicates who or what performed the event.)
1501     */
1502    public List<MedicationDispensePerformerComponent> getPerformer() { 
1503      if (this.performer == null)
1504        this.performer = new ArrayList<MedicationDispensePerformerComponent>();
1505      return this.performer;
1506    }
1507
1508    /**
1509     * @return Returns a reference to <code>this</code> for easy method chaining
1510     */
1511    public MedicationDispense setPerformer(List<MedicationDispensePerformerComponent> thePerformer) { 
1512      this.performer = thePerformer;
1513      return this;
1514    }
1515
1516    public boolean hasPerformer() { 
1517      if (this.performer == null)
1518        return false;
1519      for (MedicationDispensePerformerComponent item : this.performer)
1520        if (!item.isEmpty())
1521          return true;
1522      return false;
1523    }
1524
1525    public MedicationDispensePerformerComponent addPerformer() { //3
1526      MedicationDispensePerformerComponent t = new MedicationDispensePerformerComponent();
1527      if (this.performer == null)
1528        this.performer = new ArrayList<MedicationDispensePerformerComponent>();
1529      this.performer.add(t);
1530      return t;
1531    }
1532
1533    public MedicationDispense addPerformer(MedicationDispensePerformerComponent t) { //3
1534      if (t == null)
1535        return this;
1536      if (this.performer == null)
1537        this.performer = new ArrayList<MedicationDispensePerformerComponent>();
1538      this.performer.add(t);
1539      return this;
1540    }
1541
1542    /**
1543     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist {3}
1544     */
1545    public MedicationDispensePerformerComponent getPerformerFirstRep() { 
1546      if (getPerformer().isEmpty()) {
1547        addPerformer();
1548      }
1549      return getPerformer().get(0);
1550    }
1551
1552    /**
1553     * @return {@link #location} (The principal physical location where the dispense was performed.)
1554     */
1555    public Reference getLocation() { 
1556      if (this.location == null)
1557        if (Configuration.errorOnAutoCreate())
1558          throw new Error("Attempt to auto-create MedicationDispense.location");
1559        else if (Configuration.doAutoCreate())
1560          this.location = new Reference(); // cc
1561      return this.location;
1562    }
1563
1564    public boolean hasLocation() { 
1565      return this.location != null && !this.location.isEmpty();
1566    }
1567
1568    /**
1569     * @param value {@link #location} (The principal physical location where the dispense was performed.)
1570     */
1571    public MedicationDispense setLocation(Reference value) { 
1572      this.location = value;
1573      return this;
1574    }
1575
1576    /**
1577     * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.)
1578     */
1579    public List<Reference> getAuthorizingPrescription() { 
1580      if (this.authorizingPrescription == null)
1581        this.authorizingPrescription = new ArrayList<Reference>();
1582      return this.authorizingPrescription;
1583    }
1584
1585    /**
1586     * @return Returns a reference to <code>this</code> for easy method chaining
1587     */
1588    public MedicationDispense setAuthorizingPrescription(List<Reference> theAuthorizingPrescription) { 
1589      this.authorizingPrescription = theAuthorizingPrescription;
1590      return this;
1591    }
1592
1593    public boolean hasAuthorizingPrescription() { 
1594      if (this.authorizingPrescription == null)
1595        return false;
1596      for (Reference item : this.authorizingPrescription)
1597        if (!item.isEmpty())
1598          return true;
1599      return false;
1600    }
1601
1602    public Reference addAuthorizingPrescription() { //3
1603      Reference t = new Reference();
1604      if (this.authorizingPrescription == null)
1605        this.authorizingPrescription = new ArrayList<Reference>();
1606      this.authorizingPrescription.add(t);
1607      return t;
1608    }
1609
1610    public MedicationDispense addAuthorizingPrescription(Reference t) { //3
1611      if (t == null)
1612        return this;
1613      if (this.authorizingPrescription == null)
1614        this.authorizingPrescription = new ArrayList<Reference>();
1615      this.authorizingPrescription.add(t);
1616      return this;
1617    }
1618
1619    /**
1620     * @return The first repetition of repeating field {@link #authorizingPrescription}, creating it if it does not already exist {3}
1621     */
1622    public Reference getAuthorizingPrescriptionFirstRep() { 
1623      if (getAuthorizingPrescription().isEmpty()) {
1624        addAuthorizingPrescription();
1625      }
1626      return getAuthorizingPrescription().get(0);
1627    }
1628
1629    /**
1630     * @return {@link #type} (Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.)
1631     */
1632    public CodeableConcept getType() { 
1633      if (this.type == null)
1634        if (Configuration.errorOnAutoCreate())
1635          throw new Error("Attempt to auto-create MedicationDispense.type");
1636        else if (Configuration.doAutoCreate())
1637          this.type = new CodeableConcept(); // cc
1638      return this.type;
1639    }
1640
1641    public boolean hasType() { 
1642      return this.type != null && !this.type.isEmpty();
1643    }
1644
1645    /**
1646     * @param value {@link #type} (Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.)
1647     */
1648    public MedicationDispense setType(CodeableConcept value) { 
1649      this.type = value;
1650      return this;
1651    }
1652
1653    /**
1654     * @return {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.)
1655     */
1656    public Quantity getQuantity() { 
1657      if (this.quantity == null)
1658        if (Configuration.errorOnAutoCreate())
1659          throw new Error("Attempt to auto-create MedicationDispense.quantity");
1660        else if (Configuration.doAutoCreate())
1661          this.quantity = new Quantity(); // cc
1662      return this.quantity;
1663    }
1664
1665    public boolean hasQuantity() { 
1666      return this.quantity != null && !this.quantity.isEmpty();
1667    }
1668
1669    /**
1670     * @param value {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.)
1671     */
1672    public MedicationDispense setQuantity(Quantity value) { 
1673      this.quantity = value;
1674      return this;
1675    }
1676
1677    /**
1678     * @return {@link #daysSupply} (The amount of medication expressed as a timing amount.)
1679     */
1680    public Quantity getDaysSupply() { 
1681      if (this.daysSupply == null)
1682        if (Configuration.errorOnAutoCreate())
1683          throw new Error("Attempt to auto-create MedicationDispense.daysSupply");
1684        else if (Configuration.doAutoCreate())
1685          this.daysSupply = new Quantity(); // cc
1686      return this.daysSupply;
1687    }
1688
1689    public boolean hasDaysSupply() { 
1690      return this.daysSupply != null && !this.daysSupply.isEmpty();
1691    }
1692
1693    /**
1694     * @param value {@link #daysSupply} (The amount of medication expressed as a timing amount.)
1695     */
1696    public MedicationDispense setDaysSupply(Quantity value) { 
1697      this.daysSupply = value;
1698      return this;
1699    }
1700
1701    /**
1702     * @return {@link #recorded} (The date (and maybe time) when the dispense activity started if whenPrepared or whenHandedOver is not populated.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
1703     */
1704    public DateTimeType getRecordedElement() { 
1705      if (this.recorded == null)
1706        if (Configuration.errorOnAutoCreate())
1707          throw new Error("Attempt to auto-create MedicationDispense.recorded");
1708        else if (Configuration.doAutoCreate())
1709          this.recorded = new DateTimeType(); // bb
1710      return this.recorded;
1711    }
1712
1713    public boolean hasRecordedElement() { 
1714      return this.recorded != null && !this.recorded.isEmpty();
1715    }
1716
1717    public boolean hasRecorded() { 
1718      return this.recorded != null && !this.recorded.isEmpty();
1719    }
1720
1721    /**
1722     * @param value {@link #recorded} (The date (and maybe time) when the dispense activity started if whenPrepared or whenHandedOver is not populated.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
1723     */
1724    public MedicationDispense setRecordedElement(DateTimeType value) { 
1725      this.recorded = value;
1726      return this;
1727    }
1728
1729    /**
1730     * @return The date (and maybe time) when the dispense activity started if whenPrepared or whenHandedOver is not populated.
1731     */
1732    public Date getRecorded() { 
1733      return this.recorded == null ? null : this.recorded.getValue();
1734    }
1735
1736    /**
1737     * @param value The date (and maybe time) when the dispense activity started if whenPrepared or whenHandedOver is not populated.
1738     */
1739    public MedicationDispense setRecorded(Date value) { 
1740      if (value == null)
1741        this.recorded = null;
1742      else {
1743        if (this.recorded == null)
1744          this.recorded = new DateTimeType();
1745        this.recorded.setValue(value);
1746      }
1747      return this;
1748    }
1749
1750    /**
1751     * @return {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value
1752     */
1753    public DateTimeType getWhenPreparedElement() { 
1754      if (this.whenPrepared == null)
1755        if (Configuration.errorOnAutoCreate())
1756          throw new Error("Attempt to auto-create MedicationDispense.whenPrepared");
1757        else if (Configuration.doAutoCreate())
1758          this.whenPrepared = new DateTimeType(); // bb
1759      return this.whenPrepared;
1760    }
1761
1762    public boolean hasWhenPreparedElement() { 
1763      return this.whenPrepared != null && !this.whenPrepared.isEmpty();
1764    }
1765
1766    public boolean hasWhenPrepared() { 
1767      return this.whenPrepared != null && !this.whenPrepared.isEmpty();
1768    }
1769
1770    /**
1771     * @param value {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value
1772     */
1773    public MedicationDispense setWhenPreparedElement(DateTimeType value) { 
1774      this.whenPrepared = value;
1775      return this;
1776    }
1777
1778    /**
1779     * @return The time when the dispensed product was packaged and reviewed.
1780     */
1781    public Date getWhenPrepared() { 
1782      return this.whenPrepared == null ? null : this.whenPrepared.getValue();
1783    }
1784
1785    /**
1786     * @param value The time when the dispensed product was packaged and reviewed.
1787     */
1788    public MedicationDispense setWhenPrepared(Date value) { 
1789      if (value == null)
1790        this.whenPrepared = null;
1791      else {
1792        if (this.whenPrepared == null)
1793          this.whenPrepared = new DateTimeType();
1794        this.whenPrepared.setValue(value);
1795      }
1796      return this;
1797    }
1798
1799    /**
1800     * @return {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value
1801     */
1802    public DateTimeType getWhenHandedOverElement() { 
1803      if (this.whenHandedOver == null)
1804        if (Configuration.errorOnAutoCreate())
1805          throw new Error("Attempt to auto-create MedicationDispense.whenHandedOver");
1806        else if (Configuration.doAutoCreate())
1807          this.whenHandedOver = new DateTimeType(); // bb
1808      return this.whenHandedOver;
1809    }
1810
1811    public boolean hasWhenHandedOverElement() { 
1812      return this.whenHandedOver != null && !this.whenHandedOver.isEmpty();
1813    }
1814
1815    public boolean hasWhenHandedOver() { 
1816      return this.whenHandedOver != null && !this.whenHandedOver.isEmpty();
1817    }
1818
1819    /**
1820     * @param value {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value
1821     */
1822    public MedicationDispense setWhenHandedOverElement(DateTimeType value) { 
1823      this.whenHandedOver = value;
1824      return this;
1825    }
1826
1827    /**
1828     * @return The time the dispensed product was provided to the patient or their representative.
1829     */
1830    public Date getWhenHandedOver() { 
1831      return this.whenHandedOver == null ? null : this.whenHandedOver.getValue();
1832    }
1833
1834    /**
1835     * @param value The time the dispensed product was provided to the patient or their representative.
1836     */
1837    public MedicationDispense setWhenHandedOver(Date value) { 
1838      if (value == null)
1839        this.whenHandedOver = null;
1840      else {
1841        if (this.whenHandedOver == null)
1842          this.whenHandedOver = new DateTimeType();
1843        this.whenHandedOver.setValue(value);
1844      }
1845      return this;
1846    }
1847
1848    /**
1849     * @return {@link #destination} (Identification of the facility/location where the medication was/will be shipped to, as part of the dispense event.)
1850     */
1851    public Reference getDestination() { 
1852      if (this.destination == null)
1853        if (Configuration.errorOnAutoCreate())
1854          throw new Error("Attempt to auto-create MedicationDispense.destination");
1855        else if (Configuration.doAutoCreate())
1856          this.destination = new Reference(); // cc
1857      return this.destination;
1858    }
1859
1860    public boolean hasDestination() { 
1861      return this.destination != null && !this.destination.isEmpty();
1862    }
1863
1864    /**
1865     * @param value {@link #destination} (Identification of the facility/location where the medication was/will be shipped to, as part of the dispense event.)
1866     */
1867    public MedicationDispense setDestination(Reference value) { 
1868      this.destination = value;
1869      return this;
1870    }
1871
1872    /**
1873     * @return {@link #receiver} (Identifies the person who picked up the medication or the location of where the medication was delivered.  This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional or a location.)
1874     */
1875    public List<Reference> getReceiver() { 
1876      if (this.receiver == null)
1877        this.receiver = new ArrayList<Reference>();
1878      return this.receiver;
1879    }
1880
1881    /**
1882     * @return Returns a reference to <code>this</code> for easy method chaining
1883     */
1884    public MedicationDispense setReceiver(List<Reference> theReceiver) { 
1885      this.receiver = theReceiver;
1886      return this;
1887    }
1888
1889    public boolean hasReceiver() { 
1890      if (this.receiver == null)
1891        return false;
1892      for (Reference item : this.receiver)
1893        if (!item.isEmpty())
1894          return true;
1895      return false;
1896    }
1897
1898    public Reference addReceiver() { //3
1899      Reference t = new Reference();
1900      if (this.receiver == null)
1901        this.receiver = new ArrayList<Reference>();
1902      this.receiver.add(t);
1903      return t;
1904    }
1905
1906    public MedicationDispense addReceiver(Reference t) { //3
1907      if (t == null)
1908        return this;
1909      if (this.receiver == null)
1910        this.receiver = new ArrayList<Reference>();
1911      this.receiver.add(t);
1912      return this;
1913    }
1914
1915    /**
1916     * @return The first repetition of repeating field {@link #receiver}, creating it if it does not already exist {3}
1917     */
1918    public Reference getReceiverFirstRep() { 
1919      if (getReceiver().isEmpty()) {
1920        addReceiver();
1921      }
1922      return getReceiver().get(0);
1923    }
1924
1925    /**
1926     * @return {@link #note} (Extra information about the dispense that could not be conveyed in the other attributes.)
1927     */
1928    public List<Annotation> getNote() { 
1929      if (this.note == null)
1930        this.note = new ArrayList<Annotation>();
1931      return this.note;
1932    }
1933
1934    /**
1935     * @return Returns a reference to <code>this</code> for easy method chaining
1936     */
1937    public MedicationDispense setNote(List<Annotation> theNote) { 
1938      this.note = theNote;
1939      return this;
1940    }
1941
1942    public boolean hasNote() { 
1943      if (this.note == null)
1944        return false;
1945      for (Annotation item : this.note)
1946        if (!item.isEmpty())
1947          return true;
1948      return false;
1949    }
1950
1951    public Annotation addNote() { //3
1952      Annotation t = new Annotation();
1953      if (this.note == null)
1954        this.note = new ArrayList<Annotation>();
1955      this.note.add(t);
1956      return t;
1957    }
1958
1959    public MedicationDispense addNote(Annotation t) { //3
1960      if (t == null)
1961        return this;
1962      if (this.note == null)
1963        this.note = new ArrayList<Annotation>();
1964      this.note.add(t);
1965      return this;
1966    }
1967
1968    /**
1969     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
1970     */
1971    public Annotation getNoteFirstRep() { 
1972      if (getNote().isEmpty()) {
1973        addNote();
1974      }
1975      return getNote().get(0);
1976    }
1977
1978    /**
1979     * @return {@link #renderedDosageInstruction} (The full representation of the dose of the medication included in all dosage instructions.  To be used when multiple dosage instructions are included to represent complex dosing such as increasing or tapering doses.). This is the underlying object with id, value and extensions. The accessor "getRenderedDosageInstruction" gives direct access to the value
1980     */
1981    public MarkdownType getRenderedDosageInstructionElement() { 
1982      if (this.renderedDosageInstruction == null)
1983        if (Configuration.errorOnAutoCreate())
1984          throw new Error("Attempt to auto-create MedicationDispense.renderedDosageInstruction");
1985        else if (Configuration.doAutoCreate())
1986          this.renderedDosageInstruction = new MarkdownType(); // bb
1987      return this.renderedDosageInstruction;
1988    }
1989
1990    public boolean hasRenderedDosageInstructionElement() { 
1991      return this.renderedDosageInstruction != null && !this.renderedDosageInstruction.isEmpty();
1992    }
1993
1994    public boolean hasRenderedDosageInstruction() { 
1995      return this.renderedDosageInstruction != null && !this.renderedDosageInstruction.isEmpty();
1996    }
1997
1998    /**
1999     * @param value {@link #renderedDosageInstruction} (The full representation of the dose of the medication included in all dosage instructions.  To be used when multiple dosage instructions are included to represent complex dosing such as increasing or tapering doses.). This is the underlying object with id, value and extensions. The accessor "getRenderedDosageInstruction" gives direct access to the value
2000     */
2001    public MedicationDispense setRenderedDosageInstructionElement(MarkdownType value) { 
2002      this.renderedDosageInstruction = value;
2003      return this;
2004    }
2005
2006    /**
2007     * @return The full representation of the dose of the medication included in all dosage instructions.  To be used when multiple dosage instructions are included to represent complex dosing such as increasing or tapering doses.
2008     */
2009    public String getRenderedDosageInstruction() { 
2010      return this.renderedDosageInstruction == null ? null : this.renderedDosageInstruction.getValue();
2011    }
2012
2013    /**
2014     * @param value The full representation of the dose of the medication included in all dosage instructions.  To be used when multiple dosage instructions are included to represent complex dosing such as increasing or tapering doses.
2015     */
2016    public MedicationDispense setRenderedDosageInstruction(String value) { 
2017      if (Utilities.noString(value))
2018        this.renderedDosageInstruction = null;
2019      else {
2020        if (this.renderedDosageInstruction == null)
2021          this.renderedDosageInstruction = new MarkdownType();
2022        this.renderedDosageInstruction.setValue(value);
2023      }
2024      return this;
2025    }
2026
2027    /**
2028     * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.)
2029     */
2030    public List<Dosage> getDosageInstruction() { 
2031      if (this.dosageInstruction == null)
2032        this.dosageInstruction = new ArrayList<Dosage>();
2033      return this.dosageInstruction;
2034    }
2035
2036    /**
2037     * @return Returns a reference to <code>this</code> for easy method chaining
2038     */
2039    public MedicationDispense setDosageInstruction(List<Dosage> theDosageInstruction) { 
2040      this.dosageInstruction = theDosageInstruction;
2041      return this;
2042    }
2043
2044    public boolean hasDosageInstruction() { 
2045      if (this.dosageInstruction == null)
2046        return false;
2047      for (Dosage item : this.dosageInstruction)
2048        if (!item.isEmpty())
2049          return true;
2050      return false;
2051    }
2052
2053    public Dosage addDosageInstruction() { //3
2054      Dosage t = new Dosage();
2055      if (this.dosageInstruction == null)
2056        this.dosageInstruction = new ArrayList<Dosage>();
2057      this.dosageInstruction.add(t);
2058      return t;
2059    }
2060
2061    public MedicationDispense addDosageInstruction(Dosage t) { //3
2062      if (t == null)
2063        return this;
2064      if (this.dosageInstruction == null)
2065        this.dosageInstruction = new ArrayList<Dosage>();
2066      this.dosageInstruction.add(t);
2067      return this;
2068    }
2069
2070    /**
2071     * @return The first repetition of repeating field {@link #dosageInstruction}, creating it if it does not already exist {3}
2072     */
2073    public Dosage getDosageInstructionFirstRep() { 
2074      if (getDosageInstruction().isEmpty()) {
2075        addDosageInstruction();
2076      }
2077      return getDosageInstruction().get(0);
2078    }
2079
2080    /**
2081     * @return {@link #substitution} (Indicates whether or not substitution was made as part of the dispense.  In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen.  This block explains what substitution did or did not happen and why.  If nothing is specified, substitution was not done.)
2082     */
2083    public MedicationDispenseSubstitutionComponent getSubstitution() { 
2084      if (this.substitution == null)
2085        if (Configuration.errorOnAutoCreate())
2086          throw new Error("Attempt to auto-create MedicationDispense.substitution");
2087        else if (Configuration.doAutoCreate())
2088          this.substitution = new MedicationDispenseSubstitutionComponent(); // cc
2089      return this.substitution;
2090    }
2091
2092    public boolean hasSubstitution() { 
2093      return this.substitution != null && !this.substitution.isEmpty();
2094    }
2095
2096    /**
2097     * @param value {@link #substitution} (Indicates whether or not substitution was made as part of the dispense.  In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen.  This block explains what substitution did or did not happen and why.  If nothing is specified, substitution was not done.)
2098     */
2099    public MedicationDispense setSubstitution(MedicationDispenseSubstitutionComponent value) { 
2100      this.substitution = value;
2101      return this;
2102    }
2103
2104    /**
2105     * @return {@link #eventHistory} (A summary of the events of interest that have occurred, such as when the dispense was verified.)
2106     */
2107    public List<Reference> getEventHistory() { 
2108      if (this.eventHistory == null)
2109        this.eventHistory = new ArrayList<Reference>();
2110      return this.eventHistory;
2111    }
2112
2113    /**
2114     * @return Returns a reference to <code>this</code> for easy method chaining
2115     */
2116    public MedicationDispense setEventHistory(List<Reference> theEventHistory) { 
2117      this.eventHistory = theEventHistory;
2118      return this;
2119    }
2120
2121    public boolean hasEventHistory() { 
2122      if (this.eventHistory == null)
2123        return false;
2124      for (Reference item : this.eventHistory)
2125        if (!item.isEmpty())
2126          return true;
2127      return false;
2128    }
2129
2130    public Reference addEventHistory() { //3
2131      Reference t = new Reference();
2132      if (this.eventHistory == null)
2133        this.eventHistory = new ArrayList<Reference>();
2134      this.eventHistory.add(t);
2135      return t;
2136    }
2137
2138    public MedicationDispense addEventHistory(Reference t) { //3
2139      if (t == null)
2140        return this;
2141      if (this.eventHistory == null)
2142        this.eventHistory = new ArrayList<Reference>();
2143      this.eventHistory.add(t);
2144      return this;
2145    }
2146
2147    /**
2148     * @return The first repetition of repeating field {@link #eventHistory}, creating it if it does not already exist {3}
2149     */
2150    public Reference getEventHistoryFirstRep() { 
2151      if (getEventHistory().isEmpty()) {
2152        addEventHistory();
2153      }
2154      return getEventHistory().get(0);
2155    }
2156
2157      protected void listChildren(List<Property> children) {
2158        super.listChildren(children);
2159        children.add(new Property("identifier", "Identifier", "Identifiers associated with this Medication Dispense 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));
2160        children.add(new Property("basedOn", "Reference(CarePlan)", "A plan that is fulfilled in whole or in part by this MedicationDispense.", 0, java.lang.Integer.MAX_VALUE, basedOn));
2161        children.add(new Property("partOf", "Reference(Procedure|MedicationAdministration)", "The procedure or medication administration that triggered the dispense.", 0, java.lang.Integer.MAX_VALUE, partOf));
2162        children.add(new Property("status", "code", "A code specifying the state of the set of dispense events.", 0, 1, status));
2163        children.add(new Property("notPerformedReason", "CodeableReference(DetectedIssue)", "Indicates the reason why a dispense was not performed.", 0, 1, notPerformedReason));
2164        children.add(new Property("statusChanged", "dateTime", "The date (and maybe time) when the status of the dispense record changed.", 0, 1, statusChanged));
2165        children.add(new Property("category", "CodeableConcept", "Indicates the type of medication dispense (for example, drug classification like ATC, where meds would be administered, legal category of the medication.).", 0, java.lang.Integer.MAX_VALUE, category));
2166        children.add(new Property("medication", "CodeableReference(Medication)", "Identifies the medication supplied. 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));
2167        children.add(new Property("subject", "Reference(Patient|Group)", "A link to a resource representing the person or the group to whom the medication will be given.", 0, 1, subject));
2168        children.add(new Property("encounter", "Reference(Encounter)", "The encounter that establishes the context for this event.", 0, 1, encounter));
2169        children.add(new Property("supportingInformation", "Reference(Any)", "Additional information that supports the medication being dispensed.  For example, there may be requirements that a specific lab test has been completed prior to dispensing or the patient's weight at the time of dispensing is documented.", 0, java.lang.Integer.MAX_VALUE, supportingInformation));
2170        children.add(new Property("performer", "", "Indicates who or what performed the event.", 0, java.lang.Integer.MAX_VALUE, performer));
2171        children.add(new Property("location", "Reference(Location)", "The principal physical location where the dispense was performed.", 0, 1, location));
2172        children.add(new Property("authorizingPrescription", "Reference(MedicationRequest)", "Indicates the medication order that is being dispensed against.", 0, java.lang.Integer.MAX_VALUE, authorizingPrescription));
2173        children.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, 1, type));
2174        children.add(new Property("quantity", "Quantity", "The amount of medication that has been dispensed. Includes unit of measure.", 0, 1, quantity));
2175        children.add(new Property("daysSupply", "Quantity", "The amount of medication expressed as a timing amount.", 0, 1, daysSupply));
2176        children.add(new Property("recorded", "dateTime", "The date (and maybe time) when the dispense activity started if whenPrepared or whenHandedOver is not populated.", 0, 1, recorded));
2177        children.add(new Property("whenPrepared", "dateTime", "The time when the dispensed product was packaged and reviewed.", 0, 1, whenPrepared));
2178        children.add(new Property("whenHandedOver", "dateTime", "The time the dispensed product was provided to the patient or their representative.", 0, 1, whenHandedOver));
2179        children.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the medication was/will be shipped to, as part of the dispense event.", 0, 1, destination));
2180        children.add(new Property("receiver", "Reference(Patient|Practitioner|RelatedPerson|Location|PractitionerRole)", "Identifies the person who picked up the medication or the location of where the medication was delivered.  This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional or a location.", 0, java.lang.Integer.MAX_VALUE, receiver));
2181        children.add(new Property("note", "Annotation", "Extra information about the dispense that could not be conveyed in the other attributes.", 0, java.lang.Integer.MAX_VALUE, note));
2182        children.add(new Property("renderedDosageInstruction", "markdown", "The full representation of the dose of the medication included in all dosage instructions.  To be used when multiple dosage instructions are included to represent complex dosing such as increasing or tapering doses.", 0, 1, renderedDosageInstruction));
2183        children.add(new Property("dosageInstruction", "Dosage", "Indicates how the medication is to be used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction));
2184        children.add(new Property("substitution", "", "Indicates whether or not substitution was made as part of the dispense.  In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen.  This block explains what substitution did or did not happen and why.  If nothing is specified, substitution was not done.", 0, 1, substitution));
2185        children.add(new Property("eventHistory", "Reference(Provenance)", "A summary of the events of interest that have occurred, such as when the dispense was verified.", 0, java.lang.Integer.MAX_VALUE, eventHistory));
2186      }
2187
2188      @Override
2189      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2190        switch (_hash) {
2191        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers associated with this Medication Dispense 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);
2192        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(CarePlan)", "A plan that is fulfilled in whole or in part by this MedicationDispense.", 0, java.lang.Integer.MAX_VALUE, basedOn);
2193        case -995410646: /*partOf*/  return new Property("partOf", "Reference(Procedure|MedicationAdministration)", "The procedure or medication administration that triggered the dispense.", 0, java.lang.Integer.MAX_VALUE, partOf);
2194        case -892481550: /*status*/  return new Property("status", "code", "A code specifying the state of the set of dispense events.", 0, 1, status);
2195        case -820839727: /*notPerformedReason*/  return new Property("notPerformedReason", "CodeableReference(DetectedIssue)", "Indicates the reason why a dispense was not performed.", 0, 1, notPerformedReason);
2196        case -1174686110: /*statusChanged*/  return new Property("statusChanged", "dateTime", "The date (and maybe time) when the status of the dispense record changed.", 0, 1, statusChanged);
2197        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "Indicates the type of medication dispense (for example, drug classification like ATC, where meds would be administered, legal category of the medication.).", 0, java.lang.Integer.MAX_VALUE, category);
2198        case 1998965455: /*medication*/  return new Property("medication", "CodeableReference(Medication)", "Identifies the medication supplied. 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);
2199        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "A link to a resource representing the person or the group to whom the medication will be given.", 0, 1, subject);
2200        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The encounter that establishes the context for this event.", 0, 1, encounter);
2201        case -1248768647: /*supportingInformation*/  return new Property("supportingInformation", "Reference(Any)", "Additional information that supports the medication being dispensed.  For example, there may be requirements that a specific lab test has been completed prior to dispensing or the patient's weight at the time of dispensing is documented.", 0, java.lang.Integer.MAX_VALUE, supportingInformation);
2202        case 481140686: /*performer*/  return new Property("performer", "", "Indicates who or what performed the event.", 0, java.lang.Integer.MAX_VALUE, performer);
2203        case 1901043637: /*location*/  return new Property("location", "Reference(Location)", "The principal physical location where the dispense was performed.", 0, 1, location);
2204        case -1237557856: /*authorizingPrescription*/  return new Property("authorizingPrescription", "Reference(MedicationRequest)", "Indicates the medication order that is being dispensed against.", 0, java.lang.Integer.MAX_VALUE, authorizingPrescription);
2205        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, 1, type);
2206        case -1285004149: /*quantity*/  return new Property("quantity", "Quantity", "The amount of medication that has been dispensed. Includes unit of measure.", 0, 1, quantity);
2207        case 197175334: /*daysSupply*/  return new Property("daysSupply", "Quantity", "The amount of medication expressed as a timing amount.", 0, 1, daysSupply);
2208        case -799233872: /*recorded*/  return new Property("recorded", "dateTime", "The date (and maybe time) when the dispense activity started if whenPrepared or whenHandedOver is not populated.", 0, 1, recorded);
2209        case -562837097: /*whenPrepared*/  return new Property("whenPrepared", "dateTime", "The time when the dispensed product was packaged and reviewed.", 0, 1, whenPrepared);
2210        case -940241380: /*whenHandedOver*/  return new Property("whenHandedOver", "dateTime", "The time the dispensed product was provided to the patient or their representative.", 0, 1, whenHandedOver);
2211        case -1429847026: /*destination*/  return new Property("destination", "Reference(Location)", "Identification of the facility/location where the medication was/will be shipped to, as part of the dispense event.", 0, 1, destination);
2212        case -808719889: /*receiver*/  return new Property("receiver", "Reference(Patient|Practitioner|RelatedPerson|Location|PractitionerRole)", "Identifies the person who picked up the medication or the location of where the medication was delivered.  This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional or a location.", 0, java.lang.Integer.MAX_VALUE, receiver);
2213        case 3387378: /*note*/  return new Property("note", "Annotation", "Extra information about the dispense that could not be conveyed in the other attributes.", 0, java.lang.Integer.MAX_VALUE, note);
2214        case 1718902050: /*renderedDosageInstruction*/  return new Property("renderedDosageInstruction", "markdown", "The full representation of the dose of the medication included in all dosage instructions.  To be used when multiple dosage instructions are included to represent complex dosing such as increasing or tapering doses.", 0, 1, renderedDosageInstruction);
2215        case -1201373865: /*dosageInstruction*/  return new Property("dosageInstruction", "Dosage", "Indicates how the medication is to be used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction);
2216        case 826147581: /*substitution*/  return new Property("substitution", "", "Indicates whether or not substitution was made as part of the dispense.  In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen.  This block explains what substitution did or did not happen and why.  If nothing is specified, substitution was not done.", 0, 1, substitution);
2217        case 1835190426: /*eventHistory*/  return new Property("eventHistory", "Reference(Provenance)", "A summary of the events of interest that have occurred, such as when the dispense was verified.", 0, java.lang.Integer.MAX_VALUE, eventHistory);
2218        default: return super.getNamedProperty(_hash, _name, _checkValid);
2219        }
2220
2221      }
2222
2223      @Override
2224      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2225        switch (hash) {
2226        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2227        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2228        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
2229        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<MedicationDispenseStatusCodes>
2230        case -820839727: /*notPerformedReason*/ return this.notPerformedReason == null ? new Base[0] : new Base[] {this.notPerformedReason}; // CodeableReference
2231        case -1174686110: /*statusChanged*/ return this.statusChanged == null ? new Base[0] : new Base[] {this.statusChanged}; // DateTimeType
2232        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2233        case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // CodeableReference
2234        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2235        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
2236        case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference
2237        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // MedicationDispensePerformerComponent
2238        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
2239        case -1237557856: /*authorizingPrescription*/ return this.authorizingPrescription == null ? new Base[0] : this.authorizingPrescription.toArray(new Base[this.authorizingPrescription.size()]); // Reference
2240        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2241        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
2242        case 197175334: /*daysSupply*/ return this.daysSupply == null ? new Base[0] : new Base[] {this.daysSupply}; // Quantity
2243        case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // DateTimeType
2244        case -562837097: /*whenPrepared*/ return this.whenPrepared == null ? new Base[0] : new Base[] {this.whenPrepared}; // DateTimeType
2245        case -940241380: /*whenHandedOver*/ return this.whenHandedOver == null ? new Base[0] : new Base[] {this.whenHandedOver}; // DateTimeType
2246        case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // Reference
2247        case -808719889: /*receiver*/ return this.receiver == null ? new Base[0] : this.receiver.toArray(new Base[this.receiver.size()]); // Reference
2248        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2249        case 1718902050: /*renderedDosageInstruction*/ return this.renderedDosageInstruction == null ? new Base[0] : new Base[] {this.renderedDosageInstruction}; // MarkdownType
2250        case -1201373865: /*dosageInstruction*/ return this.dosageInstruction == null ? new Base[0] : this.dosageInstruction.toArray(new Base[this.dosageInstruction.size()]); // Dosage
2251        case 826147581: /*substitution*/ return this.substitution == null ? new Base[0] : new Base[] {this.substitution}; // MedicationDispenseSubstitutionComponent
2252        case 1835190426: /*eventHistory*/ return this.eventHistory == null ? new Base[0] : this.eventHistory.toArray(new Base[this.eventHistory.size()]); // Reference
2253        default: return super.getProperty(hash, name, checkValid);
2254        }
2255
2256      }
2257
2258      @Override
2259      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2260        switch (hash) {
2261        case -1618432855: // identifier
2262          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2263          return value;
2264        case -332612366: // basedOn
2265          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
2266          return value;
2267        case -995410646: // partOf
2268          this.getPartOf().add(TypeConvertor.castToReference(value)); // Reference
2269          return value;
2270        case -892481550: // status
2271          value = new MedicationDispenseStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2272          this.status = (Enumeration) value; // Enumeration<MedicationDispenseStatusCodes>
2273          return value;
2274        case -820839727: // notPerformedReason
2275          this.notPerformedReason = TypeConvertor.castToCodeableReference(value); // CodeableReference
2276          return value;
2277        case -1174686110: // statusChanged
2278          this.statusChanged = TypeConvertor.castToDateTime(value); // DateTimeType
2279          return value;
2280        case 50511102: // category
2281          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2282          return value;
2283        case 1998965455: // medication
2284          this.medication = TypeConvertor.castToCodeableReference(value); // CodeableReference
2285          return value;
2286        case -1867885268: // subject
2287          this.subject = TypeConvertor.castToReference(value); // Reference
2288          return value;
2289        case 1524132147: // encounter
2290          this.encounter = TypeConvertor.castToReference(value); // Reference
2291          return value;
2292        case -1248768647: // supportingInformation
2293          this.getSupportingInformation().add(TypeConvertor.castToReference(value)); // Reference
2294          return value;
2295        case 481140686: // performer
2296          this.getPerformer().add((MedicationDispensePerformerComponent) value); // MedicationDispensePerformerComponent
2297          return value;
2298        case 1901043637: // location
2299          this.location = TypeConvertor.castToReference(value); // Reference
2300          return value;
2301        case -1237557856: // authorizingPrescription
2302          this.getAuthorizingPrescription().add(TypeConvertor.castToReference(value)); // Reference
2303          return value;
2304        case 3575610: // type
2305          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2306          return value;
2307        case -1285004149: // quantity
2308          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
2309          return value;
2310        case 197175334: // daysSupply
2311          this.daysSupply = TypeConvertor.castToQuantity(value); // Quantity
2312          return value;
2313        case -799233872: // recorded
2314          this.recorded = TypeConvertor.castToDateTime(value); // DateTimeType
2315          return value;
2316        case -562837097: // whenPrepared
2317          this.whenPrepared = TypeConvertor.castToDateTime(value); // DateTimeType
2318          return value;
2319        case -940241380: // whenHandedOver
2320          this.whenHandedOver = TypeConvertor.castToDateTime(value); // DateTimeType
2321          return value;
2322        case -1429847026: // destination
2323          this.destination = TypeConvertor.castToReference(value); // Reference
2324          return value;
2325        case -808719889: // receiver
2326          this.getReceiver().add(TypeConvertor.castToReference(value)); // Reference
2327          return value;
2328        case 3387378: // note
2329          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
2330          return value;
2331        case 1718902050: // renderedDosageInstruction
2332          this.renderedDosageInstruction = TypeConvertor.castToMarkdown(value); // MarkdownType
2333          return value;
2334        case -1201373865: // dosageInstruction
2335          this.getDosageInstruction().add(TypeConvertor.castToDosage(value)); // Dosage
2336          return value;
2337        case 826147581: // substitution
2338          this.substitution = (MedicationDispenseSubstitutionComponent) value; // MedicationDispenseSubstitutionComponent
2339          return value;
2340        case 1835190426: // eventHistory
2341          this.getEventHistory().add(TypeConvertor.castToReference(value)); // Reference
2342          return value;
2343        default: return super.setProperty(hash, name, value);
2344        }
2345
2346      }
2347
2348      @Override
2349      public Base setProperty(String name, Base value) throws FHIRException {
2350        if (name.equals("identifier")) {
2351          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2352        } else if (name.equals("basedOn")) {
2353          this.getBasedOn().add(TypeConvertor.castToReference(value));
2354        } else if (name.equals("partOf")) {
2355          this.getPartOf().add(TypeConvertor.castToReference(value));
2356        } else if (name.equals("status")) {
2357          value = new MedicationDispenseStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2358          this.status = (Enumeration) value; // Enumeration<MedicationDispenseStatusCodes>
2359        } else if (name.equals("notPerformedReason")) {
2360          this.notPerformedReason = TypeConvertor.castToCodeableReference(value); // CodeableReference
2361        } else if (name.equals("statusChanged")) {
2362          this.statusChanged = TypeConvertor.castToDateTime(value); // DateTimeType
2363        } else if (name.equals("category")) {
2364          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
2365        } else if (name.equals("medication")) {
2366          this.medication = TypeConvertor.castToCodeableReference(value); // CodeableReference
2367        } else if (name.equals("subject")) {
2368          this.subject = TypeConvertor.castToReference(value); // Reference
2369        } else if (name.equals("encounter")) {
2370          this.encounter = TypeConvertor.castToReference(value); // Reference
2371        } else if (name.equals("supportingInformation")) {
2372          this.getSupportingInformation().add(TypeConvertor.castToReference(value));
2373        } else if (name.equals("performer")) {
2374          this.getPerformer().add((MedicationDispensePerformerComponent) value);
2375        } else if (name.equals("location")) {
2376          this.location = TypeConvertor.castToReference(value); // Reference
2377        } else if (name.equals("authorizingPrescription")) {
2378          this.getAuthorizingPrescription().add(TypeConvertor.castToReference(value));
2379        } else if (name.equals("type")) {
2380          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2381        } else if (name.equals("quantity")) {
2382          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
2383        } else if (name.equals("daysSupply")) {
2384          this.daysSupply = TypeConvertor.castToQuantity(value); // Quantity
2385        } else if (name.equals("recorded")) {
2386          this.recorded = TypeConvertor.castToDateTime(value); // DateTimeType
2387        } else if (name.equals("whenPrepared")) {
2388          this.whenPrepared = TypeConvertor.castToDateTime(value); // DateTimeType
2389        } else if (name.equals("whenHandedOver")) {
2390          this.whenHandedOver = TypeConvertor.castToDateTime(value); // DateTimeType
2391        } else if (name.equals("destination")) {
2392          this.destination = TypeConvertor.castToReference(value); // Reference
2393        } else if (name.equals("receiver")) {
2394          this.getReceiver().add(TypeConvertor.castToReference(value));
2395        } else if (name.equals("note")) {
2396          this.getNote().add(TypeConvertor.castToAnnotation(value));
2397        } else if (name.equals("renderedDosageInstruction")) {
2398          this.renderedDosageInstruction = TypeConvertor.castToMarkdown(value); // MarkdownType
2399        } else if (name.equals("dosageInstruction")) {
2400          this.getDosageInstruction().add(TypeConvertor.castToDosage(value));
2401        } else if (name.equals("substitution")) {
2402          this.substitution = (MedicationDispenseSubstitutionComponent) value; // MedicationDispenseSubstitutionComponent
2403        } else if (name.equals("eventHistory")) {
2404          this.getEventHistory().add(TypeConvertor.castToReference(value));
2405        } else
2406          return super.setProperty(name, value);
2407        return value;
2408      }
2409
2410      @Override
2411      public Base makeProperty(int hash, String name) throws FHIRException {
2412        switch (hash) {
2413        case -1618432855:  return addIdentifier(); 
2414        case -332612366:  return addBasedOn(); 
2415        case -995410646:  return addPartOf(); 
2416        case -892481550:  return getStatusElement();
2417        case -820839727:  return getNotPerformedReason();
2418        case -1174686110:  return getStatusChangedElement();
2419        case 50511102:  return addCategory(); 
2420        case 1998965455:  return getMedication();
2421        case -1867885268:  return getSubject();
2422        case 1524132147:  return getEncounter();
2423        case -1248768647:  return addSupportingInformation(); 
2424        case 481140686:  return addPerformer(); 
2425        case 1901043637:  return getLocation();
2426        case -1237557856:  return addAuthorizingPrescription(); 
2427        case 3575610:  return getType();
2428        case -1285004149:  return getQuantity();
2429        case 197175334:  return getDaysSupply();
2430        case -799233872:  return getRecordedElement();
2431        case -562837097:  return getWhenPreparedElement();
2432        case -940241380:  return getWhenHandedOverElement();
2433        case -1429847026:  return getDestination();
2434        case -808719889:  return addReceiver(); 
2435        case 3387378:  return addNote(); 
2436        case 1718902050:  return getRenderedDosageInstructionElement();
2437        case -1201373865:  return addDosageInstruction(); 
2438        case 826147581:  return getSubstitution();
2439        case 1835190426:  return addEventHistory(); 
2440        default: return super.makeProperty(hash, name);
2441        }
2442
2443      }
2444
2445      @Override
2446      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2447        switch (hash) {
2448        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2449        case -332612366: /*basedOn*/ return new String[] {"Reference"};
2450        case -995410646: /*partOf*/ return new String[] {"Reference"};
2451        case -892481550: /*status*/ return new String[] {"code"};
2452        case -820839727: /*notPerformedReason*/ return new String[] {"CodeableReference"};
2453        case -1174686110: /*statusChanged*/ return new String[] {"dateTime"};
2454        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2455        case 1998965455: /*medication*/ return new String[] {"CodeableReference"};
2456        case -1867885268: /*subject*/ return new String[] {"Reference"};
2457        case 1524132147: /*encounter*/ return new String[] {"Reference"};
2458        case -1248768647: /*supportingInformation*/ return new String[] {"Reference"};
2459        case 481140686: /*performer*/ return new String[] {};
2460        case 1901043637: /*location*/ return new String[] {"Reference"};
2461        case -1237557856: /*authorizingPrescription*/ return new String[] {"Reference"};
2462        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2463        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
2464        case 197175334: /*daysSupply*/ return new String[] {"Quantity"};
2465        case -799233872: /*recorded*/ return new String[] {"dateTime"};
2466        case -562837097: /*whenPrepared*/ return new String[] {"dateTime"};
2467        case -940241380: /*whenHandedOver*/ return new String[] {"dateTime"};
2468        case -1429847026: /*destination*/ return new String[] {"Reference"};
2469        case -808719889: /*receiver*/ return new String[] {"Reference"};
2470        case 3387378: /*note*/ return new String[] {"Annotation"};
2471        case 1718902050: /*renderedDosageInstruction*/ return new String[] {"markdown"};
2472        case -1201373865: /*dosageInstruction*/ return new String[] {"Dosage"};
2473        case 826147581: /*substitution*/ return new String[] {};
2474        case 1835190426: /*eventHistory*/ return new String[] {"Reference"};
2475        default: return super.getTypesForProperty(hash, name);
2476        }
2477
2478      }
2479
2480      @Override
2481      public Base addChild(String name) throws FHIRException {
2482        if (name.equals("identifier")) {
2483          return addIdentifier();
2484        }
2485        else if (name.equals("basedOn")) {
2486          return addBasedOn();
2487        }
2488        else if (name.equals("partOf")) {
2489          return addPartOf();
2490        }
2491        else if (name.equals("status")) {
2492          throw new FHIRException("Cannot call addChild on a singleton property MedicationDispense.status");
2493        }
2494        else if (name.equals("notPerformedReason")) {
2495          this.notPerformedReason = new CodeableReference();
2496          return this.notPerformedReason;
2497        }
2498        else if (name.equals("statusChanged")) {
2499          throw new FHIRException("Cannot call addChild on a singleton property MedicationDispense.statusChanged");
2500        }
2501        else if (name.equals("category")) {
2502          return addCategory();
2503        }
2504        else if (name.equals("medication")) {
2505          this.medication = new CodeableReference();
2506          return this.medication;
2507        }
2508        else if (name.equals("subject")) {
2509          this.subject = new Reference();
2510          return this.subject;
2511        }
2512        else if (name.equals("encounter")) {
2513          this.encounter = new Reference();
2514          return this.encounter;
2515        }
2516        else if (name.equals("supportingInformation")) {
2517          return addSupportingInformation();
2518        }
2519        else if (name.equals("performer")) {
2520          return addPerformer();
2521        }
2522        else if (name.equals("location")) {
2523          this.location = new Reference();
2524          return this.location;
2525        }
2526        else if (name.equals("authorizingPrescription")) {
2527          return addAuthorizingPrescription();
2528        }
2529        else if (name.equals("type")) {
2530          this.type = new CodeableConcept();
2531          return this.type;
2532        }
2533        else if (name.equals("quantity")) {
2534          this.quantity = new Quantity();
2535          return this.quantity;
2536        }
2537        else if (name.equals("daysSupply")) {
2538          this.daysSupply = new Quantity();
2539          return this.daysSupply;
2540        }
2541        else if (name.equals("recorded")) {
2542          throw new FHIRException("Cannot call addChild on a singleton property MedicationDispense.recorded");
2543        }
2544        else if (name.equals("whenPrepared")) {
2545          throw new FHIRException("Cannot call addChild on a singleton property MedicationDispense.whenPrepared");
2546        }
2547        else if (name.equals("whenHandedOver")) {
2548          throw new FHIRException("Cannot call addChild on a singleton property MedicationDispense.whenHandedOver");
2549        }
2550        else if (name.equals("destination")) {
2551          this.destination = new Reference();
2552          return this.destination;
2553        }
2554        else if (name.equals("receiver")) {
2555          return addReceiver();
2556        }
2557        else if (name.equals("note")) {
2558          return addNote();
2559        }
2560        else if (name.equals("renderedDosageInstruction")) {
2561          throw new FHIRException("Cannot call addChild on a singleton property MedicationDispense.renderedDosageInstruction");
2562        }
2563        else if (name.equals("dosageInstruction")) {
2564          return addDosageInstruction();
2565        }
2566        else if (name.equals("substitution")) {
2567          this.substitution = new MedicationDispenseSubstitutionComponent();
2568          return this.substitution;
2569        }
2570        else if (name.equals("eventHistory")) {
2571          return addEventHistory();
2572        }
2573        else
2574          return super.addChild(name);
2575      }
2576
2577  public String fhirType() {
2578    return "MedicationDispense";
2579
2580  }
2581
2582      public MedicationDispense copy() {
2583        MedicationDispense dst = new MedicationDispense();
2584        copyValues(dst);
2585        return dst;
2586      }
2587
2588      public void copyValues(MedicationDispense dst) {
2589        super.copyValues(dst);
2590        if (identifier != null) {
2591          dst.identifier = new ArrayList<Identifier>();
2592          for (Identifier i : identifier)
2593            dst.identifier.add(i.copy());
2594        };
2595        if (basedOn != null) {
2596          dst.basedOn = new ArrayList<Reference>();
2597          for (Reference i : basedOn)
2598            dst.basedOn.add(i.copy());
2599        };
2600        if (partOf != null) {
2601          dst.partOf = new ArrayList<Reference>();
2602          for (Reference i : partOf)
2603            dst.partOf.add(i.copy());
2604        };
2605        dst.status = status == null ? null : status.copy();
2606        dst.notPerformedReason = notPerformedReason == null ? null : notPerformedReason.copy();
2607        dst.statusChanged = statusChanged == null ? null : statusChanged.copy();
2608        if (category != null) {
2609          dst.category = new ArrayList<CodeableConcept>();
2610          for (CodeableConcept i : category)
2611            dst.category.add(i.copy());
2612        };
2613        dst.medication = medication == null ? null : medication.copy();
2614        dst.subject = subject == null ? null : subject.copy();
2615        dst.encounter = encounter == null ? null : encounter.copy();
2616        if (supportingInformation != null) {
2617          dst.supportingInformation = new ArrayList<Reference>();
2618          for (Reference i : supportingInformation)
2619            dst.supportingInformation.add(i.copy());
2620        };
2621        if (performer != null) {
2622          dst.performer = new ArrayList<MedicationDispensePerformerComponent>();
2623          for (MedicationDispensePerformerComponent i : performer)
2624            dst.performer.add(i.copy());
2625        };
2626        dst.location = location == null ? null : location.copy();
2627        if (authorizingPrescription != null) {
2628          dst.authorizingPrescription = new ArrayList<Reference>();
2629          for (Reference i : authorizingPrescription)
2630            dst.authorizingPrescription.add(i.copy());
2631        };
2632        dst.type = type == null ? null : type.copy();
2633        dst.quantity = quantity == null ? null : quantity.copy();
2634        dst.daysSupply = daysSupply == null ? null : daysSupply.copy();
2635        dst.recorded = recorded == null ? null : recorded.copy();
2636        dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy();
2637        dst.whenHandedOver = whenHandedOver == null ? null : whenHandedOver.copy();
2638        dst.destination = destination == null ? null : destination.copy();
2639        if (receiver != null) {
2640          dst.receiver = new ArrayList<Reference>();
2641          for (Reference i : receiver)
2642            dst.receiver.add(i.copy());
2643        };
2644        if (note != null) {
2645          dst.note = new ArrayList<Annotation>();
2646          for (Annotation i : note)
2647            dst.note.add(i.copy());
2648        };
2649        dst.renderedDosageInstruction = renderedDosageInstruction == null ? null : renderedDosageInstruction.copy();
2650        if (dosageInstruction != null) {
2651          dst.dosageInstruction = new ArrayList<Dosage>();
2652          for (Dosage i : dosageInstruction)
2653            dst.dosageInstruction.add(i.copy());
2654        };
2655        dst.substitution = substitution == null ? null : substitution.copy();
2656        if (eventHistory != null) {
2657          dst.eventHistory = new ArrayList<Reference>();
2658          for (Reference i : eventHistory)
2659            dst.eventHistory.add(i.copy());
2660        };
2661      }
2662
2663      protected MedicationDispense typedCopy() {
2664        return copy();
2665      }
2666
2667      @Override
2668      public boolean equalsDeep(Base other_) {
2669        if (!super.equalsDeep(other_))
2670          return false;
2671        if (!(other_ instanceof MedicationDispense))
2672          return false;
2673        MedicationDispense o = (MedicationDispense) other_;
2674        return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(partOf, o.partOf, true)
2675           && compareDeep(status, o.status, true) && compareDeep(notPerformedReason, o.notPerformedReason, true)
2676           && compareDeep(statusChanged, o.statusChanged, true) && compareDeep(category, o.category, true)
2677           && compareDeep(medication, o.medication, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true)
2678           && compareDeep(supportingInformation, o.supportingInformation, true) && compareDeep(performer, o.performer, true)
2679           && compareDeep(location, o.location, true) && compareDeep(authorizingPrescription, o.authorizingPrescription, true)
2680           && compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true) && compareDeep(daysSupply, o.daysSupply, true)
2681           && compareDeep(recorded, o.recorded, true) && compareDeep(whenPrepared, o.whenPrepared, true) && compareDeep(whenHandedOver, o.whenHandedOver, true)
2682           && compareDeep(destination, o.destination, true) && compareDeep(receiver, o.receiver, true) && compareDeep(note, o.note, true)
2683           && compareDeep(renderedDosageInstruction, o.renderedDosageInstruction, true) && compareDeep(dosageInstruction, o.dosageInstruction, true)
2684           && compareDeep(substitution, o.substitution, true) && compareDeep(eventHistory, o.eventHistory, true)
2685          ;
2686      }
2687
2688      @Override
2689      public boolean equalsShallow(Base other_) {
2690        if (!super.equalsShallow(other_))
2691          return false;
2692        if (!(other_ instanceof MedicationDispense))
2693          return false;
2694        MedicationDispense o = (MedicationDispense) other_;
2695        return compareValues(status, o.status, true) && compareValues(statusChanged, o.statusChanged, true)
2696           && compareValues(recorded, o.recorded, true) && compareValues(whenPrepared, o.whenPrepared, true) && compareValues(whenHandedOver, o.whenHandedOver, true)
2697           && compareValues(renderedDosageInstruction, o.renderedDosageInstruction, true);
2698      }
2699
2700      public boolean isEmpty() {
2701        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, partOf
2702          , status, notPerformedReason, statusChanged, category, medication, subject, encounter
2703          , supportingInformation, performer, location, authorizingPrescription, type, quantity
2704          , daysSupply, recorded, whenPrepared, whenHandedOver, destination, receiver, note
2705          , renderedDosageInstruction, dosageInstruction, substitution, eventHistory);
2706      }
2707
2708  @Override
2709  public ResourceType getResourceType() {
2710    return ResourceType.MedicationDispense;
2711   }
2712
2713 /**
2714   * Search parameter: <b>destination</b>
2715   * <p>
2716   * Description: <b>Returns dispenses that should be sent to a specific destination</b><br>
2717   * Type: <b>reference</b><br>
2718   * Path: <b>MedicationDispense.destination</b><br>
2719   * </p>
2720   */
2721  @SearchParamDefinition(name="destination", path="MedicationDispense.destination", description="Returns dispenses that should be sent to a specific destination", type="reference", target={Location.class } )
2722  public static final String SP_DESTINATION = "destination";
2723 /**
2724   * <b>Fluent Client</b> search parameter constant for <b>destination</b>
2725   * <p>
2726   * Description: <b>Returns dispenses that should be sent to a specific destination</b><br>
2727   * Type: <b>reference</b><br>
2728   * Path: <b>MedicationDispense.destination</b><br>
2729   * </p>
2730   */
2731  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DESTINATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DESTINATION);
2732
2733/**
2734   * Constant for fluent queries to be used to add include statements. Specifies
2735   * the path value of "<b>MedicationDispense:destination</b>".
2736   */
2737  public static final ca.uhn.fhir.model.api.Include INCLUDE_DESTINATION = new ca.uhn.fhir.model.api.Include("MedicationDispense:destination").toLocked();
2738
2739 /**
2740   * Search parameter: <b>location</b>
2741   * <p>
2742   * Description: <b>Returns dispense for a given location</b><br>
2743   * Type: <b>reference</b><br>
2744   * Path: <b>MedicationDispense.location</b><br>
2745   * </p>
2746   */
2747  @SearchParamDefinition(name="location", path="MedicationDispense.location", description="Returns dispense for a given location", type="reference", target={Location.class } )
2748  public static final String SP_LOCATION = "location";
2749 /**
2750   * <b>Fluent Client</b> search parameter constant for <b>location</b>
2751   * <p>
2752   * Description: <b>Returns dispense for a given location</b><br>
2753   * Type: <b>reference</b><br>
2754   * Path: <b>MedicationDispense.location</b><br>
2755   * </p>
2756   */
2757  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
2758
2759/**
2760   * Constant for fluent queries to be used to add include statements. Specifies
2761   * the path value of "<b>MedicationDispense:location</b>".
2762   */
2763  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("MedicationDispense:location").toLocked();
2764
2765 /**
2766   * Search parameter: <b>performer</b>
2767   * <p>
2768   * Description: <b>Returns dispenses performed by a specific individual</b><br>
2769   * Type: <b>reference</b><br>
2770   * Path: <b>MedicationDispense.performer.actor</b><br>
2771   * </p>
2772   */
2773  @SearchParamDefinition(name="performer", path="MedicationDispense.performer.actor", description="Returns dispenses performed by a specific individual", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={CareTeam.class, Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2774  public static final String SP_PERFORMER = "performer";
2775 /**
2776   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
2777   * <p>
2778   * Description: <b>Returns dispenses performed by a specific individual</b><br>
2779   * Type: <b>reference</b><br>
2780   * Path: <b>MedicationDispense.performer.actor</b><br>
2781   * </p>
2782   */
2783  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
2784
2785/**
2786   * Constant for fluent queries to be used to add include statements. Specifies
2787   * the path value of "<b>MedicationDispense:performer</b>".
2788   */
2789  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("MedicationDispense:performer").toLocked();
2790
2791 /**
2792   * Search parameter: <b>receiver</b>
2793   * <p>
2794   * Description: <b>The identity of a receiver to list dispenses for</b><br>
2795   * Type: <b>reference</b><br>
2796   * Path: <b>MedicationDispense.receiver</b><br>
2797   * </p>
2798   */
2799  @SearchParamDefinition(name="receiver", path="MedicationDispense.receiver", description="The identity of a receiver to list dispenses for", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Location.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2800  public static final String SP_RECEIVER = "receiver";
2801 /**
2802   * <b>Fluent Client</b> search parameter constant for <b>receiver</b>
2803   * <p>
2804   * Description: <b>The identity of a receiver to list dispenses for</b><br>
2805   * Type: <b>reference</b><br>
2806   * Path: <b>MedicationDispense.receiver</b><br>
2807   * </p>
2808   */
2809  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECEIVER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECEIVER);
2810
2811/**
2812   * Constant for fluent queries to be used to add include statements. Specifies
2813   * the path value of "<b>MedicationDispense:receiver</b>".
2814   */
2815  public static final ca.uhn.fhir.model.api.Include INCLUDE_RECEIVER = new ca.uhn.fhir.model.api.Include("MedicationDispense:receiver").toLocked();
2816
2817 /**
2818   * Search parameter: <b>recorded</b>
2819   * <p>
2820   * Description: <b>Returns dispenses where dispensing activity began on this date</b><br>
2821   * Type: <b>date</b><br>
2822   * Path: <b>MedicationDispense.recorded</b><br>
2823   * </p>
2824   */
2825  @SearchParamDefinition(name="recorded", path="MedicationDispense.recorded", description="Returns dispenses where dispensing activity began on this date", type="date" )
2826  public static final String SP_RECORDED = "recorded";
2827 /**
2828   * <b>Fluent Client</b> search parameter constant for <b>recorded</b>
2829   * <p>
2830   * Description: <b>Returns dispenses where dispensing activity began on this date</b><br>
2831   * Type: <b>date</b><br>
2832   * Path: <b>MedicationDispense.recorded</b><br>
2833   * </p>
2834   */
2835  public static final ca.uhn.fhir.rest.gclient.DateClientParam RECORDED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_RECORDED);
2836
2837 /**
2838   * Search parameter: <b>responsibleparty</b>
2839   * <p>
2840   * Description: <b>Returns dispenses with the specified responsible party</b><br>
2841   * Type: <b>reference</b><br>
2842   * Path: <b>MedicationDispense.substitution.responsibleParty</b><br>
2843   * </p>
2844   */
2845  @SearchParamDefinition(name="responsibleparty", path="MedicationDispense.substitution.responsibleParty", description="Returns dispenses with the specified responsible party", type="reference", target={Organization.class, Practitioner.class, PractitionerRole.class } )
2846  public static final String SP_RESPONSIBLEPARTY = "responsibleparty";
2847 /**
2848   * <b>Fluent Client</b> search parameter constant for <b>responsibleparty</b>
2849   * <p>
2850   * Description: <b>Returns dispenses with the specified responsible party</b><br>
2851   * Type: <b>reference</b><br>
2852   * Path: <b>MedicationDispense.substitution.responsibleParty</b><br>
2853   * </p>
2854   */
2855  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESPONSIBLEPARTY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESPONSIBLEPARTY);
2856
2857/**
2858   * Constant for fluent queries to be used to add include statements. Specifies
2859   * the path value of "<b>MedicationDispense:responsibleparty</b>".
2860   */
2861  public static final ca.uhn.fhir.model.api.Include INCLUDE_RESPONSIBLEPARTY = new ca.uhn.fhir.model.api.Include("MedicationDispense:responsibleparty").toLocked();
2862
2863 /**
2864   * Search parameter: <b>subject</b>
2865   * <p>
2866   * Description: <b>The identity of a patient for whom to list dispenses</b><br>
2867   * Type: <b>reference</b><br>
2868   * Path: <b>MedicationDispense.subject</b><br>
2869   * </p>
2870   */
2871  @SearchParamDefinition(name="subject", path="MedicationDispense.subject", description="The identity of a patient for whom to list dispenses", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Group.class, Patient.class } )
2872  public static final String SP_SUBJECT = "subject";
2873 /**
2874   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2875   * <p>
2876   * Description: <b>The identity of a patient for whom to list dispenses</b><br>
2877   * Type: <b>reference</b><br>
2878   * Path: <b>MedicationDispense.subject</b><br>
2879   * </p>
2880   */
2881  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2882
2883/**
2884   * Constant for fluent queries to be used to add include statements. Specifies
2885   * the path value of "<b>MedicationDispense:subject</b>".
2886   */
2887  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("MedicationDispense:subject").toLocked();
2888
2889 /**
2890   * Search parameter: <b>whenhandedover</b>
2891   * <p>
2892   * Description: <b>Returns dispenses handed over on this date</b><br>
2893   * Type: <b>date</b><br>
2894   * Path: <b>MedicationDispense.whenHandedOver</b><br>
2895   * </p>
2896   */
2897  @SearchParamDefinition(name="whenhandedover", path="MedicationDispense.whenHandedOver", description="Returns dispenses handed over on this date", type="date" )
2898  public static final String SP_WHENHANDEDOVER = "whenhandedover";
2899 /**
2900   * <b>Fluent Client</b> search parameter constant for <b>whenhandedover</b>
2901   * <p>
2902   * Description: <b>Returns dispenses handed over on this date</b><br>
2903   * Type: <b>date</b><br>
2904   * Path: <b>MedicationDispense.whenHandedOver</b><br>
2905   * </p>
2906   */
2907  public static final ca.uhn.fhir.rest.gclient.DateClientParam WHENHANDEDOVER = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_WHENHANDEDOVER);
2908
2909 /**
2910   * Search parameter: <b>whenprepared</b>
2911   * <p>
2912   * Description: <b>Returns dispenses prepared on this date</b><br>
2913   * Type: <b>date</b><br>
2914   * Path: <b>MedicationDispense.whenPrepared</b><br>
2915   * </p>
2916   */
2917  @SearchParamDefinition(name="whenprepared", path="MedicationDispense.whenPrepared", description="Returns dispenses prepared on this date", type="date" )
2918  public static final String SP_WHENPREPARED = "whenprepared";
2919 /**
2920   * <b>Fluent Client</b> search parameter constant for <b>whenprepared</b>
2921   * <p>
2922   * Description: <b>Returns dispenses prepared on this date</b><br>
2923   * Type: <b>date</b><br>
2924   * Path: <b>MedicationDispense.whenPrepared</b><br>
2925   * </p>
2926   */
2927  public static final ca.uhn.fhir.rest.gclient.DateClientParam WHENPREPARED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_WHENPREPARED);
2928
2929 /**
2930   * Search parameter: <b>code</b>
2931   * <p>
2932   * Description: <b>Multiple Resources: 
2933
2934* [AdverseEvent](adverseevent.html): Event or incident that occurred or was averted
2935* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2936* [AuditEvent](auditevent.html): More specific code for the event
2937* [Basic](basic.html): Kind of Resource
2938* [ChargeItem](chargeitem.html): A code that identifies the charge, like a billing code
2939* [Condition](condition.html): Code for the condition
2940* [DetectedIssue](detectedissue.html): Issue Type, e.g. drug-drug, duplicate therapy, etc.
2941* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2942* [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
2943* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2944* [ImagingSelection](imagingselection.html): The imaging selection status
2945* [List](list.html): What the purpose of this list is
2946* [Medication](medication.html): Returns medications for a specific code
2947* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2948* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2949* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2950* [MedicationStatement](medicationstatement.html): Return statements of this medication code
2951* [NutritionIntake](nutritionintake.html): Returns statements of this code of NutritionIntake
2952* [Observation](observation.html): The code of the observation type
2953* [Procedure](procedure.html): A code to identify a  procedure
2954* [RequestOrchestration](requestorchestration.html): The code of the request orchestration
2955* [Task](task.html): Search by task code
2956</b><br>
2957   * Type: <b>token</b><br>
2958   * 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>
2959   * </p>
2960   */
2961  @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" )
2962  public static final String SP_CODE = "code";
2963 /**
2964   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2965   * <p>
2966   * Description: <b>Multiple Resources: 
2967
2968* [AdverseEvent](adverseevent.html): Event or incident that occurred or was averted
2969* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2970* [AuditEvent](auditevent.html): More specific code for the event
2971* [Basic](basic.html): Kind of Resource
2972* [ChargeItem](chargeitem.html): A code that identifies the charge, like a billing code
2973* [Condition](condition.html): Code for the condition
2974* [DetectedIssue](detectedissue.html): Issue Type, e.g. drug-drug, duplicate therapy, etc.
2975* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2976* [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
2977* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2978* [ImagingSelection](imagingselection.html): The imaging selection status
2979* [List](list.html): What the purpose of this list is
2980* [Medication](medication.html): Returns medications for a specific code
2981* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2982* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2983* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2984* [MedicationStatement](medicationstatement.html): Return statements of this medication code
2985* [NutritionIntake](nutritionintake.html): Returns statements of this code of NutritionIntake
2986* [Observation](observation.html): The code of the observation type
2987* [Procedure](procedure.html): A code to identify a  procedure
2988* [RequestOrchestration](requestorchestration.html): The code of the request orchestration
2989* [Task](task.html): Search by task code
2990</b><br>
2991   * Type: <b>token</b><br>
2992   * 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>
2993   * </p>
2994   */
2995  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2996
2997 /**
2998   * Search parameter: <b>encounter</b>
2999   * <p>
3000   * Description: <b>Multiple Resources: 
3001
3002* [AuditEvent](auditevent.html): Encounter related to the activity recorded in the AuditEvent
3003* [CarePlan](careplan.html): The Encounter during which this CarePlan was created
3004* [ChargeItem](chargeitem.html): Encounter associated with event
3005* [Claim](claim.html): Encounters associated with a billed line item
3006* [ClinicalImpression](clinicalimpression.html): The Encounter during which this ClinicalImpression was created
3007* [Communication](communication.html): The Encounter during which this Communication was created
3008* [CommunicationRequest](communicationrequest.html): The Encounter during which this CommunicationRequest was created
3009* [Composition](composition.html): Context of the Composition
3010* [Condition](condition.html): The Encounter during which this Condition was created
3011* [DeviceRequest](devicerequest.html): Encounter during which request was created
3012* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made
3013* [EncounterHistory](encounterhistory.html): The Encounter associated with this set of history values
3014* [ExplanationOfBenefit](explanationofbenefit.html): Encounters associated with a billed line item
3015* [Flag](flag.html): Alert relevant during encounter
3016* [ImagingStudy](imagingstudy.html): The context of the study
3017* [List](list.html): Context in which list created
3018* [MedicationDispense](medicationdispense.html): Returns dispenses with a specific encounter
3019* [MedicationStatement](medicationstatement.html): Returns statements for a specific encounter
3020* [NutritionIntake](nutritionintake.html): Returns statements for a specific encounter
3021* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier
3022* [Observation](observation.html): Encounter related to the observation
3023* [Procedure](procedure.html): The Encounter during which this Procedure was created
3024* [Provenance](provenance.html): Encounter related to the Provenance
3025* [QuestionnaireResponse](questionnaireresponse.html): Encounter associated with the questionnaire response
3026* [RequestOrchestration](requestorchestration.html): The encounter the request orchestration applies to
3027* [RiskAssessment](riskassessment.html): Where was assessment performed?
3028* [ServiceRequest](servicerequest.html): An encounter in which this request is made
3029* [Task](task.html): Search by encounter
3030* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier
3031</b><br>
3032   * Type: <b>reference</b><br>
3033   * Path: <b>AuditEvent.encounter | CarePlan.encounter | ChargeItem.encounter | Claim.item.encounter | ClinicalImpression.encounter | Communication.encounter | CommunicationRequest.encounter | Composition.encounter | Condition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | EncounterHistory.encounter | ExplanationOfBenefit.item.encounter | Flag.encounter | ImagingStudy.encounter | List.encounter | MedicationDispense.encounter | MedicationStatement.encounter | NutritionIntake.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | Provenance.encounter | QuestionnaireResponse.encounter | RequestOrchestration.encounter | RiskAssessment.encounter | ServiceRequest.encounter | Task.encounter | VisionPrescription.encounter</b><br>
3034   * </p>
3035   */
3036  @SearchParamDefinition(name="encounter", path="AuditEvent.encounter | CarePlan.encounter | ChargeItem.encounter | Claim.item.encounter | ClinicalImpression.encounter | Communication.encounter | CommunicationRequest.encounter | Composition.encounter | Condition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | EncounterHistory.encounter | ExplanationOfBenefit.item.encounter | Flag.encounter | ImagingStudy.encounter | List.encounter | MedicationDispense.encounter | MedicationStatement.encounter | NutritionIntake.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | Provenance.encounter | QuestionnaireResponse.encounter | RequestOrchestration.encounter | RiskAssessment.encounter | ServiceRequest.encounter | Task.encounter | VisionPrescription.encounter", description="Multiple Resources: \r\n\r\n* [AuditEvent](auditevent.html): Encounter related to the activity recorded in the AuditEvent\r\n* [CarePlan](careplan.html): The Encounter during which this CarePlan was created\r\n* [ChargeItem](chargeitem.html): Encounter associated with event\r\n* [Claim](claim.html): Encounters associated with a billed line item\r\n* [ClinicalImpression](clinicalimpression.html): The Encounter during which this ClinicalImpression was created\r\n* [Communication](communication.html): The Encounter during which this Communication was created\r\n* [CommunicationRequest](communicationrequest.html): The Encounter during which this CommunicationRequest was created\r\n* [Composition](composition.html): Context of the Composition\r\n* [Condition](condition.html): The Encounter during which this Condition was created\r\n* [DeviceRequest](devicerequest.html): Encounter during which request was created\r\n* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made\r\n* [EncounterHistory](encounterhistory.html): The Encounter associated with this set of history values\r\n* [ExplanationOfBenefit](explanationofbenefit.html): Encounters associated with a billed line item\r\n* [Flag](flag.html): Alert relevant during encounter\r\n* [ImagingStudy](imagingstudy.html): The context of the study\r\n* [List](list.html): Context in which list created\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with a specific encounter\r\n* [MedicationStatement](medicationstatement.html): Returns statements for a specific encounter\r\n* [NutritionIntake](nutritionintake.html): Returns statements for a specific encounter\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier\r\n* [Observation](observation.html): Encounter related to the observation\r\n* [Procedure](procedure.html): The Encounter during which this Procedure was created\r\n* [Provenance](provenance.html): Encounter related to the Provenance\r\n* [QuestionnaireResponse](questionnaireresponse.html): Encounter associated with the questionnaire response\r\n* [RequestOrchestration](requestorchestration.html): The encounter the request orchestration applies to\r\n* [RiskAssessment](riskassessment.html): Where was assessment performed?\r\n* [ServiceRequest](servicerequest.html): An encounter in which this request is made\r\n* [Task](task.html): Search by encounter\r\n* [VisionPrescription](visionprescription.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 } )
3037  public static final String SP_ENCOUNTER = "encounter";
3038 /**
3039   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
3040   * <p>
3041   * Description: <b>Multiple Resources: 
3042
3043* [AuditEvent](auditevent.html): Encounter related to the activity recorded in the AuditEvent
3044* [CarePlan](careplan.html): The Encounter during which this CarePlan was created
3045* [ChargeItem](chargeitem.html): Encounter associated with event
3046* [Claim](claim.html): Encounters associated with a billed line item
3047* [ClinicalImpression](clinicalimpression.html): The Encounter during which this ClinicalImpression was created
3048* [Communication](communication.html): The Encounter during which this Communication was created
3049* [CommunicationRequest](communicationrequest.html): The Encounter during which this CommunicationRequest was created
3050* [Composition](composition.html): Context of the Composition
3051* [Condition](condition.html): The Encounter during which this Condition was created
3052* [DeviceRequest](devicerequest.html): Encounter during which request was created
3053* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made
3054* [EncounterHistory](encounterhistory.html): The Encounter associated with this set of history values
3055* [ExplanationOfBenefit](explanationofbenefit.html): Encounters associated with a billed line item
3056* [Flag](flag.html): Alert relevant during encounter
3057* [ImagingStudy](imagingstudy.html): The context of the study
3058* [List](list.html): Context in which list created
3059* [MedicationDispense](medicationdispense.html): Returns dispenses with a specific encounter
3060* [MedicationStatement](medicationstatement.html): Returns statements for a specific encounter
3061* [NutritionIntake](nutritionintake.html): Returns statements for a specific encounter
3062* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier
3063* [Observation](observation.html): Encounter related to the observation
3064* [Procedure](procedure.html): The Encounter during which this Procedure was created
3065* [Provenance](provenance.html): Encounter related to the Provenance
3066* [QuestionnaireResponse](questionnaireresponse.html): Encounter associated with the questionnaire response
3067* [RequestOrchestration](requestorchestration.html): The encounter the request orchestration applies to
3068* [RiskAssessment](riskassessment.html): Where was assessment performed?
3069* [ServiceRequest](servicerequest.html): An encounter in which this request is made
3070* [Task](task.html): Search by encounter
3071* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier
3072</b><br>
3073   * Type: <b>reference</b><br>
3074   * Path: <b>AuditEvent.encounter | CarePlan.encounter | ChargeItem.encounter | Claim.item.encounter | ClinicalImpression.encounter | Communication.encounter | CommunicationRequest.encounter | Composition.encounter | Condition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | EncounterHistory.encounter | ExplanationOfBenefit.item.encounter | Flag.encounter | ImagingStudy.encounter | List.encounter | MedicationDispense.encounter | MedicationStatement.encounter | NutritionIntake.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | Provenance.encounter | QuestionnaireResponse.encounter | RequestOrchestration.encounter | RiskAssessment.encounter | ServiceRequest.encounter | Task.encounter | VisionPrescription.encounter</b><br>
3075   * </p>
3076   */
3077  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
3078
3079/**
3080   * Constant for fluent queries to be used to add include statements. Specifies
3081   * the path value of "<b>MedicationDispense:encounter</b>".
3082   */
3083  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("MedicationDispense:encounter").toLocked();
3084
3085 /**
3086   * Search parameter: <b>identifier</b>
3087   * <p>
3088   * Description: <b>Multiple Resources: 
3089
3090* [Account](account.html): Account number
3091* [AdverseEvent](adverseevent.html): Business identifier for the event
3092* [AllergyIntolerance](allergyintolerance.html): External ids for this item
3093* [Appointment](appointment.html): An Identifier of the Appointment
3094* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
3095* [Basic](basic.html): Business identifier
3096* [BodyStructure](bodystructure.html): Bodystructure identifier
3097* [CarePlan](careplan.html): External Ids for this plan
3098* [CareTeam](careteam.html): External Ids for this team
3099* [ChargeItem](chargeitem.html): Business Identifier for item
3100* [Claim](claim.html): The primary identifier of the financial resource
3101* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
3102* [ClinicalImpression](clinicalimpression.html): Business identifier
3103* [Communication](communication.html): Unique identifier
3104* [CommunicationRequest](communicationrequest.html): Unique identifier
3105* [Composition](composition.html): Version-independent identifier for the Composition
3106* [Condition](condition.html): A unique identifier of the condition record
3107* [Consent](consent.html): Identifier for this record (external references)
3108* [Contract](contract.html): The identity of the contract
3109* [Coverage](coverage.html): The primary identifier of the insured and the coverage
3110* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
3111* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
3112* [DetectedIssue](detectedissue.html): Unique id for the detected issue
3113* [DeviceRequest](devicerequest.html): Business identifier for request/order
3114* [DeviceUsage](deviceusage.html): Search by identifier
3115* [DiagnosticReport](diagnosticreport.html): An identifier for the report
3116* [DocumentReference](documentreference.html): Identifier of the attachment binary
3117* [Encounter](encounter.html): Identifier(s) by which this encounter is known
3118* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
3119* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
3120* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
3121* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
3122* [Flag](flag.html): Business identifier
3123* [Goal](goal.html): External Ids for this goal
3124* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
3125* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
3126* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
3127* [Immunization](immunization.html): Business identifier
3128* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
3129* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
3130* [Invoice](invoice.html): Business Identifier for item
3131* [List](list.html): Business identifier
3132* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
3133* [Medication](medication.html): Returns medications with this external identifier
3134* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
3135* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
3136* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
3137* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
3138* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
3139* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
3140* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
3141* [Observation](observation.html): The unique id for a particular observation
3142* [Person](person.html): A person Identifier
3143* [Procedure](procedure.html): A unique identifier for a procedure
3144* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
3145* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
3146* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
3147* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
3148* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
3149* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
3150* [Specimen](specimen.html): The unique identifier associated with the specimen
3151* [SupplyDelivery](supplydelivery.html): External identifier
3152* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
3153* [Task](task.html): Search for a task instance by its business identifier
3154* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
3155</b><br>
3156   * Type: <b>token</b><br>
3157   * 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>
3158   * </p>
3159   */
3160  @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" )
3161  public static final String SP_IDENTIFIER = "identifier";
3162 /**
3163   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3164   * <p>
3165   * Description: <b>Multiple Resources: 
3166
3167* [Account](account.html): Account number
3168* [AdverseEvent](adverseevent.html): Business identifier for the event
3169* [AllergyIntolerance](allergyintolerance.html): External ids for this item
3170* [Appointment](appointment.html): An Identifier of the Appointment
3171* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
3172* [Basic](basic.html): Business identifier
3173* [BodyStructure](bodystructure.html): Bodystructure identifier
3174* [CarePlan](careplan.html): External Ids for this plan
3175* [CareTeam](careteam.html): External Ids for this team
3176* [ChargeItem](chargeitem.html): Business Identifier for item
3177* [Claim](claim.html): The primary identifier of the financial resource
3178* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
3179* [ClinicalImpression](clinicalimpression.html): Business identifier
3180* [Communication](communication.html): Unique identifier
3181* [CommunicationRequest](communicationrequest.html): Unique identifier
3182* [Composition](composition.html): Version-independent identifier for the Composition
3183* [Condition](condition.html): A unique identifier of the condition record
3184* [Consent](consent.html): Identifier for this record (external references)
3185* [Contract](contract.html): The identity of the contract
3186* [Coverage](coverage.html): The primary identifier of the insured and the coverage
3187* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
3188* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
3189* [DetectedIssue](detectedissue.html): Unique id for the detected issue
3190* [DeviceRequest](devicerequest.html): Business identifier for request/order
3191* [DeviceUsage](deviceusage.html): Search by identifier
3192* [DiagnosticReport](diagnosticreport.html): An identifier for the report
3193* [DocumentReference](documentreference.html): Identifier of the attachment binary
3194* [Encounter](encounter.html): Identifier(s) by which this encounter is known
3195* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
3196* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
3197* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
3198* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
3199* [Flag](flag.html): Business identifier
3200* [Goal](goal.html): External Ids for this goal
3201* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
3202* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
3203* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
3204* [Immunization](immunization.html): Business identifier
3205* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
3206* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
3207* [Invoice](invoice.html): Business Identifier for item
3208* [List](list.html): Business identifier
3209* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
3210* [Medication](medication.html): Returns medications with this external identifier
3211* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
3212* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
3213* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
3214* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
3215* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
3216* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
3217* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
3218* [Observation](observation.html): The unique id for a particular observation
3219* [Person](person.html): A person Identifier
3220* [Procedure](procedure.html): A unique identifier for a procedure
3221* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
3222* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
3223* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
3224* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
3225* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
3226* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
3227* [Specimen](specimen.html): The unique identifier associated with the specimen
3228* [SupplyDelivery](supplydelivery.html): External identifier
3229* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
3230* [Task](task.html): Search for a task instance by its business identifier
3231* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
3232</b><br>
3233   * Type: <b>token</b><br>
3234   * 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>
3235   * </p>
3236   */
3237  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3238
3239 /**
3240   * Search parameter: <b>patient</b>
3241   * <p>
3242   * Description: <b>Multiple Resources: 
3243
3244* [Account](account.html): The entity that caused the expenses
3245* [AdverseEvent](adverseevent.html): Subject impacted by event
3246* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
3247* [Appointment](appointment.html): One of the individuals of the appointment is this patient
3248* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
3249* [AuditEvent](auditevent.html): Where the activity involved patient data
3250* [Basic](basic.html): Identifies the focus of this resource
3251* [BodyStructure](bodystructure.html): Who this is about
3252* [CarePlan](careplan.html): Who the care plan is for
3253* [CareTeam](careteam.html): Who care team is for
3254* [ChargeItem](chargeitem.html): Individual service was done for/to
3255* [Claim](claim.html): Patient receiving the products or services
3256* [ClaimResponse](claimresponse.html): The subject of care
3257* [ClinicalImpression](clinicalimpression.html): Patient assessed
3258* [Communication](communication.html): Focus of message
3259* [CommunicationRequest](communicationrequest.html): Focus of message
3260* [Composition](composition.html): Who and/or what the composition is about
3261* [Condition](condition.html): Who has the condition?
3262* [Consent](consent.html): Who the consent applies to
3263* [Contract](contract.html): The identity of the subject of the contract (if a patient)
3264* [Coverage](coverage.html): Retrieve coverages for a patient
3265* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
3266* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
3267* [DetectedIssue](detectedissue.html): Associated patient
3268* [DeviceRequest](devicerequest.html): Individual the service is ordered for
3269* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
3270* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
3271* [DocumentReference](documentreference.html): Who/what is the subject of the document
3272* [Encounter](encounter.html): The patient present at the encounter
3273* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
3274* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
3275* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
3276* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
3277* [Flag](flag.html): The identity of a subject to list flags for
3278* [Goal](goal.html): Who this goal is intended for
3279* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
3280* [ImagingSelection](imagingselection.html): Who the study is about
3281* [ImagingStudy](imagingstudy.html): Who the study is about
3282* [Immunization](immunization.html): The patient for the vaccination record
3283* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
3284* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
3285* [Invoice](invoice.html): Recipient(s) of goods and services
3286* [List](list.html): If all resources have the same subject
3287* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
3288* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
3289* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
3290* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
3291* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
3292* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
3293* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
3294* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
3295* [Observation](observation.html): The subject that the observation is about (if patient)
3296* [Person](person.html): The Person links to this Patient
3297* [Procedure](procedure.html): Search by subject - a patient
3298* [Provenance](provenance.html): Where the activity involved patient data
3299* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
3300* [RelatedPerson](relatedperson.html): The patient this related person is related to
3301* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
3302* [ResearchSubject](researchsubject.html): Who or what is part of study
3303* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
3304* [ServiceRequest](servicerequest.html): Search by subject - a patient
3305* [Specimen](specimen.html): The patient the specimen comes from
3306* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
3307* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
3308* [Task](task.html): Search by patient
3309* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
3310</b><br>
3311   * Type: <b>reference</b><br>
3312   * 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>
3313   * </p>
3314   */
3315  @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 } )
3316  public static final String SP_PATIENT = "patient";
3317 /**
3318   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3319   * <p>
3320   * Description: <b>Multiple Resources: 
3321
3322* [Account](account.html): The entity that caused the expenses
3323* [AdverseEvent](adverseevent.html): Subject impacted by event
3324* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
3325* [Appointment](appointment.html): One of the individuals of the appointment is this patient
3326* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
3327* [AuditEvent](auditevent.html): Where the activity involved patient data
3328* [Basic](basic.html): Identifies the focus of this resource
3329* [BodyStructure](bodystructure.html): Who this is about
3330* [CarePlan](careplan.html): Who the care plan is for
3331* [CareTeam](careteam.html): Who care team is for
3332* [ChargeItem](chargeitem.html): Individual service was done for/to
3333* [Claim](claim.html): Patient receiving the products or services
3334* [ClaimResponse](claimresponse.html): The subject of care
3335* [ClinicalImpression](clinicalimpression.html): Patient assessed
3336* [Communication](communication.html): Focus of message
3337* [CommunicationRequest](communicationrequest.html): Focus of message
3338* [Composition](composition.html): Who and/or what the composition is about
3339* [Condition](condition.html): Who has the condition?
3340* [Consent](consent.html): Who the consent applies to
3341* [Contract](contract.html): The identity of the subject of the contract (if a patient)
3342* [Coverage](coverage.html): Retrieve coverages for a patient
3343* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
3344* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
3345* [DetectedIssue](detectedissue.html): Associated patient
3346* [DeviceRequest](devicerequest.html): Individual the service is ordered for
3347* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
3348* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
3349* [DocumentReference](documentreference.html): Who/what is the subject of the document
3350* [Encounter](encounter.html): The patient present at the encounter
3351* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
3352* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
3353* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
3354* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
3355* [Flag](flag.html): The identity of a subject to list flags for
3356* [Goal](goal.html): Who this goal is intended for
3357* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
3358* [ImagingSelection](imagingselection.html): Who the study is about
3359* [ImagingStudy](imagingstudy.html): Who the study is about
3360* [Immunization](immunization.html): The patient for the vaccination record
3361* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
3362* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
3363* [Invoice](invoice.html): Recipient(s) of goods and services
3364* [List](list.html): If all resources have the same subject
3365* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
3366* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
3367* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
3368* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
3369* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
3370* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
3371* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
3372* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
3373* [Observation](observation.html): The subject that the observation is about (if patient)
3374* [Person](person.html): The Person links to this Patient
3375* [Procedure](procedure.html): Search by subject - a patient
3376* [Provenance](provenance.html): Where the activity involved patient data
3377* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
3378* [RelatedPerson](relatedperson.html): The patient this related person is related to
3379* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
3380* [ResearchSubject](researchsubject.html): Who or what is part of study
3381* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
3382* [ServiceRequest](servicerequest.html): Search by subject - a patient
3383* [Specimen](specimen.html): The patient the specimen comes from
3384* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
3385* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
3386* [Task](task.html): Search by patient
3387* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
3388</b><br>
3389   * Type: <b>reference</b><br>
3390   * 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>
3391   * </p>
3392   */
3393  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3394
3395/**
3396   * Constant for fluent queries to be used to add include statements. Specifies
3397   * the path value of "<b>MedicationDispense:patient</b>".
3398   */
3399  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MedicationDispense:patient").toLocked();
3400
3401 /**
3402   * Search parameter: <b>type</b>
3403   * <p>
3404   * Description: <b>Multiple Resources: 
3405
3406* [Account](account.html): E.g. patient, expense, depreciation
3407* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
3408* [Composition](composition.html): Kind of composition (LOINC if possible)
3409* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)
3410* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
3411* [Encounter](encounter.html): Specific type of encounter
3412* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
3413* [Invoice](invoice.html): Type of Invoice
3414* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type
3415* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence
3416* [Specimen](specimen.html): The specimen type
3417</b><br>
3418   * Type: <b>token</b><br>
3419   * Path: <b>Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type</b><br>
3420   * </p>
3421   */
3422  @SearchParamDefinition(name="type", path="Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type", description="Multiple Resources: \r\n\r\n* [Account](account.html): E.g. patient, expense, depreciation\r\n* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)\r\n* [Composition](composition.html): Kind of composition (LOINC if possible)\r\n* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)\r\n* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)\r\n* [Encounter](encounter.html): Specific type of encounter\r\n* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management\r\n* [Invoice](invoice.html): Type of Invoice\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type\r\n* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence\r\n* [Specimen](specimen.html): The specimen type\r\n", type="token" )
3423  public static final String SP_TYPE = "type";
3424 /**
3425   * <b>Fluent Client</b> search parameter constant for <b>type</b>
3426   * <p>
3427   * Description: <b>Multiple Resources: 
3428
3429* [Account](account.html): E.g. patient, expense, depreciation
3430* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
3431* [Composition](composition.html): Kind of composition (LOINC if possible)
3432* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)
3433* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
3434* [Encounter](encounter.html): Specific type of encounter
3435* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
3436* [Invoice](invoice.html): Type of Invoice
3437* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type
3438* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence
3439* [Specimen](specimen.html): The specimen type
3440</b><br>
3441   * Type: <b>token</b><br>
3442   * Path: <b>Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type</b><br>
3443   * </p>
3444   */
3445  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
3446
3447 /**
3448   * Search parameter: <b>medication</b>
3449   * <p>
3450   * Description: <b>Multiple Resources: 
3451
3452* [MedicationAdministration](medicationadministration.html): Return administrations of this medication reference
3453* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine resource
3454* [MedicationRequest](medicationrequest.html): Return prescriptions for this medication reference
3455* [MedicationStatement](medicationstatement.html): Return statements of this medication reference
3456</b><br>
3457   * Type: <b>reference</b><br>
3458   * Path: <b>MedicationAdministration.medication.reference | MedicationDispense.medication.reference | MedicationRequest.medication.reference | MedicationStatement.medication.reference</b><br>
3459   * </p>
3460   */
3461  @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 } )
3462  public static final String SP_MEDICATION = "medication";
3463 /**
3464   * <b>Fluent Client</b> search parameter constant for <b>medication</b>
3465   * <p>
3466   * Description: <b>Multiple Resources: 
3467
3468* [MedicationAdministration](medicationadministration.html): Return administrations of this medication reference
3469* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine resource
3470* [MedicationRequest](medicationrequest.html): Return prescriptions for this medication reference
3471* [MedicationStatement](medicationstatement.html): Return statements of this medication reference
3472</b><br>
3473   * Type: <b>reference</b><br>
3474   * Path: <b>MedicationAdministration.medication.reference | MedicationDispense.medication.reference | MedicationRequest.medication.reference | MedicationStatement.medication.reference</b><br>
3475   * </p>
3476   */
3477  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDICATION);
3478
3479/**
3480   * Constant for fluent queries to be used to add include statements. Specifies
3481   * the path value of "<b>MedicationDispense:medication</b>".
3482   */
3483  public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("MedicationDispense:medication").toLocked();
3484
3485 /**
3486   * Search parameter: <b>prescription</b>
3487   * <p>
3488   * Description: <b>Multiple Resources: 
3489
3490* [MedicationDispense](medicationdispense.html): The identity of a prescription to list dispenses from
3491</b><br>
3492   * Type: <b>reference</b><br>
3493   * Path: <b>MedicationDispense.authorizingPrescription</b><br>
3494   * </p>
3495   */
3496  @SearchParamDefinition(name="prescription", path="MedicationDispense.authorizingPrescription", description="Multiple Resources: \r\n\r\n* [MedicationDispense](medicationdispense.html): The identity of a prescription to list dispenses from\r\n", type="reference", target={MedicationRequest.class } )
3497  public static final String SP_PRESCRIPTION = "prescription";
3498 /**
3499   * <b>Fluent Client</b> search parameter constant for <b>prescription</b>
3500   * <p>
3501   * Description: <b>Multiple Resources: 
3502
3503* [MedicationDispense](medicationdispense.html): The identity of a prescription to list dispenses from
3504</b><br>
3505   * Type: <b>reference</b><br>
3506   * Path: <b>MedicationDispense.authorizingPrescription</b><br>
3507   * </p>
3508   */
3509  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRESCRIPTION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRESCRIPTION);
3510
3511/**
3512   * Constant for fluent queries to be used to add include statements. Specifies
3513   * the path value of "<b>MedicationDispense:prescription</b>".
3514   */
3515  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRESCRIPTION = new ca.uhn.fhir.model.api.Include("MedicationDispense:prescription").toLocked();
3516
3517 /**
3518   * Search parameter: <b>status</b>
3519   * <p>
3520   * Description: <b>Multiple Resources: 
3521
3522* [MedicationAdministration](medicationadministration.html): MedicationAdministration event status (for example one of active/paused/completed/nullified)
3523* [MedicationDispense](medicationdispense.html): Returns dispenses with a specified dispense status
3524* [MedicationRequest](medicationrequest.html): Status of the prescription
3525* [MedicationStatement](medicationstatement.html): Return statements that match the given status
3526</b><br>
3527   * Type: <b>token</b><br>
3528   * Path: <b>MedicationAdministration.status | MedicationDispense.status | MedicationRequest.status | MedicationStatement.status</b><br>
3529   * </p>
3530   */
3531  @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" )
3532  public static final String SP_STATUS = "status";
3533 /**
3534   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3535   * <p>
3536   * Description: <b>Multiple Resources: 
3537
3538* [MedicationAdministration](medicationadministration.html): MedicationAdministration event status (for example one of active/paused/completed/nullified)
3539* [MedicationDispense](medicationdispense.html): Returns dispenses with a specified dispense status
3540* [MedicationRequest](medicationrequest.html): Status of the prescription
3541* [MedicationStatement](medicationstatement.html): Return statements that match the given status
3542</b><br>
3543   * Type: <b>token</b><br>
3544   * Path: <b>MedicationAdministration.status | MedicationDispense.status | MedicationRequest.status | MedicationStatement.status</b><br>
3545   * </p>
3546   */
3547  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3548
3549
3550}
3551