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