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