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