001package org.hl7.fhir.r4.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import org.hl7.fhir.utilities.Utilities;
040import org.hl7.fhir.r4.model.Enumerations.*;
041import ca.uhn.fhir.model.api.annotation.ResourceDef;
042import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
043import ca.uhn.fhir.model.api.annotation.Child;
044import ca.uhn.fhir.model.api.annotation.ChildOrder;
045import ca.uhn.fhir.model.api.annotation.Description;
046import ca.uhn.fhir.model.api.annotation.Block;
047import org.hl7.fhir.instance.model.api.*;
048import org.hl7.fhir.exceptions.FHIRException;
049/**
050 * This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.
051 */
052@ResourceDef(name="PlanDefinition", profile="http://hl7.org/fhir/StructureDefinition/PlanDefinition")
053@ChildOrder(names={"url", "identifier", "version", "name", "title", "subtitle", "type", "status", "experimental", "subject[x]", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "usage", "copyright", "approvalDate", "lastReviewDate", "effectivePeriod", "topic", "author", "editor", "reviewer", "endorser", "relatedArtifact", "library", "goal", "action"})
054public class PlanDefinition extends MetadataResource {
055
056    public enum RequestPriority {
057        /**
058         * The request has normal priority.
059         */
060        ROUTINE, 
061        /**
062         * The request should be actioned promptly - higher priority than routine.
063         */
064        URGENT, 
065        /**
066         * The request should be actioned as soon as possible - higher priority than urgent.
067         */
068        ASAP, 
069        /**
070         * The request should be actioned immediately - highest possible priority.  E.g. an emergency.
071         */
072        STAT, 
073        /**
074         * added to help the parsers with the generic types
075         */
076        NULL;
077        public static RequestPriority fromCode(String codeString) throws FHIRException {
078            if (codeString == null || "".equals(codeString))
079                return null;
080        if ("routine".equals(codeString))
081          return ROUTINE;
082        if ("urgent".equals(codeString))
083          return URGENT;
084        if ("asap".equals(codeString))
085          return ASAP;
086        if ("stat".equals(codeString))
087          return STAT;
088        if (Configuration.isAcceptInvalidEnums())
089          return null;
090        else
091          throw new FHIRException("Unknown RequestPriority code '"+codeString+"'");
092        }
093        public String toCode() {
094          switch (this) {
095            case ROUTINE: return "routine";
096            case URGENT: return "urgent";
097            case ASAP: return "asap";
098            case STAT: return "stat";
099            default: return "?";
100          }
101        }
102        public String getSystem() {
103          switch (this) {
104            case ROUTINE: return "http://hl7.org/fhir/request-priority";
105            case URGENT: return "http://hl7.org/fhir/request-priority";
106            case ASAP: return "http://hl7.org/fhir/request-priority";
107            case STAT: return "http://hl7.org/fhir/request-priority";
108            default: return "?";
109          }
110        }
111        public String getDefinition() {
112          switch (this) {
113            case ROUTINE: return "The request has normal priority.";
114            case URGENT: return "The request should be actioned promptly - higher priority than routine.";
115            case ASAP: return "The request should be actioned as soon as possible - higher priority than urgent.";
116            case STAT: return "The request should be actioned immediately - highest possible priority.  E.g. an emergency.";
117            default: return "?";
118          }
119        }
120        public String getDisplay() {
121          switch (this) {
122            case ROUTINE: return "Routine";
123            case URGENT: return "Urgent";
124            case ASAP: return "ASAP";
125            case STAT: return "STAT";
126            default: return "?";
127          }
128        }
129    }
130
131  public static class RequestPriorityEnumFactory implements EnumFactory<RequestPriority> {
132    public RequestPriority fromCode(String codeString) throws IllegalArgumentException {
133      if (codeString == null || "".equals(codeString))
134            if (codeString == null || "".equals(codeString))
135                return null;
136        if ("routine".equals(codeString))
137          return RequestPriority.ROUTINE;
138        if ("urgent".equals(codeString))
139          return RequestPriority.URGENT;
140        if ("asap".equals(codeString))
141          return RequestPriority.ASAP;
142        if ("stat".equals(codeString))
143          return RequestPriority.STAT;
144        throw new IllegalArgumentException("Unknown RequestPriority code '"+codeString+"'");
145        }
146        public Enumeration<RequestPriority> fromType(Base code) throws FHIRException {
147          if (code == null)
148            return null;
149          if (code.isEmpty())
150            return new Enumeration<RequestPriority>(this);
151          String codeString = ((PrimitiveType) code).asStringValue();
152          if (codeString == null || "".equals(codeString))
153            return null;
154        if ("routine".equals(codeString))
155          return new Enumeration<RequestPriority>(this, RequestPriority.ROUTINE);
156        if ("urgent".equals(codeString))
157          return new Enumeration<RequestPriority>(this, RequestPriority.URGENT);
158        if ("asap".equals(codeString))
159          return new Enumeration<RequestPriority>(this, RequestPriority.ASAP);
160        if ("stat".equals(codeString))
161          return new Enumeration<RequestPriority>(this, RequestPriority.STAT);
162        throw new FHIRException("Unknown RequestPriority code '"+codeString+"'");
163        }
164    public String toCode(RequestPriority code) {
165      if (code == RequestPriority.ROUTINE)
166        return "routine";
167      if (code == RequestPriority.URGENT)
168        return "urgent";
169      if (code == RequestPriority.ASAP)
170        return "asap";
171      if (code == RequestPriority.STAT)
172        return "stat";
173      return "?";
174      }
175    public String toSystem(RequestPriority code) {
176      return code.getSystem();
177      }
178    }
179
180    public enum ActionConditionKind {
181        /**
182         * The condition describes whether or not a given action is applicable.
183         */
184        APPLICABILITY, 
185        /**
186         * The condition is a starting condition for the action.
187         */
188        START, 
189        /**
190         * The condition is a stop, or exit condition for the action.
191         */
192        STOP, 
193        /**
194         * added to help the parsers with the generic types
195         */
196        NULL;
197        public static ActionConditionKind fromCode(String codeString) throws FHIRException {
198            if (codeString == null || "".equals(codeString))
199                return null;
200        if ("applicability".equals(codeString))
201          return APPLICABILITY;
202        if ("start".equals(codeString))
203          return START;
204        if ("stop".equals(codeString))
205          return STOP;
206        if (Configuration.isAcceptInvalidEnums())
207          return null;
208        else
209          throw new FHIRException("Unknown ActionConditionKind code '"+codeString+"'");
210        }
211        public String toCode() {
212          switch (this) {
213            case APPLICABILITY: return "applicability";
214            case START: return "start";
215            case STOP: return "stop";
216            default: return "?";
217          }
218        }
219        public String getSystem() {
220          switch (this) {
221            case APPLICABILITY: return "http://hl7.org/fhir/action-condition-kind";
222            case START: return "http://hl7.org/fhir/action-condition-kind";
223            case STOP: return "http://hl7.org/fhir/action-condition-kind";
224            default: return "?";
225          }
226        }
227        public String getDefinition() {
228          switch (this) {
229            case APPLICABILITY: return "The condition describes whether or not a given action is applicable.";
230            case START: return "The condition is a starting condition for the action.";
231            case STOP: return "The condition is a stop, or exit condition for the action.";
232            default: return "?";
233          }
234        }
235        public String getDisplay() {
236          switch (this) {
237            case APPLICABILITY: return "Applicability";
238            case START: return "Start";
239            case STOP: return "Stop";
240            default: return "?";
241          }
242        }
243    }
244
245  public static class ActionConditionKindEnumFactory implements EnumFactory<ActionConditionKind> {
246    public ActionConditionKind fromCode(String codeString) throws IllegalArgumentException {
247      if (codeString == null || "".equals(codeString))
248            if (codeString == null || "".equals(codeString))
249                return null;
250        if ("applicability".equals(codeString))
251          return ActionConditionKind.APPLICABILITY;
252        if ("start".equals(codeString))
253          return ActionConditionKind.START;
254        if ("stop".equals(codeString))
255          return ActionConditionKind.STOP;
256        throw new IllegalArgumentException("Unknown ActionConditionKind code '"+codeString+"'");
257        }
258        public Enumeration<ActionConditionKind> fromType(Base code) throws FHIRException {
259          if (code == null)
260            return null;
261          if (code.isEmpty())
262            return new Enumeration<ActionConditionKind>(this);
263          String codeString = ((PrimitiveType) code).asStringValue();
264          if (codeString == null || "".equals(codeString))
265            return null;
266        if ("applicability".equals(codeString))
267          return new Enumeration<ActionConditionKind>(this, ActionConditionKind.APPLICABILITY);
268        if ("start".equals(codeString))
269          return new Enumeration<ActionConditionKind>(this, ActionConditionKind.START);
270        if ("stop".equals(codeString))
271          return new Enumeration<ActionConditionKind>(this, ActionConditionKind.STOP);
272        throw new FHIRException("Unknown ActionConditionKind code '"+codeString+"'");
273        }
274    public String toCode(ActionConditionKind code) {
275      if (code == ActionConditionKind.APPLICABILITY)
276        return "applicability";
277      if (code == ActionConditionKind.START)
278        return "start";
279      if (code == ActionConditionKind.STOP)
280        return "stop";
281      return "?";
282      }
283    public String toSystem(ActionConditionKind code) {
284      return code.getSystem();
285      }
286    }
287
288    public enum ActionRelationshipType {
289        /**
290         * The action must be performed before the start of the related action.
291         */
292        BEFORESTART, 
293        /**
294         * The action must be performed before the related action.
295         */
296        BEFORE, 
297        /**
298         * The action must be performed before the end of the related action.
299         */
300        BEFOREEND, 
301        /**
302         * The action must be performed concurrent with the start of the related action.
303         */
304        CONCURRENTWITHSTART, 
305        /**
306         * The action must be performed concurrent with the related action.
307         */
308        CONCURRENT, 
309        /**
310         * The action must be performed concurrent with the end of the related action.
311         */
312        CONCURRENTWITHEND, 
313        /**
314         * The action must be performed after the start of the related action.
315         */
316        AFTERSTART, 
317        /**
318         * The action must be performed after the related action.
319         */
320        AFTER, 
321        /**
322         * The action must be performed after the end of the related action.
323         */
324        AFTEREND, 
325        /**
326         * added to help the parsers with the generic types
327         */
328        NULL;
329        public static ActionRelationshipType fromCode(String codeString) throws FHIRException {
330            if (codeString == null || "".equals(codeString))
331                return null;
332        if ("before-start".equals(codeString))
333          return BEFORESTART;
334        if ("before".equals(codeString))
335          return BEFORE;
336        if ("before-end".equals(codeString))
337          return BEFOREEND;
338        if ("concurrent-with-start".equals(codeString))
339          return CONCURRENTWITHSTART;
340        if ("concurrent".equals(codeString))
341          return CONCURRENT;
342        if ("concurrent-with-end".equals(codeString))
343          return CONCURRENTWITHEND;
344        if ("after-start".equals(codeString))
345          return AFTERSTART;
346        if ("after".equals(codeString))
347          return AFTER;
348        if ("after-end".equals(codeString))
349          return AFTEREND;
350        if (Configuration.isAcceptInvalidEnums())
351          return null;
352        else
353          throw new FHIRException("Unknown ActionRelationshipType code '"+codeString+"'");
354        }
355        public String toCode() {
356          switch (this) {
357            case BEFORESTART: return "before-start";
358            case BEFORE: return "before";
359            case BEFOREEND: return "before-end";
360            case CONCURRENTWITHSTART: return "concurrent-with-start";
361            case CONCURRENT: return "concurrent";
362            case CONCURRENTWITHEND: return "concurrent-with-end";
363            case AFTERSTART: return "after-start";
364            case AFTER: return "after";
365            case AFTEREND: return "after-end";
366            default: return "?";
367          }
368        }
369        public String getSystem() {
370          switch (this) {
371            case BEFORESTART: return "http://hl7.org/fhir/action-relationship-type";
372            case BEFORE: return "http://hl7.org/fhir/action-relationship-type";
373            case BEFOREEND: return "http://hl7.org/fhir/action-relationship-type";
374            case CONCURRENTWITHSTART: return "http://hl7.org/fhir/action-relationship-type";
375            case CONCURRENT: return "http://hl7.org/fhir/action-relationship-type";
376            case CONCURRENTWITHEND: return "http://hl7.org/fhir/action-relationship-type";
377            case AFTERSTART: return "http://hl7.org/fhir/action-relationship-type";
378            case AFTER: return "http://hl7.org/fhir/action-relationship-type";
379            case AFTEREND: return "http://hl7.org/fhir/action-relationship-type";
380            default: return "?";
381          }
382        }
383        public String getDefinition() {
384          switch (this) {
385            case BEFORESTART: return "The action must be performed before the start of the related action.";
386            case BEFORE: return "The action must be performed before the related action.";
387            case BEFOREEND: return "The action must be performed before the end of the related action.";
388            case CONCURRENTWITHSTART: return "The action must be performed concurrent with the start of the related action.";
389            case CONCURRENT: return "The action must be performed concurrent with the related action.";
390            case CONCURRENTWITHEND: return "The action must be performed concurrent with the end of the related action.";
391            case AFTERSTART: return "The action must be performed after the start of the related action.";
392            case AFTER: return "The action must be performed after the related action.";
393            case AFTEREND: return "The action must be performed after the end of the related action.";
394            default: return "?";
395          }
396        }
397        public String getDisplay() {
398          switch (this) {
399            case BEFORESTART: return "Before Start";
400            case BEFORE: return "Before";
401            case BEFOREEND: return "Before End";
402            case CONCURRENTWITHSTART: return "Concurrent With Start";
403            case CONCURRENT: return "Concurrent";
404            case CONCURRENTWITHEND: return "Concurrent With End";
405            case AFTERSTART: return "After Start";
406            case AFTER: return "After";
407            case AFTEREND: return "After End";
408            default: return "?";
409          }
410        }
411    }
412
413  public static class ActionRelationshipTypeEnumFactory implements EnumFactory<ActionRelationshipType> {
414    public ActionRelationshipType fromCode(String codeString) throws IllegalArgumentException {
415      if (codeString == null || "".equals(codeString))
416            if (codeString == null || "".equals(codeString))
417                return null;
418        if ("before-start".equals(codeString))
419          return ActionRelationshipType.BEFORESTART;
420        if ("before".equals(codeString))
421          return ActionRelationshipType.BEFORE;
422        if ("before-end".equals(codeString))
423          return ActionRelationshipType.BEFOREEND;
424        if ("concurrent-with-start".equals(codeString))
425          return ActionRelationshipType.CONCURRENTWITHSTART;
426        if ("concurrent".equals(codeString))
427          return ActionRelationshipType.CONCURRENT;
428        if ("concurrent-with-end".equals(codeString))
429          return ActionRelationshipType.CONCURRENTWITHEND;
430        if ("after-start".equals(codeString))
431          return ActionRelationshipType.AFTERSTART;
432        if ("after".equals(codeString))
433          return ActionRelationshipType.AFTER;
434        if ("after-end".equals(codeString))
435          return ActionRelationshipType.AFTEREND;
436        throw new IllegalArgumentException("Unknown ActionRelationshipType code '"+codeString+"'");
437        }
438        public Enumeration<ActionRelationshipType> fromType(Base code) throws FHIRException {
439          if (code == null)
440            return null;
441          if (code.isEmpty())
442            return new Enumeration<ActionRelationshipType>(this);
443          String codeString = ((PrimitiveType) code).asStringValue();
444          if (codeString == null || "".equals(codeString))
445            return null;
446        if ("before-start".equals(codeString))
447          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.BEFORESTART);
448        if ("before".equals(codeString))
449          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.BEFORE);
450        if ("before-end".equals(codeString))
451          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.BEFOREEND);
452        if ("concurrent-with-start".equals(codeString))
453          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.CONCURRENTWITHSTART);
454        if ("concurrent".equals(codeString))
455          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.CONCURRENT);
456        if ("concurrent-with-end".equals(codeString))
457          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.CONCURRENTWITHEND);
458        if ("after-start".equals(codeString))
459          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.AFTERSTART);
460        if ("after".equals(codeString))
461          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.AFTER);
462        if ("after-end".equals(codeString))
463          return new Enumeration<ActionRelationshipType>(this, ActionRelationshipType.AFTEREND);
464        throw new FHIRException("Unknown ActionRelationshipType code '"+codeString+"'");
465        }
466    public String toCode(ActionRelationshipType code) {
467      if (code == ActionRelationshipType.BEFORESTART)
468        return "before-start";
469      if (code == ActionRelationshipType.BEFORE)
470        return "before";
471      if (code == ActionRelationshipType.BEFOREEND)
472        return "before-end";
473      if (code == ActionRelationshipType.CONCURRENTWITHSTART)
474        return "concurrent-with-start";
475      if (code == ActionRelationshipType.CONCURRENT)
476        return "concurrent";
477      if (code == ActionRelationshipType.CONCURRENTWITHEND)
478        return "concurrent-with-end";
479      if (code == ActionRelationshipType.AFTERSTART)
480        return "after-start";
481      if (code == ActionRelationshipType.AFTER)
482        return "after";
483      if (code == ActionRelationshipType.AFTEREND)
484        return "after-end";
485      return "?";
486      }
487    public String toSystem(ActionRelationshipType code) {
488      return code.getSystem();
489      }
490    }
491
492    public enum ActionParticipantType {
493        /**
494         * The participant is the patient under evaluation.
495         */
496        PATIENT, 
497        /**
498         * The participant is a practitioner involved in the patient's care.
499         */
500        PRACTITIONER, 
501        /**
502         * The participant is a person related to the patient.
503         */
504        RELATEDPERSON, 
505        /**
506         * The participant is a system or device used in the care of the patient.
507         */
508        DEVICE, 
509        /**
510         * added to help the parsers with the generic types
511         */
512        NULL;
513        public static ActionParticipantType fromCode(String codeString) throws FHIRException {
514            if (codeString == null || "".equals(codeString))
515                return null;
516        if ("patient".equals(codeString))
517          return PATIENT;
518        if ("practitioner".equals(codeString))
519          return PRACTITIONER;
520        if ("related-person".equals(codeString))
521          return RELATEDPERSON;
522        if ("device".equals(codeString))
523          return DEVICE;
524        if (Configuration.isAcceptInvalidEnums())
525          return null;
526        else
527          throw new FHIRException("Unknown ActionParticipantType code '"+codeString+"'");
528        }
529        public String toCode() {
530          switch (this) {
531            case PATIENT: return "patient";
532            case PRACTITIONER: return "practitioner";
533            case RELATEDPERSON: return "related-person";
534            case DEVICE: return "device";
535            default: return "?";
536          }
537        }
538        public String getSystem() {
539          switch (this) {
540            case PATIENT: return "http://hl7.org/fhir/action-participant-type";
541            case PRACTITIONER: return "http://hl7.org/fhir/action-participant-type";
542            case RELATEDPERSON: return "http://hl7.org/fhir/action-participant-type";
543            case DEVICE: return "http://hl7.org/fhir/action-participant-type";
544            default: return "?";
545          }
546        }
547        public String getDefinition() {
548          switch (this) {
549            case PATIENT: return "The participant is the patient under evaluation.";
550            case PRACTITIONER: return "The participant is a practitioner involved in the patient's care.";
551            case RELATEDPERSON: return "The participant is a person related to the patient.";
552            case DEVICE: return "The participant is a system or device used in the care of the patient.";
553            default: return "?";
554          }
555        }
556        public String getDisplay() {
557          switch (this) {
558            case PATIENT: return "Patient";
559            case PRACTITIONER: return "Practitioner";
560            case RELATEDPERSON: return "Related Person";
561            case DEVICE: return "Device";
562            default: return "?";
563          }
564        }
565    }
566
567  public static class ActionParticipantTypeEnumFactory implements EnumFactory<ActionParticipantType> {
568    public ActionParticipantType fromCode(String codeString) throws IllegalArgumentException {
569      if (codeString == null || "".equals(codeString))
570            if (codeString == null || "".equals(codeString))
571                return null;
572        if ("patient".equals(codeString))
573          return ActionParticipantType.PATIENT;
574        if ("practitioner".equals(codeString))
575          return ActionParticipantType.PRACTITIONER;
576        if ("related-person".equals(codeString))
577          return ActionParticipantType.RELATEDPERSON;
578        if ("device".equals(codeString))
579          return ActionParticipantType.DEVICE;
580        throw new IllegalArgumentException("Unknown ActionParticipantType code '"+codeString+"'");
581        }
582        public Enumeration<ActionParticipantType> fromType(Base code) throws FHIRException {
583          if (code == null)
584            return null;
585          if (code.isEmpty())
586            return new Enumeration<ActionParticipantType>(this);
587          String codeString = ((PrimitiveType) code).asStringValue();
588          if (codeString == null || "".equals(codeString))
589            return null;
590        if ("patient".equals(codeString))
591          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.PATIENT);
592        if ("practitioner".equals(codeString))
593          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.PRACTITIONER);
594        if ("related-person".equals(codeString))
595          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.RELATEDPERSON);
596        if ("device".equals(codeString))
597          return new Enumeration<ActionParticipantType>(this, ActionParticipantType.DEVICE);
598        throw new FHIRException("Unknown ActionParticipantType code '"+codeString+"'");
599        }
600    public String toCode(ActionParticipantType code) {
601      if (code == ActionParticipantType.PATIENT)
602        return "patient";
603      if (code == ActionParticipantType.PRACTITIONER)
604        return "practitioner";
605      if (code == ActionParticipantType.RELATEDPERSON)
606        return "related-person";
607      if (code == ActionParticipantType.DEVICE)
608        return "device";
609      return "?";
610      }
611    public String toSystem(ActionParticipantType code) {
612      return code.getSystem();
613      }
614    }
615
616    public enum ActionGroupingBehavior {
617        /**
618         * Any group marked with this behavior should be displayed as a visual group to the end user.
619         */
620        VISUALGROUP, 
621        /**
622         * 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.
623         */
624        LOGICALGROUP, 
625        /**
626         * 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".
627         */
628        SENTENCEGROUP, 
629        /**
630         * added to help the parsers with the generic types
631         */
632        NULL;
633        public static ActionGroupingBehavior fromCode(String codeString) throws FHIRException {
634            if (codeString == null || "".equals(codeString))
635                return null;
636        if ("visual-group".equals(codeString))
637          return VISUALGROUP;
638        if ("logical-group".equals(codeString))
639          return LOGICALGROUP;
640        if ("sentence-group".equals(codeString))
641          return SENTENCEGROUP;
642        if (Configuration.isAcceptInvalidEnums())
643          return null;
644        else
645          throw new FHIRException("Unknown ActionGroupingBehavior code '"+codeString+"'");
646        }
647        public String toCode() {
648          switch (this) {
649            case VISUALGROUP: return "visual-group";
650            case LOGICALGROUP: return "logical-group";
651            case SENTENCEGROUP: return "sentence-group";
652            default: return "?";
653          }
654        }
655        public String getSystem() {
656          switch (this) {
657            case VISUALGROUP: return "http://hl7.org/fhir/action-grouping-behavior";
658            case LOGICALGROUP: return "http://hl7.org/fhir/action-grouping-behavior";
659            case SENTENCEGROUP: return "http://hl7.org/fhir/action-grouping-behavior";
660            default: return "?";
661          }
662        }
663        public String getDefinition() {
664          switch (this) {
665            case VISUALGROUP: return "Any group marked with this behavior should be displayed as a visual group to the end user.";
666            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.";
667            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\".";
668            default: return "?";
669          }
670        }
671        public String getDisplay() {
672          switch (this) {
673            case VISUALGROUP: return "Visual Group";
674            case LOGICALGROUP: return "Logical Group";
675            case SENTENCEGROUP: return "Sentence Group";
676            default: return "?";
677          }
678        }
679    }
680
681  public static class ActionGroupingBehaviorEnumFactory implements EnumFactory<ActionGroupingBehavior> {
682    public ActionGroupingBehavior fromCode(String codeString) throws IllegalArgumentException {
683      if (codeString == null || "".equals(codeString))
684            if (codeString == null || "".equals(codeString))
685                return null;
686        if ("visual-group".equals(codeString))
687          return ActionGroupingBehavior.VISUALGROUP;
688        if ("logical-group".equals(codeString))
689          return ActionGroupingBehavior.LOGICALGROUP;
690        if ("sentence-group".equals(codeString))
691          return ActionGroupingBehavior.SENTENCEGROUP;
692        throw new IllegalArgumentException("Unknown ActionGroupingBehavior code '"+codeString+"'");
693        }
694        public Enumeration<ActionGroupingBehavior> fromType(Base code) throws FHIRException {
695          if (code == null)
696            return null;
697          if (code.isEmpty())
698            return new Enumeration<ActionGroupingBehavior>(this);
699          String codeString = ((PrimitiveType) code).asStringValue();
700          if (codeString == null || "".equals(codeString))
701            return null;
702        if ("visual-group".equals(codeString))
703          return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.VISUALGROUP);
704        if ("logical-group".equals(codeString))
705          return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.LOGICALGROUP);
706        if ("sentence-group".equals(codeString))
707          return new Enumeration<ActionGroupingBehavior>(this, ActionGroupingBehavior.SENTENCEGROUP);
708        throw new FHIRException("Unknown ActionGroupingBehavior code '"+codeString+"'");
709        }
710    public String toCode(ActionGroupingBehavior code) {
711      if (code == ActionGroupingBehavior.VISUALGROUP)
712        return "visual-group";
713      if (code == ActionGroupingBehavior.LOGICALGROUP)
714        return "logical-group";
715      if (code == ActionGroupingBehavior.SENTENCEGROUP)
716        return "sentence-group";
717      return "?";
718      }
719    public String toSystem(ActionGroupingBehavior code) {
720      return code.getSystem();
721      }
722    }
723
724    public enum ActionSelectionBehavior {
725        /**
726         * Any number of the actions in the group may be chosen, from zero to all.
727         */
728        ANY, 
729        /**
730         * All the actions in the group must be selected as a single unit.
731         */
732        ALL, 
733        /**
734         * 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.
735         */
736        ALLORNONE, 
737        /**
738         * 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.
739         */
740        EXACTLYONE, 
741        /**
742         * The end user may choose zero or at most one of the actions in the group.
743         */
744        ATMOSTONE, 
745        /**
746         * The end user must choose a minimum of one, and as many additional as desired.
747         */
748        ONEORMORE, 
749        /**
750         * added to help the parsers with the generic types
751         */
752        NULL;
753        public static ActionSelectionBehavior fromCode(String codeString) throws FHIRException {
754            if (codeString == null || "".equals(codeString))
755                return null;
756        if ("any".equals(codeString))
757          return ANY;
758        if ("all".equals(codeString))
759          return ALL;
760        if ("all-or-none".equals(codeString))
761          return ALLORNONE;
762        if ("exactly-one".equals(codeString))
763          return EXACTLYONE;
764        if ("at-most-one".equals(codeString))
765          return ATMOSTONE;
766        if ("one-or-more".equals(codeString))
767          return ONEORMORE;
768        if (Configuration.isAcceptInvalidEnums())
769          return null;
770        else
771          throw new FHIRException("Unknown ActionSelectionBehavior code '"+codeString+"'");
772        }
773        public String toCode() {
774          switch (this) {
775            case ANY: return "any";
776            case ALL: return "all";
777            case ALLORNONE: return "all-or-none";
778            case EXACTLYONE: return "exactly-one";
779            case ATMOSTONE: return "at-most-one";
780            case ONEORMORE: return "one-or-more";
781            default: return "?";
782          }
783        }
784        public String getSystem() {
785          switch (this) {
786            case ANY: return "http://hl7.org/fhir/action-selection-behavior";
787            case ALL: return "http://hl7.org/fhir/action-selection-behavior";
788            case ALLORNONE: return "http://hl7.org/fhir/action-selection-behavior";
789            case EXACTLYONE: return "http://hl7.org/fhir/action-selection-behavior";
790            case ATMOSTONE: return "http://hl7.org/fhir/action-selection-behavior";
791            case ONEORMORE: return "http://hl7.org/fhir/action-selection-behavior";
792            default: return "?";
793          }
794        }
795        public String getDefinition() {
796          switch (this) {
797            case ANY: return "Any number of the actions in the group may be chosen, from zero to all.";
798            case ALL: return "All the actions in the group must be selected as a single unit.";
799            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.";
800            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.";
801            case ATMOSTONE: return "The end user may choose zero or at most one of the actions in the group.";
802            case ONEORMORE: return "The end user must choose a minimum of one, and as many additional as desired.";
803            default: return "?";
804          }
805        }
806        public String getDisplay() {
807          switch (this) {
808            case ANY: return "Any";
809            case ALL: return "All";
810            case ALLORNONE: return "All Or None";
811            case EXACTLYONE: return "Exactly One";
812            case ATMOSTONE: return "At Most One";
813            case ONEORMORE: return "One Or More";
814            default: return "?";
815          }
816        }
817    }
818
819  public static class ActionSelectionBehaviorEnumFactory implements EnumFactory<ActionSelectionBehavior> {
820    public ActionSelectionBehavior fromCode(String codeString) throws IllegalArgumentException {
821      if (codeString == null || "".equals(codeString))
822            if (codeString == null || "".equals(codeString))
823                return null;
824        if ("any".equals(codeString))
825          return ActionSelectionBehavior.ANY;
826        if ("all".equals(codeString))
827          return ActionSelectionBehavior.ALL;
828        if ("all-or-none".equals(codeString))
829          return ActionSelectionBehavior.ALLORNONE;
830        if ("exactly-one".equals(codeString))
831          return ActionSelectionBehavior.EXACTLYONE;
832        if ("at-most-one".equals(codeString))
833          return ActionSelectionBehavior.ATMOSTONE;
834        if ("one-or-more".equals(codeString))
835          return ActionSelectionBehavior.ONEORMORE;
836        throw new IllegalArgumentException("Unknown ActionSelectionBehavior code '"+codeString+"'");
837        }
838        public Enumeration<ActionSelectionBehavior> fromType(Base code) throws FHIRException {
839          if (code == null)
840            return null;
841          if (code.isEmpty())
842            return new Enumeration<ActionSelectionBehavior>(this);
843          String codeString = ((PrimitiveType) code).asStringValue();
844          if (codeString == null || "".equals(codeString))
845            return null;
846        if ("any".equals(codeString))
847          return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ANY);
848        if ("all".equals(codeString))
849          return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ALL);
850        if ("all-or-none".equals(codeString))
851          return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ALLORNONE);
852        if ("exactly-one".equals(codeString))
853          return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.EXACTLYONE);
854        if ("at-most-one".equals(codeString))
855          return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ATMOSTONE);
856        if ("one-or-more".equals(codeString))
857          return new Enumeration<ActionSelectionBehavior>(this, ActionSelectionBehavior.ONEORMORE);
858        throw new FHIRException("Unknown ActionSelectionBehavior code '"+codeString+"'");
859        }
860    public String toCode(ActionSelectionBehavior code) {
861      if (code == ActionSelectionBehavior.ANY)
862        return "any";
863      if (code == ActionSelectionBehavior.ALL)
864        return "all";
865      if (code == ActionSelectionBehavior.ALLORNONE)
866        return "all-or-none";
867      if (code == ActionSelectionBehavior.EXACTLYONE)
868        return "exactly-one";
869      if (code == ActionSelectionBehavior.ATMOSTONE)
870        return "at-most-one";
871      if (code == ActionSelectionBehavior.ONEORMORE)
872        return "one-or-more";
873      return "?";
874      }
875    public String toSystem(ActionSelectionBehavior code) {
876      return code.getSystem();
877      }
878    }
879
880    public enum ActionRequiredBehavior {
881        /**
882         * 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.
883         */
884        MUST, 
885        /**
886         * An action with this behavior may be included in the set of actions processed by the end user.
887         */
888        COULD, 
889        /**
890         * 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.
891         */
892        MUSTUNLESSDOCUMENTED, 
893        /**
894         * added to help the parsers with the generic types
895         */
896        NULL;
897        public static ActionRequiredBehavior fromCode(String codeString) throws FHIRException {
898            if (codeString == null || "".equals(codeString))
899                return null;
900        if ("must".equals(codeString))
901          return MUST;
902        if ("could".equals(codeString))
903          return COULD;
904        if ("must-unless-documented".equals(codeString))
905          return MUSTUNLESSDOCUMENTED;
906        if (Configuration.isAcceptInvalidEnums())
907          return null;
908        else
909          throw new FHIRException("Unknown ActionRequiredBehavior code '"+codeString+"'");
910        }
911        public String toCode() {
912          switch (this) {
913            case MUST: return "must";
914            case COULD: return "could";
915            case MUSTUNLESSDOCUMENTED: return "must-unless-documented";
916            default: return "?";
917          }
918        }
919        public String getSystem() {
920          switch (this) {
921            case MUST: return "http://hl7.org/fhir/action-required-behavior";
922            case COULD: return "http://hl7.org/fhir/action-required-behavior";
923            case MUSTUNLESSDOCUMENTED: return "http://hl7.org/fhir/action-required-behavior";
924            default: return "?";
925          }
926        }
927        public String getDefinition() {
928          switch (this) {
929            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.";
930            case COULD: return "An action with this behavior may be included in the set of actions processed by the end user.";
931            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.";
932            default: return "?";
933          }
934        }
935        public String getDisplay() {
936          switch (this) {
937            case MUST: return "Must";
938            case COULD: return "Could";
939            case MUSTUNLESSDOCUMENTED: return "Must Unless Documented";
940            default: return "?";
941          }
942        }
943    }
944
945  public static class ActionRequiredBehaviorEnumFactory implements EnumFactory<ActionRequiredBehavior> {
946    public ActionRequiredBehavior fromCode(String codeString) throws IllegalArgumentException {
947      if (codeString == null || "".equals(codeString))
948            if (codeString == null || "".equals(codeString))
949                return null;
950        if ("must".equals(codeString))
951          return ActionRequiredBehavior.MUST;
952        if ("could".equals(codeString))
953          return ActionRequiredBehavior.COULD;
954        if ("must-unless-documented".equals(codeString))
955          return ActionRequiredBehavior.MUSTUNLESSDOCUMENTED;
956        throw new IllegalArgumentException("Unknown ActionRequiredBehavior code '"+codeString+"'");
957        }
958        public Enumeration<ActionRequiredBehavior> fromType(Base code) throws FHIRException {
959          if (code == null)
960            return null;
961          if (code.isEmpty())
962            return new Enumeration<ActionRequiredBehavior>(this);
963          String codeString = ((PrimitiveType) code).asStringValue();
964          if (codeString == null || "".equals(codeString))
965            return null;
966        if ("must".equals(codeString))
967          return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.MUST);
968        if ("could".equals(codeString))
969          return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.COULD);
970        if ("must-unless-documented".equals(codeString))
971          return new Enumeration<ActionRequiredBehavior>(this, ActionRequiredBehavior.MUSTUNLESSDOCUMENTED);
972        throw new FHIRException("Unknown ActionRequiredBehavior code '"+codeString+"'");
973        }
974    public String toCode(ActionRequiredBehavior code) {
975      if (code == ActionRequiredBehavior.MUST)
976        return "must";
977      if (code == ActionRequiredBehavior.COULD)
978        return "could";
979      if (code == ActionRequiredBehavior.MUSTUNLESSDOCUMENTED)
980        return "must-unless-documented";
981      return "?";
982      }
983    public String toSystem(ActionRequiredBehavior code) {
984      return code.getSystem();
985      }
986    }
987
988    public enum ActionPrecheckBehavior {
989        /**
990         * 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.
991         */
992        YES, 
993        /**
994         * 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.
995         */
996        NO, 
997        /**
998         * added to help the parsers with the generic types
999         */
1000        NULL;
1001        public static ActionPrecheckBehavior fromCode(String codeString) throws FHIRException {
1002            if (codeString == null || "".equals(codeString))
1003                return null;
1004        if ("yes".equals(codeString))
1005          return YES;
1006        if ("no".equals(codeString))
1007          return NO;
1008        if (Configuration.isAcceptInvalidEnums())
1009          return null;
1010        else
1011          throw new FHIRException("Unknown ActionPrecheckBehavior code '"+codeString+"'");
1012        }
1013        public String toCode() {
1014          switch (this) {
1015            case YES: return "yes";
1016            case NO: return "no";
1017            default: return "?";
1018          }
1019        }
1020        public String getSystem() {
1021          switch (this) {
1022            case YES: return "http://hl7.org/fhir/action-precheck-behavior";
1023            case NO: return "http://hl7.org/fhir/action-precheck-behavior";
1024            default: return "?";
1025          }
1026        }
1027        public String getDefinition() {
1028          switch (this) {
1029            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.";
1030            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.";
1031            default: return "?";
1032          }
1033        }
1034        public String getDisplay() {
1035          switch (this) {
1036            case YES: return "Yes";
1037            case NO: return "No";
1038            default: return "?";
1039          }
1040        }
1041    }
1042
1043  public static class ActionPrecheckBehaviorEnumFactory implements EnumFactory<ActionPrecheckBehavior> {
1044    public ActionPrecheckBehavior fromCode(String codeString) throws IllegalArgumentException {
1045      if (codeString == null || "".equals(codeString))
1046            if (codeString == null || "".equals(codeString))
1047                return null;
1048        if ("yes".equals(codeString))
1049          return ActionPrecheckBehavior.YES;
1050        if ("no".equals(codeString))
1051          return ActionPrecheckBehavior.NO;
1052        throw new IllegalArgumentException("Unknown ActionPrecheckBehavior code '"+codeString+"'");
1053        }
1054        public Enumeration<ActionPrecheckBehavior> fromType(Base code) throws FHIRException {
1055          if (code == null)
1056            return null;
1057          if (code.isEmpty())
1058            return new Enumeration<ActionPrecheckBehavior>(this);
1059          String codeString = ((PrimitiveType) code).asStringValue();
1060          if (codeString == null || "".equals(codeString))
1061            return null;
1062        if ("yes".equals(codeString))
1063          return new Enumeration<ActionPrecheckBehavior>(this, ActionPrecheckBehavior.YES);
1064        if ("no".equals(codeString))
1065          return new Enumeration<ActionPrecheckBehavior>(this, ActionPrecheckBehavior.NO);
1066        throw new FHIRException("Unknown ActionPrecheckBehavior code '"+codeString+"'");
1067        }
1068    public String toCode(ActionPrecheckBehavior code) {
1069      if (code == ActionPrecheckBehavior.YES)
1070        return "yes";
1071      if (code == ActionPrecheckBehavior.NO)
1072        return "no";
1073      return "?";
1074      }
1075    public String toSystem(ActionPrecheckBehavior code) {
1076      return code.getSystem();
1077      }
1078    }
1079
1080    public enum ActionCardinalityBehavior {
1081        /**
1082         * The action may only be selected one time.
1083         */
1084        SINGLE, 
1085        /**
1086         * The action may be selected multiple times.
1087         */
1088        MULTIPLE, 
1089        /**
1090         * added to help the parsers with the generic types
1091         */
1092        NULL;
1093        public static ActionCardinalityBehavior fromCode(String codeString) throws FHIRException {
1094            if (codeString == null || "".equals(codeString))
1095                return null;
1096        if ("single".equals(codeString))
1097          return SINGLE;
1098        if ("multiple".equals(codeString))
1099          return MULTIPLE;
1100        if (Configuration.isAcceptInvalidEnums())
1101          return null;
1102        else
1103          throw new FHIRException("Unknown ActionCardinalityBehavior code '"+codeString+"'");
1104        }
1105        public String toCode() {
1106          switch (this) {
1107            case SINGLE: return "single";
1108            case MULTIPLE: return "multiple";
1109            default: return "?";
1110          }
1111        }
1112        public String getSystem() {
1113          switch (this) {
1114            case SINGLE: return "http://hl7.org/fhir/action-cardinality-behavior";
1115            case MULTIPLE: return "http://hl7.org/fhir/action-cardinality-behavior";
1116            default: return "?";
1117          }
1118        }
1119        public String getDefinition() {
1120          switch (this) {
1121            case SINGLE: return "The action may only be selected one time.";
1122            case MULTIPLE: return "The action may be selected multiple times.";
1123            default: return "?";
1124          }
1125        }
1126        public String getDisplay() {
1127          switch (this) {
1128            case SINGLE: return "Single";
1129            case MULTIPLE: return "Multiple";
1130            default: return "?";
1131          }
1132        }
1133    }
1134
1135  public static class ActionCardinalityBehaviorEnumFactory implements EnumFactory<ActionCardinalityBehavior> {
1136    public ActionCardinalityBehavior fromCode(String codeString) throws IllegalArgumentException {
1137      if (codeString == null || "".equals(codeString))
1138            if (codeString == null || "".equals(codeString))
1139                return null;
1140        if ("single".equals(codeString))
1141          return ActionCardinalityBehavior.SINGLE;
1142        if ("multiple".equals(codeString))
1143          return ActionCardinalityBehavior.MULTIPLE;
1144        throw new IllegalArgumentException("Unknown ActionCardinalityBehavior code '"+codeString+"'");
1145        }
1146        public Enumeration<ActionCardinalityBehavior> fromType(Base code) throws FHIRException {
1147          if (code == null)
1148            return null;
1149          if (code.isEmpty())
1150            return new Enumeration<ActionCardinalityBehavior>(this);
1151          String codeString = ((PrimitiveType) code).asStringValue();
1152          if (codeString == null || "".equals(codeString))
1153            return null;
1154        if ("single".equals(codeString))
1155          return new Enumeration<ActionCardinalityBehavior>(this, ActionCardinalityBehavior.SINGLE);
1156        if ("multiple".equals(codeString))
1157          return new Enumeration<ActionCardinalityBehavior>(this, ActionCardinalityBehavior.MULTIPLE);
1158        throw new FHIRException("Unknown ActionCardinalityBehavior code '"+codeString+"'");
1159        }
1160    public String toCode(ActionCardinalityBehavior code) {
1161      if (code == ActionCardinalityBehavior.SINGLE)
1162        return "single";
1163      if (code == ActionCardinalityBehavior.MULTIPLE)
1164        return "multiple";
1165      return "?";
1166      }
1167    public String toSystem(ActionCardinalityBehavior code) {
1168      return code.getSystem();
1169      }
1170    }
1171
1172    @Block()
1173    public static class PlanDefinitionGoalComponent extends BackboneElement implements IBaseBackboneElement {
1174        /**
1175         * Indicates a category the goal falls within.
1176         */
1177        @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
1178        @Description(shortDefinition="E.g. Treatment, dietary, behavioral", formalDefinition="Indicates a category the goal falls within." )
1179        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/goal-category")
1180        protected CodeableConcept category;
1181
1182        /**
1183         * Human-readable and/or coded description of a specific desired objective of care, such as "control blood pressure" or "negotiate an obstacle course" or "dance with child at wedding".
1184         */
1185        @Child(name = "description", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false)
1186        @Description(shortDefinition="Code or text describing the goal", formalDefinition="Human-readable and/or coded description of a specific desired objective of care, such as \"control blood pressure\" or \"negotiate an obstacle course\" or \"dance with child at wedding\"." )
1187        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
1188        protected CodeableConcept description;
1189
1190        /**
1191         * Identifies the expected level of importance associated with reaching/sustaining the defined goal.
1192         */
1193        @Child(name = "priority", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
1194        @Description(shortDefinition="high-priority | medium-priority | low-priority", formalDefinition="Identifies the expected level of importance associated with reaching/sustaining the defined goal." )
1195        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/goal-priority")
1196        protected CodeableConcept priority;
1197
1198        /**
1199         * The event after which the goal should begin being pursued.
1200         */
1201        @Child(name = "start", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
1202        @Description(shortDefinition="When goal pursuit begins", formalDefinition="The event after which the goal should begin being pursued." )
1203        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/goal-start-event")
1204        protected CodeableConcept start;
1205
1206        /**
1207         * Identifies problems, conditions, issues, or concerns the goal is intended to address.
1208         */
1209        @Child(name = "addresses", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1210        @Description(shortDefinition="What does the goal address", formalDefinition="Identifies problems, conditions, issues, or concerns the goal is intended to address." )
1211        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
1212        protected List<CodeableConcept> addresses;
1213
1214        /**
1215         * Didactic or other informational resources associated with the goal that provide further supporting information about the goal. Information resources can include inline text commentary and links to web resources.
1216         */
1217        @Child(name = "documentation", type = {RelatedArtifact.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1218        @Description(shortDefinition="Supporting documentation for the goal", formalDefinition="Didactic or other informational resources associated with the goal that provide further supporting information about the goal. Information resources can include inline text commentary and links to web resources." )
1219        protected List<RelatedArtifact> documentation;
1220
1221        /**
1222         * Indicates what should be done and within what timeframe.
1223         */
1224        @Child(name = "target", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1225        @Description(shortDefinition="Target outcome for the goal", formalDefinition="Indicates what should be done and within what timeframe." )
1226        protected List<PlanDefinitionGoalTargetComponent> target;
1227
1228        private static final long serialVersionUID = -795308926L;
1229
1230    /**
1231     * Constructor
1232     */
1233      public PlanDefinitionGoalComponent() {
1234        super();
1235      }
1236
1237    /**
1238     * Constructor
1239     */
1240      public PlanDefinitionGoalComponent(CodeableConcept description) {
1241        super();
1242        this.description = description;
1243      }
1244
1245        /**
1246         * @return {@link #category} (Indicates a category the goal falls within.)
1247         */
1248        public CodeableConcept getCategory() { 
1249          if (this.category == null)
1250            if (Configuration.errorOnAutoCreate())
1251              throw new Error("Attempt to auto-create PlanDefinitionGoalComponent.category");
1252            else if (Configuration.doAutoCreate())
1253              this.category = new CodeableConcept(); // cc
1254          return this.category;
1255        }
1256
1257        public boolean hasCategory() { 
1258          return this.category != null && !this.category.isEmpty();
1259        }
1260
1261        /**
1262         * @param value {@link #category} (Indicates a category the goal falls within.)
1263         */
1264        public PlanDefinitionGoalComponent setCategory(CodeableConcept value) { 
1265          this.category = value;
1266          return this;
1267        }
1268
1269        /**
1270         * @return {@link #description} (Human-readable and/or coded description of a specific desired objective of care, such as "control blood pressure" or "negotiate an obstacle course" or "dance with child at wedding".)
1271         */
1272        public CodeableConcept getDescription() { 
1273          if (this.description == null)
1274            if (Configuration.errorOnAutoCreate())
1275              throw new Error("Attempt to auto-create PlanDefinitionGoalComponent.description");
1276            else if (Configuration.doAutoCreate())
1277              this.description = new CodeableConcept(); // cc
1278          return this.description;
1279        }
1280
1281        public boolean hasDescription() { 
1282          return this.description != null && !this.description.isEmpty();
1283        }
1284
1285        /**
1286         * @param value {@link #description} (Human-readable and/or coded description of a specific desired objective of care, such as "control blood pressure" or "negotiate an obstacle course" or "dance with child at wedding".)
1287         */
1288        public PlanDefinitionGoalComponent setDescription(CodeableConcept value) { 
1289          this.description = value;
1290          return this;
1291        }
1292
1293        /**
1294         * @return {@link #priority} (Identifies the expected level of importance associated with reaching/sustaining the defined goal.)
1295         */
1296        public CodeableConcept getPriority() { 
1297          if (this.priority == null)
1298            if (Configuration.errorOnAutoCreate())
1299              throw new Error("Attempt to auto-create PlanDefinitionGoalComponent.priority");
1300            else if (Configuration.doAutoCreate())
1301              this.priority = new CodeableConcept(); // cc
1302          return this.priority;
1303        }
1304
1305        public boolean hasPriority() { 
1306          return this.priority != null && !this.priority.isEmpty();
1307        }
1308
1309        /**
1310         * @param value {@link #priority} (Identifies the expected level of importance associated with reaching/sustaining the defined goal.)
1311         */
1312        public PlanDefinitionGoalComponent setPriority(CodeableConcept value) { 
1313          this.priority = value;
1314          return this;
1315        }
1316
1317        /**
1318         * @return {@link #start} (The event after which the goal should begin being pursued.)
1319         */
1320        public CodeableConcept getStart() { 
1321          if (this.start == null)
1322            if (Configuration.errorOnAutoCreate())
1323              throw new Error("Attempt to auto-create PlanDefinitionGoalComponent.start");
1324            else if (Configuration.doAutoCreate())
1325              this.start = new CodeableConcept(); // cc
1326          return this.start;
1327        }
1328
1329        public boolean hasStart() { 
1330          return this.start != null && !this.start.isEmpty();
1331        }
1332
1333        /**
1334         * @param value {@link #start} (The event after which the goal should begin being pursued.)
1335         */
1336        public PlanDefinitionGoalComponent setStart(CodeableConcept value) { 
1337          this.start = value;
1338          return this;
1339        }
1340
1341        /**
1342         * @return {@link #addresses} (Identifies problems, conditions, issues, or concerns the goal is intended to address.)
1343         */
1344        public List<CodeableConcept> getAddresses() { 
1345          if (this.addresses == null)
1346            this.addresses = new ArrayList<CodeableConcept>();
1347          return this.addresses;
1348        }
1349
1350        /**
1351         * @return Returns a reference to <code>this</code> for easy method chaining
1352         */
1353        public PlanDefinitionGoalComponent setAddresses(List<CodeableConcept> theAddresses) { 
1354          this.addresses = theAddresses;
1355          return this;
1356        }
1357
1358        public boolean hasAddresses() { 
1359          if (this.addresses == null)
1360            return false;
1361          for (CodeableConcept item : this.addresses)
1362            if (!item.isEmpty())
1363              return true;
1364          return false;
1365        }
1366
1367        public CodeableConcept addAddresses() { //3
1368          CodeableConcept t = new CodeableConcept();
1369          if (this.addresses == null)
1370            this.addresses = new ArrayList<CodeableConcept>();
1371          this.addresses.add(t);
1372          return t;
1373        }
1374
1375        public PlanDefinitionGoalComponent addAddresses(CodeableConcept t) { //3
1376          if (t == null)
1377            return this;
1378          if (this.addresses == null)
1379            this.addresses = new ArrayList<CodeableConcept>();
1380          this.addresses.add(t);
1381          return this;
1382        }
1383
1384        /**
1385         * @return The first repetition of repeating field {@link #addresses}, creating it if it does not already exist
1386         */
1387        public CodeableConcept getAddressesFirstRep() { 
1388          if (getAddresses().isEmpty()) {
1389            addAddresses();
1390          }
1391          return getAddresses().get(0);
1392        }
1393
1394        /**
1395         * @return {@link #documentation} (Didactic or other informational resources associated with the goal that provide further supporting information about the goal. Information resources can include inline text commentary and links to web resources.)
1396         */
1397        public List<RelatedArtifact> getDocumentation() { 
1398          if (this.documentation == null)
1399            this.documentation = new ArrayList<RelatedArtifact>();
1400          return this.documentation;
1401        }
1402
1403        /**
1404         * @return Returns a reference to <code>this</code> for easy method chaining
1405         */
1406        public PlanDefinitionGoalComponent setDocumentation(List<RelatedArtifact> theDocumentation) { 
1407          this.documentation = theDocumentation;
1408          return this;
1409        }
1410
1411        public boolean hasDocumentation() { 
1412          if (this.documentation == null)
1413            return false;
1414          for (RelatedArtifact item : this.documentation)
1415            if (!item.isEmpty())
1416              return true;
1417          return false;
1418        }
1419
1420        public RelatedArtifact addDocumentation() { //3
1421          RelatedArtifact t = new RelatedArtifact();
1422          if (this.documentation == null)
1423            this.documentation = new ArrayList<RelatedArtifact>();
1424          this.documentation.add(t);
1425          return t;
1426        }
1427
1428        public PlanDefinitionGoalComponent addDocumentation(RelatedArtifact t) { //3
1429          if (t == null)
1430            return this;
1431          if (this.documentation == null)
1432            this.documentation = new ArrayList<RelatedArtifact>();
1433          this.documentation.add(t);
1434          return this;
1435        }
1436
1437        /**
1438         * @return The first repetition of repeating field {@link #documentation}, creating it if it does not already exist
1439         */
1440        public RelatedArtifact getDocumentationFirstRep() { 
1441          if (getDocumentation().isEmpty()) {
1442            addDocumentation();
1443          }
1444          return getDocumentation().get(0);
1445        }
1446
1447        /**
1448         * @return {@link #target} (Indicates what should be done and within what timeframe.)
1449         */
1450        public List<PlanDefinitionGoalTargetComponent> getTarget() { 
1451          if (this.target == null)
1452            this.target = new ArrayList<PlanDefinitionGoalTargetComponent>();
1453          return this.target;
1454        }
1455
1456        /**
1457         * @return Returns a reference to <code>this</code> for easy method chaining
1458         */
1459        public PlanDefinitionGoalComponent setTarget(List<PlanDefinitionGoalTargetComponent> theTarget) { 
1460          this.target = theTarget;
1461          return this;
1462        }
1463
1464        public boolean hasTarget() { 
1465          if (this.target == null)
1466            return false;
1467          for (PlanDefinitionGoalTargetComponent item : this.target)
1468            if (!item.isEmpty())
1469              return true;
1470          return false;
1471        }
1472
1473        public PlanDefinitionGoalTargetComponent addTarget() { //3
1474          PlanDefinitionGoalTargetComponent t = new PlanDefinitionGoalTargetComponent();
1475          if (this.target == null)
1476            this.target = new ArrayList<PlanDefinitionGoalTargetComponent>();
1477          this.target.add(t);
1478          return t;
1479        }
1480
1481        public PlanDefinitionGoalComponent addTarget(PlanDefinitionGoalTargetComponent t) { //3
1482          if (t == null)
1483            return this;
1484          if (this.target == null)
1485            this.target = new ArrayList<PlanDefinitionGoalTargetComponent>();
1486          this.target.add(t);
1487          return this;
1488        }
1489
1490        /**
1491         * @return The first repetition of repeating field {@link #target}, creating it if it does not already exist
1492         */
1493        public PlanDefinitionGoalTargetComponent getTargetFirstRep() { 
1494          if (getTarget().isEmpty()) {
1495            addTarget();
1496          }
1497          return getTarget().get(0);
1498        }
1499
1500        protected void listChildren(List<Property> children) {
1501          super.listChildren(children);
1502          children.add(new Property("category", "CodeableConcept", "Indicates a category the goal falls within.", 0, 1, category));
1503          children.add(new Property("description", "CodeableConcept", "Human-readable and/or coded description of a specific desired objective of care, such as \"control blood pressure\" or \"negotiate an obstacle course\" or \"dance with child at wedding\".", 0, 1, description));
1504          children.add(new Property("priority", "CodeableConcept", "Identifies the expected level of importance associated with reaching/sustaining the defined goal.", 0, 1, priority));
1505          children.add(new Property("start", "CodeableConcept", "The event after which the goal should begin being pursued.", 0, 1, start));
1506          children.add(new Property("addresses", "CodeableConcept", "Identifies problems, conditions, issues, or concerns the goal is intended to address.", 0, java.lang.Integer.MAX_VALUE, addresses));
1507          children.add(new Property("documentation", "RelatedArtifact", "Didactic or other informational resources associated with the goal that provide further supporting information about the goal. Information resources can include inline text commentary and links to web resources.", 0, java.lang.Integer.MAX_VALUE, documentation));
1508          children.add(new Property("target", "", "Indicates what should be done and within what timeframe.", 0, java.lang.Integer.MAX_VALUE, target));
1509        }
1510
1511        @Override
1512        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1513          switch (_hash) {
1514          case 50511102: /*category*/  return new Property("category", "CodeableConcept", "Indicates a category the goal falls within.", 0, 1, category);
1515          case -1724546052: /*description*/  return new Property("description", "CodeableConcept", "Human-readable and/or coded description of a specific desired objective of care, such as \"control blood pressure\" or \"negotiate an obstacle course\" or \"dance with child at wedding\".", 0, 1, description);
1516          case -1165461084: /*priority*/  return new Property("priority", "CodeableConcept", "Identifies the expected level of importance associated with reaching/sustaining the defined goal.", 0, 1, priority);
1517          case 109757538: /*start*/  return new Property("start", "CodeableConcept", "The event after which the goal should begin being pursued.", 0, 1, start);
1518          case 874544034: /*addresses*/  return new Property("addresses", "CodeableConcept", "Identifies problems, conditions, issues, or concerns the goal is intended to address.", 0, java.lang.Integer.MAX_VALUE, addresses);
1519          case 1587405498: /*documentation*/  return new Property("documentation", "RelatedArtifact", "Didactic or other informational resources associated with the goal that provide further supporting information about the goal. Information resources can include inline text commentary and links to web resources.", 0, java.lang.Integer.MAX_VALUE, documentation);
1520          case -880905839: /*target*/  return new Property("target", "", "Indicates what should be done and within what timeframe.", 0, java.lang.Integer.MAX_VALUE, target);
1521          default: return super.getNamedProperty(_hash, _name, _checkValid);
1522          }
1523
1524        }
1525
1526      @Override
1527      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1528        switch (hash) {
1529        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept
1530        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // CodeableConcept
1531        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept
1532        case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // CodeableConcept
1533        case 874544034: /*addresses*/ return this.addresses == null ? new Base[0] : this.addresses.toArray(new Base[this.addresses.size()]); // CodeableConcept
1534        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : this.documentation.toArray(new Base[this.documentation.size()]); // RelatedArtifact
1535        case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // PlanDefinitionGoalTargetComponent
1536        default: return super.getProperty(hash, name, checkValid);
1537        }
1538
1539      }
1540
1541      @Override
1542      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1543        switch (hash) {
1544        case 50511102: // category
1545          this.category = castToCodeableConcept(value); // CodeableConcept
1546          return value;
1547        case -1724546052: // description
1548          this.description = castToCodeableConcept(value); // CodeableConcept
1549          return value;
1550        case -1165461084: // priority
1551          this.priority = castToCodeableConcept(value); // CodeableConcept
1552          return value;
1553        case 109757538: // start
1554          this.start = castToCodeableConcept(value); // CodeableConcept
1555          return value;
1556        case 874544034: // addresses
1557          this.getAddresses().add(castToCodeableConcept(value)); // CodeableConcept
1558          return value;
1559        case 1587405498: // documentation
1560          this.getDocumentation().add(castToRelatedArtifact(value)); // RelatedArtifact
1561          return value;
1562        case -880905839: // target
1563          this.getTarget().add((PlanDefinitionGoalTargetComponent) value); // PlanDefinitionGoalTargetComponent
1564          return value;
1565        default: return super.setProperty(hash, name, value);
1566        }
1567
1568      }
1569
1570      @Override
1571      public Base setProperty(String name, Base value) throws FHIRException {
1572        if (name.equals("category")) {
1573          this.category = castToCodeableConcept(value); // CodeableConcept
1574        } else if (name.equals("description")) {
1575          this.description = castToCodeableConcept(value); // CodeableConcept
1576        } else if (name.equals("priority")) {
1577          this.priority = castToCodeableConcept(value); // CodeableConcept
1578        } else if (name.equals("start")) {
1579          this.start = castToCodeableConcept(value); // CodeableConcept
1580        } else if (name.equals("addresses")) {
1581          this.getAddresses().add(castToCodeableConcept(value));
1582        } else if (name.equals("documentation")) {
1583          this.getDocumentation().add(castToRelatedArtifact(value));
1584        } else if (name.equals("target")) {
1585          this.getTarget().add((PlanDefinitionGoalTargetComponent) value);
1586        } else
1587          return super.setProperty(name, value);
1588        return value;
1589      }
1590
1591      @Override
1592      public Base makeProperty(int hash, String name) throws FHIRException {
1593        switch (hash) {
1594        case 50511102:  return getCategory(); 
1595        case -1724546052:  return getDescription(); 
1596        case -1165461084:  return getPriority(); 
1597        case 109757538:  return getStart(); 
1598        case 874544034:  return addAddresses(); 
1599        case 1587405498:  return addDocumentation(); 
1600        case -880905839:  return addTarget(); 
1601        default: return super.makeProperty(hash, name);
1602        }
1603
1604      }
1605
1606      @Override
1607      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1608        switch (hash) {
1609        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
1610        case -1724546052: /*description*/ return new String[] {"CodeableConcept"};
1611        case -1165461084: /*priority*/ return new String[] {"CodeableConcept"};
1612        case 109757538: /*start*/ return new String[] {"CodeableConcept"};
1613        case 874544034: /*addresses*/ return new String[] {"CodeableConcept"};
1614        case 1587405498: /*documentation*/ return new String[] {"RelatedArtifact"};
1615        case -880905839: /*target*/ return new String[] {};
1616        default: return super.getTypesForProperty(hash, name);
1617        }
1618
1619      }
1620
1621      @Override
1622      public Base addChild(String name) throws FHIRException {
1623        if (name.equals("category")) {
1624          this.category = new CodeableConcept();
1625          return this.category;
1626        }
1627        else if (name.equals("description")) {
1628          this.description = new CodeableConcept();
1629          return this.description;
1630        }
1631        else if (name.equals("priority")) {
1632          this.priority = new CodeableConcept();
1633          return this.priority;
1634        }
1635        else if (name.equals("start")) {
1636          this.start = new CodeableConcept();
1637          return this.start;
1638        }
1639        else if (name.equals("addresses")) {
1640          return addAddresses();
1641        }
1642        else if (name.equals("documentation")) {
1643          return addDocumentation();
1644        }
1645        else if (name.equals("target")) {
1646          return addTarget();
1647        }
1648        else
1649          return super.addChild(name);
1650      }
1651
1652      public PlanDefinitionGoalComponent copy() {
1653        PlanDefinitionGoalComponent dst = new PlanDefinitionGoalComponent();
1654        copyValues(dst);
1655        return dst;
1656      }
1657
1658      public void copyValues(PlanDefinitionGoalComponent dst) {
1659        super.copyValues(dst);
1660        dst.category = category == null ? null : category.copy();
1661        dst.description = description == null ? null : description.copy();
1662        dst.priority = priority == null ? null : priority.copy();
1663        dst.start = start == null ? null : start.copy();
1664        if (addresses != null) {
1665          dst.addresses = new ArrayList<CodeableConcept>();
1666          for (CodeableConcept i : addresses)
1667            dst.addresses.add(i.copy());
1668        };
1669        if (documentation != null) {
1670          dst.documentation = new ArrayList<RelatedArtifact>();
1671          for (RelatedArtifact i : documentation)
1672            dst.documentation.add(i.copy());
1673        };
1674        if (target != null) {
1675          dst.target = new ArrayList<PlanDefinitionGoalTargetComponent>();
1676          for (PlanDefinitionGoalTargetComponent i : target)
1677            dst.target.add(i.copy());
1678        };
1679      }
1680
1681      @Override
1682      public boolean equalsDeep(Base other_) {
1683        if (!super.equalsDeep(other_))
1684          return false;
1685        if (!(other_ instanceof PlanDefinitionGoalComponent))
1686          return false;
1687        PlanDefinitionGoalComponent o = (PlanDefinitionGoalComponent) other_;
1688        return compareDeep(category, o.category, true) && compareDeep(description, o.description, true)
1689           && compareDeep(priority, o.priority, true) && compareDeep(start, o.start, true) && compareDeep(addresses, o.addresses, true)
1690           && compareDeep(documentation, o.documentation, true) && compareDeep(target, o.target, true);
1691      }
1692
1693      @Override
1694      public boolean equalsShallow(Base other_) {
1695        if (!super.equalsShallow(other_))
1696          return false;
1697        if (!(other_ instanceof PlanDefinitionGoalComponent))
1698          return false;
1699        PlanDefinitionGoalComponent o = (PlanDefinitionGoalComponent) other_;
1700        return true;
1701      }
1702
1703      public boolean isEmpty() {
1704        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, description, priority
1705          , start, addresses, documentation, target);
1706      }
1707
1708  public String fhirType() {
1709    return "PlanDefinition.goal";
1710
1711  }
1712
1713  }
1714
1715    @Block()
1716    public static class PlanDefinitionGoalTargetComponent extends BackboneElement implements IBaseBackboneElement {
1717        /**
1718         * The parameter whose value is to be tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.
1719         */
1720        @Child(name = "measure", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
1721        @Description(shortDefinition="The parameter whose value is to be tracked", formalDefinition="The parameter whose value is to be tracked, e.g. body weight, blood pressure, or hemoglobin A1c level." )
1722        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/observation-codes")
1723        protected CodeableConcept measure;
1724
1725        /**
1726         * The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.
1727         */
1728        @Child(name = "detail", type = {Quantity.class, Range.class, CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
1729        @Description(shortDefinition="The target value to be achieved", formalDefinition="The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value." )
1730        protected Type detail;
1731
1732        /**
1733         * Indicates the timeframe after the start of the goal in which the goal should be met.
1734         */
1735        @Child(name = "due", type = {Duration.class}, order=3, min=0, max=1, modifier=false, summary=false)
1736        @Description(shortDefinition="Reach goal within", formalDefinition="Indicates the timeframe after the start of the goal in which the goal should be met." )
1737        protected Duration due;
1738
1739        private static final long serialVersionUID = -131874144L;
1740
1741    /**
1742     * Constructor
1743     */
1744      public PlanDefinitionGoalTargetComponent() {
1745        super();
1746      }
1747
1748        /**
1749         * @return {@link #measure} (The parameter whose value is to be tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.)
1750         */
1751        public CodeableConcept getMeasure() { 
1752          if (this.measure == null)
1753            if (Configuration.errorOnAutoCreate())
1754              throw new Error("Attempt to auto-create PlanDefinitionGoalTargetComponent.measure");
1755            else if (Configuration.doAutoCreate())
1756              this.measure = new CodeableConcept(); // cc
1757          return this.measure;
1758        }
1759
1760        public boolean hasMeasure() { 
1761          return this.measure != null && !this.measure.isEmpty();
1762        }
1763
1764        /**
1765         * @param value {@link #measure} (The parameter whose value is to be tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.)
1766         */
1767        public PlanDefinitionGoalTargetComponent setMeasure(CodeableConcept value) { 
1768          this.measure = value;
1769          return this;
1770        }
1771
1772        /**
1773         * @return {@link #detail} (The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.)
1774         */
1775        public Type getDetail() { 
1776          return this.detail;
1777        }
1778
1779        /**
1780         * @return {@link #detail} (The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.)
1781         */
1782        public Quantity getDetailQuantity() throws FHIRException { 
1783          if (this.detail == null)
1784            this.detail = new Quantity();
1785          if (!(this.detail instanceof Quantity))
1786            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.detail.getClass().getName()+" was encountered");
1787          return (Quantity) this.detail;
1788        }
1789
1790        public boolean hasDetailQuantity() { 
1791          return this != null && this.detail instanceof Quantity;
1792        }
1793
1794        /**
1795         * @return {@link #detail} (The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.)
1796         */
1797        public Range getDetailRange() throws FHIRException { 
1798          if (this.detail == null)
1799            this.detail = new Range();
1800          if (!(this.detail instanceof Range))
1801            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.detail.getClass().getName()+" was encountered");
1802          return (Range) this.detail;
1803        }
1804
1805        public boolean hasDetailRange() { 
1806          return this != null && this.detail instanceof Range;
1807        }
1808
1809        /**
1810         * @return {@link #detail} (The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.)
1811         */
1812        public CodeableConcept getDetailCodeableConcept() throws FHIRException { 
1813          if (this.detail == null)
1814            this.detail = new CodeableConcept();
1815          if (!(this.detail instanceof CodeableConcept))
1816            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.detail.getClass().getName()+" was encountered");
1817          return (CodeableConcept) this.detail;
1818        }
1819
1820        public boolean hasDetailCodeableConcept() { 
1821          return this != null && this.detail instanceof CodeableConcept;
1822        }
1823
1824        public boolean hasDetail() { 
1825          return this.detail != null && !this.detail.isEmpty();
1826        }
1827
1828        /**
1829         * @param value {@link #detail} (The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.)
1830         */
1831        public PlanDefinitionGoalTargetComponent setDetail(Type value) { 
1832          if (value != null && !(value instanceof Quantity || value instanceof Range || value instanceof CodeableConcept))
1833            throw new Error("Not the right type for PlanDefinition.goal.target.detail[x]: "+value.fhirType());
1834          this.detail = value;
1835          return this;
1836        }
1837
1838        /**
1839         * @return {@link #due} (Indicates the timeframe after the start of the goal in which the goal should be met.)
1840         */
1841        public Duration getDue() { 
1842          if (this.due == null)
1843            if (Configuration.errorOnAutoCreate())
1844              throw new Error("Attempt to auto-create PlanDefinitionGoalTargetComponent.due");
1845            else if (Configuration.doAutoCreate())
1846              this.due = new Duration(); // cc
1847          return this.due;
1848        }
1849
1850        public boolean hasDue() { 
1851          return this.due != null && !this.due.isEmpty();
1852        }
1853
1854        /**
1855         * @param value {@link #due} (Indicates the timeframe after the start of the goal in which the goal should be met.)
1856         */
1857        public PlanDefinitionGoalTargetComponent setDue(Duration value) { 
1858          this.due = value;
1859          return this;
1860        }
1861
1862        protected void listChildren(List<Property> children) {
1863          super.listChildren(children);
1864          children.add(new Property("measure", "CodeableConcept", "The parameter whose value is to be tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.", 0, 1, measure));
1865          children.add(new Property("detail[x]", "Quantity|Range|CodeableConcept", "The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.", 0, 1, detail));
1866          children.add(new Property("due", "Duration", "Indicates the timeframe after the start of the goal in which the goal should be met.", 0, 1, due));
1867        }
1868
1869        @Override
1870        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1871          switch (_hash) {
1872          case 938321246: /*measure*/  return new Property("measure", "CodeableConcept", "The parameter whose value is to be tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.", 0, 1, measure);
1873          case -1973084529: /*detail[x]*/  return new Property("detail[x]", "Quantity|Range|CodeableConcept", "The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.", 0, 1, detail);
1874          case -1335224239: /*detail*/  return new Property("detail[x]", "Quantity|Range|CodeableConcept", "The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.", 0, 1, detail);
1875          case -1313079300: /*detailQuantity*/  return new Property("detail[x]", "Quantity|Range|CodeableConcept", "The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.", 0, 1, detail);
1876          case -2062632084: /*detailRange*/  return new Property("detail[x]", "Quantity|Range|CodeableConcept", "The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.", 0, 1, detail);
1877          case -175586544: /*detailCodeableConcept*/  return new Property("detail[x]", "Quantity|Range|CodeableConcept", "The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.", 0, 1, detail);
1878          case 99828: /*due*/  return new Property("due", "Duration", "Indicates the timeframe after the start of the goal in which the goal should be met.", 0, 1, due);
1879          default: return super.getNamedProperty(_hash, _name, _checkValid);
1880          }
1881
1882        }
1883
1884      @Override
1885      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1886        switch (hash) {
1887        case 938321246: /*measure*/ return this.measure == null ? new Base[0] : new Base[] {this.measure}; // CodeableConcept
1888        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // Type
1889        case 99828: /*due*/ return this.due == null ? new Base[0] : new Base[] {this.due}; // Duration
1890        default: return super.getProperty(hash, name, checkValid);
1891        }
1892
1893      }
1894
1895      @Override
1896      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1897        switch (hash) {
1898        case 938321246: // measure
1899          this.measure = castToCodeableConcept(value); // CodeableConcept
1900          return value;
1901        case -1335224239: // detail
1902          this.detail = castToType(value); // Type
1903          return value;
1904        case 99828: // due
1905          this.due = castToDuration(value); // Duration
1906          return value;
1907        default: return super.setProperty(hash, name, value);
1908        }
1909
1910      }
1911
1912      @Override
1913      public Base setProperty(String name, Base value) throws FHIRException {
1914        if (name.equals("measure")) {
1915          this.measure = castToCodeableConcept(value); // CodeableConcept
1916        } else if (name.equals("detail[x]")) {
1917          this.detail = castToType(value); // Type
1918        } else if (name.equals("due")) {
1919          this.due = castToDuration(value); // Duration
1920        } else
1921          return super.setProperty(name, value);
1922        return value;
1923      }
1924
1925      @Override
1926      public Base makeProperty(int hash, String name) throws FHIRException {
1927        switch (hash) {
1928        case 938321246:  return getMeasure(); 
1929        case -1973084529:  return getDetail(); 
1930        case -1335224239:  return getDetail(); 
1931        case 99828:  return getDue(); 
1932        default: return super.makeProperty(hash, name);
1933        }
1934
1935      }
1936
1937      @Override
1938      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1939        switch (hash) {
1940        case 938321246: /*measure*/ return new String[] {"CodeableConcept"};
1941        case -1335224239: /*detail*/ return new String[] {"Quantity", "Range", "CodeableConcept"};
1942        case 99828: /*due*/ return new String[] {"Duration"};
1943        default: return super.getTypesForProperty(hash, name);
1944        }
1945
1946      }
1947
1948      @Override
1949      public Base addChild(String name) throws FHIRException {
1950        if (name.equals("measure")) {
1951          this.measure = new CodeableConcept();
1952          return this.measure;
1953        }
1954        else if (name.equals("detailQuantity")) {
1955          this.detail = new Quantity();
1956          return this.detail;
1957        }
1958        else if (name.equals("detailRange")) {
1959          this.detail = new Range();
1960          return this.detail;
1961        }
1962        else if (name.equals("detailCodeableConcept")) {
1963          this.detail = new CodeableConcept();
1964          return this.detail;
1965        }
1966        else if (name.equals("due")) {
1967          this.due = new Duration();
1968          return this.due;
1969        }
1970        else
1971          return super.addChild(name);
1972      }
1973
1974      public PlanDefinitionGoalTargetComponent copy() {
1975        PlanDefinitionGoalTargetComponent dst = new PlanDefinitionGoalTargetComponent();
1976        copyValues(dst);
1977        return dst;
1978      }
1979
1980      public void copyValues(PlanDefinitionGoalTargetComponent dst) {
1981        super.copyValues(dst);
1982        dst.measure = measure == null ? null : measure.copy();
1983        dst.detail = detail == null ? null : detail.copy();
1984        dst.due = due == null ? null : due.copy();
1985      }
1986
1987      @Override
1988      public boolean equalsDeep(Base other_) {
1989        if (!super.equalsDeep(other_))
1990          return false;
1991        if (!(other_ instanceof PlanDefinitionGoalTargetComponent))
1992          return false;
1993        PlanDefinitionGoalTargetComponent o = (PlanDefinitionGoalTargetComponent) other_;
1994        return compareDeep(measure, o.measure, true) && compareDeep(detail, o.detail, true) && compareDeep(due, o.due, true)
1995          ;
1996      }
1997
1998      @Override
1999      public boolean equalsShallow(Base other_) {
2000        if (!super.equalsShallow(other_))
2001          return false;
2002        if (!(other_ instanceof PlanDefinitionGoalTargetComponent))
2003          return false;
2004        PlanDefinitionGoalTargetComponent o = (PlanDefinitionGoalTargetComponent) other_;
2005        return true;
2006      }
2007
2008      public boolean isEmpty() {
2009        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(measure, detail, due);
2010      }
2011
2012  public String fhirType() {
2013    return "PlanDefinition.goal.target";
2014
2015  }
2016
2017  }
2018
2019    @Block()
2020    public static class PlanDefinitionActionComponent extends BackboneElement implements IBaseBackboneElement {
2021        /**
2022         * A user-visible prefix for the action.
2023         */
2024        @Child(name = "prefix", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
2025        @Description(shortDefinition="User-visible prefix for the action (e.g. 1. or A.)", formalDefinition="A user-visible prefix for the action." )
2026        protected StringType prefix;
2027
2028        /**
2029         * The title of the action displayed to a user.
2030         */
2031        @Child(name = "title", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2032        @Description(shortDefinition="User-visible title", formalDefinition="The title of the action displayed to a user." )
2033        protected StringType title;
2034
2035        /**
2036         * A brief description of the action used to provide a summary to display to the user.
2037         */
2038        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2039        @Description(shortDefinition="Brief description of the action", formalDefinition="A brief description of the action used to provide a summary to display to the user." )
2040        protected StringType description;
2041
2042        /**
2043         * 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.
2044         */
2045        @Child(name = "textEquivalent", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
2046        @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." )
2047        protected StringType textEquivalent;
2048
2049        /**
2050         * Indicates how quickly the action should be addressed with respect to other actions.
2051         */
2052        @Child(name = "priority", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
2053        @Description(shortDefinition="routine | urgent | asap | stat", formalDefinition="Indicates how quickly the action should be addressed with respect to other actions." )
2054        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority")
2055        protected Enumeration<RequestPriority> priority;
2056
2057        /**
2058         * A code that provides meaning for the action or action group. For example, a section may have a LOINC code for the section of a documentation template.
2059         */
2060        @Child(name = "code", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2061        @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 the section of a documentation template." )
2062        protected List<CodeableConcept> code;
2063
2064        /**
2065         * A description of why this action is necessary or appropriate.
2066         */
2067        @Child(name = "reason", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2068        @Description(shortDefinition="Why the action should be performed", formalDefinition="A description of why this action is necessary or appropriate." )
2069        protected List<CodeableConcept> reason;
2070
2071        /**
2072         * 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.
2073         */
2074        @Child(name = "documentation", type = {RelatedArtifact.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2075        @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." )
2076        protected List<RelatedArtifact> documentation;
2077
2078        /**
2079         * Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition.
2080         */
2081        @Child(name = "goalId", type = {IdType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2082        @Description(shortDefinition="What goals this action supports", formalDefinition="Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition." )
2083        protected List<IdType> goalId;
2084
2085        /**
2086         * A code or group definition that describes the intended subject of the action and its children, if any.
2087         */
2088        @Child(name = "subject", type = {CodeableConcept.class, Group.class}, order=10, min=0, max=1, modifier=false, summary=false)
2089        @Description(shortDefinition="Type of individual the action is focused on", formalDefinition="A code or group definition that describes the intended subject of the action and its children, if any." )
2090        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/subject-type")
2091        protected Type subject;
2092
2093        /**
2094         * A description of when the action should be triggered.
2095         */
2096        @Child(name = "trigger", type = {TriggerDefinition.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2097        @Description(shortDefinition="When the action should be triggered", formalDefinition="A description of when the action should be triggered." )
2098        protected List<TriggerDefinition> trigger;
2099
2100        /**
2101         * An expression that describes applicability criteria or start/stop conditions for the action.
2102         */
2103        @Child(name = "condition", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2104        @Description(shortDefinition="Whether or not the action is applicable", formalDefinition="An expression that describes applicability criteria or start/stop conditions for the action." )
2105        protected List<PlanDefinitionActionConditionComponent> condition;
2106
2107        /**
2108         * Defines input data requirements for the action.
2109         */
2110        @Child(name = "input", type = {DataRequirement.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2111        @Description(shortDefinition="Input data requirements", formalDefinition="Defines input data requirements for the action." )
2112        protected List<DataRequirement> input;
2113
2114        /**
2115         * Defines the outputs of the action, if any.
2116         */
2117        @Child(name = "output", type = {DataRequirement.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2118        @Description(shortDefinition="Output data definition", formalDefinition="Defines the outputs of the action, if any." )
2119        protected List<DataRequirement> output;
2120
2121        /**
2122         * A relationship to another action such as "before" or "30-60 minutes after start of".
2123         */
2124        @Child(name = "relatedAction", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2125        @Description(shortDefinition="Relationship to another action", formalDefinition="A relationship to another action such as \"before\" or \"30-60 minutes after start of\"." )
2126        protected List<PlanDefinitionActionRelatedActionComponent> relatedAction;
2127
2128        /**
2129         * An optional value describing when the action should be performed.
2130         */
2131        @Child(name = "timing", type = {DateTimeType.class, Age.class, Period.class, Duration.class, Range.class, Timing.class}, order=16, min=0, max=1, modifier=false, summary=false)
2132        @Description(shortDefinition="When the action should take place", formalDefinition="An optional value describing when the action should be performed." )
2133        protected Type timing;
2134
2135        /**
2136         * Indicates who should participate in performing the action described.
2137         */
2138        @Child(name = "participant", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2139        @Description(shortDefinition="Who should participate in the action", formalDefinition="Indicates who should participate in performing the action described." )
2140        protected List<PlanDefinitionActionParticipantComponent> participant;
2141
2142        /**
2143         * The type of action to perform (create, update, remove).
2144         */
2145        @Child(name = "type", type = {CodeableConcept.class}, order=18, min=0, max=1, modifier=false, summary=false)
2146        @Description(shortDefinition="create | update | remove | fire-event", formalDefinition="The type of action to perform (create, update, remove)." )
2147        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-type")
2148        protected CodeableConcept type;
2149
2150        /**
2151         * Defines the grouping behavior for the action and its children.
2152         */
2153        @Child(name = "groupingBehavior", type = {CodeType.class}, order=19, min=0, max=1, modifier=false, summary=false)
2154        @Description(shortDefinition="visual-group | logical-group | sentence-group", formalDefinition="Defines the grouping behavior for the action and its children." )
2155        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-grouping-behavior")
2156        protected Enumeration<ActionGroupingBehavior> groupingBehavior;
2157
2158        /**
2159         * Defines the selection behavior for the action and its children.
2160         */
2161        @Child(name = "selectionBehavior", type = {CodeType.class}, order=20, min=0, max=1, modifier=false, summary=false)
2162        @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." )
2163        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-selection-behavior")
2164        protected Enumeration<ActionSelectionBehavior> selectionBehavior;
2165
2166        /**
2167         * Defines the required behavior for the action.
2168         */
2169        @Child(name = "requiredBehavior", type = {CodeType.class}, order=21, min=0, max=1, modifier=false, summary=false)
2170        @Description(shortDefinition="must | could | must-unless-documented", formalDefinition="Defines the required behavior for the action." )
2171        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-required-behavior")
2172        protected Enumeration<ActionRequiredBehavior> requiredBehavior;
2173
2174        /**
2175         * Defines whether the action should usually be preselected.
2176         */
2177        @Child(name = "precheckBehavior", type = {CodeType.class}, order=22, min=0, max=1, modifier=false, summary=false)
2178        @Description(shortDefinition="yes | no", formalDefinition="Defines whether the action should usually be preselected." )
2179        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-precheck-behavior")
2180        protected Enumeration<ActionPrecheckBehavior> precheckBehavior;
2181
2182        /**
2183         * Defines whether the action can be selected multiple times.
2184         */
2185        @Child(name = "cardinalityBehavior", type = {CodeType.class}, order=23, min=0, max=1, modifier=false, summary=false)
2186        @Description(shortDefinition="single | multiple", formalDefinition="Defines whether the action can be selected multiple times." )
2187        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-cardinality-behavior")
2188        protected Enumeration<ActionCardinalityBehavior> cardinalityBehavior;
2189
2190        /**
2191         * A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.
2192         */
2193        @Child(name = "definition", type = {CanonicalType.class, UriType.class}, order=24, min=0, max=1, modifier=false, summary=false)
2194        @Description(shortDefinition="Description of the activity to be performed", formalDefinition="A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken." )
2195        protected Type definition;
2196
2197        /**
2198         * A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.
2199         */
2200        @Child(name = "transform", type = {CanonicalType.class}, order=25, min=0, max=1, modifier=false, summary=false)
2201        @Description(shortDefinition="Transform to apply the template", formalDefinition="A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input." )
2202        protected CanonicalType transform;
2203
2204        /**
2205         * Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.
2206         */
2207        @Child(name = "dynamicValue", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2208        @Description(shortDefinition="Dynamic aspects of the definition", formalDefinition="Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result." )
2209        protected List<PlanDefinitionActionDynamicValueComponent> dynamicValue;
2210
2211        /**
2212         * Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.
2213         */
2214        @Child(name = "action", type = {PlanDefinitionActionComponent.class}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2215        @Description(shortDefinition="A sub-action", formalDefinition="Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition." )
2216        protected List<PlanDefinitionActionComponent> action;
2217
2218        private static final long serialVersionUID = 158605540L;
2219
2220    /**
2221     * Constructor
2222     */
2223      public PlanDefinitionActionComponent() {
2224        super();
2225      }
2226
2227        /**
2228         * @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
2229         */
2230        public StringType getPrefixElement() { 
2231          if (this.prefix == null)
2232            if (Configuration.errorOnAutoCreate())
2233              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.prefix");
2234            else if (Configuration.doAutoCreate())
2235              this.prefix = new StringType(); // bb
2236          return this.prefix;
2237        }
2238
2239        public boolean hasPrefixElement() { 
2240          return this.prefix != null && !this.prefix.isEmpty();
2241        }
2242
2243        public boolean hasPrefix() { 
2244          return this.prefix != null && !this.prefix.isEmpty();
2245        }
2246
2247        /**
2248         * @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
2249         */
2250        public PlanDefinitionActionComponent setPrefixElement(StringType value) { 
2251          this.prefix = value;
2252          return this;
2253        }
2254
2255        /**
2256         * @return A user-visible prefix for the action.
2257         */
2258        public String getPrefix() { 
2259          return this.prefix == null ? null : this.prefix.getValue();
2260        }
2261
2262        /**
2263         * @param value A user-visible prefix for the action.
2264         */
2265        public PlanDefinitionActionComponent setPrefix(String value) { 
2266          if (Utilities.noString(value))
2267            this.prefix = null;
2268          else {
2269            if (this.prefix == null)
2270              this.prefix = new StringType();
2271            this.prefix.setValue(value);
2272          }
2273          return this;
2274        }
2275
2276        /**
2277         * @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
2278         */
2279        public StringType getTitleElement() { 
2280          if (this.title == null)
2281            if (Configuration.errorOnAutoCreate())
2282              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.title");
2283            else if (Configuration.doAutoCreate())
2284              this.title = new StringType(); // bb
2285          return this.title;
2286        }
2287
2288        public boolean hasTitleElement() { 
2289          return this.title != null && !this.title.isEmpty();
2290        }
2291
2292        public boolean hasTitle() { 
2293          return this.title != null && !this.title.isEmpty();
2294        }
2295
2296        /**
2297         * @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
2298         */
2299        public PlanDefinitionActionComponent setTitleElement(StringType value) { 
2300          this.title = value;
2301          return this;
2302        }
2303
2304        /**
2305         * @return The title of the action displayed to a user.
2306         */
2307        public String getTitle() { 
2308          return this.title == null ? null : this.title.getValue();
2309        }
2310
2311        /**
2312         * @param value The title of the action displayed to a user.
2313         */
2314        public PlanDefinitionActionComponent setTitle(String value) { 
2315          if (Utilities.noString(value))
2316            this.title = null;
2317          else {
2318            if (this.title == null)
2319              this.title = new StringType();
2320            this.title.setValue(value);
2321          }
2322          return this;
2323        }
2324
2325        /**
2326         * @return {@link #description} (A brief 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
2327         */
2328        public StringType getDescriptionElement() { 
2329          if (this.description == null)
2330            if (Configuration.errorOnAutoCreate())
2331              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.description");
2332            else if (Configuration.doAutoCreate())
2333              this.description = new StringType(); // bb
2334          return this.description;
2335        }
2336
2337        public boolean hasDescriptionElement() { 
2338          return this.description != null && !this.description.isEmpty();
2339        }
2340
2341        public boolean hasDescription() { 
2342          return this.description != null && !this.description.isEmpty();
2343        }
2344
2345        /**
2346         * @param value {@link #description} (A brief 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
2347         */
2348        public PlanDefinitionActionComponent setDescriptionElement(StringType value) { 
2349          this.description = value;
2350          return this;
2351        }
2352
2353        /**
2354         * @return A brief description of the action used to provide a summary to display to the user.
2355         */
2356        public String getDescription() { 
2357          return this.description == null ? null : this.description.getValue();
2358        }
2359
2360        /**
2361         * @param value A brief description of the action used to provide a summary to display to the user.
2362         */
2363        public PlanDefinitionActionComponent setDescription(String value) { 
2364          if (Utilities.noString(value))
2365            this.description = null;
2366          else {
2367            if (this.description == null)
2368              this.description = new StringType();
2369            this.description.setValue(value);
2370          }
2371          return this;
2372        }
2373
2374        /**
2375         * @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
2376         */
2377        public StringType getTextEquivalentElement() { 
2378          if (this.textEquivalent == null)
2379            if (Configuration.errorOnAutoCreate())
2380              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.textEquivalent");
2381            else if (Configuration.doAutoCreate())
2382              this.textEquivalent = new StringType(); // bb
2383          return this.textEquivalent;
2384        }
2385
2386        public boolean hasTextEquivalentElement() { 
2387          return this.textEquivalent != null && !this.textEquivalent.isEmpty();
2388        }
2389
2390        public boolean hasTextEquivalent() { 
2391          return this.textEquivalent != null && !this.textEquivalent.isEmpty();
2392        }
2393
2394        /**
2395         * @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
2396         */
2397        public PlanDefinitionActionComponent setTextEquivalentElement(StringType value) { 
2398          this.textEquivalent = value;
2399          return this;
2400        }
2401
2402        /**
2403         * @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.
2404         */
2405        public String getTextEquivalent() { 
2406          return this.textEquivalent == null ? null : this.textEquivalent.getValue();
2407        }
2408
2409        /**
2410         * @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.
2411         */
2412        public PlanDefinitionActionComponent setTextEquivalent(String value) { 
2413          if (Utilities.noString(value))
2414            this.textEquivalent = null;
2415          else {
2416            if (this.textEquivalent == null)
2417              this.textEquivalent = new StringType();
2418            this.textEquivalent.setValue(value);
2419          }
2420          return this;
2421        }
2422
2423        /**
2424         * @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
2425         */
2426        public Enumeration<RequestPriority> getPriorityElement() { 
2427          if (this.priority == null)
2428            if (Configuration.errorOnAutoCreate())
2429              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.priority");
2430            else if (Configuration.doAutoCreate())
2431              this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory()); // bb
2432          return this.priority;
2433        }
2434
2435        public boolean hasPriorityElement() { 
2436          return this.priority != null && !this.priority.isEmpty();
2437        }
2438
2439        public boolean hasPriority() { 
2440          return this.priority != null && !this.priority.isEmpty();
2441        }
2442
2443        /**
2444         * @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
2445         */
2446        public PlanDefinitionActionComponent setPriorityElement(Enumeration<RequestPriority> value) { 
2447          this.priority = value;
2448          return this;
2449        }
2450
2451        /**
2452         * @return Indicates how quickly the action should be addressed with respect to other actions.
2453         */
2454        public RequestPriority getPriority() { 
2455          return this.priority == null ? null : this.priority.getValue();
2456        }
2457
2458        /**
2459         * @param value Indicates how quickly the action should be addressed with respect to other actions.
2460         */
2461        public PlanDefinitionActionComponent setPriority(RequestPriority value) { 
2462          if (value == null)
2463            this.priority = null;
2464          else {
2465            if (this.priority == null)
2466              this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory());
2467            this.priority.setValue(value);
2468          }
2469          return this;
2470        }
2471
2472        /**
2473         * @return {@link #code} (A code that provides meaning for the action or action group. For example, a section may have a LOINC code for the section of a documentation template.)
2474         */
2475        public List<CodeableConcept> getCode() { 
2476          if (this.code == null)
2477            this.code = new ArrayList<CodeableConcept>();
2478          return this.code;
2479        }
2480
2481        /**
2482         * @return Returns a reference to <code>this</code> for easy method chaining
2483         */
2484        public PlanDefinitionActionComponent setCode(List<CodeableConcept> theCode) { 
2485          this.code = theCode;
2486          return this;
2487        }
2488
2489        public boolean hasCode() { 
2490          if (this.code == null)
2491            return false;
2492          for (CodeableConcept item : this.code)
2493            if (!item.isEmpty())
2494              return true;
2495          return false;
2496        }
2497
2498        public CodeableConcept addCode() { //3
2499          CodeableConcept t = new CodeableConcept();
2500          if (this.code == null)
2501            this.code = new ArrayList<CodeableConcept>();
2502          this.code.add(t);
2503          return t;
2504        }
2505
2506        public PlanDefinitionActionComponent addCode(CodeableConcept t) { //3
2507          if (t == null)
2508            return this;
2509          if (this.code == null)
2510            this.code = new ArrayList<CodeableConcept>();
2511          this.code.add(t);
2512          return this;
2513        }
2514
2515        /**
2516         * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist
2517         */
2518        public CodeableConcept getCodeFirstRep() { 
2519          if (getCode().isEmpty()) {
2520            addCode();
2521          }
2522          return getCode().get(0);
2523        }
2524
2525        /**
2526         * @return {@link #reason} (A description of why this action is necessary or appropriate.)
2527         */
2528        public List<CodeableConcept> getReason() { 
2529          if (this.reason == null)
2530            this.reason = new ArrayList<CodeableConcept>();
2531          return this.reason;
2532        }
2533
2534        /**
2535         * @return Returns a reference to <code>this</code> for easy method chaining
2536         */
2537        public PlanDefinitionActionComponent setReason(List<CodeableConcept> theReason) { 
2538          this.reason = theReason;
2539          return this;
2540        }
2541
2542        public boolean hasReason() { 
2543          if (this.reason == null)
2544            return false;
2545          for (CodeableConcept item : this.reason)
2546            if (!item.isEmpty())
2547              return true;
2548          return false;
2549        }
2550
2551        public CodeableConcept addReason() { //3
2552          CodeableConcept t = new CodeableConcept();
2553          if (this.reason == null)
2554            this.reason = new ArrayList<CodeableConcept>();
2555          this.reason.add(t);
2556          return t;
2557        }
2558
2559        public PlanDefinitionActionComponent addReason(CodeableConcept t) { //3
2560          if (t == null)
2561            return this;
2562          if (this.reason == null)
2563            this.reason = new ArrayList<CodeableConcept>();
2564          this.reason.add(t);
2565          return this;
2566        }
2567
2568        /**
2569         * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist
2570         */
2571        public CodeableConcept getReasonFirstRep() { 
2572          if (getReason().isEmpty()) {
2573            addReason();
2574          }
2575          return getReason().get(0);
2576        }
2577
2578        /**
2579         * @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.)
2580         */
2581        public List<RelatedArtifact> getDocumentation() { 
2582          if (this.documentation == null)
2583            this.documentation = new ArrayList<RelatedArtifact>();
2584          return this.documentation;
2585        }
2586
2587        /**
2588         * @return Returns a reference to <code>this</code> for easy method chaining
2589         */
2590        public PlanDefinitionActionComponent setDocumentation(List<RelatedArtifact> theDocumentation) { 
2591          this.documentation = theDocumentation;
2592          return this;
2593        }
2594
2595        public boolean hasDocumentation() { 
2596          if (this.documentation == null)
2597            return false;
2598          for (RelatedArtifact item : this.documentation)
2599            if (!item.isEmpty())
2600              return true;
2601          return false;
2602        }
2603
2604        public RelatedArtifact addDocumentation() { //3
2605          RelatedArtifact t = new RelatedArtifact();
2606          if (this.documentation == null)
2607            this.documentation = new ArrayList<RelatedArtifact>();
2608          this.documentation.add(t);
2609          return t;
2610        }
2611
2612        public PlanDefinitionActionComponent addDocumentation(RelatedArtifact t) { //3
2613          if (t == null)
2614            return this;
2615          if (this.documentation == null)
2616            this.documentation = new ArrayList<RelatedArtifact>();
2617          this.documentation.add(t);
2618          return this;
2619        }
2620
2621        /**
2622         * @return The first repetition of repeating field {@link #documentation}, creating it if it does not already exist
2623         */
2624        public RelatedArtifact getDocumentationFirstRep() { 
2625          if (getDocumentation().isEmpty()) {
2626            addDocumentation();
2627          }
2628          return getDocumentation().get(0);
2629        }
2630
2631        /**
2632         * @return {@link #goalId} (Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition.)
2633         */
2634        public List<IdType> getGoalId() { 
2635          if (this.goalId == null)
2636            this.goalId = new ArrayList<IdType>();
2637          return this.goalId;
2638        }
2639
2640        /**
2641         * @return Returns a reference to <code>this</code> for easy method chaining
2642         */
2643        public PlanDefinitionActionComponent setGoalId(List<IdType> theGoalId) { 
2644          this.goalId = theGoalId;
2645          return this;
2646        }
2647
2648        public boolean hasGoalId() { 
2649          if (this.goalId == null)
2650            return false;
2651          for (IdType item : this.goalId)
2652            if (!item.isEmpty())
2653              return true;
2654          return false;
2655        }
2656
2657        /**
2658         * @return {@link #goalId} (Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition.)
2659         */
2660        public IdType addGoalIdElement() {//2 
2661          IdType t = new IdType();
2662          if (this.goalId == null)
2663            this.goalId = new ArrayList<IdType>();
2664          this.goalId.add(t);
2665          return t;
2666        }
2667
2668        /**
2669         * @param value {@link #goalId} (Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition.)
2670         */
2671        public PlanDefinitionActionComponent addGoalId(String value) { //1
2672          IdType t = new IdType();
2673          t.setValue(value);
2674          if (this.goalId == null)
2675            this.goalId = new ArrayList<IdType>();
2676          this.goalId.add(t);
2677          return this;
2678        }
2679
2680        /**
2681         * @param value {@link #goalId} (Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition.)
2682         */
2683        public boolean hasGoalId(String value) { 
2684          if (this.goalId == null)
2685            return false;
2686          for (IdType v : this.goalId)
2687            if (v.getValue().equals(value)) // id
2688              return true;
2689          return false;
2690        }
2691
2692        /**
2693         * @return {@link #subject} (A code or group definition that describes the intended subject of the action and its children, if any.)
2694         */
2695        public Type getSubject() { 
2696          return this.subject;
2697        }
2698
2699        /**
2700         * @return {@link #subject} (A code or group definition that describes the intended subject of the action and its children, if any.)
2701         */
2702        public CodeableConcept getSubjectCodeableConcept() throws FHIRException { 
2703          if (this.subject == null)
2704            this.subject = new CodeableConcept();
2705          if (!(this.subject instanceof CodeableConcept))
2706            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.subject.getClass().getName()+" was encountered");
2707          return (CodeableConcept) this.subject;
2708        }
2709
2710        public boolean hasSubjectCodeableConcept() { 
2711          return this != null && this.subject instanceof CodeableConcept;
2712        }
2713
2714        /**
2715         * @return {@link #subject} (A code or group definition that describes the intended subject of the action and its children, if any.)
2716         */
2717        public Reference getSubjectReference() throws FHIRException { 
2718          if (this.subject == null)
2719            this.subject = new Reference();
2720          if (!(this.subject instanceof Reference))
2721            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.subject.getClass().getName()+" was encountered");
2722          return (Reference) this.subject;
2723        }
2724
2725        public boolean hasSubjectReference() { 
2726          return this != null && this.subject instanceof Reference;
2727        }
2728
2729        public boolean hasSubject() { 
2730          return this.subject != null && !this.subject.isEmpty();
2731        }
2732
2733        /**
2734         * @param value {@link #subject} (A code or group definition that describes the intended subject of the action and its children, if any.)
2735         */
2736        public PlanDefinitionActionComponent setSubject(Type value) { 
2737          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
2738            throw new Error("Not the right type for PlanDefinition.action.subject[x]: "+value.fhirType());
2739          this.subject = value;
2740          return this;
2741        }
2742
2743        /**
2744         * @return {@link #trigger} (A description of when the action should be triggered.)
2745         */
2746        public List<TriggerDefinition> getTrigger() { 
2747          if (this.trigger == null)
2748            this.trigger = new ArrayList<TriggerDefinition>();
2749          return this.trigger;
2750        }
2751
2752        /**
2753         * @return Returns a reference to <code>this</code> for easy method chaining
2754         */
2755        public PlanDefinitionActionComponent setTrigger(List<TriggerDefinition> theTrigger) { 
2756          this.trigger = theTrigger;
2757          return this;
2758        }
2759
2760        public boolean hasTrigger() { 
2761          if (this.trigger == null)
2762            return false;
2763          for (TriggerDefinition item : this.trigger)
2764            if (!item.isEmpty())
2765              return true;
2766          return false;
2767        }
2768
2769        public TriggerDefinition addTrigger() { //3
2770          TriggerDefinition t = new TriggerDefinition();
2771          if (this.trigger == null)
2772            this.trigger = new ArrayList<TriggerDefinition>();
2773          this.trigger.add(t);
2774          return t;
2775        }
2776
2777        public PlanDefinitionActionComponent addTrigger(TriggerDefinition t) { //3
2778          if (t == null)
2779            return this;
2780          if (this.trigger == null)
2781            this.trigger = new ArrayList<TriggerDefinition>();
2782          this.trigger.add(t);
2783          return this;
2784        }
2785
2786        /**
2787         * @return The first repetition of repeating field {@link #trigger}, creating it if it does not already exist
2788         */
2789        public TriggerDefinition getTriggerFirstRep() { 
2790          if (getTrigger().isEmpty()) {
2791            addTrigger();
2792          }
2793          return getTrigger().get(0);
2794        }
2795
2796        /**
2797         * @return {@link #condition} (An expression that describes applicability criteria or start/stop conditions for the action.)
2798         */
2799        public List<PlanDefinitionActionConditionComponent> getCondition() { 
2800          if (this.condition == null)
2801            this.condition = new ArrayList<PlanDefinitionActionConditionComponent>();
2802          return this.condition;
2803        }
2804
2805        /**
2806         * @return Returns a reference to <code>this</code> for easy method chaining
2807         */
2808        public PlanDefinitionActionComponent setCondition(List<PlanDefinitionActionConditionComponent> theCondition) { 
2809          this.condition = theCondition;
2810          return this;
2811        }
2812
2813        public boolean hasCondition() { 
2814          if (this.condition == null)
2815            return false;
2816          for (PlanDefinitionActionConditionComponent item : this.condition)
2817            if (!item.isEmpty())
2818              return true;
2819          return false;
2820        }
2821
2822        public PlanDefinitionActionConditionComponent addCondition() { //3
2823          PlanDefinitionActionConditionComponent t = new PlanDefinitionActionConditionComponent();
2824          if (this.condition == null)
2825            this.condition = new ArrayList<PlanDefinitionActionConditionComponent>();
2826          this.condition.add(t);
2827          return t;
2828        }
2829
2830        public PlanDefinitionActionComponent addCondition(PlanDefinitionActionConditionComponent t) { //3
2831          if (t == null)
2832            return this;
2833          if (this.condition == null)
2834            this.condition = new ArrayList<PlanDefinitionActionConditionComponent>();
2835          this.condition.add(t);
2836          return this;
2837        }
2838
2839        /**
2840         * @return The first repetition of repeating field {@link #condition}, creating it if it does not already exist
2841         */
2842        public PlanDefinitionActionConditionComponent getConditionFirstRep() { 
2843          if (getCondition().isEmpty()) {
2844            addCondition();
2845          }
2846          return getCondition().get(0);
2847        }
2848
2849        /**
2850         * @return {@link #input} (Defines input data requirements for the action.)
2851         */
2852        public List<DataRequirement> getInput() { 
2853          if (this.input == null)
2854            this.input = new ArrayList<DataRequirement>();
2855          return this.input;
2856        }
2857
2858        /**
2859         * @return Returns a reference to <code>this</code> for easy method chaining
2860         */
2861        public PlanDefinitionActionComponent setInput(List<DataRequirement> theInput) { 
2862          this.input = theInput;
2863          return this;
2864        }
2865
2866        public boolean hasInput() { 
2867          if (this.input == null)
2868            return false;
2869          for (DataRequirement item : this.input)
2870            if (!item.isEmpty())
2871              return true;
2872          return false;
2873        }
2874
2875        public DataRequirement addInput() { //3
2876          DataRequirement t = new DataRequirement();
2877          if (this.input == null)
2878            this.input = new ArrayList<DataRequirement>();
2879          this.input.add(t);
2880          return t;
2881        }
2882
2883        public PlanDefinitionActionComponent addInput(DataRequirement t) { //3
2884          if (t == null)
2885            return this;
2886          if (this.input == null)
2887            this.input = new ArrayList<DataRequirement>();
2888          this.input.add(t);
2889          return this;
2890        }
2891
2892        /**
2893         * @return The first repetition of repeating field {@link #input}, creating it if it does not already exist
2894         */
2895        public DataRequirement getInputFirstRep() { 
2896          if (getInput().isEmpty()) {
2897            addInput();
2898          }
2899          return getInput().get(0);
2900        }
2901
2902        /**
2903         * @return {@link #output} (Defines the outputs of the action, if any.)
2904         */
2905        public List<DataRequirement> getOutput() { 
2906          if (this.output == null)
2907            this.output = new ArrayList<DataRequirement>();
2908          return this.output;
2909        }
2910
2911        /**
2912         * @return Returns a reference to <code>this</code> for easy method chaining
2913         */
2914        public PlanDefinitionActionComponent setOutput(List<DataRequirement> theOutput) { 
2915          this.output = theOutput;
2916          return this;
2917        }
2918
2919        public boolean hasOutput() { 
2920          if (this.output == null)
2921            return false;
2922          for (DataRequirement item : this.output)
2923            if (!item.isEmpty())
2924              return true;
2925          return false;
2926        }
2927
2928        public DataRequirement addOutput() { //3
2929          DataRequirement t = new DataRequirement();
2930          if (this.output == null)
2931            this.output = new ArrayList<DataRequirement>();
2932          this.output.add(t);
2933          return t;
2934        }
2935
2936        public PlanDefinitionActionComponent addOutput(DataRequirement t) { //3
2937          if (t == null)
2938            return this;
2939          if (this.output == null)
2940            this.output = new ArrayList<DataRequirement>();
2941          this.output.add(t);
2942          return this;
2943        }
2944
2945        /**
2946         * @return The first repetition of repeating field {@link #output}, creating it if it does not already exist
2947         */
2948        public DataRequirement getOutputFirstRep() { 
2949          if (getOutput().isEmpty()) {
2950            addOutput();
2951          }
2952          return getOutput().get(0);
2953        }
2954
2955        /**
2956         * @return {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".)
2957         */
2958        public List<PlanDefinitionActionRelatedActionComponent> getRelatedAction() { 
2959          if (this.relatedAction == null)
2960            this.relatedAction = new ArrayList<PlanDefinitionActionRelatedActionComponent>();
2961          return this.relatedAction;
2962        }
2963
2964        /**
2965         * @return Returns a reference to <code>this</code> for easy method chaining
2966         */
2967        public PlanDefinitionActionComponent setRelatedAction(List<PlanDefinitionActionRelatedActionComponent> theRelatedAction) { 
2968          this.relatedAction = theRelatedAction;
2969          return this;
2970        }
2971
2972        public boolean hasRelatedAction() { 
2973          if (this.relatedAction == null)
2974            return false;
2975          for (PlanDefinitionActionRelatedActionComponent item : this.relatedAction)
2976            if (!item.isEmpty())
2977              return true;
2978          return false;
2979        }
2980
2981        public PlanDefinitionActionRelatedActionComponent addRelatedAction() { //3
2982          PlanDefinitionActionRelatedActionComponent t = new PlanDefinitionActionRelatedActionComponent();
2983          if (this.relatedAction == null)
2984            this.relatedAction = new ArrayList<PlanDefinitionActionRelatedActionComponent>();
2985          this.relatedAction.add(t);
2986          return t;
2987        }
2988
2989        public PlanDefinitionActionComponent addRelatedAction(PlanDefinitionActionRelatedActionComponent t) { //3
2990          if (t == null)
2991            return this;
2992          if (this.relatedAction == null)
2993            this.relatedAction = new ArrayList<PlanDefinitionActionRelatedActionComponent>();
2994          this.relatedAction.add(t);
2995          return this;
2996        }
2997
2998        /**
2999         * @return The first repetition of repeating field {@link #relatedAction}, creating it if it does not already exist
3000         */
3001        public PlanDefinitionActionRelatedActionComponent getRelatedActionFirstRep() { 
3002          if (getRelatedAction().isEmpty()) {
3003            addRelatedAction();
3004          }
3005          return getRelatedAction().get(0);
3006        }
3007
3008        /**
3009         * @return {@link #timing} (An optional value describing when the action should be performed.)
3010         */
3011        public Type getTiming() { 
3012          return this.timing;
3013        }
3014
3015        /**
3016         * @return {@link #timing} (An optional value describing when the action should be performed.)
3017         */
3018        public DateTimeType getTimingDateTimeType() throws FHIRException { 
3019          if (this.timing == null)
3020            this.timing = new DateTimeType();
3021          if (!(this.timing instanceof DateTimeType))
3022            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered");
3023          return (DateTimeType) this.timing;
3024        }
3025
3026        public boolean hasTimingDateTimeType() { 
3027          return this != null && this.timing instanceof DateTimeType;
3028        }
3029
3030        /**
3031         * @return {@link #timing} (An optional value describing when the action should be performed.)
3032         */
3033        public Age getTimingAge() throws FHIRException { 
3034          if (this.timing == null)
3035            this.timing = new Age();
3036          if (!(this.timing instanceof Age))
3037            throw new FHIRException("Type mismatch: the type Age was expected, but "+this.timing.getClass().getName()+" was encountered");
3038          return (Age) this.timing;
3039        }
3040
3041        public boolean hasTimingAge() { 
3042          return this != null && this.timing instanceof Age;
3043        }
3044
3045        /**
3046         * @return {@link #timing} (An optional value describing when the action should be performed.)
3047         */
3048        public Period getTimingPeriod() throws FHIRException { 
3049          if (this.timing == null)
3050            this.timing = new Period();
3051          if (!(this.timing instanceof Period))
3052            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered");
3053          return (Period) this.timing;
3054        }
3055
3056        public boolean hasTimingPeriod() { 
3057          return this != null && this.timing instanceof Period;
3058        }
3059
3060        /**
3061         * @return {@link #timing} (An optional value describing when the action should be performed.)
3062         */
3063        public Duration getTimingDuration() throws FHIRException { 
3064          if (this.timing == null)
3065            this.timing = new Duration();
3066          if (!(this.timing instanceof Duration))
3067            throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.timing.getClass().getName()+" was encountered");
3068          return (Duration) this.timing;
3069        }
3070
3071        public boolean hasTimingDuration() { 
3072          return this != null && this.timing instanceof Duration;
3073        }
3074
3075        /**
3076         * @return {@link #timing} (An optional value describing when the action should be performed.)
3077         */
3078        public Range getTimingRange() throws FHIRException { 
3079          if (this.timing == null)
3080            this.timing = new Range();
3081          if (!(this.timing instanceof Range))
3082            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.timing.getClass().getName()+" was encountered");
3083          return (Range) this.timing;
3084        }
3085
3086        public boolean hasTimingRange() { 
3087          return this != null && this.timing instanceof Range;
3088        }
3089
3090        /**
3091         * @return {@link #timing} (An optional value describing when the action should be performed.)
3092         */
3093        public Timing getTimingTiming() throws FHIRException { 
3094          if (this.timing == null)
3095            this.timing = new Timing();
3096          if (!(this.timing instanceof Timing))
3097            throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered");
3098          return (Timing) this.timing;
3099        }
3100
3101        public boolean hasTimingTiming() { 
3102          return this != null && this.timing instanceof Timing;
3103        }
3104
3105        public boolean hasTiming() { 
3106          return this.timing != null && !this.timing.isEmpty();
3107        }
3108
3109        /**
3110         * @param value {@link #timing} (An optional value describing when the action should be performed.)
3111         */
3112        public PlanDefinitionActionComponent setTiming(Type value) { 
3113          if (value != null && !(value instanceof DateTimeType || value instanceof Age || value instanceof Period || value instanceof Duration || value instanceof Range || value instanceof Timing))
3114            throw new Error("Not the right type for PlanDefinition.action.timing[x]: "+value.fhirType());
3115          this.timing = value;
3116          return this;
3117        }
3118
3119        /**
3120         * @return {@link #participant} (Indicates who should participate in performing the action described.)
3121         */
3122        public List<PlanDefinitionActionParticipantComponent> getParticipant() { 
3123          if (this.participant == null)
3124            this.participant = new ArrayList<PlanDefinitionActionParticipantComponent>();
3125          return this.participant;
3126        }
3127
3128        /**
3129         * @return Returns a reference to <code>this</code> for easy method chaining
3130         */
3131        public PlanDefinitionActionComponent setParticipant(List<PlanDefinitionActionParticipantComponent> theParticipant) { 
3132          this.participant = theParticipant;
3133          return this;
3134        }
3135
3136        public boolean hasParticipant() { 
3137          if (this.participant == null)
3138            return false;
3139          for (PlanDefinitionActionParticipantComponent item : this.participant)
3140            if (!item.isEmpty())
3141              return true;
3142          return false;
3143        }
3144
3145        public PlanDefinitionActionParticipantComponent addParticipant() { //3
3146          PlanDefinitionActionParticipantComponent t = new PlanDefinitionActionParticipantComponent();
3147          if (this.participant == null)
3148            this.participant = new ArrayList<PlanDefinitionActionParticipantComponent>();
3149          this.participant.add(t);
3150          return t;
3151        }
3152
3153        public PlanDefinitionActionComponent addParticipant(PlanDefinitionActionParticipantComponent t) { //3
3154          if (t == null)
3155            return this;
3156          if (this.participant == null)
3157            this.participant = new ArrayList<PlanDefinitionActionParticipantComponent>();
3158          this.participant.add(t);
3159          return this;
3160        }
3161
3162        /**
3163         * @return The first repetition of repeating field {@link #participant}, creating it if it does not already exist
3164         */
3165        public PlanDefinitionActionParticipantComponent getParticipantFirstRep() { 
3166          if (getParticipant().isEmpty()) {
3167            addParticipant();
3168          }
3169          return getParticipant().get(0);
3170        }
3171
3172        /**
3173         * @return {@link #type} (The type of action to perform (create, update, remove).)
3174         */
3175        public CodeableConcept getType() { 
3176          if (this.type == null)
3177            if (Configuration.errorOnAutoCreate())
3178              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.type");
3179            else if (Configuration.doAutoCreate())
3180              this.type = new CodeableConcept(); // cc
3181          return this.type;
3182        }
3183
3184        public boolean hasType() { 
3185          return this.type != null && !this.type.isEmpty();
3186        }
3187
3188        /**
3189         * @param value {@link #type} (The type of action to perform (create, update, remove).)
3190         */
3191        public PlanDefinitionActionComponent setType(CodeableConcept value) { 
3192          this.type = value;
3193          return this;
3194        }
3195
3196        /**
3197         * @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
3198         */
3199        public Enumeration<ActionGroupingBehavior> getGroupingBehaviorElement() { 
3200          if (this.groupingBehavior == null)
3201            if (Configuration.errorOnAutoCreate())
3202              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.groupingBehavior");
3203            else if (Configuration.doAutoCreate())
3204              this.groupingBehavior = new Enumeration<ActionGroupingBehavior>(new ActionGroupingBehaviorEnumFactory()); // bb
3205          return this.groupingBehavior;
3206        }
3207
3208        public boolean hasGroupingBehaviorElement() { 
3209          return this.groupingBehavior != null && !this.groupingBehavior.isEmpty();
3210        }
3211
3212        public boolean hasGroupingBehavior() { 
3213          return this.groupingBehavior != null && !this.groupingBehavior.isEmpty();
3214        }
3215
3216        /**
3217         * @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
3218         */
3219        public PlanDefinitionActionComponent setGroupingBehaviorElement(Enumeration<ActionGroupingBehavior> value) { 
3220          this.groupingBehavior = value;
3221          return this;
3222        }
3223
3224        /**
3225         * @return Defines the grouping behavior for the action and its children.
3226         */
3227        public ActionGroupingBehavior getGroupingBehavior() { 
3228          return this.groupingBehavior == null ? null : this.groupingBehavior.getValue();
3229        }
3230
3231        /**
3232         * @param value Defines the grouping behavior for the action and its children.
3233         */
3234        public PlanDefinitionActionComponent setGroupingBehavior(ActionGroupingBehavior value) { 
3235          if (value == null)
3236            this.groupingBehavior = null;
3237          else {
3238            if (this.groupingBehavior == null)
3239              this.groupingBehavior = new Enumeration<ActionGroupingBehavior>(new ActionGroupingBehaviorEnumFactory());
3240            this.groupingBehavior.setValue(value);
3241          }
3242          return this;
3243        }
3244
3245        /**
3246         * @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
3247         */
3248        public Enumeration<ActionSelectionBehavior> getSelectionBehaviorElement() { 
3249          if (this.selectionBehavior == null)
3250            if (Configuration.errorOnAutoCreate())
3251              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.selectionBehavior");
3252            else if (Configuration.doAutoCreate())
3253              this.selectionBehavior = new Enumeration<ActionSelectionBehavior>(new ActionSelectionBehaviorEnumFactory()); // bb
3254          return this.selectionBehavior;
3255        }
3256
3257        public boolean hasSelectionBehaviorElement() { 
3258          return this.selectionBehavior != null && !this.selectionBehavior.isEmpty();
3259        }
3260
3261        public boolean hasSelectionBehavior() { 
3262          return this.selectionBehavior != null && !this.selectionBehavior.isEmpty();
3263        }
3264
3265        /**
3266         * @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
3267         */
3268        public PlanDefinitionActionComponent setSelectionBehaviorElement(Enumeration<ActionSelectionBehavior> value) { 
3269          this.selectionBehavior = value;
3270          return this;
3271        }
3272
3273        /**
3274         * @return Defines the selection behavior for the action and its children.
3275         */
3276        public ActionSelectionBehavior getSelectionBehavior() { 
3277          return this.selectionBehavior == null ? null : this.selectionBehavior.getValue();
3278        }
3279
3280        /**
3281         * @param value Defines the selection behavior for the action and its children.
3282         */
3283        public PlanDefinitionActionComponent setSelectionBehavior(ActionSelectionBehavior value) { 
3284          if (value == null)
3285            this.selectionBehavior = null;
3286          else {
3287            if (this.selectionBehavior == null)
3288              this.selectionBehavior = new Enumeration<ActionSelectionBehavior>(new ActionSelectionBehaviorEnumFactory());
3289            this.selectionBehavior.setValue(value);
3290          }
3291          return this;
3292        }
3293
3294        /**
3295         * @return {@link #requiredBehavior} (Defines the required behavior for the action.). This is the underlying object with id, value and extensions. The accessor "getRequiredBehavior" gives direct access to the value
3296         */
3297        public Enumeration<ActionRequiredBehavior> getRequiredBehaviorElement() { 
3298          if (this.requiredBehavior == null)
3299            if (Configuration.errorOnAutoCreate())
3300              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.requiredBehavior");
3301            else if (Configuration.doAutoCreate())
3302              this.requiredBehavior = new Enumeration<ActionRequiredBehavior>(new ActionRequiredBehaviorEnumFactory()); // bb
3303          return this.requiredBehavior;
3304        }
3305
3306        public boolean hasRequiredBehaviorElement() { 
3307          return this.requiredBehavior != null && !this.requiredBehavior.isEmpty();
3308        }
3309
3310        public boolean hasRequiredBehavior() { 
3311          return this.requiredBehavior != null && !this.requiredBehavior.isEmpty();
3312        }
3313
3314        /**
3315         * @param value {@link #requiredBehavior} (Defines the required behavior for the action.). This is the underlying object with id, value and extensions. The accessor "getRequiredBehavior" gives direct access to the value
3316         */
3317        public PlanDefinitionActionComponent setRequiredBehaviorElement(Enumeration<ActionRequiredBehavior> value) { 
3318          this.requiredBehavior = value;
3319          return this;
3320        }
3321
3322        /**
3323         * @return Defines the required behavior for the action.
3324         */
3325        public ActionRequiredBehavior getRequiredBehavior() { 
3326          return this.requiredBehavior == null ? null : this.requiredBehavior.getValue();
3327        }
3328
3329        /**
3330         * @param value Defines the required behavior for the action.
3331         */
3332        public PlanDefinitionActionComponent setRequiredBehavior(ActionRequiredBehavior value) { 
3333          if (value == null)
3334            this.requiredBehavior = null;
3335          else {
3336            if (this.requiredBehavior == null)
3337              this.requiredBehavior = new Enumeration<ActionRequiredBehavior>(new ActionRequiredBehaviorEnumFactory());
3338            this.requiredBehavior.setValue(value);
3339          }
3340          return this;
3341        }
3342
3343        /**
3344         * @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
3345         */
3346        public Enumeration<ActionPrecheckBehavior> getPrecheckBehaviorElement() { 
3347          if (this.precheckBehavior == null)
3348            if (Configuration.errorOnAutoCreate())
3349              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.precheckBehavior");
3350            else if (Configuration.doAutoCreate())
3351              this.precheckBehavior = new Enumeration<ActionPrecheckBehavior>(new ActionPrecheckBehaviorEnumFactory()); // bb
3352          return this.precheckBehavior;
3353        }
3354
3355        public boolean hasPrecheckBehaviorElement() { 
3356          return this.precheckBehavior != null && !this.precheckBehavior.isEmpty();
3357        }
3358
3359        public boolean hasPrecheckBehavior() { 
3360          return this.precheckBehavior != null && !this.precheckBehavior.isEmpty();
3361        }
3362
3363        /**
3364         * @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
3365         */
3366        public PlanDefinitionActionComponent setPrecheckBehaviorElement(Enumeration<ActionPrecheckBehavior> value) { 
3367          this.precheckBehavior = value;
3368          return this;
3369        }
3370
3371        /**
3372         * @return Defines whether the action should usually be preselected.
3373         */
3374        public ActionPrecheckBehavior getPrecheckBehavior() { 
3375          return this.precheckBehavior == null ? null : this.precheckBehavior.getValue();
3376        }
3377
3378        /**
3379         * @param value Defines whether the action should usually be preselected.
3380         */
3381        public PlanDefinitionActionComponent setPrecheckBehavior(ActionPrecheckBehavior value) { 
3382          if (value == null)
3383            this.precheckBehavior = null;
3384          else {
3385            if (this.precheckBehavior == null)
3386              this.precheckBehavior = new Enumeration<ActionPrecheckBehavior>(new ActionPrecheckBehaviorEnumFactory());
3387            this.precheckBehavior.setValue(value);
3388          }
3389          return this;
3390        }
3391
3392        /**
3393         * @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
3394         */
3395        public Enumeration<ActionCardinalityBehavior> getCardinalityBehaviorElement() { 
3396          if (this.cardinalityBehavior == null)
3397            if (Configuration.errorOnAutoCreate())
3398              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.cardinalityBehavior");
3399            else if (Configuration.doAutoCreate())
3400              this.cardinalityBehavior = new Enumeration<ActionCardinalityBehavior>(new ActionCardinalityBehaviorEnumFactory()); // bb
3401          return this.cardinalityBehavior;
3402        }
3403
3404        public boolean hasCardinalityBehaviorElement() { 
3405          return this.cardinalityBehavior != null && !this.cardinalityBehavior.isEmpty();
3406        }
3407
3408        public boolean hasCardinalityBehavior() { 
3409          return this.cardinalityBehavior != null && !this.cardinalityBehavior.isEmpty();
3410        }
3411
3412        /**
3413         * @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
3414         */
3415        public PlanDefinitionActionComponent setCardinalityBehaviorElement(Enumeration<ActionCardinalityBehavior> value) { 
3416          this.cardinalityBehavior = value;
3417          return this;
3418        }
3419
3420        /**
3421         * @return Defines whether the action can be selected multiple times.
3422         */
3423        public ActionCardinalityBehavior getCardinalityBehavior() { 
3424          return this.cardinalityBehavior == null ? null : this.cardinalityBehavior.getValue();
3425        }
3426
3427        /**
3428         * @param value Defines whether the action can be selected multiple times.
3429         */
3430        public PlanDefinitionActionComponent setCardinalityBehavior(ActionCardinalityBehavior value) { 
3431          if (value == null)
3432            this.cardinalityBehavior = null;
3433          else {
3434            if (this.cardinalityBehavior == null)
3435              this.cardinalityBehavior = new Enumeration<ActionCardinalityBehavior>(new ActionCardinalityBehaviorEnumFactory());
3436            this.cardinalityBehavior.setValue(value);
3437          }
3438          return this;
3439        }
3440
3441        /**
3442         * @return {@link #definition} (A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.)
3443         */
3444        public Type getDefinition() { 
3445          return this.definition;
3446        }
3447
3448        /**
3449         * @return {@link #definition} (A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.)
3450         */
3451        public CanonicalType getDefinitionCanonicalType() throws FHIRException { 
3452          if (this.definition == null)
3453            this.definition = new CanonicalType();
3454          if (!(this.definition instanceof CanonicalType))
3455            throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.definition.getClass().getName()+" was encountered");
3456          return (CanonicalType) this.definition;
3457        }
3458
3459        public boolean hasDefinitionCanonicalType() { 
3460          return this != null && this.definition instanceof CanonicalType;
3461        }
3462
3463        /**
3464         * @return {@link #definition} (A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.)
3465         */
3466        public UriType getDefinitionUriType() throws FHIRException { 
3467          if (this.definition == null)
3468            this.definition = new UriType();
3469          if (!(this.definition instanceof UriType))
3470            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.definition.getClass().getName()+" was encountered");
3471          return (UriType) this.definition;
3472        }
3473
3474        public boolean hasDefinitionUriType() { 
3475          return this != null && this.definition instanceof UriType;
3476        }
3477
3478        public boolean hasDefinition() { 
3479          return this.definition != null && !this.definition.isEmpty();
3480        }
3481
3482        /**
3483         * @param value {@link #definition} (A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.)
3484         */
3485        public PlanDefinitionActionComponent setDefinition(Type value) { 
3486          if (value != null && !(value instanceof CanonicalType || value instanceof UriType))
3487            throw new Error("Not the right type for PlanDefinition.action.definition[x]: "+value.fhirType());
3488          this.definition = value;
3489          return this;
3490        }
3491
3492        /**
3493         * @return {@link #transform} (A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.). This is the underlying object with id, value and extensions. The accessor "getTransform" gives direct access to the value
3494         */
3495        public CanonicalType getTransformElement() { 
3496          if (this.transform == null)
3497            if (Configuration.errorOnAutoCreate())
3498              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.transform");
3499            else if (Configuration.doAutoCreate())
3500              this.transform = new CanonicalType(); // bb
3501          return this.transform;
3502        }
3503
3504        public boolean hasTransformElement() { 
3505          return this.transform != null && !this.transform.isEmpty();
3506        }
3507
3508        public boolean hasTransform() { 
3509          return this.transform != null && !this.transform.isEmpty();
3510        }
3511
3512        /**
3513         * @param value {@link #transform} (A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.). This is the underlying object with id, value and extensions. The accessor "getTransform" gives direct access to the value
3514         */
3515        public PlanDefinitionActionComponent setTransformElement(CanonicalType value) { 
3516          this.transform = value;
3517          return this;
3518        }
3519
3520        /**
3521         * @return A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.
3522         */
3523        public String getTransform() { 
3524          return this.transform == null ? null : this.transform.getValue();
3525        }
3526
3527        /**
3528         * @param value A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.
3529         */
3530        public PlanDefinitionActionComponent setTransform(String value) { 
3531          if (Utilities.noString(value))
3532            this.transform = null;
3533          else {
3534            if (this.transform == null)
3535              this.transform = new CanonicalType();
3536            this.transform.setValue(value);
3537          }
3538          return this;
3539        }
3540
3541        /**
3542         * @return {@link #dynamicValue} (Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.)
3543         */
3544        public List<PlanDefinitionActionDynamicValueComponent> getDynamicValue() { 
3545          if (this.dynamicValue == null)
3546            this.dynamicValue = new ArrayList<PlanDefinitionActionDynamicValueComponent>();
3547          return this.dynamicValue;
3548        }
3549
3550        /**
3551         * @return Returns a reference to <code>this</code> for easy method chaining
3552         */
3553        public PlanDefinitionActionComponent setDynamicValue(List<PlanDefinitionActionDynamicValueComponent> theDynamicValue) { 
3554          this.dynamicValue = theDynamicValue;
3555          return this;
3556        }
3557
3558        public boolean hasDynamicValue() { 
3559          if (this.dynamicValue == null)
3560            return false;
3561          for (PlanDefinitionActionDynamicValueComponent item : this.dynamicValue)
3562            if (!item.isEmpty())
3563              return true;
3564          return false;
3565        }
3566
3567        public PlanDefinitionActionDynamicValueComponent addDynamicValue() { //3
3568          PlanDefinitionActionDynamicValueComponent t = new PlanDefinitionActionDynamicValueComponent();
3569          if (this.dynamicValue == null)
3570            this.dynamicValue = new ArrayList<PlanDefinitionActionDynamicValueComponent>();
3571          this.dynamicValue.add(t);
3572          return t;
3573        }
3574
3575        public PlanDefinitionActionComponent addDynamicValue(PlanDefinitionActionDynamicValueComponent t) { //3
3576          if (t == null)
3577            return this;
3578          if (this.dynamicValue == null)
3579            this.dynamicValue = new ArrayList<PlanDefinitionActionDynamicValueComponent>();
3580          this.dynamicValue.add(t);
3581          return this;
3582        }
3583
3584        /**
3585         * @return The first repetition of repeating field {@link #dynamicValue}, creating it if it does not already exist
3586         */
3587        public PlanDefinitionActionDynamicValueComponent getDynamicValueFirstRep() { 
3588          if (getDynamicValue().isEmpty()) {
3589            addDynamicValue();
3590          }
3591          return getDynamicValue().get(0);
3592        }
3593
3594        /**
3595         * @return {@link #action} (Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.)
3596         */
3597        public List<PlanDefinitionActionComponent> getAction() { 
3598          if (this.action == null)
3599            this.action = new ArrayList<PlanDefinitionActionComponent>();
3600          return this.action;
3601        }
3602
3603        /**
3604         * @return Returns a reference to <code>this</code> for easy method chaining
3605         */
3606        public PlanDefinitionActionComponent setAction(List<PlanDefinitionActionComponent> theAction) { 
3607          this.action = theAction;
3608          return this;
3609        }
3610
3611        public boolean hasAction() { 
3612          if (this.action == null)
3613            return false;
3614          for (PlanDefinitionActionComponent item : this.action)
3615            if (!item.isEmpty())
3616              return true;
3617          return false;
3618        }
3619
3620        public PlanDefinitionActionComponent addAction() { //3
3621          PlanDefinitionActionComponent t = new PlanDefinitionActionComponent();
3622          if (this.action == null)
3623            this.action = new ArrayList<PlanDefinitionActionComponent>();
3624          this.action.add(t);
3625          return t;
3626        }
3627
3628        public PlanDefinitionActionComponent addAction(PlanDefinitionActionComponent t) { //3
3629          if (t == null)
3630            return this;
3631          if (this.action == null)
3632            this.action = new ArrayList<PlanDefinitionActionComponent>();
3633          this.action.add(t);
3634          return this;
3635        }
3636
3637        /**
3638         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist
3639         */
3640        public PlanDefinitionActionComponent getActionFirstRep() { 
3641          if (getAction().isEmpty()) {
3642            addAction();
3643          }
3644          return getAction().get(0);
3645        }
3646
3647        protected void listChildren(List<Property> children) {
3648          super.listChildren(children);
3649          children.add(new Property("prefix", "string", "A user-visible prefix for the action.", 0, 1, prefix));
3650          children.add(new Property("title", "string", "The title of the action displayed to a user.", 0, 1, title));
3651          children.add(new Property("description", "string", "A brief description of the action used to provide a summary to display to the user.", 0, 1, description));
3652          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));
3653          children.add(new Property("priority", "code", "Indicates how quickly the action should be addressed with respect to other actions.", 0, 1, priority));
3654          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 the section of a documentation template.", 0, java.lang.Integer.MAX_VALUE, code));
3655          children.add(new Property("reason", "CodeableConcept", "A description of why this action is necessary or appropriate.", 0, java.lang.Integer.MAX_VALUE, reason));
3656          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));
3657          children.add(new Property("goalId", "id", "Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition.", 0, java.lang.Integer.MAX_VALUE, goalId));
3658          children.add(new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the action and its children, if any.", 0, 1, subject));
3659          children.add(new Property("trigger", "TriggerDefinition", "A description of when the action should be triggered.", 0, java.lang.Integer.MAX_VALUE, trigger));
3660          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));
3661          children.add(new Property("input", "DataRequirement", "Defines input data requirements for the action.", 0, java.lang.Integer.MAX_VALUE, input));
3662          children.add(new Property("output", "DataRequirement", "Defines the outputs of the action, if any.", 0, java.lang.Integer.MAX_VALUE, output));
3663          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));
3664          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));
3665          children.add(new Property("participant", "", "Indicates who should participate in performing the action described.", 0, java.lang.Integer.MAX_VALUE, participant));
3666          children.add(new Property("type", "CodeableConcept", "The type of action to perform (create, update, remove).", 0, 1, type));
3667          children.add(new Property("groupingBehavior", "code", "Defines the grouping behavior for the action and its children.", 0, 1, groupingBehavior));
3668          children.add(new Property("selectionBehavior", "code", "Defines the selection behavior for the action and its children.", 0, 1, selectionBehavior));
3669          children.add(new Property("requiredBehavior", "code", "Defines the required behavior for the action.", 0, 1, requiredBehavior));
3670          children.add(new Property("precheckBehavior", "code", "Defines whether the action should usually be preselected.", 0, 1, precheckBehavior));
3671          children.add(new Property("cardinalityBehavior", "code", "Defines whether the action can be selected multiple times.", 0, 1, cardinalityBehavior));
3672          children.add(new Property("definition[x]", "canonical(ActivityDefinition|PlanDefinition|Questionnaire)|uri", "A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.", 0, 1, definition));
3673          children.add(new Property("transform", "canonical(StructureMap)", "A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.", 0, 1, transform));
3674          children.add(new Property("dynamicValue", "", "Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.", 0, java.lang.Integer.MAX_VALUE, dynamicValue));
3675          children.add(new Property("action", "@PlanDefinition.action", "Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.", 0, java.lang.Integer.MAX_VALUE, action));
3676        }
3677
3678        @Override
3679        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3680          switch (_hash) {
3681          case -980110702: /*prefix*/  return new Property("prefix", "string", "A user-visible prefix for the action.", 0, 1, prefix);
3682          case 110371416: /*title*/  return new Property("title", "string", "The title of the action displayed to a user.", 0, 1, title);
3683          case -1724546052: /*description*/  return new Property("description", "string", "A brief description of the action used to provide a summary to display to the user.", 0, 1, description);
3684          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);
3685          case -1165461084: /*priority*/  return new Property("priority", "code", "Indicates how quickly the action should be addressed with respect to other actions.", 0, 1, priority);
3686          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 the section of a documentation template.", 0, java.lang.Integer.MAX_VALUE, code);
3687          case -934964668: /*reason*/  return new Property("reason", "CodeableConcept", "A description of why this action is necessary or appropriate.", 0, java.lang.Integer.MAX_VALUE, reason);
3688          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);
3689          case -1240658034: /*goalId*/  return new Property("goalId", "id", "Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition.", 0, java.lang.Integer.MAX_VALUE, goalId);
3690          case -573640748: /*subject[x]*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the action and its children, if any.", 0, 1, subject);
3691          case -1867885268: /*subject*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the action and its children, if any.", 0, 1, subject);
3692          case -1257122603: /*subjectCodeableConcept*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the action and its children, if any.", 0, 1, subject);
3693          case 772938623: /*subjectReference*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the action and its children, if any.", 0, 1, subject);
3694          case -1059891784: /*trigger*/  return new Property("trigger", "TriggerDefinition", "A description of when the action should be triggered.", 0, java.lang.Integer.MAX_VALUE, trigger);
3695          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);
3696          case 100358090: /*input*/  return new Property("input", "DataRequirement", "Defines input data requirements for the action.", 0, java.lang.Integer.MAX_VALUE, input);
3697          case -1005512447: /*output*/  return new Property("output", "DataRequirement", "Defines the outputs of the action, if any.", 0, java.lang.Integer.MAX_VALUE, output);
3698          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);
3699          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);
3700          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);
3701          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);
3702          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);
3703          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);
3704          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);
3705          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);
3706          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);
3707          case 767422259: /*participant*/  return new Property("participant", "", "Indicates who should participate in performing the action described.", 0, java.lang.Integer.MAX_VALUE, participant);
3708          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The type of action to perform (create, update, remove).", 0, 1, type);
3709          case 586678389: /*groupingBehavior*/  return new Property("groupingBehavior", "code", "Defines the grouping behavior for the action and its children.", 0, 1, groupingBehavior);
3710          case 168639486: /*selectionBehavior*/  return new Property("selectionBehavior", "code", "Defines the selection behavior for the action and its children.", 0, 1, selectionBehavior);
3711          case -1163906287: /*requiredBehavior*/  return new Property("requiredBehavior", "code", "Defines the required behavior for the action.", 0, 1, requiredBehavior);
3712          case -1174249033: /*precheckBehavior*/  return new Property("precheckBehavior", "code", "Defines whether the action should usually be preselected.", 0, 1, precheckBehavior);
3713          case -922577408: /*cardinalityBehavior*/  return new Property("cardinalityBehavior", "code", "Defines whether the action can be selected multiple times.", 0, 1, cardinalityBehavior);
3714          case -1139422643: /*definition[x]*/  return new Property("definition[x]", "canonical(ActivityDefinition|PlanDefinition|Questionnaire)|uri", "A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.", 0, 1, definition);
3715          case -1014418093: /*definition*/  return new Property("definition[x]", "canonical(ActivityDefinition|PlanDefinition|Questionnaire)|uri", "A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.", 0, 1, definition);
3716          case 933485793: /*definitionCanonical*/  return new Property("definition[x]", "canonical(ActivityDefinition|PlanDefinition|Questionnaire)|uri", "A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.", 0, 1, definition);
3717          case -1139428583: /*definitionUri*/  return new Property("definition[x]", "canonical(ActivityDefinition|PlanDefinition|Questionnaire)|uri", "A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.", 0, 1, definition);
3718          case 1052666732: /*transform*/  return new Property("transform", "canonical(StructureMap)", "A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.", 0, 1, transform);
3719          case 572625010: /*dynamicValue*/  return new Property("dynamicValue", "", "Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.", 0, java.lang.Integer.MAX_VALUE, dynamicValue);
3720          case -1422950858: /*action*/  return new Property("action", "@PlanDefinition.action", "Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.", 0, java.lang.Integer.MAX_VALUE, action);
3721          default: return super.getNamedProperty(_hash, _name, _checkValid);
3722          }
3723
3724        }
3725
3726      @Override
3727      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3728        switch (hash) {
3729        case -980110702: /*prefix*/ return this.prefix == null ? new Base[0] : new Base[] {this.prefix}; // StringType
3730        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
3731        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
3732        case -900391049: /*textEquivalent*/ return this.textEquivalent == null ? new Base[0] : new Base[] {this.textEquivalent}; // StringType
3733        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration<RequestPriority>
3734        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept
3735        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept
3736        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : this.documentation.toArray(new Base[this.documentation.size()]); // RelatedArtifact
3737        case -1240658034: /*goalId*/ return this.goalId == null ? new Base[0] : this.goalId.toArray(new Base[this.goalId.size()]); // IdType
3738        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Type
3739        case -1059891784: /*trigger*/ return this.trigger == null ? new Base[0] : this.trigger.toArray(new Base[this.trigger.size()]); // TriggerDefinition
3740        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // PlanDefinitionActionConditionComponent
3741        case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // DataRequirement
3742        case -1005512447: /*output*/ return this.output == null ? new Base[0] : this.output.toArray(new Base[this.output.size()]); // DataRequirement
3743        case -384107967: /*relatedAction*/ return this.relatedAction == null ? new Base[0] : this.relatedAction.toArray(new Base[this.relatedAction.size()]); // PlanDefinitionActionRelatedActionComponent
3744        case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type
3745        case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // PlanDefinitionActionParticipantComponent
3746        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3747        case 586678389: /*groupingBehavior*/ return this.groupingBehavior == null ? new Base[0] : new Base[] {this.groupingBehavior}; // Enumeration<ActionGroupingBehavior>
3748        case 168639486: /*selectionBehavior*/ return this.selectionBehavior == null ? new Base[0] : new Base[] {this.selectionBehavior}; // Enumeration<ActionSelectionBehavior>
3749        case -1163906287: /*requiredBehavior*/ return this.requiredBehavior == null ? new Base[0] : new Base[] {this.requiredBehavior}; // Enumeration<ActionRequiredBehavior>
3750        case -1174249033: /*precheckBehavior*/ return this.precheckBehavior == null ? new Base[0] : new Base[] {this.precheckBehavior}; // Enumeration<ActionPrecheckBehavior>
3751        case -922577408: /*cardinalityBehavior*/ return this.cardinalityBehavior == null ? new Base[0] : new Base[] {this.cardinalityBehavior}; // Enumeration<ActionCardinalityBehavior>
3752        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // Type
3753        case 1052666732: /*transform*/ return this.transform == null ? new Base[0] : new Base[] {this.transform}; // CanonicalType
3754        case 572625010: /*dynamicValue*/ return this.dynamicValue == null ? new Base[0] : this.dynamicValue.toArray(new Base[this.dynamicValue.size()]); // PlanDefinitionActionDynamicValueComponent
3755        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // PlanDefinitionActionComponent
3756        default: return super.getProperty(hash, name, checkValid);
3757        }
3758
3759      }
3760
3761      @Override
3762      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3763        switch (hash) {
3764        case -980110702: // prefix
3765          this.prefix = castToString(value); // StringType
3766          return value;
3767        case 110371416: // title
3768          this.title = castToString(value); // StringType
3769          return value;
3770        case -1724546052: // description
3771          this.description = castToString(value); // StringType
3772          return value;
3773        case -900391049: // textEquivalent
3774          this.textEquivalent = castToString(value); // StringType
3775          return value;
3776        case -1165461084: // priority
3777          value = new RequestPriorityEnumFactory().fromType(castToCode(value));
3778          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
3779          return value;
3780        case 3059181: // code
3781          this.getCode().add(castToCodeableConcept(value)); // CodeableConcept
3782          return value;
3783        case -934964668: // reason
3784          this.getReason().add(castToCodeableConcept(value)); // CodeableConcept
3785          return value;
3786        case 1587405498: // documentation
3787          this.getDocumentation().add(castToRelatedArtifact(value)); // RelatedArtifact
3788          return value;
3789        case -1240658034: // goalId
3790          this.getGoalId().add(castToId(value)); // IdType
3791          return value;
3792        case -1867885268: // subject
3793          this.subject = castToType(value); // Type
3794          return value;
3795        case -1059891784: // trigger
3796          this.getTrigger().add(castToTriggerDefinition(value)); // TriggerDefinition
3797          return value;
3798        case -861311717: // condition
3799          this.getCondition().add((PlanDefinitionActionConditionComponent) value); // PlanDefinitionActionConditionComponent
3800          return value;
3801        case 100358090: // input
3802          this.getInput().add(castToDataRequirement(value)); // DataRequirement
3803          return value;
3804        case -1005512447: // output
3805          this.getOutput().add(castToDataRequirement(value)); // DataRequirement
3806          return value;
3807        case -384107967: // relatedAction
3808          this.getRelatedAction().add((PlanDefinitionActionRelatedActionComponent) value); // PlanDefinitionActionRelatedActionComponent
3809          return value;
3810        case -873664438: // timing
3811          this.timing = castToType(value); // Type
3812          return value;
3813        case 767422259: // participant
3814          this.getParticipant().add((PlanDefinitionActionParticipantComponent) value); // PlanDefinitionActionParticipantComponent
3815          return value;
3816        case 3575610: // type
3817          this.type = castToCodeableConcept(value); // CodeableConcept
3818          return value;
3819        case 586678389: // groupingBehavior
3820          value = new ActionGroupingBehaviorEnumFactory().fromType(castToCode(value));
3821          this.groupingBehavior = (Enumeration) value; // Enumeration<ActionGroupingBehavior>
3822          return value;
3823        case 168639486: // selectionBehavior
3824          value = new ActionSelectionBehaviorEnumFactory().fromType(castToCode(value));
3825          this.selectionBehavior = (Enumeration) value; // Enumeration<ActionSelectionBehavior>
3826          return value;
3827        case -1163906287: // requiredBehavior
3828          value = new ActionRequiredBehaviorEnumFactory().fromType(castToCode(value));
3829          this.requiredBehavior = (Enumeration) value; // Enumeration<ActionRequiredBehavior>
3830          return value;
3831        case -1174249033: // precheckBehavior
3832          value = new ActionPrecheckBehaviorEnumFactory().fromType(castToCode(value));
3833          this.precheckBehavior = (Enumeration) value; // Enumeration<ActionPrecheckBehavior>
3834          return value;
3835        case -922577408: // cardinalityBehavior
3836          value = new ActionCardinalityBehaviorEnumFactory().fromType(castToCode(value));
3837          this.cardinalityBehavior = (Enumeration) value; // Enumeration<ActionCardinalityBehavior>
3838          return value;
3839        case -1014418093: // definition
3840          this.definition = castToType(value); // Type
3841          return value;
3842        case 1052666732: // transform
3843          this.transform = castToCanonical(value); // CanonicalType
3844          return value;
3845        case 572625010: // dynamicValue
3846          this.getDynamicValue().add((PlanDefinitionActionDynamicValueComponent) value); // PlanDefinitionActionDynamicValueComponent
3847          return value;
3848        case -1422950858: // action
3849          this.getAction().add((PlanDefinitionActionComponent) value); // PlanDefinitionActionComponent
3850          return value;
3851        default: return super.setProperty(hash, name, value);
3852        }
3853
3854      }
3855
3856      @Override
3857      public Base setProperty(String name, Base value) throws FHIRException {
3858        if (name.equals("prefix")) {
3859          this.prefix = castToString(value); // StringType
3860        } else if (name.equals("title")) {
3861          this.title = castToString(value); // StringType
3862        } else if (name.equals("description")) {
3863          this.description = castToString(value); // StringType
3864        } else if (name.equals("textEquivalent")) {
3865          this.textEquivalent = castToString(value); // StringType
3866        } else if (name.equals("priority")) {
3867          value = new RequestPriorityEnumFactory().fromType(castToCode(value));
3868          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
3869        } else if (name.equals("code")) {
3870          this.getCode().add(castToCodeableConcept(value));
3871        } else if (name.equals("reason")) {
3872          this.getReason().add(castToCodeableConcept(value));
3873        } else if (name.equals("documentation")) {
3874          this.getDocumentation().add(castToRelatedArtifact(value));
3875        } else if (name.equals("goalId")) {
3876          this.getGoalId().add(castToId(value));
3877        } else if (name.equals("subject[x]")) {
3878          this.subject = castToType(value); // Type
3879        } else if (name.equals("trigger")) {
3880          this.getTrigger().add(castToTriggerDefinition(value));
3881        } else if (name.equals("condition")) {
3882          this.getCondition().add((PlanDefinitionActionConditionComponent) value);
3883        } else if (name.equals("input")) {
3884          this.getInput().add(castToDataRequirement(value));
3885        } else if (name.equals("output")) {
3886          this.getOutput().add(castToDataRequirement(value));
3887        } else if (name.equals("relatedAction")) {
3888          this.getRelatedAction().add((PlanDefinitionActionRelatedActionComponent) value);
3889        } else if (name.equals("timing[x]")) {
3890          this.timing = castToType(value); // Type
3891        } else if (name.equals("participant")) {
3892          this.getParticipant().add((PlanDefinitionActionParticipantComponent) value);
3893        } else if (name.equals("type")) {
3894          this.type = castToCodeableConcept(value); // CodeableConcept
3895        } else if (name.equals("groupingBehavior")) {
3896          value = new ActionGroupingBehaviorEnumFactory().fromType(castToCode(value));
3897          this.groupingBehavior = (Enumeration) value; // Enumeration<ActionGroupingBehavior>
3898        } else if (name.equals("selectionBehavior")) {
3899          value = new ActionSelectionBehaviorEnumFactory().fromType(castToCode(value));
3900          this.selectionBehavior = (Enumeration) value; // Enumeration<ActionSelectionBehavior>
3901        } else if (name.equals("requiredBehavior")) {
3902          value = new ActionRequiredBehaviorEnumFactory().fromType(castToCode(value));
3903          this.requiredBehavior = (Enumeration) value; // Enumeration<ActionRequiredBehavior>
3904        } else if (name.equals("precheckBehavior")) {
3905          value = new ActionPrecheckBehaviorEnumFactory().fromType(castToCode(value));
3906          this.precheckBehavior = (Enumeration) value; // Enumeration<ActionPrecheckBehavior>
3907        } else if (name.equals("cardinalityBehavior")) {
3908          value = new ActionCardinalityBehaviorEnumFactory().fromType(castToCode(value));
3909          this.cardinalityBehavior = (Enumeration) value; // Enumeration<ActionCardinalityBehavior>
3910        } else if (name.equals("definition[x]")) {
3911          this.definition = castToType(value); // Type
3912        } else if (name.equals("transform")) {
3913          this.transform = castToCanonical(value); // CanonicalType
3914        } else if (name.equals("dynamicValue")) {
3915          this.getDynamicValue().add((PlanDefinitionActionDynamicValueComponent) value);
3916        } else if (name.equals("action")) {
3917          this.getAction().add((PlanDefinitionActionComponent) value);
3918        } else
3919          return super.setProperty(name, value);
3920        return value;
3921      }
3922
3923      @Override
3924      public Base makeProperty(int hash, String name) throws FHIRException {
3925        switch (hash) {
3926        case -980110702:  return getPrefixElement();
3927        case 110371416:  return getTitleElement();
3928        case -1724546052:  return getDescriptionElement();
3929        case -900391049:  return getTextEquivalentElement();
3930        case -1165461084:  return getPriorityElement();
3931        case 3059181:  return addCode(); 
3932        case -934964668:  return addReason(); 
3933        case 1587405498:  return addDocumentation(); 
3934        case -1240658034:  return addGoalIdElement();
3935        case -573640748:  return getSubject(); 
3936        case -1867885268:  return getSubject(); 
3937        case -1059891784:  return addTrigger(); 
3938        case -861311717:  return addCondition(); 
3939        case 100358090:  return addInput(); 
3940        case -1005512447:  return addOutput(); 
3941        case -384107967:  return addRelatedAction(); 
3942        case 164632566:  return getTiming(); 
3943        case -873664438:  return getTiming(); 
3944        case 767422259:  return addParticipant(); 
3945        case 3575610:  return getType(); 
3946        case 586678389:  return getGroupingBehaviorElement();
3947        case 168639486:  return getSelectionBehaviorElement();
3948        case -1163906287:  return getRequiredBehaviorElement();
3949        case -1174249033:  return getPrecheckBehaviorElement();
3950        case -922577408:  return getCardinalityBehaviorElement();
3951        case -1139422643:  return getDefinition(); 
3952        case -1014418093:  return getDefinition(); 
3953        case 1052666732:  return getTransformElement();
3954        case 572625010:  return addDynamicValue(); 
3955        case -1422950858:  return addAction(); 
3956        default: return super.makeProperty(hash, name);
3957        }
3958
3959      }
3960
3961      @Override
3962      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3963        switch (hash) {
3964        case -980110702: /*prefix*/ return new String[] {"string"};
3965        case 110371416: /*title*/ return new String[] {"string"};
3966        case -1724546052: /*description*/ return new String[] {"string"};
3967        case -900391049: /*textEquivalent*/ return new String[] {"string"};
3968        case -1165461084: /*priority*/ return new String[] {"code"};
3969        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
3970        case -934964668: /*reason*/ return new String[] {"CodeableConcept"};
3971        case 1587405498: /*documentation*/ return new String[] {"RelatedArtifact"};
3972        case -1240658034: /*goalId*/ return new String[] {"id"};
3973        case -1867885268: /*subject*/ return new String[] {"CodeableConcept", "Reference"};
3974        case -1059891784: /*trigger*/ return new String[] {"TriggerDefinition"};
3975        case -861311717: /*condition*/ return new String[] {};
3976        case 100358090: /*input*/ return new String[] {"DataRequirement"};
3977        case -1005512447: /*output*/ return new String[] {"DataRequirement"};
3978        case -384107967: /*relatedAction*/ return new String[] {};
3979        case -873664438: /*timing*/ return new String[] {"dateTime", "Age", "Period", "Duration", "Range", "Timing"};
3980        case 767422259: /*participant*/ return new String[] {};
3981        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3982        case 586678389: /*groupingBehavior*/ return new String[] {"code"};
3983        case 168639486: /*selectionBehavior*/ return new String[] {"code"};
3984        case -1163906287: /*requiredBehavior*/ return new String[] {"code"};
3985        case -1174249033: /*precheckBehavior*/ return new String[] {"code"};
3986        case -922577408: /*cardinalityBehavior*/ return new String[] {"code"};
3987        case -1014418093: /*definition*/ return new String[] {"canonical", "uri"};
3988        case 1052666732: /*transform*/ return new String[] {"canonical"};
3989        case 572625010: /*dynamicValue*/ return new String[] {};
3990        case -1422950858: /*action*/ return new String[] {"@PlanDefinition.action"};
3991        default: return super.getTypesForProperty(hash, name);
3992        }
3993
3994      }
3995
3996      @Override
3997      public Base addChild(String name) throws FHIRException {
3998        if (name.equals("prefix")) {
3999          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.prefix");
4000        }
4001        else if (name.equals("title")) {
4002          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.title");
4003        }
4004        else if (name.equals("description")) {
4005          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.description");
4006        }
4007        else if (name.equals("textEquivalent")) {
4008          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.textEquivalent");
4009        }
4010        else if (name.equals("priority")) {
4011          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.priority");
4012        }
4013        else if (name.equals("code")) {
4014          return addCode();
4015        }
4016        else if (name.equals("reason")) {
4017          return addReason();
4018        }
4019        else if (name.equals("documentation")) {
4020          return addDocumentation();
4021        }
4022        else if (name.equals("goalId")) {
4023          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.goalId");
4024        }
4025        else if (name.equals("subjectCodeableConcept")) {
4026          this.subject = new CodeableConcept();
4027          return this.subject;
4028        }
4029        else if (name.equals("subjectReference")) {
4030          this.subject = new Reference();
4031          return this.subject;
4032        }
4033        else if (name.equals("trigger")) {
4034          return addTrigger();
4035        }
4036        else if (name.equals("condition")) {
4037          return addCondition();
4038        }
4039        else if (name.equals("input")) {
4040          return addInput();
4041        }
4042        else if (name.equals("output")) {
4043          return addOutput();
4044        }
4045        else if (name.equals("relatedAction")) {
4046          return addRelatedAction();
4047        }
4048        else if (name.equals("timingDateTime")) {
4049          this.timing = new DateTimeType();
4050          return this.timing;
4051        }
4052        else if (name.equals("timingAge")) {
4053          this.timing = new Age();
4054          return this.timing;
4055        }
4056        else if (name.equals("timingPeriod")) {
4057          this.timing = new Period();
4058          return this.timing;
4059        }
4060        else if (name.equals("timingDuration")) {
4061          this.timing = new Duration();
4062          return this.timing;
4063        }
4064        else if (name.equals("timingRange")) {
4065          this.timing = new Range();
4066          return this.timing;
4067        }
4068        else if (name.equals("timingTiming")) {
4069          this.timing = new Timing();
4070          return this.timing;
4071        }
4072        else if (name.equals("participant")) {
4073          return addParticipant();
4074        }
4075        else if (name.equals("type")) {
4076          this.type = new CodeableConcept();
4077          return this.type;
4078        }
4079        else if (name.equals("groupingBehavior")) {
4080          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.groupingBehavior");
4081        }
4082        else if (name.equals("selectionBehavior")) {
4083          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.selectionBehavior");
4084        }
4085        else if (name.equals("requiredBehavior")) {
4086          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.requiredBehavior");
4087        }
4088        else if (name.equals("precheckBehavior")) {
4089          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.precheckBehavior");
4090        }
4091        else if (name.equals("cardinalityBehavior")) {
4092          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.cardinalityBehavior");
4093        }
4094        else if (name.equals("definitionCanonical")) {
4095          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.definition[x]");
4096        }
4097        else if (name.equals("definitionUri")) {
4098          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.definition[x]");
4099        }
4100        else if (name.equals("transform")) {
4101          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.transform");
4102        }
4103        else if (name.equals("dynamicValue")) {
4104          return addDynamicValue();
4105        }
4106        else if (name.equals("action")) {
4107          return addAction();
4108        }
4109        else
4110          return super.addChild(name);
4111      }
4112
4113      public PlanDefinitionActionComponent copy() {
4114        PlanDefinitionActionComponent dst = new PlanDefinitionActionComponent();
4115        copyValues(dst);
4116        return dst;
4117      }
4118
4119      public void copyValues(PlanDefinitionActionComponent dst) {
4120        super.copyValues(dst);
4121        dst.prefix = prefix == null ? null : prefix.copy();
4122        dst.title = title == null ? null : title.copy();
4123        dst.description = description == null ? null : description.copy();
4124        dst.textEquivalent = textEquivalent == null ? null : textEquivalent.copy();
4125        dst.priority = priority == null ? null : priority.copy();
4126        if (code != null) {
4127          dst.code = new ArrayList<CodeableConcept>();
4128          for (CodeableConcept i : code)
4129            dst.code.add(i.copy());
4130        };
4131        if (reason != null) {
4132          dst.reason = new ArrayList<CodeableConcept>();
4133          for (CodeableConcept i : reason)
4134            dst.reason.add(i.copy());
4135        };
4136        if (documentation != null) {
4137          dst.documentation = new ArrayList<RelatedArtifact>();
4138          for (RelatedArtifact i : documentation)
4139            dst.documentation.add(i.copy());
4140        };
4141        if (goalId != null) {
4142          dst.goalId = new ArrayList<IdType>();
4143          for (IdType i : goalId)
4144            dst.goalId.add(i.copy());
4145        };
4146        dst.subject = subject == null ? null : subject.copy();
4147        if (trigger != null) {
4148          dst.trigger = new ArrayList<TriggerDefinition>();
4149          for (TriggerDefinition i : trigger)
4150            dst.trigger.add(i.copy());
4151        };
4152        if (condition != null) {
4153          dst.condition = new ArrayList<PlanDefinitionActionConditionComponent>();
4154          for (PlanDefinitionActionConditionComponent i : condition)
4155            dst.condition.add(i.copy());
4156        };
4157        if (input != null) {
4158          dst.input = new ArrayList<DataRequirement>();
4159          for (DataRequirement i : input)
4160            dst.input.add(i.copy());
4161        };
4162        if (output != null) {
4163          dst.output = new ArrayList<DataRequirement>();
4164          for (DataRequirement i : output)
4165            dst.output.add(i.copy());
4166        };
4167        if (relatedAction != null) {
4168          dst.relatedAction = new ArrayList<PlanDefinitionActionRelatedActionComponent>();
4169          for (PlanDefinitionActionRelatedActionComponent i : relatedAction)
4170            dst.relatedAction.add(i.copy());
4171        };
4172        dst.timing = timing == null ? null : timing.copy();
4173        if (participant != null) {
4174          dst.participant = new ArrayList<PlanDefinitionActionParticipantComponent>();
4175          for (PlanDefinitionActionParticipantComponent i : participant)
4176            dst.participant.add(i.copy());
4177        };
4178        dst.type = type == null ? null : type.copy();
4179        dst.groupingBehavior = groupingBehavior == null ? null : groupingBehavior.copy();
4180        dst.selectionBehavior = selectionBehavior == null ? null : selectionBehavior.copy();
4181        dst.requiredBehavior = requiredBehavior == null ? null : requiredBehavior.copy();
4182        dst.precheckBehavior = precheckBehavior == null ? null : precheckBehavior.copy();
4183        dst.cardinalityBehavior = cardinalityBehavior == null ? null : cardinalityBehavior.copy();
4184        dst.definition = definition == null ? null : definition.copy();
4185        dst.transform = transform == null ? null : transform.copy();
4186        if (dynamicValue != null) {
4187          dst.dynamicValue = new ArrayList<PlanDefinitionActionDynamicValueComponent>();
4188          for (PlanDefinitionActionDynamicValueComponent i : dynamicValue)
4189            dst.dynamicValue.add(i.copy());
4190        };
4191        if (action != null) {
4192          dst.action = new ArrayList<PlanDefinitionActionComponent>();
4193          for (PlanDefinitionActionComponent i : action)
4194            dst.action.add(i.copy());
4195        };
4196      }
4197
4198      @Override
4199      public boolean equalsDeep(Base other_) {
4200        if (!super.equalsDeep(other_))
4201          return false;
4202        if (!(other_ instanceof PlanDefinitionActionComponent))
4203          return false;
4204        PlanDefinitionActionComponent o = (PlanDefinitionActionComponent) other_;
4205        return compareDeep(prefix, o.prefix, true) && compareDeep(title, o.title, true) && compareDeep(description, o.description, true)
4206           && compareDeep(textEquivalent, o.textEquivalent, true) && compareDeep(priority, o.priority, true)
4207           && compareDeep(code, o.code, true) && compareDeep(reason, o.reason, true) && compareDeep(documentation, o.documentation, true)
4208           && compareDeep(goalId, o.goalId, true) && compareDeep(subject, o.subject, true) && compareDeep(trigger, o.trigger, true)
4209           && compareDeep(condition, o.condition, true) && compareDeep(input, o.input, true) && compareDeep(output, o.output, true)
4210           && compareDeep(relatedAction, o.relatedAction, true) && compareDeep(timing, o.timing, true) && compareDeep(participant, o.participant, true)
4211           && compareDeep(type, o.type, true) && compareDeep(groupingBehavior, o.groupingBehavior, true) && compareDeep(selectionBehavior, o.selectionBehavior, true)
4212           && compareDeep(requiredBehavior, o.requiredBehavior, true) && compareDeep(precheckBehavior, o.precheckBehavior, true)
4213           && compareDeep(cardinalityBehavior, o.cardinalityBehavior, true) && compareDeep(definition, o.definition, true)
4214           && compareDeep(transform, o.transform, true) && compareDeep(dynamicValue, o.dynamicValue, true)
4215           && compareDeep(action, o.action, true);
4216      }
4217
4218      @Override
4219      public boolean equalsShallow(Base other_) {
4220        if (!super.equalsShallow(other_))
4221          return false;
4222        if (!(other_ instanceof PlanDefinitionActionComponent))
4223          return false;
4224        PlanDefinitionActionComponent o = (PlanDefinitionActionComponent) other_;
4225        return compareValues(prefix, o.prefix, true) && compareValues(title, o.title, true) && compareValues(description, o.description, true)
4226           && compareValues(textEquivalent, o.textEquivalent, true) && compareValues(priority, o.priority, true)
4227           && compareValues(goalId, o.goalId, true) && compareValues(groupingBehavior, o.groupingBehavior, true)
4228           && compareValues(selectionBehavior, o.selectionBehavior, true) && compareValues(requiredBehavior, o.requiredBehavior, true)
4229           && compareValues(precheckBehavior, o.precheckBehavior, true) && compareValues(cardinalityBehavior, o.cardinalityBehavior, true)
4230          ;
4231      }
4232
4233      public boolean isEmpty() {
4234        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(prefix, title, description
4235          , textEquivalent, priority, code, reason, documentation, goalId, subject, trigger
4236          , condition, input, output, relatedAction, timing, participant, type, groupingBehavior
4237          , selectionBehavior, requiredBehavior, precheckBehavior, cardinalityBehavior, definition
4238          , transform, dynamicValue, action);
4239      }
4240
4241  public String fhirType() {
4242    return "PlanDefinition.action";
4243
4244  }
4245
4246  }
4247
4248    @Block()
4249    public static class PlanDefinitionActionConditionComponent extends BackboneElement implements IBaseBackboneElement {
4250        /**
4251         * The kind of condition.
4252         */
4253        @Child(name = "kind", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4254        @Description(shortDefinition="applicability | start | stop", formalDefinition="The kind of condition." )
4255        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-condition-kind")
4256        protected Enumeration<ActionConditionKind> kind;
4257
4258        /**
4259         * An expression that returns true or false, indicating whether the condition is satisfied.
4260         */
4261        @Child(name = "expression", type = {Expression.class}, order=2, min=0, max=1, modifier=false, summary=false)
4262        @Description(shortDefinition="Boolean-valued expression", formalDefinition="An expression that returns true or false, indicating whether the condition is satisfied." )
4263        protected Expression expression;
4264
4265        private static final long serialVersionUID = -455150438L;
4266
4267    /**
4268     * Constructor
4269     */
4270      public PlanDefinitionActionConditionComponent() {
4271        super();
4272      }
4273
4274    /**
4275     * Constructor
4276     */
4277      public PlanDefinitionActionConditionComponent(Enumeration<ActionConditionKind> kind) {
4278        super();
4279        this.kind = kind;
4280      }
4281
4282        /**
4283         * @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
4284         */
4285        public Enumeration<ActionConditionKind> getKindElement() { 
4286          if (this.kind == null)
4287            if (Configuration.errorOnAutoCreate())
4288              throw new Error("Attempt to auto-create PlanDefinitionActionConditionComponent.kind");
4289            else if (Configuration.doAutoCreate())
4290              this.kind = new Enumeration<ActionConditionKind>(new ActionConditionKindEnumFactory()); // bb
4291          return this.kind;
4292        }
4293
4294        public boolean hasKindElement() { 
4295          return this.kind != null && !this.kind.isEmpty();
4296        }
4297
4298        public boolean hasKind() { 
4299          return this.kind != null && !this.kind.isEmpty();
4300        }
4301
4302        /**
4303         * @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
4304         */
4305        public PlanDefinitionActionConditionComponent setKindElement(Enumeration<ActionConditionKind> value) { 
4306          this.kind = value;
4307          return this;
4308        }
4309
4310        /**
4311         * @return The kind of condition.
4312         */
4313        public ActionConditionKind getKind() { 
4314          return this.kind == null ? null : this.kind.getValue();
4315        }
4316
4317        /**
4318         * @param value The kind of condition.
4319         */
4320        public PlanDefinitionActionConditionComponent setKind(ActionConditionKind value) { 
4321            if (this.kind == null)
4322              this.kind = new Enumeration<ActionConditionKind>(new ActionConditionKindEnumFactory());
4323            this.kind.setValue(value);
4324          return this;
4325        }
4326
4327        /**
4328         * @return {@link #expression} (An expression that returns true or false, indicating whether the condition is satisfied.)
4329         */
4330        public Expression getExpression() { 
4331          if (this.expression == null)
4332            if (Configuration.errorOnAutoCreate())
4333              throw new Error("Attempt to auto-create PlanDefinitionActionConditionComponent.expression");
4334            else if (Configuration.doAutoCreate())
4335              this.expression = new Expression(); // cc
4336          return this.expression;
4337        }
4338
4339        public boolean hasExpression() { 
4340          return this.expression != null && !this.expression.isEmpty();
4341        }
4342
4343        /**
4344         * @param value {@link #expression} (An expression that returns true or false, indicating whether the condition is satisfied.)
4345         */
4346        public PlanDefinitionActionConditionComponent setExpression(Expression value) { 
4347          this.expression = value;
4348          return this;
4349        }
4350
4351        protected void listChildren(List<Property> children) {
4352          super.listChildren(children);
4353          children.add(new Property("kind", "code", "The kind of condition.", 0, 1, kind));
4354          children.add(new Property("expression", "Expression", "An expression that returns true or false, indicating whether the condition is satisfied.", 0, 1, expression));
4355        }
4356
4357        @Override
4358        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4359          switch (_hash) {
4360          case 3292052: /*kind*/  return new Property("kind", "code", "The kind of condition.", 0, 1, kind);
4361          case -1795452264: /*expression*/  return new Property("expression", "Expression", "An expression that returns true or false, indicating whether the condition is satisfied.", 0, 1, expression);
4362          default: return super.getNamedProperty(_hash, _name, _checkValid);
4363          }
4364
4365        }
4366
4367      @Override
4368      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4369        switch (hash) {
4370        case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration<ActionConditionKind>
4371        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // Expression
4372        default: return super.getProperty(hash, name, checkValid);
4373        }
4374
4375      }
4376
4377      @Override
4378      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4379        switch (hash) {
4380        case 3292052: // kind
4381          value = new ActionConditionKindEnumFactory().fromType(castToCode(value));
4382          this.kind = (Enumeration) value; // Enumeration<ActionConditionKind>
4383          return value;
4384        case -1795452264: // expression
4385          this.expression = castToExpression(value); // Expression
4386          return value;
4387        default: return super.setProperty(hash, name, value);
4388        }
4389
4390      }
4391
4392      @Override
4393      public Base setProperty(String name, Base value) throws FHIRException {
4394        if (name.equals("kind")) {
4395          value = new ActionConditionKindEnumFactory().fromType(castToCode(value));
4396          this.kind = (Enumeration) value; // Enumeration<ActionConditionKind>
4397        } else if (name.equals("expression")) {
4398          this.expression = castToExpression(value); // Expression
4399        } else
4400          return super.setProperty(name, value);
4401        return value;
4402      }
4403
4404      @Override
4405      public Base makeProperty(int hash, String name) throws FHIRException {
4406        switch (hash) {
4407        case 3292052:  return getKindElement();
4408        case -1795452264:  return getExpression(); 
4409        default: return super.makeProperty(hash, name);
4410        }
4411
4412      }
4413
4414      @Override
4415      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4416        switch (hash) {
4417        case 3292052: /*kind*/ return new String[] {"code"};
4418        case -1795452264: /*expression*/ return new String[] {"Expression"};
4419        default: return super.getTypesForProperty(hash, name);
4420        }
4421
4422      }
4423
4424      @Override
4425      public Base addChild(String name) throws FHIRException {
4426        if (name.equals("kind")) {
4427          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.kind");
4428        }
4429        else if (name.equals("expression")) {
4430          this.expression = new Expression();
4431          return this.expression;
4432        }
4433        else
4434          return super.addChild(name);
4435      }
4436
4437      public PlanDefinitionActionConditionComponent copy() {
4438        PlanDefinitionActionConditionComponent dst = new PlanDefinitionActionConditionComponent();
4439        copyValues(dst);
4440        return dst;
4441      }
4442
4443      public void copyValues(PlanDefinitionActionConditionComponent dst) {
4444        super.copyValues(dst);
4445        dst.kind = kind == null ? null : kind.copy();
4446        dst.expression = expression == null ? null : expression.copy();
4447      }
4448
4449      @Override
4450      public boolean equalsDeep(Base other_) {
4451        if (!super.equalsDeep(other_))
4452          return false;
4453        if (!(other_ instanceof PlanDefinitionActionConditionComponent))
4454          return false;
4455        PlanDefinitionActionConditionComponent o = (PlanDefinitionActionConditionComponent) other_;
4456        return compareDeep(kind, o.kind, true) && compareDeep(expression, o.expression, true);
4457      }
4458
4459      @Override
4460      public boolean equalsShallow(Base other_) {
4461        if (!super.equalsShallow(other_))
4462          return false;
4463        if (!(other_ instanceof PlanDefinitionActionConditionComponent))
4464          return false;
4465        PlanDefinitionActionConditionComponent o = (PlanDefinitionActionConditionComponent) other_;
4466        return compareValues(kind, o.kind, true);
4467      }
4468
4469      public boolean isEmpty() {
4470        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(kind, expression);
4471      }
4472
4473  public String fhirType() {
4474    return "PlanDefinition.action.condition";
4475
4476  }
4477
4478  }
4479
4480    @Block()
4481    public static class PlanDefinitionActionRelatedActionComponent extends BackboneElement implements IBaseBackboneElement {
4482        /**
4483         * The element id of the related action.
4484         */
4485        @Child(name = "actionId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4486        @Description(shortDefinition="What action is this related to", formalDefinition="The element id of the related action." )
4487        protected IdType actionId;
4488
4489        /**
4490         * The relationship of this action to the related action.
4491         */
4492        @Child(name = "relationship", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false)
4493        @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." )
4494        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-relationship-type")
4495        protected Enumeration<ActionRelationshipType> relationship;
4496
4497        /**
4498         * A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.
4499         */
4500        @Child(name = "offset", type = {Duration.class, Range.class}, order=3, min=0, max=1, modifier=false, summary=false)
4501        @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." )
4502        protected Type offset;
4503
4504        private static final long serialVersionUID = 1063306770L;
4505
4506    /**
4507     * Constructor
4508     */
4509      public PlanDefinitionActionRelatedActionComponent() {
4510        super();
4511      }
4512
4513    /**
4514     * Constructor
4515     */
4516      public PlanDefinitionActionRelatedActionComponent(IdType actionId, Enumeration<ActionRelationshipType> relationship) {
4517        super();
4518        this.actionId = actionId;
4519        this.relationship = relationship;
4520      }
4521
4522        /**
4523         * @return {@link #actionId} (The element id of the related action.). This is the underlying object with id, value and extensions. The accessor "getActionId" gives direct access to the value
4524         */
4525        public IdType getActionIdElement() { 
4526          if (this.actionId == null)
4527            if (Configuration.errorOnAutoCreate())
4528              throw new Error("Attempt to auto-create PlanDefinitionActionRelatedActionComponent.actionId");
4529            else if (Configuration.doAutoCreate())
4530              this.actionId = new IdType(); // bb
4531          return this.actionId;
4532        }
4533
4534        public boolean hasActionIdElement() { 
4535          return this.actionId != null && !this.actionId.isEmpty();
4536        }
4537
4538        public boolean hasActionId() { 
4539          return this.actionId != null && !this.actionId.isEmpty();
4540        }
4541
4542        /**
4543         * @param value {@link #actionId} (The element id of the related action.). This is the underlying object with id, value and extensions. The accessor "getActionId" gives direct access to the value
4544         */
4545        public PlanDefinitionActionRelatedActionComponent setActionIdElement(IdType value) { 
4546          this.actionId = value;
4547          return this;
4548        }
4549
4550        /**
4551         * @return The element id of the related action.
4552         */
4553        public String getActionId() { 
4554          return this.actionId == null ? null : this.actionId.getValue();
4555        }
4556
4557        /**
4558         * @param value The element id of the related action.
4559         */
4560        public PlanDefinitionActionRelatedActionComponent setActionId(String value) { 
4561            if (this.actionId == null)
4562              this.actionId = new IdType();
4563            this.actionId.setValue(value);
4564          return this;
4565        }
4566
4567        /**
4568         * @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
4569         */
4570        public Enumeration<ActionRelationshipType> getRelationshipElement() { 
4571          if (this.relationship == null)
4572            if (Configuration.errorOnAutoCreate())
4573              throw new Error("Attempt to auto-create PlanDefinitionActionRelatedActionComponent.relationship");
4574            else if (Configuration.doAutoCreate())
4575              this.relationship = new Enumeration<ActionRelationshipType>(new ActionRelationshipTypeEnumFactory()); // bb
4576          return this.relationship;
4577        }
4578
4579        public boolean hasRelationshipElement() { 
4580          return this.relationship != null && !this.relationship.isEmpty();
4581        }
4582
4583        public boolean hasRelationship() { 
4584          return this.relationship != null && !this.relationship.isEmpty();
4585        }
4586
4587        /**
4588         * @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
4589         */
4590        public PlanDefinitionActionRelatedActionComponent setRelationshipElement(Enumeration<ActionRelationshipType> value) { 
4591          this.relationship = value;
4592          return this;
4593        }
4594
4595        /**
4596         * @return The relationship of this action to the related action.
4597         */
4598        public ActionRelationshipType getRelationship() { 
4599          return this.relationship == null ? null : this.relationship.getValue();
4600        }
4601
4602        /**
4603         * @param value The relationship of this action to the related action.
4604         */
4605        public PlanDefinitionActionRelatedActionComponent setRelationship(ActionRelationshipType value) { 
4606            if (this.relationship == null)
4607              this.relationship = new Enumeration<ActionRelationshipType>(new ActionRelationshipTypeEnumFactory());
4608            this.relationship.setValue(value);
4609          return this;
4610        }
4611
4612        /**
4613         * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.)
4614         */
4615        public Type getOffset() { 
4616          return this.offset;
4617        }
4618
4619        /**
4620         * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.)
4621         */
4622        public Duration getOffsetDuration() throws FHIRException { 
4623          if (this.offset == null)
4624            this.offset = new Duration();
4625          if (!(this.offset instanceof Duration))
4626            throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.offset.getClass().getName()+" was encountered");
4627          return (Duration) this.offset;
4628        }
4629
4630        public boolean hasOffsetDuration() { 
4631          return this != null && this.offset instanceof Duration;
4632        }
4633
4634        /**
4635         * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.)
4636         */
4637        public Range getOffsetRange() throws FHIRException { 
4638          if (this.offset == null)
4639            this.offset = new Range();
4640          if (!(this.offset instanceof Range))
4641            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.offset.getClass().getName()+" was encountered");
4642          return (Range) this.offset;
4643        }
4644
4645        public boolean hasOffsetRange() { 
4646          return this != null && this.offset instanceof Range;
4647        }
4648
4649        public boolean hasOffset() { 
4650          return this.offset != null && !this.offset.isEmpty();
4651        }
4652
4653        /**
4654         * @param value {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.)
4655         */
4656        public PlanDefinitionActionRelatedActionComponent setOffset(Type value) { 
4657          if (value != null && !(value instanceof Duration || value instanceof Range))
4658            throw new Error("Not the right type for PlanDefinition.action.relatedAction.offset[x]: "+value.fhirType());
4659          this.offset = value;
4660          return this;
4661        }
4662
4663        protected void listChildren(List<Property> children) {
4664          super.listChildren(children);
4665          children.add(new Property("actionId", "id", "The element id of the related action.", 0, 1, actionId));
4666          children.add(new Property("relationship", "code", "The relationship of this action to the related action.", 0, 1, relationship));
4667          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));
4668        }
4669
4670        @Override
4671        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4672          switch (_hash) {
4673          case -1656172047: /*actionId*/  return new Property("actionId", "id", "The element id of the related action.", 0, 1, actionId);
4674          case -261851592: /*relationship*/  return new Property("relationship", "code", "The relationship of this action to the related action.", 0, 1, relationship);
4675          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);
4676          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);
4677          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);
4678          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);
4679          default: return super.getNamedProperty(_hash, _name, _checkValid);
4680          }
4681
4682        }
4683
4684      @Override
4685      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4686        switch (hash) {
4687        case -1656172047: /*actionId*/ return this.actionId == null ? new Base[0] : new Base[] {this.actionId}; // IdType
4688        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Enumeration<ActionRelationshipType>
4689        case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // Type
4690        default: return super.getProperty(hash, name, checkValid);
4691        }
4692
4693      }
4694
4695      @Override
4696      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4697        switch (hash) {
4698        case -1656172047: // actionId
4699          this.actionId = castToId(value); // IdType
4700          return value;
4701        case -261851592: // relationship
4702          value = new ActionRelationshipTypeEnumFactory().fromType(castToCode(value));
4703          this.relationship = (Enumeration) value; // Enumeration<ActionRelationshipType>
4704          return value;
4705        case -1019779949: // offset
4706          this.offset = castToType(value); // Type
4707          return value;
4708        default: return super.setProperty(hash, name, value);
4709        }
4710
4711      }
4712
4713      @Override
4714      public Base setProperty(String name, Base value) throws FHIRException {
4715        if (name.equals("actionId")) {
4716          this.actionId = castToId(value); // IdType
4717        } else if (name.equals("relationship")) {
4718          value = new ActionRelationshipTypeEnumFactory().fromType(castToCode(value));
4719          this.relationship = (Enumeration) value; // Enumeration<ActionRelationshipType>
4720        } else if (name.equals("offset[x]")) {
4721          this.offset = castToType(value); // Type
4722        } else
4723          return super.setProperty(name, value);
4724        return value;
4725      }
4726
4727      @Override
4728      public Base makeProperty(int hash, String name) throws FHIRException {
4729        switch (hash) {
4730        case -1656172047:  return getActionIdElement();
4731        case -261851592:  return getRelationshipElement();
4732        case -1960684787:  return getOffset(); 
4733        case -1019779949:  return getOffset(); 
4734        default: return super.makeProperty(hash, name);
4735        }
4736
4737      }
4738
4739      @Override
4740      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4741        switch (hash) {
4742        case -1656172047: /*actionId*/ return new String[] {"id"};
4743        case -261851592: /*relationship*/ return new String[] {"code"};
4744        case -1019779949: /*offset*/ return new String[] {"Duration", "Range"};
4745        default: return super.getTypesForProperty(hash, name);
4746        }
4747
4748      }
4749
4750      @Override
4751      public Base addChild(String name) throws FHIRException {
4752        if (name.equals("actionId")) {
4753          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.actionId");
4754        }
4755        else if (name.equals("relationship")) {
4756          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.relationship");
4757        }
4758        else if (name.equals("offsetDuration")) {
4759          this.offset = new Duration();
4760          return this.offset;
4761        }
4762        else if (name.equals("offsetRange")) {
4763          this.offset = new Range();
4764          return this.offset;
4765        }
4766        else
4767          return super.addChild(name);
4768      }
4769
4770      public PlanDefinitionActionRelatedActionComponent copy() {
4771        PlanDefinitionActionRelatedActionComponent dst = new PlanDefinitionActionRelatedActionComponent();
4772        copyValues(dst);
4773        return dst;
4774      }
4775
4776      public void copyValues(PlanDefinitionActionRelatedActionComponent dst) {
4777        super.copyValues(dst);
4778        dst.actionId = actionId == null ? null : actionId.copy();
4779        dst.relationship = relationship == null ? null : relationship.copy();
4780        dst.offset = offset == null ? null : offset.copy();
4781      }
4782
4783      @Override
4784      public boolean equalsDeep(Base other_) {
4785        if (!super.equalsDeep(other_))
4786          return false;
4787        if (!(other_ instanceof PlanDefinitionActionRelatedActionComponent))
4788          return false;
4789        PlanDefinitionActionRelatedActionComponent o = (PlanDefinitionActionRelatedActionComponent) other_;
4790        return compareDeep(actionId, o.actionId, true) && compareDeep(relationship, o.relationship, true)
4791           && compareDeep(offset, o.offset, true);
4792      }
4793
4794      @Override
4795      public boolean equalsShallow(Base other_) {
4796        if (!super.equalsShallow(other_))
4797          return false;
4798        if (!(other_ instanceof PlanDefinitionActionRelatedActionComponent))
4799          return false;
4800        PlanDefinitionActionRelatedActionComponent o = (PlanDefinitionActionRelatedActionComponent) other_;
4801        return compareValues(actionId, o.actionId, true) && compareValues(relationship, o.relationship, true)
4802          ;
4803      }
4804
4805      public boolean isEmpty() {
4806        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(actionId, relationship, offset
4807          );
4808      }
4809
4810  public String fhirType() {
4811    return "PlanDefinition.action.relatedAction";
4812
4813  }
4814
4815  }
4816
4817    @Block()
4818    public static class PlanDefinitionActionParticipantComponent extends BackboneElement implements IBaseBackboneElement {
4819        /**
4820         * The type of participant in the action.
4821         */
4822        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4823        @Description(shortDefinition="patient | practitioner | related-person | device", formalDefinition="The type of participant in the action." )
4824        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-participant-type")
4825        protected Enumeration<ActionParticipantType> type;
4826
4827        /**
4828         * The role the participant should play in performing the described action.
4829         */
4830        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
4831        @Description(shortDefinition="E.g. Nurse, Surgeon, Parent", formalDefinition="The role the participant should play in performing the described action." )
4832        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-participant-role")
4833        protected CodeableConcept role;
4834
4835        private static final long serialVersionUID = -1152013659L;
4836
4837    /**
4838     * Constructor
4839     */
4840      public PlanDefinitionActionParticipantComponent() {
4841        super();
4842      }
4843
4844    /**
4845     * Constructor
4846     */
4847      public PlanDefinitionActionParticipantComponent(Enumeration<ActionParticipantType> type) {
4848        super();
4849        this.type = type;
4850      }
4851
4852        /**
4853         * @return {@link #type} (The type of participant in the action.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
4854         */
4855        public Enumeration<ActionParticipantType> getTypeElement() { 
4856          if (this.type == null)
4857            if (Configuration.errorOnAutoCreate())
4858              throw new Error("Attempt to auto-create PlanDefinitionActionParticipantComponent.type");
4859            else if (Configuration.doAutoCreate())
4860              this.type = new Enumeration<ActionParticipantType>(new ActionParticipantTypeEnumFactory()); // bb
4861          return this.type;
4862        }
4863
4864        public boolean hasTypeElement() { 
4865          return this.type != null && !this.type.isEmpty();
4866        }
4867
4868        public boolean hasType() { 
4869          return this.type != null && !this.type.isEmpty();
4870        }
4871
4872        /**
4873         * @param value {@link #type} (The type of participant in the action.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
4874         */
4875        public PlanDefinitionActionParticipantComponent setTypeElement(Enumeration<ActionParticipantType> value) { 
4876          this.type = value;
4877          return this;
4878        }
4879
4880        /**
4881         * @return The type of participant in the action.
4882         */
4883        public ActionParticipantType getType() { 
4884          return this.type == null ? null : this.type.getValue();
4885        }
4886
4887        /**
4888         * @param value The type of participant in the action.
4889         */
4890        public PlanDefinitionActionParticipantComponent setType(ActionParticipantType value) { 
4891            if (this.type == null)
4892              this.type = new Enumeration<ActionParticipantType>(new ActionParticipantTypeEnumFactory());
4893            this.type.setValue(value);
4894          return this;
4895        }
4896
4897        /**
4898         * @return {@link #role} (The role the participant should play in performing the described action.)
4899         */
4900        public CodeableConcept getRole() { 
4901          if (this.role == null)
4902            if (Configuration.errorOnAutoCreate())
4903              throw new Error("Attempt to auto-create PlanDefinitionActionParticipantComponent.role");
4904            else if (Configuration.doAutoCreate())
4905              this.role = new CodeableConcept(); // cc
4906          return this.role;
4907        }
4908
4909        public boolean hasRole() { 
4910          return this.role != null && !this.role.isEmpty();
4911        }
4912
4913        /**
4914         * @param value {@link #role} (The role the participant should play in performing the described action.)
4915         */
4916        public PlanDefinitionActionParticipantComponent setRole(CodeableConcept value) { 
4917          this.role = value;
4918          return this;
4919        }
4920
4921        protected void listChildren(List<Property> children) {
4922          super.listChildren(children);
4923          children.add(new Property("type", "code", "The type of participant in the action.", 0, 1, type));
4924          children.add(new Property("role", "CodeableConcept", "The role the participant should play in performing the described action.", 0, 1, role));
4925        }
4926
4927        @Override
4928        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4929          switch (_hash) {
4930          case 3575610: /*type*/  return new Property("type", "code", "The type of participant in the action.", 0, 1, type);
4931          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "The role the participant should play in performing the described action.", 0, 1, role);
4932          default: return super.getNamedProperty(_hash, _name, _checkValid);
4933          }
4934
4935        }
4936
4937      @Override
4938      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4939        switch (hash) {
4940        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<ActionParticipantType>
4941        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
4942        default: return super.getProperty(hash, name, checkValid);
4943        }
4944
4945      }
4946
4947      @Override
4948      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4949        switch (hash) {
4950        case 3575610: // type
4951          value = new ActionParticipantTypeEnumFactory().fromType(castToCode(value));
4952          this.type = (Enumeration) value; // Enumeration<ActionParticipantType>
4953          return value;
4954        case 3506294: // role
4955          this.role = castToCodeableConcept(value); // CodeableConcept
4956          return value;
4957        default: return super.setProperty(hash, name, value);
4958        }
4959
4960      }
4961
4962      @Override
4963      public Base setProperty(String name, Base value) throws FHIRException {
4964        if (name.equals("type")) {
4965          value = new ActionParticipantTypeEnumFactory().fromType(castToCode(value));
4966          this.type = (Enumeration) value; // Enumeration<ActionParticipantType>
4967        } else if (name.equals("role")) {
4968          this.role = castToCodeableConcept(value); // CodeableConcept
4969        } else
4970          return super.setProperty(name, value);
4971        return value;
4972      }
4973
4974      @Override
4975      public Base makeProperty(int hash, String name) throws FHIRException {
4976        switch (hash) {
4977        case 3575610:  return getTypeElement();
4978        case 3506294:  return getRole(); 
4979        default: return super.makeProperty(hash, name);
4980        }
4981
4982      }
4983
4984      @Override
4985      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4986        switch (hash) {
4987        case 3575610: /*type*/ return new String[] {"code"};
4988        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
4989        default: return super.getTypesForProperty(hash, name);
4990        }
4991
4992      }
4993
4994      @Override
4995      public Base addChild(String name) throws FHIRException {
4996        if (name.equals("type")) {
4997          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.type");
4998        }
4999        else if (name.equals("role")) {
5000          this.role = new CodeableConcept();
5001          return this.role;
5002        }
5003        else
5004          return super.addChild(name);
5005      }
5006
5007      public PlanDefinitionActionParticipantComponent copy() {
5008        PlanDefinitionActionParticipantComponent dst = new PlanDefinitionActionParticipantComponent();
5009        copyValues(dst);
5010        return dst;
5011      }
5012
5013      public void copyValues(PlanDefinitionActionParticipantComponent dst) {
5014        super.copyValues(dst);
5015        dst.type = type == null ? null : type.copy();
5016        dst.role = role == null ? null : role.copy();
5017      }
5018
5019      @Override
5020      public boolean equalsDeep(Base other_) {
5021        if (!super.equalsDeep(other_))
5022          return false;
5023        if (!(other_ instanceof PlanDefinitionActionParticipantComponent))
5024          return false;
5025        PlanDefinitionActionParticipantComponent o = (PlanDefinitionActionParticipantComponent) other_;
5026        return compareDeep(type, o.type, true) && compareDeep(role, o.role, true);
5027      }
5028
5029      @Override
5030      public boolean equalsShallow(Base other_) {
5031        if (!super.equalsShallow(other_))
5032          return false;
5033        if (!(other_ instanceof PlanDefinitionActionParticipantComponent))
5034          return false;
5035        PlanDefinitionActionParticipantComponent o = (PlanDefinitionActionParticipantComponent) other_;
5036        return compareValues(type, o.type, true);
5037      }
5038
5039      public boolean isEmpty() {
5040        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, role);
5041      }
5042
5043  public String fhirType() {
5044    return "PlanDefinition.action.participant";
5045
5046  }
5047
5048  }
5049
5050    @Block()
5051    public static class PlanDefinitionActionDynamicValueComponent extends BackboneElement implements IBaseBackboneElement {
5052        /**
5053         * The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).
5054         */
5055        @Child(name = "path", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
5056        @Description(shortDefinition="The path to the element to be set dynamically", formalDefinition="The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details)." )
5057        protected StringType path;
5058
5059        /**
5060         * An expression specifying the value of the customized element.
5061         */
5062        @Child(name = "expression", type = {Expression.class}, order=2, min=0, max=1, modifier=false, summary=false)
5063        @Description(shortDefinition="An expression that provides the dynamic value for the customization", formalDefinition="An expression specifying the value of the customized element." )
5064        protected Expression expression;
5065
5066        private static final long serialVersionUID = 1064529082L;
5067
5068    /**
5069     * Constructor
5070     */
5071      public PlanDefinitionActionDynamicValueComponent() {
5072        super();
5073      }
5074
5075        /**
5076         * @return {@link #path} (The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
5077         */
5078        public StringType getPathElement() { 
5079          if (this.path == null)
5080            if (Configuration.errorOnAutoCreate())
5081              throw new Error("Attempt to auto-create PlanDefinitionActionDynamicValueComponent.path");
5082            else if (Configuration.doAutoCreate())
5083              this.path = new StringType(); // bb
5084          return this.path;
5085        }
5086
5087        public boolean hasPathElement() { 
5088          return this.path != null && !this.path.isEmpty();
5089        }
5090
5091        public boolean hasPath() { 
5092          return this.path != null && !this.path.isEmpty();
5093        }
5094
5095        /**
5096         * @param value {@link #path} (The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
5097         */
5098        public PlanDefinitionActionDynamicValueComponent setPathElement(StringType value) { 
5099          this.path = value;
5100          return this;
5101        }
5102
5103        /**
5104         * @return The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).
5105         */
5106        public String getPath() { 
5107          return this.path == null ? null : this.path.getValue();
5108        }
5109
5110        /**
5111         * @param value The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).
5112         */
5113        public PlanDefinitionActionDynamicValueComponent setPath(String value) { 
5114          if (Utilities.noString(value))
5115            this.path = null;
5116          else {
5117            if (this.path == null)
5118              this.path = new StringType();
5119            this.path.setValue(value);
5120          }
5121          return this;
5122        }
5123
5124        /**
5125         * @return {@link #expression} (An expression specifying the value of the customized element.)
5126         */
5127        public Expression getExpression() { 
5128          if (this.expression == null)
5129            if (Configuration.errorOnAutoCreate())
5130              throw new Error("Attempt to auto-create PlanDefinitionActionDynamicValueComponent.expression");
5131            else if (Configuration.doAutoCreate())
5132              this.expression = new Expression(); // cc
5133          return this.expression;
5134        }
5135
5136        public boolean hasExpression() { 
5137          return this.expression != null && !this.expression.isEmpty();
5138        }
5139
5140        /**
5141         * @param value {@link #expression} (An expression specifying the value of the customized element.)
5142         */
5143        public PlanDefinitionActionDynamicValueComponent setExpression(Expression value) { 
5144          this.expression = value;
5145          return this;
5146        }
5147
5148        protected void listChildren(List<Property> children) {
5149          super.listChildren(children);
5150          children.add(new Property("path", "string", "The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).", 0, 1, path));
5151          children.add(new Property("expression", "Expression", "An expression specifying the value of the customized element.", 0, 1, expression));
5152        }
5153
5154        @Override
5155        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5156          switch (_hash) {
5157          case 3433509: /*path*/  return new Property("path", "string", "The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).", 0, 1, path);
5158          case -1795452264: /*expression*/  return new Property("expression", "Expression", "An expression specifying the value of the customized element.", 0, 1, expression);
5159          default: return super.getNamedProperty(_hash, _name, _checkValid);
5160          }
5161
5162        }
5163
5164      @Override
5165      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5166        switch (hash) {
5167        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
5168        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // Expression
5169        default: return super.getProperty(hash, name, checkValid);
5170        }
5171
5172      }
5173
5174      @Override
5175      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5176        switch (hash) {
5177        case 3433509: // path
5178          this.path = castToString(value); // StringType
5179          return value;
5180        case -1795452264: // expression
5181          this.expression = castToExpression(value); // Expression
5182          return value;
5183        default: return super.setProperty(hash, name, value);
5184        }
5185
5186      }
5187
5188      @Override
5189      public Base setProperty(String name, Base value) throws FHIRException {
5190        if (name.equals("path")) {
5191          this.path = castToString(value); // StringType
5192        } else if (name.equals("expression")) {
5193          this.expression = castToExpression(value); // Expression
5194        } else
5195          return super.setProperty(name, value);
5196        return value;
5197      }
5198
5199      @Override
5200      public Base makeProperty(int hash, String name) throws FHIRException {
5201        switch (hash) {
5202        case 3433509:  return getPathElement();
5203        case -1795452264:  return getExpression(); 
5204        default: return super.makeProperty(hash, name);
5205        }
5206
5207      }
5208
5209      @Override
5210      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5211        switch (hash) {
5212        case 3433509: /*path*/ return new String[] {"string"};
5213        case -1795452264: /*expression*/ return new String[] {"Expression"};
5214        default: return super.getTypesForProperty(hash, name);
5215        }
5216
5217      }
5218
5219      @Override
5220      public Base addChild(String name) throws FHIRException {
5221        if (name.equals("path")) {
5222          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.path");
5223        }
5224        else if (name.equals("expression")) {
5225          this.expression = new Expression();
5226          return this.expression;
5227        }
5228        else
5229          return super.addChild(name);
5230      }
5231
5232      public PlanDefinitionActionDynamicValueComponent copy() {
5233        PlanDefinitionActionDynamicValueComponent dst = new PlanDefinitionActionDynamicValueComponent();
5234        copyValues(dst);
5235        return dst;
5236      }
5237
5238      public void copyValues(PlanDefinitionActionDynamicValueComponent dst) {
5239        super.copyValues(dst);
5240        dst.path = path == null ? null : path.copy();
5241        dst.expression = expression == null ? null : expression.copy();
5242      }
5243
5244      @Override
5245      public boolean equalsDeep(Base other_) {
5246        if (!super.equalsDeep(other_))
5247          return false;
5248        if (!(other_ instanceof PlanDefinitionActionDynamicValueComponent))
5249          return false;
5250        PlanDefinitionActionDynamicValueComponent o = (PlanDefinitionActionDynamicValueComponent) other_;
5251        return compareDeep(path, o.path, true) && compareDeep(expression, o.expression, true);
5252      }
5253
5254      @Override
5255      public boolean equalsShallow(Base other_) {
5256        if (!super.equalsShallow(other_))
5257          return false;
5258        if (!(other_ instanceof PlanDefinitionActionDynamicValueComponent))
5259          return false;
5260        PlanDefinitionActionDynamicValueComponent o = (PlanDefinitionActionDynamicValueComponent) other_;
5261        return compareValues(path, o.path, true);
5262      }
5263
5264      public boolean isEmpty() {
5265        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(path, expression);
5266      }
5267
5268  public String fhirType() {
5269    return "PlanDefinition.action.dynamicValue";
5270
5271  }
5272
5273  }
5274
5275    /**
5276     * A formal identifier that is used to identify this plan definition when it is represented in other formats, or referenced in a specification, model, design or an instance.
5277     */
5278    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5279    @Description(shortDefinition="Additional identifier for the plan definition", formalDefinition="A formal identifier that is used to identify this plan definition when it is represented in other formats, or referenced in a specification, model, design or an instance." )
5280    protected List<Identifier> identifier;
5281
5282    /**
5283     * An explanatory or alternate title for the plan definition giving additional information about its content.
5284     */
5285    @Child(name = "subtitle", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
5286    @Description(shortDefinition="Subordinate title of the plan definition", formalDefinition="An explanatory or alternate title for the plan definition giving additional information about its content." )
5287    protected StringType subtitle;
5288
5289    /**
5290     * A high-level category for the plan definition that distinguishes the kinds of systems that would be interested in the plan definition.
5291     */
5292    @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
5293    @Description(shortDefinition="order-set | clinical-protocol | eca-rule | workflow-definition", formalDefinition="A high-level category for the plan definition that distinguishes the kinds of systems that would be interested in the plan definition." )
5294    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/plan-definition-type")
5295    protected CodeableConcept type;
5296
5297    /**
5298     * A code or group definition that describes the intended subject of the plan definition.
5299     */
5300    @Child(name = "subject", type = {CodeableConcept.class, Group.class}, order=3, min=0, max=1, modifier=false, summary=false)
5301    @Description(shortDefinition="Type of individual the plan definition is focused on", formalDefinition="A code or group definition that describes the intended subject of the plan definition." )
5302    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/subject-type")
5303    protected Type subject;
5304
5305    /**
5306     * Explanation of why this plan definition is needed and why it has been designed as it has.
5307     */
5308    @Child(name = "purpose", type = {MarkdownType.class}, order=4, min=0, max=1, modifier=false, summary=false)
5309    @Description(shortDefinition="Why this plan definition is defined", formalDefinition="Explanation of why this plan definition is needed and why it has been designed as it has." )
5310    protected MarkdownType purpose;
5311
5312    /**
5313     * A detailed description of how the plan definition is used from a clinical perspective.
5314     */
5315    @Child(name = "usage", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
5316    @Description(shortDefinition="Describes the clinical usage of the plan", formalDefinition="A detailed description of how the plan definition is used from a clinical perspective." )
5317    protected StringType usage;
5318
5319    /**
5320     * A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition.
5321     */
5322    @Child(name = "copyright", type = {MarkdownType.class}, order=6, min=0, max=1, modifier=false, summary=false)
5323    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition." )
5324    protected MarkdownType copyright;
5325
5326    /**
5327     * The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
5328     */
5329    @Child(name = "approvalDate", type = {DateType.class}, order=7, min=0, max=1, modifier=false, summary=false)
5330    @Description(shortDefinition="When the plan definition was approved by publisher", formalDefinition="The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage." )
5331    protected DateType approvalDate;
5332
5333    /**
5334     * The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
5335     */
5336    @Child(name = "lastReviewDate", type = {DateType.class}, order=8, min=0, max=1, modifier=false, summary=false)
5337    @Description(shortDefinition="When the plan definition was last reviewed", formalDefinition="The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date." )
5338    protected DateType lastReviewDate;
5339
5340    /**
5341     * The period during which the plan definition content was or is planned to be in active use.
5342     */
5343    @Child(name = "effectivePeriod", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=true)
5344    @Description(shortDefinition="When the plan definition is expected to be used", formalDefinition="The period during which the plan definition content was or is planned to be in active use." )
5345    protected Period effectivePeriod;
5346
5347    /**
5348     * Descriptive topics related to the content of the plan definition. Topics provide a high-level categorization of the definition that can be useful for filtering and searching.
5349     */
5350    @Child(name = "topic", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5351    @Description(shortDefinition="E.g. Education, Treatment, Assessment", formalDefinition="Descriptive topics related to the content of the plan definition. Topics provide a high-level categorization of the definition that can be useful for filtering and searching." )
5352    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/definition-topic")
5353    protected List<CodeableConcept> topic;
5354
5355    /**
5356     * An individiual or organization primarily involved in the creation and maintenance of the content.
5357     */
5358    @Child(name = "author", type = {ContactDetail.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5359    @Description(shortDefinition="Who authored the content", formalDefinition="An individiual or organization primarily involved in the creation and maintenance of the content." )
5360    protected List<ContactDetail> author;
5361
5362    /**
5363     * An individual or organization primarily responsible for internal coherence of the content.
5364     */
5365    @Child(name = "editor", type = {ContactDetail.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5366    @Description(shortDefinition="Who edited the content", formalDefinition="An individual or organization primarily responsible for internal coherence of the content." )
5367    protected List<ContactDetail> editor;
5368
5369    /**
5370     * An individual or organization primarily responsible for review of some aspect of the content.
5371     */
5372    @Child(name = "reviewer", type = {ContactDetail.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5373    @Description(shortDefinition="Who reviewed the content", formalDefinition="An individual or organization primarily responsible for review of some aspect of the content." )
5374    protected List<ContactDetail> reviewer;
5375
5376    /**
5377     * An individual or organization responsible for officially endorsing the content for use in some setting.
5378     */
5379    @Child(name = "endorser", type = {ContactDetail.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5380    @Description(shortDefinition="Who endorsed the content", formalDefinition="An individual or organization responsible for officially endorsing the content for use in some setting." )
5381    protected List<ContactDetail> endorser;
5382
5383    /**
5384     * Related artifacts such as additional documentation, justification, or bibliographic references.
5385     */
5386    @Child(name = "relatedArtifact", type = {RelatedArtifact.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5387    @Description(shortDefinition="Additional documentation, citations", formalDefinition="Related artifacts such as additional documentation, justification, or bibliographic references." )
5388    protected List<RelatedArtifact> relatedArtifact;
5389
5390    /**
5391     * A reference to a Library resource containing any formal logic used by the plan definition.
5392     */
5393    @Child(name = "library", type = {CanonicalType.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5394    @Description(shortDefinition="Logic used by the plan definition", formalDefinition="A reference to a Library resource containing any formal logic used by the plan definition." )
5395    protected List<CanonicalType> library;
5396
5397    /**
5398     * Goals that describe what the activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.
5399     */
5400    @Child(name = "goal", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5401    @Description(shortDefinition="What the plan is trying to accomplish", formalDefinition="Goals that describe what the activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc." )
5402    protected List<PlanDefinitionGoalComponent> goal;
5403
5404    /**
5405     * An action or group of actions to be taken as part of the plan.
5406     */
5407    @Child(name = "action", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5408    @Description(shortDefinition="Action defined by the plan", formalDefinition="An action or group of actions to be taken as part of the plan." )
5409    protected List<PlanDefinitionActionComponent> action;
5410
5411    private static final long serialVersionUID = -1725695645L;
5412
5413  /**
5414   * Constructor
5415   */
5416    public PlanDefinition() {
5417      super();
5418    }
5419
5420  /**
5421   * Constructor
5422   */
5423    public PlanDefinition(Enumeration<PublicationStatus> status) {
5424      super();
5425      this.status = status;
5426    }
5427
5428    /**
5429     * @return {@link #url} (An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
5430     */
5431    public UriType getUrlElement() { 
5432      if (this.url == null)
5433        if (Configuration.errorOnAutoCreate())
5434          throw new Error("Attempt to auto-create PlanDefinition.url");
5435        else if (Configuration.doAutoCreate())
5436          this.url = new UriType(); // bb
5437      return this.url;
5438    }
5439
5440    public boolean hasUrlElement() { 
5441      return this.url != null && !this.url.isEmpty();
5442    }
5443
5444    public boolean hasUrl() { 
5445      return this.url != null && !this.url.isEmpty();
5446    }
5447
5448    /**
5449     * @param value {@link #url} (An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
5450     */
5451    public PlanDefinition setUrlElement(UriType value) { 
5452      this.url = value;
5453      return this;
5454    }
5455
5456    /**
5457     * @return An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.
5458     */
5459    public String getUrl() { 
5460      return this.url == null ? null : this.url.getValue();
5461    }
5462
5463    /**
5464     * @param value An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.
5465     */
5466    public PlanDefinition setUrl(String value) { 
5467      if (Utilities.noString(value))
5468        this.url = null;
5469      else {
5470        if (this.url == null)
5471          this.url = new UriType();
5472        this.url.setValue(value);
5473      }
5474      return this;
5475    }
5476
5477    /**
5478     * @return {@link #identifier} (A formal identifier that is used to identify this plan definition when it is represented in other formats, or referenced in a specification, model, design or an instance.)
5479     */
5480    public List<Identifier> getIdentifier() { 
5481      if (this.identifier == null)
5482        this.identifier = new ArrayList<Identifier>();
5483      return this.identifier;
5484    }
5485
5486    /**
5487     * @return Returns a reference to <code>this</code> for easy method chaining
5488     */
5489    public PlanDefinition setIdentifier(List<Identifier> theIdentifier) { 
5490      this.identifier = theIdentifier;
5491      return this;
5492    }
5493
5494    public boolean hasIdentifier() { 
5495      if (this.identifier == null)
5496        return false;
5497      for (Identifier item : this.identifier)
5498        if (!item.isEmpty())
5499          return true;
5500      return false;
5501    }
5502
5503    public Identifier addIdentifier() { //3
5504      Identifier t = new Identifier();
5505      if (this.identifier == null)
5506        this.identifier = new ArrayList<Identifier>();
5507      this.identifier.add(t);
5508      return t;
5509    }
5510
5511    public PlanDefinition addIdentifier(Identifier t) { //3
5512      if (t == null)
5513        return this;
5514      if (this.identifier == null)
5515        this.identifier = new ArrayList<Identifier>();
5516      this.identifier.add(t);
5517      return this;
5518    }
5519
5520    /**
5521     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
5522     */
5523    public Identifier getIdentifierFirstRep() { 
5524      if (getIdentifier().isEmpty()) {
5525        addIdentifier();
5526      }
5527      return getIdentifier().get(0);
5528    }
5529
5530    /**
5531     * @return {@link #version} (The identifier that is used to identify this version of the plan definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the plan definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
5532     */
5533    public StringType getVersionElement() { 
5534      if (this.version == null)
5535        if (Configuration.errorOnAutoCreate())
5536          throw new Error("Attempt to auto-create PlanDefinition.version");
5537        else if (Configuration.doAutoCreate())
5538          this.version = new StringType(); // bb
5539      return this.version;
5540    }
5541
5542    public boolean hasVersionElement() { 
5543      return this.version != null && !this.version.isEmpty();
5544    }
5545
5546    public boolean hasVersion() { 
5547      return this.version != null && !this.version.isEmpty();
5548    }
5549
5550    /**
5551     * @param value {@link #version} (The identifier that is used to identify this version of the plan definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the plan definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
5552     */
5553    public PlanDefinition setVersionElement(StringType value) { 
5554      this.version = value;
5555      return this;
5556    }
5557
5558    /**
5559     * @return The identifier that is used to identify this version of the plan definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the plan definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.
5560     */
5561    public String getVersion() { 
5562      return this.version == null ? null : this.version.getValue();
5563    }
5564
5565    /**
5566     * @param value The identifier that is used to identify this version of the plan definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the plan definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.
5567     */
5568    public PlanDefinition setVersion(String value) { 
5569      if (Utilities.noString(value))
5570        this.version = null;
5571      else {
5572        if (this.version == null)
5573          this.version = new StringType();
5574        this.version.setValue(value);
5575      }
5576      return this;
5577    }
5578
5579    /**
5580     * @return {@link #name} (A natural language name identifying the plan definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
5581     */
5582    public StringType getNameElement() { 
5583      if (this.name == null)
5584        if (Configuration.errorOnAutoCreate())
5585          throw new Error("Attempt to auto-create PlanDefinition.name");
5586        else if (Configuration.doAutoCreate())
5587          this.name = new StringType(); // bb
5588      return this.name;
5589    }
5590
5591    public boolean hasNameElement() { 
5592      return this.name != null && !this.name.isEmpty();
5593    }
5594
5595    public boolean hasName() { 
5596      return this.name != null && !this.name.isEmpty();
5597    }
5598
5599    /**
5600     * @param value {@link #name} (A natural language name identifying the plan definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
5601     */
5602    public PlanDefinition setNameElement(StringType value) { 
5603      this.name = value;
5604      return this;
5605    }
5606
5607    /**
5608     * @return A natural language name identifying the plan definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.
5609     */
5610    public String getName() { 
5611      return this.name == null ? null : this.name.getValue();
5612    }
5613
5614    /**
5615     * @param value A natural language name identifying the plan definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.
5616     */
5617    public PlanDefinition setName(String value) { 
5618      if (Utilities.noString(value))
5619        this.name = null;
5620      else {
5621        if (this.name == null)
5622          this.name = new StringType();
5623        this.name.setValue(value);
5624      }
5625      return this;
5626    }
5627
5628    /**
5629     * @return {@link #title} (A short, descriptive, user-friendly title for the plan definition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
5630     */
5631    public StringType getTitleElement() { 
5632      if (this.title == null)
5633        if (Configuration.errorOnAutoCreate())
5634          throw new Error("Attempt to auto-create PlanDefinition.title");
5635        else if (Configuration.doAutoCreate())
5636          this.title = new StringType(); // bb
5637      return this.title;
5638    }
5639
5640    public boolean hasTitleElement() { 
5641      return this.title != null && !this.title.isEmpty();
5642    }
5643
5644    public boolean hasTitle() { 
5645      return this.title != null && !this.title.isEmpty();
5646    }
5647
5648    /**
5649     * @param value {@link #title} (A short, descriptive, user-friendly title for the plan definition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
5650     */
5651    public PlanDefinition setTitleElement(StringType value) { 
5652      this.title = value;
5653      return this;
5654    }
5655
5656    /**
5657     * @return A short, descriptive, user-friendly title for the plan definition.
5658     */
5659    public String getTitle() { 
5660      return this.title == null ? null : this.title.getValue();
5661    }
5662
5663    /**
5664     * @param value A short, descriptive, user-friendly title for the plan definition.
5665     */
5666    public PlanDefinition setTitle(String value) { 
5667      if (Utilities.noString(value))
5668        this.title = null;
5669      else {
5670        if (this.title == null)
5671          this.title = new StringType();
5672        this.title.setValue(value);
5673      }
5674      return this;
5675    }
5676
5677    /**
5678     * @return {@link #subtitle} (An explanatory or alternate title for the plan definition giving additional information about its content.). This is the underlying object with id, value and extensions. The accessor "getSubtitle" gives direct access to the value
5679     */
5680    public StringType getSubtitleElement() { 
5681      if (this.subtitle == null)
5682        if (Configuration.errorOnAutoCreate())
5683          throw new Error("Attempt to auto-create PlanDefinition.subtitle");
5684        else if (Configuration.doAutoCreate())
5685          this.subtitle = new StringType(); // bb
5686      return this.subtitle;
5687    }
5688
5689    public boolean hasSubtitleElement() { 
5690      return this.subtitle != null && !this.subtitle.isEmpty();
5691    }
5692
5693    public boolean hasSubtitle() { 
5694      return this.subtitle != null && !this.subtitle.isEmpty();
5695    }
5696
5697    /**
5698     * @param value {@link #subtitle} (An explanatory or alternate title for the plan definition giving additional information about its content.). This is the underlying object with id, value and extensions. The accessor "getSubtitle" gives direct access to the value
5699     */
5700    public PlanDefinition setSubtitleElement(StringType value) { 
5701      this.subtitle = value;
5702      return this;
5703    }
5704
5705    /**
5706     * @return An explanatory or alternate title for the plan definition giving additional information about its content.
5707     */
5708    public String getSubtitle() { 
5709      return this.subtitle == null ? null : this.subtitle.getValue();
5710    }
5711
5712    /**
5713     * @param value An explanatory or alternate title for the plan definition giving additional information about its content.
5714     */
5715    public PlanDefinition setSubtitle(String value) { 
5716      if (Utilities.noString(value))
5717        this.subtitle = null;
5718      else {
5719        if (this.subtitle == null)
5720          this.subtitle = new StringType();
5721        this.subtitle.setValue(value);
5722      }
5723      return this;
5724    }
5725
5726    /**
5727     * @return {@link #type} (A high-level category for the plan definition that distinguishes the kinds of systems that would be interested in the plan definition.)
5728     */
5729    public CodeableConcept getType() { 
5730      if (this.type == null)
5731        if (Configuration.errorOnAutoCreate())
5732          throw new Error("Attempt to auto-create PlanDefinition.type");
5733        else if (Configuration.doAutoCreate())
5734          this.type = new CodeableConcept(); // cc
5735      return this.type;
5736    }
5737
5738    public boolean hasType() { 
5739      return this.type != null && !this.type.isEmpty();
5740    }
5741
5742    /**
5743     * @param value {@link #type} (A high-level category for the plan definition that distinguishes the kinds of systems that would be interested in the plan definition.)
5744     */
5745    public PlanDefinition setType(CodeableConcept value) { 
5746      this.type = value;
5747      return this;
5748    }
5749
5750    /**
5751     * @return {@link #status} (The status of this plan definition. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
5752     */
5753    public Enumeration<PublicationStatus> getStatusElement() { 
5754      if (this.status == null)
5755        if (Configuration.errorOnAutoCreate())
5756          throw new Error("Attempt to auto-create PlanDefinition.status");
5757        else if (Configuration.doAutoCreate())
5758          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
5759      return this.status;
5760    }
5761
5762    public boolean hasStatusElement() { 
5763      return this.status != null && !this.status.isEmpty();
5764    }
5765
5766    public boolean hasStatus() { 
5767      return this.status != null && !this.status.isEmpty();
5768    }
5769
5770    /**
5771     * @param value {@link #status} (The status of this plan definition. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
5772     */
5773    public PlanDefinition setStatusElement(Enumeration<PublicationStatus> value) { 
5774      this.status = value;
5775      return this;
5776    }
5777
5778    /**
5779     * @return The status of this plan definition. Enables tracking the life-cycle of the content.
5780     */
5781    public PublicationStatus getStatus() { 
5782      return this.status == null ? null : this.status.getValue();
5783    }
5784
5785    /**
5786     * @param value The status of this plan definition. Enables tracking the life-cycle of the content.
5787     */
5788    public PlanDefinition setStatus(PublicationStatus value) { 
5789        if (this.status == null)
5790          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
5791        this.status.setValue(value);
5792      return this;
5793    }
5794
5795    /**
5796     * @return {@link #experimental} (A Boolean value to indicate that this plan definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
5797     */
5798    public BooleanType getExperimentalElement() { 
5799      if (this.experimental == null)
5800        if (Configuration.errorOnAutoCreate())
5801          throw new Error("Attempt to auto-create PlanDefinition.experimental");
5802        else if (Configuration.doAutoCreate())
5803          this.experimental = new BooleanType(); // bb
5804      return this.experimental;
5805    }
5806
5807    public boolean hasExperimentalElement() { 
5808      return this.experimental != null && !this.experimental.isEmpty();
5809    }
5810
5811    public boolean hasExperimental() { 
5812      return this.experimental != null && !this.experimental.isEmpty();
5813    }
5814
5815    /**
5816     * @param value {@link #experimental} (A Boolean value to indicate that this plan definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
5817     */
5818    public PlanDefinition setExperimentalElement(BooleanType value) { 
5819      this.experimental = value;
5820      return this;
5821    }
5822
5823    /**
5824     * @return A Boolean value to indicate that this plan definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
5825     */
5826    public boolean getExperimental() { 
5827      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
5828    }
5829
5830    /**
5831     * @param value A Boolean value to indicate that this plan definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
5832     */
5833    public PlanDefinition setExperimental(boolean value) { 
5834        if (this.experimental == null)
5835          this.experimental = new BooleanType();
5836        this.experimental.setValue(value);
5837      return this;
5838    }
5839
5840    /**
5841     * @return {@link #subject} (A code or group definition that describes the intended subject of the plan definition.)
5842     */
5843    public Type getSubject() { 
5844      return this.subject;
5845    }
5846
5847    /**
5848     * @return {@link #subject} (A code or group definition that describes the intended subject of the plan definition.)
5849     */
5850    public CodeableConcept getSubjectCodeableConcept() throws FHIRException { 
5851      if (this.subject == null)
5852        this.subject = new CodeableConcept();
5853      if (!(this.subject instanceof CodeableConcept))
5854        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.subject.getClass().getName()+" was encountered");
5855      return (CodeableConcept) this.subject;
5856    }
5857
5858    public boolean hasSubjectCodeableConcept() { 
5859      return this != null && this.subject instanceof CodeableConcept;
5860    }
5861
5862    /**
5863     * @return {@link #subject} (A code or group definition that describes the intended subject of the plan definition.)
5864     */
5865    public Reference getSubjectReference() throws FHIRException { 
5866      if (this.subject == null)
5867        this.subject = new Reference();
5868      if (!(this.subject instanceof Reference))
5869        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.subject.getClass().getName()+" was encountered");
5870      return (Reference) this.subject;
5871    }
5872
5873    public boolean hasSubjectReference() { 
5874      return this != null && this.subject instanceof Reference;
5875    }
5876
5877    public boolean hasSubject() { 
5878      return this.subject != null && !this.subject.isEmpty();
5879    }
5880
5881    /**
5882     * @param value {@link #subject} (A code or group definition that describes the intended subject of the plan definition.)
5883     */
5884    public PlanDefinition setSubject(Type value) { 
5885      if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
5886        throw new Error("Not the right type for PlanDefinition.subject[x]: "+value.fhirType());
5887      this.subject = value;
5888      return this;
5889    }
5890
5891    /**
5892     * @return {@link #date} (The date  (and optionally time) when the plan definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the plan definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
5893     */
5894    public DateTimeType getDateElement() { 
5895      if (this.date == null)
5896        if (Configuration.errorOnAutoCreate())
5897          throw new Error("Attempt to auto-create PlanDefinition.date");
5898        else if (Configuration.doAutoCreate())
5899          this.date = new DateTimeType(); // bb
5900      return this.date;
5901    }
5902
5903    public boolean hasDateElement() { 
5904      return this.date != null && !this.date.isEmpty();
5905    }
5906
5907    public boolean hasDate() { 
5908      return this.date != null && !this.date.isEmpty();
5909    }
5910
5911    /**
5912     * @param value {@link #date} (The date  (and optionally time) when the plan definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the plan definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
5913     */
5914    public PlanDefinition setDateElement(DateTimeType value) { 
5915      this.date = value;
5916      return this;
5917    }
5918
5919    /**
5920     * @return The date  (and optionally time) when the plan definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the plan definition changes.
5921     */
5922    public Date getDate() { 
5923      return this.date == null ? null : this.date.getValue();
5924    }
5925
5926    /**
5927     * @param value The date  (and optionally time) when the plan definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the plan definition changes.
5928     */
5929    public PlanDefinition setDate(Date value) { 
5930      if (value == null)
5931        this.date = null;
5932      else {
5933        if (this.date == null)
5934          this.date = new DateTimeType();
5935        this.date.setValue(value);
5936      }
5937      return this;
5938    }
5939
5940    /**
5941     * @return {@link #publisher} (The name of the organization or individual that published the plan definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
5942     */
5943    public StringType getPublisherElement() { 
5944      if (this.publisher == null)
5945        if (Configuration.errorOnAutoCreate())
5946          throw new Error("Attempt to auto-create PlanDefinition.publisher");
5947        else if (Configuration.doAutoCreate())
5948          this.publisher = new StringType(); // bb
5949      return this.publisher;
5950    }
5951
5952    public boolean hasPublisherElement() { 
5953      return this.publisher != null && !this.publisher.isEmpty();
5954    }
5955
5956    public boolean hasPublisher() { 
5957      return this.publisher != null && !this.publisher.isEmpty();
5958    }
5959
5960    /**
5961     * @param value {@link #publisher} (The name of the organization or individual that published the plan definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
5962     */
5963    public PlanDefinition setPublisherElement(StringType value) { 
5964      this.publisher = value;
5965      return this;
5966    }
5967
5968    /**
5969     * @return The name of the organization or individual that published the plan definition.
5970     */
5971    public String getPublisher() { 
5972      return this.publisher == null ? null : this.publisher.getValue();
5973    }
5974
5975    /**
5976     * @param value The name of the organization or individual that published the plan definition.
5977     */
5978    public PlanDefinition setPublisher(String value) { 
5979      if (Utilities.noString(value))
5980        this.publisher = null;
5981      else {
5982        if (this.publisher == null)
5983          this.publisher = new StringType();
5984        this.publisher.setValue(value);
5985      }
5986      return this;
5987    }
5988
5989    /**
5990     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
5991     */
5992    public List<ContactDetail> getContact() { 
5993      if (this.contact == null)
5994        this.contact = new ArrayList<ContactDetail>();
5995      return this.contact;
5996    }
5997
5998    /**
5999     * @return Returns a reference to <code>this</code> for easy method chaining
6000     */
6001    public PlanDefinition setContact(List<ContactDetail> theContact) { 
6002      this.contact = theContact;
6003      return this;
6004    }
6005
6006    public boolean hasContact() { 
6007      if (this.contact == null)
6008        return false;
6009      for (ContactDetail item : this.contact)
6010        if (!item.isEmpty())
6011          return true;
6012      return false;
6013    }
6014
6015    public ContactDetail addContact() { //3
6016      ContactDetail t = new ContactDetail();
6017      if (this.contact == null)
6018        this.contact = new ArrayList<ContactDetail>();
6019      this.contact.add(t);
6020      return t;
6021    }
6022
6023    public PlanDefinition addContact(ContactDetail t) { //3
6024      if (t == null)
6025        return this;
6026      if (this.contact == null)
6027        this.contact = new ArrayList<ContactDetail>();
6028      this.contact.add(t);
6029      return this;
6030    }
6031
6032    /**
6033     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
6034     */
6035    public ContactDetail getContactFirstRep() { 
6036      if (getContact().isEmpty()) {
6037        addContact();
6038      }
6039      return getContact().get(0);
6040    }
6041
6042    /**
6043     * @return {@link #description} (A free text natural language description of the plan definition from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
6044     */
6045    public MarkdownType getDescriptionElement() { 
6046      if (this.description == null)
6047        if (Configuration.errorOnAutoCreate())
6048          throw new Error("Attempt to auto-create PlanDefinition.description");
6049        else if (Configuration.doAutoCreate())
6050          this.description = new MarkdownType(); // bb
6051      return this.description;
6052    }
6053
6054    public boolean hasDescriptionElement() { 
6055      return this.description != null && !this.description.isEmpty();
6056    }
6057
6058    public boolean hasDescription() { 
6059      return this.description != null && !this.description.isEmpty();
6060    }
6061
6062    /**
6063     * @param value {@link #description} (A free text natural language description of the plan definition from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
6064     */
6065    public PlanDefinition setDescriptionElement(MarkdownType value) { 
6066      this.description = value;
6067      return this;
6068    }
6069
6070    /**
6071     * @return A free text natural language description of the plan definition from a consumer's perspective.
6072     */
6073    public String getDescription() { 
6074      return this.description == null ? null : this.description.getValue();
6075    }
6076
6077    /**
6078     * @param value A free text natural language description of the plan definition from a consumer's perspective.
6079     */
6080    public PlanDefinition setDescription(String value) { 
6081      if (value == null)
6082        this.description = null;
6083      else {
6084        if (this.description == null)
6085          this.description = new MarkdownType();
6086        this.description.setValue(value);
6087      }
6088      return this;
6089    }
6090
6091    /**
6092     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate plan definition instances.)
6093     */
6094    public List<UsageContext> getUseContext() { 
6095      if (this.useContext == null)
6096        this.useContext = new ArrayList<UsageContext>();
6097      return this.useContext;
6098    }
6099
6100    /**
6101     * @return Returns a reference to <code>this</code> for easy method chaining
6102     */
6103    public PlanDefinition setUseContext(List<UsageContext> theUseContext) { 
6104      this.useContext = theUseContext;
6105      return this;
6106    }
6107
6108    public boolean hasUseContext() { 
6109      if (this.useContext == null)
6110        return false;
6111      for (UsageContext item : this.useContext)
6112        if (!item.isEmpty())
6113          return true;
6114      return false;
6115    }
6116
6117    public UsageContext addUseContext() { //3
6118      UsageContext t = new UsageContext();
6119      if (this.useContext == null)
6120        this.useContext = new ArrayList<UsageContext>();
6121      this.useContext.add(t);
6122      return t;
6123    }
6124
6125    public PlanDefinition addUseContext(UsageContext t) { //3
6126      if (t == null)
6127        return this;
6128      if (this.useContext == null)
6129        this.useContext = new ArrayList<UsageContext>();
6130      this.useContext.add(t);
6131      return this;
6132    }
6133
6134    /**
6135     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
6136     */
6137    public UsageContext getUseContextFirstRep() { 
6138      if (getUseContext().isEmpty()) {
6139        addUseContext();
6140      }
6141      return getUseContext().get(0);
6142    }
6143
6144    /**
6145     * @return {@link #jurisdiction} (A legal or geographic region in which the plan definition is intended to be used.)
6146     */
6147    public List<CodeableConcept> getJurisdiction() { 
6148      if (this.jurisdiction == null)
6149        this.jurisdiction = new ArrayList<CodeableConcept>();
6150      return this.jurisdiction;
6151    }
6152
6153    /**
6154     * @return Returns a reference to <code>this</code> for easy method chaining
6155     */
6156    public PlanDefinition setJurisdiction(List<CodeableConcept> theJurisdiction) { 
6157      this.jurisdiction = theJurisdiction;
6158      return this;
6159    }
6160
6161    public boolean hasJurisdiction() { 
6162      if (this.jurisdiction == null)
6163        return false;
6164      for (CodeableConcept item : this.jurisdiction)
6165        if (!item.isEmpty())
6166          return true;
6167      return false;
6168    }
6169
6170    public CodeableConcept addJurisdiction() { //3
6171      CodeableConcept t = new CodeableConcept();
6172      if (this.jurisdiction == null)
6173        this.jurisdiction = new ArrayList<CodeableConcept>();
6174      this.jurisdiction.add(t);
6175      return t;
6176    }
6177
6178    public PlanDefinition addJurisdiction(CodeableConcept t) { //3
6179      if (t == null)
6180        return this;
6181      if (this.jurisdiction == null)
6182        this.jurisdiction = new ArrayList<CodeableConcept>();
6183      this.jurisdiction.add(t);
6184      return this;
6185    }
6186
6187    /**
6188     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
6189     */
6190    public CodeableConcept getJurisdictionFirstRep() { 
6191      if (getJurisdiction().isEmpty()) {
6192        addJurisdiction();
6193      }
6194      return getJurisdiction().get(0);
6195    }
6196
6197    /**
6198     * @return {@link #purpose} (Explanation of why this plan definition is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
6199     */
6200    public MarkdownType getPurposeElement() { 
6201      if (this.purpose == null)
6202        if (Configuration.errorOnAutoCreate())
6203          throw new Error("Attempt to auto-create PlanDefinition.purpose");
6204        else if (Configuration.doAutoCreate())
6205          this.purpose = new MarkdownType(); // bb
6206      return this.purpose;
6207    }
6208
6209    public boolean hasPurposeElement() { 
6210      return this.purpose != null && !this.purpose.isEmpty();
6211    }
6212
6213    public boolean hasPurpose() { 
6214      return this.purpose != null && !this.purpose.isEmpty();
6215    }
6216
6217    /**
6218     * @param value {@link #purpose} (Explanation of why this plan definition is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
6219     */
6220    public PlanDefinition setPurposeElement(MarkdownType value) { 
6221      this.purpose = value;
6222      return this;
6223    }
6224
6225    /**
6226     * @return Explanation of why this plan definition is needed and why it has been designed as it has.
6227     */
6228    public String getPurpose() { 
6229      return this.purpose == null ? null : this.purpose.getValue();
6230    }
6231
6232    /**
6233     * @param value Explanation of why this plan definition is needed and why it has been designed as it has.
6234     */
6235    public PlanDefinition setPurpose(String value) { 
6236      if (value == null)
6237        this.purpose = null;
6238      else {
6239        if (this.purpose == null)
6240          this.purpose = new MarkdownType();
6241        this.purpose.setValue(value);
6242      }
6243      return this;
6244    }
6245
6246    /**
6247     * @return {@link #usage} (A detailed description of how the plan definition is used from a clinical perspective.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value
6248     */
6249    public StringType getUsageElement() { 
6250      if (this.usage == null)
6251        if (Configuration.errorOnAutoCreate())
6252          throw new Error("Attempt to auto-create PlanDefinition.usage");
6253        else if (Configuration.doAutoCreate())
6254          this.usage = new StringType(); // bb
6255      return this.usage;
6256    }
6257
6258    public boolean hasUsageElement() { 
6259      return this.usage != null && !this.usage.isEmpty();
6260    }
6261
6262    public boolean hasUsage() { 
6263      return this.usage != null && !this.usage.isEmpty();
6264    }
6265
6266    /**
6267     * @param value {@link #usage} (A detailed description of how the plan definition is used from a clinical perspective.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value
6268     */
6269    public PlanDefinition setUsageElement(StringType value) { 
6270      this.usage = value;
6271      return this;
6272    }
6273
6274    /**
6275     * @return A detailed description of how the plan definition is used from a clinical perspective.
6276     */
6277    public String getUsage() { 
6278      return this.usage == null ? null : this.usage.getValue();
6279    }
6280
6281    /**
6282     * @param value A detailed description of how the plan definition is used from a clinical perspective.
6283     */
6284    public PlanDefinition setUsage(String value) { 
6285      if (Utilities.noString(value))
6286        this.usage = null;
6287      else {
6288        if (this.usage == null)
6289          this.usage = new StringType();
6290        this.usage.setValue(value);
6291      }
6292      return this;
6293    }
6294
6295    /**
6296     * @return {@link #copyright} (A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
6297     */
6298    public MarkdownType getCopyrightElement() { 
6299      if (this.copyright == null)
6300        if (Configuration.errorOnAutoCreate())
6301          throw new Error("Attempt to auto-create PlanDefinition.copyright");
6302        else if (Configuration.doAutoCreate())
6303          this.copyright = new MarkdownType(); // bb
6304      return this.copyright;
6305    }
6306
6307    public boolean hasCopyrightElement() { 
6308      return this.copyright != null && !this.copyright.isEmpty();
6309    }
6310
6311    public boolean hasCopyright() { 
6312      return this.copyright != null && !this.copyright.isEmpty();
6313    }
6314
6315    /**
6316     * @param value {@link #copyright} (A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
6317     */
6318    public PlanDefinition setCopyrightElement(MarkdownType value) { 
6319      this.copyright = value;
6320      return this;
6321    }
6322
6323    /**
6324     * @return A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition.
6325     */
6326    public String getCopyright() { 
6327      return this.copyright == null ? null : this.copyright.getValue();
6328    }
6329
6330    /**
6331     * @param value A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition.
6332     */
6333    public PlanDefinition setCopyright(String value) { 
6334      if (value == null)
6335        this.copyright = null;
6336      else {
6337        if (this.copyright == null)
6338          this.copyright = new MarkdownType();
6339        this.copyright.setValue(value);
6340      }
6341      return this;
6342    }
6343
6344    /**
6345     * @return {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
6346     */
6347    public DateType getApprovalDateElement() { 
6348      if (this.approvalDate == null)
6349        if (Configuration.errorOnAutoCreate())
6350          throw new Error("Attempt to auto-create PlanDefinition.approvalDate");
6351        else if (Configuration.doAutoCreate())
6352          this.approvalDate = new DateType(); // bb
6353      return this.approvalDate;
6354    }
6355
6356    public boolean hasApprovalDateElement() { 
6357      return this.approvalDate != null && !this.approvalDate.isEmpty();
6358    }
6359
6360    public boolean hasApprovalDate() { 
6361      return this.approvalDate != null && !this.approvalDate.isEmpty();
6362    }
6363
6364    /**
6365     * @param value {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
6366     */
6367    public PlanDefinition setApprovalDateElement(DateType value) { 
6368      this.approvalDate = value;
6369      return this;
6370    }
6371
6372    /**
6373     * @return The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
6374     */
6375    public Date getApprovalDate() { 
6376      return this.approvalDate == null ? null : this.approvalDate.getValue();
6377    }
6378
6379    /**
6380     * @param value The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
6381     */
6382    public PlanDefinition setApprovalDate(Date value) { 
6383      if (value == null)
6384        this.approvalDate = null;
6385      else {
6386        if (this.approvalDate == null)
6387          this.approvalDate = new DateType();
6388        this.approvalDate.setValue(value);
6389      }
6390      return this;
6391    }
6392
6393    /**
6394     * @return {@link #lastReviewDate} (The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
6395     */
6396    public DateType getLastReviewDateElement() { 
6397      if (this.lastReviewDate == null)
6398        if (Configuration.errorOnAutoCreate())
6399          throw new Error("Attempt to auto-create PlanDefinition.lastReviewDate");
6400        else if (Configuration.doAutoCreate())
6401          this.lastReviewDate = new DateType(); // bb
6402      return this.lastReviewDate;
6403    }
6404
6405    public boolean hasLastReviewDateElement() { 
6406      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
6407    }
6408
6409    public boolean hasLastReviewDate() { 
6410      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
6411    }
6412
6413    /**
6414     * @param value {@link #lastReviewDate} (The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
6415     */
6416    public PlanDefinition setLastReviewDateElement(DateType value) { 
6417      this.lastReviewDate = value;
6418      return this;
6419    }
6420
6421    /**
6422     * @return The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
6423     */
6424    public Date getLastReviewDate() { 
6425      return this.lastReviewDate == null ? null : this.lastReviewDate.getValue();
6426    }
6427
6428    /**
6429     * @param value The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
6430     */
6431    public PlanDefinition setLastReviewDate(Date value) { 
6432      if (value == null)
6433        this.lastReviewDate = null;
6434      else {
6435        if (this.lastReviewDate == null)
6436          this.lastReviewDate = new DateType();
6437        this.lastReviewDate.setValue(value);
6438      }
6439      return this;
6440    }
6441
6442    /**
6443     * @return {@link #effectivePeriod} (The period during which the plan definition content was or is planned to be in active use.)
6444     */
6445    public Period getEffectivePeriod() { 
6446      if (this.effectivePeriod == null)
6447        if (Configuration.errorOnAutoCreate())
6448          throw new Error("Attempt to auto-create PlanDefinition.effectivePeriod");
6449        else if (Configuration.doAutoCreate())
6450          this.effectivePeriod = new Period(); // cc
6451      return this.effectivePeriod;
6452    }
6453
6454    public boolean hasEffectivePeriod() { 
6455      return this.effectivePeriod != null && !this.effectivePeriod.isEmpty();
6456    }
6457
6458    /**
6459     * @param value {@link #effectivePeriod} (The period during which the plan definition content was or is planned to be in active use.)
6460     */
6461    public PlanDefinition setEffectivePeriod(Period value) { 
6462      this.effectivePeriod = value;
6463      return this;
6464    }
6465
6466    /**
6467     * @return {@link #topic} (Descriptive topics related to the content of the plan definition. Topics provide a high-level categorization of the definition that can be useful for filtering and searching.)
6468     */
6469    public List<CodeableConcept> getTopic() { 
6470      if (this.topic == null)
6471        this.topic = new ArrayList<CodeableConcept>();
6472      return this.topic;
6473    }
6474
6475    /**
6476     * @return Returns a reference to <code>this</code> for easy method chaining
6477     */
6478    public PlanDefinition setTopic(List<CodeableConcept> theTopic) { 
6479      this.topic = theTopic;
6480      return this;
6481    }
6482
6483    public boolean hasTopic() { 
6484      if (this.topic == null)
6485        return false;
6486      for (CodeableConcept item : this.topic)
6487        if (!item.isEmpty())
6488          return true;
6489      return false;
6490    }
6491
6492    public CodeableConcept addTopic() { //3
6493      CodeableConcept t = new CodeableConcept();
6494      if (this.topic == null)
6495        this.topic = new ArrayList<CodeableConcept>();
6496      this.topic.add(t);
6497      return t;
6498    }
6499
6500    public PlanDefinition addTopic(CodeableConcept t) { //3
6501      if (t == null)
6502        return this;
6503      if (this.topic == null)
6504        this.topic = new ArrayList<CodeableConcept>();
6505      this.topic.add(t);
6506      return this;
6507    }
6508
6509    /**
6510     * @return The first repetition of repeating field {@link #topic}, creating it if it does not already exist
6511     */
6512    public CodeableConcept getTopicFirstRep() { 
6513      if (getTopic().isEmpty()) {
6514        addTopic();
6515      }
6516      return getTopic().get(0);
6517    }
6518
6519    /**
6520     * @return {@link #author} (An individiual or organization primarily involved in the creation and maintenance of the content.)
6521     */
6522    public List<ContactDetail> getAuthor() { 
6523      if (this.author == null)
6524        this.author = new ArrayList<ContactDetail>();
6525      return this.author;
6526    }
6527
6528    /**
6529     * @return Returns a reference to <code>this</code> for easy method chaining
6530     */
6531    public PlanDefinition setAuthor(List<ContactDetail> theAuthor) { 
6532      this.author = theAuthor;
6533      return this;
6534    }
6535
6536    public boolean hasAuthor() { 
6537      if (this.author == null)
6538        return false;
6539      for (ContactDetail item : this.author)
6540        if (!item.isEmpty())
6541          return true;
6542      return false;
6543    }
6544
6545    public ContactDetail addAuthor() { //3
6546      ContactDetail t = new ContactDetail();
6547      if (this.author == null)
6548        this.author = new ArrayList<ContactDetail>();
6549      this.author.add(t);
6550      return t;
6551    }
6552
6553    public PlanDefinition addAuthor(ContactDetail t) { //3
6554      if (t == null)
6555        return this;
6556      if (this.author == null)
6557        this.author = new ArrayList<ContactDetail>();
6558      this.author.add(t);
6559      return this;
6560    }
6561
6562    /**
6563     * @return The first repetition of repeating field {@link #author}, creating it if it does not already exist
6564     */
6565    public ContactDetail getAuthorFirstRep() { 
6566      if (getAuthor().isEmpty()) {
6567        addAuthor();
6568      }
6569      return getAuthor().get(0);
6570    }
6571
6572    /**
6573     * @return {@link #editor} (An individual or organization primarily responsible for internal coherence of the content.)
6574     */
6575    public List<ContactDetail> getEditor() { 
6576      if (this.editor == null)
6577        this.editor = new ArrayList<ContactDetail>();
6578      return this.editor;
6579    }
6580
6581    /**
6582     * @return Returns a reference to <code>this</code> for easy method chaining
6583     */
6584    public PlanDefinition setEditor(List<ContactDetail> theEditor) { 
6585      this.editor = theEditor;
6586      return this;
6587    }
6588
6589    public boolean hasEditor() { 
6590      if (this.editor == null)
6591        return false;
6592      for (ContactDetail item : this.editor)
6593        if (!item.isEmpty())
6594          return true;
6595      return false;
6596    }
6597
6598    public ContactDetail addEditor() { //3
6599      ContactDetail t = new ContactDetail();
6600      if (this.editor == null)
6601        this.editor = new ArrayList<ContactDetail>();
6602      this.editor.add(t);
6603      return t;
6604    }
6605
6606    public PlanDefinition addEditor(ContactDetail t) { //3
6607      if (t == null)
6608        return this;
6609      if (this.editor == null)
6610        this.editor = new ArrayList<ContactDetail>();
6611      this.editor.add(t);
6612      return this;
6613    }
6614
6615    /**
6616     * @return The first repetition of repeating field {@link #editor}, creating it if it does not already exist
6617     */
6618    public ContactDetail getEditorFirstRep() { 
6619      if (getEditor().isEmpty()) {
6620        addEditor();
6621      }
6622      return getEditor().get(0);
6623    }
6624
6625    /**
6626     * @return {@link #reviewer} (An individual or organization primarily responsible for review of some aspect of the content.)
6627     */
6628    public List<ContactDetail> getReviewer() { 
6629      if (this.reviewer == null)
6630        this.reviewer = new ArrayList<ContactDetail>();
6631      return this.reviewer;
6632    }
6633
6634    /**
6635     * @return Returns a reference to <code>this</code> for easy method chaining
6636     */
6637    public PlanDefinition setReviewer(List<ContactDetail> theReviewer) { 
6638      this.reviewer = theReviewer;
6639      return this;
6640    }
6641
6642    public boolean hasReviewer() { 
6643      if (this.reviewer == null)
6644        return false;
6645      for (ContactDetail item : this.reviewer)
6646        if (!item.isEmpty())
6647          return true;
6648      return false;
6649    }
6650
6651    public ContactDetail addReviewer() { //3
6652      ContactDetail t = new ContactDetail();
6653      if (this.reviewer == null)
6654        this.reviewer = new ArrayList<ContactDetail>();
6655      this.reviewer.add(t);
6656      return t;
6657    }
6658
6659    public PlanDefinition addReviewer(ContactDetail t) { //3
6660      if (t == null)
6661        return this;
6662      if (this.reviewer == null)
6663        this.reviewer = new ArrayList<ContactDetail>();
6664      this.reviewer.add(t);
6665      return this;
6666    }
6667
6668    /**
6669     * @return The first repetition of repeating field {@link #reviewer}, creating it if it does not already exist
6670     */
6671    public ContactDetail getReviewerFirstRep() { 
6672      if (getReviewer().isEmpty()) {
6673        addReviewer();
6674      }
6675      return getReviewer().get(0);
6676    }
6677
6678    /**
6679     * @return {@link #endorser} (An individual or organization responsible for officially endorsing the content for use in some setting.)
6680     */
6681    public List<ContactDetail> getEndorser() { 
6682      if (this.endorser == null)
6683        this.endorser = new ArrayList<ContactDetail>();
6684      return this.endorser;
6685    }
6686
6687    /**
6688     * @return Returns a reference to <code>this</code> for easy method chaining
6689     */
6690    public PlanDefinition setEndorser(List<ContactDetail> theEndorser) { 
6691      this.endorser = theEndorser;
6692      return this;
6693    }
6694
6695    public boolean hasEndorser() { 
6696      if (this.endorser == null)
6697        return false;
6698      for (ContactDetail item : this.endorser)
6699        if (!item.isEmpty())
6700          return true;
6701      return false;
6702    }
6703
6704    public ContactDetail addEndorser() { //3
6705      ContactDetail t = new ContactDetail();
6706      if (this.endorser == null)
6707        this.endorser = new ArrayList<ContactDetail>();
6708      this.endorser.add(t);
6709      return t;
6710    }
6711
6712    public PlanDefinition addEndorser(ContactDetail t) { //3
6713      if (t == null)
6714        return this;
6715      if (this.endorser == null)
6716        this.endorser = new ArrayList<ContactDetail>();
6717      this.endorser.add(t);
6718      return this;
6719    }
6720
6721    /**
6722     * @return The first repetition of repeating field {@link #endorser}, creating it if it does not already exist
6723     */
6724    public ContactDetail getEndorserFirstRep() { 
6725      if (getEndorser().isEmpty()) {
6726        addEndorser();
6727      }
6728      return getEndorser().get(0);
6729    }
6730
6731    /**
6732     * @return {@link #relatedArtifact} (Related artifacts such as additional documentation, justification, or bibliographic references.)
6733     */
6734    public List<RelatedArtifact> getRelatedArtifact() { 
6735      if (this.relatedArtifact == null)
6736        this.relatedArtifact = new ArrayList<RelatedArtifact>();
6737      return this.relatedArtifact;
6738    }
6739
6740    /**
6741     * @return Returns a reference to <code>this</code> for easy method chaining
6742     */
6743    public PlanDefinition setRelatedArtifact(List<RelatedArtifact> theRelatedArtifact) { 
6744      this.relatedArtifact = theRelatedArtifact;
6745      return this;
6746    }
6747
6748    public boolean hasRelatedArtifact() { 
6749      if (this.relatedArtifact == null)
6750        return false;
6751      for (RelatedArtifact item : this.relatedArtifact)
6752        if (!item.isEmpty())
6753          return true;
6754      return false;
6755    }
6756
6757    public RelatedArtifact addRelatedArtifact() { //3
6758      RelatedArtifact t = new RelatedArtifact();
6759      if (this.relatedArtifact == null)
6760        this.relatedArtifact = new ArrayList<RelatedArtifact>();
6761      this.relatedArtifact.add(t);
6762      return t;
6763    }
6764
6765    public PlanDefinition addRelatedArtifact(RelatedArtifact t) { //3
6766      if (t == null)
6767        return this;
6768      if (this.relatedArtifact == null)
6769        this.relatedArtifact = new ArrayList<RelatedArtifact>();
6770      this.relatedArtifact.add(t);
6771      return this;
6772    }
6773
6774    /**
6775     * @return The first repetition of repeating field {@link #relatedArtifact}, creating it if it does not already exist
6776     */
6777    public RelatedArtifact getRelatedArtifactFirstRep() { 
6778      if (getRelatedArtifact().isEmpty()) {
6779        addRelatedArtifact();
6780      }
6781      return getRelatedArtifact().get(0);
6782    }
6783
6784    /**
6785     * @return {@link #library} (A reference to a Library resource containing any formal logic used by the plan definition.)
6786     */
6787    public List<CanonicalType> getLibrary() { 
6788      if (this.library == null)
6789        this.library = new ArrayList<CanonicalType>();
6790      return this.library;
6791    }
6792
6793    /**
6794     * @return Returns a reference to <code>this</code> for easy method chaining
6795     */
6796    public PlanDefinition setLibrary(List<CanonicalType> theLibrary) { 
6797      this.library = theLibrary;
6798      return this;
6799    }
6800
6801    public boolean hasLibrary() { 
6802      if (this.library == null)
6803        return false;
6804      for (CanonicalType item : this.library)
6805        if (!item.isEmpty())
6806          return true;
6807      return false;
6808    }
6809
6810    /**
6811     * @return {@link #library} (A reference to a Library resource containing any formal logic used by the plan definition.)
6812     */
6813    public CanonicalType addLibraryElement() {//2 
6814      CanonicalType t = new CanonicalType();
6815      if (this.library == null)
6816        this.library = new ArrayList<CanonicalType>();
6817      this.library.add(t);
6818      return t;
6819    }
6820
6821    /**
6822     * @param value {@link #library} (A reference to a Library resource containing any formal logic used by the plan definition.)
6823     */
6824    public PlanDefinition addLibrary(String value) { //1
6825      CanonicalType t = new CanonicalType();
6826      t.setValue(value);
6827      if (this.library == null)
6828        this.library = new ArrayList<CanonicalType>();
6829      this.library.add(t);
6830      return this;
6831    }
6832
6833    /**
6834     * @param value {@link #library} (A reference to a Library resource containing any formal logic used by the plan definition.)
6835     */
6836    public boolean hasLibrary(String value) { 
6837      if (this.library == null)
6838        return false;
6839      for (CanonicalType v : this.library)
6840        if (v.getValue().equals(value)) // canonical(Library)
6841          return true;
6842      return false;
6843    }
6844
6845    /**
6846     * @return {@link #goal} (Goals that describe what the activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.)
6847     */
6848    public List<PlanDefinitionGoalComponent> getGoal() { 
6849      if (this.goal == null)
6850        this.goal = new ArrayList<PlanDefinitionGoalComponent>();
6851      return this.goal;
6852    }
6853
6854    /**
6855     * @return Returns a reference to <code>this</code> for easy method chaining
6856     */
6857    public PlanDefinition setGoal(List<PlanDefinitionGoalComponent> theGoal) { 
6858      this.goal = theGoal;
6859      return this;
6860    }
6861
6862    public boolean hasGoal() { 
6863      if (this.goal == null)
6864        return false;
6865      for (PlanDefinitionGoalComponent item : this.goal)
6866        if (!item.isEmpty())
6867          return true;
6868      return false;
6869    }
6870
6871    public PlanDefinitionGoalComponent addGoal() { //3
6872      PlanDefinitionGoalComponent t = new PlanDefinitionGoalComponent();
6873      if (this.goal == null)
6874        this.goal = new ArrayList<PlanDefinitionGoalComponent>();
6875      this.goal.add(t);
6876      return t;
6877    }
6878
6879    public PlanDefinition addGoal(PlanDefinitionGoalComponent t) { //3
6880      if (t == null)
6881        return this;
6882      if (this.goal == null)
6883        this.goal = new ArrayList<PlanDefinitionGoalComponent>();
6884      this.goal.add(t);
6885      return this;
6886    }
6887
6888    /**
6889     * @return The first repetition of repeating field {@link #goal}, creating it if it does not already exist
6890     */
6891    public PlanDefinitionGoalComponent getGoalFirstRep() { 
6892      if (getGoal().isEmpty()) {
6893        addGoal();
6894      }
6895      return getGoal().get(0);
6896    }
6897
6898    /**
6899     * @return {@link #action} (An action or group of actions to be taken as part of the plan.)
6900     */
6901    public List<PlanDefinitionActionComponent> getAction() { 
6902      if (this.action == null)
6903        this.action = new ArrayList<PlanDefinitionActionComponent>();
6904      return this.action;
6905    }
6906
6907    /**
6908     * @return Returns a reference to <code>this</code> for easy method chaining
6909     */
6910    public PlanDefinition setAction(List<PlanDefinitionActionComponent> theAction) { 
6911      this.action = theAction;
6912      return this;
6913    }
6914
6915    public boolean hasAction() { 
6916      if (this.action == null)
6917        return false;
6918      for (PlanDefinitionActionComponent item : this.action)
6919        if (!item.isEmpty())
6920          return true;
6921      return false;
6922    }
6923
6924    public PlanDefinitionActionComponent addAction() { //3
6925      PlanDefinitionActionComponent t = new PlanDefinitionActionComponent();
6926      if (this.action == null)
6927        this.action = new ArrayList<PlanDefinitionActionComponent>();
6928      this.action.add(t);
6929      return t;
6930    }
6931
6932    public PlanDefinition addAction(PlanDefinitionActionComponent t) { //3
6933      if (t == null)
6934        return this;
6935      if (this.action == null)
6936        this.action = new ArrayList<PlanDefinitionActionComponent>();
6937      this.action.add(t);
6938      return this;
6939    }
6940
6941    /**
6942     * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist
6943     */
6944    public PlanDefinitionActionComponent getActionFirstRep() { 
6945      if (getAction().isEmpty()) {
6946        addAction();
6947      }
6948      return getAction().get(0);
6949    }
6950
6951      protected void listChildren(List<Property> children) {
6952        super.listChildren(children);
6953        children.add(new Property("url", "uri", "An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.", 0, 1, url));
6954        children.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this plan definition when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
6955        children.add(new Property("version", "string", "The identifier that is used to identify this version of the plan definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the plan definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.", 0, 1, version));
6956        children.add(new Property("name", "string", "A natural language name identifying the plan definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
6957        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the plan definition.", 0, 1, title));
6958        children.add(new Property("subtitle", "string", "An explanatory or alternate title for the plan definition giving additional information about its content.", 0, 1, subtitle));
6959        children.add(new Property("type", "CodeableConcept", "A high-level category for the plan definition that distinguishes the kinds of systems that would be interested in the plan definition.", 0, 1, type));
6960        children.add(new Property("status", "code", "The status of this plan definition. Enables tracking the life-cycle of the content.", 0, 1, status));
6961        children.add(new Property("experimental", "boolean", "A Boolean value to indicate that this plan definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.", 0, 1, experimental));
6962        children.add(new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the plan definition.", 0, 1, subject));
6963        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the plan definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the plan definition changes.", 0, 1, date));
6964        children.add(new Property("publisher", "string", "The name of the organization or individual that published the plan definition.", 0, 1, publisher));
6965        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
6966        children.add(new Property("description", "markdown", "A free text natural language description of the plan definition from a consumer's perspective.", 0, 1, description));
6967        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate plan definition instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
6968        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the plan definition is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
6969        children.add(new Property("purpose", "markdown", "Explanation of why this plan definition is needed and why it has been designed as it has.", 0, 1, purpose));
6970        children.add(new Property("usage", "string", "A detailed description of how the plan definition is used from a clinical perspective.", 0, 1, usage));
6971        children.add(new Property("copyright", "markdown", "A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition.", 0, 1, copyright));
6972        children.add(new Property("approvalDate", "date", "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.", 0, 1, approvalDate));
6973        children.add(new Property("lastReviewDate", "date", "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.", 0, 1, lastReviewDate));
6974        children.add(new Property("effectivePeriod", "Period", "The period during which the plan definition content was or is planned to be in active use.", 0, 1, effectivePeriod));
6975        children.add(new Property("topic", "CodeableConcept", "Descriptive topics related to the content of the plan definition. Topics provide a high-level categorization of the definition that can be useful for filtering and searching.", 0, java.lang.Integer.MAX_VALUE, topic));
6976        children.add(new Property("author", "ContactDetail", "An individiual or organization primarily involved in the creation and maintenance of the content.", 0, java.lang.Integer.MAX_VALUE, author));
6977        children.add(new Property("editor", "ContactDetail", "An individual or organization primarily responsible for internal coherence of the content.", 0, java.lang.Integer.MAX_VALUE, editor));
6978        children.add(new Property("reviewer", "ContactDetail", "An individual or organization primarily responsible for review of some aspect of the content.", 0, java.lang.Integer.MAX_VALUE, reviewer));
6979        children.add(new Property("endorser", "ContactDetail", "An individual or organization responsible for officially endorsing the content for use in some setting.", 0, java.lang.Integer.MAX_VALUE, endorser));
6980        children.add(new Property("relatedArtifact", "RelatedArtifact", "Related artifacts such as additional documentation, justification, or bibliographic references.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact));
6981        children.add(new Property("library", "canonical(Library)", "A reference to a Library resource containing any formal logic used by the plan definition.", 0, java.lang.Integer.MAX_VALUE, library));
6982        children.add(new Property("goal", "", "Goals that describe what the activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.", 0, java.lang.Integer.MAX_VALUE, goal));
6983        children.add(new Property("action", "", "An action or group of actions to be taken as part of the plan.", 0, java.lang.Integer.MAX_VALUE, action));
6984      }
6985
6986      @Override
6987      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6988        switch (_hash) {
6989        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.", 0, 1, url);
6990        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A formal identifier that is used to identify this plan definition when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier);
6991        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the plan definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the plan definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.", 0, 1, version);
6992        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the plan definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
6993        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the plan definition.", 0, 1, title);
6994        case -2060497896: /*subtitle*/  return new Property("subtitle", "string", "An explanatory or alternate title for the plan definition giving additional information about its content.", 0, 1, subtitle);
6995        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A high-level category for the plan definition that distinguishes the kinds of systems that would be interested in the plan definition.", 0, 1, type);
6996        case -892481550: /*status*/  return new Property("status", "code", "The status of this plan definition. Enables tracking the life-cycle of the content.", 0, 1, status);
6997        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A Boolean value to indicate that this plan definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.", 0, 1, experimental);
6998        case -573640748: /*subject[x]*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the plan definition.", 0, 1, subject);
6999        case -1867885268: /*subject*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the plan definition.", 0, 1, subject);
7000        case -1257122603: /*subjectCodeableConcept*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the plan definition.", 0, 1, subject);
7001        case 772938623: /*subjectReference*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)", "A code or group definition that describes the intended subject of the plan definition.", 0, 1, subject);
7002        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the plan definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the plan definition changes.", 0, 1, date);
7003        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the organization or individual that published the plan definition.", 0, 1, publisher);
7004        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
7005        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the plan definition from a consumer's perspective.", 0, 1, description);
7006        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate plan definition instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
7007        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the plan definition is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
7008        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explanation of why this plan definition is needed and why it has been designed as it has.", 0, 1, purpose);
7009        case 111574433: /*usage*/  return new Property("usage", "string", "A detailed description of how the plan definition is used from a clinical perspective.", 0, 1, usage);
7010        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition.", 0, 1, copyright);
7011        case 223539345: /*approvalDate*/  return new Property("approvalDate", "date", "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.", 0, 1, approvalDate);
7012        case -1687512484: /*lastReviewDate*/  return new Property("lastReviewDate", "date", "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.", 0, 1, lastReviewDate);
7013        case -403934648: /*effectivePeriod*/  return new Property("effectivePeriod", "Period", "The period during which the plan definition content was or is planned to be in active use.", 0, 1, effectivePeriod);
7014        case 110546223: /*topic*/  return new Property("topic", "CodeableConcept", "Descriptive topics related to the content of the plan definition. Topics provide a high-level categorization of the definition that can be useful for filtering and searching.", 0, java.lang.Integer.MAX_VALUE, topic);
7015        case -1406328437: /*author*/  return new Property("author", "ContactDetail", "An individiual or organization primarily involved in the creation and maintenance of the content.", 0, java.lang.Integer.MAX_VALUE, author);
7016        case -1307827859: /*editor*/  return new Property("editor", "ContactDetail", "An individual or organization primarily responsible for internal coherence of the content.", 0, java.lang.Integer.MAX_VALUE, editor);
7017        case -261190139: /*reviewer*/  return new Property("reviewer", "ContactDetail", "An individual or organization primarily responsible for review of some aspect of the content.", 0, java.lang.Integer.MAX_VALUE, reviewer);
7018        case 1740277666: /*endorser*/  return new Property("endorser", "ContactDetail", "An individual or organization responsible for officially endorsing the content for use in some setting.", 0, java.lang.Integer.MAX_VALUE, endorser);
7019        case 666807069: /*relatedArtifact*/  return new Property("relatedArtifact", "RelatedArtifact", "Related artifacts such as additional documentation, justification, or bibliographic references.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact);
7020        case 166208699: /*library*/  return new Property("library", "canonical(Library)", "A reference to a Library resource containing any formal logic used by the plan definition.", 0, java.lang.Integer.MAX_VALUE, library);
7021        case 3178259: /*goal*/  return new Property("goal", "", "Goals that describe what the activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.", 0, java.lang.Integer.MAX_VALUE, goal);
7022        case -1422950858: /*action*/  return new Property("action", "", "An action or group of actions to be taken as part of the plan.", 0, java.lang.Integer.MAX_VALUE, action);
7023        default: return super.getNamedProperty(_hash, _name, _checkValid);
7024        }
7025
7026      }
7027
7028      @Override
7029      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7030        switch (hash) {
7031        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
7032        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
7033        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
7034        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
7035        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
7036        case -2060497896: /*subtitle*/ return this.subtitle == null ? new Base[0] : new Base[] {this.subtitle}; // StringType
7037        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
7038        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
7039        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
7040        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Type
7041        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
7042        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
7043        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
7044        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
7045        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
7046        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
7047        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
7048        case 111574433: /*usage*/ return this.usage == null ? new Base[0] : new Base[] {this.usage}; // StringType
7049        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
7050        case 223539345: /*approvalDate*/ return this.approvalDate == null ? new Base[0] : new Base[] {this.approvalDate}; // DateType
7051        case -1687512484: /*lastReviewDate*/ return this.lastReviewDate == null ? new Base[0] : new Base[] {this.lastReviewDate}; // DateType
7052        case -403934648: /*effectivePeriod*/ return this.effectivePeriod == null ? new Base[0] : new Base[] {this.effectivePeriod}; // Period
7053        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : this.topic.toArray(new Base[this.topic.size()]); // CodeableConcept
7054        case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // ContactDetail
7055        case -1307827859: /*editor*/ return this.editor == null ? new Base[0] : this.editor.toArray(new Base[this.editor.size()]); // ContactDetail
7056        case -261190139: /*reviewer*/ return this.reviewer == null ? new Base[0] : this.reviewer.toArray(new Base[this.reviewer.size()]); // ContactDetail
7057        case 1740277666: /*endorser*/ return this.endorser == null ? new Base[0] : this.endorser.toArray(new Base[this.endorser.size()]); // ContactDetail
7058        case 666807069: /*relatedArtifact*/ return this.relatedArtifact == null ? new Base[0] : this.relatedArtifact.toArray(new Base[this.relatedArtifact.size()]); // RelatedArtifact
7059        case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // CanonicalType
7060        case 3178259: /*goal*/ return this.goal == null ? new Base[0] : this.goal.toArray(new Base[this.goal.size()]); // PlanDefinitionGoalComponent
7061        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // PlanDefinitionActionComponent
7062        default: return super.getProperty(hash, name, checkValid);
7063        }
7064
7065      }
7066
7067      @Override
7068      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7069        switch (hash) {
7070        case 116079: // url
7071          this.url = castToUri(value); // UriType
7072          return value;
7073        case -1618432855: // identifier
7074          this.getIdentifier().add(castToIdentifier(value)); // Identifier
7075          return value;
7076        case 351608024: // version
7077          this.version = castToString(value); // StringType
7078          return value;
7079        case 3373707: // name
7080          this.name = castToString(value); // StringType
7081          return value;
7082        case 110371416: // title
7083          this.title = castToString(value); // StringType
7084          return value;
7085        case -2060497896: // subtitle
7086          this.subtitle = castToString(value); // StringType
7087          return value;
7088        case 3575610: // type
7089          this.type = castToCodeableConcept(value); // CodeableConcept
7090          return value;
7091        case -892481550: // status
7092          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
7093          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
7094          return value;
7095        case -404562712: // experimental
7096          this.experimental = castToBoolean(value); // BooleanType
7097          return value;
7098        case -1867885268: // subject
7099          this.subject = castToType(value); // Type
7100          return value;
7101        case 3076014: // date
7102          this.date = castToDateTime(value); // DateTimeType
7103          return value;
7104        case 1447404028: // publisher
7105          this.publisher = castToString(value); // StringType
7106          return value;
7107        case 951526432: // contact
7108          this.getContact().add(castToContactDetail(value)); // ContactDetail
7109          return value;
7110        case -1724546052: // description
7111          this.description = castToMarkdown(value); // MarkdownType
7112          return value;
7113        case -669707736: // useContext
7114          this.getUseContext().add(castToUsageContext(value)); // UsageContext
7115          return value;
7116        case -507075711: // jurisdiction
7117          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
7118          return value;
7119        case -220463842: // purpose
7120          this.purpose = castToMarkdown(value); // MarkdownType
7121          return value;
7122        case 111574433: // usage
7123          this.usage = castToString(value); // StringType
7124          return value;
7125        case 1522889671: // copyright
7126          this.copyright = castToMarkdown(value); // MarkdownType
7127          return value;
7128        case 223539345: // approvalDate
7129          this.approvalDate = castToDate(value); // DateType
7130          return value;
7131        case -1687512484: // lastReviewDate
7132          this.lastReviewDate = castToDate(value); // DateType
7133          return value;
7134        case -403934648: // effectivePeriod
7135          this.effectivePeriod = castToPeriod(value); // Period
7136          return value;
7137        case 110546223: // topic
7138          this.getTopic().add(castToCodeableConcept(value)); // CodeableConcept
7139          return value;
7140        case -1406328437: // author
7141          this.getAuthor().add(castToContactDetail(value)); // ContactDetail
7142          return value;
7143        case -1307827859: // editor
7144          this.getEditor().add(castToContactDetail(value)); // ContactDetail
7145          return value;
7146        case -261190139: // reviewer
7147          this.getReviewer().add(castToContactDetail(value)); // ContactDetail
7148          return value;
7149        case 1740277666: // endorser
7150          this.getEndorser().add(castToContactDetail(value)); // ContactDetail
7151          return value;
7152        case 666807069: // relatedArtifact
7153          this.getRelatedArtifact().add(castToRelatedArtifact(value)); // RelatedArtifact
7154          return value;
7155        case 166208699: // library
7156          this.getLibrary().add(castToCanonical(value)); // CanonicalType
7157          return value;
7158        case 3178259: // goal
7159          this.getGoal().add((PlanDefinitionGoalComponent) value); // PlanDefinitionGoalComponent
7160          return value;
7161        case -1422950858: // action
7162          this.getAction().add((PlanDefinitionActionComponent) value); // PlanDefinitionActionComponent
7163          return value;
7164        default: return super.setProperty(hash, name, value);
7165        }
7166
7167      }
7168
7169      @Override
7170      public Base setProperty(String name, Base value) throws FHIRException {
7171        if (name.equals("url")) {
7172          this.url = castToUri(value); // UriType
7173        } else if (name.equals("identifier")) {
7174          this.getIdentifier().add(castToIdentifier(value));
7175        } else if (name.equals("version")) {
7176          this.version = castToString(value); // StringType
7177        } else if (name.equals("name")) {
7178          this.name = castToString(value); // StringType
7179        } else if (name.equals("title")) {
7180          this.title = castToString(value); // StringType
7181        } else if (name.equals("subtitle")) {
7182          this.subtitle = castToString(value); // StringType
7183        } else if (name.equals("type")) {
7184          this.type = castToCodeableConcept(value); // CodeableConcept
7185        } else if (name.equals("status")) {
7186          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
7187          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
7188        } else if (name.equals("experimental")) {
7189          this.experimental = castToBoolean(value); // BooleanType
7190        } else if (name.equals("subject[x]")) {
7191          this.subject = castToType(value); // Type
7192        } else if (name.equals("date")) {
7193          this.date = castToDateTime(value); // DateTimeType
7194        } else if (name.equals("publisher")) {
7195          this.publisher = castToString(value); // StringType
7196        } else if (name.equals("contact")) {
7197          this.getContact().add(castToContactDetail(value));
7198        } else if (name.equals("description")) {
7199          this.description = castToMarkdown(value); // MarkdownType
7200        } else if (name.equals("useContext")) {
7201          this.getUseContext().add(castToUsageContext(value));
7202        } else if (name.equals("jurisdiction")) {
7203          this.getJurisdiction().add(castToCodeableConcept(value));
7204        } else if (name.equals("purpose")) {
7205          this.purpose = castToMarkdown(value); // MarkdownType
7206        } else if (name.equals("usage")) {
7207          this.usage = castToString(value); // StringType
7208        } else if (name.equals("copyright")) {
7209          this.copyright = castToMarkdown(value); // MarkdownType
7210        } else if (name.equals("approvalDate")) {
7211          this.approvalDate = castToDate(value); // DateType
7212        } else if (name.equals("lastReviewDate")) {
7213          this.lastReviewDate = castToDate(value); // DateType
7214        } else if (name.equals("effectivePeriod")) {
7215          this.effectivePeriod = castToPeriod(value); // Period
7216        } else if (name.equals("topic")) {
7217          this.getTopic().add(castToCodeableConcept(value));
7218        } else if (name.equals("author")) {
7219          this.getAuthor().add(castToContactDetail(value));
7220        } else if (name.equals("editor")) {
7221          this.getEditor().add(castToContactDetail(value));
7222        } else if (name.equals("reviewer")) {
7223          this.getReviewer().add(castToContactDetail(value));
7224        } else if (name.equals("endorser")) {
7225          this.getEndorser().add(castToContactDetail(value));
7226        } else if (name.equals("relatedArtifact")) {
7227          this.getRelatedArtifact().add(castToRelatedArtifact(value));
7228        } else if (name.equals("library")) {
7229          this.getLibrary().add(castToCanonical(value));
7230        } else if (name.equals("goal")) {
7231          this.getGoal().add((PlanDefinitionGoalComponent) value);
7232        } else if (name.equals("action")) {
7233          this.getAction().add((PlanDefinitionActionComponent) value);
7234        } else
7235          return super.setProperty(name, value);
7236        return value;
7237      }
7238
7239      @Override
7240      public Base makeProperty(int hash, String name) throws FHIRException {
7241        switch (hash) {
7242        case 116079:  return getUrlElement();
7243        case -1618432855:  return addIdentifier(); 
7244        case 351608024:  return getVersionElement();
7245        case 3373707:  return getNameElement();
7246        case 110371416:  return getTitleElement();
7247        case -2060497896:  return getSubtitleElement();
7248        case 3575610:  return getType(); 
7249        case -892481550:  return getStatusElement();
7250        case -404562712:  return getExperimentalElement();
7251        case -573640748:  return getSubject(); 
7252        case -1867885268:  return getSubject(); 
7253        case 3076014:  return getDateElement();
7254        case 1447404028:  return getPublisherElement();
7255        case 951526432:  return addContact(); 
7256        case -1724546052:  return getDescriptionElement();
7257        case -669707736:  return addUseContext(); 
7258        case -507075711:  return addJurisdiction(); 
7259        case -220463842:  return getPurposeElement();
7260        case 111574433:  return getUsageElement();
7261        case 1522889671:  return getCopyrightElement();
7262        case 223539345:  return getApprovalDateElement();
7263        case -1687512484:  return getLastReviewDateElement();
7264        case -403934648:  return getEffectivePeriod(); 
7265        case 110546223:  return addTopic(); 
7266        case -1406328437:  return addAuthor(); 
7267        case -1307827859:  return addEditor(); 
7268        case -261190139:  return addReviewer(); 
7269        case 1740277666:  return addEndorser(); 
7270        case 666807069:  return addRelatedArtifact(); 
7271        case 166208699:  return addLibraryElement();
7272        case 3178259:  return addGoal(); 
7273        case -1422950858:  return addAction(); 
7274        default: return super.makeProperty(hash, name);
7275        }
7276
7277      }
7278
7279      @Override
7280      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7281        switch (hash) {
7282        case 116079: /*url*/ return new String[] {"uri"};
7283        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
7284        case 351608024: /*version*/ return new String[] {"string"};
7285        case 3373707: /*name*/ return new String[] {"string"};
7286        case 110371416: /*title*/ return new String[] {"string"};
7287        case -2060497896: /*subtitle*/ return new String[] {"string"};
7288        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
7289        case -892481550: /*status*/ return new String[] {"code"};
7290        case -404562712: /*experimental*/ return new String[] {"boolean"};
7291        case -1867885268: /*subject*/ return new String[] {"CodeableConcept", "Reference"};
7292        case 3076014: /*date*/ return new String[] {"dateTime"};
7293        case 1447404028: /*publisher*/ return new String[] {"string"};
7294        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
7295        case -1724546052: /*description*/ return new String[] {"markdown"};
7296        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
7297        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
7298        case -220463842: /*purpose*/ return new String[] {"markdown"};
7299        case 111574433: /*usage*/ return new String[] {"string"};
7300        case 1522889671: /*copyright*/ return new String[] {"markdown"};
7301        case 223539345: /*approvalDate*/ return new String[] {"date"};
7302        case -1687512484: /*lastReviewDate*/ return new String[] {"date"};
7303        case -403934648: /*effectivePeriod*/ return new String[] {"Period"};
7304        case 110546223: /*topic*/ return new String[] {"CodeableConcept"};
7305        case -1406328437: /*author*/ return new String[] {"ContactDetail"};
7306        case -1307827859: /*editor*/ return new String[] {"ContactDetail"};
7307        case -261190139: /*reviewer*/ return new String[] {"ContactDetail"};
7308        case 1740277666: /*endorser*/ return new String[] {"ContactDetail"};
7309        case 666807069: /*relatedArtifact*/ return new String[] {"RelatedArtifact"};
7310        case 166208699: /*library*/ return new String[] {"canonical"};
7311        case 3178259: /*goal*/ return new String[] {};
7312        case -1422950858: /*action*/ return new String[] {};
7313        default: return super.getTypesForProperty(hash, name);
7314        }
7315
7316      }
7317
7318      @Override
7319      public Base addChild(String name) throws FHIRException {
7320        if (name.equals("url")) {
7321          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.url");
7322        }
7323        else if (name.equals("identifier")) {
7324          return addIdentifier();
7325        }
7326        else if (name.equals("version")) {
7327          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.version");
7328        }
7329        else if (name.equals("name")) {
7330          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.name");
7331        }
7332        else if (name.equals("title")) {
7333          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.title");
7334        }
7335        else if (name.equals("subtitle")) {
7336          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.subtitle");
7337        }
7338        else if (name.equals("type")) {
7339          this.type = new CodeableConcept();
7340          return this.type;
7341        }
7342        else if (name.equals("status")) {
7343          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.status");
7344        }
7345        else if (name.equals("experimental")) {
7346          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.experimental");
7347        }
7348        else if (name.equals("subjectCodeableConcept")) {
7349          this.subject = new CodeableConcept();
7350          return this.subject;
7351        }
7352        else if (name.equals("subjectReference")) {
7353          this.subject = new Reference();
7354          return this.subject;
7355        }
7356        else if (name.equals("date")) {
7357          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.date");
7358        }
7359        else if (name.equals("publisher")) {
7360          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.publisher");
7361        }
7362        else if (name.equals("contact")) {
7363          return addContact();
7364        }
7365        else if (name.equals("description")) {
7366          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.description");
7367        }
7368        else if (name.equals("useContext")) {
7369          return addUseContext();
7370        }
7371        else if (name.equals("jurisdiction")) {
7372          return addJurisdiction();
7373        }
7374        else if (name.equals("purpose")) {
7375          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.purpose");
7376        }
7377        else if (name.equals("usage")) {
7378          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.usage");
7379        }
7380        else if (name.equals("copyright")) {
7381          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.copyright");
7382        }
7383        else if (name.equals("approvalDate")) {
7384          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.approvalDate");
7385        }
7386        else if (name.equals("lastReviewDate")) {
7387          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.lastReviewDate");
7388        }
7389        else if (name.equals("effectivePeriod")) {
7390          this.effectivePeriod = new Period();
7391          return this.effectivePeriod;
7392        }
7393        else if (name.equals("topic")) {
7394          return addTopic();
7395        }
7396        else if (name.equals("author")) {
7397          return addAuthor();
7398        }
7399        else if (name.equals("editor")) {
7400          return addEditor();
7401        }
7402        else if (name.equals("reviewer")) {
7403          return addReviewer();
7404        }
7405        else if (name.equals("endorser")) {
7406          return addEndorser();
7407        }
7408        else if (name.equals("relatedArtifact")) {
7409          return addRelatedArtifact();
7410        }
7411        else if (name.equals("library")) {
7412          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.library");
7413        }
7414        else if (name.equals("goal")) {
7415          return addGoal();
7416        }
7417        else if (name.equals("action")) {
7418          return addAction();
7419        }
7420        else
7421          return super.addChild(name);
7422      }
7423
7424  public String fhirType() {
7425    return "PlanDefinition";
7426
7427  }
7428
7429      public PlanDefinition copy() {
7430        PlanDefinition dst = new PlanDefinition();
7431        copyValues(dst);
7432        return dst;
7433      }
7434
7435      public void copyValues(PlanDefinition dst) {
7436        super.copyValues(dst);
7437        dst.url = url == null ? null : url.copy();
7438        if (identifier != null) {
7439          dst.identifier = new ArrayList<Identifier>();
7440          for (Identifier i : identifier)
7441            dst.identifier.add(i.copy());
7442        };
7443        dst.version = version == null ? null : version.copy();
7444        dst.name = name == null ? null : name.copy();
7445        dst.title = title == null ? null : title.copy();
7446        dst.subtitle = subtitle == null ? null : subtitle.copy();
7447        dst.type = type == null ? null : type.copy();
7448        dst.status = status == null ? null : status.copy();
7449        dst.experimental = experimental == null ? null : experimental.copy();
7450        dst.subject = subject == null ? null : subject.copy();
7451        dst.date = date == null ? null : date.copy();
7452        dst.publisher = publisher == null ? null : publisher.copy();
7453        if (contact != null) {
7454          dst.contact = new ArrayList<ContactDetail>();
7455          for (ContactDetail i : contact)
7456            dst.contact.add(i.copy());
7457        };
7458        dst.description = description == null ? null : description.copy();
7459        if (useContext != null) {
7460          dst.useContext = new ArrayList<UsageContext>();
7461          for (UsageContext i : useContext)
7462            dst.useContext.add(i.copy());
7463        };
7464        if (jurisdiction != null) {
7465          dst.jurisdiction = new ArrayList<CodeableConcept>();
7466          for (CodeableConcept i : jurisdiction)
7467            dst.jurisdiction.add(i.copy());
7468        };
7469        dst.purpose = purpose == null ? null : purpose.copy();
7470        dst.usage = usage == null ? null : usage.copy();
7471        dst.copyright = copyright == null ? null : copyright.copy();
7472        dst.approvalDate = approvalDate == null ? null : approvalDate.copy();
7473        dst.lastReviewDate = lastReviewDate == null ? null : lastReviewDate.copy();
7474        dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy();
7475        if (topic != null) {
7476          dst.topic = new ArrayList<CodeableConcept>();
7477          for (CodeableConcept i : topic)
7478            dst.topic.add(i.copy());
7479        };
7480        if (author != null) {
7481          dst.author = new ArrayList<ContactDetail>();
7482          for (ContactDetail i : author)
7483            dst.author.add(i.copy());
7484        };
7485        if (editor != null) {
7486          dst.editor = new ArrayList<ContactDetail>();
7487          for (ContactDetail i : editor)
7488            dst.editor.add(i.copy());
7489        };
7490        if (reviewer != null) {
7491          dst.reviewer = new ArrayList<ContactDetail>();
7492          for (ContactDetail i : reviewer)
7493            dst.reviewer.add(i.copy());
7494        };
7495        if (endorser != null) {
7496          dst.endorser = new ArrayList<ContactDetail>();
7497          for (ContactDetail i : endorser)
7498            dst.endorser.add(i.copy());
7499        };
7500        if (relatedArtifact != null) {
7501          dst.relatedArtifact = new ArrayList<RelatedArtifact>();
7502          for (RelatedArtifact i : relatedArtifact)
7503            dst.relatedArtifact.add(i.copy());
7504        };
7505        if (library != null) {
7506          dst.library = new ArrayList<CanonicalType>();
7507          for (CanonicalType i : library)
7508            dst.library.add(i.copy());
7509        };
7510        if (goal != null) {
7511          dst.goal = new ArrayList<PlanDefinitionGoalComponent>();
7512          for (PlanDefinitionGoalComponent i : goal)
7513            dst.goal.add(i.copy());
7514        };
7515        if (action != null) {
7516          dst.action = new ArrayList<PlanDefinitionActionComponent>();
7517          for (PlanDefinitionActionComponent i : action)
7518            dst.action.add(i.copy());
7519        };
7520      }
7521
7522      protected PlanDefinition typedCopy() {
7523        return copy();
7524      }
7525
7526      @Override
7527      public boolean equalsDeep(Base other_) {
7528        if (!super.equalsDeep(other_))
7529          return false;
7530        if (!(other_ instanceof PlanDefinition))
7531          return false;
7532        PlanDefinition o = (PlanDefinition) other_;
7533        return compareDeep(identifier, o.identifier, true) && compareDeep(subtitle, o.subtitle, true) && compareDeep(type, o.type, true)
7534           && compareDeep(subject, o.subject, true) && compareDeep(purpose, o.purpose, true) && compareDeep(usage, o.usage, true)
7535           && compareDeep(copyright, o.copyright, true) && compareDeep(approvalDate, o.approvalDate, true)
7536           && compareDeep(lastReviewDate, o.lastReviewDate, true) && compareDeep(effectivePeriod, o.effectivePeriod, true)
7537           && compareDeep(topic, o.topic, true) && compareDeep(author, o.author, true) && compareDeep(editor, o.editor, true)
7538           && compareDeep(reviewer, o.reviewer, true) && compareDeep(endorser, o.endorser, true) && compareDeep(relatedArtifact, o.relatedArtifact, true)
7539           && compareDeep(library, o.library, true) && compareDeep(goal, o.goal, true) && compareDeep(action, o.action, true)
7540          ;
7541      }
7542
7543      @Override
7544      public boolean equalsShallow(Base other_) {
7545        if (!super.equalsShallow(other_))
7546          return false;
7547        if (!(other_ instanceof PlanDefinition))
7548          return false;
7549        PlanDefinition o = (PlanDefinition) other_;
7550        return compareValues(subtitle, o.subtitle, true) && compareValues(purpose, o.purpose, true) && compareValues(usage, o.usage, true)
7551           && compareValues(copyright, o.copyright, true) && compareValues(approvalDate, o.approvalDate, true)
7552           && compareValues(lastReviewDate, o.lastReviewDate, true);
7553      }
7554
7555      public boolean isEmpty() {
7556        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, subtitle, type
7557          , subject, purpose, usage, copyright, approvalDate, lastReviewDate, effectivePeriod
7558          , topic, author, editor, reviewer, endorser, relatedArtifact, library, goal
7559          , action);
7560      }
7561
7562  @Override
7563  public ResourceType getResourceType() {
7564    return ResourceType.PlanDefinition;
7565   }
7566
7567 /**
7568   * Search parameter: <b>date</b>
7569   * <p>
7570   * Description: <b>The plan definition publication date</b><br>
7571   * Type: <b>date</b><br>
7572   * Path: <b>PlanDefinition.date</b><br>
7573   * </p>
7574   */
7575  @SearchParamDefinition(name="date", path="PlanDefinition.date", description="The plan definition publication date", type="date" )
7576  public static final String SP_DATE = "date";
7577 /**
7578   * <b>Fluent Client</b> search parameter constant for <b>date</b>
7579   * <p>
7580   * Description: <b>The plan definition publication date</b><br>
7581   * Type: <b>date</b><br>
7582   * Path: <b>PlanDefinition.date</b><br>
7583   * </p>
7584   */
7585  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
7586
7587 /**
7588   * Search parameter: <b>identifier</b>
7589   * <p>
7590   * Description: <b>External identifier for the plan definition</b><br>
7591   * Type: <b>token</b><br>
7592   * Path: <b>PlanDefinition.identifier</b><br>
7593   * </p>
7594   */
7595  @SearchParamDefinition(name="identifier", path="PlanDefinition.identifier", description="External identifier for the plan definition", type="token" )
7596  public static final String SP_IDENTIFIER = "identifier";
7597 /**
7598   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
7599   * <p>
7600   * Description: <b>External identifier for the plan definition</b><br>
7601   * Type: <b>token</b><br>
7602   * Path: <b>PlanDefinition.identifier</b><br>
7603   * </p>
7604   */
7605  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
7606
7607 /**
7608   * Search parameter: <b>successor</b>
7609   * <p>
7610   * Description: <b>What resource is being referenced</b><br>
7611   * Type: <b>reference</b><br>
7612   * Path: <b>PlanDefinition.relatedArtifact.resource</b><br>
7613   * </p>
7614   */
7615  @SearchParamDefinition(name="successor", path="PlanDefinition.relatedArtifact.where(type='successor').resource", description="What resource is being referenced", type="reference" )
7616  public static final String SP_SUCCESSOR = "successor";
7617 /**
7618   * <b>Fluent Client</b> search parameter constant for <b>successor</b>
7619   * <p>
7620   * Description: <b>What resource is being referenced</b><br>
7621   * Type: <b>reference</b><br>
7622   * Path: <b>PlanDefinition.relatedArtifact.resource</b><br>
7623   * </p>
7624   */
7625  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUCCESSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUCCESSOR);
7626
7627/**
7628   * Constant for fluent queries to be used to add include statements. Specifies
7629   * the path value of "<b>PlanDefinition:successor</b>".
7630   */
7631  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUCCESSOR = new ca.uhn.fhir.model.api.Include("PlanDefinition:successor").toLocked();
7632
7633 /**
7634   * Search parameter: <b>context-type-value</b>
7635   * <p>
7636   * Description: <b>A use context type and value assigned to the plan definition</b><br>
7637   * Type: <b>composite</b><br>
7638   * Path: <b></b><br>
7639   * </p>
7640   */
7641  @SearchParamDefinition(name="context-type-value", path="PlanDefinition.useContext", description="A use context type and value assigned to the plan definition", type="composite", compositeOf={"context-type", "context"} )
7642  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
7643 /**
7644   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
7645   * <p>
7646   * Description: <b>A use context type and value assigned to the plan definition</b><br>
7647   * Type: <b>composite</b><br>
7648   * Path: <b></b><br>
7649   * </p>
7650   */
7651  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> CONTEXT_TYPE_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(SP_CONTEXT_TYPE_VALUE);
7652
7653 /**
7654   * Search parameter: <b>jurisdiction</b>
7655   * <p>
7656   * Description: <b>Intended jurisdiction for the plan definition</b><br>
7657   * Type: <b>token</b><br>
7658   * Path: <b>PlanDefinition.jurisdiction</b><br>
7659   * </p>
7660   */
7661  @SearchParamDefinition(name="jurisdiction", path="PlanDefinition.jurisdiction", description="Intended jurisdiction for the plan definition", type="token" )
7662  public static final String SP_JURISDICTION = "jurisdiction";
7663 /**
7664   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
7665   * <p>
7666   * Description: <b>Intended jurisdiction for the plan definition</b><br>
7667   * Type: <b>token</b><br>
7668   * Path: <b>PlanDefinition.jurisdiction</b><br>
7669   * </p>
7670   */
7671  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
7672
7673 /**
7674   * Search parameter: <b>description</b>
7675   * <p>
7676   * Description: <b>The description of the plan definition</b><br>
7677   * Type: <b>string</b><br>
7678   * Path: <b>PlanDefinition.description</b><br>
7679   * </p>
7680   */
7681  @SearchParamDefinition(name="description", path="PlanDefinition.description", description="The description of the plan definition", type="string" )
7682  public static final String SP_DESCRIPTION = "description";
7683 /**
7684   * <b>Fluent Client</b> search parameter constant for <b>description</b>
7685   * <p>
7686   * Description: <b>The description of the plan definition</b><br>
7687   * Type: <b>string</b><br>
7688   * Path: <b>PlanDefinition.description</b><br>
7689   * </p>
7690   */
7691  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
7692
7693 /**
7694   * Search parameter: <b>derived-from</b>
7695   * <p>
7696   * Description: <b>What resource is being referenced</b><br>
7697   * Type: <b>reference</b><br>
7698   * Path: <b>PlanDefinition.relatedArtifact.resource</b><br>
7699   * </p>
7700   */
7701  @SearchParamDefinition(name="derived-from", path="PlanDefinition.relatedArtifact.where(type='derived-from').resource", description="What resource is being referenced", type="reference" )
7702  public static final String SP_DERIVED_FROM = "derived-from";
7703 /**
7704   * <b>Fluent Client</b> search parameter constant for <b>derived-from</b>
7705   * <p>
7706   * Description: <b>What resource is being referenced</b><br>
7707   * Type: <b>reference</b><br>
7708   * Path: <b>PlanDefinition.relatedArtifact.resource</b><br>
7709   * </p>
7710   */
7711  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DERIVED_FROM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DERIVED_FROM);
7712
7713/**
7714   * Constant for fluent queries to be used to add include statements. Specifies
7715   * the path value of "<b>PlanDefinition:derived-from</b>".
7716   */
7717  public static final ca.uhn.fhir.model.api.Include INCLUDE_DERIVED_FROM = new ca.uhn.fhir.model.api.Include("PlanDefinition:derived-from").toLocked();
7718
7719 /**
7720   * Search parameter: <b>context-type</b>
7721   * <p>
7722   * Description: <b>A type of use context assigned to the plan definition</b><br>
7723   * Type: <b>token</b><br>
7724   * Path: <b>PlanDefinition.useContext.code</b><br>
7725   * </p>
7726   */
7727  @SearchParamDefinition(name="context-type", path="PlanDefinition.useContext.code", description="A type of use context assigned to the plan definition", type="token" )
7728  public static final String SP_CONTEXT_TYPE = "context-type";
7729 /**
7730   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
7731   * <p>
7732   * Description: <b>A type of use context assigned to the plan definition</b><br>
7733   * Type: <b>token</b><br>
7734   * Path: <b>PlanDefinition.useContext.code</b><br>
7735   * </p>
7736   */
7737  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT_TYPE);
7738
7739 /**
7740   * Search parameter: <b>predecessor</b>
7741   * <p>
7742   * Description: <b>What resource is being referenced</b><br>
7743   * Type: <b>reference</b><br>
7744   * Path: <b>PlanDefinition.relatedArtifact.resource</b><br>
7745   * </p>
7746   */
7747  @SearchParamDefinition(name="predecessor", path="PlanDefinition.relatedArtifact.where(type='predecessor').resource", description="What resource is being referenced", type="reference" )
7748  public static final String SP_PREDECESSOR = "predecessor";
7749 /**
7750   * <b>Fluent Client</b> search parameter constant for <b>predecessor</b>
7751   * <p>
7752   * Description: <b>What resource is being referenced</b><br>
7753   * Type: <b>reference</b><br>
7754   * Path: <b>PlanDefinition.relatedArtifact.resource</b><br>
7755   * </p>
7756   */
7757  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PREDECESSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PREDECESSOR);
7758
7759/**
7760   * Constant for fluent queries to be used to add include statements. Specifies
7761   * the path value of "<b>PlanDefinition:predecessor</b>".
7762   */
7763  public static final ca.uhn.fhir.model.api.Include INCLUDE_PREDECESSOR = new ca.uhn.fhir.model.api.Include("PlanDefinition:predecessor").toLocked();
7764
7765 /**
7766   * Search parameter: <b>title</b>
7767   * <p>
7768   * Description: <b>The human-friendly name of the plan definition</b><br>
7769   * Type: <b>string</b><br>
7770   * Path: <b>PlanDefinition.title</b><br>
7771   * </p>
7772   */
7773  @SearchParamDefinition(name="title", path="PlanDefinition.title", description="The human-friendly name of the plan definition", type="string" )
7774  public static final String SP_TITLE = "title";
7775 /**
7776   * <b>Fluent Client</b> search parameter constant for <b>title</b>
7777   * <p>
7778   * Description: <b>The human-friendly name of the plan definition</b><br>
7779   * Type: <b>string</b><br>
7780   * Path: <b>PlanDefinition.title</b><br>
7781   * </p>
7782   */
7783  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
7784
7785 /**
7786   * Search parameter: <b>composed-of</b>
7787   * <p>
7788   * Description: <b>What resource is being referenced</b><br>
7789   * Type: <b>reference</b><br>
7790   * Path: <b>PlanDefinition.relatedArtifact.resource</b><br>
7791   * </p>
7792   */
7793  @SearchParamDefinition(name="composed-of", path="PlanDefinition.relatedArtifact.where(type='composed-of').resource", description="What resource is being referenced", type="reference" )
7794  public static final String SP_COMPOSED_OF = "composed-of";
7795 /**
7796   * <b>Fluent Client</b> search parameter constant for <b>composed-of</b>
7797   * <p>
7798   * Description: <b>What resource is being referenced</b><br>
7799   * Type: <b>reference</b><br>
7800   * Path: <b>PlanDefinition.relatedArtifact.resource</b><br>
7801   * </p>
7802   */
7803  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COMPOSED_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_COMPOSED_OF);
7804
7805/**
7806   * Constant for fluent queries to be used to add include statements. Specifies
7807   * the path value of "<b>PlanDefinition:composed-of</b>".
7808   */
7809  public static final ca.uhn.fhir.model.api.Include INCLUDE_COMPOSED_OF = new ca.uhn.fhir.model.api.Include("PlanDefinition:composed-of").toLocked();
7810
7811 /**
7812   * Search parameter: <b>type</b>
7813   * <p>
7814   * Description: <b>The type of artifact the plan (e.g. order-set, eca-rule, protocol)</b><br>
7815   * Type: <b>token</b><br>
7816   * Path: <b>PlanDefinition.type</b><br>
7817   * </p>
7818   */
7819  @SearchParamDefinition(name="type", path="PlanDefinition.type", description="The type of artifact the plan (e.g. order-set, eca-rule, protocol)", type="token" )
7820  public static final String SP_TYPE = "type";
7821 /**
7822   * <b>Fluent Client</b> search parameter constant for <b>type</b>
7823   * <p>
7824   * Description: <b>The type of artifact the plan (e.g. order-set, eca-rule, protocol)</b><br>
7825   * Type: <b>token</b><br>
7826   * Path: <b>PlanDefinition.type</b><br>
7827   * </p>
7828   */
7829  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
7830
7831 /**
7832   * Search parameter: <b>version</b>
7833   * <p>
7834   * Description: <b>The business version of the plan definition</b><br>
7835   * Type: <b>token</b><br>
7836   * Path: <b>PlanDefinition.version</b><br>
7837   * </p>
7838   */
7839  @SearchParamDefinition(name="version", path="PlanDefinition.version", description="The business version of the plan definition", type="token" )
7840  public static final String SP_VERSION = "version";
7841 /**
7842   * <b>Fluent Client</b> search parameter constant for <b>version</b>
7843   * <p>
7844   * Description: <b>The business version of the plan definition</b><br>
7845   * Type: <b>token</b><br>
7846   * Path: <b>PlanDefinition.version</b><br>
7847   * </p>
7848   */
7849  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
7850
7851 /**
7852   * Search parameter: <b>url</b>
7853   * <p>
7854   * Description: <b>The uri that identifies the plan definition</b><br>
7855   * Type: <b>uri</b><br>
7856   * Path: <b>PlanDefinition.url</b><br>
7857   * </p>
7858   */
7859  @SearchParamDefinition(name="url", path="PlanDefinition.url", description="The uri that identifies the plan definition", type="uri" )
7860  public static final String SP_URL = "url";
7861 /**
7862   * <b>Fluent Client</b> search parameter constant for <b>url</b>
7863   * <p>
7864   * Description: <b>The uri that identifies the plan definition</b><br>
7865   * Type: <b>uri</b><br>
7866   * Path: <b>PlanDefinition.url</b><br>
7867   * </p>
7868   */
7869  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
7870
7871 /**
7872   * Search parameter: <b>context-quantity</b>
7873   * <p>
7874   * Description: <b>A quantity- or range-valued use context assigned to the plan definition</b><br>
7875   * Type: <b>quantity</b><br>
7876   * Path: <b>PlanDefinition.useContext.valueQuantity, PlanDefinition.useContext.valueRange</b><br>
7877   * </p>
7878   */
7879  @SearchParamDefinition(name="context-quantity", path="(PlanDefinition.useContext.value as Quantity) | (PlanDefinition.useContext.value as Range)", description="A quantity- or range-valued use context assigned to the plan definition", type="quantity" )
7880  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
7881 /**
7882   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
7883   * <p>
7884   * Description: <b>A quantity- or range-valued use context assigned to the plan definition</b><br>
7885   * Type: <b>quantity</b><br>
7886   * Path: <b>PlanDefinition.useContext.valueQuantity, PlanDefinition.useContext.valueRange</b><br>
7887   * </p>
7888   */
7889  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_CONTEXT_QUANTITY);
7890
7891 /**
7892   * Search parameter: <b>effective</b>
7893   * <p>
7894   * Description: <b>The time during which the plan definition is intended to be in use</b><br>
7895   * Type: <b>date</b><br>
7896   * Path: <b>PlanDefinition.effectivePeriod</b><br>
7897   * </p>
7898   */
7899  @SearchParamDefinition(name="effective", path="PlanDefinition.effectivePeriod", description="The time during which the plan definition is intended to be in use", type="date" )
7900  public static final String SP_EFFECTIVE = "effective";
7901 /**
7902   * <b>Fluent Client</b> search parameter constant for <b>effective</b>
7903   * <p>
7904   * Description: <b>The time during which the plan definition is intended to be in use</b><br>
7905   * Type: <b>date</b><br>
7906   * Path: <b>PlanDefinition.effectivePeriod</b><br>
7907   * </p>
7908   */
7909  public static final ca.uhn.fhir.rest.gclient.DateClientParam EFFECTIVE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EFFECTIVE);
7910
7911 /**
7912   * Search parameter: <b>depends-on</b>
7913   * <p>
7914   * Description: <b>What resource is being referenced</b><br>
7915   * Type: <b>reference</b><br>
7916   * Path: <b>PlanDefinition.relatedArtifact.resource, PlanDefinition.library</b><br>
7917   * </p>
7918   */
7919  @SearchParamDefinition(name="depends-on", path="PlanDefinition.relatedArtifact.where(type='depends-on').resource | PlanDefinition.library", description="What resource is being referenced", type="reference" )
7920  public static final String SP_DEPENDS_ON = "depends-on";
7921 /**
7922   * <b>Fluent Client</b> search parameter constant for <b>depends-on</b>
7923   * <p>
7924   * Description: <b>What resource is being referenced</b><br>
7925   * Type: <b>reference</b><br>
7926   * Path: <b>PlanDefinition.relatedArtifact.resource, PlanDefinition.library</b><br>
7927   * </p>
7928   */
7929  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEPENDS_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEPENDS_ON);
7930
7931/**
7932   * Constant for fluent queries to be used to add include statements. Specifies
7933   * the path value of "<b>PlanDefinition:depends-on</b>".
7934   */
7935  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEPENDS_ON = new ca.uhn.fhir.model.api.Include("PlanDefinition:depends-on").toLocked();
7936
7937 /**
7938   * Search parameter: <b>name</b>
7939   * <p>
7940   * Description: <b>Computationally friendly name of the plan definition</b><br>
7941   * Type: <b>string</b><br>
7942   * Path: <b>PlanDefinition.name</b><br>
7943   * </p>
7944   */
7945  @SearchParamDefinition(name="name", path="PlanDefinition.name", description="Computationally friendly name of the plan definition", type="string" )
7946  public static final String SP_NAME = "name";
7947 /**
7948   * <b>Fluent Client</b> search parameter constant for <b>name</b>
7949   * <p>
7950   * Description: <b>Computationally friendly name of the plan definition</b><br>
7951   * Type: <b>string</b><br>
7952   * Path: <b>PlanDefinition.name</b><br>
7953   * </p>
7954   */
7955  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
7956
7957 /**
7958   * Search parameter: <b>context</b>
7959   * <p>
7960   * Description: <b>A use context assigned to the plan definition</b><br>
7961   * Type: <b>token</b><br>
7962   * Path: <b>PlanDefinition.useContext.valueCodeableConcept</b><br>
7963   * </p>
7964   */
7965  @SearchParamDefinition(name="context", path="(PlanDefinition.useContext.value as CodeableConcept)", description="A use context assigned to the plan definition", type="token" )
7966  public static final String SP_CONTEXT = "context";
7967 /**
7968   * <b>Fluent Client</b> search parameter constant for <b>context</b>
7969   * <p>
7970   * Description: <b>A use context assigned to the plan definition</b><br>
7971   * Type: <b>token</b><br>
7972   * Path: <b>PlanDefinition.useContext.valueCodeableConcept</b><br>
7973   * </p>
7974   */
7975  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT);
7976
7977 /**
7978   * Search parameter: <b>publisher</b>
7979   * <p>
7980   * Description: <b>Name of the publisher of the plan definition</b><br>
7981   * Type: <b>string</b><br>
7982   * Path: <b>PlanDefinition.publisher</b><br>
7983   * </p>
7984   */
7985  @SearchParamDefinition(name="publisher", path="PlanDefinition.publisher", description="Name of the publisher of the plan definition", type="string" )
7986  public static final String SP_PUBLISHER = "publisher";
7987 /**
7988   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
7989   * <p>
7990   * Description: <b>Name of the publisher of the plan definition</b><br>
7991   * Type: <b>string</b><br>
7992   * Path: <b>PlanDefinition.publisher</b><br>
7993   * </p>
7994   */
7995  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
7996
7997 /**
7998   * Search parameter: <b>topic</b>
7999   * <p>
8000   * Description: <b>Topics associated with the module</b><br>
8001   * Type: <b>token</b><br>
8002   * Path: <b>PlanDefinition.topic</b><br>
8003   * </p>
8004   */
8005  @SearchParamDefinition(name="topic", path="PlanDefinition.topic", description="Topics associated with the module", type="token" )
8006  public static final String SP_TOPIC = "topic";
8007 /**
8008   * <b>Fluent Client</b> search parameter constant for <b>topic</b>
8009   * <p>
8010   * Description: <b>Topics associated with the module</b><br>
8011   * Type: <b>token</b><br>
8012   * Path: <b>PlanDefinition.topic</b><br>
8013   * </p>
8014   */
8015  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC);
8016
8017 /**
8018   * Search parameter: <b>definition</b>
8019   * <p>
8020   * Description: <b>Activity or plan definitions used by plan definition</b><br>
8021   * Type: <b>reference</b><br>
8022   * Path: <b>PlanDefinition.action.definition[x]</b><br>
8023   * </p>
8024   */
8025  @SearchParamDefinition(name="definition", path="PlanDefinition.action.definition", description="Activity or plan definitions used by plan definition", type="reference", target={ActivityDefinition.class, PlanDefinition.class, Questionnaire.class } )
8026  public static final String SP_DEFINITION = "definition";
8027 /**
8028   * <b>Fluent Client</b> search parameter constant for <b>definition</b>
8029   * <p>
8030   * Description: <b>Activity or plan definitions used by plan definition</b><br>
8031   * Type: <b>reference</b><br>
8032   * Path: <b>PlanDefinition.action.definition[x]</b><br>
8033   * </p>
8034   */
8035  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEFINITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEFINITION);
8036
8037/**
8038   * Constant for fluent queries to be used to add include statements. Specifies
8039   * the path value of "<b>PlanDefinition:definition</b>".
8040   */
8041  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEFINITION = new ca.uhn.fhir.model.api.Include("PlanDefinition:definition").toLocked();
8042
8043 /**
8044   * Search parameter: <b>context-type-quantity</b>
8045   * <p>
8046   * Description: <b>A use context type and quantity- or range-based value assigned to the plan definition</b><br>
8047   * Type: <b>composite</b><br>
8048   * Path: <b></b><br>
8049   * </p>
8050   */
8051  @SearchParamDefinition(name="context-type-quantity", path="PlanDefinition.useContext", description="A use context type and quantity- or range-based value assigned to the plan definition", type="composite", compositeOf={"context-type", "context-quantity"} )
8052  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
8053 /**
8054   * <b>Fluent Client</b> search parameter constant for <b>context-type-quantity</b>
8055   * <p>
8056   * Description: <b>A use context type and quantity- or range-based value assigned to the plan definition</b><br>
8057   * Type: <b>composite</b><br>
8058   * Path: <b></b><br>
8059   * </p>
8060   */
8061  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> CONTEXT_TYPE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(SP_CONTEXT_TYPE_QUANTITY);
8062
8063 /**
8064   * Search parameter: <b>status</b>
8065   * <p>
8066   * Description: <b>The current status of the plan definition</b><br>
8067   * Type: <b>token</b><br>
8068   * Path: <b>PlanDefinition.status</b><br>
8069   * </p>
8070   */
8071  @SearchParamDefinition(name="status", path="PlanDefinition.status", description="The current status of the plan definition", type="token" )
8072  public static final String SP_STATUS = "status";
8073 /**
8074   * <b>Fluent Client</b> search parameter constant for <b>status</b>
8075   * <p>
8076   * Description: <b>The current status of the plan definition</b><br>
8077   * Type: <b>token</b><br>
8078   * Path: <b>PlanDefinition.status</b><br>
8079   * </p>
8080   */
8081  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
8082
8083
8084}