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 * A record of a non-patient specific request for a medication, substance, device, certain types of biologically derived product, and nutrition product used in the healthcare setting.
052 */
053@ResourceDef(name="SupplyRequest", profile="http://hl7.org/fhir/StructureDefinition/SupplyRequest")
054public class SupplyRequest extends DomainResource {
055
056    public enum SupplyRequestStatus {
057        /**
058         * The request has been created but is not yet complete or ready for action.
059         */
060        DRAFT, 
061        /**
062         * The request is ready to be acted upon.
063         */
064        ACTIVE, 
065        /**
066         * The authorization/request to act has been temporarily withdrawn but is expected to resume in the future.
067         */
068        SUSPENDED, 
069        /**
070         * The authorization/request to act has been terminated prior to the full completion of the intended actions.  No further activity should occur.
071         */
072        CANCELLED, 
073        /**
074         * Activity against the request has been sufficiently completed to the satisfaction of the requester.
075         */
076        COMPLETED, 
077        /**
078         * 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 \"cancelled\" rather than \"entered-in-error\".).
079         */
080        ENTEREDINERROR, 
081        /**
082         * The authoring/source system does not know which of the status values currently applies for this observation. Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, but the authoring/source system does not know which.
083         */
084        UNKNOWN, 
085        /**
086         * added to help the parsers with the generic types
087         */
088        NULL;
089        public static SupplyRequestStatus fromCode(String codeString) throws FHIRException {
090            if (codeString == null || "".equals(codeString))
091                return null;
092        if ("draft".equals(codeString))
093          return DRAFT;
094        if ("active".equals(codeString))
095          return ACTIVE;
096        if ("suspended".equals(codeString))
097          return SUSPENDED;
098        if ("cancelled".equals(codeString))
099          return CANCELLED;
100        if ("completed".equals(codeString))
101          return COMPLETED;
102        if ("entered-in-error".equals(codeString))
103          return ENTEREDINERROR;
104        if ("unknown".equals(codeString))
105          return UNKNOWN;
106        if (Configuration.isAcceptInvalidEnums())
107          return null;
108        else
109          throw new FHIRException("Unknown SupplyRequestStatus code '"+codeString+"'");
110        }
111        public String toCode() {
112          switch (this) {
113            case DRAFT: return "draft";
114            case ACTIVE: return "active";
115            case SUSPENDED: return "suspended";
116            case CANCELLED: return "cancelled";
117            case COMPLETED: return "completed";
118            case ENTEREDINERROR: return "entered-in-error";
119            case UNKNOWN: return "unknown";
120            case NULL: return null;
121            default: return "?";
122          }
123        }
124        public String getSystem() {
125          switch (this) {
126            case DRAFT: return "http://hl7.org/fhir/supplyrequest-status";
127            case ACTIVE: return "http://hl7.org/fhir/supplyrequest-status";
128            case SUSPENDED: return "http://hl7.org/fhir/supplyrequest-status";
129            case CANCELLED: return "http://hl7.org/fhir/supplyrequest-status";
130            case COMPLETED: return "http://hl7.org/fhir/supplyrequest-status";
131            case ENTEREDINERROR: return "http://hl7.org/fhir/supplyrequest-status";
132            case UNKNOWN: return "http://hl7.org/fhir/supplyrequest-status";
133            case NULL: return null;
134            default: return "?";
135          }
136        }
137        public String getDefinition() {
138          switch (this) {
139            case DRAFT: return "The request has been created but is not yet complete or ready for action.";
140            case ACTIVE: return "The request is ready to be acted upon.";
141            case SUSPENDED: return "The authorization/request to act has been temporarily withdrawn but is expected to resume in the future.";
142            case CANCELLED: return "The authorization/request to act has been terminated prior to the full completion of the intended actions.  No further activity should occur.";
143            case COMPLETED: return "Activity against the request has been sufficiently completed to the satisfaction of the requester.";
144            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 \"cancelled\" rather than \"entered-in-error\".).";
145            case UNKNOWN: return "The authoring/source system does not know which of the status values currently applies for this observation. Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, but the authoring/source system does not know which.";
146            case NULL: return null;
147            default: return "?";
148          }
149        }
150        public String getDisplay() {
151          switch (this) {
152            case DRAFT: return "Draft";
153            case ACTIVE: return "Active";
154            case SUSPENDED: return "Suspended";
155            case CANCELLED: return "Cancelled";
156            case COMPLETED: return "Completed";
157            case ENTEREDINERROR: return "Entered in Error";
158            case UNKNOWN: return "Unknown";
159            case NULL: return null;
160            default: return "?";
161          }
162        }
163    }
164
165  public static class SupplyRequestStatusEnumFactory implements EnumFactory<SupplyRequestStatus> {
166    public SupplyRequestStatus fromCode(String codeString) throws IllegalArgumentException {
167      if (codeString == null || "".equals(codeString))
168            if (codeString == null || "".equals(codeString))
169                return null;
170        if ("draft".equals(codeString))
171          return SupplyRequestStatus.DRAFT;
172        if ("active".equals(codeString))
173          return SupplyRequestStatus.ACTIVE;
174        if ("suspended".equals(codeString))
175          return SupplyRequestStatus.SUSPENDED;
176        if ("cancelled".equals(codeString))
177          return SupplyRequestStatus.CANCELLED;
178        if ("completed".equals(codeString))
179          return SupplyRequestStatus.COMPLETED;
180        if ("entered-in-error".equals(codeString))
181          return SupplyRequestStatus.ENTEREDINERROR;
182        if ("unknown".equals(codeString))
183          return SupplyRequestStatus.UNKNOWN;
184        throw new IllegalArgumentException("Unknown SupplyRequestStatus code '"+codeString+"'");
185        }
186        public Enumeration<SupplyRequestStatus> fromType(Base code) throws FHIRException {
187          if (code == null)
188            return null;
189          if (code.isEmpty())
190            return new Enumeration<SupplyRequestStatus>(this);
191          String codeString = ((PrimitiveType) code).asStringValue();
192          if (codeString == null || "".equals(codeString))
193            return null;
194        if ("draft".equals(codeString))
195          return new Enumeration<SupplyRequestStatus>(this, SupplyRequestStatus.DRAFT);
196        if ("active".equals(codeString))
197          return new Enumeration<SupplyRequestStatus>(this, SupplyRequestStatus.ACTIVE);
198        if ("suspended".equals(codeString))
199          return new Enumeration<SupplyRequestStatus>(this, SupplyRequestStatus.SUSPENDED);
200        if ("cancelled".equals(codeString))
201          return new Enumeration<SupplyRequestStatus>(this, SupplyRequestStatus.CANCELLED);
202        if ("completed".equals(codeString))
203          return new Enumeration<SupplyRequestStatus>(this, SupplyRequestStatus.COMPLETED);
204        if ("entered-in-error".equals(codeString))
205          return new Enumeration<SupplyRequestStatus>(this, SupplyRequestStatus.ENTEREDINERROR);
206        if ("unknown".equals(codeString))
207          return new Enumeration<SupplyRequestStatus>(this, SupplyRequestStatus.UNKNOWN);
208        throw new FHIRException("Unknown SupplyRequestStatus code '"+codeString+"'");
209        }
210    public String toCode(SupplyRequestStatus code) {
211      if (code == SupplyRequestStatus.DRAFT)
212        return "draft";
213      if (code == SupplyRequestStatus.ACTIVE)
214        return "active";
215      if (code == SupplyRequestStatus.SUSPENDED)
216        return "suspended";
217      if (code == SupplyRequestStatus.CANCELLED)
218        return "cancelled";
219      if (code == SupplyRequestStatus.COMPLETED)
220        return "completed";
221      if (code == SupplyRequestStatus.ENTEREDINERROR)
222        return "entered-in-error";
223      if (code == SupplyRequestStatus.UNKNOWN)
224        return "unknown";
225      return "?";
226      }
227    public String toSystem(SupplyRequestStatus code) {
228      return code.getSystem();
229      }
230    }
231
232    @Block()
233    public static class SupplyRequestParameterComponent extends BackboneElement implements IBaseBackboneElement {
234        /**
235         * A code or string that identifies the device detail being asserted.
236         */
237        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
238        @Description(shortDefinition="Item detail", formalDefinition="A code or string that identifies the device detail being asserted." )
239        protected CodeableConcept code;
240
241        /**
242         * The value of the device detail.
243         */
244        @Child(name = "value", type = {CodeableConcept.class, Quantity.class, Range.class, BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
245        @Description(shortDefinition="Value of detail", formalDefinition="The value of the device detail." )
246        protected DataType value;
247
248        private static final long serialVersionUID = -1950789033L;
249
250    /**
251     * Constructor
252     */
253      public SupplyRequestParameterComponent() {
254        super();
255      }
256
257        /**
258         * @return {@link #code} (A code or string that identifies the device detail being asserted.)
259         */
260        public CodeableConcept getCode() { 
261          if (this.code == null)
262            if (Configuration.errorOnAutoCreate())
263              throw new Error("Attempt to auto-create SupplyRequestParameterComponent.code");
264            else if (Configuration.doAutoCreate())
265              this.code = new CodeableConcept(); // cc
266          return this.code;
267        }
268
269        public boolean hasCode() { 
270          return this.code != null && !this.code.isEmpty();
271        }
272
273        /**
274         * @param value {@link #code} (A code or string that identifies the device detail being asserted.)
275         */
276        public SupplyRequestParameterComponent setCode(CodeableConcept value) { 
277          this.code = value;
278          return this;
279        }
280
281        /**
282         * @return {@link #value} (The value of the device detail.)
283         */
284        public DataType getValue() { 
285          return this.value;
286        }
287
288        /**
289         * @return {@link #value} (The value of the device detail.)
290         */
291        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
292          if (this.value == null)
293            this.value = new CodeableConcept();
294          if (!(this.value instanceof CodeableConcept))
295            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
296          return (CodeableConcept) this.value;
297        }
298
299        public boolean hasValueCodeableConcept() { 
300          return this != null && this.value instanceof CodeableConcept;
301        }
302
303        /**
304         * @return {@link #value} (The value of the device detail.)
305         */
306        public Quantity getValueQuantity() throws FHIRException { 
307          if (this.value == null)
308            this.value = new Quantity();
309          if (!(this.value instanceof Quantity))
310            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
311          return (Quantity) this.value;
312        }
313
314        public boolean hasValueQuantity() { 
315          return this != null && this.value instanceof Quantity;
316        }
317
318        /**
319         * @return {@link #value} (The value of the device detail.)
320         */
321        public Range getValueRange() throws FHIRException { 
322          if (this.value == null)
323            this.value = new Range();
324          if (!(this.value instanceof Range))
325            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
326          return (Range) this.value;
327        }
328
329        public boolean hasValueRange() { 
330          return this != null && this.value instanceof Range;
331        }
332
333        /**
334         * @return {@link #value} (The value of the device detail.)
335         */
336        public BooleanType getValueBooleanType() throws FHIRException { 
337          if (this.value == null)
338            this.value = new BooleanType();
339          if (!(this.value instanceof BooleanType))
340            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
341          return (BooleanType) this.value;
342        }
343
344        public boolean hasValueBooleanType() { 
345          return this != null && this.value instanceof BooleanType;
346        }
347
348        public boolean hasValue() { 
349          return this.value != null && !this.value.isEmpty();
350        }
351
352        /**
353         * @param value {@link #value} (The value of the device detail.)
354         */
355        public SupplyRequestParameterComponent setValue(DataType value) { 
356          if (value != null && !(value instanceof CodeableConcept || value instanceof Quantity || value instanceof Range || value instanceof BooleanType))
357            throw new Error("Not the right type for SupplyRequest.parameter.value[x]: "+value.fhirType());
358          this.value = value;
359          return this;
360        }
361
362        protected void listChildren(List<Property> children) {
363          super.listChildren(children);
364          children.add(new Property("code", "CodeableConcept", "A code or string that identifies the device detail being asserted.", 0, 1, code));
365          children.add(new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value));
366        }
367
368        @Override
369        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
370          switch (_hash) {
371          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A code or string that identifies the device detail being asserted.", 0, 1, code);
372          case -1410166417: /*value[x]*/  return new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value);
373          case 111972721: /*value*/  return new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value);
374          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "The value of the device detail.", 0, 1, value);
375          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "The value of the device detail.", 0, 1, value);
376          case 2030761548: /*valueRange*/  return new Property("value[x]", "Range", "The value of the device detail.", 0, 1, value);
377          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "The value of the device detail.", 0, 1, value);
378          default: return super.getNamedProperty(_hash, _name, _checkValid);
379          }
380
381        }
382
383      @Override
384      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
385        switch (hash) {
386        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
387        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
388        default: return super.getProperty(hash, name, checkValid);
389        }
390
391      }
392
393      @Override
394      public Base setProperty(int hash, String name, Base value) throws FHIRException {
395        switch (hash) {
396        case 3059181: // code
397          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
398          return value;
399        case 111972721: // value
400          this.value = TypeConvertor.castToType(value); // DataType
401          return value;
402        default: return super.setProperty(hash, name, value);
403        }
404
405      }
406
407      @Override
408      public Base setProperty(String name, Base value) throws FHIRException {
409        if (name.equals("code")) {
410          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
411        } else if (name.equals("value[x]")) {
412          this.value = TypeConvertor.castToType(value); // DataType
413        } else
414          return super.setProperty(name, value);
415        return value;
416      }
417
418      @Override
419      public Base makeProperty(int hash, String name) throws FHIRException {
420        switch (hash) {
421        case 3059181:  return getCode();
422        case -1410166417:  return getValue();
423        case 111972721:  return getValue();
424        default: return super.makeProperty(hash, name);
425        }
426
427      }
428
429      @Override
430      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
431        switch (hash) {
432        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
433        case 111972721: /*value*/ return new String[] {"CodeableConcept", "Quantity", "Range", "boolean"};
434        default: return super.getTypesForProperty(hash, name);
435        }
436
437      }
438
439      @Override
440      public Base addChild(String name) throws FHIRException {
441        if (name.equals("code")) {
442          this.code = new CodeableConcept();
443          return this.code;
444        }
445        else if (name.equals("valueCodeableConcept")) {
446          this.value = new CodeableConcept();
447          return this.value;
448        }
449        else if (name.equals("valueQuantity")) {
450          this.value = new Quantity();
451          return this.value;
452        }
453        else if (name.equals("valueRange")) {
454          this.value = new Range();
455          return this.value;
456        }
457        else if (name.equals("valueBoolean")) {
458          this.value = new BooleanType();
459          return this.value;
460        }
461        else
462          return super.addChild(name);
463      }
464
465      public SupplyRequestParameterComponent copy() {
466        SupplyRequestParameterComponent dst = new SupplyRequestParameterComponent();
467        copyValues(dst);
468        return dst;
469      }
470
471      public void copyValues(SupplyRequestParameterComponent dst) {
472        super.copyValues(dst);
473        dst.code = code == null ? null : code.copy();
474        dst.value = value == null ? null : value.copy();
475      }
476
477      @Override
478      public boolean equalsDeep(Base other_) {
479        if (!super.equalsDeep(other_))
480          return false;
481        if (!(other_ instanceof SupplyRequestParameterComponent))
482          return false;
483        SupplyRequestParameterComponent o = (SupplyRequestParameterComponent) other_;
484        return compareDeep(code, o.code, true) && compareDeep(value, o.value, true);
485      }
486
487      @Override
488      public boolean equalsShallow(Base other_) {
489        if (!super.equalsShallow(other_))
490          return false;
491        if (!(other_ instanceof SupplyRequestParameterComponent))
492          return false;
493        SupplyRequestParameterComponent o = (SupplyRequestParameterComponent) other_;
494        return true;
495      }
496
497      public boolean isEmpty() {
498        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, value);
499      }
500
501  public String fhirType() {
502    return "SupplyRequest.parameter";
503
504  }
505
506  }
507
508    /**
509     * Business identifiers assigned to this SupplyRequest by the author and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server.
510     */
511    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
512    @Description(shortDefinition="Business Identifier for SupplyRequest", formalDefinition="Business identifiers assigned to this SupplyRequest by the author and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server." )
513    protected List<Identifier> identifier;
514
515    /**
516     * Status of the supply request.
517     */
518    @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true)
519    @Description(shortDefinition="draft | active | suspended +", formalDefinition="Status of the supply request." )
520    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/supplyrequest-status")
521    protected Enumeration<SupplyRequestStatus> status;
522
523    /**
524     * Plan/proposal/order fulfilled by this request.
525     */
526    @Child(name = "basedOn", type = {Reference.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
527    @Description(shortDefinition="What other request is fulfilled by this supply request", formalDefinition="Plan/proposal/order fulfilled by this request." )
528    protected List<Reference> basedOn;
529
530    /**
531     * Category of supply, e.g.  central, non-stock, etc. This is used to support work flows associated with the supply process.
532     */
533    @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
534    @Description(shortDefinition="The kind of supply (central, non-stock, etc.)", formalDefinition="Category of supply, e.g.  central, non-stock, etc. This is used to support work flows associated with the supply process." )
535    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/supplyrequest-kind")
536    protected CodeableConcept category;
537
538    /**
539     * Indicates how quickly this SupplyRequest should be addressed with respect to other requests.
540     */
541    @Child(name = "priority", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true)
542    @Description(shortDefinition="routine | urgent | asap | stat", formalDefinition="Indicates how quickly this SupplyRequest should be addressed with respect to other requests." )
543    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority")
544    protected Enumeration<RequestPriority> priority;
545
546    /**
547     * The item that is requested to be supplied. 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.
548     */
549    @Child(name = "item", type = {CodeableReference.class}, order=5, min=1, max=1, modifier=false, summary=true)
550    @Description(shortDefinition="Medication, Substance, or Device requested to be supplied", formalDefinition="The item that is requested to be supplied. 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." )
551    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/supply-item")
552    protected CodeableReference item;
553
554    /**
555     * The amount that is being ordered of the indicated item.
556     */
557    @Child(name = "quantity", type = {Quantity.class}, order=6, min=1, max=1, modifier=false, summary=true)
558    @Description(shortDefinition="The requested amount of the item indicated", formalDefinition="The amount that is being ordered of the indicated item." )
559    protected Quantity quantity;
560
561    /**
562     * Specific parameters for the ordered item.  For example, the size of the indicated item.
563     */
564    @Child(name = "parameter", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
565    @Description(shortDefinition="Ordered item details", formalDefinition="Specific parameters for the ordered item.  For example, the size of the indicated item." )
566    protected List<SupplyRequestParameterComponent> parameter;
567
568    /**
569     * When the request should be fulfilled.
570     */
571    @Child(name = "occurrence", type = {DateTimeType.class, Period.class, Timing.class}, order=8, min=0, max=1, modifier=false, summary=true)
572    @Description(shortDefinition="When the request should be fulfilled", formalDefinition="When the request should be fulfilled." )
573    protected DataType occurrence;
574
575    /**
576     * When the request was made.
577     */
578    @Child(name = "authoredOn", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=true)
579    @Description(shortDefinition="When the request was made", formalDefinition="When the request was made." )
580    protected DateTimeType authoredOn;
581
582    /**
583     * The device, practitioner, etc. who initiated the request.
584     */
585    @Child(name = "requester", type = {Practitioner.class, PractitionerRole.class, Organization.class, Patient.class, RelatedPerson.class, Device.class, CareTeam.class}, order=10, min=0, max=1, modifier=false, summary=true)
586    @Description(shortDefinition="Individual making the request", formalDefinition="The device, practitioner, etc. who initiated the request." )
587    protected Reference requester;
588
589    /**
590     * Who is intended to fulfill the request.
591     */
592    @Child(name = "supplier", type = {Organization.class, HealthcareService.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
593    @Description(shortDefinition="Who is intended to fulfill the request", formalDefinition="Who is intended to fulfill the request." )
594    protected List<Reference> supplier;
595
596    /**
597     * The reason why the supply item was requested.
598     */
599    @Child(name = "reason", type = {CodeableReference.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
600    @Description(shortDefinition="The reason why the supply item was requested", formalDefinition="The reason why the supply item was requested." )
601    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/supplyrequest-reason")
602    protected List<CodeableReference> reason;
603
604    /**
605     * Where the supply is expected to come from.
606     */
607    @Child(name = "deliverFrom", type = {Organization.class, Location.class}, order=13, min=0, max=1, modifier=false, summary=false)
608    @Description(shortDefinition="The origin of the supply", formalDefinition="Where the supply is expected to come from." )
609    protected Reference deliverFrom;
610
611    /**
612     * Where the supply is destined to go.
613     */
614    @Child(name = "deliverTo", type = {Organization.class, Location.class, Patient.class}, order=14, min=0, max=1, modifier=false, summary=false)
615    @Description(shortDefinition="The destination of the supply", formalDefinition="Where the supply is destined to go." )
616    protected Reference deliverTo;
617
618    private static final long serialVersionUID = 1124508055L;
619
620  /**
621   * Constructor
622   */
623    public SupplyRequest() {
624      super();
625    }
626
627  /**
628   * Constructor
629   */
630    public SupplyRequest(CodeableReference item, Quantity quantity) {
631      super();
632      this.setItem(item);
633      this.setQuantity(quantity);
634    }
635
636    /**
637     * @return {@link #identifier} (Business identifiers assigned to this SupplyRequest by the author and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server.)
638     */
639    public List<Identifier> getIdentifier() { 
640      if (this.identifier == null)
641        this.identifier = new ArrayList<Identifier>();
642      return this.identifier;
643    }
644
645    /**
646     * @return Returns a reference to <code>this</code> for easy method chaining
647     */
648    public SupplyRequest setIdentifier(List<Identifier> theIdentifier) { 
649      this.identifier = theIdentifier;
650      return this;
651    }
652
653    public boolean hasIdentifier() { 
654      if (this.identifier == null)
655        return false;
656      for (Identifier item : this.identifier)
657        if (!item.isEmpty())
658          return true;
659      return false;
660    }
661
662    public Identifier addIdentifier() { //3
663      Identifier t = new Identifier();
664      if (this.identifier == null)
665        this.identifier = new ArrayList<Identifier>();
666      this.identifier.add(t);
667      return t;
668    }
669
670    public SupplyRequest addIdentifier(Identifier t) { //3
671      if (t == null)
672        return this;
673      if (this.identifier == null)
674        this.identifier = new ArrayList<Identifier>();
675      this.identifier.add(t);
676      return this;
677    }
678
679    /**
680     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
681     */
682    public Identifier getIdentifierFirstRep() { 
683      if (getIdentifier().isEmpty()) {
684        addIdentifier();
685      }
686      return getIdentifier().get(0);
687    }
688
689    /**
690     * @return {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
691     */
692    public Enumeration<SupplyRequestStatus> getStatusElement() { 
693      if (this.status == null)
694        if (Configuration.errorOnAutoCreate())
695          throw new Error("Attempt to auto-create SupplyRequest.status");
696        else if (Configuration.doAutoCreate())
697          this.status = new Enumeration<SupplyRequestStatus>(new SupplyRequestStatusEnumFactory()); // bb
698      return this.status;
699    }
700
701    public boolean hasStatusElement() { 
702      return this.status != null && !this.status.isEmpty();
703    }
704
705    public boolean hasStatus() { 
706      return this.status != null && !this.status.isEmpty();
707    }
708
709    /**
710     * @param value {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
711     */
712    public SupplyRequest setStatusElement(Enumeration<SupplyRequestStatus> value) { 
713      this.status = value;
714      return this;
715    }
716
717    /**
718     * @return Status of the supply request.
719     */
720    public SupplyRequestStatus getStatus() { 
721      return this.status == null ? null : this.status.getValue();
722    }
723
724    /**
725     * @param value Status of the supply request.
726     */
727    public SupplyRequest setStatus(SupplyRequestStatus value) { 
728      if (value == null)
729        this.status = null;
730      else {
731        if (this.status == null)
732          this.status = new Enumeration<SupplyRequestStatus>(new SupplyRequestStatusEnumFactory());
733        this.status.setValue(value);
734      }
735      return this;
736    }
737
738    /**
739     * @return {@link #basedOn} (Plan/proposal/order fulfilled by this request.)
740     */
741    public List<Reference> getBasedOn() { 
742      if (this.basedOn == null)
743        this.basedOn = new ArrayList<Reference>();
744      return this.basedOn;
745    }
746
747    /**
748     * @return Returns a reference to <code>this</code> for easy method chaining
749     */
750    public SupplyRequest setBasedOn(List<Reference> theBasedOn) { 
751      this.basedOn = theBasedOn;
752      return this;
753    }
754
755    public boolean hasBasedOn() { 
756      if (this.basedOn == null)
757        return false;
758      for (Reference item : this.basedOn)
759        if (!item.isEmpty())
760          return true;
761      return false;
762    }
763
764    public Reference addBasedOn() { //3
765      Reference t = new Reference();
766      if (this.basedOn == null)
767        this.basedOn = new ArrayList<Reference>();
768      this.basedOn.add(t);
769      return t;
770    }
771
772    public SupplyRequest addBasedOn(Reference t) { //3
773      if (t == null)
774        return this;
775      if (this.basedOn == null)
776        this.basedOn = new ArrayList<Reference>();
777      this.basedOn.add(t);
778      return this;
779    }
780
781    /**
782     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
783     */
784    public Reference getBasedOnFirstRep() { 
785      if (getBasedOn().isEmpty()) {
786        addBasedOn();
787      }
788      return getBasedOn().get(0);
789    }
790
791    /**
792     * @return {@link #category} (Category of supply, e.g.  central, non-stock, etc. This is used to support work flows associated with the supply process.)
793     */
794    public CodeableConcept getCategory() { 
795      if (this.category == null)
796        if (Configuration.errorOnAutoCreate())
797          throw new Error("Attempt to auto-create SupplyRequest.category");
798        else if (Configuration.doAutoCreate())
799          this.category = new CodeableConcept(); // cc
800      return this.category;
801    }
802
803    public boolean hasCategory() { 
804      return this.category != null && !this.category.isEmpty();
805    }
806
807    /**
808     * @param value {@link #category} (Category of supply, e.g.  central, non-stock, etc. This is used to support work flows associated with the supply process.)
809     */
810    public SupplyRequest setCategory(CodeableConcept value) { 
811      this.category = value;
812      return this;
813    }
814
815    /**
816     * @return {@link #priority} (Indicates how quickly this SupplyRequest should be addressed with respect to other requests.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
817     */
818    public Enumeration<RequestPriority> getPriorityElement() { 
819      if (this.priority == null)
820        if (Configuration.errorOnAutoCreate())
821          throw new Error("Attempt to auto-create SupplyRequest.priority");
822        else if (Configuration.doAutoCreate())
823          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory()); // bb
824      return this.priority;
825    }
826
827    public boolean hasPriorityElement() { 
828      return this.priority != null && !this.priority.isEmpty();
829    }
830
831    public boolean hasPriority() { 
832      return this.priority != null && !this.priority.isEmpty();
833    }
834
835    /**
836     * @param value {@link #priority} (Indicates how quickly this SupplyRequest should be addressed with respect to other requests.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
837     */
838    public SupplyRequest setPriorityElement(Enumeration<RequestPriority> value) { 
839      this.priority = value;
840      return this;
841    }
842
843    /**
844     * @return Indicates how quickly this SupplyRequest should be addressed with respect to other requests.
845     */
846    public RequestPriority getPriority() { 
847      return this.priority == null ? null : this.priority.getValue();
848    }
849
850    /**
851     * @param value Indicates how quickly this SupplyRequest should be addressed with respect to other requests.
852     */
853    public SupplyRequest setPriority(RequestPriority value) { 
854      if (value == null)
855        this.priority = null;
856      else {
857        if (this.priority == null)
858          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory());
859        this.priority.setValue(value);
860      }
861      return this;
862    }
863
864    /**
865     * @return {@link #item} (The item that is requested to be supplied. 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.)
866     */
867    public CodeableReference getItem() { 
868      if (this.item == null)
869        if (Configuration.errorOnAutoCreate())
870          throw new Error("Attempt to auto-create SupplyRequest.item");
871        else if (Configuration.doAutoCreate())
872          this.item = new CodeableReference(); // cc
873      return this.item;
874    }
875
876    public boolean hasItem() { 
877      return this.item != null && !this.item.isEmpty();
878    }
879
880    /**
881     * @param value {@link #item} (The item that is requested to be supplied. 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.)
882     */
883    public SupplyRequest setItem(CodeableReference value) { 
884      this.item = value;
885      return this;
886    }
887
888    /**
889     * @return {@link #quantity} (The amount that is being ordered of the indicated item.)
890     */
891    public Quantity getQuantity() { 
892      if (this.quantity == null)
893        if (Configuration.errorOnAutoCreate())
894          throw new Error("Attempt to auto-create SupplyRequest.quantity");
895        else if (Configuration.doAutoCreate())
896          this.quantity = new Quantity(); // cc
897      return this.quantity;
898    }
899
900    public boolean hasQuantity() { 
901      return this.quantity != null && !this.quantity.isEmpty();
902    }
903
904    /**
905     * @param value {@link #quantity} (The amount that is being ordered of the indicated item.)
906     */
907    public SupplyRequest setQuantity(Quantity value) { 
908      this.quantity = value;
909      return this;
910    }
911
912    /**
913     * @return {@link #parameter} (Specific parameters for the ordered item.  For example, the size of the indicated item.)
914     */
915    public List<SupplyRequestParameterComponent> getParameter() { 
916      if (this.parameter == null)
917        this.parameter = new ArrayList<SupplyRequestParameterComponent>();
918      return this.parameter;
919    }
920
921    /**
922     * @return Returns a reference to <code>this</code> for easy method chaining
923     */
924    public SupplyRequest setParameter(List<SupplyRequestParameterComponent> theParameter) { 
925      this.parameter = theParameter;
926      return this;
927    }
928
929    public boolean hasParameter() { 
930      if (this.parameter == null)
931        return false;
932      for (SupplyRequestParameterComponent item : this.parameter)
933        if (!item.isEmpty())
934          return true;
935      return false;
936    }
937
938    public SupplyRequestParameterComponent addParameter() { //3
939      SupplyRequestParameterComponent t = new SupplyRequestParameterComponent();
940      if (this.parameter == null)
941        this.parameter = new ArrayList<SupplyRequestParameterComponent>();
942      this.parameter.add(t);
943      return t;
944    }
945
946    public SupplyRequest addParameter(SupplyRequestParameterComponent t) { //3
947      if (t == null)
948        return this;
949      if (this.parameter == null)
950        this.parameter = new ArrayList<SupplyRequestParameterComponent>();
951      this.parameter.add(t);
952      return this;
953    }
954
955    /**
956     * @return The first repetition of repeating field {@link #parameter}, creating it if it does not already exist {3}
957     */
958    public SupplyRequestParameterComponent getParameterFirstRep() { 
959      if (getParameter().isEmpty()) {
960        addParameter();
961      }
962      return getParameter().get(0);
963    }
964
965    /**
966     * @return {@link #occurrence} (When the request should be fulfilled.)
967     */
968    public DataType getOccurrence() { 
969      return this.occurrence;
970    }
971
972    /**
973     * @return {@link #occurrence} (When the request should be fulfilled.)
974     */
975    public DateTimeType getOccurrenceDateTimeType() throws FHIRException { 
976      if (this.occurrence == null)
977        this.occurrence = new DateTimeType();
978      if (!(this.occurrence instanceof DateTimeType))
979        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
980      return (DateTimeType) this.occurrence;
981    }
982
983    public boolean hasOccurrenceDateTimeType() { 
984      return this != null && this.occurrence instanceof DateTimeType;
985    }
986
987    /**
988     * @return {@link #occurrence} (When the request should be fulfilled.)
989     */
990    public Period getOccurrencePeriod() throws FHIRException { 
991      if (this.occurrence == null)
992        this.occurrence = new Period();
993      if (!(this.occurrence instanceof Period))
994        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.occurrence.getClass().getName()+" was encountered");
995      return (Period) this.occurrence;
996    }
997
998    public boolean hasOccurrencePeriod() { 
999      return this != null && this.occurrence instanceof Period;
1000    }
1001
1002    /**
1003     * @return {@link #occurrence} (When the request should be fulfilled.)
1004     */
1005    public Timing getOccurrenceTiming() throws FHIRException { 
1006      if (this.occurrence == null)
1007        this.occurrence = new Timing();
1008      if (!(this.occurrence instanceof Timing))
1009        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1010      return (Timing) this.occurrence;
1011    }
1012
1013    public boolean hasOccurrenceTiming() { 
1014      return this != null && this.occurrence instanceof Timing;
1015    }
1016
1017    public boolean hasOccurrence() { 
1018      return this.occurrence != null && !this.occurrence.isEmpty();
1019    }
1020
1021    /**
1022     * @param value {@link #occurrence} (When the request should be fulfilled.)
1023     */
1024    public SupplyRequest setOccurrence(DataType value) { 
1025      if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof Timing))
1026        throw new Error("Not the right type for SupplyRequest.occurrence[x]: "+value.fhirType());
1027      this.occurrence = value;
1028      return this;
1029    }
1030
1031    /**
1032     * @return {@link #authoredOn} (When the request was made.). This is the underlying object with id, value and extensions. The accessor "getAuthoredOn" gives direct access to the value
1033     */
1034    public DateTimeType getAuthoredOnElement() { 
1035      if (this.authoredOn == null)
1036        if (Configuration.errorOnAutoCreate())
1037          throw new Error("Attempt to auto-create SupplyRequest.authoredOn");
1038        else if (Configuration.doAutoCreate())
1039          this.authoredOn = new DateTimeType(); // bb
1040      return this.authoredOn;
1041    }
1042
1043    public boolean hasAuthoredOnElement() { 
1044      return this.authoredOn != null && !this.authoredOn.isEmpty();
1045    }
1046
1047    public boolean hasAuthoredOn() { 
1048      return this.authoredOn != null && !this.authoredOn.isEmpty();
1049    }
1050
1051    /**
1052     * @param value {@link #authoredOn} (When the request was made.). This is the underlying object with id, value and extensions. The accessor "getAuthoredOn" gives direct access to the value
1053     */
1054    public SupplyRequest setAuthoredOnElement(DateTimeType value) { 
1055      this.authoredOn = value;
1056      return this;
1057    }
1058
1059    /**
1060     * @return When the request was made.
1061     */
1062    public Date getAuthoredOn() { 
1063      return this.authoredOn == null ? null : this.authoredOn.getValue();
1064    }
1065
1066    /**
1067     * @param value When the request was made.
1068     */
1069    public SupplyRequest setAuthoredOn(Date value) { 
1070      if (value == null)
1071        this.authoredOn = null;
1072      else {
1073        if (this.authoredOn == null)
1074          this.authoredOn = new DateTimeType();
1075        this.authoredOn.setValue(value);
1076      }
1077      return this;
1078    }
1079
1080    /**
1081     * @return {@link #requester} (The device, practitioner, etc. who initiated the request.)
1082     */
1083    public Reference getRequester() { 
1084      if (this.requester == null)
1085        if (Configuration.errorOnAutoCreate())
1086          throw new Error("Attempt to auto-create SupplyRequest.requester");
1087        else if (Configuration.doAutoCreate())
1088          this.requester = new Reference(); // cc
1089      return this.requester;
1090    }
1091
1092    public boolean hasRequester() { 
1093      return this.requester != null && !this.requester.isEmpty();
1094    }
1095
1096    /**
1097     * @param value {@link #requester} (The device, practitioner, etc. who initiated the request.)
1098     */
1099    public SupplyRequest setRequester(Reference value) { 
1100      this.requester = value;
1101      return this;
1102    }
1103
1104    /**
1105     * @return {@link #supplier} (Who is intended to fulfill the request.)
1106     */
1107    public List<Reference> getSupplier() { 
1108      if (this.supplier == null)
1109        this.supplier = new ArrayList<Reference>();
1110      return this.supplier;
1111    }
1112
1113    /**
1114     * @return Returns a reference to <code>this</code> for easy method chaining
1115     */
1116    public SupplyRequest setSupplier(List<Reference> theSupplier) { 
1117      this.supplier = theSupplier;
1118      return this;
1119    }
1120
1121    public boolean hasSupplier() { 
1122      if (this.supplier == null)
1123        return false;
1124      for (Reference item : this.supplier)
1125        if (!item.isEmpty())
1126          return true;
1127      return false;
1128    }
1129
1130    public Reference addSupplier() { //3
1131      Reference t = new Reference();
1132      if (this.supplier == null)
1133        this.supplier = new ArrayList<Reference>();
1134      this.supplier.add(t);
1135      return t;
1136    }
1137
1138    public SupplyRequest addSupplier(Reference t) { //3
1139      if (t == null)
1140        return this;
1141      if (this.supplier == null)
1142        this.supplier = new ArrayList<Reference>();
1143      this.supplier.add(t);
1144      return this;
1145    }
1146
1147    /**
1148     * @return The first repetition of repeating field {@link #supplier}, creating it if it does not already exist {3}
1149     */
1150    public Reference getSupplierFirstRep() { 
1151      if (getSupplier().isEmpty()) {
1152        addSupplier();
1153      }
1154      return getSupplier().get(0);
1155    }
1156
1157    /**
1158     * @return {@link #reason} (The reason why the supply item was requested.)
1159     */
1160    public List<CodeableReference> getReason() { 
1161      if (this.reason == null)
1162        this.reason = new ArrayList<CodeableReference>();
1163      return this.reason;
1164    }
1165
1166    /**
1167     * @return Returns a reference to <code>this</code> for easy method chaining
1168     */
1169    public SupplyRequest setReason(List<CodeableReference> theReason) { 
1170      this.reason = theReason;
1171      return this;
1172    }
1173
1174    public boolean hasReason() { 
1175      if (this.reason == null)
1176        return false;
1177      for (CodeableReference item : this.reason)
1178        if (!item.isEmpty())
1179          return true;
1180      return false;
1181    }
1182
1183    public CodeableReference addReason() { //3
1184      CodeableReference t = new CodeableReference();
1185      if (this.reason == null)
1186        this.reason = new ArrayList<CodeableReference>();
1187      this.reason.add(t);
1188      return t;
1189    }
1190
1191    public SupplyRequest addReason(CodeableReference t) { //3
1192      if (t == null)
1193        return this;
1194      if (this.reason == null)
1195        this.reason = new ArrayList<CodeableReference>();
1196      this.reason.add(t);
1197      return this;
1198    }
1199
1200    /**
1201     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
1202     */
1203    public CodeableReference getReasonFirstRep() { 
1204      if (getReason().isEmpty()) {
1205        addReason();
1206      }
1207      return getReason().get(0);
1208    }
1209
1210    /**
1211     * @return {@link #deliverFrom} (Where the supply is expected to come from.)
1212     */
1213    public Reference getDeliverFrom() { 
1214      if (this.deliverFrom == null)
1215        if (Configuration.errorOnAutoCreate())
1216          throw new Error("Attempt to auto-create SupplyRequest.deliverFrom");
1217        else if (Configuration.doAutoCreate())
1218          this.deliverFrom = new Reference(); // cc
1219      return this.deliverFrom;
1220    }
1221
1222    public boolean hasDeliverFrom() { 
1223      return this.deliverFrom != null && !this.deliverFrom.isEmpty();
1224    }
1225
1226    /**
1227     * @param value {@link #deliverFrom} (Where the supply is expected to come from.)
1228     */
1229    public SupplyRequest setDeliverFrom(Reference value) { 
1230      this.deliverFrom = value;
1231      return this;
1232    }
1233
1234    /**
1235     * @return {@link #deliverTo} (Where the supply is destined to go.)
1236     */
1237    public Reference getDeliverTo() { 
1238      if (this.deliverTo == null)
1239        if (Configuration.errorOnAutoCreate())
1240          throw new Error("Attempt to auto-create SupplyRequest.deliverTo");
1241        else if (Configuration.doAutoCreate())
1242          this.deliverTo = new Reference(); // cc
1243      return this.deliverTo;
1244    }
1245
1246    public boolean hasDeliverTo() { 
1247      return this.deliverTo != null && !this.deliverTo.isEmpty();
1248    }
1249
1250    /**
1251     * @param value {@link #deliverTo} (Where the supply is destined to go.)
1252     */
1253    public SupplyRequest setDeliverTo(Reference value) { 
1254      this.deliverTo = value;
1255      return this;
1256    }
1257
1258      protected void listChildren(List<Property> children) {
1259        super.listChildren(children);
1260        children.add(new Property("identifier", "Identifier", "Business identifiers assigned to this SupplyRequest by the author and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
1261        children.add(new Property("status", "code", "Status of the supply request.", 0, 1, status));
1262        children.add(new Property("basedOn", "Reference(Any)", "Plan/proposal/order fulfilled by this request.", 0, java.lang.Integer.MAX_VALUE, basedOn));
1263        children.add(new Property("category", "CodeableConcept", "Category of supply, e.g.  central, non-stock, etc. This is used to support work flows associated with the supply process.", 0, 1, category));
1264        children.add(new Property("priority", "code", "Indicates how quickly this SupplyRequest should be addressed with respect to other requests.", 0, 1, priority));
1265        children.add(new Property("item", "CodeableReference(Medication|Substance|Device|DeviceDefinition)", "The item that is requested to be supplied. 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));
1266        children.add(new Property("quantity", "Quantity", "The amount that is being ordered of the indicated item.", 0, 1, quantity));
1267        children.add(new Property("parameter", "", "Specific parameters for the ordered item.  For example, the size of the indicated item.", 0, java.lang.Integer.MAX_VALUE, parameter));
1268        children.add(new Property("occurrence[x]", "dateTime|Period|Timing", "When the request should be fulfilled.", 0, 1, occurrence));
1269        children.add(new Property("authoredOn", "dateTime", "When the request was made.", 0, 1, authoredOn));
1270        children.add(new Property("requester", "Reference(Practitioner|PractitionerRole|Organization|Patient|RelatedPerson|Device|CareTeam)", "The device, practitioner, etc. who initiated the request.", 0, 1, requester));
1271        children.add(new Property("supplier", "Reference(Organization|HealthcareService)", "Who is intended to fulfill the request.", 0, java.lang.Integer.MAX_VALUE, supplier));
1272        children.add(new Property("reason", "CodeableReference(Condition|Observation|DiagnosticReport|DocumentReference)", "The reason why the supply item was requested.", 0, java.lang.Integer.MAX_VALUE, reason));
1273        children.add(new Property("deliverFrom", "Reference(Organization|Location)", "Where the supply is expected to come from.", 0, 1, deliverFrom));
1274        children.add(new Property("deliverTo", "Reference(Organization|Location|Patient)", "Where the supply is destined to go.", 0, 1, deliverTo));
1275      }
1276
1277      @Override
1278      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1279        switch (_hash) {
1280        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifiers assigned to this SupplyRequest by the author and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier);
1281        case -892481550: /*status*/  return new Property("status", "code", "Status of the supply request.", 0, 1, status);
1282        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(Any)", "Plan/proposal/order fulfilled by this request.", 0, java.lang.Integer.MAX_VALUE, basedOn);
1283        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "Category of supply, e.g.  central, non-stock, etc. This is used to support work flows associated with the supply process.", 0, 1, category);
1284        case -1165461084: /*priority*/  return new Property("priority", "code", "Indicates how quickly this SupplyRequest should be addressed with respect to other requests.", 0, 1, priority);
1285        case 3242771: /*item*/  return new Property("item", "CodeableReference(Medication|Substance|Device|DeviceDefinition)", "The item that is requested to be supplied. 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);
1286        case -1285004149: /*quantity*/  return new Property("quantity", "Quantity", "The amount that is being ordered of the indicated item.", 0, 1, quantity);
1287        case 1954460585: /*parameter*/  return new Property("parameter", "", "Specific parameters for the ordered item.  For example, the size of the indicated item.", 0, java.lang.Integer.MAX_VALUE, parameter);
1288        case -2022646513: /*occurrence[x]*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "When the request should be fulfilled.", 0, 1, occurrence);
1289        case 1687874001: /*occurrence*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "When the request should be fulfilled.", 0, 1, occurrence);
1290        case -298443636: /*occurrenceDateTime*/  return new Property("occurrence[x]", "dateTime", "When the request should be fulfilled.", 0, 1, occurrence);
1291        case 1397156594: /*occurrencePeriod*/  return new Property("occurrence[x]", "Period", "When the request should be fulfilled.", 0, 1, occurrence);
1292        case 1515218299: /*occurrenceTiming*/  return new Property("occurrence[x]", "Timing", "When the request should be fulfilled.", 0, 1, occurrence);
1293        case -1500852503: /*authoredOn*/  return new Property("authoredOn", "dateTime", "When the request was made.", 0, 1, authoredOn);
1294        case 693933948: /*requester*/  return new Property("requester", "Reference(Practitioner|PractitionerRole|Organization|Patient|RelatedPerson|Device|CareTeam)", "The device, practitioner, etc. who initiated the request.", 0, 1, requester);
1295        case -1663305268: /*supplier*/  return new Property("supplier", "Reference(Organization|HealthcareService)", "Who is intended to fulfill the request.", 0, java.lang.Integer.MAX_VALUE, supplier);
1296        case -934964668: /*reason*/  return new Property("reason", "CodeableReference(Condition|Observation|DiagnosticReport|DocumentReference)", "The reason why the supply item was requested.", 0, java.lang.Integer.MAX_VALUE, reason);
1297        case -949323153: /*deliverFrom*/  return new Property("deliverFrom", "Reference(Organization|Location)", "Where the supply is expected to come from.", 0, 1, deliverFrom);
1298        case -242327936: /*deliverTo*/  return new Property("deliverTo", "Reference(Organization|Location|Patient)", "Where the supply is destined to go.", 0, 1, deliverTo);
1299        default: return super.getNamedProperty(_hash, _name, _checkValid);
1300        }
1301
1302      }
1303
1304      @Override
1305      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1306        switch (hash) {
1307        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1308        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<SupplyRequestStatus>
1309        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
1310        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept
1311        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration<RequestPriority>
1312        case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // CodeableReference
1313        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
1314        case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // SupplyRequestParameterComponent
1315        case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // DataType
1316        case -1500852503: /*authoredOn*/ return this.authoredOn == null ? new Base[0] : new Base[] {this.authoredOn}; // DateTimeType
1317        case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference
1318        case -1663305268: /*supplier*/ return this.supplier == null ? new Base[0] : this.supplier.toArray(new Base[this.supplier.size()]); // Reference
1319        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableReference
1320        case -949323153: /*deliverFrom*/ return this.deliverFrom == null ? new Base[0] : new Base[] {this.deliverFrom}; // Reference
1321        case -242327936: /*deliverTo*/ return this.deliverTo == null ? new Base[0] : new Base[] {this.deliverTo}; // Reference
1322        default: return super.getProperty(hash, name, checkValid);
1323        }
1324
1325      }
1326
1327      @Override
1328      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1329        switch (hash) {
1330        case -1618432855: // identifier
1331          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1332          return value;
1333        case -892481550: // status
1334          value = new SupplyRequestStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1335          this.status = (Enumeration) value; // Enumeration<SupplyRequestStatus>
1336          return value;
1337        case -332612366: // basedOn
1338          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
1339          return value;
1340        case 50511102: // category
1341          this.category = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1342          return value;
1343        case -1165461084: // priority
1344          value = new RequestPriorityEnumFactory().fromType(TypeConvertor.castToCode(value));
1345          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
1346          return value;
1347        case 3242771: // item
1348          this.item = TypeConvertor.castToCodeableReference(value); // CodeableReference
1349          return value;
1350        case -1285004149: // quantity
1351          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
1352          return value;
1353        case 1954460585: // parameter
1354          this.getParameter().add((SupplyRequestParameterComponent) value); // SupplyRequestParameterComponent
1355          return value;
1356        case 1687874001: // occurrence
1357          this.occurrence = TypeConvertor.castToType(value); // DataType
1358          return value;
1359        case -1500852503: // authoredOn
1360          this.authoredOn = TypeConvertor.castToDateTime(value); // DateTimeType
1361          return value;
1362        case 693933948: // requester
1363          this.requester = TypeConvertor.castToReference(value); // Reference
1364          return value;
1365        case -1663305268: // supplier
1366          this.getSupplier().add(TypeConvertor.castToReference(value)); // Reference
1367          return value;
1368        case -934964668: // reason
1369          this.getReason().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
1370          return value;
1371        case -949323153: // deliverFrom
1372          this.deliverFrom = TypeConvertor.castToReference(value); // Reference
1373          return value;
1374        case -242327936: // deliverTo
1375          this.deliverTo = TypeConvertor.castToReference(value); // Reference
1376          return value;
1377        default: return super.setProperty(hash, name, value);
1378        }
1379
1380      }
1381
1382      @Override
1383      public Base setProperty(String name, Base value) throws FHIRException {
1384        if (name.equals("identifier")) {
1385          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1386        } else if (name.equals("status")) {
1387          value = new SupplyRequestStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1388          this.status = (Enumeration) value; // Enumeration<SupplyRequestStatus>
1389        } else if (name.equals("basedOn")) {
1390          this.getBasedOn().add(TypeConvertor.castToReference(value));
1391        } else if (name.equals("category")) {
1392          this.category = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1393        } else if (name.equals("priority")) {
1394          value = new RequestPriorityEnumFactory().fromType(TypeConvertor.castToCode(value));
1395          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
1396        } else if (name.equals("item")) {
1397          this.item = TypeConvertor.castToCodeableReference(value); // CodeableReference
1398        } else if (name.equals("quantity")) {
1399          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
1400        } else if (name.equals("parameter")) {
1401          this.getParameter().add((SupplyRequestParameterComponent) value);
1402        } else if (name.equals("occurrence[x]")) {
1403          this.occurrence = TypeConvertor.castToType(value); // DataType
1404        } else if (name.equals("authoredOn")) {
1405          this.authoredOn = TypeConvertor.castToDateTime(value); // DateTimeType
1406        } else if (name.equals("requester")) {
1407          this.requester = TypeConvertor.castToReference(value); // Reference
1408        } else if (name.equals("supplier")) {
1409          this.getSupplier().add(TypeConvertor.castToReference(value));
1410        } else if (name.equals("reason")) {
1411          this.getReason().add(TypeConvertor.castToCodeableReference(value));
1412        } else if (name.equals("deliverFrom")) {
1413          this.deliverFrom = TypeConvertor.castToReference(value); // Reference
1414        } else if (name.equals("deliverTo")) {
1415          this.deliverTo = TypeConvertor.castToReference(value); // Reference
1416        } else
1417          return super.setProperty(name, value);
1418        return value;
1419      }
1420
1421      @Override
1422      public Base makeProperty(int hash, String name) throws FHIRException {
1423        switch (hash) {
1424        case -1618432855:  return addIdentifier(); 
1425        case -892481550:  return getStatusElement();
1426        case -332612366:  return addBasedOn(); 
1427        case 50511102:  return getCategory();
1428        case -1165461084:  return getPriorityElement();
1429        case 3242771:  return getItem();
1430        case -1285004149:  return getQuantity();
1431        case 1954460585:  return addParameter(); 
1432        case -2022646513:  return getOccurrence();
1433        case 1687874001:  return getOccurrence();
1434        case -1500852503:  return getAuthoredOnElement();
1435        case 693933948:  return getRequester();
1436        case -1663305268:  return addSupplier(); 
1437        case -934964668:  return addReason(); 
1438        case -949323153:  return getDeliverFrom();
1439        case -242327936:  return getDeliverTo();
1440        default: return super.makeProperty(hash, name);
1441        }
1442
1443      }
1444
1445      @Override
1446      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1447        switch (hash) {
1448        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1449        case -892481550: /*status*/ return new String[] {"code"};
1450        case -332612366: /*basedOn*/ return new String[] {"Reference"};
1451        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
1452        case -1165461084: /*priority*/ return new String[] {"code"};
1453        case 3242771: /*item*/ return new String[] {"CodeableReference"};
1454        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
1455        case 1954460585: /*parameter*/ return new String[] {};
1456        case 1687874001: /*occurrence*/ return new String[] {"dateTime", "Period", "Timing"};
1457        case -1500852503: /*authoredOn*/ return new String[] {"dateTime"};
1458        case 693933948: /*requester*/ return new String[] {"Reference"};
1459        case -1663305268: /*supplier*/ return new String[] {"Reference"};
1460        case -934964668: /*reason*/ return new String[] {"CodeableReference"};
1461        case -949323153: /*deliverFrom*/ return new String[] {"Reference"};
1462        case -242327936: /*deliverTo*/ return new String[] {"Reference"};
1463        default: return super.getTypesForProperty(hash, name);
1464        }
1465
1466      }
1467
1468      @Override
1469      public Base addChild(String name) throws FHIRException {
1470        if (name.equals("identifier")) {
1471          return addIdentifier();
1472        }
1473        else if (name.equals("status")) {
1474          throw new FHIRException("Cannot call addChild on a primitive type SupplyRequest.status");
1475        }
1476        else if (name.equals("basedOn")) {
1477          return addBasedOn();
1478        }
1479        else if (name.equals("category")) {
1480          this.category = new CodeableConcept();
1481          return this.category;
1482        }
1483        else if (name.equals("priority")) {
1484          throw new FHIRException("Cannot call addChild on a primitive type SupplyRequest.priority");
1485        }
1486        else if (name.equals("item")) {
1487          this.item = new CodeableReference();
1488          return this.item;
1489        }
1490        else if (name.equals("quantity")) {
1491          this.quantity = new Quantity();
1492          return this.quantity;
1493        }
1494        else if (name.equals("parameter")) {
1495          return addParameter();
1496        }
1497        else if (name.equals("occurrenceDateTime")) {
1498          this.occurrence = new DateTimeType();
1499          return this.occurrence;
1500        }
1501        else if (name.equals("occurrencePeriod")) {
1502          this.occurrence = new Period();
1503          return this.occurrence;
1504        }
1505        else if (name.equals("occurrenceTiming")) {
1506          this.occurrence = new Timing();
1507          return this.occurrence;
1508        }
1509        else if (name.equals("authoredOn")) {
1510          throw new FHIRException("Cannot call addChild on a primitive type SupplyRequest.authoredOn");
1511        }
1512        else if (name.equals("requester")) {
1513          this.requester = new Reference();
1514          return this.requester;
1515        }
1516        else if (name.equals("supplier")) {
1517          return addSupplier();
1518        }
1519        else if (name.equals("reason")) {
1520          return addReason();
1521        }
1522        else if (name.equals("deliverFrom")) {
1523          this.deliverFrom = new Reference();
1524          return this.deliverFrom;
1525        }
1526        else if (name.equals("deliverTo")) {
1527          this.deliverTo = new Reference();
1528          return this.deliverTo;
1529        }
1530        else
1531          return super.addChild(name);
1532      }
1533
1534  public String fhirType() {
1535    return "SupplyRequest";
1536
1537  }
1538
1539      public SupplyRequest copy() {
1540        SupplyRequest dst = new SupplyRequest();
1541        copyValues(dst);
1542        return dst;
1543      }
1544
1545      public void copyValues(SupplyRequest dst) {
1546        super.copyValues(dst);
1547        if (identifier != null) {
1548          dst.identifier = new ArrayList<Identifier>();
1549          for (Identifier i : identifier)
1550            dst.identifier.add(i.copy());
1551        };
1552        dst.status = status == null ? null : status.copy();
1553        if (basedOn != null) {
1554          dst.basedOn = new ArrayList<Reference>();
1555          for (Reference i : basedOn)
1556            dst.basedOn.add(i.copy());
1557        };
1558        dst.category = category == null ? null : category.copy();
1559        dst.priority = priority == null ? null : priority.copy();
1560        dst.item = item == null ? null : item.copy();
1561        dst.quantity = quantity == null ? null : quantity.copy();
1562        if (parameter != null) {
1563          dst.parameter = new ArrayList<SupplyRequestParameterComponent>();
1564          for (SupplyRequestParameterComponent i : parameter)
1565            dst.parameter.add(i.copy());
1566        };
1567        dst.occurrence = occurrence == null ? null : occurrence.copy();
1568        dst.authoredOn = authoredOn == null ? null : authoredOn.copy();
1569        dst.requester = requester == null ? null : requester.copy();
1570        if (supplier != null) {
1571          dst.supplier = new ArrayList<Reference>();
1572          for (Reference i : supplier)
1573            dst.supplier.add(i.copy());
1574        };
1575        if (reason != null) {
1576          dst.reason = new ArrayList<CodeableReference>();
1577          for (CodeableReference i : reason)
1578            dst.reason.add(i.copy());
1579        };
1580        dst.deliverFrom = deliverFrom == null ? null : deliverFrom.copy();
1581        dst.deliverTo = deliverTo == null ? null : deliverTo.copy();
1582      }
1583
1584      protected SupplyRequest typedCopy() {
1585        return copy();
1586      }
1587
1588      @Override
1589      public boolean equalsDeep(Base other_) {
1590        if (!super.equalsDeep(other_))
1591          return false;
1592        if (!(other_ instanceof SupplyRequest))
1593          return false;
1594        SupplyRequest o = (SupplyRequest) other_;
1595        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(basedOn, o.basedOn, true)
1596           && compareDeep(category, o.category, true) && compareDeep(priority, o.priority, true) && compareDeep(item, o.item, true)
1597           && compareDeep(quantity, o.quantity, true) && compareDeep(parameter, o.parameter, true) && compareDeep(occurrence, o.occurrence, true)
1598           && compareDeep(authoredOn, o.authoredOn, true) && compareDeep(requester, o.requester, true) && compareDeep(supplier, o.supplier, true)
1599           && compareDeep(reason, o.reason, true) && compareDeep(deliverFrom, o.deliverFrom, true) && compareDeep(deliverTo, o.deliverTo, true)
1600          ;
1601      }
1602
1603      @Override
1604      public boolean equalsShallow(Base other_) {
1605        if (!super.equalsShallow(other_))
1606          return false;
1607        if (!(other_ instanceof SupplyRequest))
1608          return false;
1609        SupplyRequest o = (SupplyRequest) other_;
1610        return compareValues(status, o.status, true) && compareValues(priority, o.priority, true) && compareValues(authoredOn, o.authoredOn, true)
1611          ;
1612      }
1613
1614      public boolean isEmpty() {
1615        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, basedOn
1616          , category, priority, item, quantity, parameter, occurrence, authoredOn, requester
1617          , supplier, reason, deliverFrom, deliverTo);
1618      }
1619
1620  @Override
1621  public ResourceType getResourceType() {
1622    return ResourceType.SupplyRequest;
1623   }
1624
1625 /**
1626   * Search parameter: <b>category</b>
1627   * <p>
1628   * Description: <b>The kind of supply (central, non-stock, etc.)</b><br>
1629   * Type: <b>token</b><br>
1630   * Path: <b>SupplyRequest.category</b><br>
1631   * </p>
1632   */
1633  @SearchParamDefinition(name="category", path="SupplyRequest.category", description="The kind of supply (central, non-stock, etc.)", type="token" )
1634  public static final String SP_CATEGORY = "category";
1635 /**
1636   * <b>Fluent Client</b> search parameter constant for <b>category</b>
1637   * <p>
1638   * Description: <b>The kind of supply (central, non-stock, etc.)</b><br>
1639   * Type: <b>token</b><br>
1640   * Path: <b>SupplyRequest.category</b><br>
1641   * </p>
1642   */
1643  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
1644
1645 /**
1646   * Search parameter: <b>requester</b>
1647   * <p>
1648   * Description: <b>Individual making the request</b><br>
1649   * Type: <b>reference</b><br>
1650   * Path: <b>SupplyRequest.requester</b><br>
1651   * </p>
1652   */
1653  @SearchParamDefinition(name="requester", path="SupplyRequest.requester", description="Individual making the request", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for RelatedPerson") }, target={CareTeam.class, Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
1654  public static final String SP_REQUESTER = "requester";
1655 /**
1656   * <b>Fluent Client</b> search parameter constant for <b>requester</b>
1657   * <p>
1658   * Description: <b>Individual making the request</b><br>
1659   * Type: <b>reference</b><br>
1660   * Path: <b>SupplyRequest.requester</b><br>
1661   * </p>
1662   */
1663  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER);
1664
1665/**
1666   * Constant for fluent queries to be used to add include statements. Specifies
1667   * the path value of "<b>SupplyRequest:requester</b>".
1668   */
1669  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("SupplyRequest:requester").toLocked();
1670
1671 /**
1672   * Search parameter: <b>status</b>
1673   * <p>
1674   * Description: <b>draft | active | suspended +</b><br>
1675   * Type: <b>token</b><br>
1676   * Path: <b>SupplyRequest.status</b><br>
1677   * </p>
1678   */
1679  @SearchParamDefinition(name="status", path="SupplyRequest.status", description="draft | active | suspended +", type="token" )
1680  public static final String SP_STATUS = "status";
1681 /**
1682   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1683   * <p>
1684   * Description: <b>draft | active | suspended +</b><br>
1685   * Type: <b>token</b><br>
1686   * Path: <b>SupplyRequest.status</b><br>
1687   * </p>
1688   */
1689  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1690
1691 /**
1692   * Search parameter: <b>subject</b>
1693   * <p>
1694   * Description: <b>The destination of the supply</b><br>
1695   * Type: <b>reference</b><br>
1696   * Path: <b>SupplyRequest.deliverTo</b><br>
1697   * </p>
1698   */
1699  @SearchParamDefinition(name="subject", path="SupplyRequest.deliverTo", description="The destination of the supply", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Location.class, Organization.class, Patient.class } )
1700  public static final String SP_SUBJECT = "subject";
1701 /**
1702   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
1703   * <p>
1704   * Description: <b>The destination of the supply</b><br>
1705   * Type: <b>reference</b><br>
1706   * Path: <b>SupplyRequest.deliverTo</b><br>
1707   * </p>
1708   */
1709  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
1710
1711/**
1712   * Constant for fluent queries to be used to add include statements. Specifies
1713   * the path value of "<b>SupplyRequest:subject</b>".
1714   */
1715  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("SupplyRequest:subject").toLocked();
1716
1717 /**
1718   * Search parameter: <b>supplier</b>
1719   * <p>
1720   * Description: <b>Who is intended to fulfill the request</b><br>
1721   * Type: <b>reference</b><br>
1722   * Path: <b>SupplyRequest.supplier</b><br>
1723   * </p>
1724   */
1725  @SearchParamDefinition(name="supplier", path="SupplyRequest.supplier", description="Who is intended to fulfill the request", type="reference", target={HealthcareService.class, Organization.class } )
1726  public static final String SP_SUPPLIER = "supplier";
1727 /**
1728   * <b>Fluent Client</b> search parameter constant for <b>supplier</b>
1729   * <p>
1730   * Description: <b>Who is intended to fulfill the request</b><br>
1731   * Type: <b>reference</b><br>
1732   * Path: <b>SupplyRequest.supplier</b><br>
1733   * </p>
1734   */
1735  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPLIER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPLIER);
1736
1737/**
1738   * Constant for fluent queries to be used to add include statements. Specifies
1739   * the path value of "<b>SupplyRequest:supplier</b>".
1740   */
1741  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPLIER = new ca.uhn.fhir.model.api.Include("SupplyRequest:supplier").toLocked();
1742
1743 /**
1744   * Search parameter: <b>date</b>
1745   * <p>
1746   * Description: <b>Multiple Resources: 
1747
1748* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
1749* [CarePlan](careplan.html): Time period plan covers
1750* [CareTeam](careteam.html): A date within the coverage time period.
1751* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
1752* [Composition](composition.html): Composition editing time
1753* [Consent](consent.html): When consent was agreed to
1754* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
1755* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
1756* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
1757* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
1758* [Flag](flag.html): Time period when flag is active
1759* [Immunization](immunization.html): Vaccination  (non)-Administration Date
1760* [List](list.html): When the list was prepared
1761* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
1762* [Procedure](procedure.html): When the procedure occurred or is occurring
1763* [RiskAssessment](riskassessment.html): When was assessment made?
1764* [SupplyRequest](supplyrequest.html): When the request was made
1765</b><br>
1766   * Type: <b>date</b><br>
1767   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
1768   * </p>
1769   */
1770  @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded\r\n* [CarePlan](careplan.html): Time period plan covers\r\n* [CareTeam](careteam.html): A date within the coverage time period.\r\n* [ClinicalImpression](clinicalimpression.html): When the assessment was documented\r\n* [Composition](composition.html): Composition editing time\r\n* [Consent](consent.html): When consent was agreed to\r\n* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report\r\n* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted\r\n* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period\r\n* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated\r\n* [Flag](flag.html): Time period when flag is active\r\n* [Immunization](immunization.html): Vaccination  (non)-Administration Date\r\n* [List](list.html): When the list was prepared\r\n* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period\r\n* [Procedure](procedure.html): When the procedure occurred or is occurring\r\n* [RiskAssessment](riskassessment.html): When was assessment made?\r\n* [SupplyRequest](supplyrequest.html): When the request was made\r\n", type="date" )
1771  public static final String SP_DATE = "date";
1772 /**
1773   * <b>Fluent Client</b> search parameter constant for <b>date</b>
1774   * <p>
1775   * Description: <b>Multiple Resources: 
1776
1777* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
1778* [CarePlan](careplan.html): Time period plan covers
1779* [CareTeam](careteam.html): A date within the coverage time period.
1780* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
1781* [Composition](composition.html): Composition editing time
1782* [Consent](consent.html): When consent was agreed to
1783* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
1784* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
1785* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
1786* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
1787* [Flag](flag.html): Time period when flag is active
1788* [Immunization](immunization.html): Vaccination  (non)-Administration Date
1789* [List](list.html): When the list was prepared
1790* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
1791* [Procedure](procedure.html): When the procedure occurred or is occurring
1792* [RiskAssessment](riskassessment.html): When was assessment made?
1793* [SupplyRequest](supplyrequest.html): When the request was made
1794</b><br>
1795   * Type: <b>date</b><br>
1796   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
1797   * </p>
1798   */
1799  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
1800
1801 /**
1802   * Search parameter: <b>identifier</b>
1803   * <p>
1804   * Description: <b>Multiple Resources: 
1805
1806* [AllergyIntolerance](allergyintolerance.html): External ids for this item
1807* [CarePlan](careplan.html): External Ids for this plan
1808* [CareTeam](careteam.html): External Ids for this team
1809* [Composition](composition.html): Version-independent identifier for the Composition
1810* [Condition](condition.html): A unique identifier of the condition record
1811* [Consent](consent.html): Identifier for this record (external references)
1812* [DetectedIssue](detectedissue.html): Unique id for the detected issue
1813* [DeviceRequest](devicerequest.html): Business identifier for request/order
1814* [DiagnosticReport](diagnosticreport.html): An identifier for the report
1815* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
1816* [DocumentReference](documentreference.html): Identifier of the attachment binary
1817* [Encounter](encounter.html): Identifier(s) by which this encounter is known
1818* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
1819* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
1820* [Goal](goal.html): External Ids for this goal
1821* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
1822* [Immunization](immunization.html): Business identifier
1823* [List](list.html): Business identifier
1824* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
1825* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
1826* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
1827* [MedicationUsage](medicationusage.html): Return statements with this external identifier
1828* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
1829* [Observation](observation.html): The unique id for a particular observation
1830* [Procedure](procedure.html): A unique identifier for a procedure
1831* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
1832* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
1833* [SupplyDelivery](supplydelivery.html): External identifier
1834* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
1835* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
1836</b><br>
1837   * Type: <b>token</b><br>
1838   * 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>
1839   * </p>
1840   */
1841  @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" )
1842  public static final String SP_IDENTIFIER = "identifier";
1843 /**
1844   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1845   * <p>
1846   * Description: <b>Multiple Resources: 
1847
1848* [AllergyIntolerance](allergyintolerance.html): External ids for this item
1849* [CarePlan](careplan.html): External Ids for this plan
1850* [CareTeam](careteam.html): External Ids for this team
1851* [Composition](composition.html): Version-independent identifier for the Composition
1852* [Condition](condition.html): A unique identifier of the condition record
1853* [Consent](consent.html): Identifier for this record (external references)
1854* [DetectedIssue](detectedissue.html): Unique id for the detected issue
1855* [DeviceRequest](devicerequest.html): Business identifier for request/order
1856* [DiagnosticReport](diagnosticreport.html): An identifier for the report
1857* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
1858* [DocumentReference](documentreference.html): Identifier of the attachment binary
1859* [Encounter](encounter.html): Identifier(s) by which this encounter is known
1860* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
1861* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
1862* [Goal](goal.html): External Ids for this goal
1863* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
1864* [Immunization](immunization.html): Business identifier
1865* [List](list.html): Business identifier
1866* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
1867* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
1868* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
1869* [MedicationUsage](medicationusage.html): Return statements with this external identifier
1870* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
1871* [Observation](observation.html): The unique id for a particular observation
1872* [Procedure](procedure.html): A unique identifier for a procedure
1873* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
1874* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
1875* [SupplyDelivery](supplydelivery.html): External identifier
1876* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
1877* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
1878</b><br>
1879   * Type: <b>token</b><br>
1880   * 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>
1881   * </p>
1882   */
1883  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1884
1885
1886}
1887