001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Thu, Dec 27, 2018 10:06-0500 for FHIR v4.0.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import ca.uhn.fhir.model.api.annotation.ResourceDef;
038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
039import ca.uhn.fhir.model.api.annotation.Child;
040import ca.uhn.fhir.model.api.annotation.ChildOrder;
041import ca.uhn.fhir.model.api.annotation.Description;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045/**
046 * 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.
047 */
048@ResourceDef(name="DeviceRequest", profile="http://hl7.org/fhir/StructureDefinition/DeviceRequest")
049public class DeviceRequest extends DomainResource {
050
051    public enum DeviceRequestStatus {
052        /**
053         * The request has been created but is not yet complete or ready for action.
054         */
055        DRAFT, 
056        /**
057         * The request is in force and ready to be acted upon.
058         */
059        ACTIVE, 
060        /**
061         * The request (and any implicit authorization to act) has been temporarily withdrawn but is expected to resume in the future.
062         */
063        ONHOLD, 
064        /**
065         * The request (and any implicit authorization to act) has been terminated prior to the known full completion of the intended actions.  No further activity should occur.
066         */
067        REVOKED, 
068        /**
069         * The activity described by the request has been fully performed.  No further activity will occur.
070         */
071        COMPLETED, 
072        /**
073         * This request should never have existed and should be considered 'void'.  (It is possible that real-world decisions were based on it.  If real-world activity has occurred, the status should be "cancelled" rather than "entered-in-error".).
074         */
075        ENTEREDINERROR, 
076        /**
077         * The authoring/source system does not know which of the status values currently applies for this request.  Note: This concept is not to be used for "other" - one of the listed statuses is presumed to apply,  but the authoring/source system does not know which.
078         */
079        UNKNOWN, 
080        /**
081         * added to help the parsers with the generic types
082         */
083        NULL;
084        public static DeviceRequestStatus fromCode(String codeString) throws FHIRException {
085            if (codeString == null || "".equals(codeString))
086                return null;
087        if ("draft".equals(codeString))
088          return DRAFT;
089        if ("active".equals(codeString))
090          return ACTIVE;
091        if ("on-hold".equals(codeString))
092          return ONHOLD;
093        if ("revoked".equals(codeString))
094          return REVOKED;
095        if ("completed".equals(codeString))
096          return COMPLETED;
097        if ("entered-in-error".equals(codeString))
098          return ENTEREDINERROR;
099        if ("unknown".equals(codeString))
100          return UNKNOWN;
101        if (Configuration.isAcceptInvalidEnums())
102          return null;
103        else
104          throw new FHIRException("Unknown DeviceRequestStatus code '"+codeString+"'");
105        }
106        public String toCode() {
107          switch (this) {
108            case DRAFT: return "draft";
109            case ACTIVE: return "active";
110            case ONHOLD: return "on-hold";
111            case REVOKED: return "revoked";
112            case COMPLETED: return "completed";
113            case ENTEREDINERROR: return "entered-in-error";
114            case UNKNOWN: return "unknown";
115            default: return "?";
116          }
117        }
118        public String getSystem() {
119          switch (this) {
120            case DRAFT: return "http://hl7.org/fhir/request-status";
121            case ACTIVE: return "http://hl7.org/fhir/request-status";
122            case ONHOLD: return "http://hl7.org/fhir/request-status";
123            case REVOKED: return "http://hl7.org/fhir/request-status";
124            case COMPLETED: return "http://hl7.org/fhir/request-status";
125            case ENTEREDINERROR: return "http://hl7.org/fhir/request-status";
126            case UNKNOWN: return "http://hl7.org/fhir/request-status";
127            default: return "?";
128          }
129        }
130        public String getDefinition() {
131          switch (this) {
132            case DRAFT: return "The request has been created but is not yet complete or ready for action.";
133            case ACTIVE: return "The request is in force and ready to be acted upon.";
134            case ONHOLD: return "The request (and any implicit authorization to act) has been temporarily withdrawn but is expected to resume in the future.";
135            case REVOKED: return "The request (and any implicit authorization to act) has been terminated prior to the known full completion of the intended actions.  No further activity should occur.";
136            case COMPLETED: return "The activity described by the request has been fully performed.  No further activity will occur.";
137            case ENTEREDINERROR: return "This request should never have existed and should be considered 'void'.  (It is possible that real-world decisions were based on it.  If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".).";
138            case UNKNOWN: return "The authoring/source system does not know which of the status values currently applies for this request.  Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply,  but the authoring/source system does not know which.";
139            default: return "?";
140          }
141        }
142        public String getDisplay() {
143          switch (this) {
144            case DRAFT: return "Draft";
145            case ACTIVE: return "Active";
146            case ONHOLD: return "On Hold";
147            case REVOKED: return "Revoked";
148            case COMPLETED: return "Completed";
149            case ENTEREDINERROR: return "Entered in Error";
150            case UNKNOWN: return "Unknown";
151            default: return "?";
152          }
153        }
154    }
155
156  public static class DeviceRequestStatusEnumFactory implements EnumFactory<DeviceRequestStatus> {
157    public DeviceRequestStatus fromCode(String codeString) throws IllegalArgumentException {
158      if (codeString == null || "".equals(codeString))
159            if (codeString == null || "".equals(codeString))
160                return null;
161        if ("draft".equals(codeString))
162          return DeviceRequestStatus.DRAFT;
163        if ("active".equals(codeString))
164          return DeviceRequestStatus.ACTIVE;
165        if ("on-hold".equals(codeString))
166          return DeviceRequestStatus.ONHOLD;
167        if ("revoked".equals(codeString))
168          return DeviceRequestStatus.REVOKED;
169        if ("completed".equals(codeString))
170          return DeviceRequestStatus.COMPLETED;
171        if ("entered-in-error".equals(codeString))
172          return DeviceRequestStatus.ENTEREDINERROR;
173        if ("unknown".equals(codeString))
174          return DeviceRequestStatus.UNKNOWN;
175        throw new IllegalArgumentException("Unknown DeviceRequestStatus code '"+codeString+"'");
176        }
177        public Enumeration<DeviceRequestStatus> fromType(Base code) throws FHIRException {
178          if (code == null)
179            return null;
180          if (code.isEmpty())
181            return new Enumeration<DeviceRequestStatus>(this);
182          String codeString = ((PrimitiveType) code).asStringValue();
183          if (codeString == null || "".equals(codeString))
184            return null;
185        if ("draft".equals(codeString))
186          return new Enumeration<DeviceRequestStatus>(this, DeviceRequestStatus.DRAFT);
187        if ("active".equals(codeString))
188          return new Enumeration<DeviceRequestStatus>(this, DeviceRequestStatus.ACTIVE);
189        if ("on-hold".equals(codeString))
190          return new Enumeration<DeviceRequestStatus>(this, DeviceRequestStatus.ONHOLD);
191        if ("revoked".equals(codeString))
192          return new Enumeration<DeviceRequestStatus>(this, DeviceRequestStatus.REVOKED);
193        if ("completed".equals(codeString))
194          return new Enumeration<DeviceRequestStatus>(this, DeviceRequestStatus.COMPLETED);
195        if ("entered-in-error".equals(codeString))
196          return new Enumeration<DeviceRequestStatus>(this, DeviceRequestStatus.ENTEREDINERROR);
197        if ("unknown".equals(codeString))
198          return new Enumeration<DeviceRequestStatus>(this, DeviceRequestStatus.UNKNOWN);
199        throw new FHIRException("Unknown DeviceRequestStatus code '"+codeString+"'");
200        }
201    public String toCode(DeviceRequestStatus code) {
202      if (code == DeviceRequestStatus.DRAFT)
203        return "draft";
204      if (code == DeviceRequestStatus.ACTIVE)
205        return "active";
206      if (code == DeviceRequestStatus.ONHOLD)
207        return "on-hold";
208      if (code == DeviceRequestStatus.REVOKED)
209        return "revoked";
210      if (code == DeviceRequestStatus.COMPLETED)
211        return "completed";
212      if (code == DeviceRequestStatus.ENTEREDINERROR)
213        return "entered-in-error";
214      if (code == DeviceRequestStatus.UNKNOWN)
215        return "unknown";
216      return "?";
217      }
218    public String toSystem(DeviceRequestStatus code) {
219      return code.getSystem();
220      }
221    }
222
223    public enum RequestIntent {
224        /**
225         * The request is a suggestion made by someone/something that does not have an intention to ensure it occurs and without providing an authorization to act.
226         */
227        PROPOSAL, 
228        /**
229         * The request represents an intention to ensure something occurs without providing an authorization for others to act.
230         */
231        PLAN, 
232        /**
233         * The request represents a legally binding instruction authored by a Patient or RelatedPerson.
234         */
235        DIRECTIVE, 
236        /**
237         * The request represents a request/demand and authorization for action by a Practitioner.
238         */
239        ORDER, 
240        /**
241         * The request represents an original authorization for action.
242         */
243        ORIGINALORDER, 
244        /**
245         * The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization.
246         */
247        REFLEXORDER, 
248        /**
249         * The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order.
250         */
251        FILLERORDER, 
252        /**
253         * An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence.  E.g. The administration of a single dose of a drug.
254         */
255        INSTANCEORDER, 
256        /**
257         * The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests.  Refer to [[[RequestGroup]]] for additional information on how this status is used.
258         */
259        OPTION, 
260        /**
261         * added to help the parsers with the generic types
262         */
263        NULL;
264        public static RequestIntent fromCode(String codeString) throws FHIRException {
265            if (codeString == null || "".equals(codeString))
266                return null;
267        if ("proposal".equals(codeString))
268          return PROPOSAL;
269        if ("plan".equals(codeString))
270          return PLAN;
271        if ("directive".equals(codeString))
272          return DIRECTIVE;
273        if ("order".equals(codeString))
274          return ORDER;
275        if ("original-order".equals(codeString))
276          return ORIGINALORDER;
277        if ("reflex-order".equals(codeString))
278          return REFLEXORDER;
279        if ("filler-order".equals(codeString))
280          return FILLERORDER;
281        if ("instance-order".equals(codeString))
282          return INSTANCEORDER;
283        if ("option".equals(codeString))
284          return OPTION;
285        if (Configuration.isAcceptInvalidEnums())
286          return null;
287        else
288          throw new FHIRException("Unknown RequestIntent code '"+codeString+"'");
289        }
290        public String toCode() {
291          switch (this) {
292            case PROPOSAL: return "proposal";
293            case PLAN: return "plan";
294            case DIRECTIVE: return "directive";
295            case ORDER: return "order";
296            case ORIGINALORDER: return "original-order";
297            case REFLEXORDER: return "reflex-order";
298            case FILLERORDER: return "filler-order";
299            case INSTANCEORDER: return "instance-order";
300            case OPTION: return "option";
301            default: return "?";
302          }
303        }
304        public String getSystem() {
305          switch (this) {
306            case PROPOSAL: return "http://hl7.org/fhir/request-intent";
307            case PLAN: return "http://hl7.org/fhir/request-intent";
308            case DIRECTIVE: return "http://hl7.org/fhir/request-intent";
309            case ORDER: return "http://hl7.org/fhir/request-intent";
310            case ORIGINALORDER: return "http://hl7.org/fhir/request-intent";
311            case REFLEXORDER: return "http://hl7.org/fhir/request-intent";
312            case FILLERORDER: return "http://hl7.org/fhir/request-intent";
313            case INSTANCEORDER: return "http://hl7.org/fhir/request-intent";
314            case OPTION: return "http://hl7.org/fhir/request-intent";
315            default: return "?";
316          }
317        }
318        public String getDefinition() {
319          switch (this) {
320            case PROPOSAL: return "The request is a suggestion made by someone/something that does not have an intention to ensure it occurs and without providing an authorization to act.";
321            case PLAN: return "The request represents an intention to ensure something occurs without providing an authorization for others to act.";
322            case DIRECTIVE: return "The request represents a legally binding instruction authored by a Patient or RelatedPerson.";
323            case ORDER: return "The request represents a request/demand and authorization for action by a Practitioner.";
324            case ORIGINALORDER: return "The request represents an original authorization for action.";
325            case REFLEXORDER: return "The request represents an automatically generated supplemental authorization for action based on a parent authorization together with initial results of the action taken against that parent authorization.";
326            case FILLERORDER: return "The request represents the view of an authorization instantiated by a fulfilling system representing the details of the fulfiller's intention to act upon a submitted order.";
327            case INSTANCEORDER: return "An order created in fulfillment of a broader order that represents the authorization for a single activity occurrence.  E.g. The administration of a single dose of a drug.";
328            case OPTION: return "The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests.  Refer to [[[RequestGroup]]] for additional information on how this status is used.";
329            default: return "?";
330          }
331        }
332        public String getDisplay() {
333          switch (this) {
334            case PROPOSAL: return "Proposal";
335            case PLAN: return "Plan";
336            case DIRECTIVE: return "Directive";
337            case ORDER: return "Order";
338            case ORIGINALORDER: return "Original Order";
339            case REFLEXORDER: return "Reflex Order";
340            case FILLERORDER: return "Filler Order";
341            case INSTANCEORDER: return "Instance Order";
342            case OPTION: return "Option";
343            default: return "?";
344          }
345        }
346    }
347
348  public static class RequestIntentEnumFactory implements EnumFactory<RequestIntent> {
349    public RequestIntent fromCode(String codeString) throws IllegalArgumentException {
350      if (codeString == null || "".equals(codeString))
351            if (codeString == null || "".equals(codeString))
352                return null;
353        if ("proposal".equals(codeString))
354          return RequestIntent.PROPOSAL;
355        if ("plan".equals(codeString))
356          return RequestIntent.PLAN;
357        if ("directive".equals(codeString))
358          return RequestIntent.DIRECTIVE;
359        if ("order".equals(codeString))
360          return RequestIntent.ORDER;
361        if ("original-order".equals(codeString))
362          return RequestIntent.ORIGINALORDER;
363        if ("reflex-order".equals(codeString))
364          return RequestIntent.REFLEXORDER;
365        if ("filler-order".equals(codeString))
366          return RequestIntent.FILLERORDER;
367        if ("instance-order".equals(codeString))
368          return RequestIntent.INSTANCEORDER;
369        if ("option".equals(codeString))
370          return RequestIntent.OPTION;
371        throw new IllegalArgumentException("Unknown RequestIntent code '"+codeString+"'");
372        }
373        public Enumeration<RequestIntent> fromType(Base code) throws FHIRException {
374          if (code == null)
375            return null;
376          if (code.isEmpty())
377            return new Enumeration<RequestIntent>(this);
378          String codeString = ((PrimitiveType) code).asStringValue();
379          if (codeString == null || "".equals(codeString))
380            return null;
381        if ("proposal".equals(codeString))
382          return new Enumeration<RequestIntent>(this, RequestIntent.PROPOSAL);
383        if ("plan".equals(codeString))
384          return new Enumeration<RequestIntent>(this, RequestIntent.PLAN);
385        if ("directive".equals(codeString))
386          return new Enumeration<RequestIntent>(this, RequestIntent.DIRECTIVE);
387        if ("order".equals(codeString))
388          return new Enumeration<RequestIntent>(this, RequestIntent.ORDER);
389        if ("original-order".equals(codeString))
390          return new Enumeration<RequestIntent>(this, RequestIntent.ORIGINALORDER);
391        if ("reflex-order".equals(codeString))
392          return new Enumeration<RequestIntent>(this, RequestIntent.REFLEXORDER);
393        if ("filler-order".equals(codeString))
394          return new Enumeration<RequestIntent>(this, RequestIntent.FILLERORDER);
395        if ("instance-order".equals(codeString))
396          return new Enumeration<RequestIntent>(this, RequestIntent.INSTANCEORDER);
397        if ("option".equals(codeString))
398          return new Enumeration<RequestIntent>(this, RequestIntent.OPTION);
399        throw new FHIRException("Unknown RequestIntent code '"+codeString+"'");
400        }
401    public String toCode(RequestIntent code) {
402      if (code == RequestIntent.PROPOSAL)
403        return "proposal";
404      if (code == RequestIntent.PLAN)
405        return "plan";
406      if (code == RequestIntent.DIRECTIVE)
407        return "directive";
408      if (code == RequestIntent.ORDER)
409        return "order";
410      if (code == RequestIntent.ORIGINALORDER)
411        return "original-order";
412      if (code == RequestIntent.REFLEXORDER)
413        return "reflex-order";
414      if (code == RequestIntent.FILLERORDER)
415        return "filler-order";
416      if (code == RequestIntent.INSTANCEORDER)
417        return "instance-order";
418      if (code == RequestIntent.OPTION)
419        return "option";
420      return "?";
421      }
422    public String toSystem(RequestIntent code) {
423      return code.getSystem();
424      }
425    }
426
427    public enum RequestPriority {
428        /**
429         * The request has normal priority.
430         */
431        ROUTINE, 
432        /**
433         * The request should be actioned promptly - higher priority than routine.
434         */
435        URGENT, 
436        /**
437         * The request should be actioned as soon as possible - higher priority than urgent.
438         */
439        ASAP, 
440        /**
441         * The request should be actioned immediately - highest possible priority.  E.g. an emergency.
442         */
443        STAT, 
444        /**
445         * added to help the parsers with the generic types
446         */
447        NULL;
448        public static RequestPriority fromCode(String codeString) throws FHIRException {
449            if (codeString == null || "".equals(codeString))
450                return null;
451        if ("routine".equals(codeString))
452          return ROUTINE;
453        if ("urgent".equals(codeString))
454          return URGENT;
455        if ("asap".equals(codeString))
456          return ASAP;
457        if ("stat".equals(codeString))
458          return STAT;
459        if (Configuration.isAcceptInvalidEnums())
460          return null;
461        else
462          throw new FHIRException("Unknown RequestPriority code '"+codeString+"'");
463        }
464        public String toCode() {
465          switch (this) {
466            case ROUTINE: return "routine";
467            case URGENT: return "urgent";
468            case ASAP: return "asap";
469            case STAT: return "stat";
470            default: return "?";
471          }
472        }
473        public String getSystem() {
474          switch (this) {
475            case ROUTINE: return "http://hl7.org/fhir/request-priority";
476            case URGENT: return "http://hl7.org/fhir/request-priority";
477            case ASAP: return "http://hl7.org/fhir/request-priority";
478            case STAT: return "http://hl7.org/fhir/request-priority";
479            default: return "?";
480          }
481        }
482        public String getDefinition() {
483          switch (this) {
484            case ROUTINE: return "The request has normal priority.";
485            case URGENT: return "The request should be actioned promptly - higher priority than routine.";
486            case ASAP: return "The request should be actioned as soon as possible - higher priority than urgent.";
487            case STAT: return "The request should be actioned immediately - highest possible priority.  E.g. an emergency.";
488            default: return "?";
489          }
490        }
491        public String getDisplay() {
492          switch (this) {
493            case ROUTINE: return "Routine";
494            case URGENT: return "Urgent";
495            case ASAP: return "ASAP";
496            case STAT: return "STAT";
497            default: return "?";
498          }
499        }
500    }
501
502  public static class RequestPriorityEnumFactory implements EnumFactory<RequestPriority> {
503    public RequestPriority fromCode(String codeString) throws IllegalArgumentException {
504      if (codeString == null || "".equals(codeString))
505            if (codeString == null || "".equals(codeString))
506                return null;
507        if ("routine".equals(codeString))
508          return RequestPriority.ROUTINE;
509        if ("urgent".equals(codeString))
510          return RequestPriority.URGENT;
511        if ("asap".equals(codeString))
512          return RequestPriority.ASAP;
513        if ("stat".equals(codeString))
514          return RequestPriority.STAT;
515        throw new IllegalArgumentException("Unknown RequestPriority code '"+codeString+"'");
516        }
517        public Enumeration<RequestPriority> fromType(Base code) throws FHIRException {
518          if (code == null)
519            return null;
520          if (code.isEmpty())
521            return new Enumeration<RequestPriority>(this);
522          String codeString = ((PrimitiveType) code).asStringValue();
523          if (codeString == null || "".equals(codeString))
524            return null;
525        if ("routine".equals(codeString))
526          return new Enumeration<RequestPriority>(this, RequestPriority.ROUTINE);
527        if ("urgent".equals(codeString))
528          return new Enumeration<RequestPriority>(this, RequestPriority.URGENT);
529        if ("asap".equals(codeString))
530          return new Enumeration<RequestPriority>(this, RequestPriority.ASAP);
531        if ("stat".equals(codeString))
532          return new Enumeration<RequestPriority>(this, RequestPriority.STAT);
533        throw new FHIRException("Unknown RequestPriority code '"+codeString+"'");
534        }
535    public String toCode(RequestPriority code) {
536      if (code == RequestPriority.ROUTINE)
537        return "routine";
538      if (code == RequestPriority.URGENT)
539        return "urgent";
540      if (code == RequestPriority.ASAP)
541        return "asap";
542      if (code == RequestPriority.STAT)
543        return "stat";
544      return "?";
545      }
546    public String toSystem(RequestPriority code) {
547      return code.getSystem();
548      }
549    }
550
551    @Block()
552    public static class DeviceRequestParameterComponent extends BackboneElement implements IBaseBackboneElement {
553        /**
554         * A code or string that identifies the device detail being asserted.
555         */
556        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
557        @Description(shortDefinition="Device detail", formalDefinition="A code or string that identifies the device detail being asserted." )
558        protected CodeableConcept code;
559
560        /**
561         * The value of the device detail.
562         */
563        @Child(name = "value", type = {CodeableConcept.class, Quantity.class, Range.class, BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
564        @Description(shortDefinition="Value of detail", formalDefinition="The value of the device detail." )
565        protected Type value;
566
567        private static final long serialVersionUID = 884525025L;
568
569    /**
570     * Constructor
571     */
572      public DeviceRequestParameterComponent() {
573        super();
574      }
575
576        /**
577         * @return {@link #code} (A code or string that identifies the device detail being asserted.)
578         */
579        public CodeableConcept getCode() { 
580          if (this.code == null)
581            if (Configuration.errorOnAutoCreate())
582              throw new Error("Attempt to auto-create DeviceRequestParameterComponent.code");
583            else if (Configuration.doAutoCreate())
584              this.code = new CodeableConcept(); // cc
585          return this.code;
586        }
587
588        public boolean hasCode() { 
589          return this.code != null && !this.code.isEmpty();
590        }
591
592        /**
593         * @param value {@link #code} (A code or string that identifies the device detail being asserted.)
594         */
595        public DeviceRequestParameterComponent setCode(CodeableConcept value) { 
596          this.code = value;
597          return this;
598        }
599
600        /**
601         * @return {@link #value} (The value of the device detail.)
602         */
603        public Type getValue() { 
604          return this.value;
605        }
606
607        /**
608         * @return {@link #value} (The value of the device detail.)
609         */
610        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
611          if (this.value == null)
612            this.value = new CodeableConcept();
613          if (!(this.value instanceof CodeableConcept))
614            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
615          return (CodeableConcept) this.value;
616        }
617
618        public boolean hasValueCodeableConcept() { 
619          return this != null && this.value instanceof CodeableConcept;
620        }
621
622        /**
623         * @return {@link #value} (The value of the device detail.)
624         */
625        public Quantity getValueQuantity() throws FHIRException { 
626          if (this.value == null)
627            this.value = new Quantity();
628          if (!(this.value instanceof Quantity))
629            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
630          return (Quantity) this.value;
631        }
632
633        public boolean hasValueQuantity() { 
634          return this != null && this.value instanceof Quantity;
635        }
636
637        /**
638         * @return {@link #value} (The value of the device detail.)
639         */
640        public Range getValueRange() throws FHIRException { 
641          if (this.value == null)
642            this.value = new Range();
643          if (!(this.value instanceof Range))
644            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
645          return (Range) this.value;
646        }
647
648        public boolean hasValueRange() { 
649          return this != null && this.value instanceof Range;
650        }
651
652        /**
653         * @return {@link #value} (The value of the device detail.)
654         */
655        public BooleanType getValueBooleanType() throws FHIRException { 
656          if (this.value == null)
657            this.value = new BooleanType();
658          if (!(this.value instanceof BooleanType))
659            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
660          return (BooleanType) this.value;
661        }
662
663        public boolean hasValueBooleanType() { 
664          return this != null && this.value instanceof BooleanType;
665        }
666
667        public boolean hasValue() { 
668          return this.value != null && !this.value.isEmpty();
669        }
670
671        /**
672         * @param value {@link #value} (The value of the device detail.)
673         */
674        public DeviceRequestParameterComponent setValue(Type value) { 
675          if (value != null && !(value instanceof CodeableConcept || value instanceof Quantity || value instanceof Range || value instanceof BooleanType))
676            throw new Error("Not the right type for DeviceRequest.parameter.value[x]: "+value.fhirType());
677          this.value = value;
678          return this;
679        }
680
681        protected void listChildren(List<Property> children) {
682          super.listChildren(children);
683          children.add(new Property("code", "CodeableConcept", "A code or string that identifies the device detail being asserted.", 0, 1, code));
684          children.add(new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value));
685        }
686
687        @Override
688        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
689          switch (_hash) {
690          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A code or string that identifies the device detail being asserted.", 0, 1, code);
691          case -1410166417: /*value[x]*/  return new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value);
692          case 111972721: /*value*/  return new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value);
693          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value);
694          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value);
695          case 2030761548: /*valueRange*/  return new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value);
696          case 733421943: /*valueBoolean*/  return new Property("value[x]", "CodeableConcept|Quantity|Range|boolean", "The value of the device detail.", 0, 1, value);
697          default: return super.getNamedProperty(_hash, _name, _checkValid);
698          }
699
700        }
701
702      @Override
703      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
704        switch (hash) {
705        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
706        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type
707        default: return super.getProperty(hash, name, checkValid);
708        }
709
710      }
711
712      @Override
713      public Base setProperty(int hash, String name, Base value) throws FHIRException {
714        switch (hash) {
715        case 3059181: // code
716          this.code = castToCodeableConcept(value); // CodeableConcept
717          return value;
718        case 111972721: // value
719          this.value = castToType(value); // Type
720          return value;
721        default: return super.setProperty(hash, name, value);
722        }
723
724      }
725
726      @Override
727      public Base setProperty(String name, Base value) throws FHIRException {
728        if (name.equals("code")) {
729          this.code = castToCodeableConcept(value); // CodeableConcept
730        } else if (name.equals("value[x]")) {
731          this.value = castToType(value); // Type
732        } else
733          return super.setProperty(name, value);
734        return value;
735      }
736
737      @Override
738      public Base makeProperty(int hash, String name) throws FHIRException {
739        switch (hash) {
740        case 3059181:  return getCode(); 
741        case -1410166417:  return getValue(); 
742        case 111972721:  return getValue(); 
743        default: return super.makeProperty(hash, name);
744        }
745
746      }
747
748      @Override
749      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
750        switch (hash) {
751        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
752        case 111972721: /*value*/ return new String[] {"CodeableConcept", "Quantity", "Range", "boolean"};
753        default: return super.getTypesForProperty(hash, name);
754        }
755
756      }
757
758      @Override
759      public Base addChild(String name) throws FHIRException {
760        if (name.equals("code")) {
761          this.code = new CodeableConcept();
762          return this.code;
763        }
764        else if (name.equals("valueCodeableConcept")) {
765          this.value = new CodeableConcept();
766          return this.value;
767        }
768        else if (name.equals("valueQuantity")) {
769          this.value = new Quantity();
770          return this.value;
771        }
772        else if (name.equals("valueRange")) {
773          this.value = new Range();
774          return this.value;
775        }
776        else if (name.equals("valueBoolean")) {
777          this.value = new BooleanType();
778          return this.value;
779        }
780        else
781          return super.addChild(name);
782      }
783
784      public DeviceRequestParameterComponent copy() {
785        DeviceRequestParameterComponent dst = new DeviceRequestParameterComponent();
786        copyValues(dst);
787        dst.code = code == null ? null : code.copy();
788        dst.value = value == null ? null : value.copy();
789        return dst;
790      }
791
792      @Override
793      public boolean equalsDeep(Base other_) {
794        if (!super.equalsDeep(other_))
795          return false;
796        if (!(other_ instanceof DeviceRequestParameterComponent))
797          return false;
798        DeviceRequestParameterComponent o = (DeviceRequestParameterComponent) other_;
799        return compareDeep(code, o.code, true) && compareDeep(value, o.value, true);
800      }
801
802      @Override
803      public boolean equalsShallow(Base other_) {
804        if (!super.equalsShallow(other_))
805          return false;
806        if (!(other_ instanceof DeviceRequestParameterComponent))
807          return false;
808        DeviceRequestParameterComponent o = (DeviceRequestParameterComponent) other_;
809        return true;
810      }
811
812      public boolean isEmpty() {
813        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, value);
814      }
815
816  public String fhirType() {
817    return "DeviceRequest.parameter";
818
819  }
820
821  }
822
823    /**
824     * Identifiers assigned to this order by the orderer or by the receiver.
825     */
826    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
827    @Description(shortDefinition="External Request identifier", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." )
828    protected List<Identifier> identifier;
829
830    /**
831     * 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.
832     */
833    @Child(name = "instantiatesCanonical", type = {CanonicalType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
834    @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." )
835    protected List<CanonicalType> instantiatesCanonical;
836
837    /**
838     * 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.
839     */
840    @Child(name = "instantiatesUri", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
841    @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." )
842    protected List<UriType> instantiatesUri;
843
844    /**
845     * Plan/proposal/order fulfilled by this request.
846     */
847    @Child(name = "basedOn", type = {Reference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
848    @Description(shortDefinition="What request fulfills", formalDefinition="Plan/proposal/order fulfilled by this request." )
849    protected List<Reference> basedOn;
850    /**
851     * The actual objects that are the target of the reference (Plan/proposal/order fulfilled by this request.)
852     */
853    protected List<Resource> basedOnTarget;
854
855
856    /**
857     * The request takes the place of the referenced completed or terminated request(s).
858     */
859    @Child(name = "priorRequest", type = {Reference.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
860    @Description(shortDefinition="What request replaces", formalDefinition="The request takes the place of the referenced completed or terminated request(s)." )
861    protected List<Reference> priorRequest;
862    /**
863     * The actual objects that are the target of the reference (The request takes the place of the referenced completed or terminated request(s).)
864     */
865    protected List<Resource> priorRequestTarget;
866
867
868    /**
869     * Composite request this is part of.
870     */
871    @Child(name = "groupIdentifier", type = {Identifier.class}, order=5, min=0, max=1, modifier=false, summary=true)
872    @Description(shortDefinition="Identifier of composite request", formalDefinition="Composite request this is part of." )
873    protected Identifier groupIdentifier;
874
875    /**
876     * The status of the request.
877     */
878    @Child(name = "status", type = {CodeType.class}, order=6, min=0, max=1, modifier=true, summary=true)
879    @Description(shortDefinition="draft | active | suspended | completed | entered-in-error | cancelled", formalDefinition="The status of the request." )
880    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-status")
881    protected Enumeration<DeviceRequestStatus> status;
882
883    /**
884     * Whether the request is a proposal, plan, an original order or a reflex order.
885     */
886    @Child(name = "intent", type = {CodeType.class}, order=7, min=1, max=1, modifier=true, summary=true)
887    @Description(shortDefinition="proposal | plan | original-order | encoded | reflex-order", formalDefinition="Whether the request is a proposal, plan, an original order or a reflex order." )
888    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-intent")
889    protected Enumeration<RequestIntent> intent;
890
891    /**
892     * Indicates how quickly the {{title}} should be addressed with respect to other requests.
893     */
894    @Child(name = "priority", type = {CodeType.class}, order=8, min=0, max=1, modifier=false, summary=true)
895    @Description(shortDefinition="Indicates how quickly the {{title}} should be addressed with respect to other requests", formalDefinition="Indicates how quickly the {{title}} should be addressed with respect to other requests." )
896    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority")
897    protected Enumeration<RequestPriority> priority;
898
899    /**
900     * The details of the device to be used.
901     */
902    @Child(name = "code", type = {Device.class, CodeableConcept.class}, order=9, min=1, max=1, modifier=false, summary=true)
903    @Description(shortDefinition="Device requested", formalDefinition="The details of the device to be used." )
904    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-kind")
905    protected Type code;
906
907    /**
908     * Specific parameters for the ordered item.  For example, the prism value for lenses.
909     */
910    @Child(name = "parameter", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
911    @Description(shortDefinition="Device details", formalDefinition="Specific parameters for the ordered item.  For example, the prism value for lenses." )
912    protected List<DeviceRequestParameterComponent> parameter;
913
914    /**
915     * The patient who will use the device.
916     */
917    @Child(name = "subject", type = {Patient.class, Group.class, Location.class, Device.class}, order=11, min=1, max=1, modifier=false, summary=true)
918    @Description(shortDefinition="Focus of request", formalDefinition="The patient who will use the device." )
919    protected Reference subject;
920
921    /**
922     * The actual object that is the target of the reference (The patient who will use the device.)
923     */
924    protected Resource subjectTarget;
925
926    /**
927     * An encounter that provides additional context in which this request is made.
928     */
929    @Child(name = "encounter", type = {Encounter.class}, order=12, min=0, max=1, modifier=false, summary=true)
930    @Description(shortDefinition="Encounter motivating request", formalDefinition="An encounter that provides additional context in which this request is made." )
931    protected Reference encounter;
932
933    /**
934     * The actual object that is the target of the reference (An encounter that provides additional context in which this request is made.)
935     */
936    protected Encounter encounterTarget;
937
938    /**
939     * 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".
940     */
941    @Child(name = "occurrence", type = {DateTimeType.class, Period.class, Timing.class}, order=13, min=0, max=1, modifier=false, summary=true)
942    @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\"." )
943    protected Type occurrence;
944
945    /**
946     * When the request transitioned to being actionable.
947     */
948    @Child(name = "authoredOn", type = {DateTimeType.class}, order=14, min=0, max=1, modifier=false, summary=true)
949    @Description(shortDefinition="When recorded", formalDefinition="When the request transitioned to being actionable." )
950    protected DateTimeType authoredOn;
951
952    /**
953     * The individual who initiated the request and has responsibility for its activation.
954     */
955    @Child(name = "requester", type = {Device.class, Practitioner.class, PractitionerRole.class, Organization.class}, order=15, min=0, max=1, modifier=false, summary=true)
956    @Description(shortDefinition="Who/what is requesting diagnostics", formalDefinition="The individual who initiated the request and has responsibility for its activation." )
957    protected Reference requester;
958
959    /**
960     * The actual object that is the target of the reference (The individual who initiated the request and has responsibility for its activation.)
961     */
962    protected Resource requesterTarget;
963
964    /**
965     * Desired type of performer for doing the diagnostic testing.
966     */
967    @Child(name = "performerType", type = {CodeableConcept.class}, order=16, min=0, max=1, modifier=false, summary=true)
968    @Description(shortDefinition="Filler role", formalDefinition="Desired type of performer for doing the diagnostic testing." )
969    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/participant-role")
970    protected CodeableConcept performerType;
971
972    /**
973     * The desired performer for doing the diagnostic testing.
974     */
975    @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)
976    @Description(shortDefinition="Requested Filler", formalDefinition="The desired performer for doing the diagnostic testing." )
977    protected Reference performer;
978
979    /**
980     * The actual object that is the target of the reference (The desired performer for doing the diagnostic testing.)
981     */
982    protected Resource performerTarget;
983
984    /**
985     * Reason or justification for the use of this device.
986     */
987    @Child(name = "reasonCode", type = {CodeableConcept.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
988    @Description(shortDefinition="Coded Reason for request", formalDefinition="Reason or justification for the use of this device." )
989    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
990    protected List<CodeableConcept> reasonCode;
991
992    /**
993     * Reason or justification for the use of this device.
994     */
995    @Child(name = "reasonReference", type = {Condition.class, Observation.class, DiagnosticReport.class, DocumentReference.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
996    @Description(shortDefinition="Linked Reason for request", formalDefinition="Reason or justification for the use of this device." )
997    protected List<Reference> reasonReference;
998    /**
999     * The actual objects that are the target of the reference (Reason or justification for the use of this device.)
1000     */
1001    protected List<Resource> reasonReferenceTarget;
1002
1003
1004    /**
1005     * Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.
1006     */
1007    @Child(name = "insurance", type = {Coverage.class, ClaimResponse.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1008    @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." )
1009    protected List<Reference> insurance;
1010    /**
1011     * The actual objects that are the target of the reference (Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.)
1012     */
1013    protected List<Resource> insuranceTarget;
1014
1015
1016    /**
1017     * 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).
1018     */
1019    @Child(name = "supportingInfo", type = {Reference.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1020    @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)." )
1021    protected List<Reference> supportingInfo;
1022    /**
1023     * The actual objects that are the target of the reference (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).)
1024     */
1025    protected List<Resource> supportingInfoTarget;
1026
1027
1028    /**
1029     * 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.
1030     */
1031    @Child(name = "note", type = {Annotation.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1032    @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." )
1033    protected List<Annotation> note;
1034
1035    /**
1036     * Key events in the history of the request.
1037     */
1038    @Child(name = "relevantHistory", type = {Provenance.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1039    @Description(shortDefinition="Request provenance", formalDefinition="Key events in the history of the request." )
1040    protected List<Reference> relevantHistory;
1041    /**
1042     * The actual objects that are the target of the reference (Key events in the history of the request.)
1043     */
1044    protected List<Provenance> relevantHistoryTarget;
1045
1046
1047    private static final long serialVersionUID = 1484452423L;
1048
1049  /**
1050   * Constructor
1051   */
1052    public DeviceRequest() {
1053      super();
1054    }
1055
1056  /**
1057   * Constructor
1058   */
1059    public DeviceRequest(Enumeration<RequestIntent> intent, Type code, Reference subject) {
1060      super();
1061      this.intent = intent;
1062      this.code = code;
1063      this.subject = subject;
1064    }
1065
1066    /**
1067     * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.)
1068     */
1069    public List<Identifier> getIdentifier() { 
1070      if (this.identifier == null)
1071        this.identifier = new ArrayList<Identifier>();
1072      return this.identifier;
1073    }
1074
1075    /**
1076     * @return Returns a reference to <code>this</code> for easy method chaining
1077     */
1078    public DeviceRequest setIdentifier(List<Identifier> theIdentifier) { 
1079      this.identifier = theIdentifier;
1080      return this;
1081    }
1082
1083    public boolean hasIdentifier() { 
1084      if (this.identifier == null)
1085        return false;
1086      for (Identifier item : this.identifier)
1087        if (!item.isEmpty())
1088          return true;
1089      return false;
1090    }
1091
1092    public Identifier addIdentifier() { //3
1093      Identifier t = new Identifier();
1094      if (this.identifier == null)
1095        this.identifier = new ArrayList<Identifier>();
1096      this.identifier.add(t);
1097      return t;
1098    }
1099
1100    public DeviceRequest addIdentifier(Identifier t) { //3
1101      if (t == null)
1102        return this;
1103      if (this.identifier == null)
1104        this.identifier = new ArrayList<Identifier>();
1105      this.identifier.add(t);
1106      return this;
1107    }
1108
1109    /**
1110     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1111     */
1112    public Identifier getIdentifierFirstRep() { 
1113      if (getIdentifier().isEmpty()) {
1114        addIdentifier();
1115      }
1116      return getIdentifier().get(0);
1117    }
1118
1119    /**
1120     * @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.)
1121     */
1122    public List<CanonicalType> getInstantiatesCanonical() { 
1123      if (this.instantiatesCanonical == null)
1124        this.instantiatesCanonical = new ArrayList<CanonicalType>();
1125      return this.instantiatesCanonical;
1126    }
1127
1128    /**
1129     * @return Returns a reference to <code>this</code> for easy method chaining
1130     */
1131    public DeviceRequest setInstantiatesCanonical(List<CanonicalType> theInstantiatesCanonical) { 
1132      this.instantiatesCanonical = theInstantiatesCanonical;
1133      return this;
1134    }
1135
1136    public boolean hasInstantiatesCanonical() { 
1137      if (this.instantiatesCanonical == null)
1138        return false;
1139      for (CanonicalType item : this.instantiatesCanonical)
1140        if (!item.isEmpty())
1141          return true;
1142      return false;
1143    }
1144
1145    /**
1146     * @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.)
1147     */
1148    public CanonicalType addInstantiatesCanonicalElement() {//2 
1149      CanonicalType t = new CanonicalType();
1150      if (this.instantiatesCanonical == null)
1151        this.instantiatesCanonical = new ArrayList<CanonicalType>();
1152      this.instantiatesCanonical.add(t);
1153      return t;
1154    }
1155
1156    /**
1157     * @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.)
1158     */
1159    public DeviceRequest addInstantiatesCanonical(String value) { //1
1160      CanonicalType t = new CanonicalType();
1161      t.setValue(value);
1162      if (this.instantiatesCanonical == null)
1163        this.instantiatesCanonical = new ArrayList<CanonicalType>();
1164      this.instantiatesCanonical.add(t);
1165      return this;
1166    }
1167
1168    /**
1169     * @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.)
1170     */
1171    public boolean hasInstantiatesCanonical(String value) { 
1172      if (this.instantiatesCanonical == null)
1173        return false;
1174      for (CanonicalType v : this.instantiatesCanonical)
1175        if (v.getValue().equals(value)) // canonical(ActivityDefinition|PlanDefinition)
1176          return true;
1177      return false;
1178    }
1179
1180    /**
1181     * @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.)
1182     */
1183    public List<UriType> getInstantiatesUri() { 
1184      if (this.instantiatesUri == null)
1185        this.instantiatesUri = new ArrayList<UriType>();
1186      return this.instantiatesUri;
1187    }
1188
1189    /**
1190     * @return Returns a reference to <code>this</code> for easy method chaining
1191     */
1192    public DeviceRequest setInstantiatesUri(List<UriType> theInstantiatesUri) { 
1193      this.instantiatesUri = theInstantiatesUri;
1194      return this;
1195    }
1196
1197    public boolean hasInstantiatesUri() { 
1198      if (this.instantiatesUri == null)
1199        return false;
1200      for (UriType item : this.instantiatesUri)
1201        if (!item.isEmpty())
1202          return true;
1203      return false;
1204    }
1205
1206    /**
1207     * @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.)
1208     */
1209    public UriType addInstantiatesUriElement() {//2 
1210      UriType t = new UriType();
1211      if (this.instantiatesUri == null)
1212        this.instantiatesUri = new ArrayList<UriType>();
1213      this.instantiatesUri.add(t);
1214      return t;
1215    }
1216
1217    /**
1218     * @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.)
1219     */
1220    public DeviceRequest addInstantiatesUri(String value) { //1
1221      UriType t = new UriType();
1222      t.setValue(value);
1223      if (this.instantiatesUri == null)
1224        this.instantiatesUri = new ArrayList<UriType>();
1225      this.instantiatesUri.add(t);
1226      return this;
1227    }
1228
1229    /**
1230     * @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.)
1231     */
1232    public boolean hasInstantiatesUri(String value) { 
1233      if (this.instantiatesUri == null)
1234        return false;
1235      for (UriType v : this.instantiatesUri)
1236        if (v.getValue().equals(value)) // uri
1237          return true;
1238      return false;
1239    }
1240
1241    /**
1242     * @return {@link #basedOn} (Plan/proposal/order fulfilled by this request.)
1243     */
1244    public List<Reference> getBasedOn() { 
1245      if (this.basedOn == null)
1246        this.basedOn = new ArrayList<Reference>();
1247      return this.basedOn;
1248    }
1249
1250    /**
1251     * @return Returns a reference to <code>this</code> for easy method chaining
1252     */
1253    public DeviceRequest setBasedOn(List<Reference> theBasedOn) { 
1254      this.basedOn = theBasedOn;
1255      return this;
1256    }
1257
1258    public boolean hasBasedOn() { 
1259      if (this.basedOn == null)
1260        return false;
1261      for (Reference item : this.basedOn)
1262        if (!item.isEmpty())
1263          return true;
1264      return false;
1265    }
1266
1267    public Reference addBasedOn() { //3
1268      Reference t = new Reference();
1269      if (this.basedOn == null)
1270        this.basedOn = new ArrayList<Reference>();
1271      this.basedOn.add(t);
1272      return t;
1273    }
1274
1275    public DeviceRequest addBasedOn(Reference t) { //3
1276      if (t == null)
1277        return this;
1278      if (this.basedOn == null)
1279        this.basedOn = new ArrayList<Reference>();
1280      this.basedOn.add(t);
1281      return this;
1282    }
1283
1284    /**
1285     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist
1286     */
1287    public Reference getBasedOnFirstRep() { 
1288      if (getBasedOn().isEmpty()) {
1289        addBasedOn();
1290      }
1291      return getBasedOn().get(0);
1292    }
1293
1294    /**
1295     * @deprecated Use Reference#setResource(IBaseResource) instead
1296     */
1297    @Deprecated
1298    public List<Resource> getBasedOnTarget() { 
1299      if (this.basedOnTarget == null)
1300        this.basedOnTarget = new ArrayList<Resource>();
1301      return this.basedOnTarget;
1302    }
1303
1304    /**
1305     * @return {@link #priorRequest} (The request takes the place of the referenced completed or terminated request(s).)
1306     */
1307    public List<Reference> getPriorRequest() { 
1308      if (this.priorRequest == null)
1309        this.priorRequest = new ArrayList<Reference>();
1310      return this.priorRequest;
1311    }
1312
1313    /**
1314     * @return Returns a reference to <code>this</code> for easy method chaining
1315     */
1316    public DeviceRequest setPriorRequest(List<Reference> thePriorRequest) { 
1317      this.priorRequest = thePriorRequest;
1318      return this;
1319    }
1320
1321    public boolean hasPriorRequest() { 
1322      if (this.priorRequest == null)
1323        return false;
1324      for (Reference item : this.priorRequest)
1325        if (!item.isEmpty())
1326          return true;
1327      return false;
1328    }
1329
1330    public Reference addPriorRequest() { //3
1331      Reference t = new Reference();
1332      if (this.priorRequest == null)
1333        this.priorRequest = new ArrayList<Reference>();
1334      this.priorRequest.add(t);
1335      return t;
1336    }
1337
1338    public DeviceRequest addPriorRequest(Reference t) { //3
1339      if (t == null)
1340        return this;
1341      if (this.priorRequest == null)
1342        this.priorRequest = new ArrayList<Reference>();
1343      this.priorRequest.add(t);
1344      return this;
1345    }
1346
1347    /**
1348     * @return The first repetition of repeating field {@link #priorRequest}, creating it if it does not already exist
1349     */
1350    public Reference getPriorRequestFirstRep() { 
1351      if (getPriorRequest().isEmpty()) {
1352        addPriorRequest();
1353      }
1354      return getPriorRequest().get(0);
1355    }
1356
1357    /**
1358     * @deprecated Use Reference#setResource(IBaseResource) instead
1359     */
1360    @Deprecated
1361    public List<Resource> getPriorRequestTarget() { 
1362      if (this.priorRequestTarget == null)
1363        this.priorRequestTarget = new ArrayList<Resource>();
1364      return this.priorRequestTarget;
1365    }
1366
1367    /**
1368     * @return {@link #groupIdentifier} (Composite request this is part of.)
1369     */
1370    public Identifier getGroupIdentifier() { 
1371      if (this.groupIdentifier == null)
1372        if (Configuration.errorOnAutoCreate())
1373          throw new Error("Attempt to auto-create DeviceRequest.groupIdentifier");
1374        else if (Configuration.doAutoCreate())
1375          this.groupIdentifier = new Identifier(); // cc
1376      return this.groupIdentifier;
1377    }
1378
1379    public boolean hasGroupIdentifier() { 
1380      return this.groupIdentifier != null && !this.groupIdentifier.isEmpty();
1381    }
1382
1383    /**
1384     * @param value {@link #groupIdentifier} (Composite request this is part of.)
1385     */
1386    public DeviceRequest setGroupIdentifier(Identifier value) { 
1387      this.groupIdentifier = value;
1388      return this;
1389    }
1390
1391    /**
1392     * @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
1393     */
1394    public Enumeration<DeviceRequestStatus> getStatusElement() { 
1395      if (this.status == null)
1396        if (Configuration.errorOnAutoCreate())
1397          throw new Error("Attempt to auto-create DeviceRequest.status");
1398        else if (Configuration.doAutoCreate())
1399          this.status = new Enumeration<DeviceRequestStatus>(new DeviceRequestStatusEnumFactory()); // bb
1400      return this.status;
1401    }
1402
1403    public boolean hasStatusElement() { 
1404      return this.status != null && !this.status.isEmpty();
1405    }
1406
1407    public boolean hasStatus() { 
1408      return this.status != null && !this.status.isEmpty();
1409    }
1410
1411    /**
1412     * @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
1413     */
1414    public DeviceRequest setStatusElement(Enumeration<DeviceRequestStatus> value) { 
1415      this.status = value;
1416      return this;
1417    }
1418
1419    /**
1420     * @return The status of the request.
1421     */
1422    public DeviceRequestStatus getStatus() { 
1423      return this.status == null ? null : this.status.getValue();
1424    }
1425
1426    /**
1427     * @param value The status of the request.
1428     */
1429    public DeviceRequest setStatus(DeviceRequestStatus value) { 
1430      if (value == null)
1431        this.status = null;
1432      else {
1433        if (this.status == null)
1434          this.status = new Enumeration<DeviceRequestStatus>(new DeviceRequestStatusEnumFactory());
1435        this.status.setValue(value);
1436      }
1437      return this;
1438    }
1439
1440    /**
1441     * @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
1442     */
1443    public Enumeration<RequestIntent> getIntentElement() { 
1444      if (this.intent == null)
1445        if (Configuration.errorOnAutoCreate())
1446          throw new Error("Attempt to auto-create DeviceRequest.intent");
1447        else if (Configuration.doAutoCreate())
1448          this.intent = new Enumeration<RequestIntent>(new RequestIntentEnumFactory()); // bb
1449      return this.intent;
1450    }
1451
1452    public boolean hasIntentElement() { 
1453      return this.intent != null && !this.intent.isEmpty();
1454    }
1455
1456    public boolean hasIntent() { 
1457      return this.intent != null && !this.intent.isEmpty();
1458    }
1459
1460    /**
1461     * @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
1462     */
1463    public DeviceRequest setIntentElement(Enumeration<RequestIntent> value) { 
1464      this.intent = value;
1465      return this;
1466    }
1467
1468    /**
1469     * @return Whether the request is a proposal, plan, an original order or a reflex order.
1470     */
1471    public RequestIntent getIntent() { 
1472      return this.intent == null ? null : this.intent.getValue();
1473    }
1474
1475    /**
1476     * @param value Whether the request is a proposal, plan, an original order or a reflex order.
1477     */
1478    public DeviceRequest setIntent(RequestIntent value) { 
1479        if (this.intent == null)
1480          this.intent = new Enumeration<RequestIntent>(new RequestIntentEnumFactory());
1481        this.intent.setValue(value);
1482      return this;
1483    }
1484
1485    /**
1486     * @return {@link #priority} (Indicates how quickly the {{title}} 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
1487     */
1488    public Enumeration<RequestPriority> getPriorityElement() { 
1489      if (this.priority == null)
1490        if (Configuration.errorOnAutoCreate())
1491          throw new Error("Attempt to auto-create DeviceRequest.priority");
1492        else if (Configuration.doAutoCreate())
1493          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory()); // bb
1494      return this.priority;
1495    }
1496
1497    public boolean hasPriorityElement() { 
1498      return this.priority != null && !this.priority.isEmpty();
1499    }
1500
1501    public boolean hasPriority() { 
1502      return this.priority != null && !this.priority.isEmpty();
1503    }
1504
1505    /**
1506     * @param value {@link #priority} (Indicates how quickly the {{title}} 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
1507     */
1508    public DeviceRequest setPriorityElement(Enumeration<RequestPriority> value) { 
1509      this.priority = value;
1510      return this;
1511    }
1512
1513    /**
1514     * @return Indicates how quickly the {{title}} should be addressed with respect to other requests.
1515     */
1516    public RequestPriority getPriority() { 
1517      return this.priority == null ? null : this.priority.getValue();
1518    }
1519
1520    /**
1521     * @param value Indicates how quickly the {{title}} should be addressed with respect to other requests.
1522     */
1523    public DeviceRequest setPriority(RequestPriority value) { 
1524      if (value == null)
1525        this.priority = null;
1526      else {
1527        if (this.priority == null)
1528          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory());
1529        this.priority.setValue(value);
1530      }
1531      return this;
1532    }
1533
1534    /**
1535     * @return {@link #code} (The details of the device to be used.)
1536     */
1537    public Type getCode() { 
1538      return this.code;
1539    }
1540
1541    /**
1542     * @return {@link #code} (The details of the device to be used.)
1543     */
1544    public Reference getCodeReference() throws FHIRException { 
1545      if (this.code == null)
1546        this.code = new Reference();
1547      if (!(this.code instanceof Reference))
1548        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.code.getClass().getName()+" was encountered");
1549      return (Reference) this.code;
1550    }
1551
1552    public boolean hasCodeReference() { 
1553      return this != null && this.code instanceof Reference;
1554    }
1555
1556    /**
1557     * @return {@link #code} (The details of the device to be used.)
1558     */
1559    public CodeableConcept getCodeCodeableConcept() throws FHIRException { 
1560      if (this.code == null)
1561        this.code = new CodeableConcept();
1562      if (!(this.code instanceof CodeableConcept))
1563        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.code.getClass().getName()+" was encountered");
1564      return (CodeableConcept) this.code;
1565    }
1566
1567    public boolean hasCodeCodeableConcept() { 
1568      return this != null && this.code instanceof CodeableConcept;
1569    }
1570
1571    public boolean hasCode() { 
1572      return this.code != null && !this.code.isEmpty();
1573    }
1574
1575    /**
1576     * @param value {@link #code} (The details of the device to be used.)
1577     */
1578    public DeviceRequest setCode(Type value) { 
1579      if (value != null && !(value instanceof Reference || value instanceof CodeableConcept))
1580        throw new Error("Not the right type for DeviceRequest.code[x]: "+value.fhirType());
1581      this.code = value;
1582      return this;
1583    }
1584
1585    /**
1586     * @return {@link #parameter} (Specific parameters for the ordered item.  For example, the prism value for lenses.)
1587     */
1588    public List<DeviceRequestParameterComponent> getParameter() { 
1589      if (this.parameter == null)
1590        this.parameter = new ArrayList<DeviceRequestParameterComponent>();
1591      return this.parameter;
1592    }
1593
1594    /**
1595     * @return Returns a reference to <code>this</code> for easy method chaining
1596     */
1597    public DeviceRequest setParameter(List<DeviceRequestParameterComponent> theParameter) { 
1598      this.parameter = theParameter;
1599      return this;
1600    }
1601
1602    public boolean hasParameter() { 
1603      if (this.parameter == null)
1604        return false;
1605      for (DeviceRequestParameterComponent item : this.parameter)
1606        if (!item.isEmpty())
1607          return true;
1608      return false;
1609    }
1610
1611    public DeviceRequestParameterComponent addParameter() { //3
1612      DeviceRequestParameterComponent t = new DeviceRequestParameterComponent();
1613      if (this.parameter == null)
1614        this.parameter = new ArrayList<DeviceRequestParameterComponent>();
1615      this.parameter.add(t);
1616      return t;
1617    }
1618
1619    public DeviceRequest addParameter(DeviceRequestParameterComponent t) { //3
1620      if (t == null)
1621        return this;
1622      if (this.parameter == null)
1623        this.parameter = new ArrayList<DeviceRequestParameterComponent>();
1624      this.parameter.add(t);
1625      return this;
1626    }
1627
1628    /**
1629     * @return The first repetition of repeating field {@link #parameter}, creating it if it does not already exist
1630     */
1631    public DeviceRequestParameterComponent getParameterFirstRep() { 
1632      if (getParameter().isEmpty()) {
1633        addParameter();
1634      }
1635      return getParameter().get(0);
1636    }
1637
1638    /**
1639     * @return {@link #subject} (The patient who will use the device.)
1640     */
1641    public Reference getSubject() { 
1642      if (this.subject == null)
1643        if (Configuration.errorOnAutoCreate())
1644          throw new Error("Attempt to auto-create DeviceRequest.subject");
1645        else if (Configuration.doAutoCreate())
1646          this.subject = new Reference(); // cc
1647      return this.subject;
1648    }
1649
1650    public boolean hasSubject() { 
1651      return this.subject != null && !this.subject.isEmpty();
1652    }
1653
1654    /**
1655     * @param value {@link #subject} (The patient who will use the device.)
1656     */
1657    public DeviceRequest setSubject(Reference value) { 
1658      this.subject = value;
1659      return this;
1660    }
1661
1662    /**
1663     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who will use the device.)
1664     */
1665    public Resource getSubjectTarget() { 
1666      return this.subjectTarget;
1667    }
1668
1669    /**
1670     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who will use the device.)
1671     */
1672    public DeviceRequest setSubjectTarget(Resource value) { 
1673      this.subjectTarget = value;
1674      return this;
1675    }
1676
1677    /**
1678     * @return {@link #encounter} (An encounter that provides additional context in which this request is made.)
1679     */
1680    public Reference getEncounter() { 
1681      if (this.encounter == null)
1682        if (Configuration.errorOnAutoCreate())
1683          throw new Error("Attempt to auto-create DeviceRequest.encounter");
1684        else if (Configuration.doAutoCreate())
1685          this.encounter = new Reference(); // cc
1686      return this.encounter;
1687    }
1688
1689    public boolean hasEncounter() { 
1690      return this.encounter != null && !this.encounter.isEmpty();
1691    }
1692
1693    /**
1694     * @param value {@link #encounter} (An encounter that provides additional context in which this request is made.)
1695     */
1696    public DeviceRequest setEncounter(Reference value) { 
1697      this.encounter = value;
1698      return this;
1699    }
1700
1701    /**
1702     * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An encounter that provides additional context in which this request is made.)
1703     */
1704    public Encounter getEncounterTarget() { 
1705      if (this.encounterTarget == null)
1706        if (Configuration.errorOnAutoCreate())
1707          throw new Error("Attempt to auto-create DeviceRequest.encounter");
1708        else if (Configuration.doAutoCreate())
1709          this.encounterTarget = new Encounter(); // aa
1710      return this.encounterTarget;
1711    }
1712
1713    /**
1714     * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An encounter that provides additional context in which this request is made.)
1715     */
1716    public DeviceRequest setEncounterTarget(Encounter value) { 
1717      this.encounterTarget = value;
1718      return this;
1719    }
1720
1721    /**
1722     * @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".)
1723     */
1724    public Type getOccurrence() { 
1725      return this.occurrence;
1726    }
1727
1728    /**
1729     * @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".)
1730     */
1731    public DateTimeType getOccurrenceDateTimeType() throws FHIRException { 
1732      if (this.occurrence == null)
1733        this.occurrence = new DateTimeType();
1734      if (!(this.occurrence instanceof DateTimeType))
1735        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1736      return (DateTimeType) this.occurrence;
1737    }
1738
1739    public boolean hasOccurrenceDateTimeType() { 
1740      return this != null && this.occurrence instanceof DateTimeType;
1741    }
1742
1743    /**
1744     * @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".)
1745     */
1746    public Period getOccurrencePeriod() throws FHIRException { 
1747      if (this.occurrence == null)
1748        this.occurrence = new Period();
1749      if (!(this.occurrence instanceof Period))
1750        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1751      return (Period) this.occurrence;
1752    }
1753
1754    public boolean hasOccurrencePeriod() { 
1755      return this != null && this.occurrence instanceof Period;
1756    }
1757
1758    /**
1759     * @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".)
1760     */
1761    public Timing getOccurrenceTiming() throws FHIRException { 
1762      if (this.occurrence == null)
1763        this.occurrence = new Timing();
1764      if (!(this.occurrence instanceof Timing))
1765        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1766      return (Timing) this.occurrence;
1767    }
1768
1769    public boolean hasOccurrenceTiming() { 
1770      return this != null && this.occurrence instanceof Timing;
1771    }
1772
1773    public boolean hasOccurrence() { 
1774      return this.occurrence != null && !this.occurrence.isEmpty();
1775    }
1776
1777    /**
1778     * @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".)
1779     */
1780    public DeviceRequest setOccurrence(Type value) { 
1781      if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof Timing))
1782        throw new Error("Not the right type for DeviceRequest.occurrence[x]: "+value.fhirType());
1783      this.occurrence = value;
1784      return this;
1785    }
1786
1787    /**
1788     * @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
1789     */
1790    public DateTimeType getAuthoredOnElement() { 
1791      if (this.authoredOn == null)
1792        if (Configuration.errorOnAutoCreate())
1793          throw new Error("Attempt to auto-create DeviceRequest.authoredOn");
1794        else if (Configuration.doAutoCreate())
1795          this.authoredOn = new DateTimeType(); // bb
1796      return this.authoredOn;
1797    }
1798
1799    public boolean hasAuthoredOnElement() { 
1800      return this.authoredOn != null && !this.authoredOn.isEmpty();
1801    }
1802
1803    public boolean hasAuthoredOn() { 
1804      return this.authoredOn != null && !this.authoredOn.isEmpty();
1805    }
1806
1807    /**
1808     * @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
1809     */
1810    public DeviceRequest setAuthoredOnElement(DateTimeType value) { 
1811      this.authoredOn = value;
1812      return this;
1813    }
1814
1815    /**
1816     * @return When the request transitioned to being actionable.
1817     */
1818    public Date getAuthoredOn() { 
1819      return this.authoredOn == null ? null : this.authoredOn.getValue();
1820    }
1821
1822    /**
1823     * @param value When the request transitioned to being actionable.
1824     */
1825    public DeviceRequest setAuthoredOn(Date value) { 
1826      if (value == null)
1827        this.authoredOn = null;
1828      else {
1829        if (this.authoredOn == null)
1830          this.authoredOn = new DateTimeType();
1831        this.authoredOn.setValue(value);
1832      }
1833      return this;
1834    }
1835
1836    /**
1837     * @return {@link #requester} (The individual who initiated the request and has responsibility for its activation.)
1838     */
1839    public Reference getRequester() { 
1840      if (this.requester == null)
1841        if (Configuration.errorOnAutoCreate())
1842          throw new Error("Attempt to auto-create DeviceRequest.requester");
1843        else if (Configuration.doAutoCreate())
1844          this.requester = new Reference(); // cc
1845      return this.requester;
1846    }
1847
1848    public boolean hasRequester() { 
1849      return this.requester != null && !this.requester.isEmpty();
1850    }
1851
1852    /**
1853     * @param value {@link #requester} (The individual who initiated the request and has responsibility for its activation.)
1854     */
1855    public DeviceRequest setRequester(Reference value) { 
1856      this.requester = value;
1857      return this;
1858    }
1859
1860    /**
1861     * @return {@link #requester} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual who initiated the request and has responsibility for its activation.)
1862     */
1863    public Resource getRequesterTarget() { 
1864      return this.requesterTarget;
1865    }
1866
1867    /**
1868     * @param value {@link #requester} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual who initiated the request and has responsibility for its activation.)
1869     */
1870    public DeviceRequest setRequesterTarget(Resource value) { 
1871      this.requesterTarget = value;
1872      return this;
1873    }
1874
1875    /**
1876     * @return {@link #performerType} (Desired type of performer for doing the diagnostic testing.)
1877     */
1878    public CodeableConcept getPerformerType() { 
1879      if (this.performerType == null)
1880        if (Configuration.errorOnAutoCreate())
1881          throw new Error("Attempt to auto-create DeviceRequest.performerType");
1882        else if (Configuration.doAutoCreate())
1883          this.performerType = new CodeableConcept(); // cc
1884      return this.performerType;
1885    }
1886
1887    public boolean hasPerformerType() { 
1888      return this.performerType != null && !this.performerType.isEmpty();
1889    }
1890
1891    /**
1892     * @param value {@link #performerType} (Desired type of performer for doing the diagnostic testing.)
1893     */
1894    public DeviceRequest setPerformerType(CodeableConcept value) { 
1895      this.performerType = value;
1896      return this;
1897    }
1898
1899    /**
1900     * @return {@link #performer} (The desired performer for doing the diagnostic testing.)
1901     */
1902    public Reference getPerformer() { 
1903      if (this.performer == null)
1904        if (Configuration.errorOnAutoCreate())
1905          throw new Error("Attempt to auto-create DeviceRequest.performer");
1906        else if (Configuration.doAutoCreate())
1907          this.performer = new Reference(); // cc
1908      return this.performer;
1909    }
1910
1911    public boolean hasPerformer() { 
1912      return this.performer != null && !this.performer.isEmpty();
1913    }
1914
1915    /**
1916     * @param value {@link #performer} (The desired performer for doing the diagnostic testing.)
1917     */
1918    public DeviceRequest setPerformer(Reference value) { 
1919      this.performer = value;
1920      return this;
1921    }
1922
1923    /**
1924     * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The desired performer for doing the diagnostic testing.)
1925     */
1926    public Resource getPerformerTarget() { 
1927      return this.performerTarget;
1928    }
1929
1930    /**
1931     * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The desired performer for doing the diagnostic testing.)
1932     */
1933    public DeviceRequest setPerformerTarget(Resource value) { 
1934      this.performerTarget = value;
1935      return this;
1936    }
1937
1938    /**
1939     * @return {@link #reasonCode} (Reason or justification for the use of this device.)
1940     */
1941    public List<CodeableConcept> getReasonCode() { 
1942      if (this.reasonCode == null)
1943        this.reasonCode = new ArrayList<CodeableConcept>();
1944      return this.reasonCode;
1945    }
1946
1947    /**
1948     * @return Returns a reference to <code>this</code> for easy method chaining
1949     */
1950    public DeviceRequest setReasonCode(List<CodeableConcept> theReasonCode) { 
1951      this.reasonCode = theReasonCode;
1952      return this;
1953    }
1954
1955    public boolean hasReasonCode() { 
1956      if (this.reasonCode == null)
1957        return false;
1958      for (CodeableConcept item : this.reasonCode)
1959        if (!item.isEmpty())
1960          return true;
1961      return false;
1962    }
1963
1964    public CodeableConcept addReasonCode() { //3
1965      CodeableConcept t = new CodeableConcept();
1966      if (this.reasonCode == null)
1967        this.reasonCode = new ArrayList<CodeableConcept>();
1968      this.reasonCode.add(t);
1969      return t;
1970    }
1971
1972    public DeviceRequest addReasonCode(CodeableConcept t) { //3
1973      if (t == null)
1974        return this;
1975      if (this.reasonCode == null)
1976        this.reasonCode = new ArrayList<CodeableConcept>();
1977      this.reasonCode.add(t);
1978      return this;
1979    }
1980
1981    /**
1982     * @return The first repetition of repeating field {@link #reasonCode}, creating it if it does not already exist
1983     */
1984    public CodeableConcept getReasonCodeFirstRep() { 
1985      if (getReasonCode().isEmpty()) {
1986        addReasonCode();
1987      }
1988      return getReasonCode().get(0);
1989    }
1990
1991    /**
1992     * @return {@link #reasonReference} (Reason or justification for the use of this device.)
1993     */
1994    public List<Reference> getReasonReference() { 
1995      if (this.reasonReference == null)
1996        this.reasonReference = new ArrayList<Reference>();
1997      return this.reasonReference;
1998    }
1999
2000    /**
2001     * @return Returns a reference to <code>this</code> for easy method chaining
2002     */
2003    public DeviceRequest setReasonReference(List<Reference> theReasonReference) { 
2004      this.reasonReference = theReasonReference;
2005      return this;
2006    }
2007
2008    public boolean hasReasonReference() { 
2009      if (this.reasonReference == null)
2010        return false;
2011      for (Reference item : this.reasonReference)
2012        if (!item.isEmpty())
2013          return true;
2014      return false;
2015    }
2016
2017    public Reference addReasonReference() { //3
2018      Reference t = new Reference();
2019      if (this.reasonReference == null)
2020        this.reasonReference = new ArrayList<Reference>();
2021      this.reasonReference.add(t);
2022      return t;
2023    }
2024
2025    public DeviceRequest addReasonReference(Reference t) { //3
2026      if (t == null)
2027        return this;
2028      if (this.reasonReference == null)
2029        this.reasonReference = new ArrayList<Reference>();
2030      this.reasonReference.add(t);
2031      return this;
2032    }
2033
2034    /**
2035     * @return The first repetition of repeating field {@link #reasonReference}, creating it if it does not already exist
2036     */
2037    public Reference getReasonReferenceFirstRep() { 
2038      if (getReasonReference().isEmpty()) {
2039        addReasonReference();
2040      }
2041      return getReasonReference().get(0);
2042    }
2043
2044    /**
2045     * @deprecated Use Reference#setResource(IBaseResource) instead
2046     */
2047    @Deprecated
2048    public List<Resource> getReasonReferenceTarget() { 
2049      if (this.reasonReferenceTarget == null)
2050        this.reasonReferenceTarget = new ArrayList<Resource>();
2051      return this.reasonReferenceTarget;
2052    }
2053
2054    /**
2055     * @return {@link #insurance} (Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.)
2056     */
2057    public List<Reference> getInsurance() { 
2058      if (this.insurance == null)
2059        this.insurance = new ArrayList<Reference>();
2060      return this.insurance;
2061    }
2062
2063    /**
2064     * @return Returns a reference to <code>this</code> for easy method chaining
2065     */
2066    public DeviceRequest setInsurance(List<Reference> theInsurance) { 
2067      this.insurance = theInsurance;
2068      return this;
2069    }
2070
2071    public boolean hasInsurance() { 
2072      if (this.insurance == null)
2073        return false;
2074      for (Reference item : this.insurance)
2075        if (!item.isEmpty())
2076          return true;
2077      return false;
2078    }
2079
2080    public Reference addInsurance() { //3
2081      Reference t = new Reference();
2082      if (this.insurance == null)
2083        this.insurance = new ArrayList<Reference>();
2084      this.insurance.add(t);
2085      return t;
2086    }
2087
2088    public DeviceRequest addInsurance(Reference t) { //3
2089      if (t == null)
2090        return this;
2091      if (this.insurance == null)
2092        this.insurance = new ArrayList<Reference>();
2093      this.insurance.add(t);
2094      return this;
2095    }
2096
2097    /**
2098     * @return The first repetition of repeating field {@link #insurance}, creating it if it does not already exist
2099     */
2100    public Reference getInsuranceFirstRep() { 
2101      if (getInsurance().isEmpty()) {
2102        addInsurance();
2103      }
2104      return getInsurance().get(0);
2105    }
2106
2107    /**
2108     * @deprecated Use Reference#setResource(IBaseResource) instead
2109     */
2110    @Deprecated
2111    public List<Resource> getInsuranceTarget() { 
2112      if (this.insuranceTarget == null)
2113        this.insuranceTarget = new ArrayList<Resource>();
2114      return this.insuranceTarget;
2115    }
2116
2117    /**
2118     * @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).)
2119     */
2120    public List<Reference> getSupportingInfo() { 
2121      if (this.supportingInfo == null)
2122        this.supportingInfo = new ArrayList<Reference>();
2123      return this.supportingInfo;
2124    }
2125
2126    /**
2127     * @return Returns a reference to <code>this</code> for easy method chaining
2128     */
2129    public DeviceRequest setSupportingInfo(List<Reference> theSupportingInfo) { 
2130      this.supportingInfo = theSupportingInfo;
2131      return this;
2132    }
2133
2134    public boolean hasSupportingInfo() { 
2135      if (this.supportingInfo == null)
2136        return false;
2137      for (Reference item : this.supportingInfo)
2138        if (!item.isEmpty())
2139          return true;
2140      return false;
2141    }
2142
2143    public Reference addSupportingInfo() { //3
2144      Reference t = new Reference();
2145      if (this.supportingInfo == null)
2146        this.supportingInfo = new ArrayList<Reference>();
2147      this.supportingInfo.add(t);
2148      return t;
2149    }
2150
2151    public DeviceRequest addSupportingInfo(Reference t) { //3
2152      if (t == null)
2153        return this;
2154      if (this.supportingInfo == null)
2155        this.supportingInfo = new ArrayList<Reference>();
2156      this.supportingInfo.add(t);
2157      return this;
2158    }
2159
2160    /**
2161     * @return The first repetition of repeating field {@link #supportingInfo}, creating it if it does not already exist
2162     */
2163    public Reference getSupportingInfoFirstRep() { 
2164      if (getSupportingInfo().isEmpty()) {
2165        addSupportingInfo();
2166      }
2167      return getSupportingInfo().get(0);
2168    }
2169
2170    /**
2171     * @deprecated Use Reference#setResource(IBaseResource) instead
2172     */
2173    @Deprecated
2174    public List<Resource> getSupportingInfoTarget() { 
2175      if (this.supportingInfoTarget == null)
2176        this.supportingInfoTarget = new ArrayList<Resource>();
2177      return this.supportingInfoTarget;
2178    }
2179
2180    /**
2181     * @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.)
2182     */
2183    public List<Annotation> getNote() { 
2184      if (this.note == null)
2185        this.note = new ArrayList<Annotation>();
2186      return this.note;
2187    }
2188
2189    /**
2190     * @return Returns a reference to <code>this</code> for easy method chaining
2191     */
2192    public DeviceRequest setNote(List<Annotation> theNote) { 
2193      this.note = theNote;
2194      return this;
2195    }
2196
2197    public boolean hasNote() { 
2198      if (this.note == null)
2199        return false;
2200      for (Annotation item : this.note)
2201        if (!item.isEmpty())
2202          return true;
2203      return false;
2204    }
2205
2206    public Annotation addNote() { //3
2207      Annotation t = new Annotation();
2208      if (this.note == null)
2209        this.note = new ArrayList<Annotation>();
2210      this.note.add(t);
2211      return t;
2212    }
2213
2214    public DeviceRequest addNote(Annotation t) { //3
2215      if (t == null)
2216        return this;
2217      if (this.note == null)
2218        this.note = new ArrayList<Annotation>();
2219      this.note.add(t);
2220      return this;
2221    }
2222
2223    /**
2224     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
2225     */
2226    public Annotation getNoteFirstRep() { 
2227      if (getNote().isEmpty()) {
2228        addNote();
2229      }
2230      return getNote().get(0);
2231    }
2232
2233    /**
2234     * @return {@link #relevantHistory} (Key events in the history of the request.)
2235     */
2236    public List<Reference> getRelevantHistory() { 
2237      if (this.relevantHistory == null)
2238        this.relevantHistory = new ArrayList<Reference>();
2239      return this.relevantHistory;
2240    }
2241
2242    /**
2243     * @return Returns a reference to <code>this</code> for easy method chaining
2244     */
2245    public DeviceRequest setRelevantHistory(List<Reference> theRelevantHistory) { 
2246      this.relevantHistory = theRelevantHistory;
2247      return this;
2248    }
2249
2250    public boolean hasRelevantHistory() { 
2251      if (this.relevantHistory == null)
2252        return false;
2253      for (Reference item : this.relevantHistory)
2254        if (!item.isEmpty())
2255          return true;
2256      return false;
2257    }
2258
2259    public Reference addRelevantHistory() { //3
2260      Reference t = new Reference();
2261      if (this.relevantHistory == null)
2262        this.relevantHistory = new ArrayList<Reference>();
2263      this.relevantHistory.add(t);
2264      return t;
2265    }
2266
2267    public DeviceRequest addRelevantHistory(Reference t) { //3
2268      if (t == null)
2269        return this;
2270      if (this.relevantHistory == null)
2271        this.relevantHistory = new ArrayList<Reference>();
2272      this.relevantHistory.add(t);
2273      return this;
2274    }
2275
2276    /**
2277     * @return The first repetition of repeating field {@link #relevantHistory}, creating it if it does not already exist
2278     */
2279    public Reference getRelevantHistoryFirstRep() { 
2280      if (getRelevantHistory().isEmpty()) {
2281        addRelevantHistory();
2282      }
2283      return getRelevantHistory().get(0);
2284    }
2285
2286    /**
2287     * @deprecated Use Reference#setResource(IBaseResource) instead
2288     */
2289    @Deprecated
2290    public List<Provenance> getRelevantHistoryTarget() { 
2291      if (this.relevantHistoryTarget == null)
2292        this.relevantHistoryTarget = new ArrayList<Provenance>();
2293      return this.relevantHistoryTarget;
2294    }
2295
2296    /**
2297     * @deprecated Use Reference#setResource(IBaseResource) instead
2298     */
2299    @Deprecated
2300    public Provenance addRelevantHistoryTarget() { 
2301      Provenance r = new Provenance();
2302      if (this.relevantHistoryTarget == null)
2303        this.relevantHistoryTarget = new ArrayList<Provenance>();
2304      this.relevantHistoryTarget.add(r);
2305      return r;
2306    }
2307
2308      protected void listChildren(List<Property> children) {
2309        super.listChildren(children);
2310        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));
2311        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));
2312        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));
2313        children.add(new Property("basedOn", "Reference(Any)", "Plan/proposal/order fulfilled by this request.", 0, java.lang.Integer.MAX_VALUE, basedOn));
2314        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));
2315        children.add(new Property("groupIdentifier", "Identifier", "Composite request this is part of.", 0, 1, groupIdentifier));
2316        children.add(new Property("status", "code", "The status of the request.", 0, 1, status));
2317        children.add(new Property("intent", "code", "Whether the request is a proposal, plan, an original order or a reflex order.", 0, 1, intent));
2318        children.add(new Property("priority", "code", "Indicates how quickly the {{title}} should be addressed with respect to other requests.", 0, 1, priority));
2319        children.add(new Property("code[x]", "Reference(Device)|CodeableConcept", "The details of the device to be used.", 0, 1, code));
2320        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));
2321        children.add(new Property("subject", "Reference(Patient|Group|Location|Device)", "The patient who will use the device.", 0, 1, subject));
2322        children.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional context in which this request is made.", 0, 1, encounter));
2323        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));
2324        children.add(new Property("authoredOn", "dateTime", "When the request transitioned to being actionable.", 0, 1, authoredOn));
2325        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));
2326        children.add(new Property("performerType", "CodeableConcept", "Desired type of performer for doing the diagnostic testing.", 0, 1, performerType));
2327        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));
2328        children.add(new Property("reasonCode", "CodeableConcept", "Reason or justification for the use of this device.", 0, java.lang.Integer.MAX_VALUE, reasonCode));
2329        children.add(new Property("reasonReference", "Reference(Condition|Observation|DiagnosticReport|DocumentReference)", "Reason or justification for the use of this device.", 0, java.lang.Integer.MAX_VALUE, reasonReference));
2330        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));
2331        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));
2332        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));
2333        children.add(new Property("relevantHistory", "Reference(Provenance)", "Key events in the history of the request.", 0, java.lang.Integer.MAX_VALUE, relevantHistory));
2334      }
2335
2336      @Override
2337      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2338        switch (_hash) {
2339        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);
2340        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);
2341        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);
2342        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(Any)", "Plan/proposal/order fulfilled by this request.", 0, java.lang.Integer.MAX_VALUE, basedOn);
2343        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);
2344        case -445338488: /*groupIdentifier*/  return new Property("groupIdentifier", "Identifier", "Composite request this is part of.", 0, 1, groupIdentifier);
2345        case -892481550: /*status*/  return new Property("status", "code", "The status of the request.", 0, 1, status);
2346        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);
2347        case -1165461084: /*priority*/  return new Property("priority", "code", "Indicates how quickly the {{title}} should be addressed with respect to other requests.", 0, 1, priority);
2348        case 941839219: /*code[x]*/  return new Property("code[x]", "Reference(Device)|CodeableConcept", "The details of the device to be used.", 0, 1, code);
2349        case 3059181: /*code*/  return new Property("code[x]", "Reference(Device)|CodeableConcept", "The details of the device to be used.", 0, 1, code);
2350        case 1565461470: /*codeReference*/  return new Property("code[x]", "Reference(Device)|CodeableConcept", "The details of the device to be used.", 0, 1, code);
2351        case 4899316: /*codeCodeableConcept*/  return new Property("code[x]", "Reference(Device)|CodeableConcept", "The details of the device to be used.", 0, 1, code);
2352        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);
2353        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Location|Device)", "The patient who will use the device.", 0, 1, subject);
2354        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "An encounter that provides additional context in which this request is made.", 0, 1, encounter);
2355        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);
2356        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);
2357        case -298443636: /*occurrenceDateTime*/  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);
2358        case 1397156594: /*occurrencePeriod*/  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);
2359        case 1515218299: /*occurrenceTiming*/  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);
2360        case -1500852503: /*authoredOn*/  return new Property("authoredOn", "dateTime", "When the request transitioned to being actionable.", 0, 1, authoredOn);
2361        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);
2362        case -901444568: /*performerType*/  return new Property("performerType", "CodeableConcept", "Desired type of performer for doing the diagnostic testing.", 0, 1, performerType);
2363        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);
2364        case 722137681: /*reasonCode*/  return new Property("reasonCode", "CodeableConcept", "Reason or justification for the use of this device.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
2365        case -1146218137: /*reasonReference*/  return new Property("reasonReference", "Reference(Condition|Observation|DiagnosticReport|DocumentReference)", "Reason or justification for the use of this device.", 0, java.lang.Integer.MAX_VALUE, reasonReference);
2366        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);
2367        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);
2368        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);
2369        case 1538891575: /*relevantHistory*/  return new Property("relevantHistory", "Reference(Provenance)", "Key events in the history of the request.", 0, java.lang.Integer.MAX_VALUE, relevantHistory);
2370        default: return super.getNamedProperty(_hash, _name, _checkValid);
2371        }
2372
2373      }
2374
2375      @Override
2376      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2377        switch (hash) {
2378        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2379        case 8911915: /*instantiatesCanonical*/ return this.instantiatesCanonical == null ? new Base[0] : this.instantiatesCanonical.toArray(new Base[this.instantiatesCanonical.size()]); // CanonicalType
2380        case -1926393373: /*instantiatesUri*/ return this.instantiatesUri == null ? new Base[0] : this.instantiatesUri.toArray(new Base[this.instantiatesUri.size()]); // UriType
2381        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2382        case 237568101: /*priorRequest*/ return this.priorRequest == null ? new Base[0] : this.priorRequest.toArray(new Base[this.priorRequest.size()]); // Reference
2383        case -445338488: /*groupIdentifier*/ return this.groupIdentifier == null ? new Base[0] : new Base[] {this.groupIdentifier}; // Identifier
2384        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<DeviceRequestStatus>
2385        case -1183762788: /*intent*/ return this.intent == null ? new Base[0] : new Base[] {this.intent}; // Enumeration<RequestIntent>
2386        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration<RequestPriority>
2387        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Type
2388        case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // DeviceRequestParameterComponent
2389        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2390        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
2391        case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // Type
2392        case -1500852503: /*authoredOn*/ return this.authoredOn == null ? new Base[0] : new Base[] {this.authoredOn}; // DateTimeType
2393        case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference
2394        case -901444568: /*performerType*/ return this.performerType == null ? new Base[0] : new Base[] {this.performerType}; // CodeableConcept
2395        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference
2396        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
2397        case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
2398        case 73049818: /*insurance*/ return this.insurance == null ? new Base[0] : this.insurance.toArray(new Base[this.insurance.size()]); // Reference
2399        case 1922406657: /*supportingInfo*/ return this.supportingInfo == null ? new Base[0] : this.supportingInfo.toArray(new Base[this.supportingInfo.size()]); // Reference
2400        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2401        case 1538891575: /*relevantHistory*/ return this.relevantHistory == null ? new Base[0] : this.relevantHistory.toArray(new Base[this.relevantHistory.size()]); // Reference
2402        default: return super.getProperty(hash, name, checkValid);
2403        }
2404
2405      }
2406
2407      @Override
2408      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2409        switch (hash) {
2410        case -1618432855: // identifier
2411          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2412          return value;
2413        case 8911915: // instantiatesCanonical
2414          this.getInstantiatesCanonical().add(castToCanonical(value)); // CanonicalType
2415          return value;
2416        case -1926393373: // instantiatesUri
2417          this.getInstantiatesUri().add(castToUri(value)); // UriType
2418          return value;
2419        case -332612366: // basedOn
2420          this.getBasedOn().add(castToReference(value)); // Reference
2421          return value;
2422        case 237568101: // priorRequest
2423          this.getPriorRequest().add(castToReference(value)); // Reference
2424          return value;
2425        case -445338488: // groupIdentifier
2426          this.groupIdentifier = castToIdentifier(value); // Identifier
2427          return value;
2428        case -892481550: // status
2429          value = new DeviceRequestStatusEnumFactory().fromType(castToCode(value));
2430          this.status = (Enumeration) value; // Enumeration<DeviceRequestStatus>
2431          return value;
2432        case -1183762788: // intent
2433          value = new RequestIntentEnumFactory().fromType(castToCode(value));
2434          this.intent = (Enumeration) value; // Enumeration<RequestIntent>
2435          return value;
2436        case -1165461084: // priority
2437          value = new RequestPriorityEnumFactory().fromType(castToCode(value));
2438          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
2439          return value;
2440        case 3059181: // code
2441          this.code = castToType(value); // Type
2442          return value;
2443        case 1954460585: // parameter
2444          this.getParameter().add((DeviceRequestParameterComponent) value); // DeviceRequestParameterComponent
2445          return value;
2446        case -1867885268: // subject
2447          this.subject = castToReference(value); // Reference
2448          return value;
2449        case 1524132147: // encounter
2450          this.encounter = castToReference(value); // Reference
2451          return value;
2452        case 1687874001: // occurrence
2453          this.occurrence = castToType(value); // Type
2454          return value;
2455        case -1500852503: // authoredOn
2456          this.authoredOn = castToDateTime(value); // DateTimeType
2457          return value;
2458        case 693933948: // requester
2459          this.requester = castToReference(value); // Reference
2460          return value;
2461        case -901444568: // performerType
2462          this.performerType = castToCodeableConcept(value); // CodeableConcept
2463          return value;
2464        case 481140686: // performer
2465          this.performer = castToReference(value); // Reference
2466          return value;
2467        case 722137681: // reasonCode
2468          this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
2469          return value;
2470        case -1146218137: // reasonReference
2471          this.getReasonReference().add(castToReference(value)); // Reference
2472          return value;
2473        case 73049818: // insurance
2474          this.getInsurance().add(castToReference(value)); // Reference
2475          return value;
2476        case 1922406657: // supportingInfo
2477          this.getSupportingInfo().add(castToReference(value)); // Reference
2478          return value;
2479        case 3387378: // note
2480          this.getNote().add(castToAnnotation(value)); // Annotation
2481          return value;
2482        case 1538891575: // relevantHistory
2483          this.getRelevantHistory().add(castToReference(value)); // Reference
2484          return value;
2485        default: return super.setProperty(hash, name, value);
2486        }
2487
2488      }
2489
2490      @Override
2491      public Base setProperty(String name, Base value) throws FHIRException {
2492        if (name.equals("identifier")) {
2493          this.getIdentifier().add(castToIdentifier(value));
2494        } else if (name.equals("instantiatesCanonical")) {
2495          this.getInstantiatesCanonical().add(castToCanonical(value));
2496        } else if (name.equals("instantiatesUri")) {
2497          this.getInstantiatesUri().add(castToUri(value));
2498        } else if (name.equals("basedOn")) {
2499          this.getBasedOn().add(castToReference(value));
2500        } else if (name.equals("priorRequest")) {
2501          this.getPriorRequest().add(castToReference(value));
2502        } else if (name.equals("groupIdentifier")) {
2503          this.groupIdentifier = castToIdentifier(value); // Identifier
2504        } else if (name.equals("status")) {
2505          value = new DeviceRequestStatusEnumFactory().fromType(castToCode(value));
2506          this.status = (Enumeration) value; // Enumeration<DeviceRequestStatus>
2507        } else if (name.equals("intent")) {
2508          value = new RequestIntentEnumFactory().fromType(castToCode(value));
2509          this.intent = (Enumeration) value; // Enumeration<RequestIntent>
2510        } else if (name.equals("priority")) {
2511          value = new RequestPriorityEnumFactory().fromType(castToCode(value));
2512          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
2513        } else if (name.equals("code[x]")) {
2514          this.code = castToType(value); // Type
2515        } else if (name.equals("parameter")) {
2516          this.getParameter().add((DeviceRequestParameterComponent) value);
2517        } else if (name.equals("subject")) {
2518          this.subject = castToReference(value); // Reference
2519        } else if (name.equals("encounter")) {
2520          this.encounter = castToReference(value); // Reference
2521        } else if (name.equals("occurrence[x]")) {
2522          this.occurrence = castToType(value); // Type
2523        } else if (name.equals("authoredOn")) {
2524          this.authoredOn = castToDateTime(value); // DateTimeType
2525        } else if (name.equals("requester")) {
2526          this.requester = castToReference(value); // Reference
2527        } else if (name.equals("performerType")) {
2528          this.performerType = castToCodeableConcept(value); // CodeableConcept
2529        } else if (name.equals("performer")) {
2530          this.performer = castToReference(value); // Reference
2531        } else if (name.equals("reasonCode")) {
2532          this.getReasonCode().add(castToCodeableConcept(value));
2533        } else if (name.equals("reasonReference")) {
2534          this.getReasonReference().add(castToReference(value));
2535        } else if (name.equals("insurance")) {
2536          this.getInsurance().add(castToReference(value));
2537        } else if (name.equals("supportingInfo")) {
2538          this.getSupportingInfo().add(castToReference(value));
2539        } else if (name.equals("note")) {
2540          this.getNote().add(castToAnnotation(value));
2541        } else if (name.equals("relevantHistory")) {
2542          this.getRelevantHistory().add(castToReference(value));
2543        } else
2544          return super.setProperty(name, value);
2545        return value;
2546      }
2547
2548      @Override
2549      public Base makeProperty(int hash, String name) throws FHIRException {
2550        switch (hash) {
2551        case -1618432855:  return addIdentifier(); 
2552        case 8911915:  return addInstantiatesCanonicalElement();
2553        case -1926393373:  return addInstantiatesUriElement();
2554        case -332612366:  return addBasedOn(); 
2555        case 237568101:  return addPriorRequest(); 
2556        case -445338488:  return getGroupIdentifier(); 
2557        case -892481550:  return getStatusElement();
2558        case -1183762788:  return getIntentElement();
2559        case -1165461084:  return getPriorityElement();
2560        case 941839219:  return getCode(); 
2561        case 3059181:  return getCode(); 
2562        case 1954460585:  return addParameter(); 
2563        case -1867885268:  return getSubject(); 
2564        case 1524132147:  return getEncounter(); 
2565        case -2022646513:  return getOccurrence(); 
2566        case 1687874001:  return getOccurrence(); 
2567        case -1500852503:  return getAuthoredOnElement();
2568        case 693933948:  return getRequester(); 
2569        case -901444568:  return getPerformerType(); 
2570        case 481140686:  return getPerformer(); 
2571        case 722137681:  return addReasonCode(); 
2572        case -1146218137:  return addReasonReference(); 
2573        case 73049818:  return addInsurance(); 
2574        case 1922406657:  return addSupportingInfo(); 
2575        case 3387378:  return addNote(); 
2576        case 1538891575:  return addRelevantHistory(); 
2577        default: return super.makeProperty(hash, name);
2578        }
2579
2580      }
2581
2582      @Override
2583      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2584        switch (hash) {
2585        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2586        case 8911915: /*instantiatesCanonical*/ return new String[] {"canonical"};
2587        case -1926393373: /*instantiatesUri*/ return new String[] {"uri"};
2588        case -332612366: /*basedOn*/ return new String[] {"Reference"};
2589        case 237568101: /*priorRequest*/ return new String[] {"Reference"};
2590        case -445338488: /*groupIdentifier*/ return new String[] {"Identifier"};
2591        case -892481550: /*status*/ return new String[] {"code"};
2592        case -1183762788: /*intent*/ return new String[] {"code"};
2593        case -1165461084: /*priority*/ return new String[] {"code"};
2594        case 3059181: /*code*/ return new String[] {"Reference", "CodeableConcept"};
2595        case 1954460585: /*parameter*/ return new String[] {};
2596        case -1867885268: /*subject*/ return new String[] {"Reference"};
2597        case 1524132147: /*encounter*/ return new String[] {"Reference"};
2598        case 1687874001: /*occurrence*/ return new String[] {"dateTime", "Period", "Timing"};
2599        case -1500852503: /*authoredOn*/ return new String[] {"dateTime"};
2600        case 693933948: /*requester*/ return new String[] {"Reference"};
2601        case -901444568: /*performerType*/ return new String[] {"CodeableConcept"};
2602        case 481140686: /*performer*/ return new String[] {"Reference"};
2603        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
2604        case -1146218137: /*reasonReference*/ return new String[] {"Reference"};
2605        case 73049818: /*insurance*/ return new String[] {"Reference"};
2606        case 1922406657: /*supportingInfo*/ return new String[] {"Reference"};
2607        case 3387378: /*note*/ return new String[] {"Annotation"};
2608        case 1538891575: /*relevantHistory*/ return new String[] {"Reference"};
2609        default: return super.getTypesForProperty(hash, name);
2610        }
2611
2612      }
2613
2614      @Override
2615      public Base addChild(String name) throws FHIRException {
2616        if (name.equals("identifier")) {
2617          return addIdentifier();
2618        }
2619        else if (name.equals("instantiatesCanonical")) {
2620          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.instantiatesCanonical");
2621        }
2622        else if (name.equals("instantiatesUri")) {
2623          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.instantiatesUri");
2624        }
2625        else if (name.equals("basedOn")) {
2626          return addBasedOn();
2627        }
2628        else if (name.equals("priorRequest")) {
2629          return addPriorRequest();
2630        }
2631        else if (name.equals("groupIdentifier")) {
2632          this.groupIdentifier = new Identifier();
2633          return this.groupIdentifier;
2634        }
2635        else if (name.equals("status")) {
2636          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.status");
2637        }
2638        else if (name.equals("intent")) {
2639          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.intent");
2640        }
2641        else if (name.equals("priority")) {
2642          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.priority");
2643        }
2644        else if (name.equals("codeReference")) {
2645          this.code = new Reference();
2646          return this.code;
2647        }
2648        else if (name.equals("codeCodeableConcept")) {
2649          this.code = new CodeableConcept();
2650          return this.code;
2651        }
2652        else if (name.equals("parameter")) {
2653          return addParameter();
2654        }
2655        else if (name.equals("subject")) {
2656          this.subject = new Reference();
2657          return this.subject;
2658        }
2659        else if (name.equals("encounter")) {
2660          this.encounter = new Reference();
2661          return this.encounter;
2662        }
2663        else if (name.equals("occurrenceDateTime")) {
2664          this.occurrence = new DateTimeType();
2665          return this.occurrence;
2666        }
2667        else if (name.equals("occurrencePeriod")) {
2668          this.occurrence = new Period();
2669          return this.occurrence;
2670        }
2671        else if (name.equals("occurrenceTiming")) {
2672          this.occurrence = new Timing();
2673          return this.occurrence;
2674        }
2675        else if (name.equals("authoredOn")) {
2676          throw new FHIRException("Cannot call addChild on a primitive type DeviceRequest.authoredOn");
2677        }
2678        else if (name.equals("requester")) {
2679          this.requester = new Reference();
2680          return this.requester;
2681        }
2682        else if (name.equals("performerType")) {
2683          this.performerType = new CodeableConcept();
2684          return this.performerType;
2685        }
2686        else if (name.equals("performer")) {
2687          this.performer = new Reference();
2688          return this.performer;
2689        }
2690        else if (name.equals("reasonCode")) {
2691          return addReasonCode();
2692        }
2693        else if (name.equals("reasonReference")) {
2694          return addReasonReference();
2695        }
2696        else if (name.equals("insurance")) {
2697          return addInsurance();
2698        }
2699        else if (name.equals("supportingInfo")) {
2700          return addSupportingInfo();
2701        }
2702        else if (name.equals("note")) {
2703          return addNote();
2704        }
2705        else if (name.equals("relevantHistory")) {
2706          return addRelevantHistory();
2707        }
2708        else
2709          return super.addChild(name);
2710      }
2711
2712  public String fhirType() {
2713    return "DeviceRequest";
2714
2715  }
2716
2717      public DeviceRequest copy() {
2718        DeviceRequest dst = new DeviceRequest();
2719        copyValues(dst);
2720        if (identifier != null) {
2721          dst.identifier = new ArrayList<Identifier>();
2722          for (Identifier i : identifier)
2723            dst.identifier.add(i.copy());
2724        };
2725        if (instantiatesCanonical != null) {
2726          dst.instantiatesCanonical = new ArrayList<CanonicalType>();
2727          for (CanonicalType i : instantiatesCanonical)
2728            dst.instantiatesCanonical.add(i.copy());
2729        };
2730        if (instantiatesUri != null) {
2731          dst.instantiatesUri = new ArrayList<UriType>();
2732          for (UriType i : instantiatesUri)
2733            dst.instantiatesUri.add(i.copy());
2734        };
2735        if (basedOn != null) {
2736          dst.basedOn = new ArrayList<Reference>();
2737          for (Reference i : basedOn)
2738            dst.basedOn.add(i.copy());
2739        };
2740        if (priorRequest != null) {
2741          dst.priorRequest = new ArrayList<Reference>();
2742          for (Reference i : priorRequest)
2743            dst.priorRequest.add(i.copy());
2744        };
2745        dst.groupIdentifier = groupIdentifier == null ? null : groupIdentifier.copy();
2746        dst.status = status == null ? null : status.copy();
2747        dst.intent = intent == null ? null : intent.copy();
2748        dst.priority = priority == null ? null : priority.copy();
2749        dst.code = code == null ? null : code.copy();
2750        if (parameter != null) {
2751          dst.parameter = new ArrayList<DeviceRequestParameterComponent>();
2752          for (DeviceRequestParameterComponent i : parameter)
2753            dst.parameter.add(i.copy());
2754        };
2755        dst.subject = subject == null ? null : subject.copy();
2756        dst.encounter = encounter == null ? null : encounter.copy();
2757        dst.occurrence = occurrence == null ? null : occurrence.copy();
2758        dst.authoredOn = authoredOn == null ? null : authoredOn.copy();
2759        dst.requester = requester == null ? null : requester.copy();
2760        dst.performerType = performerType == null ? null : performerType.copy();
2761        dst.performer = performer == null ? null : performer.copy();
2762        if (reasonCode != null) {
2763          dst.reasonCode = new ArrayList<CodeableConcept>();
2764          for (CodeableConcept i : reasonCode)
2765            dst.reasonCode.add(i.copy());
2766        };
2767        if (reasonReference != null) {
2768          dst.reasonReference = new ArrayList<Reference>();
2769          for (Reference i : reasonReference)
2770            dst.reasonReference.add(i.copy());
2771        };
2772        if (insurance != null) {
2773          dst.insurance = new ArrayList<Reference>();
2774          for (Reference i : insurance)
2775            dst.insurance.add(i.copy());
2776        };
2777        if (supportingInfo != null) {
2778          dst.supportingInfo = new ArrayList<Reference>();
2779          for (Reference i : supportingInfo)
2780            dst.supportingInfo.add(i.copy());
2781        };
2782        if (note != null) {
2783          dst.note = new ArrayList<Annotation>();
2784          for (Annotation i : note)
2785            dst.note.add(i.copy());
2786        };
2787        if (relevantHistory != null) {
2788          dst.relevantHistory = new ArrayList<Reference>();
2789          for (Reference i : relevantHistory)
2790            dst.relevantHistory.add(i.copy());
2791        };
2792        return dst;
2793      }
2794
2795      protected DeviceRequest typedCopy() {
2796        return copy();
2797      }
2798
2799      @Override
2800      public boolean equalsDeep(Base other_) {
2801        if (!super.equalsDeep(other_))
2802          return false;
2803        if (!(other_ instanceof DeviceRequest))
2804          return false;
2805        DeviceRequest o = (DeviceRequest) other_;
2806        return compareDeep(identifier, o.identifier, true) && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
2807           && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(basedOn, o.basedOn, true)
2808           && compareDeep(priorRequest, o.priorRequest, true) && compareDeep(groupIdentifier, o.groupIdentifier, true)
2809           && compareDeep(status, o.status, true) && compareDeep(intent, o.intent, true) && compareDeep(priority, o.priority, true)
2810           && compareDeep(code, o.code, true) && compareDeep(parameter, o.parameter, true) && compareDeep(subject, o.subject, true)
2811           && compareDeep(encounter, o.encounter, true) && compareDeep(occurrence, o.occurrence, true) && compareDeep(authoredOn, o.authoredOn, true)
2812           && compareDeep(requester, o.requester, true) && compareDeep(performerType, o.performerType, true)
2813           && compareDeep(performer, o.performer, true) && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
2814           && compareDeep(insurance, o.insurance, true) && compareDeep(supportingInfo, o.supportingInfo, true)
2815           && compareDeep(note, o.note, true) && compareDeep(relevantHistory, o.relevantHistory, true);
2816      }
2817
2818      @Override
2819      public boolean equalsShallow(Base other_) {
2820        if (!super.equalsShallow(other_))
2821          return false;
2822        if (!(other_ instanceof DeviceRequest))
2823          return false;
2824        DeviceRequest o = (DeviceRequest) other_;
2825        return compareValues(instantiatesUri, o.instantiatesUri, true) && compareValues(status, o.status, true)
2826           && compareValues(intent, o.intent, true) && compareValues(priority, o.priority, true) && compareValues(authoredOn, o.authoredOn, true)
2827          ;
2828      }
2829
2830      public boolean isEmpty() {
2831        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instantiatesCanonical
2832          , instantiatesUri, basedOn, priorRequest, groupIdentifier, status, intent, priority
2833          , code, parameter, subject, encounter, occurrence, authoredOn, requester, performerType
2834          , performer, reasonCode, reasonReference, insurance, supportingInfo, note, relevantHistory
2835          );
2836      }
2837
2838  @Override
2839  public ResourceType getResourceType() {
2840    return ResourceType.DeviceRequest;
2841   }
2842
2843 /**
2844   * Search parameter: <b>requester</b>
2845   * <p>
2846   * Description: <b>Who/what is requesting service</b><br>
2847   * Type: <b>reference</b><br>
2848   * Path: <b>DeviceRequest.requester</b><br>
2849   * </p>
2850   */
2851  @SearchParamDefinition(name="requester", path="DeviceRequest.requester", description="Who/what is requesting service", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Device.class, Organization.class, Practitioner.class, PractitionerRole.class } )
2852  public static final String SP_REQUESTER = "requester";
2853 /**
2854   * <b>Fluent Client</b> search parameter constant for <b>requester</b>
2855   * <p>
2856   * Description: <b>Who/what is requesting service</b><br>
2857   * Type: <b>reference</b><br>
2858   * Path: <b>DeviceRequest.requester</b><br>
2859   * </p>
2860   */
2861  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER);
2862
2863/**
2864   * Constant for fluent queries to be used to add include statements. Specifies
2865   * the path value of "<b>DeviceRequest:requester</b>".
2866   */
2867  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("DeviceRequest:requester").toLocked();
2868
2869 /**
2870   * Search parameter: <b>insurance</b>
2871   * <p>
2872   * Description: <b>Associated insurance coverage</b><br>
2873   * Type: <b>reference</b><br>
2874   * Path: <b>DeviceRequest.insurance</b><br>
2875   * </p>
2876   */
2877  @SearchParamDefinition(name="insurance", path="DeviceRequest.insurance", description="Associated insurance coverage", type="reference", target={ClaimResponse.class, Coverage.class } )
2878  public static final String SP_INSURANCE = "insurance";
2879 /**
2880   * <b>Fluent Client</b> search parameter constant for <b>insurance</b>
2881   * <p>
2882   * Description: <b>Associated insurance coverage</b><br>
2883   * Type: <b>reference</b><br>
2884   * Path: <b>DeviceRequest.insurance</b><br>
2885   * </p>
2886   */
2887  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSURANCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSURANCE);
2888
2889/**
2890   * Constant for fluent queries to be used to add include statements. Specifies
2891   * the path value of "<b>DeviceRequest:insurance</b>".
2892   */
2893  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSURANCE = new ca.uhn.fhir.model.api.Include("DeviceRequest:insurance").toLocked();
2894
2895 /**
2896   * Search parameter: <b>identifier</b>
2897   * <p>
2898   * Description: <b>Business identifier for request/order</b><br>
2899   * Type: <b>token</b><br>
2900   * Path: <b>DeviceRequest.identifier</b><br>
2901   * </p>
2902   */
2903  @SearchParamDefinition(name="identifier", path="DeviceRequest.identifier", description="Business identifier for request/order", type="token" )
2904  public static final String SP_IDENTIFIER = "identifier";
2905 /**
2906   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2907   * <p>
2908   * Description: <b>Business identifier for request/order</b><br>
2909   * Type: <b>token</b><br>
2910   * Path: <b>DeviceRequest.identifier</b><br>
2911   * </p>
2912   */
2913  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2914
2915 /**
2916   * Search parameter: <b>code</b>
2917   * <p>
2918   * Description: <b>Code for what is being requested/ordered</b><br>
2919   * Type: <b>token</b><br>
2920   * Path: <b>DeviceRequest.codeCodeableConcept</b><br>
2921   * </p>
2922   */
2923  @SearchParamDefinition(name="code", path="(DeviceRequest.code as CodeableConcept)", description="Code for what is being requested/ordered", type="token" )
2924  public static final String SP_CODE = "code";
2925 /**
2926   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2927   * <p>
2928   * Description: <b>Code for what is being requested/ordered</b><br>
2929   * Type: <b>token</b><br>
2930   * Path: <b>DeviceRequest.codeCodeableConcept</b><br>
2931   * </p>
2932   */
2933  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2934
2935 /**
2936   * Search parameter: <b>performer</b>
2937   * <p>
2938   * Description: <b>Desired performer for service</b><br>
2939   * Type: <b>reference</b><br>
2940   * Path: <b>DeviceRequest.performer</b><br>
2941   * </p>
2942   */
2943  @SearchParamDefinition(name="performer", path="DeviceRequest.performer", description="Desired performer for service", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={CareTeam.class, Device.class, HealthcareService.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2944  public static final String SP_PERFORMER = "performer";
2945 /**
2946   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
2947   * <p>
2948   * Description: <b>Desired performer for service</b><br>
2949   * Type: <b>reference</b><br>
2950   * Path: <b>DeviceRequest.performer</b><br>
2951   * </p>
2952   */
2953  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
2954
2955/**
2956   * Constant for fluent queries to be used to add include statements. Specifies
2957   * the path value of "<b>DeviceRequest:performer</b>".
2958   */
2959  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("DeviceRequest:performer").toLocked();
2960
2961 /**
2962   * Search parameter: <b>event-date</b>
2963   * <p>
2964   * Description: <b>When service should occur</b><br>
2965   * Type: <b>date</b><br>
2966   * Path: <b>DeviceRequest.occurrenceDateTime, DeviceRequest.occurrencePeriod</b><br>
2967   * </p>
2968   */
2969  @SearchParamDefinition(name="event-date", path="(DeviceRequest.occurrence as dateTime) | (DeviceRequest.occurrence as Period)", description="When service should occur", type="date" )
2970  public static final String SP_EVENT_DATE = "event-date";
2971 /**
2972   * <b>Fluent Client</b> search parameter constant for <b>event-date</b>
2973   * <p>
2974   * Description: <b>When service should occur</b><br>
2975   * Type: <b>date</b><br>
2976   * Path: <b>DeviceRequest.occurrenceDateTime, DeviceRequest.occurrencePeriod</b><br>
2977   * </p>
2978   */
2979  public static final ca.uhn.fhir.rest.gclient.DateClientParam EVENT_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EVENT_DATE);
2980
2981 /**
2982   * Search parameter: <b>subject</b>
2983   * <p>
2984   * Description: <b>Individual the service is ordered for</b><br>
2985   * Type: <b>reference</b><br>
2986   * Path: <b>DeviceRequest.subject</b><br>
2987   * </p>
2988   */
2989  @SearchParamDefinition(name="subject", path="DeviceRequest.subject", description="Individual the service is ordered for", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Device.class, Group.class, Location.class, Patient.class } )
2990  public static final String SP_SUBJECT = "subject";
2991 /**
2992   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2993   * <p>
2994   * Description: <b>Individual the service is ordered for</b><br>
2995   * Type: <b>reference</b><br>
2996   * Path: <b>DeviceRequest.subject</b><br>
2997   * </p>
2998   */
2999  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3000
3001/**
3002   * Constant for fluent queries to be used to add include statements. Specifies
3003   * the path value of "<b>DeviceRequest:subject</b>".
3004   */
3005  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DeviceRequest:subject").toLocked();
3006
3007 /**
3008   * Search parameter: <b>instantiates-canonical</b>
3009   * <p>
3010   * Description: <b>Instantiates FHIR protocol or definition</b><br>
3011   * Type: <b>reference</b><br>
3012   * Path: <b>DeviceRequest.instantiatesCanonical</b><br>
3013   * </p>
3014   */
3015  @SearchParamDefinition(name="instantiates-canonical", path="DeviceRequest.instantiatesCanonical", description="Instantiates FHIR protocol or definition", type="reference", target={ActivityDefinition.class, PlanDefinition.class } )
3016  public static final String SP_INSTANTIATES_CANONICAL = "instantiates-canonical";
3017 /**
3018   * <b>Fluent Client</b> search parameter constant for <b>instantiates-canonical</b>
3019   * <p>
3020   * Description: <b>Instantiates FHIR protocol or definition</b><br>
3021   * Type: <b>reference</b><br>
3022   * Path: <b>DeviceRequest.instantiatesCanonical</b><br>
3023   * </p>
3024   */
3025  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSTANTIATES_CANONICAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSTANTIATES_CANONICAL);
3026
3027/**
3028   * Constant for fluent queries to be used to add include statements. Specifies
3029   * the path value of "<b>DeviceRequest:instantiates-canonical</b>".
3030   */
3031  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSTANTIATES_CANONICAL = new ca.uhn.fhir.model.api.Include("DeviceRequest:instantiates-canonical").toLocked();
3032
3033 /**
3034   * Search parameter: <b>encounter</b>
3035   * <p>
3036   * Description: <b>Encounter during which request was created</b><br>
3037   * Type: <b>reference</b><br>
3038   * Path: <b>DeviceRequest.encounter</b><br>
3039   * </p>
3040   */
3041  @SearchParamDefinition(name="encounter", path="DeviceRequest.encounter", description="Encounter during which request was created", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class } )
3042  public static final String SP_ENCOUNTER = "encounter";
3043 /**
3044   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
3045   * <p>
3046   * Description: <b>Encounter during which request was created</b><br>
3047   * Type: <b>reference</b><br>
3048   * Path: <b>DeviceRequest.encounter</b><br>
3049   * </p>
3050   */
3051  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
3052
3053/**
3054   * Constant for fluent queries to be used to add include statements. Specifies
3055   * the path value of "<b>DeviceRequest:encounter</b>".
3056   */
3057  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("DeviceRequest:encounter").toLocked();
3058
3059 /**
3060   * Search parameter: <b>authored-on</b>
3061   * <p>
3062   * Description: <b>When the request transitioned to being actionable</b><br>
3063   * Type: <b>date</b><br>
3064   * Path: <b>DeviceRequest.authoredOn</b><br>
3065   * </p>
3066   */
3067  @SearchParamDefinition(name="authored-on", path="DeviceRequest.authoredOn", description="When the request transitioned to being actionable", type="date" )
3068  public static final String SP_AUTHORED_ON = "authored-on";
3069 /**
3070   * <b>Fluent Client</b> search parameter constant for <b>authored-on</b>
3071   * <p>
3072   * Description: <b>When the request transitioned to being actionable</b><br>
3073   * Type: <b>date</b><br>
3074   * Path: <b>DeviceRequest.authoredOn</b><br>
3075   * </p>
3076   */
3077  public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORED_ON = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORED_ON);
3078
3079 /**
3080   * Search parameter: <b>intent</b>
3081   * <p>
3082   * Description: <b>proposal | plan | original-order |reflex-order</b><br>
3083   * Type: <b>token</b><br>
3084   * Path: <b>DeviceRequest.intent</b><br>
3085   * </p>
3086   */
3087  @SearchParamDefinition(name="intent", path="DeviceRequest.intent", description="proposal | plan | original-order |reflex-order", type="token" )
3088  public static final String SP_INTENT = "intent";
3089 /**
3090   * <b>Fluent Client</b> search parameter constant for <b>intent</b>
3091   * <p>
3092   * Description: <b>proposal | plan | original-order |reflex-order</b><br>
3093   * Type: <b>token</b><br>
3094   * Path: <b>DeviceRequest.intent</b><br>
3095   * </p>
3096   */
3097  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INTENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INTENT);
3098
3099 /**
3100   * Search parameter: <b>group-identifier</b>
3101   * <p>
3102   * Description: <b>Composite request this is part of</b><br>
3103   * Type: <b>token</b><br>
3104   * Path: <b>DeviceRequest.groupIdentifier</b><br>
3105   * </p>
3106   */
3107  @SearchParamDefinition(name="group-identifier", path="DeviceRequest.groupIdentifier", description="Composite request this is part of", type="token" )
3108  public static final String SP_GROUP_IDENTIFIER = "group-identifier";
3109 /**
3110   * <b>Fluent Client</b> search parameter constant for <b>group-identifier</b>
3111   * <p>
3112   * Description: <b>Composite request this is part of</b><br>
3113   * Type: <b>token</b><br>
3114   * Path: <b>DeviceRequest.groupIdentifier</b><br>
3115   * </p>
3116   */
3117  public static final ca.uhn.fhir.rest.gclient.TokenClientParam GROUP_IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GROUP_IDENTIFIER);
3118
3119 /**
3120   * Search parameter: <b>based-on</b>
3121   * <p>
3122   * Description: <b>Plan/proposal/order fulfilled by this request</b><br>
3123   * Type: <b>reference</b><br>
3124   * Path: <b>DeviceRequest.basedOn</b><br>
3125   * </p>
3126   */
3127  @SearchParamDefinition(name="based-on", path="DeviceRequest.basedOn", description="Plan/proposal/order fulfilled by this request", type="reference" )
3128  public static final String SP_BASED_ON = "based-on";
3129 /**
3130   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
3131   * <p>
3132   * Description: <b>Plan/proposal/order fulfilled by this request</b><br>
3133   * Type: <b>reference</b><br>
3134   * Path: <b>DeviceRequest.basedOn</b><br>
3135   * </p>
3136   */
3137  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
3138
3139/**
3140   * Constant for fluent queries to be used to add include statements. Specifies
3141   * the path value of "<b>DeviceRequest:based-on</b>".
3142   */
3143  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("DeviceRequest:based-on").toLocked();
3144
3145 /**
3146   * Search parameter: <b>patient</b>
3147   * <p>
3148   * Description: <b>Individual the service is ordered for</b><br>
3149   * Type: <b>reference</b><br>
3150   * Path: <b>DeviceRequest.subject</b><br>
3151   * </p>
3152   */
3153  @SearchParamDefinition(name="patient", path="DeviceRequest.subject.where(resolve() is Patient)", description="Individual the service is ordered for", type="reference", target={Patient.class } )
3154  public static final String SP_PATIENT = "patient";
3155 /**
3156   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3157   * <p>
3158   * Description: <b>Individual the service is ordered for</b><br>
3159   * Type: <b>reference</b><br>
3160   * Path: <b>DeviceRequest.subject</b><br>
3161   * </p>
3162   */
3163  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3164
3165/**
3166   * Constant for fluent queries to be used to add include statements. Specifies
3167   * the path value of "<b>DeviceRequest:patient</b>".
3168   */
3169  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DeviceRequest:patient").toLocked();
3170
3171 /**
3172   * Search parameter: <b>instantiates-uri</b>
3173   * <p>
3174   * Description: <b>Instantiates external protocol or definition</b><br>
3175   * Type: <b>uri</b><br>
3176   * Path: <b>DeviceRequest.instantiatesUri</b><br>
3177   * </p>
3178   */
3179  @SearchParamDefinition(name="instantiates-uri", path="DeviceRequest.instantiatesUri", description="Instantiates external protocol or definition", type="uri" )
3180  public static final String SP_INSTANTIATES_URI = "instantiates-uri";
3181 /**
3182   * <b>Fluent Client</b> search parameter constant for <b>instantiates-uri</b>
3183   * <p>
3184   * Description: <b>Instantiates external protocol or definition</b><br>
3185   * Type: <b>uri</b><br>
3186   * Path: <b>DeviceRequest.instantiatesUri</b><br>
3187   * </p>
3188   */
3189  public static final ca.uhn.fhir.rest.gclient.UriClientParam INSTANTIATES_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_INSTANTIATES_URI);
3190
3191 /**
3192   * Search parameter: <b>prior-request</b>
3193   * <p>
3194   * Description: <b>Request takes the place of referenced completed or terminated requests</b><br>
3195   * Type: <b>reference</b><br>
3196   * Path: <b>DeviceRequest.priorRequest</b><br>
3197   * </p>
3198   */
3199  @SearchParamDefinition(name="prior-request", path="DeviceRequest.priorRequest", description="Request takes the place of referenced completed or terminated requests", type="reference" )
3200  public static final String SP_PRIOR_REQUEST = "prior-request";
3201 /**
3202   * <b>Fluent Client</b> search parameter constant for <b>prior-request</b>
3203   * <p>
3204   * Description: <b>Request takes the place of referenced completed or terminated requests</b><br>
3205   * Type: <b>reference</b><br>
3206   * Path: <b>DeviceRequest.priorRequest</b><br>
3207   * </p>
3208   */
3209  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRIOR_REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRIOR_REQUEST);
3210
3211/**
3212   * Constant for fluent queries to be used to add include statements. Specifies
3213   * the path value of "<b>DeviceRequest:prior-request</b>".
3214   */
3215  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRIOR_REQUEST = new ca.uhn.fhir.model.api.Include("DeviceRequest:prior-request").toLocked();
3216
3217 /**
3218   * Search parameter: <b>device</b>
3219   * <p>
3220   * Description: <b>Reference to resource that is being requested/ordered</b><br>
3221   * Type: <b>reference</b><br>
3222   * Path: <b>DeviceRequest.codeReference</b><br>
3223   * </p>
3224   */
3225  @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="Device") }, target={Device.class } )
3226  public static final String SP_DEVICE = "device";
3227 /**
3228   * <b>Fluent Client</b> search parameter constant for <b>device</b>
3229   * <p>
3230   * Description: <b>Reference to resource that is being requested/ordered</b><br>
3231   * Type: <b>reference</b><br>
3232   * Path: <b>DeviceRequest.codeReference</b><br>
3233   * </p>
3234   */
3235  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE);
3236
3237/**
3238   * Constant for fluent queries to be used to add include statements. Specifies
3239   * the path value of "<b>DeviceRequest:device</b>".
3240   */
3241  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("DeviceRequest:device").toLocked();
3242
3243 /**
3244   * Search parameter: <b>status</b>
3245   * <p>
3246   * Description: <b>entered-in-error | draft | active |suspended | completed</b><br>
3247   * Type: <b>token</b><br>
3248   * Path: <b>DeviceRequest.status</b><br>
3249   * </p>
3250   */
3251  @SearchParamDefinition(name="status", path="DeviceRequest.status", description="entered-in-error | draft | active |suspended | completed", type="token" )
3252  public static final String SP_STATUS = "status";
3253 /**
3254   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3255   * <p>
3256   * Description: <b>entered-in-error | draft | active |suspended | completed</b><br>
3257   * Type: <b>token</b><br>
3258   * Path: <b>DeviceRequest.status</b><br>
3259   * </p>
3260   */
3261  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3262
3263
3264}
3265