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 Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
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 * Record of delivery of what is supplied.
052 */
053@ResourceDef(name="SupplyDelivery", profile="http://hl7.org/fhir/StructureDefinition/SupplyDelivery")
054public class SupplyDelivery extends DomainResource {
055
056    public enum SupplyDeliveryStatus {
057        /**
058         * Supply has been requested, but not delivered.
059         */
060        INPROGRESS, 
061        /**
062         * Supply has been delivered (\"completed\").
063         */
064        COMPLETED, 
065        /**
066         * Delivery was not completed.
067         */
068        ABANDONED, 
069        /**
070         * This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be \"abandoned\" rather than \"entered-in-error\".).
071         */
072        ENTEREDINERROR, 
073        /**
074         * added to help the parsers with the generic types
075         */
076        NULL;
077        public static SupplyDeliveryStatus fromCode(String codeString) throws FHIRException {
078            if (codeString == null || "".equals(codeString))
079                return null;
080        if ("in-progress".equals(codeString))
081          return INPROGRESS;
082        if ("completed".equals(codeString))
083          return COMPLETED;
084        if ("abandoned".equals(codeString))
085          return ABANDONED;
086        if ("entered-in-error".equals(codeString))
087          return ENTEREDINERROR;
088        if (Configuration.isAcceptInvalidEnums())
089          return null;
090        else
091          throw new FHIRException("Unknown SupplyDeliveryStatus code '"+codeString+"'");
092        }
093        public String toCode() {
094          switch (this) {
095            case INPROGRESS: return "in-progress";
096            case COMPLETED: return "completed";
097            case ABANDONED: return "abandoned";
098            case ENTEREDINERROR: return "entered-in-error";
099            case NULL: return null;
100            default: return "?";
101          }
102        }
103        public String getSystem() {
104          switch (this) {
105            case INPROGRESS: return "http://hl7.org/fhir/supplydelivery-status";
106            case COMPLETED: return "http://hl7.org/fhir/supplydelivery-status";
107            case ABANDONED: return "http://hl7.org/fhir/supplydelivery-status";
108            case ENTEREDINERROR: return "http://hl7.org/fhir/supplydelivery-status";
109            case NULL: return null;
110            default: return "?";
111          }
112        }
113        public String getDefinition() {
114          switch (this) {
115            case INPROGRESS: return "Supply has been requested, but not delivered.";
116            case COMPLETED: return "Supply has been delivered (\"completed\").";
117            case ABANDONED: return "Delivery was not completed.";
118            case ENTEREDINERROR: return "This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be \"abandoned\" rather than \"entered-in-error\".).";
119            case NULL: return null;
120            default: return "?";
121          }
122        }
123        public String getDisplay() {
124          switch (this) {
125            case INPROGRESS: return "In Progress";
126            case COMPLETED: return "Delivered";
127            case ABANDONED: return "Abandoned";
128            case ENTEREDINERROR: return "Entered In Error";
129            case NULL: return null;
130            default: return "?";
131          }
132        }
133    }
134
135  public static class SupplyDeliveryStatusEnumFactory implements EnumFactory<SupplyDeliveryStatus> {
136    public SupplyDeliveryStatus fromCode(String codeString) throws IllegalArgumentException {
137      if (codeString == null || "".equals(codeString))
138            if (codeString == null || "".equals(codeString))
139                return null;
140        if ("in-progress".equals(codeString))
141          return SupplyDeliveryStatus.INPROGRESS;
142        if ("completed".equals(codeString))
143          return SupplyDeliveryStatus.COMPLETED;
144        if ("abandoned".equals(codeString))
145          return SupplyDeliveryStatus.ABANDONED;
146        if ("entered-in-error".equals(codeString))
147          return SupplyDeliveryStatus.ENTEREDINERROR;
148        throw new IllegalArgumentException("Unknown SupplyDeliveryStatus code '"+codeString+"'");
149        }
150        public Enumeration<SupplyDeliveryStatus> fromType(Base code) throws FHIRException {
151          if (code == null)
152            return null;
153          if (code.isEmpty())
154            return new Enumeration<SupplyDeliveryStatus>(this);
155          String codeString = ((PrimitiveType) code).asStringValue();
156          if (codeString == null || "".equals(codeString))
157            return null;
158        if ("in-progress".equals(codeString))
159          return new Enumeration<SupplyDeliveryStatus>(this, SupplyDeliveryStatus.INPROGRESS);
160        if ("completed".equals(codeString))
161          return new Enumeration<SupplyDeliveryStatus>(this, SupplyDeliveryStatus.COMPLETED);
162        if ("abandoned".equals(codeString))
163          return new Enumeration<SupplyDeliveryStatus>(this, SupplyDeliveryStatus.ABANDONED);
164        if ("entered-in-error".equals(codeString))
165          return new Enumeration<SupplyDeliveryStatus>(this, SupplyDeliveryStatus.ENTEREDINERROR);
166        throw new FHIRException("Unknown SupplyDeliveryStatus code '"+codeString+"'");
167        }
168    public String toCode(SupplyDeliveryStatus code) {
169      if (code == SupplyDeliveryStatus.INPROGRESS)
170        return "in-progress";
171      if (code == SupplyDeliveryStatus.COMPLETED)
172        return "completed";
173      if (code == SupplyDeliveryStatus.ABANDONED)
174        return "abandoned";
175      if (code == SupplyDeliveryStatus.ENTEREDINERROR)
176        return "entered-in-error";
177      return "?";
178      }
179    public String toSystem(SupplyDeliveryStatus code) {
180      return code.getSystem();
181      }
182    }
183
184    @Block()
185    public static class SupplyDeliverySuppliedItemComponent extends BackboneElement implements IBaseBackboneElement {
186        /**
187         * The amount of supply that has been dispensed. Includes unit of measure.
188         */
189        @Child(name = "quantity", type = {Quantity.class}, order=1, min=0, max=1, modifier=false, summary=false)
190        @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of supply that has been dispensed. Includes unit of measure." )
191        protected Quantity quantity;
192
193        /**
194         * Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.
195         */
196        @Child(name = "item", type = {CodeableConcept.class, Medication.class, Substance.class, Device.class}, order=2, min=0, max=1, modifier=false, summary=false)
197        @Description(shortDefinition="Medication, Substance, or Device supplied", formalDefinition="Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list." )
198        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/supply-item")
199        protected DataType item;
200
201        private static final long serialVersionUID = -615919419L;
202
203    /**
204     * Constructor
205     */
206      public SupplyDeliverySuppliedItemComponent() {
207        super();
208      }
209
210        /**
211         * @return {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.)
212         */
213        public Quantity getQuantity() { 
214          if (this.quantity == null)
215            if (Configuration.errorOnAutoCreate())
216              throw new Error("Attempt to auto-create SupplyDeliverySuppliedItemComponent.quantity");
217            else if (Configuration.doAutoCreate())
218              this.quantity = new Quantity(); // cc
219          return this.quantity;
220        }
221
222        public boolean hasQuantity() { 
223          return this.quantity != null && !this.quantity.isEmpty();
224        }
225
226        /**
227         * @param value {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.)
228         */
229        public SupplyDeliverySuppliedItemComponent setQuantity(Quantity value) { 
230          this.quantity = value;
231          return this;
232        }
233
234        /**
235         * @return {@link #item} (Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.)
236         */
237        public DataType getItem() { 
238          return this.item;
239        }
240
241        /**
242         * @return {@link #item} (Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.)
243         */
244        public CodeableConcept getItemCodeableConcept() throws FHIRException { 
245          if (this.item == null)
246            this.item = new CodeableConcept();
247          if (!(this.item instanceof CodeableConcept))
248            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.item.getClass().getName()+" was encountered");
249          return (CodeableConcept) this.item;
250        }
251
252        public boolean hasItemCodeableConcept() { 
253          return this != null && this.item instanceof CodeableConcept;
254        }
255
256        /**
257         * @return {@link #item} (Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.)
258         */
259        public Reference getItemReference() throws FHIRException { 
260          if (this.item == null)
261            this.item = new Reference();
262          if (!(this.item instanceof Reference))
263            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.item.getClass().getName()+" was encountered");
264          return (Reference) this.item;
265        }
266
267        public boolean hasItemReference() { 
268          return this != null && this.item instanceof Reference;
269        }
270
271        public boolean hasItem() { 
272          return this.item != null && !this.item.isEmpty();
273        }
274
275        /**
276         * @param value {@link #item} (Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.)
277         */
278        public SupplyDeliverySuppliedItemComponent setItem(DataType value) { 
279          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
280            throw new Error("Not the right type for SupplyDelivery.suppliedItem.item[x]: "+value.fhirType());
281          this.item = value;
282          return this;
283        }
284
285        protected void listChildren(List<Property> children) {
286          super.listChildren(children);
287          children.add(new Property("quantity", "Quantity", "The amount of supply that has been dispensed. Includes unit of measure.", 0, 1, quantity));
288          children.add(new Property("item[x]", "CodeableConcept|Reference(Medication|Substance|Device)", "Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.", 0, 1, item));
289        }
290
291        @Override
292        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
293          switch (_hash) {
294          case -1285004149: /*quantity*/  return new Property("quantity", "Quantity", "The amount of supply that has been dispensed. Includes unit of measure.", 0, 1, quantity);
295          case 2116201613: /*item[x]*/  return new Property("item[x]", "CodeableConcept|Reference(Medication|Substance|Device)", "Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.", 0, 1, item);
296          case 3242771: /*item*/  return new Property("item[x]", "CodeableConcept|Reference(Medication|Substance|Device)", "Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.", 0, 1, item);
297          case 106644494: /*itemCodeableConcept*/  return new Property("item[x]", "CodeableConcept", "Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.", 0, 1, item);
298          case 1376364920: /*itemReference*/  return new Property("item[x]", "Reference(Medication|Substance|Device)", "Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.", 0, 1, item);
299          default: return super.getNamedProperty(_hash, _name, _checkValid);
300          }
301
302        }
303
304      @Override
305      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
306        switch (hash) {
307        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
308        case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // DataType
309        default: return super.getProperty(hash, name, checkValid);
310        }
311
312      }
313
314      @Override
315      public Base setProperty(int hash, String name, Base value) throws FHIRException {
316        switch (hash) {
317        case -1285004149: // quantity
318          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
319          return value;
320        case 3242771: // item
321          this.item = TypeConvertor.castToType(value); // DataType
322          return value;
323        default: return super.setProperty(hash, name, value);
324        }
325
326      }
327
328      @Override
329      public Base setProperty(String name, Base value) throws FHIRException {
330        if (name.equals("quantity")) {
331          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
332        } else if (name.equals("item[x]")) {
333          this.item = TypeConvertor.castToType(value); // DataType
334        } else
335          return super.setProperty(name, value);
336        return value;
337      }
338
339      @Override
340      public Base makeProperty(int hash, String name) throws FHIRException {
341        switch (hash) {
342        case -1285004149:  return getQuantity();
343        case 2116201613:  return getItem();
344        case 3242771:  return getItem();
345        default: return super.makeProperty(hash, name);
346        }
347
348      }
349
350      @Override
351      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
352        switch (hash) {
353        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
354        case 3242771: /*item*/ return new String[] {"CodeableConcept", "Reference"};
355        default: return super.getTypesForProperty(hash, name);
356        }
357
358      }
359
360      @Override
361      public Base addChild(String name) throws FHIRException {
362        if (name.equals("quantity")) {
363          this.quantity = new Quantity();
364          return this.quantity;
365        }
366        else if (name.equals("itemCodeableConcept")) {
367          this.item = new CodeableConcept();
368          return this.item;
369        }
370        else if (name.equals("itemReference")) {
371          this.item = new Reference();
372          return this.item;
373        }
374        else
375          return super.addChild(name);
376      }
377
378      public SupplyDeliverySuppliedItemComponent copy() {
379        SupplyDeliverySuppliedItemComponent dst = new SupplyDeliverySuppliedItemComponent();
380        copyValues(dst);
381        return dst;
382      }
383
384      public void copyValues(SupplyDeliverySuppliedItemComponent dst) {
385        super.copyValues(dst);
386        dst.quantity = quantity == null ? null : quantity.copy();
387        dst.item = item == null ? null : item.copy();
388      }
389
390      @Override
391      public boolean equalsDeep(Base other_) {
392        if (!super.equalsDeep(other_))
393          return false;
394        if (!(other_ instanceof SupplyDeliverySuppliedItemComponent))
395          return false;
396        SupplyDeliverySuppliedItemComponent o = (SupplyDeliverySuppliedItemComponent) other_;
397        return compareDeep(quantity, o.quantity, true) && compareDeep(item, o.item, true);
398      }
399
400      @Override
401      public boolean equalsShallow(Base other_) {
402        if (!super.equalsShallow(other_))
403          return false;
404        if (!(other_ instanceof SupplyDeliverySuppliedItemComponent))
405          return false;
406        SupplyDeliverySuppliedItemComponent o = (SupplyDeliverySuppliedItemComponent) other_;
407        return true;
408      }
409
410      public boolean isEmpty() {
411        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(quantity, item);
412      }
413
414  public String fhirType() {
415    return "SupplyDelivery.suppliedItem";
416
417  }
418
419  }
420
421    /**
422     * Identifier for the supply delivery event that is used to identify it across multiple disparate systems.
423     */
424    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
425    @Description(shortDefinition="External identifier", formalDefinition="Identifier for the supply delivery event that is used to identify it across multiple disparate systems." )
426    protected List<Identifier> identifier;
427
428    /**
429     * A plan, proposal or order that is fulfilled in whole or in part by this event.
430     */
431    @Child(name = "basedOn", type = {SupplyRequest.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
432    @Description(shortDefinition="Fulfills plan, proposal or order", formalDefinition="A plan, proposal or order that is fulfilled in whole or in part by this event." )
433    protected List<Reference> basedOn;
434
435    /**
436     * A larger event of which this particular event is a component or step.
437     */
438    @Child(name = "partOf", type = {SupplyDelivery.class, Contract.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
439    @Description(shortDefinition="Part of referenced event", formalDefinition="A larger event of which this particular event is a component or step." )
440    protected List<Reference> partOf;
441
442    /**
443     * A code specifying the state of the dispense event.
444     */
445    @Child(name = "status", type = {CodeType.class}, order=3, min=0, max=1, modifier=true, summary=true)
446    @Description(shortDefinition="in-progress | completed | abandoned | entered-in-error", formalDefinition="A code specifying the state of the dispense event." )
447    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/supplydelivery-status")
448    protected Enumeration<SupplyDeliveryStatus> status;
449
450    /**
451     * A link to a resource representing the person whom the delivered item is for.
452     */
453    @Child(name = "patient", type = {Patient.class}, order=4, min=0, max=1, modifier=false, summary=false)
454    @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the delivered item is for." )
455    protected Reference patient;
456
457    /**
458     * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.
459     */
460    @Child(name = "type", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false)
461    @Description(shortDefinition="Category of dispense event", formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." )
462    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/supplydelivery-type")
463    protected CodeableConcept type;
464
465    /**
466     * The item that is being delivered or has been supplied.
467     */
468    @Child(name = "suppliedItem", type = {}, order=6, min=0, max=1, modifier=false, summary=false)
469    @Description(shortDefinition="The item that is delivered or supplied", formalDefinition="The item that is being delivered or has been supplied." )
470    protected SupplyDeliverySuppliedItemComponent suppliedItem;
471
472    /**
473     * The date or time(s) the activity occurred.
474     */
475    @Child(name = "occurrence", type = {DateTimeType.class, Period.class, Timing.class}, order=7, min=0, max=1, modifier=false, summary=true)
476    @Description(shortDefinition="When event occurred", formalDefinition="The date or time(s) the activity occurred." )
477    protected DataType occurrence;
478
479    /**
480     * The individual responsible for dispensing the medication, supplier or device.
481     */
482    @Child(name = "supplier", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=false)
483    @Description(shortDefinition="Dispenser", formalDefinition="The individual responsible for dispensing the medication, supplier or device." )
484    protected Reference supplier;
485
486    /**
487     * Identification of the facility/location where the Supply was shipped to, as part of the dispense event.
488     */
489    @Child(name = "destination", type = {Location.class}, order=9, min=0, max=1, modifier=false, summary=false)
490    @Description(shortDefinition="Where the Supply was sent", formalDefinition="Identification of the facility/location where the Supply was shipped to, as part of the dispense event." )
491    protected Reference destination;
492
493    /**
494     * Identifies the person who picked up the Supply.
495     */
496    @Child(name = "receiver", type = {Practitioner.class, PractitionerRole.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
497    @Description(shortDefinition="Who collected the Supply", formalDefinition="Identifies the person who picked up the Supply." )
498    protected List<Reference> receiver;
499
500    private static final long serialVersionUID = -841753644L;
501
502  /**
503   * Constructor
504   */
505    public SupplyDelivery() {
506      super();
507    }
508
509    /**
510     * @return {@link #identifier} (Identifier for the supply delivery event that is used to identify it across multiple disparate systems.)
511     */
512    public List<Identifier> getIdentifier() { 
513      if (this.identifier == null)
514        this.identifier = new ArrayList<Identifier>();
515      return this.identifier;
516    }
517
518    /**
519     * @return Returns a reference to <code>this</code> for easy method chaining
520     */
521    public SupplyDelivery setIdentifier(List<Identifier> theIdentifier) { 
522      this.identifier = theIdentifier;
523      return this;
524    }
525
526    public boolean hasIdentifier() { 
527      if (this.identifier == null)
528        return false;
529      for (Identifier item : this.identifier)
530        if (!item.isEmpty())
531          return true;
532      return false;
533    }
534
535    public Identifier addIdentifier() { //3
536      Identifier t = new Identifier();
537      if (this.identifier == null)
538        this.identifier = new ArrayList<Identifier>();
539      this.identifier.add(t);
540      return t;
541    }
542
543    public SupplyDelivery addIdentifier(Identifier t) { //3
544      if (t == null)
545        return this;
546      if (this.identifier == null)
547        this.identifier = new ArrayList<Identifier>();
548      this.identifier.add(t);
549      return this;
550    }
551
552    /**
553     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
554     */
555    public Identifier getIdentifierFirstRep() { 
556      if (getIdentifier().isEmpty()) {
557        addIdentifier();
558      }
559      return getIdentifier().get(0);
560    }
561
562    /**
563     * @return {@link #basedOn} (A plan, proposal or order that is fulfilled in whole or in part by this event.)
564     */
565    public List<Reference> getBasedOn() { 
566      if (this.basedOn == null)
567        this.basedOn = new ArrayList<Reference>();
568      return this.basedOn;
569    }
570
571    /**
572     * @return Returns a reference to <code>this</code> for easy method chaining
573     */
574    public SupplyDelivery setBasedOn(List<Reference> theBasedOn) { 
575      this.basedOn = theBasedOn;
576      return this;
577    }
578
579    public boolean hasBasedOn() { 
580      if (this.basedOn == null)
581        return false;
582      for (Reference item : this.basedOn)
583        if (!item.isEmpty())
584          return true;
585      return false;
586    }
587
588    public Reference addBasedOn() { //3
589      Reference t = new Reference();
590      if (this.basedOn == null)
591        this.basedOn = new ArrayList<Reference>();
592      this.basedOn.add(t);
593      return t;
594    }
595
596    public SupplyDelivery addBasedOn(Reference t) { //3
597      if (t == null)
598        return this;
599      if (this.basedOn == null)
600        this.basedOn = new ArrayList<Reference>();
601      this.basedOn.add(t);
602      return this;
603    }
604
605    /**
606     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
607     */
608    public Reference getBasedOnFirstRep() { 
609      if (getBasedOn().isEmpty()) {
610        addBasedOn();
611      }
612      return getBasedOn().get(0);
613    }
614
615    /**
616     * @return {@link #partOf} (A larger event of which this particular event is a component or step.)
617     */
618    public List<Reference> getPartOf() { 
619      if (this.partOf == null)
620        this.partOf = new ArrayList<Reference>();
621      return this.partOf;
622    }
623
624    /**
625     * @return Returns a reference to <code>this</code> for easy method chaining
626     */
627    public SupplyDelivery setPartOf(List<Reference> thePartOf) { 
628      this.partOf = thePartOf;
629      return this;
630    }
631
632    public boolean hasPartOf() { 
633      if (this.partOf == null)
634        return false;
635      for (Reference item : this.partOf)
636        if (!item.isEmpty())
637          return true;
638      return false;
639    }
640
641    public Reference addPartOf() { //3
642      Reference t = new Reference();
643      if (this.partOf == null)
644        this.partOf = new ArrayList<Reference>();
645      this.partOf.add(t);
646      return t;
647    }
648
649    public SupplyDelivery addPartOf(Reference t) { //3
650      if (t == null)
651        return this;
652      if (this.partOf == null)
653        this.partOf = new ArrayList<Reference>();
654      this.partOf.add(t);
655      return this;
656    }
657
658    /**
659     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist {3}
660     */
661    public Reference getPartOfFirstRep() { 
662      if (getPartOf().isEmpty()) {
663        addPartOf();
664      }
665      return getPartOf().get(0);
666    }
667
668    /**
669     * @return {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
670     */
671    public Enumeration<SupplyDeliveryStatus> getStatusElement() { 
672      if (this.status == null)
673        if (Configuration.errorOnAutoCreate())
674          throw new Error("Attempt to auto-create SupplyDelivery.status");
675        else if (Configuration.doAutoCreate())
676          this.status = new Enumeration<SupplyDeliveryStatus>(new SupplyDeliveryStatusEnumFactory()); // bb
677      return this.status;
678    }
679
680    public boolean hasStatusElement() { 
681      return this.status != null && !this.status.isEmpty();
682    }
683
684    public boolean hasStatus() { 
685      return this.status != null && !this.status.isEmpty();
686    }
687
688    /**
689     * @param value {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
690     */
691    public SupplyDelivery setStatusElement(Enumeration<SupplyDeliveryStatus> value) { 
692      this.status = value;
693      return this;
694    }
695
696    /**
697     * @return A code specifying the state of the dispense event.
698     */
699    public SupplyDeliveryStatus getStatus() { 
700      return this.status == null ? null : this.status.getValue();
701    }
702
703    /**
704     * @param value A code specifying the state of the dispense event.
705     */
706    public SupplyDelivery setStatus(SupplyDeliveryStatus value) { 
707      if (value == null)
708        this.status = null;
709      else {
710        if (this.status == null)
711          this.status = new Enumeration<SupplyDeliveryStatus>(new SupplyDeliveryStatusEnumFactory());
712        this.status.setValue(value);
713      }
714      return this;
715    }
716
717    /**
718     * @return {@link #patient} (A link to a resource representing the person whom the delivered item is for.)
719     */
720    public Reference getPatient() { 
721      if (this.patient == null)
722        if (Configuration.errorOnAutoCreate())
723          throw new Error("Attempt to auto-create SupplyDelivery.patient");
724        else if (Configuration.doAutoCreate())
725          this.patient = new Reference(); // cc
726      return this.patient;
727    }
728
729    public boolean hasPatient() { 
730      return this.patient != null && !this.patient.isEmpty();
731    }
732
733    /**
734     * @param value {@link #patient} (A link to a resource representing the person whom the delivered item is for.)
735     */
736    public SupplyDelivery setPatient(Reference value) { 
737      this.patient = value;
738      return this;
739    }
740
741    /**
742     * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.)
743     */
744    public CodeableConcept getType() { 
745      if (this.type == null)
746        if (Configuration.errorOnAutoCreate())
747          throw new Error("Attempt to auto-create SupplyDelivery.type");
748        else if (Configuration.doAutoCreate())
749          this.type = new CodeableConcept(); // cc
750      return this.type;
751    }
752
753    public boolean hasType() { 
754      return this.type != null && !this.type.isEmpty();
755    }
756
757    /**
758     * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.)
759     */
760    public SupplyDelivery setType(CodeableConcept value) { 
761      this.type = value;
762      return this;
763    }
764
765    /**
766     * @return {@link #suppliedItem} (The item that is being delivered or has been supplied.)
767     */
768    public SupplyDeliverySuppliedItemComponent getSuppliedItem() { 
769      if (this.suppliedItem == null)
770        if (Configuration.errorOnAutoCreate())
771          throw new Error("Attempt to auto-create SupplyDelivery.suppliedItem");
772        else if (Configuration.doAutoCreate())
773          this.suppliedItem = new SupplyDeliverySuppliedItemComponent(); // cc
774      return this.suppliedItem;
775    }
776
777    public boolean hasSuppliedItem() { 
778      return this.suppliedItem != null && !this.suppliedItem.isEmpty();
779    }
780
781    /**
782     * @param value {@link #suppliedItem} (The item that is being delivered or has been supplied.)
783     */
784    public SupplyDelivery setSuppliedItem(SupplyDeliverySuppliedItemComponent value) { 
785      this.suppliedItem = value;
786      return this;
787    }
788
789    /**
790     * @return {@link #occurrence} (The date or time(s) the activity occurred.)
791     */
792    public DataType getOccurrence() { 
793      return this.occurrence;
794    }
795
796    /**
797     * @return {@link #occurrence} (The date or time(s) the activity occurred.)
798     */
799    public DateTimeType getOccurrenceDateTimeType() throws FHIRException { 
800      if (this.occurrence == null)
801        this.occurrence = new DateTimeType();
802      if (!(this.occurrence instanceof DateTimeType))
803        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
804      return (DateTimeType) this.occurrence;
805    }
806
807    public boolean hasOccurrenceDateTimeType() { 
808      return this != null && this.occurrence instanceof DateTimeType;
809    }
810
811    /**
812     * @return {@link #occurrence} (The date or time(s) the activity occurred.)
813     */
814    public Period getOccurrencePeriod() throws FHIRException { 
815      if (this.occurrence == null)
816        this.occurrence = new Period();
817      if (!(this.occurrence instanceof Period))
818        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.occurrence.getClass().getName()+" was encountered");
819      return (Period) this.occurrence;
820    }
821
822    public boolean hasOccurrencePeriod() { 
823      return this != null && this.occurrence instanceof Period;
824    }
825
826    /**
827     * @return {@link #occurrence} (The date or time(s) the activity occurred.)
828     */
829    public Timing getOccurrenceTiming() throws FHIRException { 
830      if (this.occurrence == null)
831        this.occurrence = new Timing();
832      if (!(this.occurrence instanceof Timing))
833        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.occurrence.getClass().getName()+" was encountered");
834      return (Timing) this.occurrence;
835    }
836
837    public boolean hasOccurrenceTiming() { 
838      return this != null && this.occurrence instanceof Timing;
839    }
840
841    public boolean hasOccurrence() { 
842      return this.occurrence != null && !this.occurrence.isEmpty();
843    }
844
845    /**
846     * @param value {@link #occurrence} (The date or time(s) the activity occurred.)
847     */
848    public SupplyDelivery setOccurrence(DataType value) { 
849      if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof Timing))
850        throw new Error("Not the right type for SupplyDelivery.occurrence[x]: "+value.fhirType());
851      this.occurrence = value;
852      return this;
853    }
854
855    /**
856     * @return {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.)
857     */
858    public Reference getSupplier() { 
859      if (this.supplier == null)
860        if (Configuration.errorOnAutoCreate())
861          throw new Error("Attempt to auto-create SupplyDelivery.supplier");
862        else if (Configuration.doAutoCreate())
863          this.supplier = new Reference(); // cc
864      return this.supplier;
865    }
866
867    public boolean hasSupplier() { 
868      return this.supplier != null && !this.supplier.isEmpty();
869    }
870
871    /**
872     * @param value {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.)
873     */
874    public SupplyDelivery setSupplier(Reference value) { 
875      this.supplier = value;
876      return this;
877    }
878
879    /**
880     * @return {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.)
881     */
882    public Reference getDestination() { 
883      if (this.destination == null)
884        if (Configuration.errorOnAutoCreate())
885          throw new Error("Attempt to auto-create SupplyDelivery.destination");
886        else if (Configuration.doAutoCreate())
887          this.destination = new Reference(); // cc
888      return this.destination;
889    }
890
891    public boolean hasDestination() { 
892      return this.destination != null && !this.destination.isEmpty();
893    }
894
895    /**
896     * @param value {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.)
897     */
898    public SupplyDelivery setDestination(Reference value) { 
899      this.destination = value;
900      return this;
901    }
902
903    /**
904     * @return {@link #receiver} (Identifies the person who picked up the Supply.)
905     */
906    public List<Reference> getReceiver() { 
907      if (this.receiver == null)
908        this.receiver = new ArrayList<Reference>();
909      return this.receiver;
910    }
911
912    /**
913     * @return Returns a reference to <code>this</code> for easy method chaining
914     */
915    public SupplyDelivery setReceiver(List<Reference> theReceiver) { 
916      this.receiver = theReceiver;
917      return this;
918    }
919
920    public boolean hasReceiver() { 
921      if (this.receiver == null)
922        return false;
923      for (Reference item : this.receiver)
924        if (!item.isEmpty())
925          return true;
926      return false;
927    }
928
929    public Reference addReceiver() { //3
930      Reference t = new Reference();
931      if (this.receiver == null)
932        this.receiver = new ArrayList<Reference>();
933      this.receiver.add(t);
934      return t;
935    }
936
937    public SupplyDelivery addReceiver(Reference t) { //3
938      if (t == null)
939        return this;
940      if (this.receiver == null)
941        this.receiver = new ArrayList<Reference>();
942      this.receiver.add(t);
943      return this;
944    }
945
946    /**
947     * @return The first repetition of repeating field {@link #receiver}, creating it if it does not already exist {3}
948     */
949    public Reference getReceiverFirstRep() { 
950      if (getReceiver().isEmpty()) {
951        addReceiver();
952      }
953      return getReceiver().get(0);
954    }
955
956      protected void listChildren(List<Property> children) {
957        super.listChildren(children);
958        children.add(new Property("identifier", "Identifier", "Identifier for the supply delivery event that is used to identify it across multiple disparate systems.", 0, java.lang.Integer.MAX_VALUE, identifier));
959        children.add(new Property("basedOn", "Reference(SupplyRequest)", "A plan, proposal or order that is fulfilled in whole or in part by this event.", 0, java.lang.Integer.MAX_VALUE, basedOn));
960        children.add(new Property("partOf", "Reference(SupplyDelivery|Contract)", "A larger event of which this particular event is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf));
961        children.add(new Property("status", "code", "A code specifying the state of the dispense event.", 0, 1, status));
962        children.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the delivered item is for.", 0, 1, patient));
963        children.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, 1, type));
964        children.add(new Property("suppliedItem", "", "The item that is being delivered or has been supplied.", 0, 1, suppliedItem));
965        children.add(new Property("occurrence[x]", "dateTime|Period|Timing", "The date or time(s) the activity occurred.", 0, 1, occurrence));
966        children.add(new Property("supplier", "Reference(Practitioner|PractitionerRole|Organization)", "The individual responsible for dispensing the medication, supplier or device.", 0, 1, supplier));
967        children.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the Supply was shipped to, as part of the dispense event.", 0, 1, destination));
968        children.add(new Property("receiver", "Reference(Practitioner|PractitionerRole)", "Identifies the person who picked up the Supply.", 0, java.lang.Integer.MAX_VALUE, receiver));
969      }
970
971      @Override
972      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
973        switch (_hash) {
974        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifier for the supply delivery event that is used to identify it across multiple disparate systems.", 0, java.lang.Integer.MAX_VALUE, identifier);
975        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(SupplyRequest)", "A plan, proposal or order that is fulfilled in whole or in part by this event.", 0, java.lang.Integer.MAX_VALUE, basedOn);
976        case -995410646: /*partOf*/  return new Property("partOf", "Reference(SupplyDelivery|Contract)", "A larger event of which this particular event is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf);
977        case -892481550: /*status*/  return new Property("status", "code", "A code specifying the state of the dispense event.", 0, 1, status);
978        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the delivered item is for.", 0, 1, patient);
979        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, 1, type);
980        case 1993333233: /*suppliedItem*/  return new Property("suppliedItem", "", "The item that is being delivered or has been supplied.", 0, 1, suppliedItem);
981        case -2022646513: /*occurrence[x]*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "The date or time(s) the activity occurred.", 0, 1, occurrence);
982        case 1687874001: /*occurrence*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "The date or time(s) the activity occurred.", 0, 1, occurrence);
983        case -298443636: /*occurrenceDateTime*/  return new Property("occurrence[x]", "dateTime", "The date or time(s) the activity occurred.", 0, 1, occurrence);
984        case 1397156594: /*occurrencePeriod*/  return new Property("occurrence[x]", "Period", "The date or time(s) the activity occurred.", 0, 1, occurrence);
985        case 1515218299: /*occurrenceTiming*/  return new Property("occurrence[x]", "Timing", "The date or time(s) the activity occurred.", 0, 1, occurrence);
986        case -1663305268: /*supplier*/  return new Property("supplier", "Reference(Practitioner|PractitionerRole|Organization)", "The individual responsible for dispensing the medication, supplier or device.", 0, 1, supplier);
987        case -1429847026: /*destination*/  return new Property("destination", "Reference(Location)", "Identification of the facility/location where the Supply was shipped to, as part of the dispense event.", 0, 1, destination);
988        case -808719889: /*receiver*/  return new Property("receiver", "Reference(Practitioner|PractitionerRole)", "Identifies the person who picked up the Supply.", 0, java.lang.Integer.MAX_VALUE, receiver);
989        default: return super.getNamedProperty(_hash, _name, _checkValid);
990        }
991
992      }
993
994      @Override
995      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
996        switch (hash) {
997        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
998        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
999        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
1000        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<SupplyDeliveryStatus>
1001        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
1002        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1003        case 1993333233: /*suppliedItem*/ return this.suppliedItem == null ? new Base[0] : new Base[] {this.suppliedItem}; // SupplyDeliverySuppliedItemComponent
1004        case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // DataType
1005        case -1663305268: /*supplier*/ return this.supplier == null ? new Base[0] : new Base[] {this.supplier}; // Reference
1006        case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // Reference
1007        case -808719889: /*receiver*/ return this.receiver == null ? new Base[0] : this.receiver.toArray(new Base[this.receiver.size()]); // Reference
1008        default: return super.getProperty(hash, name, checkValid);
1009        }
1010
1011      }
1012
1013      @Override
1014      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1015        switch (hash) {
1016        case -1618432855: // identifier
1017          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1018          return value;
1019        case -332612366: // basedOn
1020          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
1021          return value;
1022        case -995410646: // partOf
1023          this.getPartOf().add(TypeConvertor.castToReference(value)); // Reference
1024          return value;
1025        case -892481550: // status
1026          value = new SupplyDeliveryStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1027          this.status = (Enumeration) value; // Enumeration<SupplyDeliveryStatus>
1028          return value;
1029        case -791418107: // patient
1030          this.patient = TypeConvertor.castToReference(value); // Reference
1031          return value;
1032        case 3575610: // type
1033          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1034          return value;
1035        case 1993333233: // suppliedItem
1036          this.suppliedItem = (SupplyDeliverySuppliedItemComponent) value; // SupplyDeliverySuppliedItemComponent
1037          return value;
1038        case 1687874001: // occurrence
1039          this.occurrence = TypeConvertor.castToType(value); // DataType
1040          return value;
1041        case -1663305268: // supplier
1042          this.supplier = TypeConvertor.castToReference(value); // Reference
1043          return value;
1044        case -1429847026: // destination
1045          this.destination = TypeConvertor.castToReference(value); // Reference
1046          return value;
1047        case -808719889: // receiver
1048          this.getReceiver().add(TypeConvertor.castToReference(value)); // Reference
1049          return value;
1050        default: return super.setProperty(hash, name, value);
1051        }
1052
1053      }
1054
1055      @Override
1056      public Base setProperty(String name, Base value) throws FHIRException {
1057        if (name.equals("identifier")) {
1058          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1059        } else if (name.equals("basedOn")) {
1060          this.getBasedOn().add(TypeConvertor.castToReference(value));
1061        } else if (name.equals("partOf")) {
1062          this.getPartOf().add(TypeConvertor.castToReference(value));
1063        } else if (name.equals("status")) {
1064          value = new SupplyDeliveryStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1065          this.status = (Enumeration) value; // Enumeration<SupplyDeliveryStatus>
1066        } else if (name.equals("patient")) {
1067          this.patient = TypeConvertor.castToReference(value); // Reference
1068        } else if (name.equals("type")) {
1069          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1070        } else if (name.equals("suppliedItem")) {
1071          this.suppliedItem = (SupplyDeliverySuppliedItemComponent) value; // SupplyDeliverySuppliedItemComponent
1072        } else if (name.equals("occurrence[x]")) {
1073          this.occurrence = TypeConvertor.castToType(value); // DataType
1074        } else if (name.equals("supplier")) {
1075          this.supplier = TypeConvertor.castToReference(value); // Reference
1076        } else if (name.equals("destination")) {
1077          this.destination = TypeConvertor.castToReference(value); // Reference
1078        } else if (name.equals("receiver")) {
1079          this.getReceiver().add(TypeConvertor.castToReference(value));
1080        } else
1081          return super.setProperty(name, value);
1082        return value;
1083      }
1084
1085      @Override
1086      public Base makeProperty(int hash, String name) throws FHIRException {
1087        switch (hash) {
1088        case -1618432855:  return addIdentifier(); 
1089        case -332612366:  return addBasedOn(); 
1090        case -995410646:  return addPartOf(); 
1091        case -892481550:  return getStatusElement();
1092        case -791418107:  return getPatient();
1093        case 3575610:  return getType();
1094        case 1993333233:  return getSuppliedItem();
1095        case -2022646513:  return getOccurrence();
1096        case 1687874001:  return getOccurrence();
1097        case -1663305268:  return getSupplier();
1098        case -1429847026:  return getDestination();
1099        case -808719889:  return addReceiver(); 
1100        default: return super.makeProperty(hash, name);
1101        }
1102
1103      }
1104
1105      @Override
1106      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1107        switch (hash) {
1108        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1109        case -332612366: /*basedOn*/ return new String[] {"Reference"};
1110        case -995410646: /*partOf*/ return new String[] {"Reference"};
1111        case -892481550: /*status*/ return new String[] {"code"};
1112        case -791418107: /*patient*/ return new String[] {"Reference"};
1113        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1114        case 1993333233: /*suppliedItem*/ return new String[] {};
1115        case 1687874001: /*occurrence*/ return new String[] {"dateTime", "Period", "Timing"};
1116        case -1663305268: /*supplier*/ return new String[] {"Reference"};
1117        case -1429847026: /*destination*/ return new String[] {"Reference"};
1118        case -808719889: /*receiver*/ return new String[] {"Reference"};
1119        default: return super.getTypesForProperty(hash, name);
1120        }
1121
1122      }
1123
1124      @Override
1125      public Base addChild(String name) throws FHIRException {
1126        if (name.equals("identifier")) {
1127          return addIdentifier();
1128        }
1129        else if (name.equals("basedOn")) {
1130          return addBasedOn();
1131        }
1132        else if (name.equals("partOf")) {
1133          return addPartOf();
1134        }
1135        else if (name.equals("status")) {
1136          throw new FHIRException("Cannot call addChild on a primitive type SupplyDelivery.status");
1137        }
1138        else if (name.equals("patient")) {
1139          this.patient = new Reference();
1140          return this.patient;
1141        }
1142        else if (name.equals("type")) {
1143          this.type = new CodeableConcept();
1144          return this.type;
1145        }
1146        else if (name.equals("suppliedItem")) {
1147          this.suppliedItem = new SupplyDeliverySuppliedItemComponent();
1148          return this.suppliedItem;
1149        }
1150        else if (name.equals("occurrenceDateTime")) {
1151          this.occurrence = new DateTimeType();
1152          return this.occurrence;
1153        }
1154        else if (name.equals("occurrencePeriod")) {
1155          this.occurrence = new Period();
1156          return this.occurrence;
1157        }
1158        else if (name.equals("occurrenceTiming")) {
1159          this.occurrence = new Timing();
1160          return this.occurrence;
1161        }
1162        else if (name.equals("supplier")) {
1163          this.supplier = new Reference();
1164          return this.supplier;
1165        }
1166        else if (name.equals("destination")) {
1167          this.destination = new Reference();
1168          return this.destination;
1169        }
1170        else if (name.equals("receiver")) {
1171          return addReceiver();
1172        }
1173        else
1174          return super.addChild(name);
1175      }
1176
1177  public String fhirType() {
1178    return "SupplyDelivery";
1179
1180  }
1181
1182      public SupplyDelivery copy() {
1183        SupplyDelivery dst = new SupplyDelivery();
1184        copyValues(dst);
1185        return dst;
1186      }
1187
1188      public void copyValues(SupplyDelivery dst) {
1189        super.copyValues(dst);
1190        if (identifier != null) {
1191          dst.identifier = new ArrayList<Identifier>();
1192          for (Identifier i : identifier)
1193            dst.identifier.add(i.copy());
1194        };
1195        if (basedOn != null) {
1196          dst.basedOn = new ArrayList<Reference>();
1197          for (Reference i : basedOn)
1198            dst.basedOn.add(i.copy());
1199        };
1200        if (partOf != null) {
1201          dst.partOf = new ArrayList<Reference>();
1202          for (Reference i : partOf)
1203            dst.partOf.add(i.copy());
1204        };
1205        dst.status = status == null ? null : status.copy();
1206        dst.patient = patient == null ? null : patient.copy();
1207        dst.type = type == null ? null : type.copy();
1208        dst.suppliedItem = suppliedItem == null ? null : suppliedItem.copy();
1209        dst.occurrence = occurrence == null ? null : occurrence.copy();
1210        dst.supplier = supplier == null ? null : supplier.copy();
1211        dst.destination = destination == null ? null : destination.copy();
1212        if (receiver != null) {
1213          dst.receiver = new ArrayList<Reference>();
1214          for (Reference i : receiver)
1215            dst.receiver.add(i.copy());
1216        };
1217      }
1218
1219      protected SupplyDelivery typedCopy() {
1220        return copy();
1221      }
1222
1223      @Override
1224      public boolean equalsDeep(Base other_) {
1225        if (!super.equalsDeep(other_))
1226          return false;
1227        if (!(other_ instanceof SupplyDelivery))
1228          return false;
1229        SupplyDelivery o = (SupplyDelivery) other_;
1230        return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(partOf, o.partOf, true)
1231           && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) && compareDeep(type, o.type, true)
1232           && compareDeep(suppliedItem, o.suppliedItem, true) && compareDeep(occurrence, o.occurrence, true)
1233           && compareDeep(supplier, o.supplier, true) && compareDeep(destination, o.destination, true) && compareDeep(receiver, o.receiver, true)
1234          ;
1235      }
1236
1237      @Override
1238      public boolean equalsShallow(Base other_) {
1239        if (!super.equalsShallow(other_))
1240          return false;
1241        if (!(other_ instanceof SupplyDelivery))
1242          return false;
1243        SupplyDelivery o = (SupplyDelivery) other_;
1244        return compareValues(status, o.status, true);
1245      }
1246
1247      public boolean isEmpty() {
1248        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, partOf
1249          , status, patient, type, suppliedItem, occurrence, supplier, destination, receiver
1250          );
1251      }
1252
1253  @Override
1254  public ResourceType getResourceType() {
1255    return ResourceType.SupplyDelivery;
1256   }
1257
1258 /**
1259   * Search parameter: <b>receiver</b>
1260   * <p>
1261   * Description: <b>Who collected the Supply</b><br>
1262   * Type: <b>reference</b><br>
1263   * Path: <b>SupplyDelivery.receiver</b><br>
1264   * </p>
1265   */
1266  @SearchParamDefinition(name="receiver", path="SupplyDelivery.receiver", description="Who collected the Supply", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Practitioner.class, PractitionerRole.class } )
1267  public static final String SP_RECEIVER = "receiver";
1268 /**
1269   * <b>Fluent Client</b> search parameter constant for <b>receiver</b>
1270   * <p>
1271   * Description: <b>Who collected the Supply</b><br>
1272   * Type: <b>reference</b><br>
1273   * Path: <b>SupplyDelivery.receiver</b><br>
1274   * </p>
1275   */
1276  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECEIVER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECEIVER);
1277
1278/**
1279   * Constant for fluent queries to be used to add include statements. Specifies
1280   * the path value of "<b>SupplyDelivery:receiver</b>".
1281   */
1282  public static final ca.uhn.fhir.model.api.Include INCLUDE_RECEIVER = new ca.uhn.fhir.model.api.Include("SupplyDelivery:receiver").toLocked();
1283
1284 /**
1285   * Search parameter: <b>status</b>
1286   * <p>
1287   * Description: <b>in-progress | completed | abandoned | entered-in-error</b><br>
1288   * Type: <b>token</b><br>
1289   * Path: <b>SupplyDelivery.status</b><br>
1290   * </p>
1291   */
1292  @SearchParamDefinition(name="status", path="SupplyDelivery.status", description="in-progress | completed | abandoned | entered-in-error", type="token" )
1293  public static final String SP_STATUS = "status";
1294 /**
1295   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1296   * <p>
1297   * Description: <b>in-progress | completed | abandoned | entered-in-error</b><br>
1298   * Type: <b>token</b><br>
1299   * Path: <b>SupplyDelivery.status</b><br>
1300   * </p>
1301   */
1302  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1303
1304 /**
1305   * Search parameter: <b>supplier</b>
1306   * <p>
1307   * Description: <b>Dispenser</b><br>
1308   * Type: <b>reference</b><br>
1309   * Path: <b>SupplyDelivery.supplier</b><br>
1310   * </p>
1311   */
1312  @SearchParamDefinition(name="supplier", path="SupplyDelivery.supplier", description="Dispenser", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Organization.class, Practitioner.class, PractitionerRole.class } )
1313  public static final String SP_SUPPLIER = "supplier";
1314 /**
1315   * <b>Fluent Client</b> search parameter constant for <b>supplier</b>
1316   * <p>
1317   * Description: <b>Dispenser</b><br>
1318   * Type: <b>reference</b><br>
1319   * Path: <b>SupplyDelivery.supplier</b><br>
1320   * </p>
1321   */
1322  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPLIER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPLIER);
1323
1324/**
1325   * Constant for fluent queries to be used to add include statements. Specifies
1326   * the path value of "<b>SupplyDelivery:supplier</b>".
1327   */
1328  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPLIER = new ca.uhn.fhir.model.api.Include("SupplyDelivery:supplier").toLocked();
1329
1330 /**
1331   * Search parameter: <b>identifier</b>
1332   * <p>
1333   * Description: <b>Multiple Resources: 
1334
1335* [AllergyIntolerance](allergyintolerance.html): External ids for this item
1336* [CarePlan](careplan.html): External Ids for this plan
1337* [CareTeam](careteam.html): External Ids for this team
1338* [Composition](composition.html): Version-independent identifier for the Composition
1339* [Condition](condition.html): A unique identifier of the condition record
1340* [Consent](consent.html): Identifier for this record (external references)
1341* [DetectedIssue](detectedissue.html): Unique id for the detected issue
1342* [DeviceRequest](devicerequest.html): Business identifier for request/order
1343* [DiagnosticReport](diagnosticreport.html): An identifier for the report
1344* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
1345* [DocumentReference](documentreference.html): Identifier of the attachment binary
1346* [Encounter](encounter.html): Identifier(s) by which this encounter is known
1347* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
1348* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
1349* [Goal](goal.html): External Ids for this goal
1350* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
1351* [Immunization](immunization.html): Business identifier
1352* [List](list.html): Business identifier
1353* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
1354* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
1355* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
1356* [MedicationUsage](medicationusage.html): Return statements with this external identifier
1357* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
1358* [Observation](observation.html): The unique id for a particular observation
1359* [Procedure](procedure.html): A unique identifier for a procedure
1360* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
1361* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
1362* [SupplyDelivery](supplydelivery.html): External identifier
1363* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
1364* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
1365</b><br>
1366   * Type: <b>token</b><br>
1367   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
1368   * </p>
1369   */
1370  @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [List](list.html): Business identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationUsage](medicationusage.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
1371  public static final String SP_IDENTIFIER = "identifier";
1372 /**
1373   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1374   * <p>
1375   * Description: <b>Multiple Resources: 
1376
1377* [AllergyIntolerance](allergyintolerance.html): External ids for this item
1378* [CarePlan](careplan.html): External Ids for this plan
1379* [CareTeam](careteam.html): External Ids for this team
1380* [Composition](composition.html): Version-independent identifier for the Composition
1381* [Condition](condition.html): A unique identifier of the condition record
1382* [Consent](consent.html): Identifier for this record (external references)
1383* [DetectedIssue](detectedissue.html): Unique id for the detected issue
1384* [DeviceRequest](devicerequest.html): Business identifier for request/order
1385* [DiagnosticReport](diagnosticreport.html): An identifier for the report
1386* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
1387* [DocumentReference](documentreference.html): Identifier of the attachment binary
1388* [Encounter](encounter.html): Identifier(s) by which this encounter is known
1389* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
1390* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
1391* [Goal](goal.html): External Ids for this goal
1392* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
1393* [Immunization](immunization.html): Business identifier
1394* [List](list.html): Business identifier
1395* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
1396* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
1397* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
1398* [MedicationUsage](medicationusage.html): Return statements with this external identifier
1399* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
1400* [Observation](observation.html): The unique id for a particular observation
1401* [Procedure](procedure.html): A unique identifier for a procedure
1402* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
1403* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
1404* [SupplyDelivery](supplydelivery.html): External identifier
1405* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
1406* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
1407</b><br>
1408   * Type: <b>token</b><br>
1409   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
1410   * </p>
1411   */
1412  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1413
1414 /**
1415   * Search parameter: <b>patient</b>
1416   * <p>
1417   * Description: <b>Multiple Resources: 
1418
1419* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
1420* [CarePlan](careplan.html): Who the care plan is for
1421* [CareTeam](careteam.html): Who care team is for
1422* [ClinicalImpression](clinicalimpression.html): Patient assessed
1423* [Composition](composition.html): Who and/or what the composition is about
1424* [Condition](condition.html): Who has the condition?
1425* [Consent](consent.html): Who the consent applies to
1426* [DetectedIssue](detectedissue.html): Associated patient
1427* [DeviceRequest](devicerequest.html): Individual the service is ordered for
1428* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
1429* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
1430* [DocumentManifest](documentmanifest.html): The subject of the set of documents
1431* [DocumentReference](documentreference.html): Who/what is the subject of the document
1432* [Encounter](encounter.html): The patient present at the encounter
1433* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
1434* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
1435* [Flag](flag.html): The identity of a subject to list flags for
1436* [Goal](goal.html): Who this goal is intended for
1437* [ImagingStudy](imagingstudy.html): Who the study is about
1438* [Immunization](immunization.html): The patient for the vaccination record
1439* [List](list.html): If all resources have the same subject
1440* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
1441* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
1442* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
1443* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
1444* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
1445* [Observation](observation.html): The subject that the observation is about (if patient)
1446* [Procedure](procedure.html): Search by subject - a patient
1447* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
1448* [ServiceRequest](servicerequest.html): Search by subject - a patient
1449* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
1450* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
1451</b><br>
1452   * Type: <b>reference</b><br>
1453   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
1454   * </p>
1455   */
1456  @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentManifest](documentmanifest.html): The subject of the set of documents\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [List](list.html): If all resources have the same subject\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [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 } )
1457  public static final String SP_PATIENT = "patient";
1458 /**
1459   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1460   * <p>
1461   * Description: <b>Multiple Resources: 
1462
1463* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
1464* [CarePlan](careplan.html): Who the care plan is for
1465* [CareTeam](careteam.html): Who care team is for
1466* [ClinicalImpression](clinicalimpression.html): Patient assessed
1467* [Composition](composition.html): Who and/or what the composition is about
1468* [Condition](condition.html): Who has the condition?
1469* [Consent](consent.html): Who the consent applies to
1470* [DetectedIssue](detectedissue.html): Associated patient
1471* [DeviceRequest](devicerequest.html): Individual the service is ordered for
1472* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
1473* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
1474* [DocumentManifest](documentmanifest.html): The subject of the set of documents
1475* [DocumentReference](documentreference.html): Who/what is the subject of the document
1476* [Encounter](encounter.html): The patient present at the encounter
1477* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
1478* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
1479* [Flag](flag.html): The identity of a subject to list flags for
1480* [Goal](goal.html): Who this goal is intended for
1481* [ImagingStudy](imagingstudy.html): Who the study is about
1482* [Immunization](immunization.html): The patient for the vaccination record
1483* [List](list.html): If all resources have the same subject
1484* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
1485* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
1486* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
1487* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
1488* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
1489* [Observation](observation.html): The subject that the observation is about (if patient)
1490* [Procedure](procedure.html): Search by subject - a patient
1491* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
1492* [ServiceRequest](servicerequest.html): Search by subject - a patient
1493* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
1494* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
1495</b><br>
1496   * Type: <b>reference</b><br>
1497   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
1498   * </p>
1499   */
1500  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1501
1502/**
1503   * Constant for fluent queries to be used to add include statements. Specifies
1504   * the path value of "<b>SupplyDelivery:patient</b>".
1505   */
1506  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("SupplyDelivery:patient").toLocked();
1507
1508
1509}
1510