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