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