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