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