001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
033import java.util.ArrayList;
034import java.util.Date;
035import java.util.List;
036
037import org.hl7.fhir.exceptions.FHIRException;
038import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
039import org.hl7.fhir.utilities.Utilities;
040
041import ca.uhn.fhir.model.api.annotation.Block;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.Description;
044import ca.uhn.fhir.model.api.annotation.ResourceDef;
045import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
046
047/**
048 * A group of related requests that can be used to capture intended activities
049 * that have inter-dependencies such as "give this medication after that one".
050 */
051@ResourceDef(name = "RequestGroup", profile = "http://hl7.org/fhir/StructureDefinition/RequestGroup")
052public class RequestGroup extends DomainResource {
053
054  public enum RequestStatus {
055    /**
056     * The request has been created but is not yet complete or ready for action.
057     */
058    DRAFT,
059    /**
060     * The request is in force and ready to be acted upon.
061     */
062    ACTIVE,
063    /**
064     * The request (and any implicit authorization to act) has been temporarily
065     * withdrawn but is expected to resume in the future.
066     */
067    ONHOLD,
068    /**
069     * The request (and any implicit authorization to act) has been terminated prior
070     * to the known full completion of the intended actions. No further activity
071     * should occur.
072     */
073    REVOKED,
074    /**
075     * The activity described by the request has been fully performed. No further
076     * activity will occur.
077     */
078    COMPLETED,
079    /**
080     * This request should never have existed and should be considered 'void'. (It
081     * is possible that real-world decisions were based on it. If real-world
082     * activity has occurred, the status should be "revoked" rather than
083     * "entered-in-error".).
084     */
085    ENTEREDINERROR,
086    /**
087     * The authoring/source system does not know which of the status values
088     * currently applies for this request. Note: This concept is not to be used for
089     * "other" - one of the listed statuses is presumed to apply, but the
090     * authoring/source system does not know which.
091     */
092    UNKNOWN,
093    /**
094     * added to help the parsers with the generic types
095     */
096    NULL;
097
098    public static RequestStatus fromCode(String codeString) throws FHIRException {
099      if (codeString == null || "".equals(codeString))
100        return null;
101      if ("draft".equals(codeString))
102        return DRAFT;
103      if ("active".equals(codeString))
104        return ACTIVE;
105      if ("on-hold".equals(codeString))
106        return ONHOLD;
107      if ("revoked".equals(codeString))
108        return REVOKED;
109      if ("completed".equals(codeString))
110        return COMPLETED;
111      if ("entered-in-error".equals(codeString))
112        return ENTEREDINERROR;
113      if ("unknown".equals(codeString))
114        return UNKNOWN;
115      if (Configuration.isAcceptInvalidEnums())
116        return null;
117      else
118        throw new FHIRException("Unknown RequestStatus code '" + codeString + "'");
119    }
120
121    public String toCode() {
122      switch (this) {
123      case DRAFT:
124        return "draft";
125      case ACTIVE:
126        return "active";
127      case ONHOLD:
128        return "on-hold";
129      case REVOKED:
130        return "revoked";
131      case COMPLETED:
132        return "completed";
133      case ENTEREDINERROR:
134        return "entered-in-error";
135      case UNKNOWN:
136        return "unknown";
137      case NULL:
138        return null;
139      default:
140        return "?";
141      }
142    }
143
144    public String getSystem() {
145      switch (this) {
146      case DRAFT:
147        return "http://hl7.org/fhir/request-status";
148      case ACTIVE:
149        return "http://hl7.org/fhir/request-status";
150      case ONHOLD:
151        return "http://hl7.org/fhir/request-status";
152      case REVOKED:
153        return "http://hl7.org/fhir/request-status";
154      case COMPLETED:
155        return "http://hl7.org/fhir/request-status";
156      case ENTEREDINERROR:
157        return "http://hl7.org/fhir/request-status";
158      case UNKNOWN:
159        return "http://hl7.org/fhir/request-status";
160      case NULL:
161        return null;
162      default:
163        return "?";
164      }
165    }
166
167    public String getDefinition() {
168      switch (this) {
169      case DRAFT:
170        return "The request has been created but is not yet complete or ready for action.";
171      case ACTIVE:
172        return "The request is in force and ready to be acted upon.";
173      case ONHOLD:
174        return "The request (and any implicit authorization to act) has been temporarily withdrawn but is expected to resume in the future.";
175      case REVOKED:
176        return "The request (and any implicit authorization to act) has been terminated prior to the known full completion of the intended actions.  No further activity should occur.";
177      case COMPLETED:
178        return "The activity described by the request has been fully performed.  No further activity will occur.";
179      case ENTEREDINERROR:
180        return "This request should never have existed and should be considered 'void'.  (It is possible that real-world decisions were based on it.  If real-world activity has occurred, the status should be \"revoked\" rather than \"entered-in-error\".).";
181      case UNKNOWN:
182        return "The authoring/source system does not know which of the status values currently applies for this request.  Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply,  but the authoring/source system does not know which.";
183      case NULL:
184        return null;
185      default:
186        return "?";
187      }
188    }
189
190    public String getDisplay() {
191      switch (this) {
192      case DRAFT:
193        return "Draft";
194      case ACTIVE:
195        return "Active";
196      case ONHOLD:
197        return "On Hold";
198      case REVOKED:
199        return "Revoked";
200      case COMPLETED:
201        return "Completed";
202      case ENTEREDINERROR:
203        return "Entered in Error";
204      case UNKNOWN:
205        return "Unknown";
206      case NULL:
207        return null;
208      default:
209        return "?";
210      }
211    }
212  }
213
214  public static class RequestStatusEnumFactory implements EnumFactory<RequestStatus> {
215    public RequestStatus fromCode(String codeString) throws IllegalArgumentException {
216      if (codeString == null || "".equals(codeString))
217        if (codeString == null || "".equals(codeString))
218          return null;
219      if ("draft".equals(codeString))
220        return RequestStatus.DRAFT;
221      if ("active".equals(codeString))
222        return RequestStatus.ACTIVE;
223      if ("on-hold".equals(codeString))
224        return RequestStatus.ONHOLD;
225      if ("revoked".equals(codeString))
226        return RequestStatus.REVOKED;
227      if ("completed".equals(codeString))
228        return RequestStatus.COMPLETED;
229      if ("entered-in-error".equals(codeString))
230        return RequestStatus.ENTEREDINERROR;
231      if ("unknown".equals(codeString))
232        return RequestStatus.UNKNOWN;
233      throw new IllegalArgumentException("Unknown RequestStatus code '" + codeString + "'");
234    }
235
236    public Enumeration<RequestStatus> fromType(PrimitiveType<?> code) throws FHIRException {
237      if (code == null)
238        return null;
239      if (code.isEmpty())
240        return new Enumeration<RequestStatus>(this, RequestStatus.NULL, code);
241      String codeString = code.asStringValue();
242      if (codeString == null || "".equals(codeString))
243        return new Enumeration<RequestStatus>(this, RequestStatus.NULL, code);
244      if ("draft".equals(codeString))
245        return new Enumeration<RequestStatus>(this, RequestStatus.DRAFT, code);
246      if ("active".equals(codeString))
247        return new Enumeration<RequestStatus>(this, RequestStatus.ACTIVE, code);
248      if ("on-hold".equals(codeString))
249        return new Enumeration<RequestStatus>(this, RequestStatus.ONHOLD, code);
250      if ("revoked".equals(codeString))
251        return new Enumeration<RequestStatus>(this, RequestStatus.REVOKED, code);
252      if ("completed".equals(codeString))
253        return new Enumeration<RequestStatus>(this, RequestStatus.COMPLETED, code);
254      if ("entered-in-error".equals(codeString))
255        return new Enumeration<RequestStatus>(this, RequestStatus.ENTEREDINERROR, code);
256      if ("unknown".equals(codeString))
257        return new Enumeration<RequestStatus>(this, RequestStatus.UNKNOWN, code);
258      throw new FHIRException("Unknown RequestStatus code '" + codeString + "'");
259    }
260
261    public String toCode(RequestStatus code) {
262      if (code == RequestStatus.DRAFT)
263        return "draft";
264      if (code == RequestStatus.ACTIVE)
265        return "active";
266      if (code == RequestStatus.ONHOLD)
267        return "on-hold";
268      if (code == RequestStatus.REVOKED)
269        return "revoked";
270      if (code == RequestStatus.COMPLETED)
271        return "completed";
272      if (code == RequestStatus.ENTEREDINERROR)
273        return "entered-in-error";
274      if (code == RequestStatus.UNKNOWN)
275        return "unknown";
276      return "?";
277    }
278
279    public String toSystem(RequestStatus code) {
280      return code.getSystem();
281    }
282  }
283
284  public enum RequestIntent {
285    /**
286     * The request is a suggestion made by someone/something that does not have an
287     * intention to ensure it occurs and without providing an authorization to act.
288     */
289    PROPOSAL,
290    /**
291     * The request represents an intention to ensure something occurs without
292     * providing an authorization for others to act.
293     */
294    PLAN,
295    /**
296     * The request represents a legally binding instruction authored by a Patient or
297     * RelatedPerson.
298     */
299    DIRECTIVE,
300    /**
301     * The request represents a request/demand and authorization for action by a
302     * Practitioner.
303     */
304    ORDER,
305    /**
306     * The request represents an original authorization for action.
307     */
308    ORIGINALORDER,
309    /**
310     * The request represents an automatically generated supplemental authorization
311     * for action based on a parent authorization together with initial results of
312     * the action taken against that parent authorization.
313     */
314    REFLEXORDER,
315    /**
316     * The request represents the view of an authorization instantiated by a
317     * fulfilling system representing the details of the fulfiller's intention to
318     * act upon a submitted order.
319     */
320    FILLERORDER,
321    /**
322     * An order created in fulfillment of a broader order that represents the
323     * authorization for a single activity occurrence. E.g. The administration of a
324     * single dose of a drug.
325     */
326    INSTANCEORDER,
327    /**
328     * The request represents a component or option for a RequestGroup that
329     * establishes timing, conditionality and/or other constraints among a set of
330     * requests. Refer to [[[RequestGroup]]] for additional information on how this
331     * status is used.
332     */
333    OPTION,
334    /**
335     * added to help the parsers with the generic types
336     */
337    NULL;
338
339    public static RequestIntent fromCode(String codeString) throws FHIRException {
340      if (codeString == null || "".equals(codeString))
341        return null;
342      if ("proposal".equals(codeString))
343        return PROPOSAL;
344      if ("plan".equals(codeString))
345        return PLAN;
346      if ("directive".equals(codeString))
347        return DIRECTIVE;
348      if ("order".equals(codeString))
349        return ORDER;
350      if ("original-order".equals(codeString))
351        return ORIGINALORDER;
352      if ("reflex-order".equals(codeString))
353        return REFLEXORDER;
354      if ("filler-order".equals(codeString))
355        return FILLERORDER;
356      if ("instance-order".equals(codeString))
357        return INSTANCEORDER;
358      if ("option".equals(codeString))
359        return OPTION;
360      if (Configuration.isAcceptInvalidEnums())
361        return null;
362      else
363        throw new FHIRException("Unknown RequestIntent code '" + codeString + "'");
364    }
365
366    public String toCode() {
367      switch (this) {
368      case PROPOSAL:
369        return "proposal";
370      case PLAN:
371        return "plan";
372      case DIRECTIVE:
373        return "directive";
374      case ORDER:
375        return "order";
376      case ORIGINALORDER:
377        return "original-order";
378      case REFLEXORDER:
379        return "reflex-order";
380      case FILLERORDER:
381        return "filler-order";
382      case INSTANCEORDER:
383        return "instance-order";
384      case OPTION:
385        return "option";
386      case NULL:
387        return null;
388      default:
389        return "?";
390      }
391    }
392
393    public String getSystem() {
394      switch (this) {
395      case PROPOSAL:
396        return "http://hl7.org/fhir/request-intent";
397      case PLAN:
398        return "http://hl7.org/fhir/request-intent";
399      case DIRECTIVE:
400        return "http://hl7.org/fhir/request-intent";
401      case ORDER:
402        return "http://hl7.org/fhir/request-intent";
403      case ORIGINALORDER:
404        return "http://hl7.org/fhir/request-intent";
405      case REFLEXORDER:
406        return "http://hl7.org/fhir/request-intent";
407      case FILLERORDER:
408        return "http://hl7.org/fhir/request-intent";
409      case INSTANCEORDER:
410        return "http://hl7.org/fhir/request-intent";
411      case OPTION:
412        return "http://hl7.org/fhir/request-intent";
413      case NULL:
414        return null;
415      default:
416        return "?";
417      }
418    }
419
420    public String getDefinition() {
421      switch (this) {
422      case PROPOSAL:
423        return "The request is a suggestion made by someone/something that does not have an intention to ensure it occurs and without providing an authorization to act.";
424      case PLAN:
425        return "The request represents an intention to ensure something occurs without providing an authorization for others to act.";
426      case DIRECTIVE:
427        return "The request represents a legally binding instruction authored by a Patient or RelatedPerson.";
428      case ORDER:
429        return "The request represents a request/demand and authorization for action by a Practitioner.";
430      case ORIGINALORDER:
431        return "The request represents an original authorization for action.";
432      case REFLEXORDER:
433        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.";
434      case FILLERORDER:
435        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.";
436      case INSTANCEORDER:
437        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.";
438      case OPTION:
439        return "The request represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests.  Refer to [[[RequestGroup]]] for additional information on how this status is used.";
440      case NULL:
441        return null;
442      default:
443        return "?";
444      }
445    }
446
447    public String getDisplay() {
448      switch (this) {
449      case PROPOSAL:
450        return "Proposal";
451      case PLAN:
452        return "Plan";
453      case DIRECTIVE:
454        return "Directive";
455      case ORDER:
456        return "Order";
457      case ORIGINALORDER:
458        return "Original Order";
459      case REFLEXORDER:
460        return "Reflex Order";
461      case FILLERORDER:
462        return "Filler Order";
463      case INSTANCEORDER:
464        return "Instance Order";
465      case OPTION:
466        return "Option";
467      case NULL:
468        return null;
469      default:
470        return "?";
471      }
472    }
473  }
474
475  public static class RequestIntentEnumFactory implements EnumFactory<RequestIntent> {
476    public RequestIntent fromCode(String codeString) throws IllegalArgumentException {
477      if (codeString == null || "".equals(codeString))
478        if (codeString == null || "".equals(codeString))
479          return null;
480      if ("proposal".equals(codeString))
481        return RequestIntent.PROPOSAL;
482      if ("plan".equals(codeString))
483        return RequestIntent.PLAN;
484      if ("directive".equals(codeString))
485        return RequestIntent.DIRECTIVE;
486      if ("order".equals(codeString))
487        return RequestIntent.ORDER;
488      if ("original-order".equals(codeString))
489        return RequestIntent.ORIGINALORDER;
490      if ("reflex-order".equals(codeString))
491        return RequestIntent.REFLEXORDER;
492      if ("filler-order".equals(codeString))
493        return RequestIntent.FILLERORDER;
494      if ("instance-order".equals(codeString))
495        return RequestIntent.INSTANCEORDER;
496      if ("option".equals(codeString))
497        return RequestIntent.OPTION;
498      throw new IllegalArgumentException("Unknown RequestIntent code '" + codeString + "'");
499    }
500
501    public Enumeration<RequestIntent> fromType(PrimitiveType<?> code) throws FHIRException {
502      if (code == null)
503        return null;
504      if (code.isEmpty())
505        return new Enumeration<RequestIntent>(this, RequestIntent.NULL, code);
506      String codeString = code.asStringValue();
507      if (codeString == null || "".equals(codeString))
508        return new Enumeration<RequestIntent>(this, RequestIntent.NULL, code);
509      if ("proposal".equals(codeString))
510        return new Enumeration<RequestIntent>(this, RequestIntent.PROPOSAL, code);
511      if ("plan".equals(codeString))
512        return new Enumeration<RequestIntent>(this, RequestIntent.PLAN, code);
513      if ("directive".equals(codeString))
514        return new Enumeration<RequestIntent>(this, RequestIntent.DIRECTIVE, code);
515      if ("order".equals(codeString))
516        return new Enumeration<RequestIntent>(this, RequestIntent.ORDER, code);
517      if ("original-order".equals(codeString))
518        return new Enumeration<RequestIntent>(this, RequestIntent.ORIGINALORDER, code);
519      if ("reflex-order".equals(codeString))
520        return new Enumeration<RequestIntent>(this, RequestIntent.REFLEXORDER, code);
521      if ("filler-order".equals(codeString))
522        return new Enumeration<RequestIntent>(this, RequestIntent.FILLERORDER, code);
523      if ("instance-order".equals(codeString))
524        return new Enumeration<RequestIntent>(this, RequestIntent.INSTANCEORDER, code);
525      if ("option".equals(codeString))
526        return new Enumeration<RequestIntent>(this, RequestIntent.OPTION, code);
527      throw new FHIRException("Unknown RequestIntent code '" + codeString + "'");
528    }
529
530    public String toCode(RequestIntent code) {
531      if (code == RequestIntent.PROPOSAL)
532        return "proposal";
533      if (code == RequestIntent.PLAN)
534        return "plan";
535      if (code == RequestIntent.DIRECTIVE)
536        return "directive";
537      if (code == RequestIntent.ORDER)
538        return "order";
539      if (code == RequestIntent.ORIGINALORDER)
540        return "original-order";
541      if (code == RequestIntent.REFLEXORDER)
542        return "reflex-order";
543      if (code == RequestIntent.FILLERORDER)
544        return "filler-order";
545      if (code == RequestIntent.INSTANCEORDER)
546        return "instance-order";
547      if (code == RequestIntent.OPTION)
548        return "option";
549      return "?";
550    }
551
552    public String toSystem(RequestIntent code) {
553      return code.getSystem();
554    }
555  }
556
557  public enum RequestPriority {
558    /**
559     * The request has normal priority.
560     */
561    ROUTINE,
562    /**
563     * The request should be actioned promptly - higher priority than routine.
564     */
565    URGENT,
566    /**
567     * The request should be actioned as soon as possible - higher priority than
568     * urgent.
569     */
570    ASAP,
571    /**
572     * The request should be actioned immediately - highest possible priority. E.g.
573     * an emergency.
574     */
575    STAT,
576    /**
577     * added to help the parsers with the generic types
578     */
579    NULL;
580
581    public static RequestPriority fromCode(String codeString) throws FHIRException {
582      if (codeString == null || "".equals(codeString))
583        return null;
584      if ("routine".equals(codeString))
585        return ROUTINE;
586      if ("urgent".equals(codeString))
587        return URGENT;
588      if ("asap".equals(codeString))
589        return ASAP;
590      if ("stat".equals(codeString))
591        return STAT;
592      if (Configuration.isAcceptInvalidEnums())
593        return null;
594      else
595        throw new FHIRException("Unknown RequestPriority code '" + codeString + "'");
596    }
597
598    public String toCode() {
599      switch (this) {
600      case ROUTINE:
601        return "routine";
602      case URGENT:
603        return "urgent";
604      case ASAP:
605        return "asap";
606      case STAT:
607        return "stat";
608      case NULL:
609        return null;
610      default:
611        return "?";
612      }
613    }
614
615    public String getSystem() {
616      switch (this) {
617      case ROUTINE:
618        return "http://hl7.org/fhir/request-priority";
619      case URGENT:
620        return "http://hl7.org/fhir/request-priority";
621      case ASAP:
622        return "http://hl7.org/fhir/request-priority";
623      case STAT:
624        return "http://hl7.org/fhir/request-priority";
625      case NULL:
626        return null;
627      default:
628        return "?";
629      }
630    }
631
632    public String getDefinition() {
633      switch (this) {
634      case ROUTINE:
635        return "The request has normal priority.";
636      case URGENT:
637        return "The request should be actioned promptly - higher priority than routine.";
638      case ASAP:
639        return "The request should be actioned as soon as possible - higher priority than urgent.";
640      case STAT:
641        return "The request should be actioned immediately - highest possible priority.  E.g. an emergency.";
642      case NULL:
643        return null;
644      default:
645        return "?";
646      }
647    }
648
649    public String getDisplay() {
650      switch (this) {
651      case ROUTINE:
652        return "Routine";
653      case URGENT:
654        return "Urgent";
655      case ASAP:
656        return "ASAP";
657      case STAT:
658        return "STAT";
659      case NULL:
660        return null;
661      default:
662        return "?";
663      }
664    }
665  }
666
667  public static class RequestPriorityEnumFactory implements EnumFactory<RequestPriority> {
668    public RequestPriority fromCode(String codeString) throws IllegalArgumentException {
669      if (codeString == null || "".equals(codeString))
670        if (codeString == null || "".equals(codeString))
671          return null;
672      if ("routine".equals(codeString))
673        return RequestPriority.ROUTINE;
674      if ("urgent".equals(codeString))
675        return RequestPriority.URGENT;
676      if ("asap".equals(codeString))
677        return RequestPriority.ASAP;
678      if ("stat".equals(codeString))
679        return RequestPriority.STAT;
680      throw new IllegalArgumentException("Unknown RequestPriority code '" + codeString + "'");
681    }
682
683    public Enumeration<RequestPriority> fromType(PrimitiveType<?> code) throws FHIRException {
684      if (code == null)
685        return null;
686      if (code.isEmpty())
687        return new Enumeration<RequestPriority>(this, RequestPriority.NULL, code);
688      String codeString = code.asStringValue();
689      if (codeString == null || "".equals(codeString))
690        return new Enumeration<RequestPriority>(this, RequestPriority.NULL, code);
691      if ("routine".equals(codeString))
692        return new Enumeration<RequestPriority>(this, RequestPriority.ROUTINE, code);
693      if ("urgent".equals(codeString))
694        return new Enumeration<RequestPriority>(this, RequestPriority.URGENT, code);
695      if ("asap".equals(codeString))
696        return new Enumeration<RequestPriority>(this, RequestPriority.ASAP, code);
697      if ("stat".equals(codeString))
698        return new Enumeration<RequestPriority>(this, RequestPriority.STAT, code);
699      throw new FHIRException("Unknown RequestPriority code '" + codeString + "'");
700    }
701
702    public String toCode(RequestPriority code) {
703      if (code == RequestPriority.ROUTINE)
704        return "routine";
705      if (code == RequestPriority.URGENT)
706        return "urgent";
707      if (code == RequestPriority.ASAP)
708        return "asap";
709      if (code == RequestPriority.STAT)
710        return "stat";
711      return "?";
712    }
713
714    public String toSystem(RequestPriority code) {
715      return code.getSystem();
716    }
717  }
718
719  public enum ActionConditionKind {
720    /**
721     * The condition describes whether or not a given action is applicable.
722     */
723    APPLICABILITY,
724    /**
725     * The condition is a starting condition for the action.
726     */
727    START,
728    /**
729     * The condition is a stop, or exit condition for the action.
730     */
731    STOP,
732    /**
733     * added to help the parsers with the generic types
734     */
735    NULL;
736
737    public static ActionConditionKind fromCode(String codeString) throws FHIRException {
738      if (codeString == null || "".equals(codeString))
739        return null;
740      if ("applicability".equals(codeString))
741        return APPLICABILITY;
742      if ("start".equals(codeString))
743        return START;
744      if ("stop".equals(codeString))
745        return STOP;
746      if (Configuration.isAcceptInvalidEnums())
747        return null;
748      else
749        throw new FHIRException("Unknown ActionConditionKind code '" + codeString + "'");
750    }
751
752    public String toCode() {
753      switch (this) {
754      case APPLICABILITY:
755        return "applicability";
756      case START:
757        return "start";
758      case STOP:
759        return "stop";
760      case NULL:
761        return null;
762      default:
763        return "?";
764      }
765    }
766
767    public String getSystem() {
768      switch (this) {
769      case APPLICABILITY:
770        return "http://hl7.org/fhir/action-condition-kind";
771      case START:
772        return "http://hl7.org/fhir/action-condition-kind";
773      case STOP:
774        return "http://hl7.org/fhir/action-condition-kind";
775      case NULL:
776        return null;
777      default:
778        return "?";
779      }
780    }
781
782    public String getDefinition() {
783      switch (this) {
784      case APPLICABILITY:
785        return "The condition describes whether or not a given action is applicable.";
786      case START:
787        return "The condition is a starting condition for the action.";
788      case STOP:
789        return "The condition is a stop, or exit condition for the action.";
790      case NULL:
791        return null;
792      default:
793        return "?";
794      }
795    }
796
797    public String getDisplay() {
798      switch (this) {
799      case APPLICABILITY:
800        return "Applicability";
801      case START:
802        return "Start";
803      case STOP:
804        return "Stop";
805      case NULL:
806        return null;
807      default:
808        return "?";
809      }
810    }
811  }
812
813  public static class ActionConditionKindEnumFactory implements EnumFactory<ActionConditionKind> {
814    public ActionConditionKind fromCode(String codeString) throws IllegalArgumentException {
815      if (codeString == null || "".equals(codeString))
816        if (codeString == null || "".equals(codeString))
817          return null;
818      if ("applicability".equals(codeString))
819        return ActionConditionKind.APPLICABILITY;
820      if ("start".equals(codeString))
821        return ActionConditionKind.START;
822      if ("stop".equals(codeString))
823        return ActionConditionKind.STOP;
824      throw new IllegalArgumentException("Unknown ActionConditionKind code '" + codeString + "'");
825    }
826
827    public Enumeration<ActionConditionKind> fromType(PrimitiveType<?> code) throws FHIRException {
828      if (code == null)
829        return null;
830      if (code.isEmpty())
831        return new Enumeration<ActionConditionKind>(this, ActionConditionKind.NULL, code);
832      String codeString = code.asStringValue();
833      if (codeString == null || "".equals(codeString))
834        return new Enumeration<ActionConditionKind>(this, ActionConditionKind.NULL, code);
835      if ("applicability".equals(codeString))
836        return new Enumeration<ActionConditionKind>(this, ActionConditionKind.APPLICABILITY, code);
837      if ("start".equals(codeString))
838        return new Enumeration<ActionConditionKind>(this, ActionConditionKind.START, code);
839      if ("stop".equals(codeString))
840        return new Enumeration<ActionConditionKind>(this, ActionConditionKind.STOP, code);
841      throw new FHIRException("Unknown ActionConditionKind code '" + codeString + "'");
842    }
843
844    public String toCode(ActionConditionKind code) {
845      if (code == ActionConditionKind.APPLICABILITY)
846        return "applicability";
847      if (code == ActionConditionKind.START)
848        return "start";
849      if (code == ActionConditionKind.STOP)
850        return "stop";
851      return "?";
852    }
853
854    public String toSystem(ActionConditionKind code) {
855      return code.getSystem();
856    }
857  }
858
859  public enum ActionRelationshipType {
860    /**
861     * The action must be performed before the start of the related action.
862     */
863    BEFORESTART,
864    /**
865     * The action must be performed before the related action.
866     */
867    BEFORE,
868    /**
869     * The action must be performed before the end of the related action.
870     */
871    BEFOREEND,
872    /**
873     * The action must be performed concurrent with the start of the related action.
874     */
875    CONCURRENTWITHSTART,
876    /**
877     * The action must be performed concurrent with the related action.
878     */
879    CONCURRENT,
880    /**
881     * The action must be performed concurrent with the end of the related action.
882     */
883    CONCURRENTWITHEND,
884    /**
885     * The action must be performed after the start of the related action.
886     */
887    AFTERSTART,
888    /**
889     * The action must be performed after the related action.
890     */
891    AFTER,
892    /**
893     * The action must be performed after the end of the related action.
894     */
895    AFTEREND,
896    /**
897     * added to help the parsers with the generic types
898     */
899    NULL;
900
901    public static ActionRelationshipType fromCode(String codeString) throws FHIRException {
902      if (codeString == null || "".equals(codeString))
903        return null;
904      if ("before-start".equals(codeString))
905        return BEFORESTART;
906      if ("before".equals(codeString))
907        return BEFORE;
908      if ("before-end".equals(codeString))
909        return BEFOREEND;
910      if ("concurrent-with-start".equals(codeString))
911        return CONCURRENTWITHSTART;
912      if ("concurrent".equals(codeString))
913        return CONCURRENT;
914      if ("concurrent-with-end".equals(codeString))
915        return CONCURRENTWITHEND;
916      if ("after-start".equals(codeString))
917        return AFTERSTART;
918      if ("after".equals(codeString))
919        return AFTER;
920      if ("after-end".equals(codeString))
921        return AFTEREND;
922      if (Configuration.isAcceptInvalidEnums())
923        return null;
924      else
925        throw new FHIRException("Unknown ActionRelationshipType code '" + codeString + "'");
926    }
927
928    public String toCode() {
929      switch (this) {
930      case BEFORESTART:
931        return "before-start";
932      case BEFORE:
933        return "before";
934      case BEFOREEND:
935        return "before-end";
936      case CONCURRENTWITHSTART:
937        return "concurrent-with-start";
938      case CONCURRENT:
939        return "concurrent";
940      case CONCURRENTWITHEND:
941        return "concurrent-with-end";
942      case AFTERSTART:
943        return "after-start";
944      case AFTER:
945        return "after";
946      case AFTEREND:
947        return "after-end";
948      case NULL:
949        return null;
950      default:
951        return "?";
952      }
953    }
954
955    public String getSystem() {
956      switch (this) {
957      case BEFORESTART:
958        return "http://hl7.org/fhir/action-relationship-type";
959      case BEFORE:
960        return "http://hl7.org/fhir/action-relationship-type";
961      case BEFOREEND:
962        return "http://hl7.org/fhir/action-relationship-type";
963      case CONCURRENTWITHSTART:
964        return "http://hl7.org/fhir/action-relationship-type";
965      case CONCURRENT:
966        return "http://hl7.org/fhir/action-relationship-type";
967      case CONCURRENTWITHEND:
968        return "http://hl7.org/fhir/action-relationship-type";
969      case AFTERSTART:
970        return "http://hl7.org/fhir/action-relationship-type";
971      case AFTER:
972        return "http://hl7.org/fhir/action-relationship-type";
973      case AFTEREND:
974        return "http://hl7.org/fhir/action-relationship-type";
975      case NULL:
976        return null;
977      default:
978        return "?";
979      }
980    }
981
982    public String getDefinition() {
983      switch (this) {
984      case BEFORESTART:
985        return "The action must be performed before the start of the related action.";
986      case BEFORE:
987        return "The action must be performed before the related action.";
988      case BEFOREEND:
989        return "The action must be performed before the end of the related action.";
990      case CONCURRENTWITHSTART:
991        return "The action must be performed concurrent with the start of the related action.";
992      case CONCURRENT:
993        return "The action must be performed concurrent with the related action.";
994      case CONCURRENTWITHEND:
995        return "The action must be performed concurrent with the end of the related action.";
996      case AFTERSTART:
997        return "The action must be performed after the start of the related action.";
998      case AFTER:
999        return "The action must be performed after the related action.";
1000      case AFTEREND:
1001        return "The action must be performed after the end of the related action.";
1002      case NULL:
1003        return null;
1004      default:
1005        return "?";
1006      }
1007    }
1008
1009    public String getDisplay() {
1010      switch (this) {
1011      case BEFORESTART:
1012        return "Before Start";
1013      case BEFORE:
1014        return "Before";
1015      case BEFOREEND:
1016        return "Before End";
1017      case CONCURRENTWITHSTART:
1018        return "Concurrent With Start";
1019      case CONCURRENT:
1020        return "Concurrent";
1021      case CONCURRENTWITHEND:
1022        return "Concurrent With End";
1023      case AFTERSTART:
1024        return "After Start";
1025      case AFTER:
1026        return "After";
1027      case AFTEREND:
1028        return "After End";
1029      case NULL:
1030        return null;
1031      default:
1032        return "?";
1033      }
1034    }
1035  }
1036
1037  public static class ActionRelationshipTypeEnumFactory implements EnumFactory<ActionRelationshipType> {
1038    public ActionRelationshipType fromCode(String codeString) throws IllegalArgumentException {
1039      if (codeString == null || "".equals(codeString))
1040        if (codeString == null || "".equals(codeString))
1041          return null;
1042      if ("before-start".equals(codeString))
1043        return ActionRelationshipType.BEFORESTART;
1044      if ("before".equals(codeString))
1045        return ActionRelationshipType.BEFORE;
1046      if ("before-end".equals(codeString))
1047        return ActionRelationshipType.BEFOREEND;
1048      if ("concurrent-with-start".equals(codeString))
1049        return ActionRelationshipType.CONCURRENTWITHSTART;
1050      if ("concurrent".equals(codeString))
1051        return ActionRelationshipType.CONCURRENT;
1052      if ("concurrent-with-end".equals(codeString))
1053        return ActionRelationshipType.CONCURRENTWITHEND;
1054      if ("after-start".equals(codeString))
1055        return ActionRelationshipType.AFTERSTART;
1056      if ("after".equals(codeString))
1057        return ActionRelationshipType.AFTER;
1058      if ("after-end".equals(codeString))
1059        return ActionRelationshipType.AFTEREND;
1060      throw new IllegalArgumentException("Unknown ActionRelationshipType code '" + codeString + "'");
1061    }
1062
1063    public Enumeration<ActionRelationshipType> fromType(PrimitiveType<?> code) throws FHIRException {
1064      if (code == null)
1065        return null;
1066      if (code.isEmpty())
1067        return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.NULL, code);
1068      String codeString = code.asStringValue();
1069      if (codeString == null || "".equals(codeString))
1070        return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.NULL, code);
1071      if ("before-start".equals(codeString))
1072        return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.BEFORESTART, code);
1073      if ("before".equals(codeString))
1074        return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.BEFORE, code);
1075      if ("before-end".equals(codeString))
1076        return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.BEFOREEND, code);
1077      if ("concurrent-with-start".equals(codeString))
1078        return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.CONCURRENTWITHSTART, code);
1079      if ("concurrent".equals(codeString))
1080        return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.CONCURRENT, code);
1081      if ("concurrent-with-end".equals(codeString))
1082        return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.CONCURRENTWITHEND, code);
1083      if ("after-start".equals(codeString))
1084        return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.AFTERSTART, code);
1085      if ("after".equals(codeString))
1086        return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.AFTER, code);
1087      if ("after-end".equals(codeString))
1088        return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.AFTEREND, code);
1089      throw new FHIRException("Unknown ActionRelationshipType code '" + codeString + "'");
1090    }
1091
1092    public String toCode(ActionRelationshipType code) {
1093      if (code == ActionRelationshipType.BEFORESTART)
1094        return "before-start";
1095      if (code == ActionRelationshipType.BEFORE)
1096        return "before";
1097      if (code == ActionRelationshipType.BEFOREEND)
1098        return "before-end";
1099      if (code == ActionRelationshipType.CONCURRENTWITHSTART)
1100        return "concurrent-with-start";
1101      if (code == ActionRelationshipType.CONCURRENT)
1102        return "concurrent";
1103      if (code == ActionRelationshipType.CONCURRENTWITHEND)
1104        return "concurrent-with-end";
1105      if (code == ActionRelationshipType.AFTERSTART)
1106        return "after-start";
1107      if (code == ActionRelationshipType.AFTER)
1108        return "after";
1109      if (code == ActionRelationshipType.AFTEREND)
1110        return "after-end";
1111      return "?";
1112    }
1113
1114    public String toSystem(ActionRelationshipType code) {
1115      return code.getSystem();
1116    }
1117  }
1118
1119  public enum ActionGroupingBehavior {
1120    /**
1121     * Any group marked with this behavior should be displayed as a visual group to
1122     * the end user.
1123     */
1124    VISUALGROUP,
1125    /**
1126     * A group with this behavior logically groups its sub-elements, and may be
1127     * shown as a visual group to the end user, but it is not required to do so.
1128     */
1129    LOGICALGROUP,
1130    /**
1131     * A group of related alternative actions is a sentence group if the target
1132     * referenced by the action is the same in all the actions and each action
1133     * simply constitutes a different variation on how to specify the details for
1134     * the target. For example, two actions that could be in a SentenceGroup are
1135     * "aspirin, 500 mg, 2 times per day" and "aspirin, 300 mg, 3 times per day". In
1136     * both cases, aspirin is the target referenced by the action, and the two
1137     * actions represent different options for how aspirin might be ordered for the
1138     * patient. Note that a SentenceGroup would almost always have an associated
1139     * selection behavior of "AtMostOne", unless it's a required action, in which
1140     * case, it would be "ExactlyOne".
1141     */
1142    SENTENCEGROUP,
1143    /**
1144     * added to help the parsers with the generic types
1145     */
1146    NULL;
1147
1148    public static ActionGroupingBehavior fromCode(String codeString) throws FHIRException {
1149      if (codeString == null || "".equals(codeString))
1150        return null;
1151      if ("visual-group".equals(codeString))
1152        return VISUALGROUP;
1153      if ("logical-group".equals(codeString))
1154        return LOGICALGROUP;
1155      if ("sentence-group".equals(codeString))
1156        return SENTENCEGROUP;
1157      if (Configuration.isAcceptInvalidEnums())
1158        return null;
1159      else
1160        throw new FHIRException("Unknown ActionGroupingBehavior code '" + codeString + "'");
1161    }
1162
1163    public String toCode() {
1164      switch (this) {
1165      case VISUALGROUP:
1166        return "visual-group";
1167      case LOGICALGROUP:
1168        return "logical-group";
1169      case SENTENCEGROUP:
1170        return "sentence-group";
1171      case NULL:
1172        return null;
1173      default:
1174        return "?";
1175      }
1176    }
1177
1178    public String getSystem() {
1179      switch (this) {
1180      case VISUALGROUP:
1181        return "http://hl7.org/fhir/action-grouping-behavior";
1182      case LOGICALGROUP:
1183        return "http://hl7.org/fhir/action-grouping-behavior";
1184      case SENTENCEGROUP:
1185        return "http://hl7.org/fhir/action-grouping-behavior";
1186      case NULL:
1187        return null;
1188      default:
1189        return "?";
1190      }
1191    }
1192
1193    public String getDefinition() {
1194      switch (this) {
1195      case VISUALGROUP:
1196        return "Any group marked with this behavior should be displayed as a visual group to the end user.";
1197      case LOGICALGROUP:
1198        return "A group with this behavior logically groups its sub-elements, and may be shown as a visual group to the end user, but it is not required to do so.";
1199      case SENTENCEGROUP:
1200        return "A group of related alternative actions is a sentence group if the target referenced by the action is the same in all the actions and each action simply constitutes a different variation on how to specify the details for the target. For example, two actions that could be in a SentenceGroup are \"aspirin, 500 mg, 2 times per day\" and \"aspirin, 300 mg, 3 times per day\". In both cases, aspirin is the target referenced by the action, and the two actions represent different options for how aspirin might be ordered for the patient. Note that a SentenceGroup would almost always have an associated selection behavior of \"AtMostOne\", unless it's a required action, in which case, it would be \"ExactlyOne\".";
1201      case NULL:
1202        return null;
1203      default:
1204        return "?";
1205      }
1206    }
1207
1208    public String getDisplay() {
1209      switch (this) {
1210      case VISUALGROUP:
1211        return "Visual Group";
1212      case LOGICALGROUP:
1213        return "Logical Group";
1214      case SENTENCEGROUP:
1215        return "Sentence Group";
1216      case NULL:
1217        return null;
1218      default:
1219        return "?";
1220      }
1221    }
1222  }
1223
1224  public static class ActionGroupingBehaviorEnumFactory implements EnumFactory<ActionGroupingBehavior> {
1225    public ActionGroupingBehavior fromCode(String codeString) throws IllegalArgumentException {
1226      if (codeString == null || "".equals(codeString))
1227        if (codeString == null || "".equals(codeString))
1228          return null;
1229      if ("visual-group".equals(codeString))
1230        return ActionGroupingBehavior.VISUALGROUP;
1231      if ("logical-group".equals(codeString))
1232        return ActionGroupingBehavior.LOGICALGROUP;
1233      if ("sentence-group".equals(codeString))
1234        return ActionGroupingBehavior.SENTENCEGROUP;
1235      throw new IllegalArgumentException("Unknown ActionGroupingBehavior code '" + codeString + "'");
1236    }
1237
1238    public Enumeration<ActionGroupingBehavior> fromType(PrimitiveType<?> code) throws FHIRException {
1239      if (code == null)
1240        return null;
1241      if (code.isEmpty())
1242        return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.NULL, code);
1243      String codeString = code.asStringValue();
1244      if (codeString == null || "".equals(codeString))
1245        return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.NULL, code);
1246      if ("visual-group".equals(codeString))
1247        return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.VISUALGROUP, code);
1248      if ("logical-group".equals(codeString))
1249        return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.LOGICALGROUP, code);
1250      if ("sentence-group".equals(codeString))
1251        return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.SENTENCEGROUP, code);
1252      throw new FHIRException("Unknown ActionGroupingBehavior code '" + codeString + "'");
1253    }
1254
1255    public String toCode(ActionGroupingBehavior code) {
1256      if (code == ActionGroupingBehavior.VISUALGROUP)
1257        return "visual-group";
1258      if (code == ActionGroupingBehavior.LOGICALGROUP)
1259        return "logical-group";
1260      if (code == ActionGroupingBehavior.SENTENCEGROUP)
1261        return "sentence-group";
1262      return "?";
1263    }
1264
1265    public String toSystem(ActionGroupingBehavior code) {
1266      return code.getSystem();
1267    }
1268  }
1269
1270  public enum ActionSelectionBehavior {
1271    /**
1272     * Any number of the actions in the group may be chosen, from zero to all.
1273     */
1274    ANY,
1275    /**
1276     * All the actions in the group must be selected as a single unit.
1277     */
1278    ALL,
1279    /**
1280     * All the actions in the group are meant to be chosen as a single unit: either
1281     * all must be selected by the end user, or none may be selected.
1282     */
1283    ALLORNONE,
1284    /**
1285     * The end user must choose one and only one of the selectable actions in the
1286     * group. The user SHALL NOT choose none of the actions in the group.
1287     */
1288    EXACTLYONE,
1289    /**
1290     * The end user may choose zero or at most one of the actions in the group.
1291     */
1292    ATMOSTONE,
1293    /**
1294     * The end user must choose a minimum of one, and as many additional as desired.
1295     */
1296    ONEORMORE,
1297    /**
1298     * added to help the parsers with the generic types
1299     */
1300    NULL;
1301
1302    public static ActionSelectionBehavior fromCode(String codeString) throws FHIRException {
1303      if (codeString == null || "".equals(codeString))
1304        return null;
1305      if ("any".equals(codeString))
1306        return ANY;
1307      if ("all".equals(codeString))
1308        return ALL;
1309      if ("all-or-none".equals(codeString))
1310        return ALLORNONE;
1311      if ("exactly-one".equals(codeString))
1312        return EXACTLYONE;
1313      if ("at-most-one".equals(codeString))
1314        return ATMOSTONE;
1315      if ("one-or-more".equals(codeString))
1316        return ONEORMORE;
1317      if (Configuration.isAcceptInvalidEnums())
1318        return null;
1319      else
1320        throw new FHIRException("Unknown ActionSelectionBehavior code '" + codeString + "'");
1321    }
1322
1323    public String toCode() {
1324      switch (this) {
1325      case ANY:
1326        return "any";
1327      case ALL:
1328        return "all";
1329      case ALLORNONE:
1330        return "all-or-none";
1331      case EXACTLYONE:
1332        return "exactly-one";
1333      case ATMOSTONE:
1334        return "at-most-one";
1335      case ONEORMORE:
1336        return "one-or-more";
1337      case NULL:
1338        return null;
1339      default:
1340        return "?";
1341      }
1342    }
1343
1344    public String getSystem() {
1345      switch (this) {
1346      case ANY:
1347        return "http://hl7.org/fhir/action-selection-behavior";
1348      case ALL:
1349        return "http://hl7.org/fhir/action-selection-behavior";
1350      case ALLORNONE:
1351        return "http://hl7.org/fhir/action-selection-behavior";
1352      case EXACTLYONE:
1353        return "http://hl7.org/fhir/action-selection-behavior";
1354      case ATMOSTONE:
1355        return "http://hl7.org/fhir/action-selection-behavior";
1356      case ONEORMORE:
1357        return "http://hl7.org/fhir/action-selection-behavior";
1358      case NULL:
1359        return null;
1360      default:
1361        return "?";
1362      }
1363    }
1364
1365    public String getDefinition() {
1366      switch (this) {
1367      case ANY:
1368        return "Any number of the actions in the group may be chosen, from zero to all.";
1369      case ALL:
1370        return "All the actions in the group must be selected as a single unit.";
1371      case ALLORNONE:
1372        return "All the actions in the group are meant to be chosen as a single unit: either all must be selected by the end user, or none may be selected.";
1373      case EXACTLYONE:
1374        return "The end user must choose one and only one of the selectable actions in the group. The user SHALL NOT choose none of the actions in the group.";
1375      case ATMOSTONE:
1376        return "The end user may choose zero or at most one of the actions in the group.";
1377      case ONEORMORE:
1378        return "The end user must choose a minimum of one, and as many additional as desired.";
1379      case NULL:
1380        return null;
1381      default:
1382        return "?";
1383      }
1384    }
1385
1386    public String getDisplay() {
1387      switch (this) {
1388      case ANY:
1389        return "Any";
1390      case ALL:
1391        return "All";
1392      case ALLORNONE:
1393        return "All Or None";
1394      case EXACTLYONE:
1395        return "Exactly One";
1396      case ATMOSTONE:
1397        return "At Most One";
1398      case ONEORMORE:
1399        return "One Or More";
1400      case NULL:
1401        return null;
1402      default:
1403        return "?";
1404      }
1405    }
1406  }
1407
1408  public static class ActionSelectionBehaviorEnumFactory implements EnumFactory<ActionSelectionBehavior> {
1409    public ActionSelectionBehavior fromCode(String codeString) throws IllegalArgumentException {
1410      if (codeString == null || "".equals(codeString))
1411        if (codeString == null || "".equals(codeString))
1412          return null;
1413      if ("any".equals(codeString))
1414        return ActionSelectionBehavior.ANY;
1415      if ("all".equals(codeString))
1416        return ActionSelectionBehavior.ALL;
1417      if ("all-or-none".equals(codeString))
1418        return ActionSelectionBehavior.ALLORNONE;
1419      if ("exactly-one".equals(codeString))
1420        return ActionSelectionBehavior.EXACTLYONE;
1421      if ("at-most-one".equals(codeString))
1422        return ActionSelectionBehavior.ATMOSTONE;
1423      if ("one-or-more".equals(codeString))
1424        return ActionSelectionBehavior.ONEORMORE;
1425      throw new IllegalArgumentException("Unknown ActionSelectionBehavior code '" + codeString + "'");
1426    }
1427
1428    public Enumeration<ActionSelectionBehavior> fromType(PrimitiveType<?> code) throws FHIRException {
1429      if (code == null)
1430        return null;
1431      if (code.isEmpty())
1432        return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.NULL, code);
1433      String codeString = code.asStringValue();
1434      if (codeString == null || "".equals(codeString))
1435        return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.NULL, code);
1436      if ("any".equals(codeString))
1437        return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ANY, code);
1438      if ("all".equals(codeString))
1439        return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ALL, code);
1440      if ("all-or-none".equals(codeString))
1441        return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ALLORNONE, code);
1442      if ("exactly-one".equals(codeString))
1443        return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.EXACTLYONE, code);
1444      if ("at-most-one".equals(codeString))
1445        return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ATMOSTONE, code);
1446      if ("one-or-more".equals(codeString))
1447        return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ONEORMORE, code);
1448      throw new FHIRException("Unknown ActionSelectionBehavior code '" + codeString + "'");
1449    }
1450
1451    public String toCode(ActionSelectionBehavior code) {
1452      if (code == ActionSelectionBehavior.ANY)
1453        return "any";
1454      if (code == ActionSelectionBehavior.ALL)
1455        return "all";
1456      if (code == ActionSelectionBehavior.ALLORNONE)
1457        return "all-or-none";
1458      if (code == ActionSelectionBehavior.EXACTLYONE)
1459        return "exactly-one";
1460      if (code == ActionSelectionBehavior.ATMOSTONE)
1461        return "at-most-one";
1462      if (code == ActionSelectionBehavior.ONEORMORE)
1463        return "one-or-more";
1464      return "?";
1465    }
1466
1467    public String toSystem(ActionSelectionBehavior code) {
1468      return code.getSystem();
1469    }
1470  }
1471
1472  public enum ActionRequiredBehavior {
1473    /**
1474     * An action with this behavior must be included in the actions processed by the
1475     * end user; the end user SHALL NOT choose not to include this action.
1476     */
1477    MUST,
1478    /**
1479     * An action with this behavior may be included in the set of actions processed
1480     * by the end user.
1481     */
1482    COULD,
1483    /**
1484     * An action with this behavior must be included in the set of actions processed
1485     * by the end user, unless the end user provides documentation as to why the
1486     * action was not included.
1487     */
1488    MUSTUNLESSDOCUMENTED,
1489    /**
1490     * added to help the parsers with the generic types
1491     */
1492    NULL;
1493
1494    public static ActionRequiredBehavior fromCode(String codeString) throws FHIRException {
1495      if (codeString == null || "".equals(codeString))
1496        return null;
1497      if ("must".equals(codeString))
1498        return MUST;
1499      if ("could".equals(codeString))
1500        return COULD;
1501      if ("must-unless-documented".equals(codeString))
1502        return MUSTUNLESSDOCUMENTED;
1503      if (Configuration.isAcceptInvalidEnums())
1504        return null;
1505      else
1506        throw new FHIRException("Unknown ActionRequiredBehavior code '" + codeString + "'");
1507    }
1508
1509    public String toCode() {
1510      switch (this) {
1511      case MUST:
1512        return "must";
1513      case COULD:
1514        return "could";
1515      case MUSTUNLESSDOCUMENTED:
1516        return "must-unless-documented";
1517      case NULL:
1518        return null;
1519      default:
1520        return "?";
1521      }
1522    }
1523
1524    public String getSystem() {
1525      switch (this) {
1526      case MUST:
1527        return "http://hl7.org/fhir/action-required-behavior";
1528      case COULD:
1529        return "http://hl7.org/fhir/action-required-behavior";
1530      case MUSTUNLESSDOCUMENTED:
1531        return "http://hl7.org/fhir/action-required-behavior";
1532      case NULL:
1533        return null;
1534      default:
1535        return "?";
1536      }
1537    }
1538
1539    public String getDefinition() {
1540      switch (this) {
1541      case MUST:
1542        return "An action with this behavior must be included in the actions processed by the end user; the end user SHALL NOT choose not to include this action.";
1543      case COULD:
1544        return "An action with this behavior may be included in the set of actions processed by the end user.";
1545      case MUSTUNLESSDOCUMENTED:
1546        return "An action with this behavior must be included in the set of actions processed by the end user, unless the end user provides documentation as to why the action was not included.";
1547      case NULL:
1548        return null;
1549      default:
1550        return "?";
1551      }
1552    }
1553
1554    public String getDisplay() {
1555      switch (this) {
1556      case MUST:
1557        return "Must";
1558      case COULD:
1559        return "Could";
1560      case MUSTUNLESSDOCUMENTED:
1561        return "Must Unless Documented";
1562      case NULL:
1563        return null;
1564      default:
1565        return "?";
1566      }
1567    }
1568  }
1569
1570  public static class ActionRequiredBehaviorEnumFactory implements EnumFactory<ActionRequiredBehavior> {
1571    public ActionRequiredBehavior fromCode(String codeString) throws IllegalArgumentException {
1572      if (codeString == null || "".equals(codeString))
1573        if (codeString == null || "".equals(codeString))
1574          return null;
1575      if ("must".equals(codeString))
1576        return ActionRequiredBehavior.MUST;
1577      if ("could".equals(codeString))
1578        return ActionRequiredBehavior.COULD;
1579      if ("must-unless-documented".equals(codeString))
1580        return ActionRequiredBehavior.MUSTUNLESSDOCUMENTED;
1581      throw new IllegalArgumentException("Unknown ActionRequiredBehavior code '" + codeString + "'");
1582    }
1583
1584    public Enumeration<ActionRequiredBehavior> fromType(PrimitiveType<?> code) throws FHIRException {
1585      if (code == null)
1586        return null;
1587      if (code.isEmpty())
1588        return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.NULL, code);
1589      String codeString = code.asStringValue();
1590      if (codeString == null || "".equals(codeString))
1591        return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.NULL, code);
1592      if ("must".equals(codeString))
1593        return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.MUST, code);
1594      if ("could".equals(codeString))
1595        return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.COULD, code);
1596      if ("must-unless-documented".equals(codeString))
1597        return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.MUSTUNLESSDOCUMENTED, code);
1598      throw new FHIRException("Unknown ActionRequiredBehavior code '" + codeString + "'");
1599    }
1600
1601    public String toCode(ActionRequiredBehavior code) {
1602      if (code == ActionRequiredBehavior.MUST)
1603        return "must";
1604      if (code == ActionRequiredBehavior.COULD)
1605        return "could";
1606      if (code == ActionRequiredBehavior.MUSTUNLESSDOCUMENTED)
1607        return "must-unless-documented";
1608      return "?";
1609    }
1610
1611    public String toSystem(ActionRequiredBehavior code) {
1612      return code.getSystem();
1613    }
1614  }
1615
1616  public enum ActionPrecheckBehavior {
1617    /**
1618     * An action with this behavior is one of the most frequent action that is, or
1619     * should be, included by an end user, for the particular context in which the
1620     * action occurs. The system displaying the action to the end user should
1621     * consider "pre-checking" such an action as a convenience for the user.
1622     */
1623    YES,
1624    /**
1625     * An action with this behavior is one of the less frequent actions included by
1626     * the end user, for the particular context in which the action occurs. The
1627     * system displaying the actions to the end user would typically not "pre-check"
1628     * such an action.
1629     */
1630    NO,
1631    /**
1632     * added to help the parsers with the generic types
1633     */
1634    NULL;
1635
1636    public static ActionPrecheckBehavior fromCode(String codeString) throws FHIRException {
1637      if (codeString == null || "".equals(codeString))
1638        return null;
1639      if ("yes".equals(codeString))
1640        return YES;
1641      if ("no".equals(codeString))
1642        return NO;
1643      if (Configuration.isAcceptInvalidEnums())
1644        return null;
1645      else
1646        throw new FHIRException("Unknown ActionPrecheckBehavior code '" + codeString + "'");
1647    }
1648
1649    public String toCode() {
1650      switch (this) {
1651      case YES:
1652        return "yes";
1653      case NO:
1654        return "no";
1655      case NULL:
1656        return null;
1657      default:
1658        return "?";
1659      }
1660    }
1661
1662    public String getSystem() {
1663      switch (this) {
1664      case YES:
1665        return "http://hl7.org/fhir/action-precheck-behavior";
1666      case NO:
1667        return "http://hl7.org/fhir/action-precheck-behavior";
1668      case NULL:
1669        return null;
1670      default:
1671        return "?";
1672      }
1673    }
1674
1675    public String getDefinition() {
1676      switch (this) {
1677      case YES:
1678        return "An action with this behavior is one of the most frequent action that is, or should be, included by an end user, for the particular context in which the action occurs. The system displaying the action to the end user should consider \"pre-checking\" such an action as a convenience for the user.";
1679      case NO:
1680        return "An action with this behavior is one of the less frequent actions included by the end user, for the particular context in which the action occurs. The system displaying the actions to the end user would typically not \"pre-check\" such an action.";
1681      case NULL:
1682        return null;
1683      default:
1684        return "?";
1685      }
1686    }
1687
1688    public String getDisplay() {
1689      switch (this) {
1690      case YES:
1691        return "Yes";
1692      case NO:
1693        return "No";
1694      case NULL:
1695        return null;
1696      default:
1697        return "?";
1698      }
1699    }
1700  }
1701
1702  public static class ActionPrecheckBehaviorEnumFactory implements EnumFactory<ActionPrecheckBehavior> {
1703    public ActionPrecheckBehavior fromCode(String codeString) throws IllegalArgumentException {
1704      if (codeString == null || "".equals(codeString))
1705        if (codeString == null || "".equals(codeString))
1706          return null;
1707      if ("yes".equals(codeString))
1708        return ActionPrecheckBehavior.YES;
1709      if ("no".equals(codeString))
1710        return ActionPrecheckBehavior.NO;
1711      throw new IllegalArgumentException("Unknown ActionPrecheckBehavior code '" + codeString + "'");
1712    }
1713
1714    public Enumeration<ActionPrecheckBehavior> fromType(PrimitiveType<?> code) throws FHIRException {
1715      if (code == null)
1716        return null;
1717      if (code.isEmpty())
1718        return new Enumeration<ActionPrecheckBehavior>(this, ActionPrecheckBehavior.NULL, code);
1719      String codeString = code.asStringValue();
1720      if (codeString == null || "".equals(codeString))
1721        return new Enumeration<ActionPrecheckBehavior>(this, ActionPrecheckBehavior.NULL, code);
1722      if ("yes".equals(codeString))
1723        return new Enumeration<ActionPrecheckBehavior>(this, ActionPrecheckBehavior.YES, code);
1724      if ("no".equals(codeString))
1725        return new Enumeration<ActionPrecheckBehavior>(this, ActionPrecheckBehavior.NO, code);
1726      throw new FHIRException("Unknown ActionPrecheckBehavior code '" + codeString + "'");
1727    }
1728
1729    public String toCode(ActionPrecheckBehavior code) {
1730      if (code == ActionPrecheckBehavior.YES)
1731        return "yes";
1732      if (code == ActionPrecheckBehavior.NO)
1733        return "no";
1734      return "?";
1735    }
1736
1737    public String toSystem(ActionPrecheckBehavior code) {
1738      return code.getSystem();
1739    }
1740  }
1741
1742  public enum ActionCardinalityBehavior {
1743    /**
1744     * The action may only be selected one time.
1745     */
1746    SINGLE,
1747    /**
1748     * The action may be selected multiple times.
1749     */
1750    MULTIPLE,
1751    /**
1752     * added to help the parsers with the generic types
1753     */
1754    NULL;
1755
1756    public static ActionCardinalityBehavior fromCode(String codeString) throws FHIRException {
1757      if (codeString == null || "".equals(codeString))
1758        return null;
1759      if ("single".equals(codeString))
1760        return SINGLE;
1761      if ("multiple".equals(codeString))
1762        return MULTIPLE;
1763      if (Configuration.isAcceptInvalidEnums())
1764        return null;
1765      else
1766        throw new FHIRException("Unknown ActionCardinalityBehavior code '" + codeString + "'");
1767    }
1768
1769    public String toCode() {
1770      switch (this) {
1771      case SINGLE:
1772        return "single";
1773      case MULTIPLE:
1774        return "multiple";
1775      case NULL:
1776        return null;
1777      default:
1778        return "?";
1779      }
1780    }
1781
1782    public String getSystem() {
1783      switch (this) {
1784      case SINGLE:
1785        return "http://hl7.org/fhir/action-cardinality-behavior";
1786      case MULTIPLE:
1787        return "http://hl7.org/fhir/action-cardinality-behavior";
1788      case NULL:
1789        return null;
1790      default:
1791        return "?";
1792      }
1793    }
1794
1795    public String getDefinition() {
1796      switch (this) {
1797      case SINGLE:
1798        return "The action may only be selected one time.";
1799      case MULTIPLE:
1800        return "The action may be selected multiple times.";
1801      case NULL:
1802        return null;
1803      default:
1804        return "?";
1805      }
1806    }
1807
1808    public String getDisplay() {
1809      switch (this) {
1810      case SINGLE:
1811        return "Single";
1812      case MULTIPLE:
1813        return "Multiple";
1814      case NULL:
1815        return null;
1816      default:
1817        return "?";
1818      }
1819    }
1820  }
1821
1822  public static class ActionCardinalityBehaviorEnumFactory implements EnumFactory<ActionCardinalityBehavior> {
1823    public ActionCardinalityBehavior fromCode(String codeString) throws IllegalArgumentException {
1824      if (codeString == null || "".equals(codeString))
1825        if (codeString == null || "".equals(codeString))
1826          return null;
1827      if ("single".equals(codeString))
1828        return ActionCardinalityBehavior.SINGLE;
1829      if ("multiple".equals(codeString))
1830        return ActionCardinalityBehavior.MULTIPLE;
1831      throw new IllegalArgumentException("Unknown ActionCardinalityBehavior code '" + codeString + "'");
1832    }
1833
1834    public Enumeration<ActionCardinalityBehavior> fromType(PrimitiveType<?> code) throws FHIRException {
1835      if (code == null)
1836        return null;
1837      if (code.isEmpty())
1838        return new Enumeration<ActionCardinalityBehavior>(this, ActionCardinalityBehavior.NULL, code);
1839      String codeString = code.asStringValue();
1840      if (codeString == null || "".equals(codeString))
1841        return new Enumeration<ActionCardinalityBehavior>(this, ActionCardinalityBehavior.NULL, code);
1842      if ("single".equals(codeString))
1843        return new Enumeration<ActionCardinalityBehavior>(this, ActionCardinalityBehavior.SINGLE, code);
1844      if ("multiple".equals(codeString))
1845        return new Enumeration<ActionCardinalityBehavior>(this, ActionCardinalityBehavior.MULTIPLE, code);
1846      throw new FHIRException("Unknown ActionCardinalityBehavior code '" + codeString + "'");
1847    }
1848
1849    public String toCode(ActionCardinalityBehavior code) {
1850      if (code == ActionCardinalityBehavior.SINGLE)
1851        return "single";
1852      if (code == ActionCardinalityBehavior.MULTIPLE)
1853        return "multiple";
1854      return "?";
1855    }
1856
1857    public String toSystem(ActionCardinalityBehavior code) {
1858      return code.getSystem();
1859    }
1860  }
1861
1862  @Block()
1863  public static class RequestGroupActionComponent extends BackboneElement implements IBaseBackboneElement {
1864    /**
1865     * A user-visible prefix for the action.
1866     */
1867    @Child(name = "prefix", type = { StringType.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
1868    @Description(shortDefinition = "User-visible prefix for the action (e.g. 1. or A.)", formalDefinition = "A user-visible prefix for the action.")
1869    protected StringType prefix;
1870
1871    /**
1872     * The title of the action displayed to a user.
1873     */
1874    @Child(name = "title", type = { StringType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
1875    @Description(shortDefinition = "User-visible title", formalDefinition = "The title of the action displayed to a user.")
1876    protected StringType title;
1877
1878    /**
1879     * A short description of the action used to provide a summary to display to the
1880     * user.
1881     */
1882    @Child(name = "description", type = {
1883        StringType.class }, order = 3, min = 0, max = 1, modifier = false, summary = true)
1884    @Description(shortDefinition = "Short description of the action", formalDefinition = "A short description of the action used to provide a summary to display to the user.")
1885    protected StringType description;
1886
1887    /**
1888     * A text equivalent of the action to be performed. This provides a
1889     * human-interpretable description of the action when the definition is consumed
1890     * by a system that might not be capable of interpreting it dynamically.
1891     */
1892    @Child(name = "textEquivalent", type = {
1893        StringType.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
1894    @Description(shortDefinition = "Static text equivalent of the action, used if the dynamic aspects cannot be interpreted by the receiving system", formalDefinition = "A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that might not be capable of interpreting it dynamically.")
1895    protected StringType textEquivalent;
1896
1897    /**
1898     * Indicates how quickly the action should be addressed with respect to other
1899     * actions.
1900     */
1901    @Child(name = "priority", type = { CodeType.class }, order = 5, min = 0, max = 1, modifier = false, summary = false)
1902    @Description(shortDefinition = "routine | urgent | asap | stat", formalDefinition = "Indicates how quickly the action should be addressed with respect to other actions.")
1903    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/request-priority")
1904    protected Enumeration<RequestPriority> priority;
1905
1906    /**
1907     * A code that provides meaning for the action or action group. For example, a
1908     * section may have a LOINC code for a section of a documentation template.
1909     */
1910    @Child(name = "code", type = {
1911        CodeableConcept.class }, order = 6, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1912    @Description(shortDefinition = "Code representing the meaning of the action or sub-actions", formalDefinition = "A code that provides meaning for the action or action group. For example, a section may have a LOINC code for a section of a documentation template.")
1913    protected List<CodeableConcept> code;
1914
1915    /**
1916     * Didactic or other informational resources associated with the action that can
1917     * be provided to the CDS recipient. Information resources can include inline
1918     * text commentary and links to web resources.
1919     */
1920    @Child(name = "documentation", type = {
1921        RelatedArtifact.class }, order = 7, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1922    @Description(shortDefinition = "Supporting documentation for the intended performer of the action", formalDefinition = "Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.")
1923    protected List<RelatedArtifact> documentation;
1924
1925    /**
1926     * An expression that describes applicability criteria, or start/stop conditions
1927     * for the action.
1928     */
1929    @Child(name = "condition", type = {}, order = 8, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1930    @Description(shortDefinition = "Whether or not the action is applicable", formalDefinition = "An expression that describes applicability criteria, or start/stop conditions for the action.")
1931    protected List<RequestGroupActionConditionComponent> condition;
1932
1933    /**
1934     * A relationship to another action such as "before" or "30-60 minutes after
1935     * start of".
1936     */
1937    @Child(name = "relatedAction", type = {}, order = 9, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1938    @Description(shortDefinition = "Relationship to another action", formalDefinition = "A relationship to another action such as \"before\" or \"30-60 minutes after start of\".")
1939    protected List<RequestGroupActionRelatedActionComponent> relatedAction;
1940
1941    /**
1942     * An optional value describing when the action should be performed.
1943     */
1944    @Child(name = "timing", type = { DateTimeType.class, Age.class, Period.class, Duration.class, Range.class,
1945        Timing.class }, order = 10, min = 0, max = 1, modifier = false, summary = false)
1946    @Description(shortDefinition = "When the action should take place", formalDefinition = "An optional value describing when the action should be performed.")
1947    protected Type timing;
1948
1949    /**
1950     * The participant that should perform or be responsible for this action.
1951     */
1952    @Child(name = "participant", type = { Patient.class, Practitioner.class, PractitionerRole.class,
1953        RelatedPerson.class,
1954        Device.class }, order = 11, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1955    @Description(shortDefinition = "Who should perform the action", formalDefinition = "The participant that should perform or be responsible for this action.")
1956    protected List<Reference> participant;
1957    /**
1958     * The actual objects that are the target of the reference (The participant that
1959     * should perform or be responsible for this action.)
1960     */
1961    protected List<Resource> participantTarget;
1962
1963    /**
1964     * The type of action to perform (create, update, remove).
1965     */
1966    @Child(name = "type", type = {
1967        CodeableConcept.class }, order = 12, min = 0, max = 1, modifier = false, summary = false)
1968    @Description(shortDefinition = "create | update | remove | fire-event", formalDefinition = "The type of action to perform (create, update, remove).")
1969    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/action-type")
1970    protected CodeableConcept type;
1971
1972    /**
1973     * Defines the grouping behavior for the action and its children.
1974     */
1975    @Child(name = "groupingBehavior", type = {
1976        CodeType.class }, order = 13, min = 0, max = 1, modifier = false, summary = false)
1977    @Description(shortDefinition = "visual-group | logical-group | sentence-group", formalDefinition = "Defines the grouping behavior for the action and its children.")
1978    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/action-grouping-behavior")
1979    protected Enumeration<ActionGroupingBehavior> groupingBehavior;
1980
1981    /**
1982     * Defines the selection behavior for the action and its children.
1983     */
1984    @Child(name = "selectionBehavior", type = {
1985        CodeType.class }, order = 14, min = 0, max = 1, modifier = false, summary = false)
1986    @Description(shortDefinition = "any | all | all-or-none | exactly-one | at-most-one | one-or-more", formalDefinition = "Defines the selection behavior for the action and its children.")
1987    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/action-selection-behavior")
1988    protected Enumeration<ActionSelectionBehavior> selectionBehavior;
1989
1990    /**
1991     * Defines expectations around whether an action is required.
1992     */
1993    @Child(name = "requiredBehavior", type = {
1994        CodeType.class }, order = 15, min = 0, max = 1, modifier = false, summary = false)
1995    @Description(shortDefinition = "must | could | must-unless-documented", formalDefinition = "Defines expectations around whether an action is required.")
1996    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/action-required-behavior")
1997    protected Enumeration<ActionRequiredBehavior> requiredBehavior;
1998
1999    /**
2000     * Defines whether the action should usually be preselected.
2001     */
2002    @Child(name = "precheckBehavior", type = {
2003        CodeType.class }, order = 16, min = 0, max = 1, modifier = false, summary = false)
2004    @Description(shortDefinition = "yes | no", formalDefinition = "Defines whether the action should usually be preselected.")
2005    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/action-precheck-behavior")
2006    protected Enumeration<ActionPrecheckBehavior> precheckBehavior;
2007
2008    /**
2009     * Defines whether the action can be selected multiple times.
2010     */
2011    @Child(name = "cardinalityBehavior", type = {
2012        CodeType.class }, order = 17, min = 0, max = 1, modifier = false, summary = false)
2013    @Description(shortDefinition = "single | multiple", formalDefinition = "Defines whether the action can be selected multiple times.")
2014    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/action-cardinality-behavior")
2015    protected Enumeration<ActionCardinalityBehavior> cardinalityBehavior;
2016
2017    /**
2018     * The resource that is the target of the action (e.g. CommunicationRequest).
2019     */
2020    @Child(name = "resource", type = {
2021        Reference.class }, order = 18, min = 0, max = 1, modifier = false, summary = false)
2022    @Description(shortDefinition = "The target of the action", formalDefinition = "The resource that is the target of the action (e.g. CommunicationRequest).")
2023    protected Reference resource;
2024
2025    /**
2026     * The actual object that is the target of the reference (The resource that is
2027     * the target of the action (e.g. CommunicationRequest).)
2028     */
2029    protected Resource resourceTarget;
2030
2031    /**
2032     * Sub actions.
2033     */
2034    @Child(name = "action", type = {
2035        RequestGroupActionComponent.class }, order = 19, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
2036    @Description(shortDefinition = "Sub action", formalDefinition = "Sub actions.")
2037    protected List<RequestGroupActionComponent> action;
2038
2039    private static final long serialVersionUID = 296752321L;
2040
2041    /**
2042     * Constructor
2043     */
2044    public RequestGroupActionComponent() {
2045      super();
2046    }
2047
2048    /**
2049     * @return {@link #prefix} (A user-visible prefix for the action.). This is the
2050     *         underlying object with id, value and extensions. The accessor
2051     *         "getPrefix" gives direct access to the value
2052     */
2053    public StringType getPrefixElement() {
2054      if (this.prefix == null)
2055        if (Configuration.errorOnAutoCreate())
2056          throw new Error("Attempt to auto-create RequestGroupActionComponent.prefix");
2057        else if (Configuration.doAutoCreate())
2058          this.prefix = new StringType(); // bb
2059      return this.prefix;
2060    }
2061
2062    public boolean hasPrefixElement() {
2063      return this.prefix != null && !this.prefix.isEmpty();
2064    }
2065
2066    public boolean hasPrefix() {
2067      return this.prefix != null && !this.prefix.isEmpty();
2068    }
2069
2070    /**
2071     * @param value {@link #prefix} (A user-visible prefix for the action.). This is
2072     *              the underlying object with id, value and extensions. The
2073     *              accessor "getPrefix" gives direct access to the value
2074     */
2075    public RequestGroupActionComponent setPrefixElement(StringType value) {
2076      this.prefix = value;
2077      return this;
2078    }
2079
2080    /**
2081     * @return A user-visible prefix for the action.
2082     */
2083    public String getPrefix() {
2084      return this.prefix == null ? null : this.prefix.getValue();
2085    }
2086
2087    /**
2088     * @param value A user-visible prefix for the action.
2089     */
2090    public RequestGroupActionComponent setPrefix(String value) {
2091      if (Utilities.noString(value))
2092        this.prefix = null;
2093      else {
2094        if (this.prefix == null)
2095          this.prefix = new StringType();
2096        this.prefix.setValue(value);
2097      }
2098      return this;
2099    }
2100
2101    /**
2102     * @return {@link #title} (The title of the action displayed to a user.). This
2103     *         is the underlying object with id, value and extensions. The accessor
2104     *         "getTitle" gives direct access to the value
2105     */
2106    public StringType getTitleElement() {
2107      if (this.title == null)
2108        if (Configuration.errorOnAutoCreate())
2109          throw new Error("Attempt to auto-create RequestGroupActionComponent.title");
2110        else if (Configuration.doAutoCreate())
2111          this.title = new StringType(); // bb
2112      return this.title;
2113    }
2114
2115    public boolean hasTitleElement() {
2116      return this.title != null && !this.title.isEmpty();
2117    }
2118
2119    public boolean hasTitle() {
2120      return this.title != null && !this.title.isEmpty();
2121    }
2122
2123    /**
2124     * @param value {@link #title} (The title of the action displayed to a user.).
2125     *              This is the underlying object with id, value and extensions. The
2126     *              accessor "getTitle" gives direct access to the value
2127     */
2128    public RequestGroupActionComponent setTitleElement(StringType value) {
2129      this.title = value;
2130      return this;
2131    }
2132
2133    /**
2134     * @return The title of the action displayed to a user.
2135     */
2136    public String getTitle() {
2137      return this.title == null ? null : this.title.getValue();
2138    }
2139
2140    /**
2141     * @param value The title of the action displayed to a user.
2142     */
2143    public RequestGroupActionComponent setTitle(String value) {
2144      if (Utilities.noString(value))
2145        this.title = null;
2146      else {
2147        if (this.title == null)
2148          this.title = new StringType();
2149        this.title.setValue(value);
2150      }
2151      return this;
2152    }
2153
2154    /**
2155     * @return {@link #description} (A short description of the action used to
2156     *         provide a summary to display to the user.). This is the underlying
2157     *         object with id, value and extensions. The accessor "getDescription"
2158     *         gives direct access to the value
2159     */
2160    public StringType getDescriptionElement() {
2161      if (this.description == null)
2162        if (Configuration.errorOnAutoCreate())
2163          throw new Error("Attempt to auto-create RequestGroupActionComponent.description");
2164        else if (Configuration.doAutoCreate())
2165          this.description = new StringType(); // bb
2166      return this.description;
2167    }
2168
2169    public boolean hasDescriptionElement() {
2170      return this.description != null && !this.description.isEmpty();
2171    }
2172
2173    public boolean hasDescription() {
2174      return this.description != null && !this.description.isEmpty();
2175    }
2176
2177    /**
2178     * @param value {@link #description} (A short description of the action used to
2179     *              provide a summary to display to the user.). This is the
2180     *              underlying object with id, value and extensions. The accessor
2181     *              "getDescription" gives direct access to the value
2182     */
2183    public RequestGroupActionComponent setDescriptionElement(StringType value) {
2184      this.description = value;
2185      return this;
2186    }
2187
2188    /**
2189     * @return A short description of the action used to provide a summary to
2190     *         display to the user.
2191     */
2192    public String getDescription() {
2193      return this.description == null ? null : this.description.getValue();
2194    }
2195
2196    /**
2197     * @param value A short description of the action used to provide a summary to
2198     *              display to the user.
2199     */
2200    public RequestGroupActionComponent setDescription(String value) {
2201      if (Utilities.noString(value))
2202        this.description = null;
2203      else {
2204        if (this.description == null)
2205          this.description = new StringType();
2206        this.description.setValue(value);
2207      }
2208      return this;
2209    }
2210
2211    /**
2212     * @return {@link #textEquivalent} (A text equivalent of the action to be
2213     *         performed. This provides a human-interpretable description of the
2214     *         action when the definition is consumed by a system that might not be
2215     *         capable of interpreting it dynamically.). This is the underlying
2216     *         object with id, value and extensions. The accessor
2217     *         "getTextEquivalent" gives direct access to the value
2218     */
2219    public StringType getTextEquivalentElement() {
2220      if (this.textEquivalent == null)
2221        if (Configuration.errorOnAutoCreate())
2222          throw new Error("Attempt to auto-create RequestGroupActionComponent.textEquivalent");
2223        else if (Configuration.doAutoCreate())
2224          this.textEquivalent = new StringType(); // bb
2225      return this.textEquivalent;
2226    }
2227
2228    public boolean hasTextEquivalentElement() {
2229      return this.textEquivalent != null && !this.textEquivalent.isEmpty();
2230    }
2231
2232    public boolean hasTextEquivalent() {
2233      return this.textEquivalent != null && !this.textEquivalent.isEmpty();
2234    }
2235
2236    /**
2237     * @param value {@link #textEquivalent} (A text equivalent of the action to be
2238     *              performed. This provides a human-interpretable description of
2239     *              the action when the definition is consumed by a system that
2240     *              might not be capable of interpreting it dynamically.). This is
2241     *              the underlying object with id, value and extensions. The
2242     *              accessor "getTextEquivalent" gives direct access to the value
2243     */
2244    public RequestGroupActionComponent setTextEquivalentElement(StringType value) {
2245      this.textEquivalent = value;
2246      return this;
2247    }
2248
2249    /**
2250     * @return A text equivalent of the action to be performed. This provides a
2251     *         human-interpretable description of the action when the definition is
2252     *         consumed by a system that might not be capable of interpreting it
2253     *         dynamically.
2254     */
2255    public String getTextEquivalent() {
2256      return this.textEquivalent == null ? null : this.textEquivalent.getValue();
2257    }
2258
2259    /**
2260     * @param value A text equivalent of the action to be performed. This provides a
2261     *              human-interpretable description of the action when the
2262     *              definition is consumed by a system that might not be capable of
2263     *              interpreting it dynamically.
2264     */
2265    public RequestGroupActionComponent setTextEquivalent(String value) {
2266      if (Utilities.noString(value))
2267        this.textEquivalent = null;
2268      else {
2269        if (this.textEquivalent == null)
2270          this.textEquivalent = new StringType();
2271        this.textEquivalent.setValue(value);
2272      }
2273      return this;
2274    }
2275
2276    /**
2277     * @return {@link #priority} (Indicates how quickly the action should be
2278     *         addressed with respect to other actions.). This is the underlying
2279     *         object with id, value and extensions. The accessor "getPriority"
2280     *         gives direct access to the value
2281     */
2282    public Enumeration<RequestPriority> getPriorityElement() {
2283      if (this.priority == null)
2284        if (Configuration.errorOnAutoCreate())
2285          throw new Error("Attempt to auto-create RequestGroupActionComponent.priority");
2286        else if (Configuration.doAutoCreate())
2287          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory()); // bb
2288      return this.priority;
2289    }
2290
2291    public boolean hasPriorityElement() {
2292      return this.priority != null && !this.priority.isEmpty();
2293    }
2294
2295    public boolean hasPriority() {
2296      return this.priority != null && !this.priority.isEmpty();
2297    }
2298
2299    /**
2300     * @param value {@link #priority} (Indicates how quickly the action should be
2301     *              addressed with respect to other actions.). This is the
2302     *              underlying object with id, value and extensions. The accessor
2303     *              "getPriority" gives direct access to the value
2304     */
2305    public RequestGroupActionComponent setPriorityElement(Enumeration<RequestPriority> value) {
2306      this.priority = value;
2307      return this;
2308    }
2309
2310    /**
2311     * @return Indicates how quickly the action should be addressed with respect to
2312     *         other actions.
2313     */
2314    public RequestPriority getPriority() {
2315      return this.priority == null ? null : this.priority.getValue();
2316    }
2317
2318    /**
2319     * @param value Indicates how quickly the action should be addressed with
2320     *              respect to other actions.
2321     */
2322    public RequestGroupActionComponent setPriority(RequestPriority value) {
2323      if (value == null)
2324        this.priority = null;
2325      else {
2326        if (this.priority == null)
2327          this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory());
2328        this.priority.setValue(value);
2329      }
2330      return this;
2331    }
2332
2333    /**
2334     * @return {@link #code} (A code that provides meaning for the action or action
2335     *         group. For example, a section may have a LOINC code for a section of
2336     *         a documentation template.)
2337     */
2338    public List<CodeableConcept> getCode() {
2339      if (this.code == null)
2340        this.code = new ArrayList<CodeableConcept>();
2341      return this.code;
2342    }
2343
2344    /**
2345     * @return Returns a reference to <code>this</code> for easy method chaining
2346     */
2347    public RequestGroupActionComponent setCode(List<CodeableConcept> theCode) {
2348      this.code = theCode;
2349      return this;
2350    }
2351
2352    public boolean hasCode() {
2353      if (this.code == null)
2354        return false;
2355      for (CodeableConcept item : this.code)
2356        if (!item.isEmpty())
2357          return true;
2358      return false;
2359    }
2360
2361    public CodeableConcept addCode() { // 3
2362      CodeableConcept t = new CodeableConcept();
2363      if (this.code == null)
2364        this.code = new ArrayList<CodeableConcept>();
2365      this.code.add(t);
2366      return t;
2367    }
2368
2369    public RequestGroupActionComponent addCode(CodeableConcept t) { // 3
2370      if (t == null)
2371        return this;
2372      if (this.code == null)
2373        this.code = new ArrayList<CodeableConcept>();
2374      this.code.add(t);
2375      return this;
2376    }
2377
2378    /**
2379     * @return The first repetition of repeating field {@link #code}, creating it if
2380     *         it does not already exist
2381     */
2382    public CodeableConcept getCodeFirstRep() {
2383      if (getCode().isEmpty()) {
2384        addCode();
2385      }
2386      return getCode().get(0);
2387    }
2388
2389    /**
2390     * @return {@link #documentation} (Didactic or other informational resources
2391     *         associated with the action that can be provided to the CDS recipient.
2392     *         Information resources can include inline text commentary and links to
2393     *         web resources.)
2394     */
2395    public List<RelatedArtifact> getDocumentation() {
2396      if (this.documentation == null)
2397        this.documentation = new ArrayList<RelatedArtifact>();
2398      return this.documentation;
2399    }
2400
2401    /**
2402     * @return Returns a reference to <code>this</code> for easy method chaining
2403     */
2404    public RequestGroupActionComponent setDocumentation(List<RelatedArtifact> theDocumentation) {
2405      this.documentation = theDocumentation;
2406      return this;
2407    }
2408
2409    public boolean hasDocumentation() {
2410      if (this.documentation == null)
2411        return false;
2412      for (RelatedArtifact item : this.documentation)
2413        if (!item.isEmpty())
2414          return true;
2415      return false;
2416    }
2417
2418    public RelatedArtifact addDocumentation() { // 3
2419      RelatedArtifact t = new RelatedArtifact();
2420      if (this.documentation == null)
2421        this.documentation = new ArrayList<RelatedArtifact>();
2422      this.documentation.add(t);
2423      return t;
2424    }
2425
2426    public RequestGroupActionComponent addDocumentation(RelatedArtifact t) { // 3
2427      if (t == null)
2428        return this;
2429      if (this.documentation == null)
2430        this.documentation = new ArrayList<RelatedArtifact>();
2431      this.documentation.add(t);
2432      return this;
2433    }
2434
2435    /**
2436     * @return The first repetition of repeating field {@link #documentation},
2437     *         creating it if it does not already exist
2438     */
2439    public RelatedArtifact getDocumentationFirstRep() {
2440      if (getDocumentation().isEmpty()) {
2441        addDocumentation();
2442      }
2443      return getDocumentation().get(0);
2444    }
2445
2446    /**
2447     * @return {@link #condition} (An expression that describes applicability
2448     *         criteria, or start/stop conditions for the action.)
2449     */
2450    public List<RequestGroupActionConditionComponent> getCondition() {
2451      if (this.condition == null)
2452        this.condition = new ArrayList<RequestGroupActionConditionComponent>();
2453      return this.condition;
2454    }
2455
2456    /**
2457     * @return Returns a reference to <code>this</code> for easy method chaining
2458     */
2459    public RequestGroupActionComponent setCondition(List<RequestGroupActionConditionComponent> theCondition) {
2460      this.condition = theCondition;
2461      return this;
2462    }
2463
2464    public boolean hasCondition() {
2465      if (this.condition == null)
2466        return false;
2467      for (RequestGroupActionConditionComponent item : this.condition)
2468        if (!item.isEmpty())
2469          return true;
2470      return false;
2471    }
2472
2473    public RequestGroupActionConditionComponent addCondition() { // 3
2474      RequestGroupActionConditionComponent t = new RequestGroupActionConditionComponent();
2475      if (this.condition == null)
2476        this.condition = new ArrayList<RequestGroupActionConditionComponent>();
2477      this.condition.add(t);
2478      return t;
2479    }
2480
2481    public RequestGroupActionComponent addCondition(RequestGroupActionConditionComponent t) { // 3
2482      if (t == null)
2483        return this;
2484      if (this.condition == null)
2485        this.condition = new ArrayList<RequestGroupActionConditionComponent>();
2486      this.condition.add(t);
2487      return this;
2488    }
2489
2490    /**
2491     * @return The first repetition of repeating field {@link #condition}, creating
2492     *         it if it does not already exist
2493     */
2494    public RequestGroupActionConditionComponent getConditionFirstRep() {
2495      if (getCondition().isEmpty()) {
2496        addCondition();
2497      }
2498      return getCondition().get(0);
2499    }
2500
2501    /**
2502     * @return {@link #relatedAction} (A relationship to another action such as
2503     *         "before" or "30-60 minutes after start of".)
2504     */
2505    public List<RequestGroupActionRelatedActionComponent> getRelatedAction() {
2506      if (this.relatedAction == null)
2507        this.relatedAction = new ArrayList<RequestGroupActionRelatedActionComponent>();
2508      return this.relatedAction;
2509    }
2510
2511    /**
2512     * @return Returns a reference to <code>this</code> for easy method chaining
2513     */
2514    public RequestGroupActionComponent setRelatedAction(
2515        List<RequestGroupActionRelatedActionComponent> theRelatedAction) {
2516      this.relatedAction = theRelatedAction;
2517      return this;
2518    }
2519
2520    public boolean hasRelatedAction() {
2521      if (this.relatedAction == null)
2522        return false;
2523      for (RequestGroupActionRelatedActionComponent item : this.relatedAction)
2524        if (!item.isEmpty())
2525          return true;
2526      return false;
2527    }
2528
2529    public RequestGroupActionRelatedActionComponent addRelatedAction() { // 3
2530      RequestGroupActionRelatedActionComponent t = new RequestGroupActionRelatedActionComponent();
2531      if (this.relatedAction == null)
2532        this.relatedAction = new ArrayList<RequestGroupActionRelatedActionComponent>();
2533      this.relatedAction.add(t);
2534      return t;
2535    }
2536
2537    public RequestGroupActionComponent addRelatedAction(RequestGroupActionRelatedActionComponent t) { // 3
2538      if (t == null)
2539        return this;
2540      if (this.relatedAction == null)
2541        this.relatedAction = new ArrayList<RequestGroupActionRelatedActionComponent>();
2542      this.relatedAction.add(t);
2543      return this;
2544    }
2545
2546    /**
2547     * @return The first repetition of repeating field {@link #relatedAction},
2548     *         creating it if it does not already exist
2549     */
2550    public RequestGroupActionRelatedActionComponent getRelatedActionFirstRep() {
2551      if (getRelatedAction().isEmpty()) {
2552        addRelatedAction();
2553      }
2554      return getRelatedAction().get(0);
2555    }
2556
2557    /**
2558     * @return {@link #timing} (An optional value describing when the action should
2559     *         be performed.)
2560     */
2561    public Type getTiming() {
2562      return this.timing;
2563    }
2564
2565    /**
2566     * @return {@link #timing} (An optional value describing when the action should
2567     *         be performed.)
2568     */
2569    public DateTimeType getTimingDateTimeType() throws FHIRException {
2570      if (this.timing == null)
2571        this.timing = new DateTimeType();
2572      if (!(this.timing instanceof DateTimeType))
2573        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "
2574            + this.timing.getClass().getName() + " was encountered");
2575      return (DateTimeType) this.timing;
2576    }
2577
2578    public boolean hasTimingDateTimeType() {
2579      return this != null && this.timing instanceof DateTimeType;
2580    }
2581
2582    /**
2583     * @return {@link #timing} (An optional value describing when the action should
2584     *         be performed.)
2585     */
2586    public Age getTimingAge() throws FHIRException {
2587      if (this.timing == null)
2588        this.timing = new Age();
2589      if (!(this.timing instanceof Age))
2590        throw new FHIRException(
2591            "Type mismatch: the type Age was expected, but " + this.timing.getClass().getName() + " was encountered");
2592      return (Age) this.timing;
2593    }
2594
2595    public boolean hasTimingAge() {
2596      return this != null && this.timing instanceof Age;
2597    }
2598
2599    /**
2600     * @return {@link #timing} (An optional value describing when the action should
2601     *         be performed.)
2602     */
2603    public Period getTimingPeriod() throws FHIRException {
2604      if (this.timing == null)
2605        this.timing = new Period();
2606      if (!(this.timing instanceof Period))
2607        throw new FHIRException("Type mismatch: the type Period was expected, but " + this.timing.getClass().getName()
2608            + " was encountered");
2609      return (Period) this.timing;
2610    }
2611
2612    public boolean hasTimingPeriod() {
2613      return this != null && this.timing instanceof Period;
2614    }
2615
2616    /**
2617     * @return {@link #timing} (An optional value describing when the action should
2618     *         be performed.)
2619     */
2620    public Duration getTimingDuration() throws FHIRException {
2621      if (this.timing == null)
2622        this.timing = new Duration();
2623      if (!(this.timing instanceof Duration))
2624        throw new FHIRException("Type mismatch: the type Duration was expected, but " + this.timing.getClass().getName()
2625            + " was encountered");
2626      return (Duration) this.timing;
2627    }
2628
2629    public boolean hasTimingDuration() {
2630      return this != null && this.timing instanceof Duration;
2631    }
2632
2633    /**
2634     * @return {@link #timing} (An optional value describing when the action should
2635     *         be performed.)
2636     */
2637    public Range getTimingRange() throws FHIRException {
2638      if (this.timing == null)
2639        this.timing = new Range();
2640      if (!(this.timing instanceof Range))
2641        throw new FHIRException(
2642            "Type mismatch: the type Range was expected, but " + this.timing.getClass().getName() + " was encountered");
2643      return (Range) this.timing;
2644    }
2645
2646    public boolean hasTimingRange() {
2647      return this != null && this.timing instanceof Range;
2648    }
2649
2650    /**
2651     * @return {@link #timing} (An optional value describing when the action should
2652     *         be performed.)
2653     */
2654    public Timing getTimingTiming() throws FHIRException {
2655      if (this.timing == null)
2656        this.timing = new Timing();
2657      if (!(this.timing instanceof Timing))
2658        throw new FHIRException("Type mismatch: the type Timing was expected, but " + this.timing.getClass().getName()
2659            + " was encountered");
2660      return (Timing) this.timing;
2661    }
2662
2663    public boolean hasTimingTiming() {
2664      return this != null && this.timing instanceof Timing;
2665    }
2666
2667    public boolean hasTiming() {
2668      return this.timing != null && !this.timing.isEmpty();
2669    }
2670
2671    /**
2672     * @param value {@link #timing} (An optional value describing when the action
2673     *              should be performed.)
2674     */
2675    public RequestGroupActionComponent setTiming(Type value) {
2676      if (value != null && !(value instanceof DateTimeType || value instanceof Age || value instanceof Period
2677          || value instanceof Duration || value instanceof Range || value instanceof Timing))
2678        throw new Error("Not the right type for RequestGroup.action.timing[x]: " + value.fhirType());
2679      this.timing = value;
2680      return this;
2681    }
2682
2683    /**
2684     * @return {@link #participant} (The participant that should perform or be
2685     *         responsible for this action.)
2686     */
2687    public List<Reference> getParticipant() {
2688      if (this.participant == null)
2689        this.participant = new ArrayList<Reference>();
2690      return this.participant;
2691    }
2692
2693    /**
2694     * @return Returns a reference to <code>this</code> for easy method chaining
2695     */
2696    public RequestGroupActionComponent setParticipant(List<Reference> theParticipant) {
2697      this.participant = theParticipant;
2698      return this;
2699    }
2700
2701    public boolean hasParticipant() {
2702      if (this.participant == null)
2703        return false;
2704      for (Reference item : this.participant)
2705        if (!item.isEmpty())
2706          return true;
2707      return false;
2708    }
2709
2710    public Reference addParticipant() { // 3
2711      Reference t = new Reference();
2712      if (this.participant == null)
2713        this.participant = new ArrayList<Reference>();
2714      this.participant.add(t);
2715      return t;
2716    }
2717
2718    public RequestGroupActionComponent addParticipant(Reference t) { // 3
2719      if (t == null)
2720        return this;
2721      if (this.participant == null)
2722        this.participant = new ArrayList<Reference>();
2723      this.participant.add(t);
2724      return this;
2725    }
2726
2727    /**
2728     * @return The first repetition of repeating field {@link #participant},
2729     *         creating it if it does not already exist
2730     */
2731    public Reference getParticipantFirstRep() {
2732      if (getParticipant().isEmpty()) {
2733        addParticipant();
2734      }
2735      return getParticipant().get(0);
2736    }
2737
2738    /**
2739     * @deprecated Use Reference#setResource(IBaseResource) instead
2740     */
2741    @Deprecated
2742    public List<Resource> getParticipantTarget() {
2743      if (this.participantTarget == null)
2744        this.participantTarget = new ArrayList<Resource>();
2745      return this.participantTarget;
2746    }
2747
2748    /**
2749     * @return {@link #type} (The type of action to perform (create, update,
2750     *         remove).)
2751     */
2752    public CodeableConcept getType() {
2753      if (this.type == null)
2754        if (Configuration.errorOnAutoCreate())
2755          throw new Error("Attempt to auto-create RequestGroupActionComponent.type");
2756        else if (Configuration.doAutoCreate())
2757          this.type = new CodeableConcept(); // cc
2758      return this.type;
2759    }
2760
2761    public boolean hasType() {
2762      return this.type != null && !this.type.isEmpty();
2763    }
2764
2765    /**
2766     * @param value {@link #type} (The type of action to perform (create, update,
2767     *              remove).)
2768     */
2769    public RequestGroupActionComponent setType(CodeableConcept value) {
2770      this.type = value;
2771      return this;
2772    }
2773
2774    /**
2775     * @return {@link #groupingBehavior} (Defines the grouping behavior for the
2776     *         action and its children.). This is the underlying object with id,
2777     *         value and extensions. The accessor "getGroupingBehavior" gives direct
2778     *         access to the value
2779     */
2780    public Enumeration<ActionGroupingBehavior> getGroupingBehaviorElement() {
2781      if (this.groupingBehavior == null)
2782        if (Configuration.errorOnAutoCreate())
2783          throw new Error("Attempt to auto-create RequestGroupActionComponent.groupingBehavior");
2784        else if (Configuration.doAutoCreate())
2785          this.groupingBehavior = new Enumeration<ActionGroupingBehavior>(new ActionGroupingBehaviorEnumFactory()); // bb
2786      return this.groupingBehavior;
2787    }
2788
2789    public boolean hasGroupingBehaviorElement() {
2790      return this.groupingBehavior != null && !this.groupingBehavior.isEmpty();
2791    }
2792
2793    public boolean hasGroupingBehavior() {
2794      return this.groupingBehavior != null && !this.groupingBehavior.isEmpty();
2795    }
2796
2797    /**
2798     * @param value {@link #groupingBehavior} (Defines the grouping behavior for the
2799     *              action and its children.). This is the underlying object with
2800     *              id, value and extensions. The accessor "getGroupingBehavior"
2801     *              gives direct access to the value
2802     */
2803    public RequestGroupActionComponent setGroupingBehaviorElement(Enumeration<ActionGroupingBehavior> value) {
2804      this.groupingBehavior = value;
2805      return this;
2806    }
2807
2808    /**
2809     * @return Defines the grouping behavior for the action and its children.
2810     */
2811    public ActionGroupingBehavior getGroupingBehavior() {
2812      return this.groupingBehavior == null ? null : this.groupingBehavior.getValue();
2813    }
2814
2815    /**
2816     * @param value Defines the grouping behavior for the action and its children.
2817     */
2818    public RequestGroupActionComponent setGroupingBehavior(ActionGroupingBehavior value) {
2819      if (value == null)
2820        this.groupingBehavior = null;
2821      else {
2822        if (this.groupingBehavior == null)
2823          this.groupingBehavior = new Enumeration<ActionGroupingBehavior>(new ActionGroupingBehaviorEnumFactory());
2824        this.groupingBehavior.setValue(value);
2825      }
2826      return this;
2827    }
2828
2829    /**
2830     * @return {@link #selectionBehavior} (Defines the selection behavior for the
2831     *         action and its children.). This is the underlying object with id,
2832     *         value and extensions. The accessor "getSelectionBehavior" gives
2833     *         direct access to the value
2834     */
2835    public Enumeration<ActionSelectionBehavior> getSelectionBehaviorElement() {
2836      if (this.selectionBehavior == null)
2837        if (Configuration.errorOnAutoCreate())
2838          throw new Error("Attempt to auto-create RequestGroupActionComponent.selectionBehavior");
2839        else if (Configuration.doAutoCreate())
2840          this.selectionBehavior = new Enumeration<ActionSelectionBehavior>(new ActionSelectionBehaviorEnumFactory()); // bb
2841      return this.selectionBehavior;
2842    }
2843
2844    public boolean hasSelectionBehaviorElement() {
2845      return this.selectionBehavior != null && !this.selectionBehavior.isEmpty();
2846    }
2847
2848    public boolean hasSelectionBehavior() {
2849      return this.selectionBehavior != null && !this.selectionBehavior.isEmpty();
2850    }
2851
2852    /**
2853     * @param value {@link #selectionBehavior} (Defines the selection behavior for
2854     *              the action and its children.). This is the underlying object
2855     *              with id, value and extensions. The accessor
2856     *              "getSelectionBehavior" gives direct access to the value
2857     */
2858    public RequestGroupActionComponent setSelectionBehaviorElement(Enumeration<ActionSelectionBehavior> value) {
2859      this.selectionBehavior = value;
2860      return this;
2861    }
2862
2863    /**
2864     * @return Defines the selection behavior for the action and its children.
2865     */
2866    public ActionSelectionBehavior getSelectionBehavior() {
2867      return this.selectionBehavior == null ? null : this.selectionBehavior.getValue();
2868    }
2869
2870    /**
2871     * @param value Defines the selection behavior for the action and its children.
2872     */
2873    public RequestGroupActionComponent setSelectionBehavior(ActionSelectionBehavior value) {
2874      if (value == null)
2875        this.selectionBehavior = null;
2876      else {
2877        if (this.selectionBehavior == null)
2878          this.selectionBehavior = new Enumeration<ActionSelectionBehavior>(new ActionSelectionBehaviorEnumFactory());
2879        this.selectionBehavior.setValue(value);
2880      }
2881      return this;
2882    }
2883
2884    /**
2885     * @return {@link #requiredBehavior} (Defines expectations around whether an
2886     *         action is required.). This is the underlying object with id, value
2887     *         and extensions. The accessor "getRequiredBehavior" gives direct
2888     *         access to the value
2889     */
2890    public Enumeration<ActionRequiredBehavior> getRequiredBehaviorElement() {
2891      if (this.requiredBehavior == null)
2892        if (Configuration.errorOnAutoCreate())
2893          throw new Error("Attempt to auto-create RequestGroupActionComponent.requiredBehavior");
2894        else if (Configuration.doAutoCreate())
2895          this.requiredBehavior = new Enumeration<ActionRequiredBehavior>(new ActionRequiredBehaviorEnumFactory()); // bb
2896      return this.requiredBehavior;
2897    }
2898
2899    public boolean hasRequiredBehaviorElement() {
2900      return this.requiredBehavior != null && !this.requiredBehavior.isEmpty();
2901    }
2902
2903    public boolean hasRequiredBehavior() {
2904      return this.requiredBehavior != null && !this.requiredBehavior.isEmpty();
2905    }
2906
2907    /**
2908     * @param value {@link #requiredBehavior} (Defines expectations around whether
2909     *              an action is required.). This is the underlying object with id,
2910     *              value and extensions. The accessor "getRequiredBehavior" gives
2911     *              direct access to the value
2912     */
2913    public RequestGroupActionComponent setRequiredBehaviorElement(Enumeration<ActionRequiredBehavior> value) {
2914      this.requiredBehavior = value;
2915      return this;
2916    }
2917
2918    /**
2919     * @return Defines expectations around whether an action is required.
2920     */
2921    public ActionRequiredBehavior getRequiredBehavior() {
2922      return this.requiredBehavior == null ? null : this.requiredBehavior.getValue();
2923    }
2924
2925    /**
2926     * @param value Defines expectations around whether an action is required.
2927     */
2928    public RequestGroupActionComponent setRequiredBehavior(ActionRequiredBehavior value) {
2929      if (value == null)
2930        this.requiredBehavior = null;
2931      else {
2932        if (this.requiredBehavior == null)
2933          this.requiredBehavior = new Enumeration<ActionRequiredBehavior>(new ActionRequiredBehaviorEnumFactory());
2934        this.requiredBehavior.setValue(value);
2935      }
2936      return this;
2937    }
2938
2939    /**
2940     * @return {@link #precheckBehavior} (Defines whether the action should usually
2941     *         be preselected.). This is the underlying object with id, value and
2942     *         extensions. The accessor "getPrecheckBehavior" gives direct access to
2943     *         the value
2944     */
2945    public Enumeration<ActionPrecheckBehavior> getPrecheckBehaviorElement() {
2946      if (this.precheckBehavior == null)
2947        if (Configuration.errorOnAutoCreate())
2948          throw new Error("Attempt to auto-create RequestGroupActionComponent.precheckBehavior");
2949        else if (Configuration.doAutoCreate())
2950          this.precheckBehavior = new Enumeration<ActionPrecheckBehavior>(new ActionPrecheckBehaviorEnumFactory()); // bb
2951      return this.precheckBehavior;
2952    }
2953
2954    public boolean hasPrecheckBehaviorElement() {
2955      return this.precheckBehavior != null && !this.precheckBehavior.isEmpty();
2956    }
2957
2958    public boolean hasPrecheckBehavior() {
2959      return this.precheckBehavior != null && !this.precheckBehavior.isEmpty();
2960    }
2961
2962    /**
2963     * @param value {@link #precheckBehavior} (Defines whether the action should
2964     *              usually be preselected.). This is the underlying object with id,
2965     *              value and extensions. The accessor "getPrecheckBehavior" gives
2966     *              direct access to the value
2967     */
2968    public RequestGroupActionComponent setPrecheckBehaviorElement(Enumeration<ActionPrecheckBehavior> value) {
2969      this.precheckBehavior = value;
2970      return this;
2971    }
2972
2973    /**
2974     * @return Defines whether the action should usually be preselected.
2975     */
2976    public ActionPrecheckBehavior getPrecheckBehavior() {
2977      return this.precheckBehavior == null ? null : this.precheckBehavior.getValue();
2978    }
2979
2980    /**
2981     * @param value Defines whether the action should usually be preselected.
2982     */
2983    public RequestGroupActionComponent setPrecheckBehavior(ActionPrecheckBehavior value) {
2984      if (value == null)
2985        this.precheckBehavior = null;
2986      else {
2987        if (this.precheckBehavior == null)
2988          this.precheckBehavior = new Enumeration<ActionPrecheckBehavior>(new ActionPrecheckBehaviorEnumFactory());
2989        this.precheckBehavior.setValue(value);
2990      }
2991      return this;
2992    }
2993
2994    /**
2995     * @return {@link #cardinalityBehavior} (Defines whether the action can be
2996     *         selected multiple times.). This is the underlying object with id,
2997     *         value and extensions. The accessor "getCardinalityBehavior" gives
2998     *         direct access to the value
2999     */
3000    public Enumeration<ActionCardinalityBehavior> getCardinalityBehaviorElement() {
3001      if (this.cardinalityBehavior == null)
3002        if (Configuration.errorOnAutoCreate())
3003          throw new Error("Attempt to auto-create RequestGroupActionComponent.cardinalityBehavior");
3004        else if (Configuration.doAutoCreate())
3005          this.cardinalityBehavior = new Enumeration<ActionCardinalityBehavior>(
3006              new ActionCardinalityBehaviorEnumFactory()); // bb
3007      return this.cardinalityBehavior;
3008    }
3009
3010    public boolean hasCardinalityBehaviorElement() {
3011      return this.cardinalityBehavior != null && !this.cardinalityBehavior.isEmpty();
3012    }
3013
3014    public boolean hasCardinalityBehavior() {
3015      return this.cardinalityBehavior != null && !this.cardinalityBehavior.isEmpty();
3016    }
3017
3018    /**
3019     * @param value {@link #cardinalityBehavior} (Defines whether the action can be
3020     *              selected multiple times.). This is the underlying object with
3021     *              id, value and extensions. The accessor "getCardinalityBehavior"
3022     *              gives direct access to the value
3023     */
3024    public RequestGroupActionComponent setCardinalityBehaviorElement(Enumeration<ActionCardinalityBehavior> value) {
3025      this.cardinalityBehavior = value;
3026      return this;
3027    }
3028
3029    /**
3030     * @return Defines whether the action can be selected multiple times.
3031     */
3032    public ActionCardinalityBehavior getCardinalityBehavior() {
3033      return this.cardinalityBehavior == null ? null : this.cardinalityBehavior.getValue();
3034    }
3035
3036    /**
3037     * @param value Defines whether the action can be selected multiple times.
3038     */
3039    public RequestGroupActionComponent setCardinalityBehavior(ActionCardinalityBehavior value) {
3040      if (value == null)
3041        this.cardinalityBehavior = null;
3042      else {
3043        if (this.cardinalityBehavior == null)
3044          this.cardinalityBehavior = new Enumeration<ActionCardinalityBehavior>(
3045              new ActionCardinalityBehaviorEnumFactory());
3046        this.cardinalityBehavior.setValue(value);
3047      }
3048      return this;
3049    }
3050
3051    /**
3052     * @return {@link #resource} (The resource that is the target of the action
3053     *         (e.g. CommunicationRequest).)
3054     */
3055    public Reference getResource() {
3056      if (this.resource == null)
3057        if (Configuration.errorOnAutoCreate())
3058          throw new Error("Attempt to auto-create RequestGroupActionComponent.resource");
3059        else if (Configuration.doAutoCreate())
3060          this.resource = new Reference(); // cc
3061      return this.resource;
3062    }
3063
3064    public boolean hasResource() {
3065      return this.resource != null && !this.resource.isEmpty();
3066    }
3067
3068    /**
3069     * @param value {@link #resource} (The resource that is the target of the action
3070     *              (e.g. CommunicationRequest).)
3071     */
3072    public RequestGroupActionComponent setResource(Reference value) {
3073      this.resource = value;
3074      return this;
3075    }
3076
3077    /**
3078     * @return {@link #resource} The actual object that is the target of the
3079     *         reference. The reference library doesn't populate this, but you can
3080     *         use it to hold the resource if you resolve it. (The resource that is
3081     *         the target of the action (e.g. CommunicationRequest).)
3082     */
3083    public Resource getResourceTarget() {
3084      return this.resourceTarget;
3085    }
3086
3087    /**
3088     * @param value {@link #resource} The actual object that is the target of the
3089     *              reference. The reference library doesn't use these, but you can
3090     *              use it to hold the resource if you resolve it. (The resource
3091     *              that is the target of the action (e.g. CommunicationRequest).)
3092     */
3093    public RequestGroupActionComponent setResourceTarget(Resource value) {
3094      this.resourceTarget = value;
3095      return this;
3096    }
3097
3098    /**
3099     * @return {@link #action} (Sub actions.)
3100     */
3101    public List<RequestGroupActionComponent> getAction() {
3102      if (this.action == null)
3103        this.action = new ArrayList<RequestGroupActionComponent>();
3104      return this.action;
3105    }
3106
3107    /**
3108     * @return Returns a reference to <code>this</code> for easy method chaining
3109     */
3110    public RequestGroupActionComponent setAction(List<RequestGroupActionComponent> theAction) {
3111      this.action = theAction;
3112      return this;
3113    }
3114
3115    public boolean hasAction() {
3116      if (this.action == null)
3117        return false;
3118      for (RequestGroupActionComponent item : this.action)
3119        if (!item.isEmpty())
3120          return true;
3121      return false;
3122    }
3123
3124    public RequestGroupActionComponent addAction() { // 3
3125      RequestGroupActionComponent t = new RequestGroupActionComponent();
3126      if (this.action == null)
3127        this.action = new ArrayList<RequestGroupActionComponent>();
3128      this.action.add(t);
3129      return t;
3130    }
3131
3132    public RequestGroupActionComponent addAction(RequestGroupActionComponent t) { // 3
3133      if (t == null)
3134        return this;
3135      if (this.action == null)
3136        this.action = new ArrayList<RequestGroupActionComponent>();
3137      this.action.add(t);
3138      return this;
3139    }
3140
3141    /**
3142     * @return The first repetition of repeating field {@link #action}, creating it
3143     *         if it does not already exist
3144     */
3145    public RequestGroupActionComponent getActionFirstRep() {
3146      if (getAction().isEmpty()) {
3147        addAction();
3148      }
3149      return getAction().get(0);
3150    }
3151
3152    protected void listChildren(List<Property> children) {
3153      super.listChildren(children);
3154      children.add(new Property("prefix", "string", "A user-visible prefix for the action.", 0, 1, prefix));
3155      children.add(new Property("title", "string", "The title of the action displayed to a user.", 0, 1, title));
3156      children.add(new Property("description", "string",
3157          "A short description of the action used to provide a summary to display to the user.", 0, 1, description));
3158      children.add(new Property("textEquivalent", "string",
3159          "A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that might not be capable of interpreting it dynamically.",
3160          0, 1, textEquivalent));
3161      children.add(new Property("priority", "code",
3162          "Indicates how quickly the action should be addressed with respect to other actions.", 0, 1, priority));
3163      children.add(new Property("code", "CodeableConcept",
3164          "A code that provides meaning for the action or action group. For example, a section may have a LOINC code for a section of a documentation template.",
3165          0, java.lang.Integer.MAX_VALUE, code));
3166      children.add(new Property("documentation", "RelatedArtifact",
3167          "Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.",
3168          0, java.lang.Integer.MAX_VALUE, documentation));
3169      children.add(new Property("condition", "",
3170          "An expression that describes applicability criteria, or start/stop conditions for the action.", 0,
3171          java.lang.Integer.MAX_VALUE, condition));
3172      children.add(new Property("relatedAction", "",
3173          "A relationship to another action such as \"before\" or \"30-60 minutes after start of\".", 0,
3174          java.lang.Integer.MAX_VALUE, relatedAction));
3175      children.add(new Property("timing[x]", "dateTime|Age|Period|Duration|Range|Timing",
3176          "An optional value describing when the action should be performed.", 0, 1, timing));
3177      children.add(new Property("participant", "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson|Device)",
3178          "The participant that should perform or be responsible for this action.", 0, java.lang.Integer.MAX_VALUE,
3179          participant));
3180      children.add(new Property("type", "CodeableConcept", "The type of action to perform (create, update, remove).", 0,
3181          1, type));
3182      children.add(new Property("groupingBehavior", "code",
3183          "Defines the grouping behavior for the action and its children.", 0, 1, groupingBehavior));
3184      children.add(new Property("selectionBehavior", "code",
3185          "Defines the selection behavior for the action and its children.", 0, 1, selectionBehavior));
3186      children.add(new Property("requiredBehavior", "code",
3187          "Defines expectations around whether an action is required.", 0, 1, requiredBehavior));
3188      children.add(new Property("precheckBehavior", "code", "Defines whether the action should usually be preselected.",
3189          0, 1, precheckBehavior));
3190      children.add(new Property("cardinalityBehavior", "code",
3191          "Defines whether the action can be selected multiple times.", 0, 1, cardinalityBehavior));
3192      children.add(new Property("resource", "Reference(Any)",
3193          "The resource that is the target of the action (e.g. CommunicationRequest).", 0, 1, resource));
3194      children
3195          .add(new Property("action", "@RequestGroup.action", "Sub actions.", 0, java.lang.Integer.MAX_VALUE, action));
3196    }
3197
3198    @Override
3199    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3200      switch (_hash) {
3201      case -980110702:
3202        /* prefix */ return new Property("prefix", "string", "A user-visible prefix for the action.", 0, 1, prefix);
3203      case 110371416:
3204        /* title */ return new Property("title", "string", "The title of the action displayed to a user.", 0, 1, title);
3205      case -1724546052:
3206        /* description */ return new Property("description", "string",
3207            "A short description of the action used to provide a summary to display to the user.", 0, 1, description);
3208      case -900391049:
3209        /* textEquivalent */ return new Property("textEquivalent", "string",
3210            "A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that might not be capable of interpreting it dynamically.",
3211            0, 1, textEquivalent);
3212      case -1165461084:
3213        /* priority */ return new Property("priority", "code",
3214            "Indicates how quickly the action should be addressed with respect to other actions.", 0, 1, priority);
3215      case 3059181:
3216        /* code */ return new Property("code", "CodeableConcept",
3217            "A code that provides meaning for the action or action group. For example, a section may have a LOINC code for a section of a documentation template.",
3218            0, java.lang.Integer.MAX_VALUE, code);
3219      case 1587405498:
3220        /* documentation */ return new Property("documentation", "RelatedArtifact",
3221            "Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.",
3222            0, java.lang.Integer.MAX_VALUE, documentation);
3223      case -861311717:
3224        /* condition */ return new Property("condition", "",
3225            "An expression that describes applicability criteria, or start/stop conditions for the action.", 0,
3226            java.lang.Integer.MAX_VALUE, condition);
3227      case -384107967:
3228        /* relatedAction */ return new Property("relatedAction", "",
3229            "A relationship to another action such as \"before\" or \"30-60 minutes after start of\".", 0,
3230            java.lang.Integer.MAX_VALUE, relatedAction);
3231      case 164632566:
3232        /* timing[x] */ return new Property("timing[x]", "dateTime|Age|Period|Duration|Range|Timing",
3233            "An optional value describing when the action should be performed.", 0, 1, timing);
3234      case -873664438:
3235        /* timing */ return new Property("timing[x]", "dateTime|Age|Period|Duration|Range|Timing",
3236            "An optional value describing when the action should be performed.", 0, 1, timing);
3237      case -1837458939:
3238        /* timingDateTime */ return new Property("timing[x]", "dateTime|Age|Period|Duration|Range|Timing",
3239            "An optional value describing when the action should be performed.", 0, 1, timing);
3240      case 164607061:
3241        /* timingAge */ return new Property("timing[x]", "dateTime|Age|Period|Duration|Range|Timing",
3242            "An optional value describing when the action should be performed.", 0, 1, timing);
3243      case -615615829:
3244        /* timingPeriod */ return new Property("timing[x]", "dateTime|Age|Period|Duration|Range|Timing",
3245            "An optional value describing when the action should be performed.", 0, 1, timing);
3246      case -1327253506:
3247        /* timingDuration */ return new Property("timing[x]", "dateTime|Age|Period|Duration|Range|Timing",
3248            "An optional value describing when the action should be performed.", 0, 1, timing);
3249      case -710871277:
3250        /* timingRange */ return new Property("timing[x]", "dateTime|Age|Period|Duration|Range|Timing",
3251            "An optional value describing when the action should be performed.", 0, 1, timing);
3252      case -497554124:
3253        /* timingTiming */ return new Property("timing[x]", "dateTime|Age|Period|Duration|Range|Timing",
3254            "An optional value describing when the action should be performed.", 0, 1, timing);
3255      case 767422259:
3256        /* participant */ return new Property("participant",
3257            "Reference(Patient|Practitioner|PractitionerRole|RelatedPerson|Device)",
3258            "The participant that should perform or be responsible for this action.", 0, java.lang.Integer.MAX_VALUE,
3259            participant);
3260      case 3575610:
3261        /* type */ return new Property("type", "CodeableConcept",
3262            "The type of action to perform (create, update, remove).", 0, 1, type);
3263      case 586678389:
3264        /* groupingBehavior */ return new Property("groupingBehavior", "code",
3265            "Defines the grouping behavior for the action and its children.", 0, 1, groupingBehavior);
3266      case 168639486:
3267        /* selectionBehavior */ return new Property("selectionBehavior", "code",
3268            "Defines the selection behavior for the action and its children.", 0, 1, selectionBehavior);
3269      case -1163906287:
3270        /* requiredBehavior */ return new Property("requiredBehavior", "code",
3271            "Defines expectations around whether an action is required.", 0, 1, requiredBehavior);
3272      case -1174249033:
3273        /* precheckBehavior */ return new Property("precheckBehavior", "code",
3274            "Defines whether the action should usually be preselected.", 0, 1, precheckBehavior);
3275      case -922577408:
3276        /* cardinalityBehavior */ return new Property("cardinalityBehavior", "code",
3277            "Defines whether the action can be selected multiple times.", 0, 1, cardinalityBehavior);
3278      case -341064690:
3279        /* resource */ return new Property("resource", "Reference(Any)",
3280            "The resource that is the target of the action (e.g. CommunicationRequest).", 0, 1, resource);
3281      case -1422950858:
3282        /* action */ return new Property("action", "@RequestGroup.action", "Sub actions.", 0,
3283            java.lang.Integer.MAX_VALUE, action);
3284      default:
3285        return super.getNamedProperty(_hash, _name, _checkValid);
3286      }
3287
3288    }
3289
3290    @Override
3291    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3292      switch (hash) {
3293      case -980110702:
3294        /* prefix */ return this.prefix == null ? new Base[0] : new Base[] { this.prefix }; // StringType
3295      case 110371416:
3296        /* title */ return this.title == null ? new Base[0] : new Base[] { this.title }; // StringType
3297      case -1724546052:
3298        /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // StringType
3299      case -900391049:
3300        /* textEquivalent */ return this.textEquivalent == null ? new Base[0] : new Base[] { this.textEquivalent }; // StringType
3301      case -1165461084:
3302        /* priority */ return this.priority == null ? new Base[0] : new Base[] { this.priority }; // Enumeration<RequestPriority>
3303      case 3059181:
3304        /* code */ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept
3305      case 1587405498:
3306        /* documentation */ return this.documentation == null ? new Base[0]
3307            : this.documentation.toArray(new Base[this.documentation.size()]); // RelatedArtifact
3308      case -861311717:
3309        /* condition */ return this.condition == null ? new Base[0]
3310            : this.condition.toArray(new Base[this.condition.size()]); // RequestGroupActionConditionComponent
3311      case -384107967:
3312        /* relatedAction */ return this.relatedAction == null ? new Base[0]
3313            : this.relatedAction.toArray(new Base[this.relatedAction.size()]); // RequestGroupActionRelatedActionComponent
3314      case -873664438:
3315        /* timing */ return this.timing == null ? new Base[0] : new Base[] { this.timing }; // Type
3316      case 767422259:
3317        /* participant */ return this.participant == null ? new Base[0]
3318            : this.participant.toArray(new Base[this.participant.size()]); // Reference
3319      case 3575610:
3320        /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // CodeableConcept
3321      case 586678389:
3322        /* groupingBehavior */ return this.groupingBehavior == null ? new Base[0]
3323            : new Base[] { this.groupingBehavior }; // Enumeration<ActionGroupingBehavior>
3324      case 168639486:
3325        /* selectionBehavior */ return this.selectionBehavior == null ? new Base[0]
3326            : new Base[] { this.selectionBehavior }; // Enumeration<ActionSelectionBehavior>
3327      case -1163906287:
3328        /* requiredBehavior */ return this.requiredBehavior == null ? new Base[0]
3329            : new Base[] { this.requiredBehavior }; // Enumeration<ActionRequiredBehavior>
3330      case -1174249033:
3331        /* precheckBehavior */ return this.precheckBehavior == null ? new Base[0]
3332            : new Base[] { this.precheckBehavior }; // Enumeration<ActionPrecheckBehavior>
3333      case -922577408:
3334        /* cardinalityBehavior */ return this.cardinalityBehavior == null ? new Base[0]
3335            : new Base[] { this.cardinalityBehavior }; // Enumeration<ActionCardinalityBehavior>
3336      case -341064690:
3337        /* resource */ return this.resource == null ? new Base[0] : new Base[] { this.resource }; // Reference
3338      case -1422950858:
3339        /* action */ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // RequestGroupActionComponent
3340      default:
3341        return super.getProperty(hash, name, checkValid);
3342      }
3343
3344    }
3345
3346    @Override
3347    public Base setProperty(int hash, String name, Base value) throws FHIRException {
3348      switch (hash) {
3349      case -980110702: // prefix
3350        this.prefix = castToString(value); // StringType
3351        return value;
3352      case 110371416: // title
3353        this.title = castToString(value); // StringType
3354        return value;
3355      case -1724546052: // description
3356        this.description = castToString(value); // StringType
3357        return value;
3358      case -900391049: // textEquivalent
3359        this.textEquivalent = castToString(value); // StringType
3360        return value;
3361      case -1165461084: // priority
3362        value = new RequestPriorityEnumFactory().fromType(castToCode(value));
3363        this.priority = (Enumeration) value; // Enumeration<RequestPriority>
3364        return value;
3365      case 3059181: // code
3366        this.getCode().add(castToCodeableConcept(value)); // CodeableConcept
3367        return value;
3368      case 1587405498: // documentation
3369        this.getDocumentation().add(castToRelatedArtifact(value)); // RelatedArtifact
3370        return value;
3371      case -861311717: // condition
3372        this.getCondition().add((RequestGroupActionConditionComponent) value); // RequestGroupActionConditionComponent
3373        return value;
3374      case -384107967: // relatedAction
3375        this.getRelatedAction().add((RequestGroupActionRelatedActionComponent) value); // RequestGroupActionRelatedActionComponent
3376        return value;
3377      case -873664438: // timing
3378        this.timing = castToType(value); // Type
3379        return value;
3380      case 767422259: // participant
3381        this.getParticipant().add(castToReference(value)); // Reference
3382        return value;
3383      case 3575610: // type
3384        this.type = castToCodeableConcept(value); // CodeableConcept
3385        return value;
3386      case 586678389: // groupingBehavior
3387        value = new ActionGroupingBehaviorEnumFactory().fromType(castToCode(value));
3388        this.groupingBehavior = (Enumeration) value; // Enumeration<ActionGroupingBehavior>
3389        return value;
3390      case 168639486: // selectionBehavior
3391        value = new ActionSelectionBehaviorEnumFactory().fromType(castToCode(value));
3392        this.selectionBehavior = (Enumeration) value; // Enumeration<ActionSelectionBehavior>
3393        return value;
3394      case -1163906287: // requiredBehavior
3395        value = new ActionRequiredBehaviorEnumFactory().fromType(castToCode(value));
3396        this.requiredBehavior = (Enumeration) value; // Enumeration<ActionRequiredBehavior>
3397        return value;
3398      case -1174249033: // precheckBehavior
3399        value = new ActionPrecheckBehaviorEnumFactory().fromType(castToCode(value));
3400        this.precheckBehavior = (Enumeration) value; // Enumeration<ActionPrecheckBehavior>
3401        return value;
3402      case -922577408: // cardinalityBehavior
3403        value = new ActionCardinalityBehaviorEnumFactory().fromType(castToCode(value));
3404        this.cardinalityBehavior = (Enumeration) value; // Enumeration<ActionCardinalityBehavior>
3405        return value;
3406      case -341064690: // resource
3407        this.resource = castToReference(value); // Reference
3408        return value;
3409      case -1422950858: // action
3410        this.getAction().add((RequestGroupActionComponent) value); // RequestGroupActionComponent
3411        return value;
3412      default:
3413        return super.setProperty(hash, name, value);
3414      }
3415
3416    }
3417
3418    @Override
3419    public Base setProperty(String name, Base value) throws FHIRException {
3420      if (name.equals("prefix")) {
3421        this.prefix = castToString(value); // StringType
3422      } else if (name.equals("title")) {
3423        this.title = castToString(value); // StringType
3424      } else if (name.equals("description")) {
3425        this.description = castToString(value); // StringType
3426      } else if (name.equals("textEquivalent")) {
3427        this.textEquivalent = castToString(value); // StringType
3428      } else if (name.equals("priority")) {
3429        value = new RequestPriorityEnumFactory().fromType(castToCode(value));
3430        this.priority = (Enumeration) value; // Enumeration<RequestPriority>
3431      } else if (name.equals("code")) {
3432        this.getCode().add(castToCodeableConcept(value));
3433      } else if (name.equals("documentation")) {
3434        this.getDocumentation().add(castToRelatedArtifact(value));
3435      } else if (name.equals("condition")) {
3436        this.getCondition().add((RequestGroupActionConditionComponent) value);
3437      } else if (name.equals("relatedAction")) {
3438        this.getRelatedAction().add((RequestGroupActionRelatedActionComponent) value);
3439      } else if (name.equals("timing[x]")) {
3440        this.timing = castToType(value); // Type
3441      } else if (name.equals("participant")) {
3442        this.getParticipant().add(castToReference(value));
3443      } else if (name.equals("type")) {
3444        this.type = castToCodeableConcept(value); // CodeableConcept
3445      } else if (name.equals("groupingBehavior")) {
3446        value = new ActionGroupingBehaviorEnumFactory().fromType(castToCode(value));
3447        this.groupingBehavior = (Enumeration) value; // Enumeration<ActionGroupingBehavior>
3448      } else if (name.equals("selectionBehavior")) {
3449        value = new ActionSelectionBehaviorEnumFactory().fromType(castToCode(value));
3450        this.selectionBehavior = (Enumeration) value; // Enumeration<ActionSelectionBehavior>
3451      } else if (name.equals("requiredBehavior")) {
3452        value = new ActionRequiredBehaviorEnumFactory().fromType(castToCode(value));
3453        this.requiredBehavior = (Enumeration) value; // Enumeration<ActionRequiredBehavior>
3454      } else if (name.equals("precheckBehavior")) {
3455        value = new ActionPrecheckBehaviorEnumFactory().fromType(castToCode(value));
3456        this.precheckBehavior = (Enumeration) value; // Enumeration<ActionPrecheckBehavior>
3457      } else if (name.equals("cardinalityBehavior")) {
3458        value = new ActionCardinalityBehaviorEnumFactory().fromType(castToCode(value));
3459        this.cardinalityBehavior = (Enumeration) value; // Enumeration<ActionCardinalityBehavior>
3460      } else if (name.equals("resource")) {
3461        this.resource = castToReference(value); // Reference
3462      } else if (name.equals("action")) {
3463        this.getAction().add((RequestGroupActionComponent) value);
3464      } else
3465        return super.setProperty(name, value);
3466      return value;
3467    }
3468
3469    @Override
3470    public Base makeProperty(int hash, String name) throws FHIRException {
3471      switch (hash) {
3472      case -980110702:
3473        return getPrefixElement();
3474      case 110371416:
3475        return getTitleElement();
3476      case -1724546052:
3477        return getDescriptionElement();
3478      case -900391049:
3479        return getTextEquivalentElement();
3480      case -1165461084:
3481        return getPriorityElement();
3482      case 3059181:
3483        return addCode();
3484      case 1587405498:
3485        return addDocumentation();
3486      case -861311717:
3487        return addCondition();
3488      case -384107967:
3489        return addRelatedAction();
3490      case 164632566:
3491        return getTiming();
3492      case -873664438:
3493        return getTiming();
3494      case 767422259:
3495        return addParticipant();
3496      case 3575610:
3497        return getType();
3498      case 586678389:
3499        return getGroupingBehaviorElement();
3500      case 168639486:
3501        return getSelectionBehaviorElement();
3502      case -1163906287:
3503        return getRequiredBehaviorElement();
3504      case -1174249033:
3505        return getPrecheckBehaviorElement();
3506      case -922577408:
3507        return getCardinalityBehaviorElement();
3508      case -341064690:
3509        return getResource();
3510      case -1422950858:
3511        return addAction();
3512      default:
3513        return super.makeProperty(hash, name);
3514      }
3515
3516    }
3517
3518    @Override
3519    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3520      switch (hash) {
3521      case -980110702:
3522        /* prefix */ return new String[] { "string" };
3523      case 110371416:
3524        /* title */ return new String[] { "string" };
3525      case -1724546052:
3526        /* description */ return new String[] { "string" };
3527      case -900391049:
3528        /* textEquivalent */ return new String[] { "string" };
3529      case -1165461084:
3530        /* priority */ return new String[] { "code" };
3531      case 3059181:
3532        /* code */ return new String[] { "CodeableConcept" };
3533      case 1587405498:
3534        /* documentation */ return new String[] { "RelatedArtifact" };
3535      case -861311717:
3536        /* condition */ return new String[] {};
3537      case -384107967:
3538        /* relatedAction */ return new String[] {};
3539      case -873664438:
3540        /* timing */ return new String[] { "dateTime", "Age", "Period", "Duration", "Range", "Timing" };
3541      case 767422259:
3542        /* participant */ return new String[] { "Reference" };
3543      case 3575610:
3544        /* type */ return new String[] { "CodeableConcept" };
3545      case 586678389:
3546        /* groupingBehavior */ return new String[] { "code" };
3547      case 168639486:
3548        /* selectionBehavior */ return new String[] { "code" };
3549      case -1163906287:
3550        /* requiredBehavior */ return new String[] { "code" };
3551      case -1174249033:
3552        /* precheckBehavior */ return new String[] { "code" };
3553      case -922577408:
3554        /* cardinalityBehavior */ return new String[] { "code" };
3555      case -341064690:
3556        /* resource */ return new String[] { "Reference" };
3557      case -1422950858:
3558        /* action */ return new String[] { "@RequestGroup.action" };
3559      default:
3560        return super.getTypesForProperty(hash, name);
3561      }
3562
3563    }
3564
3565    @Override
3566    public Base addChild(String name) throws FHIRException {
3567      if (name.equals("prefix")) {
3568        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.prefix");
3569      } else if (name.equals("title")) {
3570        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.title");
3571      } else if (name.equals("description")) {
3572        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.description");
3573      } else if (name.equals("textEquivalent")) {
3574        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.textEquivalent");
3575      } else if (name.equals("priority")) {
3576        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.priority");
3577      } else if (name.equals("code")) {
3578        return addCode();
3579      } else if (name.equals("documentation")) {
3580        return addDocumentation();
3581      } else if (name.equals("condition")) {
3582        return addCondition();
3583      } else if (name.equals("relatedAction")) {
3584        return addRelatedAction();
3585      } else if (name.equals("timingDateTime")) {
3586        this.timing = new DateTimeType();
3587        return this.timing;
3588      } else if (name.equals("timingAge")) {
3589        this.timing = new Age();
3590        return this.timing;
3591      } else if (name.equals("timingPeriod")) {
3592        this.timing = new Period();
3593        return this.timing;
3594      } else if (name.equals("timingDuration")) {
3595        this.timing = new Duration();
3596        return this.timing;
3597      } else if (name.equals("timingRange")) {
3598        this.timing = new Range();
3599        return this.timing;
3600      } else if (name.equals("timingTiming")) {
3601        this.timing = new Timing();
3602        return this.timing;
3603      } else if (name.equals("participant")) {
3604        return addParticipant();
3605      } else if (name.equals("type")) {
3606        this.type = new CodeableConcept();
3607        return this.type;
3608      } else if (name.equals("groupingBehavior")) {
3609        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.groupingBehavior");
3610      } else if (name.equals("selectionBehavior")) {
3611        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.selectionBehavior");
3612      } else if (name.equals("requiredBehavior")) {
3613        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.requiredBehavior");
3614      } else if (name.equals("precheckBehavior")) {
3615        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.precheckBehavior");
3616      } else if (name.equals("cardinalityBehavior")) {
3617        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.cardinalityBehavior");
3618      } else if (name.equals("resource")) {
3619        this.resource = new Reference();
3620        return this.resource;
3621      } else if (name.equals("action")) {
3622        return addAction();
3623      } else
3624        return super.addChild(name);
3625    }
3626
3627    public RequestGroupActionComponent copy() {
3628      RequestGroupActionComponent dst = new RequestGroupActionComponent();
3629      copyValues(dst);
3630      return dst;
3631    }
3632
3633    public void copyValues(RequestGroupActionComponent dst) {
3634      super.copyValues(dst);
3635      dst.prefix = prefix == null ? null : prefix.copy();
3636      dst.title = title == null ? null : title.copy();
3637      dst.description = description == null ? null : description.copy();
3638      dst.textEquivalent = textEquivalent == null ? null : textEquivalent.copy();
3639      dst.priority = priority == null ? null : priority.copy();
3640      if (code != null) {
3641        dst.code = new ArrayList<CodeableConcept>();
3642        for (CodeableConcept i : code)
3643          dst.code.add(i.copy());
3644      }
3645      ;
3646      if (documentation != null) {
3647        dst.documentation = new ArrayList<RelatedArtifact>();
3648        for (RelatedArtifact i : documentation)
3649          dst.documentation.add(i.copy());
3650      }
3651      ;
3652      if (condition != null) {
3653        dst.condition = new ArrayList<RequestGroupActionConditionComponent>();
3654        for (RequestGroupActionConditionComponent i : condition)
3655          dst.condition.add(i.copy());
3656      }
3657      ;
3658      if (relatedAction != null) {
3659        dst.relatedAction = new ArrayList<RequestGroupActionRelatedActionComponent>();
3660        for (RequestGroupActionRelatedActionComponent i : relatedAction)
3661          dst.relatedAction.add(i.copy());
3662      }
3663      ;
3664      dst.timing = timing == null ? null : timing.copy();
3665      if (participant != null) {
3666        dst.participant = new ArrayList<Reference>();
3667        for (Reference i : participant)
3668          dst.participant.add(i.copy());
3669      }
3670      ;
3671      dst.type = type == null ? null : type.copy();
3672      dst.groupingBehavior = groupingBehavior == null ? null : groupingBehavior.copy();
3673      dst.selectionBehavior = selectionBehavior == null ? null : selectionBehavior.copy();
3674      dst.requiredBehavior = requiredBehavior == null ? null : requiredBehavior.copy();
3675      dst.precheckBehavior = precheckBehavior == null ? null : precheckBehavior.copy();
3676      dst.cardinalityBehavior = cardinalityBehavior == null ? null : cardinalityBehavior.copy();
3677      dst.resource = resource == null ? null : resource.copy();
3678      if (action != null) {
3679        dst.action = new ArrayList<RequestGroupActionComponent>();
3680        for (RequestGroupActionComponent i : action)
3681          dst.action.add(i.copy());
3682      }
3683      ;
3684    }
3685
3686    @Override
3687    public boolean equalsDeep(Base other_) {
3688      if (!super.equalsDeep(other_))
3689        return false;
3690      if (!(other_ instanceof RequestGroupActionComponent))
3691        return false;
3692      RequestGroupActionComponent o = (RequestGroupActionComponent) other_;
3693      return compareDeep(prefix, o.prefix, true) && compareDeep(title, o.title, true)
3694          && compareDeep(description, o.description, true) && compareDeep(textEquivalent, o.textEquivalent, true)
3695          && compareDeep(priority, o.priority, true) && compareDeep(code, o.code, true)
3696          && compareDeep(documentation, o.documentation, true) && compareDeep(condition, o.condition, true)
3697          && compareDeep(relatedAction, o.relatedAction, true) && compareDeep(timing, o.timing, true)
3698          && compareDeep(participant, o.participant, true) && compareDeep(type, o.type, true)
3699          && compareDeep(groupingBehavior, o.groupingBehavior, true)
3700          && compareDeep(selectionBehavior, o.selectionBehavior, true)
3701          && compareDeep(requiredBehavior, o.requiredBehavior, true)
3702          && compareDeep(precheckBehavior, o.precheckBehavior, true)
3703          && compareDeep(cardinalityBehavior, o.cardinalityBehavior, true) && compareDeep(resource, o.resource, true)
3704          && compareDeep(action, o.action, true);
3705    }
3706
3707    @Override
3708    public boolean equalsShallow(Base other_) {
3709      if (!super.equalsShallow(other_))
3710        return false;
3711      if (!(other_ instanceof RequestGroupActionComponent))
3712        return false;
3713      RequestGroupActionComponent o = (RequestGroupActionComponent) other_;
3714      return compareValues(prefix, o.prefix, true) && compareValues(title, o.title, true)
3715          && compareValues(description, o.description, true) && compareValues(textEquivalent, o.textEquivalent, true)
3716          && compareValues(priority, o.priority, true) && compareValues(groupingBehavior, o.groupingBehavior, true)
3717          && compareValues(selectionBehavior, o.selectionBehavior, true)
3718          && compareValues(requiredBehavior, o.requiredBehavior, true)
3719          && compareValues(precheckBehavior, o.precheckBehavior, true)
3720          && compareValues(cardinalityBehavior, o.cardinalityBehavior, true);
3721    }
3722
3723    public boolean isEmpty() {
3724      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(prefix, title, description, textEquivalent,
3725          priority, code, documentation, condition, relatedAction, timing, participant, type, groupingBehavior,
3726          selectionBehavior, requiredBehavior, precheckBehavior, cardinalityBehavior, resource, action);
3727    }
3728
3729    public String fhirType() {
3730      return "RequestGroup.action";
3731
3732    }
3733
3734  }
3735
3736  @Block()
3737  public static class RequestGroupActionConditionComponent extends BackboneElement implements IBaseBackboneElement {
3738    /**
3739     * The kind of condition.
3740     */
3741    @Child(name = "kind", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = false)
3742    @Description(shortDefinition = "applicability | start | stop", formalDefinition = "The kind of condition.")
3743    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/action-condition-kind")
3744    protected Enumeration<ActionConditionKind> kind;
3745
3746    /**
3747     * An expression that returns true or false, indicating whether or not the
3748     * condition is satisfied.
3749     */
3750    @Child(name = "expression", type = {
3751        Expression.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
3752    @Description(shortDefinition = "Boolean-valued expression", formalDefinition = "An expression that returns true or false, indicating whether or not the condition is satisfied.")
3753    protected Expression expression;
3754
3755    private static final long serialVersionUID = -455150438L;
3756
3757    /**
3758     * Constructor
3759     */
3760    public RequestGroupActionConditionComponent() {
3761      super();
3762    }
3763
3764    /**
3765     * Constructor
3766     */
3767    public RequestGroupActionConditionComponent(Enumeration<ActionConditionKind> kind) {
3768      super();
3769      this.kind = kind;
3770    }
3771
3772    /**
3773     * @return {@link #kind} (The kind of condition.). This is the underlying object
3774     *         with id, value and extensions. The accessor "getKind" gives direct
3775     *         access to the value
3776     */
3777    public Enumeration<ActionConditionKind> getKindElement() {
3778      if (this.kind == null)
3779        if (Configuration.errorOnAutoCreate())
3780          throw new Error("Attempt to auto-create RequestGroupActionConditionComponent.kind");
3781        else if (Configuration.doAutoCreate())
3782          this.kind = new Enumeration<ActionConditionKind>(new ActionConditionKindEnumFactory()); // bb
3783      return this.kind;
3784    }
3785
3786    public boolean hasKindElement() {
3787      return this.kind != null && !this.kind.isEmpty();
3788    }
3789
3790    public boolean hasKind() {
3791      return this.kind != null && !this.kind.isEmpty();
3792    }
3793
3794    /**
3795     * @param value {@link #kind} (The kind of condition.). This is the underlying
3796     *              object with id, value and extensions. The accessor "getKind"
3797     *              gives direct access to the value
3798     */
3799    public RequestGroupActionConditionComponent setKindElement(Enumeration<ActionConditionKind> value) {
3800      this.kind = value;
3801      return this;
3802    }
3803
3804    /**
3805     * @return The kind of condition.
3806     */
3807    public ActionConditionKind getKind() {
3808      return this.kind == null ? null : this.kind.getValue();
3809    }
3810
3811    /**
3812     * @param value The kind of condition.
3813     */
3814    public RequestGroupActionConditionComponent setKind(ActionConditionKind value) {
3815      if (this.kind == null)
3816        this.kind = new Enumeration<ActionConditionKind>(new ActionConditionKindEnumFactory());
3817      this.kind.setValue(value);
3818      return this;
3819    }
3820
3821    /**
3822     * @return {@link #expression} (An expression that returns true or false,
3823     *         indicating whether or not the condition is satisfied.)
3824     */
3825    public Expression getExpression() {
3826      if (this.expression == null)
3827        if (Configuration.errorOnAutoCreate())
3828          throw new Error("Attempt to auto-create RequestGroupActionConditionComponent.expression");
3829        else if (Configuration.doAutoCreate())
3830          this.expression = new Expression(); // cc
3831      return this.expression;
3832    }
3833
3834    public boolean hasExpression() {
3835      return this.expression != null && !this.expression.isEmpty();
3836    }
3837
3838    /**
3839     * @param value {@link #expression} (An expression that returns true or false,
3840     *              indicating whether or not the condition is satisfied.)
3841     */
3842    public RequestGroupActionConditionComponent setExpression(Expression value) {
3843      this.expression = value;
3844      return this;
3845    }
3846
3847    protected void listChildren(List<Property> children) {
3848      super.listChildren(children);
3849      children.add(new Property("kind", "code", "The kind of condition.", 0, 1, kind));
3850      children.add(new Property("expression", "Expression",
3851          "An expression that returns true or false, indicating whether or not the condition is satisfied.", 0, 1,
3852          expression));
3853    }
3854
3855    @Override
3856    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3857      switch (_hash) {
3858      case 3292052:
3859        /* kind */ return new Property("kind", "code", "The kind of condition.", 0, 1, kind);
3860      case -1795452264:
3861        /* expression */ return new Property("expression", "Expression",
3862            "An expression that returns true or false, indicating whether or not the condition is satisfied.", 0, 1,
3863            expression);
3864      default:
3865        return super.getNamedProperty(_hash, _name, _checkValid);
3866      }
3867
3868    }
3869
3870    @Override
3871    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3872      switch (hash) {
3873      case 3292052:
3874        /* kind */ return this.kind == null ? new Base[0] : new Base[] { this.kind }; // Enumeration<ActionConditionKind>
3875      case -1795452264:
3876        /* expression */ return this.expression == null ? new Base[0] : new Base[] { this.expression }; // Expression
3877      default:
3878        return super.getProperty(hash, name, checkValid);
3879      }
3880
3881    }
3882
3883    @Override
3884    public Base setProperty(int hash, String name, Base value) throws FHIRException {
3885      switch (hash) {
3886      case 3292052: // kind
3887        value = new ActionConditionKindEnumFactory().fromType(castToCode(value));
3888        this.kind = (Enumeration) value; // Enumeration<ActionConditionKind>
3889        return value;
3890      case -1795452264: // expression
3891        this.expression = castToExpression(value); // Expression
3892        return value;
3893      default:
3894        return super.setProperty(hash, name, value);
3895      }
3896
3897    }
3898
3899    @Override
3900    public Base setProperty(String name, Base value) throws FHIRException {
3901      if (name.equals("kind")) {
3902        value = new ActionConditionKindEnumFactory().fromType(castToCode(value));
3903        this.kind = (Enumeration) value; // Enumeration<ActionConditionKind>
3904      } else if (name.equals("expression")) {
3905        this.expression = castToExpression(value); // Expression
3906      } else
3907        return super.setProperty(name, value);
3908      return value;
3909    }
3910
3911    @Override
3912    public Base makeProperty(int hash, String name) throws FHIRException {
3913      switch (hash) {
3914      case 3292052:
3915        return getKindElement();
3916      case -1795452264:
3917        return getExpression();
3918      default:
3919        return super.makeProperty(hash, name);
3920      }
3921
3922    }
3923
3924    @Override
3925    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3926      switch (hash) {
3927      case 3292052:
3928        /* kind */ return new String[] { "code" };
3929      case -1795452264:
3930        /* expression */ return new String[] { "Expression" };
3931      default:
3932        return super.getTypesForProperty(hash, name);
3933      }
3934
3935    }
3936
3937    @Override
3938    public Base addChild(String name) throws FHIRException {
3939      if (name.equals("kind")) {
3940        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.kind");
3941      } else if (name.equals("expression")) {
3942        this.expression = new Expression();
3943        return this.expression;
3944      } else
3945        return super.addChild(name);
3946    }
3947
3948    public RequestGroupActionConditionComponent copy() {
3949      RequestGroupActionConditionComponent dst = new RequestGroupActionConditionComponent();
3950      copyValues(dst);
3951      return dst;
3952    }
3953
3954    public void copyValues(RequestGroupActionConditionComponent dst) {
3955      super.copyValues(dst);
3956      dst.kind = kind == null ? null : kind.copy();
3957      dst.expression = expression == null ? null : expression.copy();
3958    }
3959
3960    @Override
3961    public boolean equalsDeep(Base other_) {
3962      if (!super.equalsDeep(other_))
3963        return false;
3964      if (!(other_ instanceof RequestGroupActionConditionComponent))
3965        return false;
3966      RequestGroupActionConditionComponent o = (RequestGroupActionConditionComponent) other_;
3967      return compareDeep(kind, o.kind, true) && compareDeep(expression, o.expression, true);
3968    }
3969
3970    @Override
3971    public boolean equalsShallow(Base other_) {
3972      if (!super.equalsShallow(other_))
3973        return false;
3974      if (!(other_ instanceof RequestGroupActionConditionComponent))
3975        return false;
3976      RequestGroupActionConditionComponent o = (RequestGroupActionConditionComponent) other_;
3977      return compareValues(kind, o.kind, true);
3978    }
3979
3980    public boolean isEmpty() {
3981      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(kind, expression);
3982    }
3983
3984    public String fhirType() {
3985      return "RequestGroup.action.condition";
3986
3987    }
3988
3989  }
3990
3991  @Block()
3992  public static class RequestGroupActionRelatedActionComponent extends BackboneElement implements IBaseBackboneElement {
3993    /**
3994     * The element id of the action this is related to.
3995     */
3996    @Child(name = "actionId", type = { IdType.class }, order = 1, min = 1, max = 1, modifier = false, summary = false)
3997    @Description(shortDefinition = "What action this is related to", formalDefinition = "The element id of the action this is related to.")
3998    protected IdType actionId;
3999
4000    /**
4001     * The relationship of this action to the related action.
4002     */
4003    @Child(name = "relationship", type = {
4004        CodeType.class }, order = 2, min = 1, max = 1, modifier = false, summary = false)
4005    @Description(shortDefinition = "before-start | before | before-end | concurrent-with-start | concurrent | concurrent-with-end | after-start | after | after-end", formalDefinition = "The relationship of this action to the related action.")
4006    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/action-relationship-type")
4007    protected Enumeration<ActionRelationshipType> relationship;
4008
4009    /**
4010     * A duration or range of durations to apply to the relationship. For example,
4011     * 30-60 minutes before.
4012     */
4013    @Child(name = "offset", type = { Duration.class,
4014        Range.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
4015    @Description(shortDefinition = "Time offset for the relationship", formalDefinition = "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.")
4016    protected Type offset;
4017
4018    private static final long serialVersionUID = 1063306770L;
4019
4020    /**
4021     * Constructor
4022     */
4023    public RequestGroupActionRelatedActionComponent() {
4024      super();
4025    }
4026
4027    /**
4028     * Constructor
4029     */
4030    public RequestGroupActionRelatedActionComponent(IdType actionId, Enumeration<ActionRelationshipType> relationship) {
4031      super();
4032      this.actionId = actionId;
4033      this.relationship = relationship;
4034    }
4035
4036    /**
4037     * @return {@link #actionId} (The element id of the action this is related to.).
4038     *         This is the underlying object with id, value and extensions. The
4039     *         accessor "getActionId" gives direct access to the value
4040     */
4041    public IdType getActionIdElement() {
4042      if (this.actionId == null)
4043        if (Configuration.errorOnAutoCreate())
4044          throw new Error("Attempt to auto-create RequestGroupActionRelatedActionComponent.actionId");
4045        else if (Configuration.doAutoCreate())
4046          this.actionId = new IdType(); // bb
4047      return this.actionId;
4048    }
4049
4050    public boolean hasActionIdElement() {
4051      return this.actionId != null && !this.actionId.isEmpty();
4052    }
4053
4054    public boolean hasActionId() {
4055      return this.actionId != null && !this.actionId.isEmpty();
4056    }
4057
4058    /**
4059     * @param value {@link #actionId} (The element id of the action this is related
4060     *              to.). This is the underlying object with id, value and
4061     *              extensions. The accessor "getActionId" gives direct access to
4062     *              the value
4063     */
4064    public RequestGroupActionRelatedActionComponent setActionIdElement(IdType value) {
4065      this.actionId = value;
4066      return this;
4067    }
4068
4069    /**
4070     * @return The element id of the action this is related to.
4071     */
4072    public String getActionId() {
4073      return this.actionId == null ? null : this.actionId.getValue();
4074    }
4075
4076    /**
4077     * @param value The element id of the action this is related to.
4078     */
4079    public RequestGroupActionRelatedActionComponent setActionId(String value) {
4080      if (this.actionId == null)
4081        this.actionId = new IdType();
4082      this.actionId.setValue(value);
4083      return this;
4084    }
4085
4086    /**
4087     * @return {@link #relationship} (The relationship of this action to the related
4088     *         action.). This is the underlying object with id, value and
4089     *         extensions. The accessor "getRelationship" gives direct access to the
4090     *         value
4091     */
4092    public Enumeration<ActionRelationshipType> getRelationshipElement() {
4093      if (this.relationship == null)
4094        if (Configuration.errorOnAutoCreate())
4095          throw new Error("Attempt to auto-create RequestGroupActionRelatedActionComponent.relationship");
4096        else if (Configuration.doAutoCreate())
4097          this.relationship = new Enumeration<ActionRelationshipType>(new ActionRelationshipTypeEnumFactory()); // bb
4098      return this.relationship;
4099    }
4100
4101    public boolean hasRelationshipElement() {
4102      return this.relationship != null && !this.relationship.isEmpty();
4103    }
4104
4105    public boolean hasRelationship() {
4106      return this.relationship != null && !this.relationship.isEmpty();
4107    }
4108
4109    /**
4110     * @param value {@link #relationship} (The relationship of this action to the
4111     *              related action.). This is the underlying object with id, value
4112     *              and extensions. The accessor "getRelationship" gives direct
4113     *              access to the value
4114     */
4115    public RequestGroupActionRelatedActionComponent setRelationshipElement(Enumeration<ActionRelationshipType> value) {
4116      this.relationship = value;
4117      return this;
4118    }
4119
4120    /**
4121     * @return The relationship of this action to the related action.
4122     */
4123    public ActionRelationshipType getRelationship() {
4124      return this.relationship == null ? null : this.relationship.getValue();
4125    }
4126
4127    /**
4128     * @param value The relationship of this action to the related action.
4129     */
4130    public RequestGroupActionRelatedActionComponent setRelationship(ActionRelationshipType value) {
4131      if (this.relationship == null)
4132        this.relationship = new Enumeration<ActionRelationshipType>(new ActionRelationshipTypeEnumFactory());
4133      this.relationship.setValue(value);
4134      return this;
4135    }
4136
4137    /**
4138     * @return {@link #offset} (A duration or range of durations to apply to the
4139     *         relationship. For example, 30-60 minutes before.)
4140     */
4141    public Type getOffset() {
4142      return this.offset;
4143    }
4144
4145    /**
4146     * @return {@link #offset} (A duration or range of durations to apply to the
4147     *         relationship. For example, 30-60 minutes before.)
4148     */
4149    public Duration getOffsetDuration() throws FHIRException {
4150      if (this.offset == null)
4151        this.offset = new Duration();
4152      if (!(this.offset instanceof Duration))
4153        throw new FHIRException("Type mismatch: the type Duration was expected, but " + this.offset.getClass().getName()
4154            + " was encountered");
4155      return (Duration) this.offset;
4156    }
4157
4158    public boolean hasOffsetDuration() {
4159      return this != null && this.offset instanceof Duration;
4160    }
4161
4162    /**
4163     * @return {@link #offset} (A duration or range of durations to apply to the
4164     *         relationship. For example, 30-60 minutes before.)
4165     */
4166    public Range getOffsetRange() throws FHIRException {
4167      if (this.offset == null)
4168        this.offset = new Range();
4169      if (!(this.offset instanceof Range))
4170        throw new FHIRException(
4171            "Type mismatch: the type Range was expected, but " + this.offset.getClass().getName() + " was encountered");
4172      return (Range) this.offset;
4173    }
4174
4175    public boolean hasOffsetRange() {
4176      return this != null && this.offset instanceof Range;
4177    }
4178
4179    public boolean hasOffset() {
4180      return this.offset != null && !this.offset.isEmpty();
4181    }
4182
4183    /**
4184     * @param value {@link #offset} (A duration or range of durations to apply to
4185     *              the relationship. For example, 30-60 minutes before.)
4186     */
4187    public RequestGroupActionRelatedActionComponent setOffset(Type value) {
4188      if (value != null && !(value instanceof Duration || value instanceof Range))
4189        throw new Error("Not the right type for RequestGroup.action.relatedAction.offset[x]: " + value.fhirType());
4190      this.offset = value;
4191      return this;
4192    }
4193
4194    protected void listChildren(List<Property> children) {
4195      super.listChildren(children);
4196      children.add(new Property("actionId", "id", "The element id of the action this is related to.", 0, 1, actionId));
4197      children.add(new Property("relationship", "code", "The relationship of this action to the related action.", 0, 1,
4198          relationship));
4199      children.add(new Property("offset[x]", "Duration|Range",
4200          "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.", 0, 1,
4201          offset));
4202    }
4203
4204    @Override
4205    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4206      switch (_hash) {
4207      case -1656172047:
4208        /* actionId */ return new Property("actionId", "id", "The element id of the action this is related to.", 0, 1,
4209            actionId);
4210      case -261851592:
4211        /* relationship */ return new Property("relationship", "code",
4212            "The relationship of this action to the related action.", 0, 1, relationship);
4213      case -1960684787:
4214        /* offset[x] */ return new Property("offset[x]", "Duration|Range",
4215            "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.", 0, 1,
4216            offset);
4217      case -1019779949:
4218        /* offset */ return new Property("offset[x]", "Duration|Range",
4219            "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.", 0, 1,
4220            offset);
4221      case 134075207:
4222        /* offsetDuration */ return new Property("offset[x]", "Duration|Range",
4223            "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.", 0, 1,
4224            offset);
4225      case 1263585386:
4226        /* offsetRange */ return new Property("offset[x]", "Duration|Range",
4227            "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.", 0, 1,
4228            offset);
4229      default:
4230        return super.getNamedProperty(_hash, _name, _checkValid);
4231      }
4232
4233    }
4234
4235    @Override
4236    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4237      switch (hash) {
4238      case -1656172047:
4239        /* actionId */ return this.actionId == null ? new Base[0] : new Base[] { this.actionId }; // IdType
4240      case -261851592:
4241        /* relationship */ return this.relationship == null ? new Base[0] : new Base[] { this.relationship }; // Enumeration<ActionRelationshipType>
4242      case -1019779949:
4243        /* offset */ return this.offset == null ? new Base[0] : new Base[] { this.offset }; // Type
4244      default:
4245        return super.getProperty(hash, name, checkValid);
4246      }
4247
4248    }
4249
4250    @Override
4251    public Base setProperty(int hash, String name, Base value) throws FHIRException {
4252      switch (hash) {
4253      case -1656172047: // actionId
4254        this.actionId = castToId(value); // IdType
4255        return value;
4256      case -261851592: // relationship
4257        value = new ActionRelationshipTypeEnumFactory().fromType(castToCode(value));
4258        this.relationship = (Enumeration) value; // Enumeration<ActionRelationshipType>
4259        return value;
4260      case -1019779949: // offset
4261        this.offset = castToType(value); // Type
4262        return value;
4263      default:
4264        return super.setProperty(hash, name, value);
4265      }
4266
4267    }
4268
4269    @Override
4270    public Base setProperty(String name, Base value) throws FHIRException {
4271      if (name.equals("actionId")) {
4272        this.actionId = castToId(value); // IdType
4273      } else if (name.equals("relationship")) {
4274        value = new ActionRelationshipTypeEnumFactory().fromType(castToCode(value));
4275        this.relationship = (Enumeration) value; // Enumeration<ActionRelationshipType>
4276      } else if (name.equals("offset[x]")) {
4277        this.offset = castToType(value); // Type
4278      } else
4279        return super.setProperty(name, value);
4280      return value;
4281    }
4282
4283    @Override
4284    public Base makeProperty(int hash, String name) throws FHIRException {
4285      switch (hash) {
4286      case -1656172047:
4287        return getActionIdElement();
4288      case -261851592:
4289        return getRelationshipElement();
4290      case -1960684787:
4291        return getOffset();
4292      case -1019779949:
4293        return getOffset();
4294      default:
4295        return super.makeProperty(hash, name);
4296      }
4297
4298    }
4299
4300    @Override
4301    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4302      switch (hash) {
4303      case -1656172047:
4304        /* actionId */ return new String[] { "id" };
4305      case -261851592:
4306        /* relationship */ return new String[] { "code" };
4307      case -1019779949:
4308        /* offset */ return new String[] { "Duration", "Range" };
4309      default:
4310        return super.getTypesForProperty(hash, name);
4311      }
4312
4313    }
4314
4315    @Override
4316    public Base addChild(String name) throws FHIRException {
4317      if (name.equals("actionId")) {
4318        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.actionId");
4319      } else if (name.equals("relationship")) {
4320        throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.relationship");
4321      } else if (name.equals("offsetDuration")) {
4322        this.offset = new Duration();
4323        return this.offset;
4324      } else if (name.equals("offsetRange")) {
4325        this.offset = new Range();
4326        return this.offset;
4327      } else
4328        return super.addChild(name);
4329    }
4330
4331    public RequestGroupActionRelatedActionComponent copy() {
4332      RequestGroupActionRelatedActionComponent dst = new RequestGroupActionRelatedActionComponent();
4333      copyValues(dst);
4334      return dst;
4335    }
4336
4337    public void copyValues(RequestGroupActionRelatedActionComponent dst) {
4338      super.copyValues(dst);
4339      dst.actionId = actionId == null ? null : actionId.copy();
4340      dst.relationship = relationship == null ? null : relationship.copy();
4341      dst.offset = offset == null ? null : offset.copy();
4342    }
4343
4344    @Override
4345    public boolean equalsDeep(Base other_) {
4346      if (!super.equalsDeep(other_))
4347        return false;
4348      if (!(other_ instanceof RequestGroupActionRelatedActionComponent))
4349        return false;
4350      RequestGroupActionRelatedActionComponent o = (RequestGroupActionRelatedActionComponent) other_;
4351      return compareDeep(actionId, o.actionId, true) && compareDeep(relationship, o.relationship, true)
4352          && compareDeep(offset, o.offset, true);
4353    }
4354
4355    @Override
4356    public boolean equalsShallow(Base other_) {
4357      if (!super.equalsShallow(other_))
4358        return false;
4359      if (!(other_ instanceof RequestGroupActionRelatedActionComponent))
4360        return false;
4361      RequestGroupActionRelatedActionComponent o = (RequestGroupActionRelatedActionComponent) other_;
4362      return compareValues(actionId, o.actionId, true) && compareValues(relationship, o.relationship, true);
4363    }
4364
4365    public boolean isEmpty() {
4366      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(actionId, relationship, offset);
4367    }
4368
4369    public String fhirType() {
4370      return "RequestGroup.action.relatedAction";
4371
4372    }
4373
4374  }
4375
4376  /**
4377   * Allows a service to provide a unique, business identifier for the request.
4378   */
4379  @Child(name = "identifier", type = {
4380      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
4381  @Description(shortDefinition = "Business identifier", formalDefinition = "Allows a service to provide a unique, business identifier for the request.")
4382  protected List<Identifier> identifier;
4383
4384  /**
4385   * A canonical URL referencing a FHIR-defined protocol, guideline, orderset or
4386   * other definition that is adhered to in whole or in part by this request.
4387   */
4388  @Child(name = "instantiatesCanonical", type = {
4389      CanonicalType.class }, order = 1, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
4390  @Description(shortDefinition = "Instantiates FHIR protocol or definition", formalDefinition = "A canonical URL referencing a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.")
4391  protected List<CanonicalType> instantiatesCanonical;
4392
4393  /**
4394   * A URL referencing an externally defined protocol, guideline, orderset or
4395   * other definition that is adhered to in whole or in part by this request.
4396   */
4397  @Child(name = "instantiatesUri", type = {
4398      UriType.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
4399  @Description(shortDefinition = "Instantiates external protocol or definition", formalDefinition = "A URL referencing an externally defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.")
4400  protected List<UriType> instantiatesUri;
4401
4402  /**
4403   * A plan, proposal or order that is fulfilled in whole or in part by this
4404   * request.
4405   */
4406  @Child(name = "basedOn", type = {
4407      Reference.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
4408  @Description(shortDefinition = "Fulfills plan, proposal, or order", formalDefinition = "A plan, proposal or order that is fulfilled in whole or in part by this request.")
4409  protected List<Reference> basedOn;
4410  /**
4411   * The actual objects that are the target of the reference (A plan, proposal or
4412   * order that is fulfilled in whole or in part by this request.)
4413   */
4414  protected List<Resource> basedOnTarget;
4415
4416  /**
4417   * Completed or terminated request(s) whose function is taken by this new
4418   * request.
4419   */
4420  @Child(name = "replaces", type = {
4421      Reference.class }, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
4422  @Description(shortDefinition = "Request(s) replaced by this request", formalDefinition = "Completed or terminated request(s) whose function is taken by this new request.")
4423  protected List<Reference> replaces;
4424  /**
4425   * The actual objects that are the target of the reference (Completed or
4426   * terminated request(s) whose function is taken by this new request.)
4427   */
4428  protected List<Resource> replacesTarget;
4429
4430  /**
4431   * A shared identifier common to all requests that were authorized more or less
4432   * simultaneously by a single author, representing the identifier of the
4433   * requisition, prescription or similar form.
4434   */
4435  @Child(name = "groupIdentifier", type = {
4436      Identifier.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
4437  @Description(shortDefinition = "Composite request this is part of", formalDefinition = "A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form.")
4438  protected Identifier groupIdentifier;
4439
4440  /**
4441   * The current state of the request. For request groups, the status reflects the
4442   * status of all the requests in the group.
4443   */
4444  @Child(name = "status", type = { CodeType.class }, order = 6, min = 1, max = 1, modifier = true, summary = true)
4445  @Description(shortDefinition = "draft | active | on-hold | revoked | completed | entered-in-error | unknown", formalDefinition = "The current state of the request. For request groups, the status reflects the status of all the requests in the group.")
4446  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/request-status")
4447  protected Enumeration<RequestStatus> status;
4448
4449  /**
4450   * Indicates the level of authority/intentionality associated with the request
4451   * and where the request fits into the workflow chain.
4452   */
4453  @Child(name = "intent", type = { CodeType.class }, order = 7, min = 1, max = 1, modifier = true, summary = true)
4454  @Description(shortDefinition = "proposal | plan | directive | order | original-order | reflex-order | filler-order | instance-order | option", formalDefinition = "Indicates the level of authority/intentionality associated with the request and where the request fits into the workflow chain.")
4455  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/request-intent")
4456  protected Enumeration<RequestIntent> intent;
4457
4458  /**
4459   * Indicates how quickly the request should be addressed with respect to other
4460   * requests.
4461   */
4462  @Child(name = "priority", type = { CodeType.class }, order = 8, min = 0, max = 1, modifier = false, summary = true)
4463  @Description(shortDefinition = "routine | urgent | asap | stat", formalDefinition = "Indicates how quickly the request should be addressed with respect to other requests.")
4464  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/request-priority")
4465  protected Enumeration<RequestPriority> priority;
4466
4467  /**
4468   * A code that identifies what the overall request group is.
4469   */
4470  @Child(name = "code", type = { CodeableConcept.class }, order = 9, min = 0, max = 1, modifier = false, summary = true)
4471  @Description(shortDefinition = "What's being requested/ordered", formalDefinition = "A code that identifies what the overall request group is.")
4472  protected CodeableConcept code;
4473
4474  /**
4475   * The subject for which the request group was created.
4476   */
4477  @Child(name = "subject", type = { Patient.class,
4478      Group.class }, order = 10, min = 0, max = 1, modifier = false, summary = false)
4479  @Description(shortDefinition = "Who the request group is about", formalDefinition = "The subject for which the request group was created.")
4480  protected Reference subject;
4481
4482  /**
4483   * The actual object that is the target of the reference (The subject for which
4484   * the request group was created.)
4485   */
4486  protected Resource subjectTarget;
4487
4488  /**
4489   * Describes the context of the request group, if any.
4490   */
4491  @Child(name = "encounter", type = {
4492      Encounter.class }, order = 11, min = 0, max = 1, modifier = false, summary = false)
4493  @Description(shortDefinition = "Created as part of", formalDefinition = "Describes the context of the request group, if any.")
4494  protected Reference encounter;
4495
4496  /**
4497   * The actual object that is the target of the reference (Describes the context
4498   * of the request group, if any.)
4499   */
4500  protected Encounter encounterTarget;
4501
4502  /**
4503   * Indicates when the request group was created.
4504   */
4505  @Child(name = "authoredOn", type = {
4506      DateTimeType.class }, order = 12, min = 0, max = 1, modifier = false, summary = false)
4507  @Description(shortDefinition = "When the request group was authored", formalDefinition = "Indicates when the request group was created.")
4508  protected DateTimeType authoredOn;
4509
4510  /**
4511   * Provides a reference to the author of the request group.
4512   */
4513  @Child(name = "author", type = { Device.class, Practitioner.class,
4514      PractitionerRole.class }, order = 13, min = 0, max = 1, modifier = false, summary = false)
4515  @Description(shortDefinition = "Device or practitioner that authored the request group", formalDefinition = "Provides a reference to the author of the request group.")
4516  protected Reference author;
4517
4518  /**
4519   * The actual object that is the target of the reference (Provides a reference
4520   * to the author of the request group.)
4521   */
4522  protected Resource authorTarget;
4523
4524  /**
4525   * Describes the reason for the request group in coded or textual form.
4526   */
4527  @Child(name = "reasonCode", type = {
4528      CodeableConcept.class }, order = 14, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
4529  @Description(shortDefinition = "Why the request group is needed", formalDefinition = "Describes the reason for the request group in coded or textual form.")
4530  protected List<CodeableConcept> reasonCode;
4531
4532  /**
4533   * Indicates another resource whose existence justifies this request group.
4534   */
4535  @Child(name = "reasonReference", type = { Condition.class, Observation.class, DiagnosticReport.class,
4536      DocumentReference.class }, order = 15, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
4537  @Description(shortDefinition = "Why the request group is needed", formalDefinition = "Indicates another resource whose existence justifies this request group.")
4538  protected List<Reference> reasonReference;
4539  /**
4540   * The actual objects that are the target of the reference (Indicates another
4541   * resource whose existence justifies this request group.)
4542   */
4543  protected List<Resource> reasonReferenceTarget;
4544
4545  /**
4546   * Provides a mechanism to communicate additional information about the
4547   * response.
4548   */
4549  @Child(name = "note", type = {
4550      Annotation.class }, order = 16, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
4551  @Description(shortDefinition = "Additional notes about the response", formalDefinition = "Provides a mechanism to communicate additional information about the response.")
4552  protected List<Annotation> note;
4553
4554  /**
4555   * The actions, if any, produced by the evaluation of the artifact.
4556   */
4557  @Child(name = "action", type = {}, order = 17, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
4558  @Description(shortDefinition = "Proposed actions, if any", formalDefinition = "The actions, if any, produced by the evaluation of the artifact.")
4559  protected List<RequestGroupActionComponent> action;
4560
4561  private static final long serialVersionUID = -2053492070L;
4562
4563  /**
4564   * Constructor
4565   */
4566  public RequestGroup() {
4567    super();
4568  }
4569
4570  /**
4571   * Constructor
4572   */
4573  public RequestGroup(Enumeration<RequestStatus> status, Enumeration<RequestIntent> intent) {
4574    super();
4575    this.status = status;
4576    this.intent = intent;
4577  }
4578
4579  /**
4580   * @return {@link #identifier} (Allows a service to provide a unique, business
4581   *         identifier for the request.)
4582   */
4583  public List<Identifier> getIdentifier() {
4584    if (this.identifier == null)
4585      this.identifier = new ArrayList<Identifier>();
4586    return this.identifier;
4587  }
4588
4589  /**
4590   * @return Returns a reference to <code>this</code> for easy method chaining
4591   */
4592  public RequestGroup setIdentifier(List<Identifier> theIdentifier) {
4593    this.identifier = theIdentifier;
4594    return this;
4595  }
4596
4597  public boolean hasIdentifier() {
4598    if (this.identifier == null)
4599      return false;
4600    for (Identifier item : this.identifier)
4601      if (!item.isEmpty())
4602        return true;
4603    return false;
4604  }
4605
4606  public Identifier addIdentifier() { // 3
4607    Identifier t = new Identifier();
4608    if (this.identifier == null)
4609      this.identifier = new ArrayList<Identifier>();
4610    this.identifier.add(t);
4611    return t;
4612  }
4613
4614  public RequestGroup addIdentifier(Identifier t) { // 3
4615    if (t == null)
4616      return this;
4617    if (this.identifier == null)
4618      this.identifier = new ArrayList<Identifier>();
4619    this.identifier.add(t);
4620    return this;
4621  }
4622
4623  /**
4624   * @return The first repetition of repeating field {@link #identifier}, creating
4625   *         it if it does not already exist
4626   */
4627  public Identifier getIdentifierFirstRep() {
4628    if (getIdentifier().isEmpty()) {
4629      addIdentifier();
4630    }
4631    return getIdentifier().get(0);
4632  }
4633
4634  /**
4635   * @return {@link #instantiatesCanonical} (A canonical URL referencing a
4636   *         FHIR-defined protocol, guideline, orderset or other definition that
4637   *         is adhered to in whole or in part by this request.)
4638   */
4639  public List<CanonicalType> getInstantiatesCanonical() {
4640    if (this.instantiatesCanonical == null)
4641      this.instantiatesCanonical = new ArrayList<CanonicalType>();
4642    return this.instantiatesCanonical;
4643  }
4644
4645  /**
4646   * @return Returns a reference to <code>this</code> for easy method chaining
4647   */
4648  public RequestGroup setInstantiatesCanonical(List<CanonicalType> theInstantiatesCanonical) {
4649    this.instantiatesCanonical = theInstantiatesCanonical;
4650    return this;
4651  }
4652
4653  public boolean hasInstantiatesCanonical() {
4654    if (this.instantiatesCanonical == null)
4655      return false;
4656    for (CanonicalType item : this.instantiatesCanonical)
4657      if (!item.isEmpty())
4658        return true;
4659    return false;
4660  }
4661
4662  /**
4663   * @return {@link #instantiatesCanonical} (A canonical URL referencing a
4664   *         FHIR-defined protocol, guideline, orderset or other definition that
4665   *         is adhered to in whole or in part by this request.)
4666   */
4667  public CanonicalType addInstantiatesCanonicalElement() {// 2
4668    CanonicalType t = new CanonicalType();
4669    if (this.instantiatesCanonical == null)
4670      this.instantiatesCanonical = new ArrayList<CanonicalType>();
4671    this.instantiatesCanonical.add(t);
4672    return t;
4673  }
4674
4675  /**
4676   * @param value {@link #instantiatesCanonical} (A canonical URL referencing a
4677   *              FHIR-defined protocol, guideline, orderset or other definition
4678   *              that is adhered to in whole or in part by this request.)
4679   */
4680  public RequestGroup addInstantiatesCanonical(String value) { // 1
4681    CanonicalType t = new CanonicalType();
4682    t.setValue(value);
4683    if (this.instantiatesCanonical == null)
4684      this.instantiatesCanonical = new ArrayList<CanonicalType>();
4685    this.instantiatesCanonical.add(t);
4686    return this;
4687  }
4688
4689  /**
4690   * @param value {@link #instantiatesCanonical} (A canonical URL referencing a
4691   *              FHIR-defined protocol, guideline, orderset or other definition
4692   *              that is adhered to in whole or in part by this request.)
4693   */
4694  public boolean hasInstantiatesCanonical(String value) {
4695    if (this.instantiatesCanonical == null)
4696      return false;
4697    for (CanonicalType v : this.instantiatesCanonical)
4698      if (v.getValue().equals(value)) // canonical
4699        return true;
4700    return false;
4701  }
4702
4703  /**
4704   * @return {@link #instantiatesUri} (A URL referencing an externally defined
4705   *         protocol, guideline, orderset or other definition that is adhered to
4706   *         in whole or in part by this request.)
4707   */
4708  public List<UriType> getInstantiatesUri() {
4709    if (this.instantiatesUri == null)
4710      this.instantiatesUri = new ArrayList<UriType>();
4711    return this.instantiatesUri;
4712  }
4713
4714  /**
4715   * @return Returns a reference to <code>this</code> for easy method chaining
4716   */
4717  public RequestGroup setInstantiatesUri(List<UriType> theInstantiatesUri) {
4718    this.instantiatesUri = theInstantiatesUri;
4719    return this;
4720  }
4721
4722  public boolean hasInstantiatesUri() {
4723    if (this.instantiatesUri == null)
4724      return false;
4725    for (UriType item : this.instantiatesUri)
4726      if (!item.isEmpty())
4727        return true;
4728    return false;
4729  }
4730
4731  /**
4732   * @return {@link #instantiatesUri} (A URL referencing an externally defined
4733   *         protocol, guideline, orderset or other definition that is adhered to
4734   *         in whole or in part by this request.)
4735   */
4736  public UriType addInstantiatesUriElement() {// 2
4737    UriType t = new UriType();
4738    if (this.instantiatesUri == null)
4739      this.instantiatesUri = new ArrayList<UriType>();
4740    this.instantiatesUri.add(t);
4741    return t;
4742  }
4743
4744  /**
4745   * @param value {@link #instantiatesUri} (A URL referencing an externally
4746   *              defined protocol, guideline, orderset or other definition that
4747   *              is adhered to in whole or in part by this request.)
4748   */
4749  public RequestGroup addInstantiatesUri(String value) { // 1
4750    UriType t = new UriType();
4751    t.setValue(value);
4752    if (this.instantiatesUri == null)
4753      this.instantiatesUri = new ArrayList<UriType>();
4754    this.instantiatesUri.add(t);
4755    return this;
4756  }
4757
4758  /**
4759   * @param value {@link #instantiatesUri} (A URL referencing an externally
4760   *              defined protocol, guideline, orderset or other definition that
4761   *              is adhered to in whole or in part by this request.)
4762   */
4763  public boolean hasInstantiatesUri(String value) {
4764    if (this.instantiatesUri == null)
4765      return false;
4766    for (UriType v : this.instantiatesUri)
4767      if (v.getValue().equals(value)) // uri
4768        return true;
4769    return false;
4770  }
4771
4772  /**
4773   * @return {@link #basedOn} (A plan, proposal or order that is fulfilled in
4774   *         whole or in part by this request.)
4775   */
4776  public List<Reference> getBasedOn() {
4777    if (this.basedOn == null)
4778      this.basedOn = new ArrayList<Reference>();
4779    return this.basedOn;
4780  }
4781
4782  /**
4783   * @return Returns a reference to <code>this</code> for easy method chaining
4784   */
4785  public RequestGroup setBasedOn(List<Reference> theBasedOn) {
4786    this.basedOn = theBasedOn;
4787    return this;
4788  }
4789
4790  public boolean hasBasedOn() {
4791    if (this.basedOn == null)
4792      return false;
4793    for (Reference item : this.basedOn)
4794      if (!item.isEmpty())
4795        return true;
4796    return false;
4797  }
4798
4799  public Reference addBasedOn() { // 3
4800    Reference t = new Reference();
4801    if (this.basedOn == null)
4802      this.basedOn = new ArrayList<Reference>();
4803    this.basedOn.add(t);
4804    return t;
4805  }
4806
4807  public RequestGroup addBasedOn(Reference t) { // 3
4808    if (t == null)
4809      return this;
4810    if (this.basedOn == null)
4811      this.basedOn = new ArrayList<Reference>();
4812    this.basedOn.add(t);
4813    return this;
4814  }
4815
4816  /**
4817   * @return The first repetition of repeating field {@link #basedOn}, creating it
4818   *         if it does not already exist
4819   */
4820  public Reference getBasedOnFirstRep() {
4821    if (getBasedOn().isEmpty()) {
4822      addBasedOn();
4823    }
4824    return getBasedOn().get(0);
4825  }
4826
4827  /**
4828   * @deprecated Use Reference#setResource(IBaseResource) instead
4829   */
4830  @Deprecated
4831  public List<Resource> getBasedOnTarget() {
4832    if (this.basedOnTarget == null)
4833      this.basedOnTarget = new ArrayList<Resource>();
4834    return this.basedOnTarget;
4835  }
4836
4837  /**
4838   * @return {@link #replaces} (Completed or terminated request(s) whose function
4839   *         is taken by this new request.)
4840   */
4841  public List<Reference> getReplaces() {
4842    if (this.replaces == null)
4843      this.replaces = new ArrayList<Reference>();
4844    return this.replaces;
4845  }
4846
4847  /**
4848   * @return Returns a reference to <code>this</code> for easy method chaining
4849   */
4850  public RequestGroup setReplaces(List<Reference> theReplaces) {
4851    this.replaces = theReplaces;
4852    return this;
4853  }
4854
4855  public boolean hasReplaces() {
4856    if (this.replaces == null)
4857      return false;
4858    for (Reference item : this.replaces)
4859      if (!item.isEmpty())
4860        return true;
4861    return false;
4862  }
4863
4864  public Reference addReplaces() { // 3
4865    Reference t = new Reference();
4866    if (this.replaces == null)
4867      this.replaces = new ArrayList<Reference>();
4868    this.replaces.add(t);
4869    return t;
4870  }
4871
4872  public RequestGroup addReplaces(Reference t) { // 3
4873    if (t == null)
4874      return this;
4875    if (this.replaces == null)
4876      this.replaces = new ArrayList<Reference>();
4877    this.replaces.add(t);
4878    return this;
4879  }
4880
4881  /**
4882   * @return The first repetition of repeating field {@link #replaces}, creating
4883   *         it if it does not already exist
4884   */
4885  public Reference getReplacesFirstRep() {
4886    if (getReplaces().isEmpty()) {
4887      addReplaces();
4888    }
4889    return getReplaces().get(0);
4890  }
4891
4892  /**
4893   * @deprecated Use Reference#setResource(IBaseResource) instead
4894   */
4895  @Deprecated
4896  public List<Resource> getReplacesTarget() {
4897    if (this.replacesTarget == null)
4898      this.replacesTarget = new ArrayList<Resource>();
4899    return this.replacesTarget;
4900  }
4901
4902  /**
4903   * @return {@link #groupIdentifier} (A shared identifier common to all requests
4904   *         that were authorized more or less simultaneously by a single author,
4905   *         representing the identifier of the requisition, prescription or
4906   *         similar form.)
4907   */
4908  public Identifier getGroupIdentifier() {
4909    if (this.groupIdentifier == null)
4910      if (Configuration.errorOnAutoCreate())
4911        throw new Error("Attempt to auto-create RequestGroup.groupIdentifier");
4912      else if (Configuration.doAutoCreate())
4913        this.groupIdentifier = new Identifier(); // cc
4914    return this.groupIdentifier;
4915  }
4916
4917  public boolean hasGroupIdentifier() {
4918    return this.groupIdentifier != null && !this.groupIdentifier.isEmpty();
4919  }
4920
4921  /**
4922   * @param value {@link #groupIdentifier} (A shared identifier common to all
4923   *              requests that were authorized more or less simultaneously by a
4924   *              single author, representing the identifier of the requisition,
4925   *              prescription or similar form.)
4926   */
4927  public RequestGroup setGroupIdentifier(Identifier value) {
4928    this.groupIdentifier = value;
4929    return this;
4930  }
4931
4932  /**
4933   * @return {@link #status} (The current state of the request. For request
4934   *         groups, the status reflects the status of all the requests in the
4935   *         group.). This is the underlying object with id, value and extensions.
4936   *         The accessor "getStatus" gives direct access to the value
4937   */
4938  public Enumeration<RequestStatus> getStatusElement() {
4939    if (this.status == null)
4940      if (Configuration.errorOnAutoCreate())
4941        throw new Error("Attempt to auto-create RequestGroup.status");
4942      else if (Configuration.doAutoCreate())
4943        this.status = new Enumeration<RequestStatus>(new RequestStatusEnumFactory()); // bb
4944    return this.status;
4945  }
4946
4947  public boolean hasStatusElement() {
4948    return this.status != null && !this.status.isEmpty();
4949  }
4950
4951  public boolean hasStatus() {
4952    return this.status != null && !this.status.isEmpty();
4953  }
4954
4955  /**
4956   * @param value {@link #status} (The current state of the request. For request
4957   *              groups, the status reflects the status of all the requests in
4958   *              the group.). This is the underlying object with id, value and
4959   *              extensions. The accessor "getStatus" gives direct access to the
4960   *              value
4961   */
4962  public RequestGroup setStatusElement(Enumeration<RequestStatus> value) {
4963    this.status = value;
4964    return this;
4965  }
4966
4967  /**
4968   * @return The current state of the request. For request groups, the status
4969   *         reflects the status of all the requests in the group.
4970   */
4971  public RequestStatus getStatus() {
4972    return this.status == null ? null : this.status.getValue();
4973  }
4974
4975  /**
4976   * @param value The current state of the request. For request groups, the status
4977   *              reflects the status of all the requests in the group.
4978   */
4979  public RequestGroup setStatus(RequestStatus value) {
4980    if (this.status == null)
4981      this.status = new Enumeration<RequestStatus>(new RequestStatusEnumFactory());
4982    this.status.setValue(value);
4983    return this;
4984  }
4985
4986  /**
4987   * @return {@link #intent} (Indicates the level of authority/intentionality
4988   *         associated with the request and where the request fits into the
4989   *         workflow chain.). This is the underlying object with id, value and
4990   *         extensions. The accessor "getIntent" gives direct access to the value
4991   */
4992  public Enumeration<RequestIntent> getIntentElement() {
4993    if (this.intent == null)
4994      if (Configuration.errorOnAutoCreate())
4995        throw new Error("Attempt to auto-create RequestGroup.intent");
4996      else if (Configuration.doAutoCreate())
4997        this.intent = new Enumeration<RequestIntent>(new RequestIntentEnumFactory()); // bb
4998    return this.intent;
4999  }
5000
5001  public boolean hasIntentElement() {
5002    return this.intent != null && !this.intent.isEmpty();
5003  }
5004
5005  public boolean hasIntent() {
5006    return this.intent != null && !this.intent.isEmpty();
5007  }
5008
5009  /**
5010   * @param value {@link #intent} (Indicates the level of authority/intentionality
5011   *              associated with the request and where the request fits into the
5012   *              workflow chain.). This is the underlying object with id, value
5013   *              and extensions. The accessor "getIntent" gives direct access to
5014   *              the value
5015   */
5016  public RequestGroup setIntentElement(Enumeration<RequestIntent> value) {
5017    this.intent = value;
5018    return this;
5019  }
5020
5021  /**
5022   * @return Indicates the level of authority/intentionality associated with the
5023   *         request and where the request fits into the workflow chain.
5024   */
5025  public RequestIntent getIntent() {
5026    return this.intent == null ? null : this.intent.getValue();
5027  }
5028
5029  /**
5030   * @param value Indicates the level of authority/intentionality associated with
5031   *              the request and where the request fits into the workflow chain.
5032   */
5033  public RequestGroup setIntent(RequestIntent value) {
5034    if (this.intent == null)
5035      this.intent = new Enumeration<RequestIntent>(new RequestIntentEnumFactory());
5036    this.intent.setValue(value);
5037    return this;
5038  }
5039
5040  /**
5041   * @return {@link #priority} (Indicates how quickly the request should be
5042   *         addressed with respect to other requests.). This is the underlying
5043   *         object with id, value and extensions. The accessor "getPriority"
5044   *         gives direct access to the value
5045   */
5046  public Enumeration<RequestPriority> getPriorityElement() {
5047    if (this.priority == null)
5048      if (Configuration.errorOnAutoCreate())
5049        throw new Error("Attempt to auto-create RequestGroup.priority");
5050      else if (Configuration.doAutoCreate())
5051        this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory()); // bb
5052    return this.priority;
5053  }
5054
5055  public boolean hasPriorityElement() {
5056    return this.priority != null && !this.priority.isEmpty();
5057  }
5058
5059  public boolean hasPriority() {
5060    return this.priority != null && !this.priority.isEmpty();
5061  }
5062
5063  /**
5064   * @param value {@link #priority} (Indicates how quickly the request should be
5065   *              addressed with respect to other requests.). This is the
5066   *              underlying object with id, value and extensions. The accessor
5067   *              "getPriority" gives direct access to the value
5068   */
5069  public RequestGroup setPriorityElement(Enumeration<RequestPriority> value) {
5070    this.priority = value;
5071    return this;
5072  }
5073
5074  /**
5075   * @return Indicates how quickly the request should be addressed with respect to
5076   *         other requests.
5077   */
5078  public RequestPriority getPriority() {
5079    return this.priority == null ? null : this.priority.getValue();
5080  }
5081
5082  /**
5083   * @param value Indicates how quickly the request should be addressed with
5084   *              respect to other requests.
5085   */
5086  public RequestGroup setPriority(RequestPriority value) {
5087    if (value == null)
5088      this.priority = null;
5089    else {
5090      if (this.priority == null)
5091        this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory());
5092      this.priority.setValue(value);
5093    }
5094    return this;
5095  }
5096
5097  /**
5098   * @return {@link #code} (A code that identifies what the overall request group
5099   *         is.)
5100   */
5101  public CodeableConcept getCode() {
5102    if (this.code == null)
5103      if (Configuration.errorOnAutoCreate())
5104        throw new Error("Attempt to auto-create RequestGroup.code");
5105      else if (Configuration.doAutoCreate())
5106        this.code = new CodeableConcept(); // cc
5107    return this.code;
5108  }
5109
5110  public boolean hasCode() {
5111    return this.code != null && !this.code.isEmpty();
5112  }
5113
5114  /**
5115   * @param value {@link #code} (A code that identifies what the overall request
5116   *              group is.)
5117   */
5118  public RequestGroup setCode(CodeableConcept value) {
5119    this.code = value;
5120    return this;
5121  }
5122
5123  /**
5124   * @return {@link #subject} (The subject for which the request group was
5125   *         created.)
5126   */
5127  public Reference getSubject() {
5128    if (this.subject == null)
5129      if (Configuration.errorOnAutoCreate())
5130        throw new Error("Attempt to auto-create RequestGroup.subject");
5131      else if (Configuration.doAutoCreate())
5132        this.subject = new Reference(); // cc
5133    return this.subject;
5134  }
5135
5136  public boolean hasSubject() {
5137    return this.subject != null && !this.subject.isEmpty();
5138  }
5139
5140  /**
5141   * @param value {@link #subject} (The subject for which the request group was
5142   *              created.)
5143   */
5144  public RequestGroup setSubject(Reference value) {
5145    this.subject = value;
5146    return this;
5147  }
5148
5149  /**
5150   * @return {@link #subject} The actual object that is the target of the
5151   *         reference. The reference library doesn't populate this, but you can
5152   *         use it to hold the resource if you resolve it. (The subject for which
5153   *         the request group was created.)
5154   */
5155  public Resource getSubjectTarget() {
5156    return this.subjectTarget;
5157  }
5158
5159  /**
5160   * @param value {@link #subject} The actual object that is the target of the
5161   *              reference. The reference library doesn't use these, but you can
5162   *              use it to hold the resource if you resolve it. (The subject for
5163   *              which the request group was created.)
5164   */
5165  public RequestGroup setSubjectTarget(Resource value) {
5166    this.subjectTarget = value;
5167    return this;
5168  }
5169
5170  /**
5171   * @return {@link #encounter} (Describes the context of the request group, if
5172   *         any.)
5173   */
5174  public Reference getEncounter() {
5175    if (this.encounter == null)
5176      if (Configuration.errorOnAutoCreate())
5177        throw new Error("Attempt to auto-create RequestGroup.encounter");
5178      else if (Configuration.doAutoCreate())
5179        this.encounter = new Reference(); // cc
5180    return this.encounter;
5181  }
5182
5183  public boolean hasEncounter() {
5184    return this.encounter != null && !this.encounter.isEmpty();
5185  }
5186
5187  /**
5188   * @param value {@link #encounter} (Describes the context of the request group,
5189   *              if any.)
5190   */
5191  public RequestGroup setEncounter(Reference value) {
5192    this.encounter = value;
5193    return this;
5194  }
5195
5196  /**
5197   * @return {@link #encounter} The actual object that is the target of the
5198   *         reference. The reference library doesn't populate this, but you can
5199   *         use it to hold the resource if you resolve it. (Describes the context
5200   *         of the request group, if any.)
5201   */
5202  public Encounter getEncounterTarget() {
5203    if (this.encounterTarget == null)
5204      if (Configuration.errorOnAutoCreate())
5205        throw new Error("Attempt to auto-create RequestGroup.encounter");
5206      else if (Configuration.doAutoCreate())
5207        this.encounterTarget = new Encounter(); // aa
5208    return this.encounterTarget;
5209  }
5210
5211  /**
5212   * @param value {@link #encounter} The actual object that is the target of the
5213   *              reference. The reference library doesn't use these, but you can
5214   *              use it to hold the resource if you resolve it. (Describes the
5215   *              context of the request group, if any.)
5216   */
5217  public RequestGroup setEncounterTarget(Encounter value) {
5218    this.encounterTarget = value;
5219    return this;
5220  }
5221
5222  /**
5223   * @return {@link #authoredOn} (Indicates when the request group was created.).
5224   *         This is the underlying object with id, value and extensions. The
5225   *         accessor "getAuthoredOn" gives direct access to the value
5226   */
5227  public DateTimeType getAuthoredOnElement() {
5228    if (this.authoredOn == null)
5229      if (Configuration.errorOnAutoCreate())
5230        throw new Error("Attempt to auto-create RequestGroup.authoredOn");
5231      else if (Configuration.doAutoCreate())
5232        this.authoredOn = new DateTimeType(); // bb
5233    return this.authoredOn;
5234  }
5235
5236  public boolean hasAuthoredOnElement() {
5237    return this.authoredOn != null && !this.authoredOn.isEmpty();
5238  }
5239
5240  public boolean hasAuthoredOn() {
5241    return this.authoredOn != null && !this.authoredOn.isEmpty();
5242  }
5243
5244  /**
5245   * @param value {@link #authoredOn} (Indicates when the request group was
5246   *              created.). This is the underlying object with id, value and
5247   *              extensions. The accessor "getAuthoredOn" gives direct access to
5248   *              the value
5249   */
5250  public RequestGroup setAuthoredOnElement(DateTimeType value) {
5251    this.authoredOn = value;
5252    return this;
5253  }
5254
5255  /**
5256   * @return Indicates when the request group was created.
5257   */
5258  public Date getAuthoredOn() {
5259    return this.authoredOn == null ? null : this.authoredOn.getValue();
5260  }
5261
5262  /**
5263   * @param value Indicates when the request group was created.
5264   */
5265  public RequestGroup setAuthoredOn(Date value) {
5266    if (value == null)
5267      this.authoredOn = null;
5268    else {
5269      if (this.authoredOn == null)
5270        this.authoredOn = new DateTimeType();
5271      this.authoredOn.setValue(value);
5272    }
5273    return this;
5274  }
5275
5276  /**
5277   * @return {@link #author} (Provides a reference to the author of the request
5278   *         group.)
5279   */
5280  public Reference getAuthor() {
5281    if (this.author == null)
5282      if (Configuration.errorOnAutoCreate())
5283        throw new Error("Attempt to auto-create RequestGroup.author");
5284      else if (Configuration.doAutoCreate())
5285        this.author = new Reference(); // cc
5286    return this.author;
5287  }
5288
5289  public boolean hasAuthor() {
5290    return this.author != null && !this.author.isEmpty();
5291  }
5292
5293  /**
5294   * @param value {@link #author} (Provides a reference to the author of the
5295   *              request group.)
5296   */
5297  public RequestGroup setAuthor(Reference value) {
5298    this.author = value;
5299    return this;
5300  }
5301
5302  /**
5303   * @return {@link #author} The actual object that is the target of the
5304   *         reference. The reference library doesn't populate this, but you can
5305   *         use it to hold the resource if you resolve it. (Provides a reference
5306   *         to the author of the request group.)
5307   */
5308  public Resource getAuthorTarget() {
5309    return this.authorTarget;
5310  }
5311
5312  /**
5313   * @param value {@link #author} The actual object that is the target of the
5314   *              reference. The reference library doesn't use these, but you can
5315   *              use it to hold the resource if you resolve it. (Provides a
5316   *              reference to the author of the request group.)
5317   */
5318  public RequestGroup setAuthorTarget(Resource value) {
5319    this.authorTarget = value;
5320    return this;
5321  }
5322
5323  /**
5324   * @return {@link #reasonCode} (Describes the reason for the request group in
5325   *         coded or textual form.)
5326   */
5327  public List<CodeableConcept> getReasonCode() {
5328    if (this.reasonCode == null)
5329      this.reasonCode = new ArrayList<CodeableConcept>();
5330    return this.reasonCode;
5331  }
5332
5333  /**
5334   * @return Returns a reference to <code>this</code> for easy method chaining
5335   */
5336  public RequestGroup setReasonCode(List<CodeableConcept> theReasonCode) {
5337    this.reasonCode = theReasonCode;
5338    return this;
5339  }
5340
5341  public boolean hasReasonCode() {
5342    if (this.reasonCode == null)
5343      return false;
5344    for (CodeableConcept item : this.reasonCode)
5345      if (!item.isEmpty())
5346        return true;
5347    return false;
5348  }
5349
5350  public CodeableConcept addReasonCode() { // 3
5351    CodeableConcept t = new CodeableConcept();
5352    if (this.reasonCode == null)
5353      this.reasonCode = new ArrayList<CodeableConcept>();
5354    this.reasonCode.add(t);
5355    return t;
5356  }
5357
5358  public RequestGroup addReasonCode(CodeableConcept t) { // 3
5359    if (t == null)
5360      return this;
5361    if (this.reasonCode == null)
5362      this.reasonCode = new ArrayList<CodeableConcept>();
5363    this.reasonCode.add(t);
5364    return this;
5365  }
5366
5367  /**
5368   * @return The first repetition of repeating field {@link #reasonCode}, creating
5369   *         it if it does not already exist
5370   */
5371  public CodeableConcept getReasonCodeFirstRep() {
5372    if (getReasonCode().isEmpty()) {
5373      addReasonCode();
5374    }
5375    return getReasonCode().get(0);
5376  }
5377
5378  /**
5379   * @return {@link #reasonReference} (Indicates another resource whose existence
5380   *         justifies this request group.)
5381   */
5382  public List<Reference> getReasonReference() {
5383    if (this.reasonReference == null)
5384      this.reasonReference = new ArrayList<Reference>();
5385    return this.reasonReference;
5386  }
5387
5388  /**
5389   * @return Returns a reference to <code>this</code> for easy method chaining
5390   */
5391  public RequestGroup setReasonReference(List<Reference> theReasonReference) {
5392    this.reasonReference = theReasonReference;
5393    return this;
5394  }
5395
5396  public boolean hasReasonReference() {
5397    if (this.reasonReference == null)
5398      return false;
5399    for (Reference item : this.reasonReference)
5400      if (!item.isEmpty())
5401        return true;
5402    return false;
5403  }
5404
5405  public Reference addReasonReference() { // 3
5406    Reference t = new Reference();
5407    if (this.reasonReference == null)
5408      this.reasonReference = new ArrayList<Reference>();
5409    this.reasonReference.add(t);
5410    return t;
5411  }
5412
5413  public RequestGroup addReasonReference(Reference t) { // 3
5414    if (t == null)
5415      return this;
5416    if (this.reasonReference == null)
5417      this.reasonReference = new ArrayList<Reference>();
5418    this.reasonReference.add(t);
5419    return this;
5420  }
5421
5422  /**
5423   * @return The first repetition of repeating field {@link #reasonReference},
5424   *         creating it if it does not already exist
5425   */
5426  public Reference getReasonReferenceFirstRep() {
5427    if (getReasonReference().isEmpty()) {
5428      addReasonReference();
5429    }
5430    return getReasonReference().get(0);
5431  }
5432
5433  /**
5434   * @deprecated Use Reference#setResource(IBaseResource) instead
5435   */
5436  @Deprecated
5437  public List<Resource> getReasonReferenceTarget() {
5438    if (this.reasonReferenceTarget == null)
5439      this.reasonReferenceTarget = new ArrayList<Resource>();
5440    return this.reasonReferenceTarget;
5441  }
5442
5443  /**
5444   * @return {@link #note} (Provides a mechanism to communicate additional
5445   *         information about the response.)
5446   */
5447  public List<Annotation> getNote() {
5448    if (this.note == null)
5449      this.note = new ArrayList<Annotation>();
5450    return this.note;
5451  }
5452
5453  /**
5454   * @return Returns a reference to <code>this</code> for easy method chaining
5455   */
5456  public RequestGroup setNote(List<Annotation> theNote) {
5457    this.note = theNote;
5458    return this;
5459  }
5460
5461  public boolean hasNote() {
5462    if (this.note == null)
5463      return false;
5464    for (Annotation item : this.note)
5465      if (!item.isEmpty())
5466        return true;
5467    return false;
5468  }
5469
5470  public Annotation addNote() { // 3
5471    Annotation t = new Annotation();
5472    if (this.note == null)
5473      this.note = new ArrayList<Annotation>();
5474    this.note.add(t);
5475    return t;
5476  }
5477
5478  public RequestGroup addNote(Annotation t) { // 3
5479    if (t == null)
5480      return this;
5481    if (this.note == null)
5482      this.note = new ArrayList<Annotation>();
5483    this.note.add(t);
5484    return this;
5485  }
5486
5487  /**
5488   * @return The first repetition of repeating field {@link #note}, creating it if
5489   *         it does not already exist
5490   */
5491  public Annotation getNoteFirstRep() {
5492    if (getNote().isEmpty()) {
5493      addNote();
5494    }
5495    return getNote().get(0);
5496  }
5497
5498  /**
5499   * @return {@link #action} (The actions, if any, produced by the evaluation of
5500   *         the artifact.)
5501   */
5502  public List<RequestGroupActionComponent> getAction() {
5503    if (this.action == null)
5504      this.action = new ArrayList<RequestGroupActionComponent>();
5505    return this.action;
5506  }
5507
5508  /**
5509   * @return Returns a reference to <code>this</code> for easy method chaining
5510   */
5511  public RequestGroup setAction(List<RequestGroupActionComponent> theAction) {
5512    this.action = theAction;
5513    return this;
5514  }
5515
5516  public boolean hasAction() {
5517    if (this.action == null)
5518      return false;
5519    for (RequestGroupActionComponent item : this.action)
5520      if (!item.isEmpty())
5521        return true;
5522    return false;
5523  }
5524
5525  public RequestGroupActionComponent addAction() { // 3
5526    RequestGroupActionComponent t = new RequestGroupActionComponent();
5527    if (this.action == null)
5528      this.action = new ArrayList<RequestGroupActionComponent>();
5529    this.action.add(t);
5530    return t;
5531  }
5532
5533  public RequestGroup addAction(RequestGroupActionComponent t) { // 3
5534    if (t == null)
5535      return this;
5536    if (this.action == null)
5537      this.action = new ArrayList<RequestGroupActionComponent>();
5538    this.action.add(t);
5539    return this;
5540  }
5541
5542  /**
5543   * @return The first repetition of repeating field {@link #action}, creating it
5544   *         if it does not already exist
5545   */
5546  public RequestGroupActionComponent getActionFirstRep() {
5547    if (getAction().isEmpty()) {
5548      addAction();
5549    }
5550    return getAction().get(0);
5551  }
5552
5553  protected void listChildren(List<Property> children) {
5554    super.listChildren(children);
5555    children.add(new Property("identifier", "Identifier",
5556        "Allows a service to provide a unique, business identifier for the request.", 0, java.lang.Integer.MAX_VALUE,
5557        identifier));
5558    children.add(new Property("instantiatesCanonical", "canonical",
5559        "A canonical URL referencing a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.",
5560        0, java.lang.Integer.MAX_VALUE, instantiatesCanonical));
5561    children.add(new Property("instantiatesUri", "uri",
5562        "A URL referencing an externally defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.",
5563        0, java.lang.Integer.MAX_VALUE, instantiatesUri));
5564    children.add(new Property("basedOn", "Reference(Any)",
5565        "A plan, proposal or order that is fulfilled in whole or in part by this request.", 0,
5566        java.lang.Integer.MAX_VALUE, basedOn));
5567    children.add(new Property("replaces", "Reference(Any)",
5568        "Completed or terminated request(s) whose function is taken by this new request.", 0,
5569        java.lang.Integer.MAX_VALUE, replaces));
5570    children.add(new Property("groupIdentifier", "Identifier",
5571        "A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form.",
5572        0, 1, groupIdentifier));
5573    children.add(new Property("status", "code",
5574        "The current state of the request. For request groups, the status reflects the status of all the requests in the group.",
5575        0, 1, status));
5576    children.add(new Property("intent", "code",
5577        "Indicates the level of authority/intentionality associated with the request and where the request fits into the workflow chain.",
5578        0, 1, intent));
5579    children.add(new Property("priority", "code",
5580        "Indicates how quickly the request should be addressed with respect to other requests.", 0, 1, priority));
5581    children.add(new Property("code", "CodeableConcept", "A code that identifies what the overall request group is.", 0,
5582        1, code));
5583    children.add(new Property("subject", "Reference(Patient|Group)",
5584        "The subject for which the request group was created.", 0, 1, subject));
5585    children.add(new Property("encounter", "Reference(Encounter)",
5586        "Describes the context of the request group, if any.", 0, 1, encounter));
5587    children
5588        .add(new Property("authoredOn", "dateTime", "Indicates when the request group was created.", 0, 1, authoredOn));
5589    children.add(new Property("author", "Reference(Device|Practitioner|PractitionerRole)",
5590        "Provides a reference to the author of the request group.", 0, 1, author));
5591    children.add(new Property("reasonCode", "CodeableConcept",
5592        "Describes the reason for the request group in coded or textual form.", 0, java.lang.Integer.MAX_VALUE,
5593        reasonCode));
5594    children.add(new Property("reasonReference", "Reference(Condition|Observation|DiagnosticReport|DocumentReference)",
5595        "Indicates another resource whose existence justifies this request group.", 0, java.lang.Integer.MAX_VALUE,
5596        reasonReference));
5597    children.add(new Property("note", "Annotation",
5598        "Provides a mechanism to communicate additional information about the response.", 0,
5599        java.lang.Integer.MAX_VALUE, note));
5600    children.add(new Property("action", "", "The actions, if any, produced by the evaluation of the artifact.", 0,
5601        java.lang.Integer.MAX_VALUE, action));
5602  }
5603
5604  @Override
5605  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5606    switch (_hash) {
5607    case -1618432855:
5608      /* identifier */ return new Property("identifier", "Identifier",
5609          "Allows a service to provide a unique, business identifier for the request.", 0, java.lang.Integer.MAX_VALUE,
5610          identifier);
5611    case 8911915:
5612      /* instantiatesCanonical */ return new Property("instantiatesCanonical", "canonical",
5613          "A canonical URL referencing a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.",
5614          0, java.lang.Integer.MAX_VALUE, instantiatesCanonical);
5615    case -1926393373:
5616      /* instantiatesUri */ return new Property("instantiatesUri", "uri",
5617          "A URL referencing an externally defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.",
5618          0, java.lang.Integer.MAX_VALUE, instantiatesUri);
5619    case -332612366:
5620      /* basedOn */ return new Property("basedOn", "Reference(Any)",
5621          "A plan, proposal or order that is fulfilled in whole or in part by this request.", 0,
5622          java.lang.Integer.MAX_VALUE, basedOn);
5623    case -430332865:
5624      /* replaces */ return new Property("replaces", "Reference(Any)",
5625          "Completed or terminated request(s) whose function is taken by this new request.", 0,
5626          java.lang.Integer.MAX_VALUE, replaces);
5627    case -445338488:
5628      /* groupIdentifier */ return new Property("groupIdentifier", "Identifier",
5629          "A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form.",
5630          0, 1, groupIdentifier);
5631    case -892481550:
5632      /* status */ return new Property("status", "code",
5633          "The current state of the request. For request groups, the status reflects the status of all the requests in the group.",
5634          0, 1, status);
5635    case -1183762788:
5636      /* intent */ return new Property("intent", "code",
5637          "Indicates the level of authority/intentionality associated with the request and where the request fits into the workflow chain.",
5638          0, 1, intent);
5639    case -1165461084:
5640      /* priority */ return new Property("priority", "code",
5641          "Indicates how quickly the request should be addressed with respect to other requests.", 0, 1, priority);
5642    case 3059181:
5643      /* code */ return new Property("code", "CodeableConcept",
5644          "A code that identifies what the overall request group is.", 0, 1, code);
5645    case -1867885268:
5646      /* subject */ return new Property("subject", "Reference(Patient|Group)",
5647          "The subject for which the request group was created.", 0, 1, subject);
5648    case 1524132147:
5649      /* encounter */ return new Property("encounter", "Reference(Encounter)",
5650          "Describes the context of the request group, if any.", 0, 1, encounter);
5651    case -1500852503:
5652      /* authoredOn */ return new Property("authoredOn", "dateTime", "Indicates when the request group was created.", 0,
5653          1, authoredOn);
5654    case -1406328437:
5655      /* author */ return new Property("author", "Reference(Device|Practitioner|PractitionerRole)",
5656          "Provides a reference to the author of the request group.", 0, 1, author);
5657    case 722137681:
5658      /* reasonCode */ return new Property("reasonCode", "CodeableConcept",
5659          "Describes the reason for the request group in coded or textual form.", 0, java.lang.Integer.MAX_VALUE,
5660          reasonCode);
5661    case -1146218137:
5662      /* reasonReference */ return new Property("reasonReference",
5663          "Reference(Condition|Observation|DiagnosticReport|DocumentReference)",
5664          "Indicates another resource whose existence justifies this request group.", 0, java.lang.Integer.MAX_VALUE,
5665          reasonReference);
5666    case 3387378:
5667      /* note */ return new Property("note", "Annotation",
5668          "Provides a mechanism to communicate additional information about the response.", 0,
5669          java.lang.Integer.MAX_VALUE, note);
5670    case -1422950858:
5671      /* action */ return new Property("action", "", "The actions, if any, produced by the evaluation of the artifact.",
5672          0, java.lang.Integer.MAX_VALUE, action);
5673    default:
5674      return super.getNamedProperty(_hash, _name, _checkValid);
5675    }
5676
5677  }
5678
5679  @Override
5680  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5681    switch (hash) {
5682    case -1618432855:
5683      /* identifier */ return this.identifier == null ? new Base[0]
5684          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
5685    case 8911915:
5686      /* instantiatesCanonical */ return this.instantiatesCanonical == null ? new Base[0]
5687          : this.instantiatesCanonical.toArray(new Base[this.instantiatesCanonical.size()]); // CanonicalType
5688    case -1926393373:
5689      /* instantiatesUri */ return this.instantiatesUri == null ? new Base[0]
5690          : this.instantiatesUri.toArray(new Base[this.instantiatesUri.size()]); // UriType
5691    case -332612366:
5692      /* basedOn */ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
5693    case -430332865:
5694      /* replaces */ return this.replaces == null ? new Base[0] : this.replaces.toArray(new Base[this.replaces.size()]); // Reference
5695    case -445338488:
5696      /* groupIdentifier */ return this.groupIdentifier == null ? new Base[0] : new Base[] { this.groupIdentifier }; // Identifier
5697    case -892481550:
5698      /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // Enumeration<RequestStatus>
5699    case -1183762788:
5700      /* intent */ return this.intent == null ? new Base[0] : new Base[] { this.intent }; // Enumeration<RequestIntent>
5701    case -1165461084:
5702      /* priority */ return this.priority == null ? new Base[0] : new Base[] { this.priority }; // Enumeration<RequestPriority>
5703    case 3059181:
5704      /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeableConcept
5705    case -1867885268:
5706      /* subject */ return this.subject == null ? new Base[0] : new Base[] { this.subject }; // Reference
5707    case 1524132147:
5708      /* encounter */ return this.encounter == null ? new Base[0] : new Base[] { this.encounter }; // Reference
5709    case -1500852503:
5710      /* authoredOn */ return this.authoredOn == null ? new Base[0] : new Base[] { this.authoredOn }; // DateTimeType
5711    case -1406328437:
5712      /* author */ return this.author == null ? new Base[0] : new Base[] { this.author }; // Reference
5713    case 722137681:
5714      /* reasonCode */ return this.reasonCode == null ? new Base[0]
5715          : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
5716    case -1146218137:
5717      /* reasonReference */ return this.reasonReference == null ? new Base[0]
5718          : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
5719    case 3387378:
5720      /* note */ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
5721    case -1422950858:
5722      /* action */ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // RequestGroupActionComponent
5723    default:
5724      return super.getProperty(hash, name, checkValid);
5725    }
5726
5727  }
5728
5729  @Override
5730  public Base setProperty(int hash, String name, Base value) throws FHIRException {
5731    switch (hash) {
5732    case -1618432855: // identifier
5733      this.getIdentifier().add(castToIdentifier(value)); // Identifier
5734      return value;
5735    case 8911915: // instantiatesCanonical
5736      this.getInstantiatesCanonical().add(castToCanonical(value)); // CanonicalType
5737      return value;
5738    case -1926393373: // instantiatesUri
5739      this.getInstantiatesUri().add(castToUri(value)); // UriType
5740      return value;
5741    case -332612366: // basedOn
5742      this.getBasedOn().add(castToReference(value)); // Reference
5743      return value;
5744    case -430332865: // replaces
5745      this.getReplaces().add(castToReference(value)); // Reference
5746      return value;
5747    case -445338488: // groupIdentifier
5748      this.groupIdentifier = castToIdentifier(value); // Identifier
5749      return value;
5750    case -892481550: // status
5751      value = new RequestStatusEnumFactory().fromType(castToCode(value));
5752      this.status = (Enumeration) value; // Enumeration<RequestStatus>
5753      return value;
5754    case -1183762788: // intent
5755      value = new RequestIntentEnumFactory().fromType(castToCode(value));
5756      this.intent = (Enumeration) value; // Enumeration<RequestIntent>
5757      return value;
5758    case -1165461084: // priority
5759      value = new RequestPriorityEnumFactory().fromType(castToCode(value));
5760      this.priority = (Enumeration) value; // Enumeration<RequestPriority>
5761      return value;
5762    case 3059181: // code
5763      this.code = castToCodeableConcept(value); // CodeableConcept
5764      return value;
5765    case -1867885268: // subject
5766      this.subject = castToReference(value); // Reference
5767      return value;
5768    case 1524132147: // encounter
5769      this.encounter = castToReference(value); // Reference
5770      return value;
5771    case -1500852503: // authoredOn
5772      this.authoredOn = castToDateTime(value); // DateTimeType
5773      return value;
5774    case -1406328437: // author
5775      this.author = castToReference(value); // Reference
5776      return value;
5777    case 722137681: // reasonCode
5778      this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
5779      return value;
5780    case -1146218137: // reasonReference
5781      this.getReasonReference().add(castToReference(value)); // Reference
5782      return value;
5783    case 3387378: // note
5784      this.getNote().add(castToAnnotation(value)); // Annotation
5785      return value;
5786    case -1422950858: // action
5787      this.getAction().add((RequestGroupActionComponent) value); // RequestGroupActionComponent
5788      return value;
5789    default:
5790      return super.setProperty(hash, name, value);
5791    }
5792
5793  }
5794
5795  @Override
5796  public Base setProperty(String name, Base value) throws FHIRException {
5797    if (name.equals("identifier")) {
5798      this.getIdentifier().add(castToIdentifier(value));
5799    } else if (name.equals("instantiatesCanonical")) {
5800      this.getInstantiatesCanonical().add(castToCanonical(value));
5801    } else if (name.equals("instantiatesUri")) {
5802      this.getInstantiatesUri().add(castToUri(value));
5803    } else if (name.equals("basedOn")) {
5804      this.getBasedOn().add(castToReference(value));
5805    } else if (name.equals("replaces")) {
5806      this.getReplaces().add(castToReference(value));
5807    } else if (name.equals("groupIdentifier")) {
5808      this.groupIdentifier = castToIdentifier(value); // Identifier
5809    } else if (name.equals("status")) {
5810      value = new RequestStatusEnumFactory().fromType(castToCode(value));
5811      this.status = (Enumeration) value; // Enumeration<RequestStatus>
5812    } else if (name.equals("intent")) {
5813      value = new RequestIntentEnumFactory().fromType(castToCode(value));
5814      this.intent = (Enumeration) value; // Enumeration<RequestIntent>
5815    } else if (name.equals("priority")) {
5816      value = new RequestPriorityEnumFactory().fromType(castToCode(value));
5817      this.priority = (Enumeration) value; // Enumeration<RequestPriority>
5818    } else if (name.equals("code")) {
5819      this.code = castToCodeableConcept(value); // CodeableConcept
5820    } else if (name.equals("subject")) {
5821      this.subject = castToReference(value); // Reference
5822    } else if (name.equals("encounter")) {
5823      this.encounter = castToReference(value); // Reference
5824    } else if (name.equals("authoredOn")) {
5825      this.authoredOn = castToDateTime(value); // DateTimeType
5826    } else if (name.equals("author")) {
5827      this.author = castToReference(value); // Reference
5828    } else if (name.equals("reasonCode")) {
5829      this.getReasonCode().add(castToCodeableConcept(value));
5830    } else if (name.equals("reasonReference")) {
5831      this.getReasonReference().add(castToReference(value));
5832    } else if (name.equals("note")) {
5833      this.getNote().add(castToAnnotation(value));
5834    } else if (name.equals("action")) {
5835      this.getAction().add((RequestGroupActionComponent) value);
5836    } else
5837      return super.setProperty(name, value);
5838    return value;
5839  }
5840
5841  @Override
5842  public Base makeProperty(int hash, String name) throws FHIRException {
5843    switch (hash) {
5844    case -1618432855:
5845      return addIdentifier();
5846    case 8911915:
5847      return addInstantiatesCanonicalElement();
5848    case -1926393373:
5849      return addInstantiatesUriElement();
5850    case -332612366:
5851      return addBasedOn();
5852    case -430332865:
5853      return addReplaces();
5854    case -445338488:
5855      return getGroupIdentifier();
5856    case -892481550:
5857      return getStatusElement();
5858    case -1183762788:
5859      return getIntentElement();
5860    case -1165461084:
5861      return getPriorityElement();
5862    case 3059181:
5863      return getCode();
5864    case -1867885268:
5865      return getSubject();
5866    case 1524132147:
5867      return getEncounter();
5868    case -1500852503:
5869      return getAuthoredOnElement();
5870    case -1406328437:
5871      return getAuthor();
5872    case 722137681:
5873      return addReasonCode();
5874    case -1146218137:
5875      return addReasonReference();
5876    case 3387378:
5877      return addNote();
5878    case -1422950858:
5879      return addAction();
5880    default:
5881      return super.makeProperty(hash, name);
5882    }
5883
5884  }
5885
5886  @Override
5887  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5888    switch (hash) {
5889    case -1618432855:
5890      /* identifier */ return new String[] { "Identifier" };
5891    case 8911915:
5892      /* instantiatesCanonical */ return new String[] { "canonical" };
5893    case -1926393373:
5894      /* instantiatesUri */ return new String[] { "uri" };
5895    case -332612366:
5896      /* basedOn */ return new String[] { "Reference" };
5897    case -430332865:
5898      /* replaces */ return new String[] { "Reference" };
5899    case -445338488:
5900      /* groupIdentifier */ return new String[] { "Identifier" };
5901    case -892481550:
5902      /* status */ return new String[] { "code" };
5903    case -1183762788:
5904      /* intent */ return new String[] { "code" };
5905    case -1165461084:
5906      /* priority */ return new String[] { "code" };
5907    case 3059181:
5908      /* code */ return new String[] { "CodeableConcept" };
5909    case -1867885268:
5910      /* subject */ return new String[] { "Reference" };
5911    case 1524132147:
5912      /* encounter */ return new String[] { "Reference" };
5913    case -1500852503:
5914      /* authoredOn */ return new String[] { "dateTime" };
5915    case -1406328437:
5916      /* author */ return new String[] { "Reference" };
5917    case 722137681:
5918      /* reasonCode */ return new String[] { "CodeableConcept" };
5919    case -1146218137:
5920      /* reasonReference */ return new String[] { "Reference" };
5921    case 3387378:
5922      /* note */ return new String[] { "Annotation" };
5923    case -1422950858:
5924      /* action */ return new String[] {};
5925    default:
5926      return super.getTypesForProperty(hash, name);
5927    }
5928
5929  }
5930
5931  @Override
5932  public Base addChild(String name) throws FHIRException {
5933    if (name.equals("identifier")) {
5934      return addIdentifier();
5935    } else if (name.equals("instantiatesCanonical")) {
5936      throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.instantiatesCanonical");
5937    } else if (name.equals("instantiatesUri")) {
5938      throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.instantiatesUri");
5939    } else if (name.equals("basedOn")) {
5940      return addBasedOn();
5941    } else if (name.equals("replaces")) {
5942      return addReplaces();
5943    } else if (name.equals("groupIdentifier")) {
5944      this.groupIdentifier = new Identifier();
5945      return this.groupIdentifier;
5946    } else if (name.equals("status")) {
5947      throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.status");
5948    } else if (name.equals("intent")) {
5949      throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.intent");
5950    } else if (name.equals("priority")) {
5951      throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.priority");
5952    } else if (name.equals("code")) {
5953      this.code = new CodeableConcept();
5954      return this.code;
5955    } else if (name.equals("subject")) {
5956      this.subject = new Reference();
5957      return this.subject;
5958    } else if (name.equals("encounter")) {
5959      this.encounter = new Reference();
5960      return this.encounter;
5961    } else if (name.equals("authoredOn")) {
5962      throw new FHIRException("Cannot call addChild on a singleton property RequestGroup.authoredOn");
5963    } else if (name.equals("author")) {
5964      this.author = new Reference();
5965      return this.author;
5966    } else if (name.equals("reasonCode")) {
5967      return addReasonCode();
5968    } else if (name.equals("reasonReference")) {
5969      return addReasonReference();
5970    } else if (name.equals("note")) {
5971      return addNote();
5972    } else if (name.equals("action")) {
5973      return addAction();
5974    } else
5975      return super.addChild(name);
5976  }
5977
5978  public String fhirType() {
5979    return "RequestGroup";
5980
5981  }
5982
5983  public RequestGroup copy() {
5984    RequestGroup dst = new RequestGroup();
5985    copyValues(dst);
5986    return dst;
5987  }
5988
5989  public void copyValues(RequestGroup dst) {
5990    super.copyValues(dst);
5991    if (identifier != null) {
5992      dst.identifier = new ArrayList<Identifier>();
5993      for (Identifier i : identifier)
5994        dst.identifier.add(i.copy());
5995    }
5996    ;
5997    if (instantiatesCanonical != null) {
5998      dst.instantiatesCanonical = new ArrayList<CanonicalType>();
5999      for (CanonicalType i : instantiatesCanonical)
6000        dst.instantiatesCanonical.add(i.copy());
6001    }
6002    ;
6003    if (instantiatesUri != null) {
6004      dst.instantiatesUri = new ArrayList<UriType>();
6005      for (UriType i : instantiatesUri)
6006        dst.instantiatesUri.add(i.copy());
6007    }
6008    ;
6009    if (basedOn != null) {
6010      dst.basedOn = new ArrayList<Reference>();
6011      for (Reference i : basedOn)
6012        dst.basedOn.add(i.copy());
6013    }
6014    ;
6015    if (replaces != null) {
6016      dst.replaces = new ArrayList<Reference>();
6017      for (Reference i : replaces)
6018        dst.replaces.add(i.copy());
6019    }
6020    ;
6021    dst.groupIdentifier = groupIdentifier == null ? null : groupIdentifier.copy();
6022    dst.status = status == null ? null : status.copy();
6023    dst.intent = intent == null ? null : intent.copy();
6024    dst.priority = priority == null ? null : priority.copy();
6025    dst.code = code == null ? null : code.copy();
6026    dst.subject = subject == null ? null : subject.copy();
6027    dst.encounter = encounter == null ? null : encounter.copy();
6028    dst.authoredOn = authoredOn == null ? null : authoredOn.copy();
6029    dst.author = author == null ? null : author.copy();
6030    if (reasonCode != null) {
6031      dst.reasonCode = new ArrayList<CodeableConcept>();
6032      for (CodeableConcept i : reasonCode)
6033        dst.reasonCode.add(i.copy());
6034    }
6035    ;
6036    if (reasonReference != null) {
6037      dst.reasonReference = new ArrayList<Reference>();
6038      for (Reference i : reasonReference)
6039        dst.reasonReference.add(i.copy());
6040    }
6041    ;
6042    if (note != null) {
6043      dst.note = new ArrayList<Annotation>();
6044      for (Annotation i : note)
6045        dst.note.add(i.copy());
6046    }
6047    ;
6048    if (action != null) {
6049      dst.action = new ArrayList<RequestGroupActionComponent>();
6050      for (RequestGroupActionComponent i : action)
6051        dst.action.add(i.copy());
6052    }
6053    ;
6054  }
6055
6056  protected RequestGroup typedCopy() {
6057    return copy();
6058  }
6059
6060  @Override
6061  public boolean equalsDeep(Base other_) {
6062    if (!super.equalsDeep(other_))
6063      return false;
6064    if (!(other_ instanceof RequestGroup))
6065      return false;
6066    RequestGroup o = (RequestGroup) other_;
6067    return compareDeep(identifier, o.identifier, true)
6068        && compareDeep(instantiatesCanonical, o.instantiatesCanonical, true)
6069        && compareDeep(instantiatesUri, o.instantiatesUri, true) && compareDeep(basedOn, o.basedOn, true)
6070        && compareDeep(replaces, o.replaces, true) && compareDeep(groupIdentifier, o.groupIdentifier, true)
6071        && compareDeep(status, o.status, true) && compareDeep(intent, o.intent, true)
6072        && compareDeep(priority, o.priority, true) && compareDeep(code, o.code, true)
6073        && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true)
6074        && compareDeep(authoredOn, o.authoredOn, true) && compareDeep(author, o.author, true)
6075        && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
6076        && compareDeep(note, o.note, true) && compareDeep(action, o.action, true);
6077  }
6078
6079  @Override
6080  public boolean equalsShallow(Base other_) {
6081    if (!super.equalsShallow(other_))
6082      return false;
6083    if (!(other_ instanceof RequestGroup))
6084      return false;
6085    RequestGroup o = (RequestGroup) other_;
6086    return compareValues(instantiatesCanonical, o.instantiatesCanonical, true)
6087        && compareValues(instantiatesUri, o.instantiatesUri, true) && compareValues(status, o.status, true)
6088        && compareValues(intent, o.intent, true) && compareValues(priority, o.priority, true)
6089        && compareValues(authoredOn, o.authoredOn, true);
6090  }
6091
6092  public boolean isEmpty() {
6093    return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, instantiatesCanonical, instantiatesUri,
6094        basedOn, replaces, groupIdentifier, status, intent, priority, code, subject, encounter, authoredOn, author,
6095        reasonCode, reasonReference, note, action);
6096  }
6097
6098  @Override
6099  public ResourceType getResourceType() {
6100    return ResourceType.RequestGroup;
6101  }
6102
6103  /**
6104   * Search parameter: <b>authored</b>
6105   * <p>
6106   * Description: <b>The date the request group was authored</b><br>
6107   * Type: <b>date</b><br>
6108   * Path: <b>RequestGroup.authoredOn</b><br>
6109   * </p>
6110   */
6111  @SearchParamDefinition(name = "authored", path = "RequestGroup.authoredOn", description = "The date the request group was authored", type = "date")
6112  public static final String SP_AUTHORED = "authored";
6113  /**
6114   * <b>Fluent Client</b> search parameter constant for <b>authored</b>
6115   * <p>
6116   * Description: <b>The date the request group was authored</b><br>
6117   * Type: <b>date</b><br>
6118   * Path: <b>RequestGroup.authoredOn</b><br>
6119   * </p>
6120   */
6121  public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORED = new ca.uhn.fhir.rest.gclient.DateClientParam(
6122      SP_AUTHORED);
6123
6124  /**
6125   * Search parameter: <b>identifier</b>
6126   * <p>
6127   * Description: <b>External identifiers for the request group</b><br>
6128   * Type: <b>token</b><br>
6129   * Path: <b>RequestGroup.identifier</b><br>
6130   * </p>
6131   */
6132  @SearchParamDefinition(name = "identifier", path = "RequestGroup.identifier", description = "External identifiers for the request group", type = "token")
6133  public static final String SP_IDENTIFIER = "identifier";
6134  /**
6135   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
6136   * <p>
6137   * Description: <b>External identifiers for the request group</b><br>
6138   * Type: <b>token</b><br>
6139   * Path: <b>RequestGroup.identifier</b><br>
6140   * </p>
6141   */
6142  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6143      SP_IDENTIFIER);
6144
6145  /**
6146   * Search parameter: <b>code</b>
6147   * <p>
6148   * Description: <b>The code of the request group</b><br>
6149   * Type: <b>token</b><br>
6150   * Path: <b>RequestGroup.code</b><br>
6151   * </p>
6152   */
6153  @SearchParamDefinition(name = "code", path = "RequestGroup.code", description = "The code of the request group", type = "token")
6154  public static final String SP_CODE = "code";
6155  /**
6156   * <b>Fluent Client</b> search parameter constant for <b>code</b>
6157   * <p>
6158   * Description: <b>The code of the request group</b><br>
6159   * Type: <b>token</b><br>
6160   * Path: <b>RequestGroup.code</b><br>
6161   * </p>
6162   */
6163  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6164      SP_CODE);
6165
6166  /**
6167   * Search parameter: <b>subject</b>
6168   * <p>
6169   * Description: <b>The subject that the request group is about</b><br>
6170   * Type: <b>reference</b><br>
6171   * Path: <b>RequestGroup.subject</b><br>
6172   * </p>
6173   */
6174  @SearchParamDefinition(name = "subject", path = "RequestGroup.subject", description = "The subject that the request group is about", type = "reference", providesMembershipIn = {
6175      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Patient") }, target = { Group.class, Patient.class })
6176  public static final String SP_SUBJECT = "subject";
6177  /**
6178   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
6179   * <p>
6180   * Description: <b>The subject that the request group is about</b><br>
6181   * Type: <b>reference</b><br>
6182   * Path: <b>RequestGroup.subject</b><br>
6183   * </p>
6184   */
6185  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
6186      SP_SUBJECT);
6187
6188  /**
6189   * Constant for fluent queries to be used to add include statements. Specifies
6190   * the path value of "<b>RequestGroup:subject</b>".
6191   */
6192  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include(
6193      "RequestGroup:subject").toLocked();
6194
6195  /**
6196   * Search parameter: <b>author</b>
6197   * <p>
6198   * Description: <b>The author of the request group</b><br>
6199   * Type: <b>reference</b><br>
6200   * Path: <b>RequestGroup.author</b><br>
6201   * </p>
6202   */
6203  @SearchParamDefinition(name = "author", path = "RequestGroup.author", description = "The author of the request group", type = "reference", providesMembershipIn = {
6204      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Device"),
6205      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Practitioner") }, target = { Device.class,
6206          Practitioner.class, PractitionerRole.class })
6207  public static final String SP_AUTHOR = "author";
6208  /**
6209   * <b>Fluent Client</b> search parameter constant for <b>author</b>
6210   * <p>
6211   * Description: <b>The author of the request group</b><br>
6212   * Type: <b>reference</b><br>
6213   * Path: <b>RequestGroup.author</b><br>
6214   * </p>
6215   */
6216  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
6217      SP_AUTHOR);
6218
6219  /**
6220   * Constant for fluent queries to be used to add include statements. Specifies
6221   * the path value of "<b>RequestGroup:author</b>".
6222   */
6223  public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include(
6224      "RequestGroup:author").toLocked();
6225
6226  /**
6227   * Search parameter: <b>instantiates-canonical</b>
6228   * <p>
6229   * Description: <b>The FHIR-based definition from which the request group is
6230   * realized</b><br>
6231   * Type: <b>reference</b><br>
6232   * Path: <b>RequestGroup.instantiatesCanonical</b><br>
6233   * </p>
6234   */
6235  @SearchParamDefinition(name = "instantiates-canonical", path = "RequestGroup.instantiatesCanonical", description = "The FHIR-based definition from which the request group is realized", type = "reference")
6236  public static final String SP_INSTANTIATES_CANONICAL = "instantiates-canonical";
6237  /**
6238   * <b>Fluent Client</b> search parameter constant for
6239   * <b>instantiates-canonical</b>
6240   * <p>
6241   * Description: <b>The FHIR-based definition from which the request group is
6242   * realized</b><br>
6243   * Type: <b>reference</b><br>
6244   * Path: <b>RequestGroup.instantiatesCanonical</b><br>
6245   * </p>
6246   */
6247  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSTANTIATES_CANONICAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
6248      SP_INSTANTIATES_CANONICAL);
6249
6250  /**
6251   * Constant for fluent queries to be used to add include statements. Specifies
6252   * the path value of "<b>RequestGroup:instantiates-canonical</b>".
6253   */
6254  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSTANTIATES_CANONICAL = new ca.uhn.fhir.model.api.Include(
6255      "RequestGroup:instantiates-canonical").toLocked();
6256
6257  /**
6258   * Search parameter: <b>encounter</b>
6259   * <p>
6260   * Description: <b>The encounter the request group applies to</b><br>
6261   * Type: <b>reference</b><br>
6262   * Path: <b>RequestGroup.encounter</b><br>
6263   * </p>
6264   */
6265  @SearchParamDefinition(name = "encounter", path = "RequestGroup.encounter", description = "The encounter the request group applies to", type = "reference", providesMembershipIn = {
6266      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Encounter") }, target = { Encounter.class })
6267  public static final String SP_ENCOUNTER = "encounter";
6268  /**
6269   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
6270   * <p>
6271   * Description: <b>The encounter the request group applies to</b><br>
6272   * Type: <b>reference</b><br>
6273   * Path: <b>RequestGroup.encounter</b><br>
6274   * </p>
6275   */
6276  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
6277      SP_ENCOUNTER);
6278
6279  /**
6280   * Constant for fluent queries to be used to add include statements. Specifies
6281   * the path value of "<b>RequestGroup:encounter</b>".
6282   */
6283  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include(
6284      "RequestGroup:encounter").toLocked();
6285
6286  /**
6287   * Search parameter: <b>priority</b>
6288   * <p>
6289   * Description: <b>The priority of the request group</b><br>
6290   * Type: <b>token</b><br>
6291   * Path: <b>RequestGroup.priority</b><br>
6292   * </p>
6293   */
6294  @SearchParamDefinition(name = "priority", path = "RequestGroup.priority", description = "The priority of the request group", type = "token")
6295  public static final String SP_PRIORITY = "priority";
6296  /**
6297   * <b>Fluent Client</b> search parameter constant for <b>priority</b>
6298   * <p>
6299   * Description: <b>The priority of the request group</b><br>
6300   * Type: <b>token</b><br>
6301   * Path: <b>RequestGroup.priority</b><br>
6302   * </p>
6303   */
6304  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6305      SP_PRIORITY);
6306
6307  /**
6308   * Search parameter: <b>intent</b>
6309   * <p>
6310   * Description: <b>The intent of the request group</b><br>
6311   * Type: <b>token</b><br>
6312   * Path: <b>RequestGroup.intent</b><br>
6313   * </p>
6314   */
6315  @SearchParamDefinition(name = "intent", path = "RequestGroup.intent", description = "The intent of the request group", type = "token")
6316  public static final String SP_INTENT = "intent";
6317  /**
6318   * <b>Fluent Client</b> search parameter constant for <b>intent</b>
6319   * <p>
6320   * Description: <b>The intent of the request group</b><br>
6321   * Type: <b>token</b><br>
6322   * Path: <b>RequestGroup.intent</b><br>
6323   * </p>
6324   */
6325  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INTENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6326      SP_INTENT);
6327
6328  /**
6329   * Search parameter: <b>participant</b>
6330   * <p>
6331   * Description: <b>The participant in the requests in the group</b><br>
6332   * Type: <b>reference</b><br>
6333   * Path: <b>RequestGroup.action.participant</b><br>
6334   * </p>
6335   */
6336  @SearchParamDefinition(name = "participant", path = "RequestGroup.action.participant", description = "The participant in the requests in the group", type = "reference", providesMembershipIn = {
6337      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Patient"),
6338      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Practitioner"),
6339      @ca.uhn.fhir.model.api.annotation.Compartment(name = "RelatedPerson") }, target = { Device.class, Patient.class,
6340          Practitioner.class, PractitionerRole.class, RelatedPerson.class })
6341  public static final String SP_PARTICIPANT = "participant";
6342  /**
6343   * <b>Fluent Client</b> search parameter constant for <b>participant</b>
6344   * <p>
6345   * Description: <b>The participant in the requests in the group</b><br>
6346   * Type: <b>reference</b><br>
6347   * Path: <b>RequestGroup.action.participant</b><br>
6348   * </p>
6349   */
6350  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
6351      SP_PARTICIPANT);
6352
6353  /**
6354   * Constant for fluent queries to be used to add include statements. Specifies
6355   * the path value of "<b>RequestGroup:participant</b>".
6356   */
6357  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTICIPANT = new ca.uhn.fhir.model.api.Include(
6358      "RequestGroup:participant").toLocked();
6359
6360  /**
6361   * Search parameter: <b>group-identifier</b>
6362   * <p>
6363   * Description: <b>The group identifier for the request group</b><br>
6364   * Type: <b>token</b><br>
6365   * Path: <b>RequestGroup.groupIdentifier</b><br>
6366   * </p>
6367   */
6368  @SearchParamDefinition(name = "group-identifier", path = "RequestGroup.groupIdentifier", description = "The group identifier for the request group", type = "token")
6369  public static final String SP_GROUP_IDENTIFIER = "group-identifier";
6370  /**
6371   * <b>Fluent Client</b> search parameter constant for <b>group-identifier</b>
6372   * <p>
6373   * Description: <b>The group identifier for the request group</b><br>
6374   * Type: <b>token</b><br>
6375   * Path: <b>RequestGroup.groupIdentifier</b><br>
6376   * </p>
6377   */
6378  public static final ca.uhn.fhir.rest.gclient.TokenClientParam GROUP_IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6379      SP_GROUP_IDENTIFIER);
6380
6381  /**
6382   * Search parameter: <b>patient</b>
6383   * <p>
6384   * Description: <b>The identity of a patient to search for request
6385   * groups</b><br>
6386   * Type: <b>reference</b><br>
6387   * Path: <b>RequestGroup.subject</b><br>
6388   * </p>
6389   */
6390  @SearchParamDefinition(name = "patient", path = "RequestGroup.subject.where(resolve() is Patient)", description = "The identity of a patient to search for request groups", type = "reference", target = {
6391      Patient.class })
6392  public static final String SP_PATIENT = "patient";
6393  /**
6394   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
6395   * <p>
6396   * Description: <b>The identity of a patient to search for request
6397   * groups</b><br>
6398   * Type: <b>reference</b><br>
6399   * Path: <b>RequestGroup.subject</b><br>
6400   * </p>
6401   */
6402  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
6403      SP_PATIENT);
6404
6405  /**
6406   * Constant for fluent queries to be used to add include statements. Specifies
6407   * the path value of "<b>RequestGroup:patient</b>".
6408   */
6409  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include(
6410      "RequestGroup:patient").toLocked();
6411
6412  /**
6413   * Search parameter: <b>instantiates-uri</b>
6414   * <p>
6415   * Description: <b>The external definition from which the request group is
6416   * realized</b><br>
6417   * Type: <b>uri</b><br>
6418   * Path: <b>RequestGroup.instantiatesUri</b><br>
6419   * </p>
6420   */
6421  @SearchParamDefinition(name = "instantiates-uri", path = "RequestGroup.instantiatesUri", description = "The external definition from which the request group is realized", type = "uri")
6422  public static final String SP_INSTANTIATES_URI = "instantiates-uri";
6423  /**
6424   * <b>Fluent Client</b> search parameter constant for <b>instantiates-uri</b>
6425   * <p>
6426   * Description: <b>The external definition from which the request group is
6427   * realized</b><br>
6428   * Type: <b>uri</b><br>
6429   * Path: <b>RequestGroup.instantiatesUri</b><br>
6430   * </p>
6431   */
6432  public static final ca.uhn.fhir.rest.gclient.UriClientParam INSTANTIATES_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(
6433      SP_INSTANTIATES_URI);
6434
6435  /**
6436   * Search parameter: <b>status</b>
6437   * <p>
6438   * Description: <b>The status of the request group</b><br>
6439   * Type: <b>token</b><br>
6440   * Path: <b>RequestGroup.status</b><br>
6441   * </p>
6442   */
6443  @SearchParamDefinition(name = "status", path = "RequestGroup.status", description = "The status of the request group", type = "token")
6444  public static final String SP_STATUS = "status";
6445  /**
6446   * <b>Fluent Client</b> search parameter constant for <b>status</b>
6447   * <p>
6448   * Description: <b>The status of the request group</b><br>
6449   * Type: <b>token</b><br>
6450   * Path: <b>RequestGroup.status</b><br>
6451   * </p>
6452   */
6453  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
6454      SP_STATUS);
6455
6456}