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