001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * Represents a request a device to be provided to a specific patient. The device may be an implantable device to be subsequently implanted, or an external assistive device, such as a walker, to be delivered and subsequently be used.
052 */
053@ResourceDef(name="DeviceRequest", profile="http://hl7.org/fhir/StructureDefinition/DeviceRequest")
054public class DeviceRequest extends DomainResource {
055
056    @Block()
057    public static class DeviceRequestParameterComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * A code or string that identifies the device detail being asserted.
060         */
061        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
062        @Description(shortDefinition="Device detail", formalDefinition="A code or string that identifies the device detail being asserted." )
063        protected CodeableConcept code;
064
065        /**
066         * The value of the device detail.
067         */
068        @Child(name = "value", type = {CodeableConcept.class, Quantity.class, Range.class, BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
069        @Description(shortDefinition="Value of detail", formalDefinition="The value of the device detail." )
070        protected DataType value;
071
072        private static final long serialVersionUID = -1950789033L;
073
074    /**
075     * Constructor
076     */
077      public DeviceRequestParameterComponent() {
078        super();
079      }
080
081        /**
082         * @return {@link #code} (A code or string that identifies the device detail being asserted.)
083         */
084        public CodeableConcept getCode() { 
085          if (this.code == null)
086            if (Configuration.errorOnAutoCreate())
087              throw new Error("Attempt to auto-create DeviceRequestParameterComponent.code");
088            else if (Configuration.doAutoCreate())
089              this.code = new CodeableConcept(); // cc
090          return this.code;
091        }
092
093        public boolean hasCode() { 
094          return this.code != null && !this.code.isEmpty();
095        }
096
097        /**
098         * @param value {@link #code} (A code or string that identifies the device detail being asserted.)
099         */
100        public DeviceRequestParameterComponent setCode(CodeableConcept value) { 
101          this.code = value;
102          return this;
103        }
104
105        /**
106         * @return {@link #value} (The value of the device detail.)
107         */
108        public DataType getValue() { 
109          return this.value;
110        }
111
112        /**
113         * @return {@link #value} (The value of the device detail.)
114         */
115        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
116          if (this.value == null)
117            this.value = new CodeableConcept();
118          if (!(this.value instanceof CodeableConcept))
119            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
120          return (CodeableConcept) this.value;
121        }
122
123        public boolean hasValueCodeableConcept() { 
124          return this != null && this.value instanceof CodeableConcept;
125        }
126
127        /**
128         * @return {@link #value} (The value of the device detail.)
129         */
130        public Quantity getValueQuantity() throws FHIRException { 
131          if (this.value == null)
132            this.value = new Quantity();
133          if (!(this.value instanceof Quantity))
134            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
135          return (Quantity) this.value;
136        }
137
138        public boolean hasValueQuantity() { 
139          return this != null && this.value instanceof Quantity;
140        }
141
142        /**
143         * @return {@link #value} (The value of the device detail.)
144         */
145        public Range getValueRange() throws FHIRException { 
146          if (this.value == null)
147            this.value = new Range();
148          if (!(this.value instanceof Range))
149            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
150          return (Range) this.value;
151        }
152
153        public boolean hasValueRange() { 
154          return this != null && this.value instanceof Range;
155        }
156
157        /**
158         * @return {@link #value} (The value of the device detail.)
159         */
160        public BooleanType getValueBooleanType() throws FHIRException { 
161          if (this.value == null)
162            this.value = new BooleanType();
163          if (!(this.value instanceof BooleanType))
164            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
165          return (BooleanType) this.value;
166        }
167
168        public boolean hasValueBooleanType() { 
169          return this != null && this.value instanceof BooleanType;
170        }
171
172        public boolean hasValue() { 
173          return this.value != null && !this.value.isEmpty();
174        }
175
176        /**
177         * @param value {@link #value} (The value of the device detail.)
178         */
179        public DeviceRequestParameterComponent setValue(DataType value) { 
180          if (value != null && !(value instanceof CodeableConcept || value instanceof Quantity || value instanceof Range || value instanceof BooleanType))
181            throw new Error("Not the right type for DeviceRequest.parameter.value[x]: "+value.fhirType());
182          this.value = value;
183          return this;
184        }
185
186        protected void listChildren(List<Property> children) {
187          super.listChildren(children);
188          children.add(new Property("code", "CodeableConcept", "A code or string that identifies the device detail being asserted.", 0, 1, code));
189          children.add(new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value));
190        }
191
192        @Override
193        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
194          switch (_hash) {
195          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A code or string that identifies the device detail being asserted.", 0, 1, code);
196          case -1410166417: /*value[x]*/  return new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value);
197          case 111972721: /*value*/  return new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value);
198          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "The value of the device detail.", 0, 1, value);
199          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "The value of the device detail.", 0, 1, value);
200          case 2030761548: /*valueRange*/  return new Property("value[x]", "Range", "The value of the device detail.", 0, 1, value);
201          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "The value of the device detail.", 0, 1, value);
202          default: return super.getNamedProperty(_hash, _name, _checkValid);
203          }
204
205        }
206
207      @Override
208      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
209        switch (hash) {
210        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
211        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
212        default: return super.getProperty(hash, name, checkValid);
213        }
214
215      }
216
217      @Override
218      public Base setProperty(int hash, String name, Base value) throws FHIRException {
219        switch (hash) {
220        case 3059181: // code
221          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
222          return value;
223        case 111972721: // value
224          this.value = TypeConvertor.castToType(value); // DataType
225          return value;
226        default: return super.setProperty(hash, name, value);
227        }
228
229      }
230
231      @Override
232      public Base setProperty(String name, Base value) throws FHIRException {
233        if (name.equals("code")) {
234          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
235        } else if (name.equals("value[x]")) {
236          this.value = TypeConvertor.castToType(value); // DataType
237        } else
238          return super.setProperty(name, value);
239        return value;
240      }
241
242      @Override
243      public Base makeProperty(int hash, String name) throws FHIRException {
244        switch (hash) {
245        case 3059181:  return getCode();
246        case -1410166417:  return getValue();
247        case 111972721:  return getValue();
248        default: return super.makeProperty(hash, name);
249        }
250
251      }
252
253      @Override
254      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
255        switch (hash) {
256        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
257        case 111972721: /*value*/ return new String[] {"CodeableConcept", "Quantity", "Range", "boolean"};
258        default: return super.getTypesForProperty(hash, name);
259        }
260
261      }
262
263      @Override
264      public Base addChild(String name) throws FHIRException {
265        if (name.equals("code")) {
266          this.code = new CodeableConcept();
267          return this.code;
268        }
269        else if (name.equals("valueCodeableConcept")) {
270          this.value = new CodeableConcept();
271          return this.value;
272        }
273        else if (name.equals("valueQuantity")) {
274          this.value = new Quantity();
275          return this.value;
276        }
277        else if (name.equals("valueRange")) {
278          this.value = new Range();
279          return this.value;
280        }
281        else if (name.equals("valueBoolean")) {
282          this.value = new BooleanType();
283          return this.value;
284        }
285        else
286          return super.addChild(name);
287      }
288
289      public DeviceRequestParameterComponent copy() {
290        DeviceRequestParameterComponent dst = new DeviceRequestParameterComponent();
291        copyValues(dst);
292        return dst;
293      }
294
295      public void copyValues(DeviceRequestParameterComponent dst) {
296        super.copyValues(dst);
297        dst.code = code == null ? null : code.copy();
298        dst.value = value == null ? null : value.copy();
299      }
300
301      @Override
302      public boolean equalsDeep(Base other_) {
303        if (!super.equalsDeep(other_))
304          return false;
305        if (!(other_ instanceof DeviceRequestParameterComponent))
306          return false;
307        DeviceRequestParameterComponent o = (DeviceRequestParameterComponent) other_;
308        return compareDeep(code, o.code, true) && compareDeep(value, o.value, true);
309      }
310
311      @Override
312      public boolean equalsShallow(Base other_) {
313        if (!super.equalsShallow(other_))
314          return false;
315        if (!(other_ instanceof DeviceRequestParameterComponent))
316          return false;
317        DeviceRequestParameterComponent o = (DeviceRequestParameterComponent) other_;
318        return true;
319      }
320
321      public boolean isEmpty() {
322        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, value);
323      }
324
325  public String fhirType() {
326    return "DeviceRequest.parameter";
327
328  }
329
330  }
331
332    /**
333     * Identifiers assigned to this order by the orderer or by the receiver.
334     */
335    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
336    @Description(shortDefinition="External Request identifier", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." )
337    protected List<Identifier> identifier;
338
339    /**
340     * The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.
341     */
342    @Child(name = "instantiatesCanonical", type = {CanonicalType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
343    @Description(shortDefinition="Instantiates FHIR protocol or definition", formalDefinition="The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest." )
344    protected List<CanonicalType> instantiatesCanonical;
345
346    /**
347     * The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.
348     */
349    @Child(name = "instantiatesUri", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
350    @Description(shortDefinition="Instantiates external protocol or definition", formalDefinition="The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest." )
351    protected List<UriType> instantiatesUri;
352
353    /**
354     * Plan/proposal/order fulfilled by this request.
355     */
356    @Child(name = "basedOn", type = {Reference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
357    @Description(shortDefinition="What request fulfills", formalDefinition="Plan/proposal/order fulfilled by this request." )
358    protected List<Reference> basedOn;
359
360    /**
361     * The request takes the place of the referenced completed or terminated request(s).
362     */
363    @Child(name = "priorRequest", type = {DeviceRequest.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
364    @Description(shortDefinition="What request replaces", formalDefinition="The request takes the place of the referenced completed or terminated request(s)." )
365    protected List<Reference> priorRequest;
366
367    /**
368     * Composite request this is part of.
369     */
370    @Child(name = "groupIdentifier", type = {Identifier.class}, order=5, min=0, max=1, modifier=false, summary=true)
371    @Description(shortDefinition="Identifier of composite request", formalDefinition="Composite request this is part of." )
372    protected Identifier groupIdentifier;
373
374    /**
375     * The status of the request.
376     */
377    @Child(name = "status", type = {CodeType.class}, order=6, min=0, max=1, modifier=true, summary=true)
378    @Description(shortDefinition="draft | active | on-hold | revoked | completed | entered-in-error | unknown", formalDefinition="The status of the request." )
379    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-status")
380    protected Enumeration<RequestStatus> status;
381
382    /**
383     * Whether the request is a proposal, plan, an original order or a reflex order.
384     */
385    @Child(name = "intent", type = {CodeType.class}, order=7, min=1, max=1, modifier=true, summary=true)
386    @Description(shortDefinition="proposal | plan | directive | order | original-order | reflex-order | filler-order | instance-order | option", formalDefinition="Whether the request is a proposal, plan, an original order or a reflex order." )
387    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-intent")
388    protected Enumeration<RequestIntent> intent;
389
390    /**
391     * Indicates how quickly the request should be addressed with respect to other requests.
392     */
393    @Child(name = "priority", type = {CodeType.class}, order=8, min=0, max=1, modifier=false, summary=true)
394    @Description(shortDefinition="routine | urgent | asap | stat", formalDefinition="Indicates how quickly the request should be addressed with respect to other requests." )
395    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority")
396    protected Enumeration<RequestPriority> priority;
397
398    /**
399     * If true, indicates that the provider is asking for the patient to either stop using or to not start using the specified device or category of devices. For example, the patient has undergone surgery and the provider is indicating that the patient should not wear contact lenses.
400     */
401    @Child(name = "doNotPerform", type = {BooleanType.class}, order=9, min=0, max=1, modifier=true, summary=true)
402    @Description(shortDefinition="True if the request is to stop or not to start using the device", formalDefinition="If true, indicates that the provider is asking for the patient to either stop using or to not start using the specified device or category of devices. For example, the patient has undergone surgery and the provider is indicating that the patient should not wear contact lenses." )
403    protected BooleanType doNotPerform;
404
405    /**
406     * The details of the device to be used.
407     */
408    @Child(name = "code", type = {CodeableReference.class}, order=10, min=1, max=1, modifier=false, summary=true)
409    @Description(shortDefinition="Device requested", formalDefinition="The details of the device to be used." )
410    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-type")
411    protected CodeableReference code;
412
413    /**
414     * The number of devices to be provided.
415     */
416    @Child(name = "quantity", type = {IntegerType.class}, order=11, min=0, max=1, modifier=false, summary=false)
417    @Description(shortDefinition="Quantity of devices to supply", formalDefinition="The number of devices to be provided." )
418    protected IntegerType quantity;
419
420    /**
421     * Specific parameters for the ordered item.  For example, the prism value for lenses.
422     */
423    @Child(name = "parameter", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
424    @Description(shortDefinition="Device details", formalDefinition="Specific parameters for the ordered item.  For example, the prism value for lenses." )
425    protected List<DeviceRequestParameterComponent> parameter;
426
427    /**
428     * The patient who will use the device.
429     */
430    @Child(name = "subject", type = {Patient.class, Group.class, Location.class, Device.class}, order=13, min=1, max=1, modifier=false, summary=true)
431    @Description(shortDefinition="Focus of request", formalDefinition="The patient who will use the device." )
432    protected Reference subject;
433
434    /**
435     * An encounter that provides additional context in which this request is made.
436     */
437    @Child(name = "encounter", type = {Encounter.class}, order=14, min=0, max=1, modifier=false, summary=true)
438    @Description(shortDefinition="Encounter motivating request", formalDefinition="An encounter that provides additional context in which this request is made." )
439    protected Reference encounter;
440
441    /**
442     * The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".
443     */
444    @Child(name = "occurrence", type = {DateTimeType.class, Period.class, Timing.class}, order=15, min=0, max=1, modifier=false, summary=true)
445    @Description(shortDefinition="Desired time or schedule for use", formalDefinition="The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\"." )
446    protected DataType occurrence;
447
448    /**
449     * When the request transitioned to being actionable.
450     */
451    @Child(name = "authoredOn", type = {DateTimeType.class}, order=16, min=0, max=1, modifier=false, summary=true)
452    @Description(shortDefinition="When recorded", formalDefinition="When the request transitioned to being actionable." )
453    protected DateTimeType authoredOn;
454
455    /**
456     * The individual or entity who initiated the request and has responsibility for its activation.
457     */
458    @Child(name = "requester", type = {Device.class, Practitioner.class, PractitionerRole.class, Organization.class}, order=17, min=0, max=1, modifier=false, summary=true)
459    @Description(shortDefinition="Who/what submitted the device request", formalDefinition="The individual or entity who initiated the request and has responsibility for its activation." )
460    protected Reference requester;
461
462    /**
463     * The desired kind of individual or entity to provide the device to the subject of the request (e.g., patient, location).
464     */
465    @Child(name = "performerType", type = {CodeableConcept.class}, order=18, min=0, max=1, modifier=false, summary=true)
466    @Description(shortDefinition="Filler role", formalDefinition="The desired kind of individual or entity to provide the device to the subject of the request (e.g., patient, location)." )
467    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/participant-role")
468    protected CodeableConcept performerType;
469
470    /**
471     * The desired individual or entity to provide the device to the subject of the request (e.g., patient, location).
472     */
473    @Child(name = "performer", type = {Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class, HealthcareService.class, Patient.class, Device.class, RelatedPerson.class}, order=19, min=0, max=1, modifier=false, summary=true)
474    @Description(shortDefinition="Requested Filler", formalDefinition="The desired individual or entity to provide the device to the subject of the request (e.g., patient, location)." )
475    protected Reference performer;
476
477    /**
478     * Reason or justification for the use of this device.
479     */
480    @Child(name = "reason", type = {CodeableReference.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
481    @Description(shortDefinition="Coded/Linked Reason for request", formalDefinition="Reason or justification for the use of this device." )
482    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
483    protected List<CodeableReference> reason;
484
485    /**
486     * Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.
487     */
488    @Child(name = "insurance", type = {Coverage.class, ClaimResponse.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
489    @Description(shortDefinition="Associated insurance coverage", formalDefinition="Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service." )
490    protected List<Reference> insurance;
491
492    /**
493     * Additional clinical information about the patient that may influence the request fulfilment.  For example, this may include where on the subject's body the device will be used (i.e. the target site).
494     */
495    @Child(name = "supportingInfo", type = {Reference.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
496    @Description(shortDefinition="Additional clinical information", formalDefinition="Additional clinical information about the patient that may influence the request fulfilment.  For example, this may include where on the subject's body the device will be used (i.e. the target site)." )
497    protected List<Reference> supportingInfo;
498
499    /**
500     * Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.
501     */
502    @Child(name = "note", type = {Annotation.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
503    @Description(shortDefinition="Notes or comments", formalDefinition="Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." )
504    protected List<Annotation> note;
505
506    /**
507     * Key events in the history of the request.
508     */
509    @Child(name = "relevantHistory", type = {Provenance.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
510    @Description(shortDefinition="Request provenance", formalDefinition="Key events in the history of the request." )
511    protected List<Reference> relevantHistory;
512
513    private static final long serialVersionUID = 97830140L;
514
515  /**
516   * Constructor
517   */
518    public DeviceRequest() {
519      super();
520    }
521
522  /**
523   * Constructor
524   */
525    public DeviceRequest(RequestIntent intent, CodeableReference code, Reference subject) {
526      super();
527      this.setIntent(intent);
528      this.setCode(code);
529      this.setSubject(subject);
530    }
531
532    /**
533     * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.)
534     */
535    public List<Identifier> getIdentifier() { 
536      if (this.identifier == null)
537        this.identifier = new ArrayList<Identifier>();
538      return this.identifier;
539    }
540
541    /**
542     * @return Returns a reference to <code>this</code> for easy method chaining
543     */
544    public DeviceRequest setIdentifier(List<Identifier> theIdentifier) { 
545      this.identifier = theIdentifier;
546      return this;
547    }
548
549    public boolean hasIdentifier() { 
550      if (this.identifier == null)
551        return false;
552      for (Identifier item : this.identifier)
553        if (!item.isEmpty())
554          return true;
555      return false;
556    }
557
558    public Identifier addIdentifier() { //3
559      Identifier t = new Identifier();
560      if (this.identifier == null)
561        this.identifier = new ArrayList<Identifier>();
562      this.identifier.add(t);
563      return t;
564    }
565
566    public DeviceRequest addIdentifier(Identifier t) { //3
567      if (t == null)
568        return this;
569      if (this.identifier == null)
570        this.identifier = new ArrayList<Identifier>();
571      this.identifier.add(t);
572      return this;
573    }
574
575    /**
576     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
577     */
578    public Identifier getIdentifierFirstRep() { 
579      if (getIdentifier().isEmpty()) {
580        addIdentifier();
581      }
582      return getIdentifier().get(0);
583    }
584
585    /**
586     * @return {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.)
587     */
588    public List<CanonicalType> getInstantiatesCanonical() { 
589      if (this.instantiatesCanonical == null)
590        this.instantiatesCanonical = new ArrayList<CanonicalType>();
591      return this.instantiatesCanonical;
592    }
593
594    /**
595     * @return Returns a reference to <code>this</code> for easy method chaining
596     */
597    public DeviceRequest setInstantiatesCanonical(List<CanonicalType> theInstantiatesCanonical) { 
598      this.instantiatesCanonical = theInstantiatesCanonical;
599      return this;
600    }
601
602    public boolean hasInstantiatesCanonical() { 
603      if (this.instantiatesCanonical == null)
604        return false;
605      for (CanonicalType item : this.instantiatesCanonical)
606        if (!item.isEmpty())
607          return true;
608      return false;
609    }
610
611    /**
612     * @return {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.)
613     */
614    public CanonicalType addInstantiatesCanonicalElement() {//2 
615      CanonicalType t = new CanonicalType();
616      if (this.instantiatesCanonical == null)
617        this.instantiatesCanonical = new ArrayList<CanonicalType>();
618      this.instantiatesCanonical.add(t);
619      return t;
620    }
621
622    /**
623     * @param value {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.)
624     */
625    public DeviceRequest addInstantiatesCanonical(String value) { //1
626      CanonicalType t = new CanonicalType();
627      t.setValue(value);
628      if (this.instantiatesCanonical == null)
629        this.instantiatesCanonical = new ArrayList<CanonicalType>();
630      this.instantiatesCanonical.add(t);
631      return this;
632    }
633
634    /**
635     * @param value {@link #instantiatesCanonical} (The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.)
636     */
637    public boolean hasInstantiatesCanonical(String value) { 
638      if (this.instantiatesCanonical == null)
639        return false;
640      for (CanonicalType v : this.instantiatesCanonical)
641        if (v.getValue().equals(value)) // canonical
642          return true;
643      return false;
644    }
645
646    /**
647     * @return {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.)
648     */
649    public List<UriType> getInstantiatesUri() { 
650      if (this.instantiatesUri == null)
651        this.instantiatesUri = new ArrayList<UriType>();
652      return this.instantiatesUri;
653    }
654
655    /**
656     * @return Returns a reference to <code>this</code> for easy method chaining
657     */
658    public DeviceRequest setInstantiatesUri(List<UriType> theInstantiatesUri) { 
659      this.instantiatesUri = theInstantiatesUri;
660      return this;
661    }
662
663    public boolean hasInstantiatesUri() { 
664      if (this.instantiatesUri == null)
665        return false;
666      for (UriType item : this.instantiatesUri)
667        if (!item.isEmpty())
668          return true;
669      return false;
670    }
671
672    /**
673     * @return {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.)
674     */
675    public UriType addInstantiatesUriElement() {//2 
676      UriType t = new UriType();
677      if (this.instantiatesUri == null)
678        this.instantiatesUri = new ArrayList<UriType>();
679      this.instantiatesUri.add(t);
680      return t;
681    }
682
683    /**
684     * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.)
685     */
686    public DeviceRequest addInstantiatesUri(String value) { //1
687      UriType t = new UriType();
688      t.setValue(value);
689      if (this.instantiatesUri == null)
690        this.instantiatesUri = new ArrayList<UriType>();
691      this.instantiatesUri.add(t);
692      return this;
693    }
694
695    /**
696     * @param value {@link #instantiatesUri} (The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.)
697     */
698    public boolean hasInstantiatesUri(String value) { 
699      if (this.instantiatesUri == null)
700        return false;
701      for (UriType v : this.instantiatesUri)
702        if (v.getValue().equals(value)) // uri
703          return true;
704      return false;
705    }
706
707    /**
708     * @return {@link #basedOn} (Plan/proposal/order fulfilled by this request.)
709     */
710    public List<Reference> getBasedOn() { 
711      if (this.basedOn == null)
712        this.basedOn = new ArrayList<Reference>();
713      return this.basedOn;
714    }
715
716    /**
717     * @return Returns a reference to <code>this</code> for easy method chaining
718     */
719    public DeviceRequest setBasedOn(List<Reference> theBasedOn) { 
720      this.basedOn = theBasedOn;
721      return this;
722    }
723
724    public boolean hasBasedOn() { 
725      if (this.basedOn == null)
726        return false;
727      for (Reference item : this.basedOn)
728        if (!item.isEmpty())
729          return true;
730      return false;
731    }
732
733    public Reference addBasedOn() { //3
734      Reference t = new Reference();
735      if (this.basedOn == null)
736        this.basedOn = new ArrayList<Reference>();
737      this.basedOn.add(t);
738      return t;
739    }
740
741    public DeviceRequest addBasedOn(Reference t) { //3
742      if (t == null)
743        return this;
744      if (this.basedOn == null)
745        this.basedOn = new ArrayList<Reference>();
746      this.basedOn.add(t);
747      return this;
748    }
749
750    /**
751     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
752     */
753    public Reference getBasedOnFirstRep() { 
754      if (getBasedOn().isEmpty()) {
755        addBasedOn();
756      }
757      return getBasedOn().get(0);
758    }
759
760    /**
761     * @return {@link #priorRequest} (The request takes the place of the referenced completed or terminated request(s).)
762     */
763    public List<Reference> getPriorRequest() { 
764      if (this.priorRequest == null)
765        this.priorRequest = new ArrayList<Reference>();
766      return this.priorRequest;
767    }
768
769    /**
770     * @return Returns a reference to <code>this</code> for easy method chaining
771     */
772    public DeviceRequest setPriorRequest(List<Reference> thePriorRequest) { 
773      this.priorRequest = thePriorRequest;
774      return this;
775    }
776
777    public boolean hasPriorRequest() { 
778      if (this.priorRequest == null)
779        return false;
780      for (Reference item : this.priorRequest)
781        if (!item.isEmpty())
782          return true;
783      return false;
784    }
785
786    public Reference addPriorRequest() { //3
787      Reference t = new Reference();
788      if (this.priorRequest == null)
789        this.priorRequest = new ArrayList<Reference>();
790      this.priorRequest.add(t);
791      return t;
792    }
793
794    public DeviceRequest addPriorRequest(Reference t) { //3
795      if (t == null)
796        return this;
797      if (this.priorRequest == null)
798        this.priorRequest = new ArrayList<Reference>();
799      this.priorRequest.add(t);
800      return this;
801    }
802
803    /**
804     * @return The first repetition of repeating field {@link #priorRequest}, creating it if it does not already exist {3}
805     */
806    public Reference getPriorRequestFirstRep() { 
807      if (getPriorRequest().isEmpty()) {
808        addPriorRequest();
809      }
810      return getPriorRequest().get(0);
811    }
812
813    /**
814     * @return {@link #groupIdentifier} (Composite request this is part of.)
815     */
816    public Identifier getGroupIdentifier() { 
817      if (this.groupIdentifier == null)
818        if (Configuration.errorOnAutoCreate())
819          throw new Error("Attempt to auto-create DeviceRequest.groupIdentifier");
820        else if (Configuration.doAutoCreate())
821          this.groupIdentifier = new Identifier(); // cc
822      return this.groupIdentifier;
823    }
824
825    public boolean hasGroupIdentifier() { 
826      return this.groupIdentifier != null && !this.groupIdentifier.isEmpty();
827    }
828
829    /**
830     * @param value {@link #groupIdentifier} (Composite request this is part of.)
831     */
832    public DeviceRequest setGroupIdentifier(Identifier value) { 
833      this.groupIdentifier = value;
834      return this;
835    }
836
837    /**
838     * @return {@link #status} (The status of the request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
839     */
840    public Enumeration<RequestStatus> getStatusElement() { 
841      if (this.status == null)
842        if (Configuration.errorOnAutoCreate())
843          throw new Error("Attempt to auto-create DeviceRequest.status");
844        else if (Configuration.doAutoCreate())
845          this.status = new Enumeration<RequestStatus>(new RequestStatusEnumFactory()); // bb
846      return this.status;
847    }
848
849    public boolean hasStatusElement() { 
850      return this.status != null && !this.status.isEmpty();
851    }
852
853    public boolean hasStatus() { 
854      return this.status != null && !this.status.isEmpty();
855    }
856
857    /**
858     * @param value {@link #status} (The status of the request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
859     */
860    public DeviceRequest setStatusElement(Enumeration<RequestStatus> value) { 
861      this.status = value;
862      return this;
863    }
864
865    /**
866     * @return The status of the request.
867     */
868    public RequestStatus getStatus() { 
869      return this.status == null ? null : this.status.getValue();
870    }
871
872    /**
873     * @param value The status of the request.
874     */
875    public DeviceRequest setStatus(RequestStatus value) { 
876      if (value == null)
877        this.status = null;
878      else {
879        if (this.status == null)
880          this.status = new Enumeration<RequestStatus>(new RequestStatusEnumFactory());
881        this.status.setValue(value);
882      }
883      return this;
884    }
885
886    /**
887     * @return {@link #intent} (Whether the request is a proposal, plan, an original order or a reflex order.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value
888     */
889    public Enumeration<RequestIntent> getIntentElement() { 
890      if (this.intent == null)
891        if (Configuration.errorOnAutoCreate())
892          throw new Error("Attempt to auto-create DeviceRequest.intent");
893        else if (Configuration.doAutoCreate())
894          this.intent = new Enumeration<RequestIntent>(new RequestIntentEnumFactory()); // bb
895      return this.intent;
896    }
897
898    public boolean hasIntentElement() { 
899      return this.intent != null && !this.intent.isEmpty();
900    }
901
902    public boolean hasIntent() { 
903      return this.intent != null && !this.intent.isEmpty();
904    }
905
906    /**
907     * @param value {@link #intent} (Whether the request is a proposal, plan, an original order or a reflex order.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value
908     */
909    public DeviceRequest setIntentElement(Enumeration<RequestIntent> value) { 
910      this.intent = value;
911      return this;
912    }
913
914    /**
915     * @return Whether the request is a proposal, plan, an original order or a reflex order.
916     */
917    public RequestIntent getIntent() { 
918      return this.intent == null ? null : this.intent.getValue();
919    }
920
921    /**
922     * @param value Whether the request is a proposal, plan, an original order or a reflex order.
923     */
924    public DeviceRequest setIntent(RequestIntent value) { 
925        if (this.intent == null)
926          this.intent = new Enumeration<RequestIntent>(new RequestIntentEnumFactory());
927        this.intent.setValue(value);
928      return this;
929    }
930
931    /**
932     * @return {@link #priority} (Indicates how quickly the request 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
933     */
934    public Enumeration<RequestPriority> getPriorityElement() { 
935      if (this.priority == null)
936        if (Configuration.errorOnAutoCreate())
937          throw new Error("Attempt to auto-create DeviceRequest.priority");
938        else if (Configuration.doAutoCreate())
939          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory()); // bb
940      return this.priority;
941    }
942
943    public boolean hasPriorityElement() { 
944      return this.priority != null && !this.priority.isEmpty();
945    }
946
947    public boolean hasPriority() { 
948      return this.priority != null && !this.priority.isEmpty();
949    }
950
951    /**
952     * @param value {@link #priority} (Indicates how quickly the request 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
953     */
954    public DeviceRequest setPriorityElement(Enumeration<RequestPriority> value) { 
955      this.priority = value;
956      return this;
957    }
958
959    /**
960     * @return Indicates how quickly the request should be addressed with respect to other requests.
961     */
962    public RequestPriority getPriority() { 
963      return this.priority == null ? null : this.priority.getValue();
964    }
965
966    /**
967     * @param value Indicates how quickly the request should be addressed with respect to other requests.
968     */
969    public DeviceRequest setPriority(RequestPriority value) { 
970      if (value == null)
971        this.priority = null;
972      else {
973        if (this.priority == null)
974          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory());
975        this.priority.setValue(value);
976      }
977      return this;
978    }
979
980    /**
981     * @return {@link #doNotPerform} (If true, indicates that the provider is asking for the patient to either stop using or to not start using the specified device or category of devices. For example, the patient has undergone surgery and the provider is indicating that the patient should not wear contact lenses.). This is the underlying object with id, value and extensions. The accessor "getDoNotPerform" gives direct access to the value
982     */
983    public BooleanType getDoNotPerformElement() { 
984      if (this.doNotPerform == null)
985        if (Configuration.errorOnAutoCreate())
986          throw new Error("Attempt to auto-create DeviceRequest.doNotPerform");
987        else if (Configuration.doAutoCreate())
988          this.doNotPerform = new BooleanType(); // bb
989      return this.doNotPerform;
990    }
991
992    public boolean hasDoNotPerformElement() { 
993      return this.doNotPerform != null && !this.doNotPerform.isEmpty();
994    }
995
996    public boolean hasDoNotPerform() { 
997      return this.doNotPerform != null && !this.doNotPerform.isEmpty();
998    }
999
1000    /**
1001     * @param value {@link #doNotPerform} (If true, indicates that the provider is asking for the patient to either stop using or to not start using the specified device or category of devices. For example, the patient has undergone surgery and the provider is indicating that the patient should not wear contact lenses.). This is the underlying object with id, value and extensions. The accessor "getDoNotPerform" gives direct access to the value
1002     */
1003    public DeviceRequest setDoNotPerformElement(BooleanType value) { 
1004      this.doNotPerform = value;
1005      return this;
1006    }
1007
1008    /**
1009     * @return If true, indicates that the provider is asking for the patient to either stop using or to not start using the specified device or category of devices. For example, the patient has undergone surgery and the provider is indicating that the patient should not wear contact lenses.
1010     */
1011    public boolean getDoNotPerform() { 
1012      return this.doNotPerform == null || this.doNotPerform.isEmpty() ? false : this.doNotPerform.getValue();
1013    }
1014
1015    /**
1016     * @param value If true, indicates that the provider is asking for the patient to either stop using or to not start using the specified device or category of devices. For example, the patient has undergone surgery and the provider is indicating that the patient should not wear contact lenses.
1017     */
1018    public DeviceRequest setDoNotPerform(boolean value) { 
1019        if (this.doNotPerform == null)
1020          this.doNotPerform = new BooleanType();
1021        this.doNotPerform.setValue(value);
1022      return this;
1023    }
1024
1025    /**
1026     * @return {@link #code} (The details of the device to be used.)
1027     */
1028    public CodeableReference getCode() { 
1029      if (this.code == null)
1030        if (Configuration.errorOnAutoCreate())
1031          throw new Error("Attempt to auto-create DeviceRequest.code");
1032        else if (Configuration.doAutoCreate())
1033          this.code = new CodeableReference(); // cc
1034      return this.code;
1035    }
1036
1037    public boolean hasCode() { 
1038      return this.code != null && !this.code.isEmpty();
1039    }
1040
1041    /**
1042     * @param value {@link #code} (The details of the device to be used.)
1043     */
1044    public DeviceRequest setCode(CodeableReference value) { 
1045      this.code = value;
1046      return this;
1047    }
1048
1049    /**
1050     * @return {@link #quantity} (The number of devices to be provided.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value
1051     */
1052    public IntegerType getQuantityElement() { 
1053      if (this.quantity == null)
1054        if (Configuration.errorOnAutoCreate())
1055          throw new Error("Attempt to auto-create DeviceRequest.quantity");
1056        else if (Configuration.doAutoCreate())
1057          this.quantity = new IntegerType(); // bb
1058      return this.quantity;
1059    }
1060
1061    public boolean hasQuantityElement() { 
1062      return this.quantity != null && !this.quantity.isEmpty();
1063    }
1064
1065    public boolean hasQuantity() { 
1066      return this.quantity != null && !this.quantity.isEmpty();
1067    }
1068
1069    /**
1070     * @param value {@link #quantity} (The number of devices to be provided.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value
1071     */
1072    public DeviceRequest setQuantityElement(IntegerType value) { 
1073      this.quantity = value;
1074      return this;
1075    }
1076
1077    /**
1078     * @return The number of devices to be provided.
1079     */
1080    public int getQuantity() { 
1081      return this.quantity == null || this.quantity.isEmpty() ? 0 : this.quantity.getValue();
1082    }
1083
1084    /**
1085     * @param value The number of devices to be provided.
1086     */
1087    public DeviceRequest setQuantity(int value) { 
1088        if (this.quantity == null)
1089          this.quantity = new IntegerType();
1090        this.quantity.setValue(value);
1091      return this;
1092    }
1093
1094    /**
1095     * @return {@link #parameter} (Specific parameters for the ordered item.  For example, the prism value for lenses.)
1096     */
1097    public List<DeviceRequestParameterComponent> getParameter() { 
1098      if (this.parameter == null)
1099        this.parameter = new ArrayList<DeviceRequestParameterComponent>();
1100      return this.parameter;
1101    }
1102
1103    /**
1104     * @return Returns a reference to <code>this</code> for easy method chaining
1105     */
1106    public DeviceRequest setParameter(List<DeviceRequestParameterComponent> theParameter) { 
1107      this.parameter = theParameter;
1108      return this;
1109    }
1110
1111    public boolean hasParameter() { 
1112      if (this.parameter == null)
1113        return false;
1114      for (DeviceRequestParameterComponent item : this.parameter)
1115        if (!item.isEmpty())
1116          return true;
1117      return false;
1118    }
1119
1120    public DeviceRequestParameterComponent addParameter() { //3
1121      DeviceRequestParameterComponent t = new DeviceRequestParameterComponent();
1122      if (this.parameter == null)
1123        this.parameter = new ArrayList<DeviceRequestParameterComponent>();
1124      this.parameter.add(t);
1125      return t;
1126    }
1127
1128    public DeviceRequest addParameter(DeviceRequestParameterComponent t) { //3
1129      if (t == null)
1130        return this;
1131      if (this.parameter == null)
1132        this.parameter = new ArrayList<DeviceRequestParameterComponent>();
1133      this.parameter.add(t);
1134      return this;
1135    }
1136
1137    /**
1138     * @return The first repetition of repeating field {@link #parameter}, creating it if it does not already exist {3}
1139     */
1140    public DeviceRequestParameterComponent getParameterFirstRep() { 
1141      if (getParameter().isEmpty()) {
1142        addParameter();
1143      }
1144      return getParameter().get(0);
1145    }
1146
1147    /**
1148     * @return {@link #subject} (The patient who will use the device.)
1149     */
1150    public Reference getSubject() { 
1151      if (this.subject == null)
1152        if (Configuration.errorOnAutoCreate())
1153          throw new Error("Attempt to auto-create DeviceRequest.subject");
1154        else if (Configuration.doAutoCreate())
1155          this.subject = new Reference(); // cc
1156      return this.subject;
1157    }
1158
1159    public boolean hasSubject() { 
1160      return this.subject != null && !this.subject.isEmpty();
1161    }
1162
1163    /**
1164     * @param value {@link #subject} (The patient who will use the device.)
1165     */
1166    public DeviceRequest setSubject(Reference value) { 
1167      this.subject = value;
1168      return this;
1169    }
1170
1171    /**
1172     * @return {@link #encounter} (An encounter that provides additional context in which this request is made.)
1173     */
1174    public Reference getEncounter() { 
1175      if (this.encounter == null)
1176        if (Configuration.errorOnAutoCreate())
1177          throw new Error("Attempt to auto-create DeviceRequest.encounter");
1178        else if (Configuration.doAutoCreate())
1179          this.encounter = new Reference(); // cc
1180      return this.encounter;
1181    }
1182
1183    public boolean hasEncounter() { 
1184      return this.encounter != null && !this.encounter.isEmpty();
1185    }
1186
1187    /**
1188     * @param value {@link #encounter} (An encounter that provides additional context in which this request is made.)
1189     */
1190    public DeviceRequest setEncounter(Reference value) { 
1191      this.encounter = value;
1192      return this;
1193    }
1194
1195    /**
1196     * @return {@link #occurrence} (The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".)
1197     */
1198    public DataType getOccurrence() { 
1199      return this.occurrence;
1200    }
1201
1202    /**
1203     * @return {@link #occurrence} (The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".)
1204     */
1205    public DateTimeType getOccurrenceDateTimeType() throws FHIRException { 
1206      if (this.occurrence == null)
1207        this.occurrence = new DateTimeType();
1208      if (!(this.occurrence instanceof DateTimeType))
1209        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1210      return (DateTimeType) this.occurrence;
1211    }
1212
1213    public boolean hasOccurrenceDateTimeType() { 
1214      return this != null && this.occurrence instanceof DateTimeType;
1215    }
1216
1217    /**
1218     * @return {@link #occurrence} (The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".)
1219     */
1220    public Period getOccurrencePeriod() throws FHIRException { 
1221      if (this.occurrence == null)
1222        this.occurrence = new Period();
1223      if (!(this.occurrence instanceof Period))
1224        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1225      return (Period) this.occurrence;
1226    }
1227
1228    public boolean hasOccurrencePeriod() { 
1229      return this != null && this.occurrence instanceof Period;
1230    }
1231
1232    /**
1233     * @return {@link #occurrence} (The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".)
1234     */
1235    public Timing getOccurrenceTiming() throws FHIRException { 
1236      if (this.occurrence == null)
1237        this.occurrence = new Timing();
1238      if (!(this.occurrence instanceof Timing))
1239        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1240      return (Timing) this.occurrence;
1241    }
1242
1243    public boolean hasOccurrenceTiming() { 
1244      return this != null && this.occurrence instanceof Timing;
1245    }
1246
1247    public boolean hasOccurrence() { 
1248      return this.occurrence != null && !this.occurrence.isEmpty();
1249    }
1250
1251    /**
1252     * @param value {@link #occurrence} (The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013".)
1253     */
1254    public DeviceRequest setOccurrence(DataType value) { 
1255      if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof Timing))
1256        throw new Error("Not the right type for DeviceRequest.occurrence[x]: "+value.fhirType());
1257      this.occurrence = value;
1258      return this;
1259    }
1260
1261    /**
1262     * @return {@link #authoredOn} (When the request transitioned to being actionable.). This is the underlying object with id, value and extensions. The accessor "getAuthoredOn" gives direct access to the value
1263     */
1264    public DateTimeType getAuthoredOnElement() { 
1265      if (this.authoredOn == null)
1266        if (Configuration.errorOnAutoCreate())
1267          throw new Error("Attempt to auto-create DeviceRequest.authoredOn");
1268        else if (Configuration.doAutoCreate())
1269          this.authoredOn = new DateTimeType(); // bb
1270      return this.authoredOn;
1271    }
1272
1273    public boolean hasAuthoredOnElement() { 
1274      return this.authoredOn != null && !this.authoredOn.isEmpty();
1275    }
1276
1277    public boolean hasAuthoredOn() { 
1278      return this.authoredOn != null && !this.authoredOn.isEmpty();
1279    }
1280
1281    /**
1282     * @param value {@link #authoredOn} (When the request transitioned to being actionable.). This is the underlying object with id, value and extensions. The accessor "getAuthoredOn" gives direct access to the value
1283     */
1284    public DeviceRequest setAuthoredOnElement(DateTimeType value) { 
1285      this.authoredOn = value;
1286      return this;
1287    }
1288
1289    /**
1290     * @return When the request transitioned to being actionable.
1291     */
1292    public Date getAuthoredOn() { 
1293      return this.authoredOn == null ? null : this.authoredOn.getValue();
1294    }
1295
1296    /**
1297     * @param value When the request transitioned to being actionable.
1298     */
1299    public DeviceRequest setAuthoredOn(Date value) { 
1300      if (value == null)
1301        this.authoredOn = null;
1302      else {
1303        if (this.authoredOn == null)
1304          this.authoredOn = new DateTimeType();
1305        this.authoredOn.setValue(value);
1306      }
1307      return this;
1308    }
1309
1310    /**
1311     * @return {@link #requester} (The individual or entity who initiated the request and has responsibility for its activation.)
1312     */
1313    public Reference getRequester() { 
1314      if (this.requester == null)
1315        if (Configuration.errorOnAutoCreate())
1316          throw new Error("Attempt to auto-create DeviceRequest.requester");
1317        else if (Configuration.doAutoCreate())
1318          this.requester = new Reference(); // cc
1319      return this.requester;
1320    }
1321
1322    public boolean hasRequester() { 
1323      return this.requester != null && !this.requester.isEmpty();
1324    }
1325
1326    /**
1327     * @param value {@link #requester} (The individual or entity who initiated the request and has responsibility for its activation.)
1328     */
1329    public DeviceRequest setRequester(Reference value) { 
1330      this.requester = value;
1331      return this;
1332    }
1333
1334    /**
1335     * @return {@link #performerType} (The desired kind of individual or entity to provide the device to the subject of the request (e.g., patient, location).)
1336     */
1337    public CodeableConcept getPerformerType() { 
1338      if (this.performerType == null)
1339        if (Configuration.errorOnAutoCreate())
1340          throw new Error("Attempt to auto-create DeviceRequest.performerType");
1341        else if (Configuration.doAutoCreate())
1342          this.performerType = new CodeableConcept(); // cc
1343      return this.performerType;
1344    }
1345
1346    public boolean hasPerformerType() { 
1347      return this.performerType != null && !this.performerType.isEmpty();
1348    }
1349
1350    /**
1351     * @param value {@link #performerType} (The desired kind of individual or entity to provide the device to the subject of the request (e.g., patient, location).)
1352     */
1353    public DeviceRequest setPerformerType(CodeableConcept value) { 
1354      this.performerType = value;
1355      return this;
1356    }
1357
1358    /**
1359     * @return {@link #performer} (The desired individual or entity to provide the device to the subject of the request (e.g., patient, location).)
1360     */
1361    public Reference getPerformer() { 
1362      if (this.performer == null)
1363        if (Configuration.errorOnAutoCreate())
1364          throw new Error("Attempt to auto-create DeviceRequest.performer");
1365        else if (Configuration.doAutoCreate())
1366          this.performer = new Reference(); // cc
1367      return this.performer;
1368    }
1369
1370    public boolean hasPerformer() { 
1371      return this.performer != null && !this.performer.isEmpty();
1372    }
1373
1374    /**
1375     * @param value {@link #performer} (The desired individual or entity to provide the device to the subject of the request (e.g., patient, location).)
1376     */
1377    public DeviceRequest setPerformer(Reference value) { 
1378      this.performer = value;
1379      return this;
1380    }
1381
1382    /**
1383     * @return {@link #reason} (Reason or justification for the use of this device.)
1384     */
1385    public List<CodeableReference> getReason() { 
1386      if (this.reason == null)
1387        this.reason = new ArrayList<CodeableReference>();
1388      return this.reason;
1389    }
1390
1391    /**
1392     * @return Returns a reference to <code>this</code> for easy method chaining
1393     */
1394    public DeviceRequest setReason(List<CodeableReference> theReason) { 
1395      this.reason = theReason;
1396      return this;
1397    }
1398
1399    public boolean hasReason() { 
1400      if (this.reason == null)
1401        return false;
1402      for (CodeableReference item : this.reason)
1403        if (!item.isEmpty())
1404          return true;
1405      return false;
1406    }
1407
1408    public CodeableReference addReason() { //3
1409      CodeableReference t = new CodeableReference();
1410      if (this.reason == null)
1411        this.reason = new ArrayList<CodeableReference>();
1412      this.reason.add(t);
1413      return t;
1414    }
1415
1416    public DeviceRequest addReason(CodeableReference t) { //3
1417      if (t == null)
1418        return this;
1419      if (this.reason == null)
1420        this.reason = new ArrayList<CodeableReference>();
1421      this.reason.add(t);
1422      return this;
1423    }
1424
1425    /**
1426     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
1427     */
1428    public CodeableReference getReasonFirstRep() { 
1429      if (getReason().isEmpty()) {
1430        addReason();
1431      }
1432      return getReason().get(0);
1433    }
1434
1435    /**
1436     * @return {@link #insurance} (Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.)
1437     */
1438    public List<Reference> getInsurance() { 
1439      if (this.insurance == null)
1440        this.insurance = new ArrayList<Reference>();
1441      return this.insurance;
1442    }
1443
1444    /**
1445     * @return Returns a reference to <code>this</code> for easy method chaining
1446     */
1447    public DeviceRequest setInsurance(List<Reference> theInsurance) { 
1448      this.insurance = theInsurance;
1449      return this;
1450    }
1451
1452    public boolean hasInsurance() { 
1453      if (this.insurance == null)
1454        return false;
1455      for (Reference item : this.insurance)
1456        if (!item.isEmpty())
1457          return true;
1458      return false;
1459    }
1460
1461    public Reference addInsurance() { //3
1462      Reference t = new Reference();
1463      if (this.insurance == null)
1464        this.insurance = new ArrayList<Reference>();
1465      this.insurance.add(t);
1466      return t;
1467    }
1468
1469    public DeviceRequest addInsurance(Reference t) { //3
1470      if (t == null)
1471        return this;
1472      if (this.insurance == null)
1473        this.insurance = new ArrayList<Reference>();
1474      this.insurance.add(t);
1475      return this;
1476    }
1477
1478    /**
1479     * @return The first repetition of repeating field {@link #insurance}, creating it if it does not already exist {3}
1480     */
1481    public Reference getInsuranceFirstRep() { 
1482      if (getInsurance().isEmpty()) {
1483        addInsurance();
1484      }
1485      return getInsurance().get(0);
1486    }
1487
1488    /**
1489     * @return {@link #supportingInfo} (Additional clinical information about the patient that may influence the request fulfilment.  For example, this may include where on the subject's body the device will be used (i.e. the target site).)
1490     */
1491    public List<Reference> getSupportingInfo() { 
1492      if (this.supportingInfo == null)
1493        this.supportingInfo = new ArrayList<Reference>();
1494      return this.supportingInfo;
1495    }
1496
1497    /**
1498     * @return Returns a reference to <code>this</code> for easy method chaining
1499     */
1500    public DeviceRequest setSupportingInfo(List<Reference> theSupportingInfo) { 
1501      this.supportingInfo = theSupportingInfo;
1502      return this;
1503    }
1504
1505    public boolean hasSupportingInfo() { 
1506      if (this.supportingInfo == null)
1507        return false;
1508      for (Reference item : this.supportingInfo)
1509        if (!item.isEmpty())
1510          return true;
1511      return false;
1512    }
1513
1514    public Reference addSupportingInfo() { //3
1515      Reference t = new Reference();
1516      if (this.supportingInfo == null)
1517        this.supportingInfo = new ArrayList<Reference>();
1518      this.supportingInfo.add(t);
1519      return t;
1520    }
1521
1522    public DeviceRequest addSupportingInfo(Reference t) { //3
1523      if (t == null)
1524        return this;
1525      if (this.supportingInfo == null)
1526        this.supportingInfo = new ArrayList<Reference>();
1527      this.supportingInfo.add(t);
1528      return this;
1529    }
1530
1531    /**
1532     * @return The first repetition of repeating field {@link #supportingInfo}, creating it if it does not already exist {3}
1533     */
1534    public Reference getSupportingInfoFirstRep() { 
1535      if (getSupportingInfo().isEmpty()) {
1536        addSupportingInfo();
1537      }
1538      return getSupportingInfo().get(0);
1539    }
1540
1541    /**
1542     * @return {@link #note} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.)
1543     */
1544    public List<Annotation> getNote() { 
1545      if (this.note == null)
1546        this.note = new ArrayList<Annotation>();
1547      return this.note;
1548    }
1549
1550    /**
1551     * @return Returns a reference to <code>this</code> for easy method chaining
1552     */
1553    public DeviceRequest setNote(List<Annotation> theNote) { 
1554      this.note = theNote;
1555      return this;
1556    }
1557
1558    public boolean hasNote() { 
1559      if (this.note == null)
1560        return false;
1561      for (Annotation item : this.note)
1562        if (!item.isEmpty())
1563          return true;
1564      return false;
1565    }
1566
1567    public Annotation addNote() { //3
1568      Annotation t = new Annotation();
1569      if (this.note == null)
1570        this.note = new ArrayList<Annotation>();
1571      this.note.add(t);
1572      return t;
1573    }
1574
1575    public DeviceRequest addNote(Annotation t) { //3
1576      if (t == null)
1577        return this;
1578      if (this.note == null)
1579        this.note = new ArrayList<Annotation>();
1580      this.note.add(t);
1581      return this;
1582    }
1583
1584    /**
1585     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
1586     */
1587    public Annotation getNoteFirstRep() { 
1588      if (getNote().isEmpty()) {
1589        addNote();
1590      }
1591      return getNote().get(0);
1592    }
1593
1594    /**
1595     * @return {@link #relevantHistory} (Key events in the history of the request.)
1596     */
1597    public List<Reference> getRelevantHistory() { 
1598      if (this.relevantHistory == null)
1599        this.relevantHistory = new ArrayList<Reference>();
1600      return this.relevantHistory;
1601    }
1602
1603    /**
1604     * @return Returns a reference to <code>this</code> for easy method chaining
1605     */
1606    public DeviceRequest setRelevantHistory(List<Reference> theRelevantHistory) { 
1607      this.relevantHistory = theRelevantHistory;
1608      return this;
1609    }
1610
1611    public boolean hasRelevantHistory() { 
1612      if (this.relevantHistory == null)
1613        return false;
1614      for (Reference item : this.relevantHistory)
1615        if (!item.isEmpty())
1616          return true;
1617      return false;
1618    }
1619
1620    public Reference addRelevantHistory() { //3
1621      Reference t = new Reference();
1622      if (this.relevantHistory == null)
1623        this.relevantHistory = new ArrayList<Reference>();
1624      this.relevantHistory.add(t);
1625      return t;
1626    }
1627
1628    public DeviceRequest addRelevantHistory(Reference t) { //3
1629      if (t == null)
1630        return this;
1631      if (this.relevantHistory == null)
1632        this.relevantHistory = new ArrayList<Reference>();
1633      this.relevantHistory.add(t);
1634      return this;
1635    }
1636
1637    /**
1638     * @return The first repetition of repeating field {@link #relevantHistory}, creating it if it does not already exist {3}
1639     */
1640    public Reference getRelevantHistoryFirstRep() { 
1641      if (getRelevantHistory().isEmpty()) {
1642        addRelevantHistory();
1643      }
1644      return getRelevantHistory().get(0);
1645    }
1646
1647      protected void listChildren(List<Property> children) {
1648        super.listChildren(children);
1649        children.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier));
1650        children.add(new Property("instantiatesCanonical", "canonical(ActivityDefinition|PlanDefinition)", "The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.", 0, java.lang.Integer.MAX_VALUE, instantiatesCanonical));
1651        children.add(new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.", 0, java.lang.Integer.MAX_VALUE, instantiatesUri));
1652        children.add(new Property("basedOn", "Reference(Any)", "Plan/proposal/order fulfilled by this request.", 0, java.lang.Integer.MAX_VALUE, basedOn));
1653        children.add(new Property("priorRequest", "Reference(DeviceRequest)", "The request takes the place of the referenced completed or terminated request(s).", 0, java.lang.Integer.MAX_VALUE, priorRequest));
1654        children.add(new Property("groupIdentifier", "Identifier", "Composite request this is part of.", 0, 1, groupIdentifier));
1655        children.add(new Property("status", "code", "The status of the request.", 0, 1, status));
1656        children.add(new Property("intent", "code", "Whether the request is a proposal, plan, an original order or a reflex order.", 0, 1, intent));
1657        children.add(new Property("priority", "code", "Indicates how quickly the request should be addressed with respect to other requests.", 0, 1, priority));
1658        children.add(new Property("doNotPerform", "boolean", "If true, indicates that the provider is asking for the patient to either stop using or to not start using the specified device or category of devices. For example, the patient has undergone surgery and the provider is indicating that the patient should not wear contact lenses.", 0, 1, doNotPerform));
1659        children.add(new Property("code", "CodeableReference(Device|DeviceDefinition)", "The details of the device to be used.", 0, 1, code));
1660        children.add(new Property("quantity", "integer", "The number of devices to be provided.", 0, 1, quantity));
1661        children.add(new Property("parameter", "", "Specific parameters for the ordered item.  For example, the prism value for lenses.", 0, java.lang.Integer.MAX_VALUE, parameter));
1662        children.add(new Property("subject", "Reference(Patient|Group|Location|Device)", "The patient who will use the device.", 0, 1, subject));
1663        children.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional context in which this request is made.", 0, 1, encounter));
1664        children.add(new Property("occurrence[x]", "dateTime|Period|Timing", "The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".", 0, 1, occurrence));
1665        children.add(new Property("authoredOn", "dateTime", "When the request transitioned to being actionable.", 0, 1, authoredOn));
1666        children.add(new Property("requester", "Reference(Device|Practitioner|PractitionerRole|Organization)", "The individual or entity who initiated the request and has responsibility for its activation.", 0, 1, requester));
1667        children.add(new Property("performerType", "CodeableConcept", "The desired kind of individual or entity to provide the device to the subject of the request (e.g., patient, location).", 0, 1, performerType));
1668        children.add(new Property("performer", "Reference(Practitioner|PractitionerRole|Organization|CareTeam|HealthcareService|Patient|Device|RelatedPerson)", "The desired individual or entity to provide the device to the subject of the request (e.g., patient, location).", 0, 1, performer));
1669        children.add(new Property("reason", "CodeableReference(Condition|Observation|DiagnosticReport|DocumentReference)", "Reason or justification for the use of this device.", 0, java.lang.Integer.MAX_VALUE, reason));
1670        children.add(new Property("insurance", "Reference(Coverage|ClaimResponse)", "Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.", 0, java.lang.Integer.MAX_VALUE, insurance));
1671        children.add(new Property("supportingInfo", "Reference(Any)", "Additional clinical information about the patient that may influence the request fulfilment.  For example, this may include where on the subject's body the device will be used (i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, supportingInfo));
1672        children.add(new Property("note", "Annotation", "Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, note));
1673        children.add(new Property("relevantHistory", "Reference(Provenance)", "Key events in the history of the request.", 0, java.lang.Integer.MAX_VALUE, relevantHistory));
1674      }
1675
1676      @Override
1677      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1678        switch (_hash) {
1679        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier);
1680        case 8911915: /*instantiatesCanonical*/  return new Property("instantiatesCanonical", "canonical(ActivityDefinition|PlanDefinition)", "The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.", 0, java.lang.Integer.MAX_VALUE, instantiatesCanonical);
1681        case -1926393373: /*instantiatesUri*/  return new Property("instantiatesUri", "uri", "The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.", 0, java.lang.Integer.MAX_VALUE, instantiatesUri);
1682        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(Any)", "Plan/proposal/order fulfilled by this request.", 0, java.lang.Integer.MAX_VALUE, basedOn);
1683        case 237568101: /*priorRequest*/  return new Property("priorRequest", "Reference(DeviceRequest)", "The request takes the place of the referenced completed or terminated request(s).", 0, java.lang.Integer.MAX_VALUE, priorRequest);
1684        case -445338488: /*groupIdentifier*/  return new Property("groupIdentifier", "Identifier", "Composite request this is part of.", 0, 1, groupIdentifier);
1685        case -892481550: /*status*/  return new Property("status", "code", "The status of the request.", 0, 1, status);
1686        case -1183762788: /*intent*/  return new Property("intent", "code", "Whether the request is a proposal, plan, an original order or a reflex order.", 0, 1, intent);
1687        case -1165461084: /*priority*/  return new Property("priority", "code", "Indicates how quickly the request should be addressed with respect to other requests.", 0, 1, priority);
1688        case -1788508167: /*doNotPerform*/  return new Property("doNotPerform", "boolean", "If true, indicates that the provider is asking for the patient to either stop using or to not start using the specified device or category of devices. For example, the patient has undergone surgery and the provider is indicating that the patient should not wear contact lenses.", 0, 1, doNotPerform);
1689        case 3059181: /*code*/  return new Property("code", "CodeableReference(Device|DeviceDefinition)", "The details of the device to be used.", 0, 1, code);
1690        case -1285004149: /*quantity*/  return new Property("quantity", "integer", "The number of devices to be provided.", 0, 1, quantity);
1691        case 1954460585: /*parameter*/  return new Property("parameter", "", "Specific parameters for the ordered item.  For example, the prism value for lenses.", 0, java.lang.Integer.MAX_VALUE, parameter);
1692        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Location|Device)", "The patient who will use the device.", 0, 1, subject);
1693        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "An encounter that provides additional context in which this request is made.", 0, 1, encounter);
1694        case -2022646513: /*occurrence[x]*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".", 0, 1, occurrence);
1695        case 1687874001: /*occurrence*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".", 0, 1, occurrence);
1696        case -298443636: /*occurrenceDateTime*/  return new Property("occurrence[x]", "dateTime", "The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".", 0, 1, occurrence);
1697        case 1397156594: /*occurrencePeriod*/  return new Property("occurrence[x]", "Period", "The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".", 0, 1, occurrence);
1698        case 1515218299: /*occurrenceTiming*/  return new Property("occurrence[x]", "Timing", "The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".", 0, 1, occurrence);
1699        case -1500852503: /*authoredOn*/  return new Property("authoredOn", "dateTime", "When the request transitioned to being actionable.", 0, 1, authoredOn);
1700        case 693933948: /*requester*/  return new Property("requester", "Reference(Device|Practitioner|PractitionerRole|Organization)", "The individual or entity who initiated the request and has responsibility for its activation.", 0, 1, requester);
1701        case -901444568: /*performerType*/  return new Property("performerType", "CodeableConcept", "The desired kind of individual or entity to provide the device to the subject of the request (e.g., patient, location).", 0, 1, performerType);
1702        case 481140686: /*performer*/  return new Property("performer", "Reference(Practitioner|PractitionerRole|Organization|CareTeam|HealthcareService|Patient|Device|RelatedPerson)", "The desired individual or entity to provide the device to the subject of the request (e.g., patient, location).", 0, 1, performer);
1703        case -934964668: /*reason*/  return new Property("reason", "CodeableReference(Condition|Observation|DiagnosticReport|DocumentReference)", "Reason or justification for the use of this device.", 0, java.lang.Integer.MAX_VALUE, reason);
1704        case 73049818: /*insurance*/  return new Property("insurance", "Reference(Coverage|ClaimResponse)", "Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.", 0, java.lang.Integer.MAX_VALUE, insurance);
1705        case 1922406657: /*supportingInfo*/  return new Property("supportingInfo", "Reference(Any)", "Additional clinical information about the patient that may influence the request fulfilment.  For example, this may include where on the subject's body the device will be used (i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, supportingInfo);
1706        case 3387378: /*note*/  return new Property("note", "Annotation", "Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, note);
1707        case 1538891575: /*relevantHistory*/  return new Property("relevantHistory", "Reference(Provenance)", "Key events in the history of the request.", 0, java.lang.Integer.MAX_VALUE, relevantHistory);
1708        default: return super.getNamedProperty(_hash, _name, _checkValid);
1709        }
1710
1711      }
1712
1713      @Override
1714      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1715        switch (hash) {
1716        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1717        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : this.instantiatesCanonical.toArray(new Base[this.instantiatesCanonical.size()]); // CanonicalType
1718        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : this.instantiatesUri.toArray(new Base[this.instantiatesUri.size()]); // UriType
1719        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
1720        case 237568101: /*priorRequest*/ return this.priorRequest == null ? new Base[0] : this.priorRequest.toArray(new Base[this.priorRequest.size()]); // Reference
1721        case -445338488: /*groupIdentifier*/ return this.groupIdentifier == null ? new Base[0] : new Base[] {this.groupIdentifier}; // Identifier
1722        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<RequestStatus>
1723        case -1183762788: /*intent*/ return this.intent == null ? new Base[0] : new Base[] {this.intent}; // Enumeration<RequestIntent>
1724        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration<RequestPriority>
1725        case -1788508167: /*doNotPerform*/ return this.doNotPerform == null ? new Base[0] : new Base[] {this.doNotPerform}; // BooleanType
1726        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableReference
1727        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // IntegerType
1728        case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // DeviceRequestParameterComponent
1729        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1730        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
1731        case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // DataType
1732        case -1500852503: /*authoredOn*/ return this.authoredOn == null ? new Base[0] : new Base[] {this.authoredOn}; // DateTimeType
1733        case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference
1734        case -901444568: /*performerType*/ return this.performerType == null ? new Base[0] : new Base[] {this.performerType}; // CodeableConcept
1735        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference
1736        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableReference
1737        case 73049818: /*insurance*/ return this.insurance == null ? new Base[0] : this.insurance.toArray(new Base[this.insurance.size()]); // Reference
1738        case 1922406657: /*supportingInfo*/ return this.supportingInfo == null ? new Base[0] : this.supportingInfo.toArray(new Base[this.supportingInfo.size()]); // Reference
1739        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1740        case 1538891575: /*relevantHistory*/ return this.relevantHistory == null ? new Base[0] : this.relevantHistory.toArray(new Base[this.relevantHistory.size()]); // Reference
1741        default: return super.getProperty(hash, name, checkValid);
1742        }
1743
1744      }
1745
1746      @Override
1747      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1748        switch (hash) {
1749        case -1618432855: // identifier
1750          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1751          return value;
1752        case 8911915: // instantiatesCanonical
1753          this.getInstantiatesCanonical().add(TypeConvertor.castToCanonical(value)); // CanonicalType
1754          return value;
1755        case -1926393373: // instantiatesUri
1756          this.getInstantiatesUri().add(TypeConvertor.castToUri(value)); // UriType
1757          return value;
1758        case -332612366: // basedOn
1759          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
1760          return value;
1761        case 237568101: // priorRequest
1762          this.getPriorRequest().add(TypeConvertor.castToReference(value)); // Reference
1763          return value;
1764        case -445338488: // groupIdentifier
1765          this.groupIdentifier = TypeConvertor.castToIdentifier(value); // Identifier
1766          return value;
1767        case -892481550: // status
1768          value = new RequestStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1769          this.status = (Enumeration) value; // Enumeration<RequestStatus>
1770          return value;
1771        case -1183762788: // intent
1772          value = new RequestIntentEnumFactory().fromType(TypeConvertor.castToCode(value));
1773          this.intent = (Enumeration) value; // Enumeration<RequestIntent>
1774          return value;
1775        case -1165461084: // priority
1776          value = new RequestPriorityEnumFactory().fromType(TypeConvertor.castToCode(value));
1777          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
1778          return value;
1779        case -1788508167: // doNotPerform
1780          this.doNotPerform = TypeConvertor.castToBoolean(value); // BooleanType
1781          return value;
1782        case 3059181: // code
1783          this.code = TypeConvertor.castToCodeableReference(value); // CodeableReference
1784          return value;
1785        case -1285004149: // quantity
1786          this.quantity = TypeConvertor.castToInteger(value); // IntegerType
1787          return value;
1788        case 1954460585: // parameter
1789          this.getParameter().add((DeviceRequestParameterComponent) value); // DeviceRequestParameterComponent
1790          return value;
1791        case -1867885268: // subject
1792          this.subject = TypeConvertor.castToReference(value); // Reference
1793          return value;
1794        case 1524132147: // encounter
1795          this.encounter = TypeConvertor.castToReference(value); // Reference
1796          return value;
1797        case 1687874001: // occurrence
1798          this.occurrence = TypeConvertor.castToType(value); // DataType
1799          return value;
1800        case -1500852503: // authoredOn
1801          this.authoredOn = TypeConvertor.castToDateTime(value); // DateTimeType
1802          return value;
1803        case 693933948: // requester
1804          this.requester = TypeConvertor.castToReference(value); // Reference
1805          return value;
1806        case -901444568: // performerType
1807          this.performerType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1808          return value;
1809        case 481140686: // performer
1810          this.performer = TypeConvertor.castToReference(value); // Reference
1811          return value;
1812        case -934964668: // reason
1813          this.getReason().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
1814          return value;
1815        case 73049818: // insurance
1816          this.getInsurance().add(TypeConvertor.castToReference(value)); // Reference
1817          return value;
1818        case 1922406657: // supportingInfo
1819          this.getSupportingInfo().add(TypeConvertor.castToReference(value)); // Reference
1820          return value;
1821        case 3387378: // note
1822          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
1823          return value;
1824        case 1538891575: // relevantHistory
1825          this.getRelevantHistory().add(TypeConvertor.castToReference(value)); // Reference
1826          return value;
1827        default: return super.setProperty(hash, name, value);
1828        }
1829
1830      }
1831
1832      @Override
1833      public Base setProperty(String name, Base value) throws FHIRException {
1834        if (name.equals("identifier")) {
1835          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1836        } else if (name.equals("instantiatesCanonical")) {
1837          this.getInstantiatesCanonical().add(TypeConvertor.castToCanonical(value));
1838        } else if (name.equals("instantiatesUri")) {
1839          this.getInstantiatesUri().add(TypeConvertor.castToUri(value));
1840        } else if (name.equals("basedOn")) {
1841          this.getBasedOn().add(TypeConvertor.castToReference(value));
1842        } else if (name.equals("priorRequest")) {
1843          this.getPriorRequest().add(TypeConvertor.castToReference(value));
1844        } else if (name.equals("groupIdentifier")) {
1845          this.groupIdentifier = TypeConvertor.castToIdentifier(value); // Identifier
1846        } else if (name.equals("status")) {
1847          value = new RequestStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1848          this.status = (Enumeration) value; // Enumeration<RequestStatus>
1849        } else if (name.equals("intent")) {
1850          value = new RequestIntentEnumFactory().fromType(TypeConvertor.castToCode(value));
1851          this.intent = (Enumeration) value; // Enumeration<RequestIntent>
1852        } else if (name.equals("priority")) {
1853          value = new RequestPriorityEnumFactory().fromType(TypeConvertor.castToCode(value));
1854          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
1855        } else if (name.equals("doNotPerform")) {
1856          this.doNotPerform = TypeConvertor.castToBoolean(value); // BooleanType
1857        } else if (name.equals("code")) {
1858          this.code = TypeConvertor.castToCodeableReference(value); // CodeableReference
1859        } else if (name.equals("quantity")) {
1860          this.quantity = TypeConvertor.castToInteger(value); // IntegerType
1861        } else if (name.equals("parameter")) {
1862          this.getParameter().add((DeviceRequestParameterComponent) value);
1863        } else if (name.equals("subject")) {
1864          this.subject = TypeConvertor.castToReference(value); // Reference
1865        } else if (name.equals("encounter")) {
1866          this.encounter = TypeConvertor.castToReference(value); // Reference
1867        } else if (name.equals("occurrence[x]")) {
1868          this.occurrence = TypeConvertor.castToType(value); // DataType
1869        } else if (name.equals("authoredOn")) {
1870          this.authoredOn = TypeConvertor.castToDateTime(value); // DateTimeType
1871        } else if (name.equals("requester")) {
1872          this.requester = TypeConvertor.castToReference(value); // Reference
1873        } else if (name.equals("performerType")) {
1874          this.performerType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1875        } else if (name.equals("performer")) {
1876          this.performer = TypeConvertor.castToReference(value); // Reference
1877        } else if (name.equals("reason")) {
1878          this.getReason().add(TypeConvertor.castToCodeableReference(value));
1879        } else if (name.equals("insurance")) {
1880          this.getInsurance().add(TypeConvertor.castToReference(value));
1881        } else if (name.equals("supportingInfo")) {
1882          this.getSupportingInfo().add(TypeConvertor.castToReference(value));
1883        } else if (name.equals("note")) {
1884          this.getNote().add(TypeConvertor.castToAnnotation(value));
1885        } else if (name.equals("relevantHistory")) {
1886          this.getRelevantHistory().add(TypeConvertor.castToReference(value));
1887        } else
1888          return super.setProperty(name, value);
1889        return value;
1890      }
1891
1892      @Override
1893      public Base makeProperty(int hash, String name) throws FHIRException {
1894        switch (hash) {
1895        case -1618432855:  return addIdentifier(); 
1896        case 8911915:  return addInstantiatesCanonicalElement();
1897        case -1926393373:  return addInstantiatesUriElement();
1898        case -332612366:  return addBasedOn(); 
1899        case 237568101:  return addPriorRequest(); 
1900        case -445338488:  return getGroupIdentifier();
1901        case -892481550:  return getStatusElement();
1902        case -1183762788:  return getIntentElement();
1903        case -1165461084:  return getPriorityElement();
1904        case -1788508167:  return getDoNotPerformElement();
1905        case 3059181:  return getCode();
1906        case -1285004149:  return getQuantityElement();
1907        case 1954460585:  return addParameter(); 
1908        case -1867885268:  return getSubject();
1909        case 1524132147:  return getEncounter();
1910        case -2022646513:  return getOccurrence();
1911        case 1687874001:  return getOccurrence();
1912        case -1500852503:  return getAuthoredOnElement();
1913        case 693933948:  return getRequester();
1914        case -901444568:  return getPerformerType();
1915        case 481140686:  return getPerformer();
1916        case -934964668:  return addReason(); 
1917        case 73049818:  return addInsurance(); 
1918        case 1922406657:  return addSupportingInfo(); 
1919        case 3387378:  return addNote(); 
1920        case 1538891575:  return addRelevantHistory(); 
1921        default: return super.makeProperty(hash, name);
1922        }
1923
1924      }
1925
1926      @Override
1927      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1928        switch (hash) {
1929        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1930        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
1931        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
1932        case -332612366: /*basedOn*/ return new String[] {"Reference"};
1933        case 237568101: /*priorRequest*/ return new String[] {"Reference"};
1934        case -445338488: /*groupIdentifier*/ return new String[] {"Identifier"};
1935        case -892481550: /*status*/ return new String[] {"code"};
1936        case -1183762788: /*intent*/ return new String[] {"code"};
1937        case -1165461084: /*priority*/ return new String[] {"code"};
1938        case -1788508167: /*doNotPerform*/ return new String[] {"boolean"};
1939        case 3059181: /*code*/ return new String[] {"CodeableReference"};
1940        case -1285004149: /*quantity*/ return new String[] {"integer"};
1941        case 1954460585: /*parameter*/ return new String[] {};
1942        case -1867885268: /*subject*/ return new String[] {"Reference"};
1943        case 1524132147: /*encounter*/ return new String[] {"Reference"};
1944        case 1687874001: /*occurrence*/ return new String[] {"dateTime", "Period", "Timing"};
1945        case -1500852503: /*authoredOn*/ return new String[] {"dateTime"};
1946        case 693933948: /*requester*/ return new String[] {"Reference"};
1947        case -901444568: /*performerType*/ return new String[] {"CodeableConcept"};
1948        case 481140686: /*performer*/ return new String[] {"Reference"};
1949        case -934964668: /*reason*/ return new String[] {"CodeableReference"};
1950        case 73049818: /*insurance*/ return new String[] {"Reference"};
1951        case 1922406657: /*supportingInfo*/ return new String[] {"Reference"};
1952        case 3387378: /*note*/ return new String[] {"Annotation"};
1953        case 1538891575: /*relevantHistory*/ return new String[] {"Reference"};
1954        default: return super.getTypesForProperty(hash, name);
1955        }
1956
1957      }
1958
1959      @Override
1960      public Base addChild(String name) throws FHIRException {
1961        if (name.equals("identifier")) {
1962          return addIdentifier();
1963        }
1964        else if (name.equals("instantiatesCanonical")) {
1965          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.instantiatesCanonical");
1966        }
1967        else if (name.equals("instantiatesUri")) {
1968          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.instantiatesUri");
1969        }
1970        else if (name.equals("basedOn")) {
1971          return addBasedOn();
1972        }
1973        else if (name.equals("priorRequest")) {
1974          return addPriorRequest();
1975        }
1976        else if (name.equals("groupIdentifier")) {
1977          this.groupIdentifier = new Identifier();
1978          return this.groupIdentifier;
1979        }
1980        else if (name.equals("status")) {
1981          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.status");
1982        }
1983        else if (name.equals("intent")) {
1984          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.intent");
1985        }
1986        else if (name.equals("priority")) {
1987          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.priority");
1988        }
1989        else if (name.equals("doNotPerform")) {
1990          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.doNotPerform");
1991        }
1992        else if (name.equals("code")) {
1993          this.code = new CodeableReference();
1994          return this.code;
1995        }
1996        else if (name.equals("quantity")) {
1997          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.quantity");
1998        }
1999        else if (name.equals("parameter")) {
2000          return addParameter();
2001        }
2002        else if (name.equals("subject")) {
2003          this.subject = new Reference();
2004          return this.subject;
2005        }
2006        else if (name.equals("encounter")) {
2007          this.encounter = new Reference();
2008          return this.encounter;
2009        }
2010        else if (name.equals("occurrenceDateTime")) {
2011          this.occurrence = new DateTimeType();
2012          return this.occurrence;
2013        }
2014        else if (name.equals("occurrencePeriod")) {
2015          this.occurrence = new Period();
2016          return this.occurrence;
2017        }
2018        else if (name.equals("occurrenceTiming")) {
2019          this.occurrence = new Timing();
2020          return this.occurrence;
2021        }
2022        else if (name.equals("authoredOn")) {
2023          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.authoredOn");
2024        }
2025        else if (name.equals("requester")) {
2026          this.requester = new Reference();
2027          return this.requester;
2028        }
2029        else if (name.equals("performerType")) {
2030          this.performerType = new CodeableConcept();
2031          return this.performerType;
2032        }
2033        else if (name.equals("performer")) {
2034          this.performer = new Reference();
2035          return this.performer;
2036        }
2037        else if (name.equals("reason")) {
2038          return addReason();
2039        }
2040        else if (name.equals("insurance")) {
2041          return addInsurance();
2042        }
2043        else if (name.equals("supportingInfo")) {
2044          return addSupportingInfo();
2045        }
2046        else if (name.equals("note")) {
2047          return addNote();
2048        }
2049        else if (name.equals("relevantHistory")) {
2050          return addRelevantHistory();
2051        }
2052        else
2053          return super.addChild(name);
2054      }
2055
2056  public String fhirType() {
2057    return "DeviceRequest";
2058
2059  }
2060
2061      public DeviceRequest copy() {
2062        DeviceRequest dst = new DeviceRequest();
2063        copyValues(dst);
2064        return dst;
2065      }
2066
2067      public void copyValues(DeviceRequest dst) {
2068        super.copyValues(dst);
2069        if (identifier != null) {
2070          dst.identifier = new ArrayList<Identifier>();
2071          for (Identifier i : identifier)
2072            dst.identifier.add(i.copy());
2073        };
2074        if (instantiatesCanonical != null) {
2075          dst.instantiatesCanonical = new ArrayList<CanonicalType>();
2076          for (CanonicalType i : instantiatesCanonical)
2077            dst.instantiatesCanonical.add(i.copy());
2078        };
2079        if (instantiatesUri != null) {
2080          dst.instantiatesUri = new ArrayList<UriType>();
2081          for (UriType i : instantiatesUri)
2082            dst.instantiatesUri.add(i.copy());
2083        };
2084        if (basedOn != null) {
2085          dst.basedOn = new ArrayList<Reference>();
2086          for (Reference i : basedOn)
2087            dst.basedOn.add(i.copy());
2088        };
2089        if (priorRequest != null) {
2090          dst.priorRequest = new ArrayList<Reference>();
2091          for (Reference i : priorRequest)
2092            dst.priorRequest.add(i.copy());
2093        };
2094        dst.groupIdentifier = groupIdentifier == null ? null : groupIdentifier.copy();
2095        dst.status = status == null ? null : status.copy();
2096        dst.intent = intent == null ? null : intent.copy();
2097        dst.priority = priority == null ? null : priority.copy();
2098        dst.doNotPerform = doNotPerform == null ? null : doNotPerform.copy();
2099        dst.code = code == null ? null : code.copy();
2100        dst.quantity = quantity == null ? null : quantity.copy();
2101        if (parameter != null) {
2102          dst.parameter = new ArrayList<DeviceRequestParameterComponent>();
2103          for (DeviceRequestParameterComponent i : parameter)
2104            dst.parameter.add(i.copy());
2105        };
2106        dst.subject = subject == null ? null : subject.copy();
2107        dst.encounter = encounter == null ? null : encounter.copy();
2108        dst.occurrence = occurrence == null ? null : occurrence.copy();
2109        dst.authoredOn = authoredOn == null ? null : authoredOn.copy();
2110        dst.requester = requester == null ? null : requester.copy();
2111        dst.performerType = performerType == null ? null : performerType.copy();
2112        dst.performer = performer == null ? null : performer.copy();
2113        if (reason != null) {
2114          dst.reason = new ArrayList<CodeableReference>();
2115          for (CodeableReference i : reason)
2116            dst.reason.add(i.copy());
2117        };
2118        if (insurance != null) {
2119          dst.insurance = new ArrayList<Reference>();
2120          for (Reference i : insurance)
2121            dst.insurance.add(i.copy());
2122        };
2123        if (supportingInfo != null) {
2124          dst.supportingInfo = new ArrayList<Reference>();
2125          for (Reference i : supportingInfo)
2126            dst.supportingInfo.add(i.copy());
2127        };
2128        if (note != null) {
2129          dst.note = new ArrayList<Annotation>();
2130          for (Annotation i : note)
2131            dst.note.add(i.copy());
2132        };
2133        if (relevantHistory != null) {
2134          dst.relevantHistory = new ArrayList<Reference>();
2135          for (Reference i : relevantHistory)
2136            dst.relevantHistory.add(i.copy());
2137        };
2138      }
2139
2140      protected DeviceRequest typedCopy() {
2141        return copy();
2142      }
2143
2144      @Override
2145      public boolean equalsDeep(Base other_) {
2146        if (!super.equalsDeep(other_))
2147          return false;
2148        if (!(other_ instanceof DeviceRequest))
2149          return false;
2150        DeviceRequest o = (DeviceRequest) other_;
2151        return compareDeep(identifier, o.identifier, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
2152           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(basedOn, o.basedOn, true)
2153           && compareDeep(priorRequest, o.priorRequest, true) && compareDeep(groupIdentifier, o.groupIdentifier, true)
2154           && compareDeep(status, o.status, true) && compareDeep(intent, o.intent, true) && compareDeep(priority, o.priority, true)
2155           && compareDeep(doNotPerform, o.doNotPerform, true) && compareDeep(code, o.code, true) && compareDeep(quantity, o.quantity, true)
2156           && compareDeep(parameter, o.parameter, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true)
2157           && compareDeep(occurrence, o.occurrence, true) && compareDeep(authoredOn, o.authoredOn, true) && compareDeep(requester, o.requester, true)
2158           && compareDeep(performerType, o.performerType, true) && compareDeep(performer, o.performer, true)
2159           && compareDeep(reason, o.reason, true) && compareDeep(insurance, o.insurance, true) && compareDeep(supportingInfo, o.supportingInfo, true)
2160           && compareDeep(note, o.note, true) && compareDeep(relevantHistory, o.relevantHistory, true);
2161      }
2162
2163      @Override
2164      public boolean equalsShallow(Base other_) {
2165        if (!super.equalsShallow(other_))
2166          return false;
2167        if (!(other_ instanceof DeviceRequest))
2168          return false;
2169        DeviceRequest o = (DeviceRequest) other_;
2170        return compareValues(instantiatesCanonical, o.instantiatesCanonical, true) && compareValues(instantiatesUri, o.instantiatesUri, true)
2171           && compareValues(status, o.status, true) && compareValues(intent, o.intent, true) && compareValues(priority, o.priority, true)
2172           && compareValues(doNotPerform, o.doNotPerform, true) && compareValues(quantity, o.quantity, true) && compareValues(authoredOn, o.authoredOn, true)
2173          ;
2174      }
2175
2176      public boolean isEmpty() {
2177        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instantiatesCanonical
2178          , instantiatesUri, basedOn, priorRequest, groupIdentifier, status, intent, priority
2179          , doNotPerform, code, quantity, parameter, subject, encounter, occurrence, authoredOn
2180          , requester, performerType, performer, reason, insurance, supportingInfo, note
2181          , relevantHistory);
2182      }
2183
2184  @Override
2185  public ResourceType getResourceType() {
2186    return ResourceType.DeviceRequest;
2187   }
2188
2189 /**
2190   * Search parameter: <b>authored-on</b>
2191   * <p>
2192   * Description: <b>When the request transitioned to being actionable</b><br>
2193   * Type: <b>date</b><br>
2194   * Path: <b>DeviceRequest.authoredOn</b><br>
2195   * </p>
2196   */
2197  @SearchParamDefinition(name="authored-on", path="DeviceRequest.authoredOn", description="When the request transitioned to being actionable", type="date" )
2198  public static final String SP_AUTHORED_ON = "authored-on";
2199 /**
2200   * <b>Fluent Client</b> search parameter constant for <b>authored-on</b>
2201   * <p>
2202   * Description: <b>When the request transitioned to being actionable</b><br>
2203   * Type: <b>date</b><br>
2204   * Path: <b>DeviceRequest.authoredOn</b><br>
2205   * </p>
2206   */
2207  public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORED_ON = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORED_ON);
2208
2209 /**
2210   * Search parameter: <b>based-on</b>
2211   * <p>
2212   * Description: <b>Plan/proposal/order fulfilled by this request</b><br>
2213   * Type: <b>reference</b><br>
2214   * Path: <b>DeviceRequest.basedOn</b><br>
2215   * </p>
2216   */
2217  @SearchParamDefinition(name="based-on", path="DeviceRequest.basedOn", description="Plan/proposal/order fulfilled by this request", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, ArtifactAssessment.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, ConceptMap2.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceDispense.class, DeviceMetric.class, DeviceRequest.class, DeviceUsage.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingSelection.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, InventoryReport.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Permission.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
2218  public static final String SP_BASED_ON = "based-on";
2219 /**
2220   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
2221   * <p>
2222   * Description: <b>Plan/proposal/order fulfilled by this request</b><br>
2223   * Type: <b>reference</b><br>
2224   * Path: <b>DeviceRequest.basedOn</b><br>
2225   * </p>
2226   */
2227  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
2228
2229/**
2230   * Constant for fluent queries to be used to add include statements. Specifies
2231   * the path value of "<b>DeviceRequest:based-on</b>".
2232   */
2233  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("DeviceRequest:based-on").toLocked();
2234
2235 /**
2236   * Search parameter: <b>device</b>
2237   * <p>
2238   * Description: <b>Reference to resource that is being requested/ordered</b><br>
2239   * Type: <b>reference</b><br>
2240   * Path: <b>DeviceRequest.code.reference</b><br>
2241   * </p>
2242   */
2243  @SearchParamDefinition(name="device", path="DeviceRequest.code.reference", description="Reference to resource that is being requested/ordered", type="reference" )
2244  public static final String SP_DEVICE = "device";
2245 /**
2246   * <b>Fluent Client</b> search parameter constant for <b>device</b>
2247   * <p>
2248   * Description: <b>Reference to resource that is being requested/ordered</b><br>
2249   * Type: <b>reference</b><br>
2250   * Path: <b>DeviceRequest.code.reference</b><br>
2251   * </p>
2252   */
2253  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE);
2254
2255/**
2256   * Constant for fluent queries to be used to add include statements. Specifies
2257   * the path value of "<b>DeviceRequest:device</b>".
2258   */
2259  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("DeviceRequest:device").toLocked();
2260
2261 /**
2262   * Search parameter: <b>event-date</b>
2263   * <p>
2264   * Description: <b>When service should occur</b><br>
2265   * Type: <b>date</b><br>
2266   * Path: <b>(DeviceRequest.occurrence as dateTime) | (DeviceRequest.occurrence as Period)</b><br>
2267   * </p>
2268   */
2269  @SearchParamDefinition(name="event-date", path="(DeviceRequest.occurrence as dateTime) | (DeviceRequest.occurrence as Period)", description="When service should occur", type="date" )
2270  public static final String SP_EVENT_DATE = "event-date";
2271 /**
2272   * <b>Fluent Client</b> search parameter constant for <b>event-date</b>
2273   * <p>
2274   * Description: <b>When service should occur</b><br>
2275   * Type: <b>date</b><br>
2276   * Path: <b>(DeviceRequest.occurrence as dateTime) | (DeviceRequest.occurrence as Period)</b><br>
2277   * </p>
2278   */
2279  public static final ca.uhn.fhir.rest.gclient.DateClientParam EVENT_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EVENT_DATE);
2280
2281 /**
2282   * Search parameter: <b>group-identifier</b>
2283   * <p>
2284   * Description: <b>Composite request this is part of</b><br>
2285   * Type: <b>token</b><br>
2286   * Path: <b>DeviceRequest.groupIdentifier</b><br>
2287   * </p>
2288   */
2289  @SearchParamDefinition(name="group-identifier", path="DeviceRequest.groupIdentifier", description="Composite request this is part of", type="token" )
2290  public static final String SP_GROUP_IDENTIFIER = "group-identifier";
2291 /**
2292   * <b>Fluent Client</b> search parameter constant for <b>group-identifier</b>
2293   * <p>
2294   * Description: <b>Composite request this is part of</b><br>
2295   * Type: <b>token</b><br>
2296   * Path: <b>DeviceRequest.groupIdentifier</b><br>
2297   * </p>
2298   */
2299  public static final ca.uhn.fhir.rest.gclient.TokenClientParam GROUP_IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GROUP_IDENTIFIER);
2300
2301 /**
2302   * Search parameter: <b>instantiates-canonical</b>
2303   * <p>
2304   * Description: <b>Instantiates FHIR protocol or definition</b><br>
2305   * Type: <b>reference</b><br>
2306   * Path: <b>DeviceRequest.instantiatesCanonical</b><br>
2307   * </p>
2308   */
2309  @SearchParamDefinition(name="instantiates-canonical", path="DeviceRequest.instantiatesCanonical", description="Instantiates FHIR protocol or definition", type="reference", target={ActivityDefinition.class, PlanDefinition.class } )
2310  public static final String SP_INSTANTIATES_CANONICAL = "instantiates-canonical";
2311 /**
2312   * <b>Fluent Client</b> search parameter constant for <b>instantiates-canonical</b>
2313   * <p>
2314   * Description: <b>Instantiates FHIR protocol or definition</b><br>
2315   * Type: <b>reference</b><br>
2316   * Path: <b>DeviceRequest.instantiatesCanonical</b><br>
2317   * </p>
2318   */
2319  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSTANTIATES_CANONICAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSTANTIATES_CANONICAL);
2320
2321/**
2322   * Constant for fluent queries to be used to add include statements. Specifies
2323   * the path value of "<b>DeviceRequest:instantiates-canonical</b>".
2324   */
2325  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSTANTIATES_CANONICAL = new ca.uhn.fhir.model.api.Include("DeviceRequest:instantiates-canonical").toLocked();
2326
2327 /**
2328   * Search parameter: <b>instantiates-uri</b>
2329   * <p>
2330   * Description: <b>Instantiates external protocol or definition</b><br>
2331   * Type: <b>uri</b><br>
2332   * Path: <b>DeviceRequest.instantiatesUri</b><br>
2333   * </p>
2334   */
2335  @SearchParamDefinition(name="instantiates-uri", path="DeviceRequest.instantiatesUri", description="Instantiates external protocol or definition", type="uri" )
2336  public static final String SP_INSTANTIATES_URI = "instantiates-uri";
2337 /**
2338   * <b>Fluent Client</b> search parameter constant for <b>instantiates-uri</b>
2339   * <p>
2340   * Description: <b>Instantiates external protocol or definition</b><br>
2341   * Type: <b>uri</b><br>
2342   * Path: <b>DeviceRequest.instantiatesUri</b><br>
2343   * </p>
2344   */
2345  public static final ca.uhn.fhir.rest.gclient.UriClientParam INSTANTIATES_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_INSTANTIATES_URI);
2346
2347 /**
2348   * Search parameter: <b>insurance</b>
2349   * <p>
2350   * Description: <b>Associated insurance coverage</b><br>
2351   * Type: <b>reference</b><br>
2352   * Path: <b>DeviceRequest.insurance</b><br>
2353   * </p>
2354   */
2355  @SearchParamDefinition(name="insurance", path="DeviceRequest.insurance", description="Associated insurance coverage", type="reference", target={ClaimResponse.class, Coverage.class } )
2356  public static final String SP_INSURANCE = "insurance";
2357 /**
2358   * <b>Fluent Client</b> search parameter constant for <b>insurance</b>
2359   * <p>
2360   * Description: <b>Associated insurance coverage</b><br>
2361   * Type: <b>reference</b><br>
2362   * Path: <b>DeviceRequest.insurance</b><br>
2363   * </p>
2364   */
2365  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSURANCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSURANCE);
2366
2367/**
2368   * Constant for fluent queries to be used to add include statements. Specifies
2369   * the path value of "<b>DeviceRequest:insurance</b>".
2370   */
2371  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSURANCE = new ca.uhn.fhir.model.api.Include("DeviceRequest:insurance").toLocked();
2372
2373 /**
2374   * Search parameter: <b>intent</b>
2375   * <p>
2376   * Description: <b>proposal | plan | original-order |reflex-order</b><br>
2377   * Type: <b>token</b><br>
2378   * Path: <b>DeviceRequest.intent</b><br>
2379   * </p>
2380   */
2381  @SearchParamDefinition(name="intent", path="DeviceRequest.intent", description="proposal | plan | original-order |reflex-order", type="token" )
2382  public static final String SP_INTENT = "intent";
2383 /**
2384   * <b>Fluent Client</b> search parameter constant for <b>intent</b>
2385   * <p>
2386   * Description: <b>proposal | plan | original-order |reflex-order</b><br>
2387   * Type: <b>token</b><br>
2388   * Path: <b>DeviceRequest.intent</b><br>
2389   * </p>
2390   */
2391  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INTENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INTENT);
2392
2393 /**
2394   * Search parameter: <b>performer</b>
2395   * <p>
2396   * Description: <b>Desired performer for service</b><br>
2397   * Type: <b>reference</b><br>
2398   * Path: <b>DeviceRequest.performer</b><br>
2399   * </p>
2400   */
2401  @SearchParamDefinition(name="performer", path="DeviceRequest.performer", description="Desired performer for service", 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 Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={CareTeam.class, Device.class, HealthcareService.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2402  public static final String SP_PERFORMER = "performer";
2403 /**
2404   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
2405   * <p>
2406   * Description: <b>Desired performer for service</b><br>
2407   * Type: <b>reference</b><br>
2408   * Path: <b>DeviceRequest.performer</b><br>
2409   * </p>
2410   */
2411  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
2412
2413/**
2414   * Constant for fluent queries to be used to add include statements. Specifies
2415   * the path value of "<b>DeviceRequest:performer</b>".
2416   */
2417  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("DeviceRequest:performer").toLocked();
2418
2419 /**
2420   * Search parameter: <b>prior-request</b>
2421   * <p>
2422   * Description: <b>Request takes the place of referenced completed or terminated requests</b><br>
2423   * Type: <b>reference</b><br>
2424   * Path: <b>DeviceRequest.priorRequest</b><br>
2425   * </p>
2426   */
2427  @SearchParamDefinition(name="prior-request", path="DeviceRequest.priorRequest", description="Request takes the place of referenced completed or terminated requests", type="reference", target={DeviceRequest.class } )
2428  public static final String SP_PRIOR_REQUEST = "prior-request";
2429 /**
2430   * <b>Fluent Client</b> search parameter constant for <b>prior-request</b>
2431   * <p>
2432   * Description: <b>Request takes the place of referenced completed or terminated requests</b><br>
2433   * Type: <b>reference</b><br>
2434   * Path: <b>DeviceRequest.priorRequest</b><br>
2435   * </p>
2436   */
2437  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRIOR_REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRIOR_REQUEST);
2438
2439/**
2440   * Constant for fluent queries to be used to add include statements. Specifies
2441   * the path value of "<b>DeviceRequest:prior-request</b>".
2442   */
2443  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRIOR_REQUEST = new ca.uhn.fhir.model.api.Include("DeviceRequest:prior-request").toLocked();
2444
2445 /**
2446   * Search parameter: <b>requester</b>
2447   * <p>
2448   * Description: <b>Who/what is requesting service</b><br>
2449   * Type: <b>reference</b><br>
2450   * Path: <b>DeviceRequest.requester</b><br>
2451   * </p>
2452   */
2453  @SearchParamDefinition(name="requester", path="DeviceRequest.requester", description="Who/what is requesting service", 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") }, target={Device.class, Organization.class, Practitioner.class, PractitionerRole.class } )
2454  public static final String SP_REQUESTER = "requester";
2455 /**
2456   * <b>Fluent Client</b> search parameter constant for <b>requester</b>
2457   * <p>
2458   * Description: <b>Who/what is requesting service</b><br>
2459   * Type: <b>reference</b><br>
2460   * Path: <b>DeviceRequest.requester</b><br>
2461   * </p>
2462   */
2463  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER);
2464
2465/**
2466   * Constant for fluent queries to be used to add include statements. Specifies
2467   * the path value of "<b>DeviceRequest:requester</b>".
2468   */
2469  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("DeviceRequest:requester").toLocked();
2470
2471 /**
2472   * Search parameter: <b>status</b>
2473   * <p>
2474   * Description: <b>entered-in-error | draft | active |suspended | completed</b><br>
2475   * Type: <b>token</b><br>
2476   * Path: <b>DeviceRequest.status</b><br>
2477   * </p>
2478   */
2479  @SearchParamDefinition(name="status", path="DeviceRequest.status", description="entered-in-error | draft | active |suspended | completed", type="token" )
2480  public static final String SP_STATUS = "status";
2481 /**
2482   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2483   * <p>
2484   * Description: <b>entered-in-error | draft | active |suspended | completed</b><br>
2485   * Type: <b>token</b><br>
2486   * Path: <b>DeviceRequest.status</b><br>
2487   * </p>
2488   */
2489  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2490
2491 /**
2492   * Search parameter: <b>subject</b>
2493   * <p>
2494   * Description: <b>Individual the service is ordered for</b><br>
2495   * Type: <b>reference</b><br>
2496   * Path: <b>DeviceRequest.subject</b><br>
2497   * </p>
2498   */
2499  @SearchParamDefinition(name="subject", path="DeviceRequest.subject", description="Individual the service is ordered for", 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 Patient") }, target={Device.class, Group.class, Location.class, Patient.class } )
2500  public static final String SP_SUBJECT = "subject";
2501 /**
2502   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2503   * <p>
2504   * Description: <b>Individual the service is ordered for</b><br>
2505   * Type: <b>reference</b><br>
2506   * Path: <b>DeviceRequest.subject</b><br>
2507   * </p>
2508   */
2509  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2510
2511/**
2512   * Constant for fluent queries to be used to add include statements. Specifies
2513   * the path value of "<b>DeviceRequest:subject</b>".
2514   */
2515  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DeviceRequest:subject").toLocked();
2516
2517 /**
2518   * Search parameter: <b>code</b>
2519   * <p>
2520   * Description: <b>Multiple Resources: 
2521
2522* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2523* [Condition](condition.html): Code for the condition
2524* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2525* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result
2526* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2527* [List](list.html): What the purpose of this list is
2528* [Medication](medication.html): Returns medications for a specific code
2529* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2530* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2531* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2532* [MedicationUsage](medicationusage.html): Return statements of this medication code
2533* [Observation](observation.html): The code of the observation type
2534* [Procedure](procedure.html): A code to identify a  procedure
2535* [ServiceRequest](servicerequest.html): What is being requested/ordered
2536</b><br>
2537   * Type: <b>token</b><br>
2538   * Path: <b>AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code | ServiceRequest.code</b><br>
2539   * </p>
2540   */
2541  @SearchParamDefinition(name="code", path="AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code | ServiceRequest.code", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance\r\n* [Condition](condition.html): Code for the condition\r\n* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered\r\n* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code\r\n* [List](list.html): What the purpose of this list is\r\n* [Medication](medication.html): Returns medications for a specific code\r\n* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code\r\n* [MedicationUsage](medicationusage.html): Return statements of this medication code\r\n* [Observation](observation.html): The code of the observation type\r\n* [Procedure](procedure.html): A code to identify a  procedure\r\n* [ServiceRequest](servicerequest.html): What is being requested/ordered\r\n", type="token" )
2542  public static final String SP_CODE = "code";
2543 /**
2544   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2545   * <p>
2546   * Description: <b>Multiple Resources: 
2547
2548* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2549* [Condition](condition.html): Code for the condition
2550* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2551* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result
2552* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2553* [List](list.html): What the purpose of this list is
2554* [Medication](medication.html): Returns medications for a specific code
2555* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2556* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2557* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2558* [MedicationUsage](medicationusage.html): Return statements of this medication code
2559* [Observation](observation.html): The code of the observation type
2560* [Procedure](procedure.html): A code to identify a  procedure
2561* [ServiceRequest](servicerequest.html): What is being requested/ordered
2562</b><br>
2563   * Type: <b>token</b><br>
2564   * Path: <b>AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code | ServiceRequest.code</b><br>
2565   * </p>
2566   */
2567  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2568
2569 /**
2570   * Search parameter: <b>encounter</b>
2571   * <p>
2572   * Description: <b>Multiple Resources: 
2573
2574* [Composition](composition.html): Context of the Composition
2575* [DeviceRequest](devicerequest.html): Encounter during which request was created
2576* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made
2577* [DocumentReference](documentreference.html): Context of the document  content
2578* [Flag](flag.html): Alert relevant during encounter
2579* [List](list.html): Context in which list created
2580* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier
2581* [Observation](observation.html): Encounter related to the observation
2582* [Procedure](procedure.html): The Encounter during which this Procedure was created
2583* [RiskAssessment](riskassessment.html): Where was assessment performed?
2584* [ServiceRequest](servicerequest.html): An encounter in which this request is made
2585* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier
2586</b><br>
2587   * Type: <b>reference</b><br>
2588   * Path: <b>Composition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | DocumentReference.encounter | Flag.encounter | List.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | RiskAssessment.encounter | ServiceRequest.encounter | VisionPrescription.encounter</b><br>
2589   * </p>
2590   */
2591  @SearchParamDefinition(name="encounter", path="Composition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | DocumentReference.encounter | Flag.encounter | List.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | RiskAssessment.encounter | ServiceRequest.encounter | VisionPrescription.encounter", description="Multiple Resources: \r\n\r\n* [Composition](composition.html): Context of the Composition\r\n* [DeviceRequest](devicerequest.html): Encounter during which request was created\r\n* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made\r\n* [DocumentReference](documentreference.html): Context of the document  content\r\n* [Flag](flag.html): Alert relevant during encounter\r\n* [List](list.html): Context in which list created\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier\r\n* [Observation](observation.html): Encounter related to the observation\r\n* [Procedure](procedure.html): The Encounter during which this Procedure was created\r\n* [RiskAssessment](riskassessment.html): Where was assessment performed?\r\n* [ServiceRequest](servicerequest.html): An encounter in which this request is made\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier\r\n", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Encounter") }, target={Encounter.class } )
2592  public static final String SP_ENCOUNTER = "encounter";
2593 /**
2594   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2595   * <p>
2596   * Description: <b>Multiple Resources: 
2597
2598* [Composition](composition.html): Context of the Composition
2599* [DeviceRequest](devicerequest.html): Encounter during which request was created
2600* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made
2601* [DocumentReference](documentreference.html): Context of the document  content
2602* [Flag](flag.html): Alert relevant during encounter
2603* [List](list.html): Context in which list created
2604* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier
2605* [Observation](observation.html): Encounter related to the observation
2606* [Procedure](procedure.html): The Encounter during which this Procedure was created
2607* [RiskAssessment](riskassessment.html): Where was assessment performed?
2608* [ServiceRequest](servicerequest.html): An encounter in which this request is made
2609* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier
2610</b><br>
2611   * Type: <b>reference</b><br>
2612   * Path: <b>Composition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | DocumentReference.encounter | Flag.encounter | List.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | RiskAssessment.encounter | ServiceRequest.encounter | VisionPrescription.encounter</b><br>
2613   * </p>
2614   */
2615  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
2616
2617/**
2618   * Constant for fluent queries to be used to add include statements. Specifies
2619   * the path value of "<b>DeviceRequest:encounter</b>".
2620   */
2621  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("DeviceRequest:encounter").toLocked();
2622
2623 /**
2624   * Search parameter: <b>identifier</b>
2625   * <p>
2626   * Description: <b>Multiple Resources: 
2627
2628* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2629* [CarePlan](careplan.html): External Ids for this plan
2630* [CareTeam](careteam.html): External Ids for this team
2631* [Composition](composition.html): Version-independent identifier for the Composition
2632* [Condition](condition.html): A unique identifier of the condition record
2633* [Consent](consent.html): Identifier for this record (external references)
2634* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2635* [DeviceRequest](devicerequest.html): Business identifier for request/order
2636* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2637* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2638* [DocumentReference](documentreference.html): Identifier of the attachment binary
2639* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2640* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2641* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2642* [Goal](goal.html): External Ids for this goal
2643* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2644* [Immunization](immunization.html): Business identifier
2645* [List](list.html): Business identifier
2646* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2647* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2648* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2649* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2650* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2651* [Observation](observation.html): The unique id for a particular observation
2652* [Procedure](procedure.html): A unique identifier for a procedure
2653* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2654* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2655* [SupplyDelivery](supplydelivery.html): External identifier
2656* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2657* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2658</b><br>
2659   * Type: <b>token</b><br>
2660   * 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.content.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2661   * </p>
2662   */
2663  @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.content.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [List](list.html): Business identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationUsage](medicationusage.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
2664  public static final String SP_IDENTIFIER = "identifier";
2665 /**
2666   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2667   * <p>
2668   * Description: <b>Multiple Resources: 
2669
2670* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2671* [CarePlan](careplan.html): External Ids for this plan
2672* [CareTeam](careteam.html): External Ids for this team
2673* [Composition](composition.html): Version-independent identifier for the Composition
2674* [Condition](condition.html): A unique identifier of the condition record
2675* [Consent](consent.html): Identifier for this record (external references)
2676* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2677* [DeviceRequest](devicerequest.html): Business identifier for request/order
2678* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2679* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2680* [DocumentReference](documentreference.html): Identifier of the attachment binary
2681* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2682* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2683* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2684* [Goal](goal.html): External Ids for this goal
2685* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2686* [Immunization](immunization.html): Business identifier
2687* [List](list.html): Business identifier
2688* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2689* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2690* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2691* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2692* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2693* [Observation](observation.html): The unique id for a particular observation
2694* [Procedure](procedure.html): A unique identifier for a procedure
2695* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2696* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2697* [SupplyDelivery](supplydelivery.html): External identifier
2698* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2699* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2700</b><br>
2701   * Type: <b>token</b><br>
2702   * 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.content.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2703   * </p>
2704   */
2705  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2706
2707 /**
2708   * Search parameter: <b>patient</b>
2709   * <p>
2710   * Description: <b>Multiple Resources: 
2711
2712* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2713* [CarePlan](careplan.html): Who the care plan is for
2714* [CareTeam](careteam.html): Who care team is for
2715* [ClinicalImpression](clinicalimpression.html): Patient assessed
2716* [Composition](composition.html): Who and/or what the composition is about
2717* [Condition](condition.html): Who has the condition?
2718* [Consent](consent.html): Who the consent applies to
2719* [DetectedIssue](detectedissue.html): Associated patient
2720* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2721* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2722* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2723* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2724* [DocumentReference](documentreference.html): Who/what is the subject of the document
2725* [Encounter](encounter.html): The patient present at the encounter
2726* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2727* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2728* [Flag](flag.html): The identity of a subject to list flags for
2729* [Goal](goal.html): Who this goal is intended for
2730* [ImagingStudy](imagingstudy.html): Who the study is about
2731* [Immunization](immunization.html): The patient for the vaccination record
2732* [List](list.html): If all resources have the same subject
2733* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2734* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2735* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2736* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2737* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
2738* [Observation](observation.html): The subject that the observation is about (if patient)
2739* [Procedure](procedure.html): Search by subject - a patient
2740* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2741* [ServiceRequest](servicerequest.html): Search by subject - a patient
2742* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2743* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2744</b><br>
2745   * Type: <b>reference</b><br>
2746   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
2747   * </p>
2748   */
2749  @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentManifest](documentmanifest.html): The subject of the set of documents\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [List](list.html): If all resources have the same subject\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, ArtifactAssessment.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, ConceptMap2.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceDispense.class, DeviceMetric.class, DeviceRequest.class, DeviceUsage.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingSelection.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, InventoryReport.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Permission.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
2750  public static final String SP_PATIENT = "patient";
2751 /**
2752   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2753   * <p>
2754   * Description: <b>Multiple Resources: 
2755
2756* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2757* [CarePlan](careplan.html): Who the care plan is for
2758* [CareTeam](careteam.html): Who care team is for
2759* [ClinicalImpression](clinicalimpression.html): Patient assessed
2760* [Composition](composition.html): Who and/or what the composition is about
2761* [Condition](condition.html): Who has the condition?
2762* [Consent](consent.html): Who the consent applies to
2763* [DetectedIssue](detectedissue.html): Associated patient
2764* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2765* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2766* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2767* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2768* [DocumentReference](documentreference.html): Who/what is the subject of the document
2769* [Encounter](encounter.html): The patient present at the encounter
2770* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2771* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2772* [Flag](flag.html): The identity of a subject to list flags for
2773* [Goal](goal.html): Who this goal is intended for
2774* [ImagingStudy](imagingstudy.html): Who the study is about
2775* [Immunization](immunization.html): The patient for the vaccination record
2776* [List](list.html): If all resources have the same subject
2777* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2778* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2779* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2780* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2781* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
2782* [Observation](observation.html): The subject that the observation is about (if patient)
2783* [Procedure](procedure.html): Search by subject - a patient
2784* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2785* [ServiceRequest](servicerequest.html): Search by subject - a patient
2786* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2787* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2788</b><br>
2789   * Type: <b>reference</b><br>
2790   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
2791   * </p>
2792   */
2793  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2794
2795/**
2796   * Constant for fluent queries to be used to add include statements. Specifies
2797   * the path value of "<b>DeviceRequest:patient</b>".
2798   */
2799  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DeviceRequest:patient").toLocked();
2800
2801
2802}
2803