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