001package org.hl7.fhir.r4b.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Dec 31, 2021 05:58+1100 for FHIR v4.3.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r4b.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 CanonicalResource {
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}, 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        public boolean hasDetail() { 
709          return this.detail != null && !this.detail.isEmpty();
710        }
711
712        /**
713         * @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.)
714         */
715        public PlanDefinitionGoalTargetComponent setDetail(DataType value) { 
716          if (value != null && !(value instanceof Quantity || value instanceof Range || value instanceof CodeableConcept))
717            throw new Error("Not the right type for PlanDefinition.goal.target.detail[x]: "+value.fhirType());
718          this.detail = value;
719          return this;
720        }
721
722        /**
723         * @return {@link #due} (Indicates the timeframe after the start of the goal in which the goal should be met.)
724         */
725        public Duration getDue() { 
726          if (this.due == null)
727            if (Configuration.errorOnAutoCreate())
728              throw new Error("Attempt to auto-create PlanDefinitionGoalTargetComponent.due");
729            else if (Configuration.doAutoCreate())
730              this.due = new Duration(); // cc
731          return this.due;
732        }
733
734        public boolean hasDue() { 
735          return this.due != null && !this.due.isEmpty();
736        }
737
738        /**
739         * @param value {@link #due} (Indicates the timeframe after the start of the goal in which the goal should be met.)
740         */
741        public PlanDefinitionGoalTargetComponent setDue(Duration value) { 
742          this.due = value;
743          return this;
744        }
745
746        protected void listChildren(List<Property> children) {
747          super.listChildren(children);
748          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));
749          children.add(new Property("detail[x]", "Quantity|Range|CodeableConcept", "The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%, 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));
750          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));
751        }
752
753        @Override
754        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
755          switch (_hash) {
756          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);
757          case -1973084529: /*detail[x]*/  return new Property("detail[x]", "Quantity|Range|CodeableConcept", "The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%, 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);
758          case -1335224239: /*detail*/  return new Property("detail[x]", "Quantity|Range|CodeableConcept", "The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%, 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);
759          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);
760          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);
761          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);
762          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);
763          default: return super.getNamedProperty(_hash, _name, _checkValid);
764          }
765
766        }
767
768      @Override
769      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
770        switch (hash) {
771        case 938321246: /*measure*/ return this.measure == null ? new Base[0] : new Base[] {this.measure}; // CodeableConcept
772        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // DataType
773        case 99828: /*due*/ return this.due == null ? new Base[0] : new Base[] {this.due}; // Duration
774        default: return super.getProperty(hash, name, checkValid);
775        }
776
777      }
778
779      @Override
780      public Base setProperty(int hash, String name, Base value) throws FHIRException {
781        switch (hash) {
782        case 938321246: // measure
783          this.measure = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
784          return value;
785        case -1335224239: // detail
786          this.detail = TypeConvertor.castToType(value); // DataType
787          return value;
788        case 99828: // due
789          this.due = TypeConvertor.castToDuration(value); // Duration
790          return value;
791        default: return super.setProperty(hash, name, value);
792        }
793
794      }
795
796      @Override
797      public Base setProperty(String name, Base value) throws FHIRException {
798        if (name.equals("measure")) {
799          this.measure = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
800        } else if (name.equals("detail[x]")) {
801          this.detail = TypeConvertor.castToType(value); // DataType
802        } else if (name.equals("due")) {
803          this.due = TypeConvertor.castToDuration(value); // Duration
804        } else
805          return super.setProperty(name, value);
806        return value;
807      }
808
809      @Override
810      public Base makeProperty(int hash, String name) throws FHIRException {
811        switch (hash) {
812        case 938321246:  return getMeasure();
813        case -1973084529:  return getDetail();
814        case -1335224239:  return getDetail();
815        case 99828:  return getDue();
816        default: return super.makeProperty(hash, name);
817        }
818
819      }
820
821      @Override
822      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
823        switch (hash) {
824        case 938321246: /*measure*/ return new String[] {"CodeableConcept"};
825        case -1335224239: /*detail*/ return new String[] {"Quantity", "Range", "CodeableConcept"};
826        case 99828: /*due*/ return new String[] {"Duration"};
827        default: return super.getTypesForProperty(hash, name);
828        }
829
830      }
831
832      @Override
833      public Base addChild(String name) throws FHIRException {
834        if (name.equals("measure")) {
835          this.measure = new CodeableConcept();
836          return this.measure;
837        }
838        else if (name.equals("detailQuantity")) {
839          this.detail = new Quantity();
840          return this.detail;
841        }
842        else if (name.equals("detailRange")) {
843          this.detail = new Range();
844          return this.detail;
845        }
846        else if (name.equals("detailCodeableConcept")) {
847          this.detail = new CodeableConcept();
848          return this.detail;
849        }
850        else if (name.equals("due")) {
851          this.due = new Duration();
852          return this.due;
853        }
854        else
855          return super.addChild(name);
856      }
857
858      public PlanDefinitionGoalTargetComponent copy() {
859        PlanDefinitionGoalTargetComponent dst = new PlanDefinitionGoalTargetComponent();
860        copyValues(dst);
861        return dst;
862      }
863
864      public void copyValues(PlanDefinitionGoalTargetComponent dst) {
865        super.copyValues(dst);
866        dst.measure = measure == null ? null : measure.copy();
867        dst.detail = detail == null ? null : detail.copy();
868        dst.due = due == null ? null : due.copy();
869      }
870
871      @Override
872      public boolean equalsDeep(Base other_) {
873        if (!super.equalsDeep(other_))
874          return false;
875        if (!(other_ instanceof PlanDefinitionGoalTargetComponent))
876          return false;
877        PlanDefinitionGoalTargetComponent o = (PlanDefinitionGoalTargetComponent) other_;
878        return compareDeep(measure, o.measure, true) && compareDeep(detail, o.detail, true) && compareDeep(due, o.due, true)
879          ;
880      }
881
882      @Override
883      public boolean equalsShallow(Base other_) {
884        if (!super.equalsShallow(other_))
885          return false;
886        if (!(other_ instanceof PlanDefinitionGoalTargetComponent))
887          return false;
888        PlanDefinitionGoalTargetComponent o = (PlanDefinitionGoalTargetComponent) other_;
889        return true;
890      }
891
892      public boolean isEmpty() {
893        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(measure, detail, due);
894      }
895
896  public String fhirType() {
897    return "PlanDefinition.goal.target";
898
899  }
900
901  }
902
903    @Block()
904    public static class PlanDefinitionActionComponent extends BackboneElement implements IBaseBackboneElement {
905        /**
906         * A user-visible prefix for the action.
907         */
908        @Child(name = "prefix", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
909        @Description(shortDefinition="User-visible prefix for the action (e.g. 1. or A.)", formalDefinition="A user-visible prefix for the action." )
910        protected StringType prefix;
911
912        /**
913         * 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.
914         */
915        @Child(name = "title", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
916        @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." )
917        protected StringType title;
918
919        /**
920         * A brief description of the action used to provide a summary to display to the user.
921         */
922        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
923        @Description(shortDefinition="Brief description of the action", formalDefinition="A brief description of the action used to provide a summary to display to the user." )
924        protected StringType description;
925
926        /**
927         * 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.
928         */
929        @Child(name = "textEquivalent", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
930        @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." )
931        protected StringType textEquivalent;
932
933        /**
934         * Indicates how quickly the action should be addressed with respect to other actions.
935         */
936        @Child(name = "priority", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
937        @Description(shortDefinition="routine | urgent | asap | stat", formalDefinition="Indicates how quickly the action should be addressed with respect to other actions." )
938        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/request-priority")
939        protected Enumeration<RequestPriority> priority;
940
941        /**
942         * 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.
943         */
944        @Child(name = "code", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
945        @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." )
946        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-code")
947        protected List<CodeableConcept> code;
948
949        /**
950         * A description of why this action is necessary or appropriate.
951         */
952        @Child(name = "reason", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
953        @Description(shortDefinition="Why the action should be performed", formalDefinition="A description of why this action is necessary or appropriate." )
954        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-reason-code")
955        protected List<CodeableConcept> reason;
956
957        /**
958         * 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.
959         */
960        @Child(name = "documentation", type = {RelatedArtifact.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
961        @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." )
962        protected List<RelatedArtifact> documentation;
963
964        /**
965         * 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.
966         */
967        @Child(name = "goalId", type = {IdType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
968        @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." )
969        protected List<IdType> goalId;
970
971        /**
972         * 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.
973         */
974        @Child(name = "subject", type = {CodeableConcept.class, Group.class, CanonicalType.class}, order=10, min=0, max=1, modifier=false, summary=false)
975        @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." )
976        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/subject-type")
977        protected DataType subject;
978
979        /**
980         * A description of when the action should be triggered.
981         */
982        @Child(name = "trigger", type = {TriggerDefinition.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
983        @Description(shortDefinition="When the action should be triggered", formalDefinition="A description of when the action should be triggered." )
984        protected List<TriggerDefinition> trigger;
985
986        /**
987         * An expression that describes applicability criteria or start/stop conditions for the action.
988         */
989        @Child(name = "condition", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
990        @Description(shortDefinition="Whether or not the action is applicable", formalDefinition="An expression that describes applicability criteria or start/stop conditions for the action." )
991        protected List<PlanDefinitionActionConditionComponent> condition;
992
993        /**
994         * Defines input data requirements for the action.
995         */
996        @Child(name = "input", type = {DataRequirement.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
997        @Description(shortDefinition="Input data requirements", formalDefinition="Defines input data requirements for the action." )
998        protected List<DataRequirement> input;
999
1000        /**
1001         * Defines the outputs of the action, if any.
1002         */
1003        @Child(name = "output", type = {DataRequirement.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1004        @Description(shortDefinition="Output data definition", formalDefinition="Defines the outputs of the action, if any." )
1005        protected List<DataRequirement> output;
1006
1007        /**
1008         * A relationship to another action such as "before" or "30-60 minutes after start of".
1009         */
1010        @Child(name = "relatedAction", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1011        @Description(shortDefinition="Relationship to another action", formalDefinition="A relationship to another action such as \"before\" or \"30-60 minutes after start of\"." )
1012        protected List<PlanDefinitionActionRelatedActionComponent> relatedAction;
1013
1014        /**
1015         * An optional value describing when the action should be performed.
1016         */
1017        @Child(name = "timing", type = {DateTimeType.class, Age.class, Period.class, Duration.class, Range.class, Timing.class}, order=16, min=0, max=1, modifier=false, summary=false)
1018        @Description(shortDefinition="When the action should take place", formalDefinition="An optional value describing when the action should be performed." )
1019        protected DataType timing;
1020
1021        /**
1022         * Indicates who should participate in performing the action described.
1023         */
1024        @Child(name = "participant", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1025        @Description(shortDefinition="Who should participate in the action", formalDefinition="Indicates who should participate in performing the action described." )
1026        protected List<PlanDefinitionActionParticipantComponent> participant;
1027
1028        /**
1029         * The type of action to perform (create, update, remove).
1030         */
1031        @Child(name = "type", type = {CodeableConcept.class}, order=18, min=0, max=1, modifier=false, summary=false)
1032        @Description(shortDefinition="create | update | remove | fire-event", formalDefinition="The type of action to perform (create, update, remove)." )
1033        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-type")
1034        protected CodeableConcept type;
1035
1036        /**
1037         * Defines the grouping behavior for the action and its children.
1038         */
1039        @Child(name = "groupingBehavior", type = {CodeType.class}, order=19, min=0, max=1, modifier=false, summary=false)
1040        @Description(shortDefinition="visual-group | logical-group | sentence-group", formalDefinition="Defines the grouping behavior for the action and its children." )
1041        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-grouping-behavior")
1042        protected Enumeration<ActionGroupingBehavior> groupingBehavior;
1043
1044        /**
1045         * Defines the selection behavior for the action and its children.
1046         */
1047        @Child(name = "selectionBehavior", type = {CodeType.class}, order=20, min=0, max=1, modifier=false, summary=false)
1048        @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." )
1049        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-selection-behavior")
1050        protected Enumeration<ActionSelectionBehavior> selectionBehavior;
1051
1052        /**
1053         * Defines the required behavior for the action.
1054         */
1055        @Child(name = "requiredBehavior", type = {CodeType.class}, order=21, min=0, max=1, modifier=false, summary=false)
1056        @Description(shortDefinition="must | could | must-unless-documented", formalDefinition="Defines the required behavior for the action." )
1057        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-required-behavior")
1058        protected Enumeration<ActionRequiredBehavior> requiredBehavior;
1059
1060        /**
1061         * Defines whether the action should usually be preselected.
1062         */
1063        @Child(name = "precheckBehavior", type = {CodeType.class}, order=22, min=0, max=1, modifier=false, summary=false)
1064        @Description(shortDefinition="yes | no", formalDefinition="Defines whether the action should usually be preselected." )
1065        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-precheck-behavior")
1066        protected Enumeration<ActionPrecheckBehavior> precheckBehavior;
1067
1068        /**
1069         * Defines whether the action can be selected multiple times.
1070         */
1071        @Child(name = "cardinalityBehavior", type = {CodeType.class}, order=23, min=0, max=1, modifier=false, summary=false)
1072        @Description(shortDefinition="single | multiple", formalDefinition="Defines whether the action can be selected multiple times." )
1073        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-cardinality-behavior")
1074        protected Enumeration<ActionCardinalityBehavior> cardinalityBehavior;
1075
1076        /**
1077         * A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.
1078         */
1079        @Child(name = "definition", type = {CanonicalType.class, UriType.class}, order=24, min=0, max=1, modifier=false, summary=false)
1080        @Description(shortDefinition="Description of the activity to be performed", formalDefinition="A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken." )
1081        protected DataType definition;
1082
1083        /**
1084         * 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.
1085         */
1086        @Child(name = "transform", type = {CanonicalType.class}, order=25, min=0, max=1, modifier=false, summary=false)
1087        @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." )
1088        protected CanonicalType transform;
1089
1090        /**
1091         * 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.
1092         */
1093        @Child(name = "dynamicValue", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1094        @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." )
1095        protected List<PlanDefinitionActionDynamicValueComponent> dynamicValue;
1096
1097        /**
1098         * 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.
1099         */
1100        @Child(name = "action", type = {PlanDefinitionActionComponent.class}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1101        @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." )
1102        protected List<PlanDefinitionActionComponent> action;
1103
1104        private static final long serialVersionUID = -1494545766L;
1105
1106    /**
1107     * Constructor
1108     */
1109      public PlanDefinitionActionComponent() {
1110        super();
1111      }
1112
1113        /**
1114         * @return {@link #prefix} (A user-visible prefix for the action.). This is the underlying object with id, value and extensions. The accessor "getPrefix" gives direct access to the value
1115         */
1116        public StringType getPrefixElement() { 
1117          if (this.prefix == null)
1118            if (Configuration.errorOnAutoCreate())
1119              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.prefix");
1120            else if (Configuration.doAutoCreate())
1121              this.prefix = new StringType(); // bb
1122          return this.prefix;
1123        }
1124
1125        public boolean hasPrefixElement() { 
1126          return this.prefix != null && !this.prefix.isEmpty();
1127        }
1128
1129        public boolean hasPrefix() { 
1130          return this.prefix != null && !this.prefix.isEmpty();
1131        }
1132
1133        /**
1134         * @param value {@link #prefix} (A user-visible prefix for the action.). This is the underlying object with id, value and extensions. The accessor "getPrefix" gives direct access to the value
1135         */
1136        public PlanDefinitionActionComponent setPrefixElement(StringType value) { 
1137          this.prefix = value;
1138          return this;
1139        }
1140
1141        /**
1142         * @return A user-visible prefix for the action.
1143         */
1144        public String getPrefix() { 
1145          return this.prefix == null ? null : this.prefix.getValue();
1146        }
1147
1148        /**
1149         * @param value A user-visible prefix for the action.
1150         */
1151        public PlanDefinitionActionComponent setPrefix(String value) { 
1152          if (Utilities.noString(value))
1153            this.prefix = null;
1154          else {
1155            if (this.prefix == null)
1156              this.prefix = new StringType();
1157            this.prefix.setValue(value);
1158          }
1159          return this;
1160        }
1161
1162        /**
1163         * @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
1164         */
1165        public StringType getTitleElement() { 
1166          if (this.title == null)
1167            if (Configuration.errorOnAutoCreate())
1168              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.title");
1169            else if (Configuration.doAutoCreate())
1170              this.title = new StringType(); // bb
1171          return this.title;
1172        }
1173
1174        public boolean hasTitleElement() { 
1175          return this.title != null && !this.title.isEmpty();
1176        }
1177
1178        public boolean hasTitle() { 
1179          return this.title != null && !this.title.isEmpty();
1180        }
1181
1182        /**
1183         * @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
1184         */
1185        public PlanDefinitionActionComponent setTitleElement(StringType value) { 
1186          this.title = value;
1187          return this;
1188        }
1189
1190        /**
1191         * @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.
1192         */
1193        public String getTitle() { 
1194          return this.title == null ? null : this.title.getValue();
1195        }
1196
1197        /**
1198         * @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.
1199         */
1200        public PlanDefinitionActionComponent setTitle(String value) { 
1201          if (Utilities.noString(value))
1202            this.title = null;
1203          else {
1204            if (this.title == null)
1205              this.title = new StringType();
1206            this.title.setValue(value);
1207          }
1208          return this;
1209        }
1210
1211        /**
1212         * @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
1213         */
1214        public StringType getDescriptionElement() { 
1215          if (this.description == null)
1216            if (Configuration.errorOnAutoCreate())
1217              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.description");
1218            else if (Configuration.doAutoCreate())
1219              this.description = new StringType(); // bb
1220          return this.description;
1221        }
1222
1223        public boolean hasDescriptionElement() { 
1224          return this.description != null && !this.description.isEmpty();
1225        }
1226
1227        public boolean hasDescription() { 
1228          return this.description != null && !this.description.isEmpty();
1229        }
1230
1231        /**
1232         * @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
1233         */
1234        public PlanDefinitionActionComponent setDescriptionElement(StringType value) { 
1235          this.description = value;
1236          return this;
1237        }
1238
1239        /**
1240         * @return A brief description of the action used to provide a summary to display to the user.
1241         */
1242        public String getDescription() { 
1243          return this.description == null ? null : this.description.getValue();
1244        }
1245
1246        /**
1247         * @param value A brief description of the action used to provide a summary to display to the user.
1248         */
1249        public PlanDefinitionActionComponent setDescription(String value) { 
1250          if (Utilities.noString(value))
1251            this.description = null;
1252          else {
1253            if (this.description == null)
1254              this.description = new StringType();
1255            this.description.setValue(value);
1256          }
1257          return this;
1258        }
1259
1260        /**
1261         * @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
1262         */
1263        public StringType getTextEquivalentElement() { 
1264          if (this.textEquivalent == null)
1265            if (Configuration.errorOnAutoCreate())
1266              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.textEquivalent");
1267            else if (Configuration.doAutoCreate())
1268              this.textEquivalent = new StringType(); // bb
1269          return this.textEquivalent;
1270        }
1271
1272        public boolean hasTextEquivalentElement() { 
1273          return this.textEquivalent != null && !this.textEquivalent.isEmpty();
1274        }
1275
1276        public boolean hasTextEquivalent() { 
1277          return this.textEquivalent != null && !this.textEquivalent.isEmpty();
1278        }
1279
1280        /**
1281         * @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
1282         */
1283        public PlanDefinitionActionComponent setTextEquivalentElement(StringType value) { 
1284          this.textEquivalent = value;
1285          return this;
1286        }
1287
1288        /**
1289         * @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.
1290         */
1291        public String getTextEquivalent() { 
1292          return this.textEquivalent == null ? null : this.textEquivalent.getValue();
1293        }
1294
1295        /**
1296         * @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.
1297         */
1298        public PlanDefinitionActionComponent setTextEquivalent(String value) { 
1299          if (Utilities.noString(value))
1300            this.textEquivalent = null;
1301          else {
1302            if (this.textEquivalent == null)
1303              this.textEquivalent = new StringType();
1304            this.textEquivalent.setValue(value);
1305          }
1306          return this;
1307        }
1308
1309        /**
1310         * @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
1311         */
1312        public Enumeration<RequestPriority> getPriorityElement() { 
1313          if (this.priority == null)
1314            if (Configuration.errorOnAutoCreate())
1315              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.priority");
1316            else if (Configuration.doAutoCreate())
1317              this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory()); // bb
1318          return this.priority;
1319        }
1320
1321        public boolean hasPriorityElement() { 
1322          return this.priority != null && !this.priority.isEmpty();
1323        }
1324
1325        public boolean hasPriority() { 
1326          return this.priority != null && !this.priority.isEmpty();
1327        }
1328
1329        /**
1330         * @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
1331         */
1332        public PlanDefinitionActionComponent setPriorityElement(Enumeration<RequestPriority> value) { 
1333          this.priority = value;
1334          return this;
1335        }
1336
1337        /**
1338         * @return Indicates how quickly the action should be addressed with respect to other actions.
1339         */
1340        public RequestPriority getPriority() { 
1341          return this.priority == null ? null : this.priority.getValue();
1342        }
1343
1344        /**
1345         * @param value Indicates how quickly the action should be addressed with respect to other actions.
1346         */
1347        public PlanDefinitionActionComponent setPriority(RequestPriority value) { 
1348          if (value == null)
1349            this.priority = null;
1350          else {
1351            if (this.priority == null)
1352              this.priority = new Enumeration<RequestPriority>(new RequestPriorityEnumFactory());
1353            this.priority.setValue(value);
1354          }
1355          return this;
1356        }
1357
1358        /**
1359         * @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.)
1360         */
1361        public List<CodeableConcept> getCode() { 
1362          if (this.code == null)
1363            this.code = new ArrayList<CodeableConcept>();
1364          return this.code;
1365        }
1366
1367        /**
1368         * @return Returns a reference to <code>this</code> for easy method chaining
1369         */
1370        public PlanDefinitionActionComponent setCode(List<CodeableConcept> theCode) { 
1371          this.code = theCode;
1372          return this;
1373        }
1374
1375        public boolean hasCode() { 
1376          if (this.code == null)
1377            return false;
1378          for (CodeableConcept item : this.code)
1379            if (!item.isEmpty())
1380              return true;
1381          return false;
1382        }
1383
1384        public CodeableConcept addCode() { //3
1385          CodeableConcept t = new CodeableConcept();
1386          if (this.code == null)
1387            this.code = new ArrayList<CodeableConcept>();
1388          this.code.add(t);
1389          return t;
1390        }
1391
1392        public PlanDefinitionActionComponent addCode(CodeableConcept t) { //3
1393          if (t == null)
1394            return this;
1395          if (this.code == null)
1396            this.code = new ArrayList<CodeableConcept>();
1397          this.code.add(t);
1398          return this;
1399        }
1400
1401        /**
1402         * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist {3}
1403         */
1404        public CodeableConcept getCodeFirstRep() { 
1405          if (getCode().isEmpty()) {
1406            addCode();
1407          }
1408          return getCode().get(0);
1409        }
1410
1411        /**
1412         * @return {@link #reason} (A description of why this action is necessary or appropriate.)
1413         */
1414        public List<CodeableConcept> getReason() { 
1415          if (this.reason == null)
1416            this.reason = new ArrayList<CodeableConcept>();
1417          return this.reason;
1418        }
1419
1420        /**
1421         * @return Returns a reference to <code>this</code> for easy method chaining
1422         */
1423        public PlanDefinitionActionComponent setReason(List<CodeableConcept> theReason) { 
1424          this.reason = theReason;
1425          return this;
1426        }
1427
1428        public boolean hasReason() { 
1429          if (this.reason == null)
1430            return false;
1431          for (CodeableConcept item : this.reason)
1432            if (!item.isEmpty())
1433              return true;
1434          return false;
1435        }
1436
1437        public CodeableConcept addReason() { //3
1438          CodeableConcept t = new CodeableConcept();
1439          if (this.reason == null)
1440            this.reason = new ArrayList<CodeableConcept>();
1441          this.reason.add(t);
1442          return t;
1443        }
1444
1445        public PlanDefinitionActionComponent addReason(CodeableConcept t) { //3
1446          if (t == null)
1447            return this;
1448          if (this.reason == null)
1449            this.reason = new ArrayList<CodeableConcept>();
1450          this.reason.add(t);
1451          return this;
1452        }
1453
1454        /**
1455         * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
1456         */
1457        public CodeableConcept getReasonFirstRep() { 
1458          if (getReason().isEmpty()) {
1459            addReason();
1460          }
1461          return getReason().get(0);
1462        }
1463
1464        /**
1465         * @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.)
1466         */
1467        public List<RelatedArtifact> getDocumentation() { 
1468          if (this.documentation == null)
1469            this.documentation = new ArrayList<RelatedArtifact>();
1470          return this.documentation;
1471        }
1472
1473        /**
1474         * @return Returns a reference to <code>this</code> for easy method chaining
1475         */
1476        public PlanDefinitionActionComponent setDocumentation(List<RelatedArtifact> theDocumentation) { 
1477          this.documentation = theDocumentation;
1478          return this;
1479        }
1480
1481        public boolean hasDocumentation() { 
1482          if (this.documentation == null)
1483            return false;
1484          for (RelatedArtifact item : this.documentation)
1485            if (!item.isEmpty())
1486              return true;
1487          return false;
1488        }
1489
1490        public RelatedArtifact addDocumentation() { //3
1491          RelatedArtifact t = new RelatedArtifact();
1492          if (this.documentation == null)
1493            this.documentation = new ArrayList<RelatedArtifact>();
1494          this.documentation.add(t);
1495          return t;
1496        }
1497
1498        public PlanDefinitionActionComponent addDocumentation(RelatedArtifact t) { //3
1499          if (t == null)
1500            return this;
1501          if (this.documentation == null)
1502            this.documentation = new ArrayList<RelatedArtifact>();
1503          this.documentation.add(t);
1504          return this;
1505        }
1506
1507        /**
1508         * @return The first repetition of repeating field {@link #documentation}, creating it if it does not already exist {3}
1509         */
1510        public RelatedArtifact getDocumentationFirstRep() { 
1511          if (getDocumentation().isEmpty()) {
1512            addDocumentation();
1513          }
1514          return getDocumentation().get(0);
1515        }
1516
1517        /**
1518         * @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.)
1519         */
1520        public List<IdType> getGoalId() { 
1521          if (this.goalId == null)
1522            this.goalId = new ArrayList<IdType>();
1523          return this.goalId;
1524        }
1525
1526        /**
1527         * @return Returns a reference to <code>this</code> for easy method chaining
1528         */
1529        public PlanDefinitionActionComponent setGoalId(List<IdType> theGoalId) { 
1530          this.goalId = theGoalId;
1531          return this;
1532        }
1533
1534        public boolean hasGoalId() { 
1535          if (this.goalId == null)
1536            return false;
1537          for (IdType item : this.goalId)
1538            if (!item.isEmpty())
1539              return true;
1540          return false;
1541        }
1542
1543        /**
1544         * @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.)
1545         */
1546        public IdType addGoalIdElement() {//2 
1547          IdType t = new IdType();
1548          if (this.goalId == null)
1549            this.goalId = new ArrayList<IdType>();
1550          this.goalId.add(t);
1551          return t;
1552        }
1553
1554        /**
1555         * @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.)
1556         */
1557        public PlanDefinitionActionComponent addGoalId(String value) { //1
1558          IdType t = new IdType();
1559          t.setValue(value);
1560          if (this.goalId == null)
1561            this.goalId = new ArrayList<IdType>();
1562          this.goalId.add(t);
1563          return this;
1564        }
1565
1566        /**
1567         * @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.)
1568         */
1569        public boolean hasGoalId(String value) { 
1570          if (this.goalId == null)
1571            return false;
1572          for (IdType v : this.goalId)
1573            if (v.getValue().equals(value)) // id
1574              return true;
1575          return false;
1576        }
1577
1578        /**
1579         * @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.)
1580         */
1581        public DataType getSubject() { 
1582          return this.subject;
1583        }
1584
1585        /**
1586         * @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.)
1587         */
1588        public CodeableConcept getSubjectCodeableConcept() throws FHIRException { 
1589          if (this.subject == null)
1590            this.subject = new CodeableConcept();
1591          if (!(this.subject instanceof CodeableConcept))
1592            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.subject.getClass().getName()+" was encountered");
1593          return (CodeableConcept) this.subject;
1594        }
1595
1596        public boolean hasSubjectCodeableConcept() { 
1597          return this != null && this.subject instanceof CodeableConcept;
1598        }
1599
1600        /**
1601         * @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.)
1602         */
1603        public Reference getSubjectReference() throws FHIRException { 
1604          if (this.subject == null)
1605            this.subject = new Reference();
1606          if (!(this.subject instanceof Reference))
1607            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.subject.getClass().getName()+" was encountered");
1608          return (Reference) this.subject;
1609        }
1610
1611        public boolean hasSubjectReference() { 
1612          return this != null && this.subject instanceof Reference;
1613        }
1614
1615        /**
1616         * @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.)
1617         */
1618        public CanonicalType getSubjectCanonicalType() throws FHIRException { 
1619          if (this.subject == null)
1620            this.subject = new CanonicalType();
1621          if (!(this.subject instanceof CanonicalType))
1622            throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.subject.getClass().getName()+" was encountered");
1623          return (CanonicalType) this.subject;
1624        }
1625
1626        public boolean hasSubjectCanonicalType() { 
1627          return this != null && this.subject instanceof CanonicalType;
1628        }
1629
1630        public boolean hasSubject() { 
1631          return this.subject != null && !this.subject.isEmpty();
1632        }
1633
1634        /**
1635         * @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.)
1636         */
1637        public PlanDefinitionActionComponent setSubject(DataType value) { 
1638          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference || value instanceof CanonicalType))
1639            throw new Error("Not the right type for PlanDefinition.action.subject[x]: "+value.fhirType());
1640          this.subject = value;
1641          return this;
1642        }
1643
1644        /**
1645         * @return {@link #trigger} (A description of when the action should be triggered.)
1646         */
1647        public List<TriggerDefinition> getTrigger() { 
1648          if (this.trigger == null)
1649            this.trigger = new ArrayList<TriggerDefinition>();
1650          return this.trigger;
1651        }
1652
1653        /**
1654         * @return Returns a reference to <code>this</code> for easy method chaining
1655         */
1656        public PlanDefinitionActionComponent setTrigger(List<TriggerDefinition> theTrigger) { 
1657          this.trigger = theTrigger;
1658          return this;
1659        }
1660
1661        public boolean hasTrigger() { 
1662          if (this.trigger == null)
1663            return false;
1664          for (TriggerDefinition item : this.trigger)
1665            if (!item.isEmpty())
1666              return true;
1667          return false;
1668        }
1669
1670        public TriggerDefinition addTrigger() { //3
1671          TriggerDefinition t = new TriggerDefinition();
1672          if (this.trigger == null)
1673            this.trigger = new ArrayList<TriggerDefinition>();
1674          this.trigger.add(t);
1675          return t;
1676        }
1677
1678        public PlanDefinitionActionComponent addTrigger(TriggerDefinition t) { //3
1679          if (t == null)
1680            return this;
1681          if (this.trigger == null)
1682            this.trigger = new ArrayList<TriggerDefinition>();
1683          this.trigger.add(t);
1684          return this;
1685        }
1686
1687        /**
1688         * @return The first repetition of repeating field {@link #trigger}, creating it if it does not already exist {3}
1689         */
1690        public TriggerDefinition getTriggerFirstRep() { 
1691          if (getTrigger().isEmpty()) {
1692            addTrigger();
1693          }
1694          return getTrigger().get(0);
1695        }
1696
1697        /**
1698         * @return {@link #condition} (An expression that describes applicability criteria or start/stop conditions for the action.)
1699         */
1700        public List<PlanDefinitionActionConditionComponent> getCondition() { 
1701          if (this.condition == null)
1702            this.condition = new ArrayList<PlanDefinitionActionConditionComponent>();
1703          return this.condition;
1704        }
1705
1706        /**
1707         * @return Returns a reference to <code>this</code> for easy method chaining
1708         */
1709        public PlanDefinitionActionComponent setCondition(List<PlanDefinitionActionConditionComponent> theCondition) { 
1710          this.condition = theCondition;
1711          return this;
1712        }
1713
1714        public boolean hasCondition() { 
1715          if (this.condition == null)
1716            return false;
1717          for (PlanDefinitionActionConditionComponent item : this.condition)
1718            if (!item.isEmpty())
1719              return true;
1720          return false;
1721        }
1722
1723        public PlanDefinitionActionConditionComponent addCondition() { //3
1724          PlanDefinitionActionConditionComponent t = new PlanDefinitionActionConditionComponent();
1725          if (this.condition == null)
1726            this.condition = new ArrayList<PlanDefinitionActionConditionComponent>();
1727          this.condition.add(t);
1728          return t;
1729        }
1730
1731        public PlanDefinitionActionComponent addCondition(PlanDefinitionActionConditionComponent t) { //3
1732          if (t == null)
1733            return this;
1734          if (this.condition == null)
1735            this.condition = new ArrayList<PlanDefinitionActionConditionComponent>();
1736          this.condition.add(t);
1737          return this;
1738        }
1739
1740        /**
1741         * @return The first repetition of repeating field {@link #condition}, creating it if it does not already exist {3}
1742         */
1743        public PlanDefinitionActionConditionComponent getConditionFirstRep() { 
1744          if (getCondition().isEmpty()) {
1745            addCondition();
1746          }
1747          return getCondition().get(0);
1748        }
1749
1750        /**
1751         * @return {@link #input} (Defines input data requirements for the action.)
1752         */
1753        public List<DataRequirement> getInput() { 
1754          if (this.input == null)
1755            this.input = new ArrayList<DataRequirement>();
1756          return this.input;
1757        }
1758
1759        /**
1760         * @return Returns a reference to <code>this</code> for easy method chaining
1761         */
1762        public PlanDefinitionActionComponent setInput(List<DataRequirement> theInput) { 
1763          this.input = theInput;
1764          return this;
1765        }
1766
1767        public boolean hasInput() { 
1768          if (this.input == null)
1769            return false;
1770          for (DataRequirement item : this.input)
1771            if (!item.isEmpty())
1772              return true;
1773          return false;
1774        }
1775
1776        public DataRequirement addInput() { //3
1777          DataRequirement t = new DataRequirement();
1778          if (this.input == null)
1779            this.input = new ArrayList<DataRequirement>();
1780          this.input.add(t);
1781          return t;
1782        }
1783
1784        public PlanDefinitionActionComponent addInput(DataRequirement t) { //3
1785          if (t == null)
1786            return this;
1787          if (this.input == null)
1788            this.input = new ArrayList<DataRequirement>();
1789          this.input.add(t);
1790          return this;
1791        }
1792
1793        /**
1794         * @return The first repetition of repeating field {@link #input}, creating it if it does not already exist {3}
1795         */
1796        public DataRequirement getInputFirstRep() { 
1797          if (getInput().isEmpty()) {
1798            addInput();
1799          }
1800          return getInput().get(0);
1801        }
1802
1803        /**
1804         * @return {@link #output} (Defines the outputs of the action, if any.)
1805         */
1806        public List<DataRequirement> getOutput() { 
1807          if (this.output == null)
1808            this.output = new ArrayList<DataRequirement>();
1809          return this.output;
1810        }
1811
1812        /**
1813         * @return Returns a reference to <code>this</code> for easy method chaining
1814         */
1815        public PlanDefinitionActionComponent setOutput(List<DataRequirement> theOutput) { 
1816          this.output = theOutput;
1817          return this;
1818        }
1819
1820        public boolean hasOutput() { 
1821          if (this.output == null)
1822            return false;
1823          for (DataRequirement item : this.output)
1824            if (!item.isEmpty())
1825              return true;
1826          return false;
1827        }
1828
1829        public DataRequirement addOutput() { //3
1830          DataRequirement t = new DataRequirement();
1831          if (this.output == null)
1832            this.output = new ArrayList<DataRequirement>();
1833          this.output.add(t);
1834          return t;
1835        }
1836
1837        public PlanDefinitionActionComponent addOutput(DataRequirement t) { //3
1838          if (t == null)
1839            return this;
1840          if (this.output == null)
1841            this.output = new ArrayList<DataRequirement>();
1842          this.output.add(t);
1843          return this;
1844        }
1845
1846        /**
1847         * @return The first repetition of repeating field {@link #output}, creating it if it does not already exist {3}
1848         */
1849        public DataRequirement getOutputFirstRep() { 
1850          if (getOutput().isEmpty()) {
1851            addOutput();
1852          }
1853          return getOutput().get(0);
1854        }
1855
1856        /**
1857         * @return {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".)
1858         */
1859        public List<PlanDefinitionActionRelatedActionComponent> getRelatedAction() { 
1860          if (this.relatedAction == null)
1861            this.relatedAction = new ArrayList<PlanDefinitionActionRelatedActionComponent>();
1862          return this.relatedAction;
1863        }
1864
1865        /**
1866         * @return Returns a reference to <code>this</code> for easy method chaining
1867         */
1868        public PlanDefinitionActionComponent setRelatedAction(List<PlanDefinitionActionRelatedActionComponent> theRelatedAction) { 
1869          this.relatedAction = theRelatedAction;
1870          return this;
1871        }
1872
1873        public boolean hasRelatedAction() { 
1874          if (this.relatedAction == null)
1875            return false;
1876          for (PlanDefinitionActionRelatedActionComponent item : this.relatedAction)
1877            if (!item.isEmpty())
1878              return true;
1879          return false;
1880        }
1881
1882        public PlanDefinitionActionRelatedActionComponent addRelatedAction() { //3
1883          PlanDefinitionActionRelatedActionComponent t = new PlanDefinitionActionRelatedActionComponent();
1884          if (this.relatedAction == null)
1885            this.relatedAction = new ArrayList<PlanDefinitionActionRelatedActionComponent>();
1886          this.relatedAction.add(t);
1887          return t;
1888        }
1889
1890        public PlanDefinitionActionComponent addRelatedAction(PlanDefinitionActionRelatedActionComponent t) { //3
1891          if (t == null)
1892            return this;
1893          if (this.relatedAction == null)
1894            this.relatedAction = new ArrayList<PlanDefinitionActionRelatedActionComponent>();
1895          this.relatedAction.add(t);
1896          return this;
1897        }
1898
1899        /**
1900         * @return The first repetition of repeating field {@link #relatedAction}, creating it if it does not already exist {3}
1901         */
1902        public PlanDefinitionActionRelatedActionComponent getRelatedActionFirstRep() { 
1903          if (getRelatedAction().isEmpty()) {
1904            addRelatedAction();
1905          }
1906          return getRelatedAction().get(0);
1907        }
1908
1909        /**
1910         * @return {@link #timing} (An optional value describing when the action should be performed.)
1911         */
1912        public DataType getTiming() { 
1913          return this.timing;
1914        }
1915
1916        /**
1917         * @return {@link #timing} (An optional value describing when the action should be performed.)
1918         */
1919        public DateTimeType getTimingDateTimeType() throws FHIRException { 
1920          if (this.timing == null)
1921            this.timing = new DateTimeType();
1922          if (!(this.timing instanceof DateTimeType))
1923            throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered");
1924          return (DateTimeType) this.timing;
1925        }
1926
1927        public boolean hasTimingDateTimeType() { 
1928          return this != null && this.timing instanceof DateTimeType;
1929        }
1930
1931        /**
1932         * @return {@link #timing} (An optional value describing when the action should be performed.)
1933         */
1934        public Age getTimingAge() throws FHIRException { 
1935          if (this.timing == null)
1936            this.timing = new Age();
1937          if (!(this.timing instanceof Age))
1938            throw new FHIRException("Type mismatch: the type Age was expected, but "+this.timing.getClass().getName()+" was encountered");
1939          return (Age) this.timing;
1940        }
1941
1942        public boolean hasTimingAge() { 
1943          return this != null && this.timing instanceof Age;
1944        }
1945
1946        /**
1947         * @return {@link #timing} (An optional value describing when the action should be performed.)
1948         */
1949        public Period getTimingPeriod() throws FHIRException { 
1950          if (this.timing == null)
1951            this.timing = new Period();
1952          if (!(this.timing instanceof Period))
1953            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered");
1954          return (Period) this.timing;
1955        }
1956
1957        public boolean hasTimingPeriod() { 
1958          return this != null && this.timing instanceof Period;
1959        }
1960
1961        /**
1962         * @return {@link #timing} (An optional value describing when the action should be performed.)
1963         */
1964        public Duration getTimingDuration() throws FHIRException { 
1965          if (this.timing == null)
1966            this.timing = new Duration();
1967          if (!(this.timing instanceof Duration))
1968            throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.timing.getClass().getName()+" was encountered");
1969          return (Duration) this.timing;
1970        }
1971
1972        public boolean hasTimingDuration() { 
1973          return this != null && this.timing instanceof Duration;
1974        }
1975
1976        /**
1977         * @return {@link #timing} (An optional value describing when the action should be performed.)
1978         */
1979        public Range getTimingRange() throws FHIRException { 
1980          if (this.timing == null)
1981            this.timing = new Range();
1982          if (!(this.timing instanceof Range))
1983            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.timing.getClass().getName()+" was encountered");
1984          return (Range) this.timing;
1985        }
1986
1987        public boolean hasTimingRange() { 
1988          return this != null && this.timing instanceof Range;
1989        }
1990
1991        /**
1992         * @return {@link #timing} (An optional value describing when the action should be performed.)
1993         */
1994        public Timing getTimingTiming() throws FHIRException { 
1995          if (this.timing == null)
1996            this.timing = new Timing();
1997          if (!(this.timing instanceof Timing))
1998            throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered");
1999          return (Timing) this.timing;
2000        }
2001
2002        public boolean hasTimingTiming() { 
2003          return this != null && this.timing instanceof Timing;
2004        }
2005
2006        public boolean hasTiming() { 
2007          return this.timing != null && !this.timing.isEmpty();
2008        }
2009
2010        /**
2011         * @param value {@link #timing} (An optional value describing when the action should be performed.)
2012         */
2013        public PlanDefinitionActionComponent setTiming(DataType value) { 
2014          if (value != null && !(value instanceof DateTimeType || value instanceof Age || value instanceof Period || value instanceof Duration || value instanceof Range || value instanceof Timing))
2015            throw new Error("Not the right type for PlanDefinition.action.timing[x]: "+value.fhirType());
2016          this.timing = value;
2017          return this;
2018        }
2019
2020        /**
2021         * @return {@link #participant} (Indicates who should participate in performing the action described.)
2022         */
2023        public List<PlanDefinitionActionParticipantComponent> getParticipant() { 
2024          if (this.participant == null)
2025            this.participant = new ArrayList<PlanDefinitionActionParticipantComponent>();
2026          return this.participant;
2027        }
2028
2029        /**
2030         * @return Returns a reference to <code>this</code> for easy method chaining
2031         */
2032        public PlanDefinitionActionComponent setParticipant(List<PlanDefinitionActionParticipantComponent> theParticipant) { 
2033          this.participant = theParticipant;
2034          return this;
2035        }
2036
2037        public boolean hasParticipant() { 
2038          if (this.participant == null)
2039            return false;
2040          for (PlanDefinitionActionParticipantComponent item : this.participant)
2041            if (!item.isEmpty())
2042              return true;
2043          return false;
2044        }
2045
2046        public PlanDefinitionActionParticipantComponent addParticipant() { //3
2047          PlanDefinitionActionParticipantComponent t = new PlanDefinitionActionParticipantComponent();
2048          if (this.participant == null)
2049            this.participant = new ArrayList<PlanDefinitionActionParticipantComponent>();
2050          this.participant.add(t);
2051          return t;
2052        }
2053
2054        public PlanDefinitionActionComponent addParticipant(PlanDefinitionActionParticipantComponent t) { //3
2055          if (t == null)
2056            return this;
2057          if (this.participant == null)
2058            this.participant = new ArrayList<PlanDefinitionActionParticipantComponent>();
2059          this.participant.add(t);
2060          return this;
2061        }
2062
2063        /**
2064         * @return The first repetition of repeating field {@link #participant}, creating it if it does not already exist {3}
2065         */
2066        public PlanDefinitionActionParticipantComponent getParticipantFirstRep() { 
2067          if (getParticipant().isEmpty()) {
2068            addParticipant();
2069          }
2070          return getParticipant().get(0);
2071        }
2072
2073        /**
2074         * @return {@link #type} (The type of action to perform (create, update, remove).)
2075         */
2076        public CodeableConcept getType() { 
2077          if (this.type == null)
2078            if (Configuration.errorOnAutoCreate())
2079              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.type");
2080            else if (Configuration.doAutoCreate())
2081              this.type = new CodeableConcept(); // cc
2082          return this.type;
2083        }
2084
2085        public boolean hasType() { 
2086          return this.type != null && !this.type.isEmpty();
2087        }
2088
2089        /**
2090         * @param value {@link #type} (The type of action to perform (create, update, remove).)
2091         */
2092        public PlanDefinitionActionComponent setType(CodeableConcept value) { 
2093          this.type = value;
2094          return this;
2095        }
2096
2097        /**
2098         * @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
2099         */
2100        public Enumeration<ActionGroupingBehavior> getGroupingBehaviorElement() { 
2101          if (this.groupingBehavior == null)
2102            if (Configuration.errorOnAutoCreate())
2103              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.groupingBehavior");
2104            else if (Configuration.doAutoCreate())
2105              this.groupingBehavior = new Enumeration<ActionGroupingBehavior>(new ActionGroupingBehaviorEnumFactory()); // bb
2106          return this.groupingBehavior;
2107        }
2108
2109        public boolean hasGroupingBehaviorElement() { 
2110          return this.groupingBehavior != null && !this.groupingBehavior.isEmpty();
2111        }
2112
2113        public boolean hasGroupingBehavior() { 
2114          return this.groupingBehavior != null && !this.groupingBehavior.isEmpty();
2115        }
2116
2117        /**
2118         * @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
2119         */
2120        public PlanDefinitionActionComponent setGroupingBehaviorElement(Enumeration<ActionGroupingBehavior> value) { 
2121          this.groupingBehavior = value;
2122          return this;
2123        }
2124
2125        /**
2126         * @return Defines the grouping behavior for the action and its children.
2127         */
2128        public ActionGroupingBehavior getGroupingBehavior() { 
2129          return this.groupingBehavior == null ? null : this.groupingBehavior.getValue();
2130        }
2131
2132        /**
2133         * @param value Defines the grouping behavior for the action and its children.
2134         */
2135        public PlanDefinitionActionComponent setGroupingBehavior(ActionGroupingBehavior value) { 
2136          if (value == null)
2137            this.groupingBehavior = null;
2138          else {
2139            if (this.groupingBehavior == null)
2140              this.groupingBehavior = new Enumeration<ActionGroupingBehavior>(new ActionGroupingBehaviorEnumFactory());
2141            this.groupingBehavior.setValue(value);
2142          }
2143          return this;
2144        }
2145
2146        /**
2147         * @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
2148         */
2149        public Enumeration<ActionSelectionBehavior> getSelectionBehaviorElement() { 
2150          if (this.selectionBehavior == null)
2151            if (Configuration.errorOnAutoCreate())
2152              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.selectionBehavior");
2153            else if (Configuration.doAutoCreate())
2154              this.selectionBehavior = new Enumeration<ActionSelectionBehavior>(new ActionSelectionBehaviorEnumFactory()); // bb
2155          return this.selectionBehavior;
2156        }
2157
2158        public boolean hasSelectionBehaviorElement() { 
2159          return this.selectionBehavior != null && !this.selectionBehavior.isEmpty();
2160        }
2161
2162        public boolean hasSelectionBehavior() { 
2163          return this.selectionBehavior != null && !this.selectionBehavior.isEmpty();
2164        }
2165
2166        /**
2167         * @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
2168         */
2169        public PlanDefinitionActionComponent setSelectionBehaviorElement(Enumeration<ActionSelectionBehavior> value) { 
2170          this.selectionBehavior = value;
2171          return this;
2172        }
2173
2174        /**
2175         * @return Defines the selection behavior for the action and its children.
2176         */
2177        public ActionSelectionBehavior getSelectionBehavior() { 
2178          return this.selectionBehavior == null ? null : this.selectionBehavior.getValue();
2179        }
2180
2181        /**
2182         * @param value Defines the selection behavior for the action and its children.
2183         */
2184        public PlanDefinitionActionComponent setSelectionBehavior(ActionSelectionBehavior value) { 
2185          if (value == null)
2186            this.selectionBehavior = null;
2187          else {
2188            if (this.selectionBehavior == null)
2189              this.selectionBehavior = new Enumeration<ActionSelectionBehavior>(new ActionSelectionBehaviorEnumFactory());
2190            this.selectionBehavior.setValue(value);
2191          }
2192          return this;
2193        }
2194
2195        /**
2196         * @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
2197         */
2198        public Enumeration<ActionRequiredBehavior> getRequiredBehaviorElement() { 
2199          if (this.requiredBehavior == null)
2200            if (Configuration.errorOnAutoCreate())
2201              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.requiredBehavior");
2202            else if (Configuration.doAutoCreate())
2203              this.requiredBehavior = new Enumeration<ActionRequiredBehavior>(new ActionRequiredBehaviorEnumFactory()); // bb
2204          return this.requiredBehavior;
2205        }
2206
2207        public boolean hasRequiredBehaviorElement() { 
2208          return this.requiredBehavior != null && !this.requiredBehavior.isEmpty();
2209        }
2210
2211        public boolean hasRequiredBehavior() { 
2212          return this.requiredBehavior != null && !this.requiredBehavior.isEmpty();
2213        }
2214
2215        /**
2216         * @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
2217         */
2218        public PlanDefinitionActionComponent setRequiredBehaviorElement(Enumeration<ActionRequiredBehavior> value) { 
2219          this.requiredBehavior = value;
2220          return this;
2221        }
2222
2223        /**
2224         * @return Defines the required behavior for the action.
2225         */
2226        public ActionRequiredBehavior getRequiredBehavior() { 
2227          return this.requiredBehavior == null ? null : this.requiredBehavior.getValue();
2228        }
2229
2230        /**
2231         * @param value Defines the required behavior for the action.
2232         */
2233        public PlanDefinitionActionComponent setRequiredBehavior(ActionRequiredBehavior value) { 
2234          if (value == null)
2235            this.requiredBehavior = null;
2236          else {
2237            if (this.requiredBehavior == null)
2238              this.requiredBehavior = new Enumeration<ActionRequiredBehavior>(new ActionRequiredBehaviorEnumFactory());
2239            this.requiredBehavior.setValue(value);
2240          }
2241          return this;
2242        }
2243
2244        /**
2245         * @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
2246         */
2247        public Enumeration<ActionPrecheckBehavior> getPrecheckBehaviorElement() { 
2248          if (this.precheckBehavior == null)
2249            if (Configuration.errorOnAutoCreate())
2250              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.precheckBehavior");
2251            else if (Configuration.doAutoCreate())
2252              this.precheckBehavior = new Enumeration<ActionPrecheckBehavior>(new ActionPrecheckBehaviorEnumFactory()); // bb
2253          return this.precheckBehavior;
2254        }
2255
2256        public boolean hasPrecheckBehaviorElement() { 
2257          return this.precheckBehavior != null && !this.precheckBehavior.isEmpty();
2258        }
2259
2260        public boolean hasPrecheckBehavior() { 
2261          return this.precheckBehavior != null && !this.precheckBehavior.isEmpty();
2262        }
2263
2264        /**
2265         * @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
2266         */
2267        public PlanDefinitionActionComponent setPrecheckBehaviorElement(Enumeration<ActionPrecheckBehavior> value) { 
2268          this.precheckBehavior = value;
2269          return this;
2270        }
2271
2272        /**
2273         * @return Defines whether the action should usually be preselected.
2274         */
2275        public ActionPrecheckBehavior getPrecheckBehavior() { 
2276          return this.precheckBehavior == null ? null : this.precheckBehavior.getValue();
2277        }
2278
2279        /**
2280         * @param value Defines whether the action should usually be preselected.
2281         */
2282        public PlanDefinitionActionComponent setPrecheckBehavior(ActionPrecheckBehavior value) { 
2283          if (value == null)
2284            this.precheckBehavior = null;
2285          else {
2286            if (this.precheckBehavior == null)
2287              this.precheckBehavior = new Enumeration<ActionPrecheckBehavior>(new ActionPrecheckBehaviorEnumFactory());
2288            this.precheckBehavior.setValue(value);
2289          }
2290          return this;
2291        }
2292
2293        /**
2294         * @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
2295         */
2296        public Enumeration<ActionCardinalityBehavior> getCardinalityBehaviorElement() { 
2297          if (this.cardinalityBehavior == null)
2298            if (Configuration.errorOnAutoCreate())
2299              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.cardinalityBehavior");
2300            else if (Configuration.doAutoCreate())
2301              this.cardinalityBehavior = new Enumeration<ActionCardinalityBehavior>(new ActionCardinalityBehaviorEnumFactory()); // bb
2302          return this.cardinalityBehavior;
2303        }
2304
2305        public boolean hasCardinalityBehaviorElement() { 
2306          return this.cardinalityBehavior != null && !this.cardinalityBehavior.isEmpty();
2307        }
2308
2309        public boolean hasCardinalityBehavior() { 
2310          return this.cardinalityBehavior != null && !this.cardinalityBehavior.isEmpty();
2311        }
2312
2313        /**
2314         * @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
2315         */
2316        public PlanDefinitionActionComponent setCardinalityBehaviorElement(Enumeration<ActionCardinalityBehavior> value) { 
2317          this.cardinalityBehavior = value;
2318          return this;
2319        }
2320
2321        /**
2322         * @return Defines whether the action can be selected multiple times.
2323         */
2324        public ActionCardinalityBehavior getCardinalityBehavior() { 
2325          return this.cardinalityBehavior == null ? null : this.cardinalityBehavior.getValue();
2326        }
2327
2328        /**
2329         * @param value Defines whether the action can be selected multiple times.
2330         */
2331        public PlanDefinitionActionComponent setCardinalityBehavior(ActionCardinalityBehavior value) { 
2332          if (value == null)
2333            this.cardinalityBehavior = null;
2334          else {
2335            if (this.cardinalityBehavior == null)
2336              this.cardinalityBehavior = new Enumeration<ActionCardinalityBehavior>(new ActionCardinalityBehaviorEnumFactory());
2337            this.cardinalityBehavior.setValue(value);
2338          }
2339          return this;
2340        }
2341
2342        /**
2343         * @return {@link #definition} (A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.)
2344         */
2345        public DataType getDefinition() { 
2346          return this.definition;
2347        }
2348
2349        /**
2350         * @return {@link #definition} (A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.)
2351         */
2352        public CanonicalType getDefinitionCanonicalType() throws FHIRException { 
2353          if (this.definition == null)
2354            this.definition = new CanonicalType();
2355          if (!(this.definition instanceof CanonicalType))
2356            throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.definition.getClass().getName()+" was encountered");
2357          return (CanonicalType) this.definition;
2358        }
2359
2360        public boolean hasDefinitionCanonicalType() { 
2361          return this != null && this.definition instanceof CanonicalType;
2362        }
2363
2364        /**
2365         * @return {@link #definition} (A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.)
2366         */
2367        public UriType getDefinitionUriType() throws FHIRException { 
2368          if (this.definition == null)
2369            this.definition = new UriType();
2370          if (!(this.definition instanceof UriType))
2371            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.definition.getClass().getName()+" was encountered");
2372          return (UriType) this.definition;
2373        }
2374
2375        public boolean hasDefinitionUriType() { 
2376          return this != null && this.definition instanceof UriType;
2377        }
2378
2379        public boolean hasDefinition() { 
2380          return this.definition != null && !this.definition.isEmpty();
2381        }
2382
2383        /**
2384         * @param value {@link #definition} (A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.)
2385         */
2386        public PlanDefinitionActionComponent setDefinition(DataType value) { 
2387          if (value != null && !(value instanceof CanonicalType || value instanceof UriType))
2388            throw new Error("Not the right type for PlanDefinition.action.definition[x]: "+value.fhirType());
2389          this.definition = value;
2390          return this;
2391        }
2392
2393        /**
2394         * @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
2395         */
2396        public CanonicalType getTransformElement() { 
2397          if (this.transform == null)
2398            if (Configuration.errorOnAutoCreate())
2399              throw new Error("Attempt to auto-create PlanDefinitionActionComponent.transform");
2400            else if (Configuration.doAutoCreate())
2401              this.transform = new CanonicalType(); // bb
2402          return this.transform;
2403        }
2404
2405        public boolean hasTransformElement() { 
2406          return this.transform != null && !this.transform.isEmpty();
2407        }
2408
2409        public boolean hasTransform() { 
2410          return this.transform != null && !this.transform.isEmpty();
2411        }
2412
2413        /**
2414         * @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
2415         */
2416        public PlanDefinitionActionComponent setTransformElement(CanonicalType value) { 
2417          this.transform = value;
2418          return this;
2419        }
2420
2421        /**
2422         * @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.
2423         */
2424        public String getTransform() { 
2425          return this.transform == null ? null : this.transform.getValue();
2426        }
2427
2428        /**
2429         * @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.
2430         */
2431        public PlanDefinitionActionComponent setTransform(String value) { 
2432          if (Utilities.noString(value))
2433            this.transform = null;
2434          else {
2435            if (this.transform == null)
2436              this.transform = new CanonicalType();
2437            this.transform.setValue(value);
2438          }
2439          return this;
2440        }
2441
2442        /**
2443         * @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.)
2444         */
2445        public List<PlanDefinitionActionDynamicValueComponent> getDynamicValue() { 
2446          if (this.dynamicValue == null)
2447            this.dynamicValue = new ArrayList<PlanDefinitionActionDynamicValueComponent>();
2448          return this.dynamicValue;
2449        }
2450
2451        /**
2452         * @return Returns a reference to <code>this</code> for easy method chaining
2453         */
2454        public PlanDefinitionActionComponent setDynamicValue(List<PlanDefinitionActionDynamicValueComponent> theDynamicValue) { 
2455          this.dynamicValue = theDynamicValue;
2456          return this;
2457        }
2458
2459        public boolean hasDynamicValue() { 
2460          if (this.dynamicValue == null)
2461            return false;
2462          for (PlanDefinitionActionDynamicValueComponent item : this.dynamicValue)
2463            if (!item.isEmpty())
2464              return true;
2465          return false;
2466        }
2467
2468        public PlanDefinitionActionDynamicValueComponent addDynamicValue() { //3
2469          PlanDefinitionActionDynamicValueComponent t = new PlanDefinitionActionDynamicValueComponent();
2470          if (this.dynamicValue == null)
2471            this.dynamicValue = new ArrayList<PlanDefinitionActionDynamicValueComponent>();
2472          this.dynamicValue.add(t);
2473          return t;
2474        }
2475
2476        public PlanDefinitionActionComponent addDynamicValue(PlanDefinitionActionDynamicValueComponent t) { //3
2477          if (t == null)
2478            return this;
2479          if (this.dynamicValue == null)
2480            this.dynamicValue = new ArrayList<PlanDefinitionActionDynamicValueComponent>();
2481          this.dynamicValue.add(t);
2482          return this;
2483        }
2484
2485        /**
2486         * @return The first repetition of repeating field {@link #dynamicValue}, creating it if it does not already exist {3}
2487         */
2488        public PlanDefinitionActionDynamicValueComponent getDynamicValueFirstRep() { 
2489          if (getDynamicValue().isEmpty()) {
2490            addDynamicValue();
2491          }
2492          return getDynamicValue().get(0);
2493        }
2494
2495        /**
2496         * @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.)
2497         */
2498        public List<PlanDefinitionActionComponent> getAction() { 
2499          if (this.action == null)
2500            this.action = new ArrayList<PlanDefinitionActionComponent>();
2501          return this.action;
2502        }
2503
2504        /**
2505         * @return Returns a reference to <code>this</code> for easy method chaining
2506         */
2507        public PlanDefinitionActionComponent setAction(List<PlanDefinitionActionComponent> theAction) { 
2508          this.action = theAction;
2509          return this;
2510        }
2511
2512        public boolean hasAction() { 
2513          if (this.action == null)
2514            return false;
2515          for (PlanDefinitionActionComponent item : this.action)
2516            if (!item.isEmpty())
2517              return true;
2518          return false;
2519        }
2520
2521        public PlanDefinitionActionComponent addAction() { //3
2522          PlanDefinitionActionComponent t = new PlanDefinitionActionComponent();
2523          if (this.action == null)
2524            this.action = new ArrayList<PlanDefinitionActionComponent>();
2525          this.action.add(t);
2526          return t;
2527        }
2528
2529        public PlanDefinitionActionComponent addAction(PlanDefinitionActionComponent t) { //3
2530          if (t == null)
2531            return this;
2532          if (this.action == null)
2533            this.action = new ArrayList<PlanDefinitionActionComponent>();
2534          this.action.add(t);
2535          return this;
2536        }
2537
2538        /**
2539         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist {3}
2540         */
2541        public PlanDefinitionActionComponent getActionFirstRep() { 
2542          if (getAction().isEmpty()) {
2543            addAction();
2544          }
2545          return getAction().get(0);
2546        }
2547
2548        protected void listChildren(List<Property> children) {
2549          super.listChildren(children);
2550          children.add(new Property("prefix", "string", "A user-visible prefix for the action.", 0, 1, prefix));
2551          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));
2552          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));
2553          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));
2554          children.add(new Property("priority", "code", "Indicates how quickly the action should be addressed with respect to other actions.", 0, 1, priority));
2555          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, java.lang.Integer.MAX_VALUE, code));
2556          children.add(new Property("reason", "CodeableConcept", "A description of why this action is necessary or appropriate.", 0, java.lang.Integer.MAX_VALUE, reason));
2557          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));
2558          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));
2559          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));
2560          children.add(new Property("trigger", "TriggerDefinition", "A description of when the action should be triggered.", 0, java.lang.Integer.MAX_VALUE, trigger));
2561          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));
2562          children.add(new Property("input", "DataRequirement", "Defines input data requirements for the action.", 0, java.lang.Integer.MAX_VALUE, input));
2563          children.add(new Property("output", "DataRequirement", "Defines the outputs of the action, if any.", 0, java.lang.Integer.MAX_VALUE, output));
2564          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));
2565          children.add(new Property("timing[x]", "dateTime|Age|Period|Duration|Range|Timing", "An optional value describing when the action should be performed.", 0, 1, timing));
2566          children.add(new Property("participant", "", "Indicates who should participate in performing the action described.", 0, java.lang.Integer.MAX_VALUE, participant));
2567          children.add(new Property("type", "CodeableConcept", "The type of action to perform (create, update, remove).", 0, 1, type));
2568          children.add(new Property("groupingBehavior", "code", "Defines the grouping behavior for the action and its children.", 0, 1, groupingBehavior));
2569          children.add(new Property("selectionBehavior", "code", "Defines the selection behavior for the action and its children.", 0, 1, selectionBehavior));
2570          children.add(new Property("requiredBehavior", "code", "Defines the required behavior for the action.", 0, 1, requiredBehavior));
2571          children.add(new Property("precheckBehavior", "code", "Defines whether the action should usually be preselected.", 0, 1, precheckBehavior));
2572          children.add(new Property("cardinalityBehavior", "code", "Defines whether the action can be selected multiple times.", 0, 1, cardinalityBehavior));
2573          children.add(new Property("definition[x]", "canonical(ActivityDefinition|PlanDefinition|Questionnaire)|uri", "A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.", 0, 1, definition));
2574          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));
2575          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));
2576          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));
2577        }
2578
2579        @Override
2580        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2581          switch (_hash) {
2582          case -980110702: /*prefix*/  return new Property("prefix", "string", "A user-visible prefix for the action.", 0, 1, prefix);
2583          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);
2584          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);
2585          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);
2586          case -1165461084: /*priority*/  return new Property("priority", "code", "Indicates how quickly the action should be addressed with respect to other actions.", 0, 1, priority);
2587          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, java.lang.Integer.MAX_VALUE, code);
2588          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);
2589          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);
2590          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);
2591          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);
2592          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);
2593          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);
2594          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);
2595          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);
2596          case -1059891784: /*trigger*/  return new Property("trigger", "TriggerDefinition", "A description of when the action should be triggered.", 0, java.lang.Integer.MAX_VALUE, trigger);
2597          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);
2598          case 100358090: /*input*/  return new Property("input", "DataRequirement", "Defines input data requirements for the action.", 0, java.lang.Integer.MAX_VALUE, input);
2599          case -1005512447: /*output*/  return new Property("output", "DataRequirement", "Defines the outputs of the action, if any.", 0, java.lang.Integer.MAX_VALUE, output);
2600          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);
2601          case 164632566: /*timing[x]*/  return new Property("timing[x]", "dateTime|Age|Period|Duration|Range|Timing", "An optional value describing when the action should be performed.", 0, 1, timing);
2602          case -873664438: /*timing*/  return new Property("timing[x]", "dateTime|Age|Period|Duration|Range|Timing", "An optional value describing when the action should be performed.", 0, 1, timing);
2603          case -1837458939: /*timingDateTime*/  return new Property("timing[x]", "dateTime", "An optional value describing when the action should be performed.", 0, 1, timing);
2604          case 164607061: /*timingAge*/  return new Property("timing[x]", "Age", "An optional value describing when the action should be performed.", 0, 1, timing);
2605          case -615615829: /*timingPeriod*/  return new Property("timing[x]", "Period", "An optional value describing when the action should be performed.", 0, 1, timing);
2606          case -1327253506: /*timingDuration*/  return new Property("timing[x]", "Duration", "An optional value describing when the action should be performed.", 0, 1, timing);
2607          case -710871277: /*timingRange*/  return new Property("timing[x]", "Range", "An optional value describing when the action should be performed.", 0, 1, timing);
2608          case -497554124: /*timingTiming*/  return new Property("timing[x]", "Timing", "An optional value describing when the action should be performed.", 0, 1, timing);
2609          case 767422259: /*participant*/  return new Property("participant", "", "Indicates who should participate in performing the action described.", 0, java.lang.Integer.MAX_VALUE, participant);
2610          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The type of action to perform (create, update, remove).", 0, 1, type);
2611          case 586678389: /*groupingBehavior*/  return new Property("groupingBehavior", "code", "Defines the grouping behavior for the action and its children.", 0, 1, groupingBehavior);
2612          case 168639486: /*selectionBehavior*/  return new Property("selectionBehavior", "code", "Defines the selection behavior for the action and its children.", 0, 1, selectionBehavior);
2613          case -1163906287: /*requiredBehavior*/  return new Property("requiredBehavior", "code", "Defines the required behavior for the action.", 0, 1, requiredBehavior);
2614          case -1174249033: /*precheckBehavior*/  return new Property("precheckBehavior", "code", "Defines whether the action should usually be preselected.", 0, 1, precheckBehavior);
2615          case -922577408: /*cardinalityBehavior*/  return new Property("cardinalityBehavior", "code", "Defines whether the action can be selected multiple times.", 0, 1, cardinalityBehavior);
2616          case -1139422643: /*definition[x]*/  return new Property("definition[x]", "canonical(ActivityDefinition|PlanDefinition|Questionnaire)|uri", "A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.", 0, 1, definition);
2617          case -1014418093: /*definition*/  return new Property("definition[x]", "canonical(ActivityDefinition|PlanDefinition|Questionnaire)|uri", "A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.", 0, 1, definition);
2618          case 933485793: /*definitionCanonical*/  return new Property("definition[x]", "canonical(ActivityDefinition|PlanDefinition|Questionnaire)", "A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.", 0, 1, definition);
2619          case -1139428583: /*definitionUri*/  return new Property("definition[x]", "uri", "A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.", 0, 1, definition);
2620          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);
2621          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);
2622          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);
2623          default: return super.getNamedProperty(_hash, _name, _checkValid);
2624          }
2625
2626        }
2627
2628      @Override
2629      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2630        switch (hash) {
2631        case -980110702: /*prefix*/ return this.prefix == null ? new Base[0] : new Base[] {this.prefix}; // StringType
2632        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
2633        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
2634        case -900391049: /*textEquivalent*/ return this.textEquivalent == null ? new Base[0] : new Base[] {this.textEquivalent}; // StringType
2635        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration<RequestPriority>
2636        case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept
2637        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept
2638        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : this.documentation.toArray(new Base[this.documentation.size()]); // RelatedArtifact
2639        case -1240658034: /*goalId*/ return this.goalId == null ? new Base[0] : this.goalId.toArray(new Base[this.goalId.size()]); // IdType
2640        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // DataType
2641        case -1059891784: /*trigger*/ return this.trigger == null ? new Base[0] : this.trigger.toArray(new Base[this.trigger.size()]); // TriggerDefinition
2642        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // PlanDefinitionActionConditionComponent
2643        case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // DataRequirement
2644        case -1005512447: /*output*/ return this.output == null ? new Base[0] : this.output.toArray(new Base[this.output.size()]); // DataRequirement
2645        case -384107967: /*relatedAction*/ return this.relatedAction == null ? new Base[0] : this.relatedAction.toArray(new Base[this.relatedAction.size()]); // PlanDefinitionActionRelatedActionComponent
2646        case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // DataType
2647        case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // PlanDefinitionActionParticipantComponent
2648        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2649        case 586678389: /*groupingBehavior*/ return this.groupingBehavior == null ? new Base[0] : new Base[] {this.groupingBehavior}; // Enumeration<ActionGroupingBehavior>
2650        case 168639486: /*selectionBehavior*/ return this.selectionBehavior == null ? new Base[0] : new Base[] {this.selectionBehavior}; // Enumeration<ActionSelectionBehavior>
2651        case -1163906287: /*requiredBehavior*/ return this.requiredBehavior == null ? new Base[0] : new Base[] {this.requiredBehavior}; // Enumeration<ActionRequiredBehavior>
2652        case -1174249033: /*precheckBehavior*/ return this.precheckBehavior == null ? new Base[0] : new Base[] {this.precheckBehavior}; // Enumeration<ActionPrecheckBehavior>
2653        case -922577408: /*cardinalityBehavior*/ return this.cardinalityBehavior == null ? new Base[0] : new Base[] {this.cardinalityBehavior}; // Enumeration<ActionCardinalityBehavior>
2654        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // DataType
2655        case 1052666732: /*transform*/ return this.transform == null ? new Base[0] : new Base[] {this.transform}; // CanonicalType
2656        case 572625010: /*dynamicValue*/ return this.dynamicValue == null ? new Base[0] : this.dynamicValue.toArray(new Base[this.dynamicValue.size()]); // PlanDefinitionActionDynamicValueComponent
2657        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // PlanDefinitionActionComponent
2658        default: return super.getProperty(hash, name, checkValid);
2659        }
2660
2661      }
2662
2663      @Override
2664      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2665        switch (hash) {
2666        case -980110702: // prefix
2667          this.prefix = TypeConvertor.castToString(value); // StringType
2668          return value;
2669        case 110371416: // title
2670          this.title = TypeConvertor.castToString(value); // StringType
2671          return value;
2672        case -1724546052: // description
2673          this.description = TypeConvertor.castToString(value); // StringType
2674          return value;
2675        case -900391049: // textEquivalent
2676          this.textEquivalent = TypeConvertor.castToString(value); // StringType
2677          return value;
2678        case -1165461084: // priority
2679          value = new RequestPriorityEnumFactory().fromType(TypeConvertor.castToCode(value));
2680          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
2681          return value;
2682        case 3059181: // code
2683          this.getCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2684          return value;
2685        case -934964668: // reason
2686          this.getReason().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2687          return value;
2688        case 1587405498: // documentation
2689          this.getDocumentation().add(TypeConvertor.castToRelatedArtifact(value)); // RelatedArtifact
2690          return value;
2691        case -1240658034: // goalId
2692          this.getGoalId().add(TypeConvertor.castToId(value)); // IdType
2693          return value;
2694        case -1867885268: // subject
2695          this.subject = TypeConvertor.castToType(value); // DataType
2696          return value;
2697        case -1059891784: // trigger
2698          this.getTrigger().add(TypeConvertor.castToTriggerDefinition(value)); // TriggerDefinition
2699          return value;
2700        case -861311717: // condition
2701          this.getCondition().add((PlanDefinitionActionConditionComponent) value); // PlanDefinitionActionConditionComponent
2702          return value;
2703        case 100358090: // input
2704          this.getInput().add(TypeConvertor.castToDataRequirement(value)); // DataRequirement
2705          return value;
2706        case -1005512447: // output
2707          this.getOutput().add(TypeConvertor.castToDataRequirement(value)); // DataRequirement
2708          return value;
2709        case -384107967: // relatedAction
2710          this.getRelatedAction().add((PlanDefinitionActionRelatedActionComponent) value); // PlanDefinitionActionRelatedActionComponent
2711          return value;
2712        case -873664438: // timing
2713          this.timing = TypeConvertor.castToType(value); // DataType
2714          return value;
2715        case 767422259: // participant
2716          this.getParticipant().add((PlanDefinitionActionParticipantComponent) value); // PlanDefinitionActionParticipantComponent
2717          return value;
2718        case 3575610: // type
2719          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2720          return value;
2721        case 586678389: // groupingBehavior
2722          value = new ActionGroupingBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
2723          this.groupingBehavior = (Enumeration) value; // Enumeration<ActionGroupingBehavior>
2724          return value;
2725        case 168639486: // selectionBehavior
2726          value = new ActionSelectionBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
2727          this.selectionBehavior = (Enumeration) value; // Enumeration<ActionSelectionBehavior>
2728          return value;
2729        case -1163906287: // requiredBehavior
2730          value = new ActionRequiredBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
2731          this.requiredBehavior = (Enumeration) value; // Enumeration<ActionRequiredBehavior>
2732          return value;
2733        case -1174249033: // precheckBehavior
2734          value = new ActionPrecheckBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
2735          this.precheckBehavior = (Enumeration) value; // Enumeration<ActionPrecheckBehavior>
2736          return value;
2737        case -922577408: // cardinalityBehavior
2738          value = new ActionCardinalityBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
2739          this.cardinalityBehavior = (Enumeration) value; // Enumeration<ActionCardinalityBehavior>
2740          return value;
2741        case -1014418093: // definition
2742          this.definition = TypeConvertor.castToType(value); // DataType
2743          return value;
2744        case 1052666732: // transform
2745          this.transform = TypeConvertor.castToCanonical(value); // CanonicalType
2746          return value;
2747        case 572625010: // dynamicValue
2748          this.getDynamicValue().add((PlanDefinitionActionDynamicValueComponent) value); // PlanDefinitionActionDynamicValueComponent
2749          return value;
2750        case -1422950858: // action
2751          this.getAction().add((PlanDefinitionActionComponent) value); // PlanDefinitionActionComponent
2752          return value;
2753        default: return super.setProperty(hash, name, value);
2754        }
2755
2756      }
2757
2758      @Override
2759      public Base setProperty(String name, Base value) throws FHIRException {
2760        if (name.equals("prefix")) {
2761          this.prefix = TypeConvertor.castToString(value); // StringType
2762        } else if (name.equals("title")) {
2763          this.title = TypeConvertor.castToString(value); // StringType
2764        } else if (name.equals("description")) {
2765          this.description = TypeConvertor.castToString(value); // StringType
2766        } else if (name.equals("textEquivalent")) {
2767          this.textEquivalent = TypeConvertor.castToString(value); // StringType
2768        } else if (name.equals("priority")) {
2769          value = new RequestPriorityEnumFactory().fromType(TypeConvertor.castToCode(value));
2770          this.priority = (Enumeration) value; // Enumeration<RequestPriority>
2771        } else if (name.equals("code")) {
2772          this.getCode().add(TypeConvertor.castToCodeableConcept(value));
2773        } else if (name.equals("reason")) {
2774          this.getReason().add(TypeConvertor.castToCodeableConcept(value));
2775        } else if (name.equals("documentation")) {
2776          this.getDocumentation().add(TypeConvertor.castToRelatedArtifact(value));
2777        } else if (name.equals("goalId")) {
2778          this.getGoalId().add(TypeConvertor.castToId(value));
2779        } else if (name.equals("subject[x]")) {
2780          this.subject = TypeConvertor.castToType(value); // DataType
2781        } else if (name.equals("trigger")) {
2782          this.getTrigger().add(TypeConvertor.castToTriggerDefinition(value));
2783        } else if (name.equals("condition")) {
2784          this.getCondition().add((PlanDefinitionActionConditionComponent) value);
2785        } else if (name.equals("input")) {
2786          this.getInput().add(TypeConvertor.castToDataRequirement(value));
2787        } else if (name.equals("output")) {
2788          this.getOutput().add(TypeConvertor.castToDataRequirement(value));
2789        } else if (name.equals("relatedAction")) {
2790          this.getRelatedAction().add((PlanDefinitionActionRelatedActionComponent) value);
2791        } else if (name.equals("timing[x]")) {
2792          this.timing = TypeConvertor.castToType(value); // DataType
2793        } else if (name.equals("participant")) {
2794          this.getParticipant().add((PlanDefinitionActionParticipantComponent) value);
2795        } else if (name.equals("type")) {
2796          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2797        } else if (name.equals("groupingBehavior")) {
2798          value = new ActionGroupingBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
2799          this.groupingBehavior = (Enumeration) value; // Enumeration<ActionGroupingBehavior>
2800        } else if (name.equals("selectionBehavior")) {
2801          value = new ActionSelectionBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
2802          this.selectionBehavior = (Enumeration) value; // Enumeration<ActionSelectionBehavior>
2803        } else if (name.equals("requiredBehavior")) {
2804          value = new ActionRequiredBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
2805          this.requiredBehavior = (Enumeration) value; // Enumeration<ActionRequiredBehavior>
2806        } else if (name.equals("precheckBehavior")) {
2807          value = new ActionPrecheckBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
2808          this.precheckBehavior = (Enumeration) value; // Enumeration<ActionPrecheckBehavior>
2809        } else if (name.equals("cardinalityBehavior")) {
2810          value = new ActionCardinalityBehaviorEnumFactory().fromType(TypeConvertor.castToCode(value));
2811          this.cardinalityBehavior = (Enumeration) value; // Enumeration<ActionCardinalityBehavior>
2812        } else if (name.equals("definition[x]")) {
2813          this.definition = TypeConvertor.castToType(value); // DataType
2814        } else if (name.equals("transform")) {
2815          this.transform = TypeConvertor.castToCanonical(value); // CanonicalType
2816        } else if (name.equals("dynamicValue")) {
2817          this.getDynamicValue().add((PlanDefinitionActionDynamicValueComponent) value);
2818        } else if (name.equals("action")) {
2819          this.getAction().add((PlanDefinitionActionComponent) value);
2820        } else
2821          return super.setProperty(name, value);
2822        return value;
2823      }
2824
2825      @Override
2826      public Base makeProperty(int hash, String name) throws FHIRException {
2827        switch (hash) {
2828        case -980110702:  return getPrefixElement();
2829        case 110371416:  return getTitleElement();
2830        case -1724546052:  return getDescriptionElement();
2831        case -900391049:  return getTextEquivalentElement();
2832        case -1165461084:  return getPriorityElement();
2833        case 3059181:  return addCode(); 
2834        case -934964668:  return addReason(); 
2835        case 1587405498:  return addDocumentation(); 
2836        case -1240658034:  return addGoalIdElement();
2837        case -573640748:  return getSubject();
2838        case -1867885268:  return getSubject();
2839        case -1059891784:  return addTrigger(); 
2840        case -861311717:  return addCondition(); 
2841        case 100358090:  return addInput(); 
2842        case -1005512447:  return addOutput(); 
2843        case -384107967:  return addRelatedAction(); 
2844        case 164632566:  return getTiming();
2845        case -873664438:  return getTiming();
2846        case 767422259:  return addParticipant(); 
2847        case 3575610:  return getType();
2848        case 586678389:  return getGroupingBehaviorElement();
2849        case 168639486:  return getSelectionBehaviorElement();
2850        case -1163906287:  return getRequiredBehaviorElement();
2851        case -1174249033:  return getPrecheckBehaviorElement();
2852        case -922577408:  return getCardinalityBehaviorElement();
2853        case -1139422643:  return getDefinition();
2854        case -1014418093:  return getDefinition();
2855        case 1052666732:  return getTransformElement();
2856        case 572625010:  return addDynamicValue(); 
2857        case -1422950858:  return addAction(); 
2858        default: return super.makeProperty(hash, name);
2859        }
2860
2861      }
2862
2863      @Override
2864      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2865        switch (hash) {
2866        case -980110702: /*prefix*/ return new String[] {"string"};
2867        case 110371416: /*title*/ return new String[] {"string"};
2868        case -1724546052: /*description*/ return new String[] {"string"};
2869        case -900391049: /*textEquivalent*/ return new String[] {"string"};
2870        case -1165461084: /*priority*/ return new String[] {"code"};
2871        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2872        case -934964668: /*reason*/ return new String[] {"CodeableConcept"};
2873        case 1587405498: /*documentation*/ return new String[] {"RelatedArtifact"};
2874        case -1240658034: /*goalId*/ return new String[] {"id"};
2875        case -1867885268: /*subject*/ return new String[] {"CodeableConcept", "Reference", "canonical"};
2876        case -1059891784: /*trigger*/ return new String[] {"TriggerDefinition"};
2877        case -861311717: /*condition*/ return new String[] {};
2878        case 100358090: /*input*/ return new String[] {"DataRequirement"};
2879        case -1005512447: /*output*/ return new String[] {"DataRequirement"};
2880        case -384107967: /*relatedAction*/ return new String[] {};
2881        case -873664438: /*timing*/ return new String[] {"dateTime", "Age", "Period", "Duration", "Range", "Timing"};
2882        case 767422259: /*participant*/ return new String[] {};
2883        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2884        case 586678389: /*groupingBehavior*/ return new String[] {"code"};
2885        case 168639486: /*selectionBehavior*/ return new String[] {"code"};
2886        case -1163906287: /*requiredBehavior*/ return new String[] {"code"};
2887        case -1174249033: /*precheckBehavior*/ return new String[] {"code"};
2888        case -922577408: /*cardinalityBehavior*/ return new String[] {"code"};
2889        case -1014418093: /*definition*/ return new String[] {"canonical", "uri"};
2890        case 1052666732: /*transform*/ return new String[] {"canonical"};
2891        case 572625010: /*dynamicValue*/ return new String[] {};
2892        case -1422950858: /*action*/ return new String[] {"@PlanDefinition.action"};
2893        default: return super.getTypesForProperty(hash, name);
2894        }
2895
2896      }
2897
2898      @Override
2899      public Base addChild(String name) throws FHIRException {
2900        if (name.equals("prefix")) {
2901          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.prefix");
2902        }
2903        else if (name.equals("title")) {
2904          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.title");
2905        }
2906        else if (name.equals("description")) {
2907          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.description");
2908        }
2909        else if (name.equals("textEquivalent")) {
2910          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.textEquivalent");
2911        }
2912        else if (name.equals("priority")) {
2913          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.priority");
2914        }
2915        else if (name.equals("code")) {
2916          return addCode();
2917        }
2918        else if (name.equals("reason")) {
2919          return addReason();
2920        }
2921        else if (name.equals("documentation")) {
2922          return addDocumentation();
2923        }
2924        else if (name.equals("goalId")) {
2925          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.goalId");
2926        }
2927        else if (name.equals("subjectCodeableConcept")) {
2928          this.subject = new CodeableConcept();
2929          return this.subject;
2930        }
2931        else if (name.equals("subjectReference")) {
2932          this.subject = new Reference();
2933          return this.subject;
2934        }
2935        else if (name.equals("subjectCanonical")) {
2936          this.subject = new CanonicalType();
2937          return this.subject;
2938        }
2939        else if (name.equals("trigger")) {
2940          return addTrigger();
2941        }
2942        else if (name.equals("condition")) {
2943          return addCondition();
2944        }
2945        else if (name.equals("input")) {
2946          return addInput();
2947        }
2948        else if (name.equals("output")) {
2949          return addOutput();
2950        }
2951        else if (name.equals("relatedAction")) {
2952          return addRelatedAction();
2953        }
2954        else if (name.equals("timingDateTime")) {
2955          this.timing = new DateTimeType();
2956          return this.timing;
2957        }
2958        else if (name.equals("timingAge")) {
2959          this.timing = new Age();
2960          return this.timing;
2961        }
2962        else if (name.equals("timingPeriod")) {
2963          this.timing = new Period();
2964          return this.timing;
2965        }
2966        else if (name.equals("timingDuration")) {
2967          this.timing = new Duration();
2968          return this.timing;
2969        }
2970        else if (name.equals("timingRange")) {
2971          this.timing = new Range();
2972          return this.timing;
2973        }
2974        else if (name.equals("timingTiming")) {
2975          this.timing = new Timing();
2976          return this.timing;
2977        }
2978        else if (name.equals("participant")) {
2979          return addParticipant();
2980        }
2981        else if (name.equals("type")) {
2982          this.type = new CodeableConcept();
2983          return this.type;
2984        }
2985        else if (name.equals("groupingBehavior")) {
2986          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.groupingBehavior");
2987        }
2988        else if (name.equals("selectionBehavior")) {
2989          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.selectionBehavior");
2990        }
2991        else if (name.equals("requiredBehavior")) {
2992          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.requiredBehavior");
2993        }
2994        else if (name.equals("precheckBehavior")) {
2995          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.precheckBehavior");
2996        }
2997        else if (name.equals("cardinalityBehavior")) {
2998          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.cardinalityBehavior");
2999        }
3000        else if (name.equals("definitionCanonical")) {
3001          this.definition = new CanonicalType();
3002          return this.definition;
3003        }
3004        else if (name.equals("definitionUri")) {
3005          this.definition = new UriType();
3006          return this.definition;
3007        }
3008        else if (name.equals("transform")) {
3009          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.transform");
3010        }
3011        else if (name.equals("dynamicValue")) {
3012          return addDynamicValue();
3013        }
3014        else if (name.equals("action")) {
3015          return addAction();
3016        }
3017        else
3018          return super.addChild(name);
3019      }
3020
3021      public PlanDefinitionActionComponent copy() {
3022        PlanDefinitionActionComponent dst = new PlanDefinitionActionComponent();
3023        copyValues(dst);
3024        return dst;
3025      }
3026
3027      public void copyValues(PlanDefinitionActionComponent dst) {
3028        super.copyValues(dst);
3029        dst.prefix = prefix == null ? null : prefix.copy();
3030        dst.title = title == null ? null : title.copy();
3031        dst.description = description == null ? null : description.copy();
3032        dst.textEquivalent = textEquivalent == null ? null : textEquivalent.copy();
3033        dst.priority = priority == null ? null : priority.copy();
3034        if (code != null) {
3035          dst.code = new ArrayList<CodeableConcept>();
3036          for (CodeableConcept i : code)
3037            dst.code.add(i.copy());
3038        };
3039        if (reason != null) {
3040          dst.reason = new ArrayList<CodeableConcept>();
3041          for (CodeableConcept i : reason)
3042            dst.reason.add(i.copy());
3043        };
3044        if (documentation != null) {
3045          dst.documentation = new ArrayList<RelatedArtifact>();
3046          for (RelatedArtifact i : documentation)
3047            dst.documentation.add(i.copy());
3048        };
3049        if (goalId != null) {
3050          dst.goalId = new ArrayList<IdType>();
3051          for (IdType i : goalId)
3052            dst.goalId.add(i.copy());
3053        };
3054        dst.subject = subject == null ? null : subject.copy();
3055        if (trigger != null) {
3056          dst.trigger = new ArrayList<TriggerDefinition>();
3057          for (TriggerDefinition i : trigger)
3058            dst.trigger.add(i.copy());
3059        };
3060        if (condition != null) {
3061          dst.condition = new ArrayList<PlanDefinitionActionConditionComponent>();
3062          for (PlanDefinitionActionConditionComponent i : condition)
3063            dst.condition.add(i.copy());
3064        };
3065        if (input != null) {
3066          dst.input = new ArrayList<DataRequirement>();
3067          for (DataRequirement i : input)
3068            dst.input.add(i.copy());
3069        };
3070        if (output != null) {
3071          dst.output = new ArrayList<DataRequirement>();
3072          for (DataRequirement i : output)
3073            dst.output.add(i.copy());
3074        };
3075        if (relatedAction != null) {
3076          dst.relatedAction = new ArrayList<PlanDefinitionActionRelatedActionComponent>();
3077          for (PlanDefinitionActionRelatedActionComponent i : relatedAction)
3078            dst.relatedAction.add(i.copy());
3079        };
3080        dst.timing = timing == null ? null : timing.copy();
3081        if (participant != null) {
3082          dst.participant = new ArrayList<PlanDefinitionActionParticipantComponent>();
3083          for (PlanDefinitionActionParticipantComponent i : participant)
3084            dst.participant.add(i.copy());
3085        };
3086        dst.type = type == null ? null : type.copy();
3087        dst.groupingBehavior = groupingBehavior == null ? null : groupingBehavior.copy();
3088        dst.selectionBehavior = selectionBehavior == null ? null : selectionBehavior.copy();
3089        dst.requiredBehavior = requiredBehavior == null ? null : requiredBehavior.copy();
3090        dst.precheckBehavior = precheckBehavior == null ? null : precheckBehavior.copy();
3091        dst.cardinalityBehavior = cardinalityBehavior == null ? null : cardinalityBehavior.copy();
3092        dst.definition = definition == null ? null : definition.copy();
3093        dst.transform = transform == null ? null : transform.copy();
3094        if (dynamicValue != null) {
3095          dst.dynamicValue = new ArrayList<PlanDefinitionActionDynamicValueComponent>();
3096          for (PlanDefinitionActionDynamicValueComponent i : dynamicValue)
3097            dst.dynamicValue.add(i.copy());
3098        };
3099        if (action != null) {
3100          dst.action = new ArrayList<PlanDefinitionActionComponent>();
3101          for (PlanDefinitionActionComponent i : action)
3102            dst.action.add(i.copy());
3103        };
3104      }
3105
3106      @Override
3107      public boolean equalsDeep(Base other_) {
3108        if (!super.equalsDeep(other_))
3109          return false;
3110        if (!(other_ instanceof PlanDefinitionActionComponent))
3111          return false;
3112        PlanDefinitionActionComponent o = (PlanDefinitionActionComponent) other_;
3113        return compareDeep(prefix, o.prefix, true) && compareDeep(title, o.title, true) && compareDeep(description, o.description, true)
3114           && compareDeep(textEquivalent, o.textEquivalent, true) && compareDeep(priority, o.priority, true)
3115           && compareDeep(code, o.code, true) && compareDeep(reason, o.reason, true) && compareDeep(documentation, o.documentation, true)
3116           && compareDeep(goalId, o.goalId, true) && compareDeep(subject, o.subject, true) && compareDeep(trigger, o.trigger, true)
3117           && compareDeep(condition, o.condition, true) && compareDeep(input, o.input, true) && compareDeep(output, o.output, true)
3118           && compareDeep(relatedAction, o.relatedAction, true) && compareDeep(timing, o.timing, true) && compareDeep(participant, o.participant, true)
3119           && compareDeep(type, o.type, true) && compareDeep(groupingBehavior, o.groupingBehavior, true) && compareDeep(selectionBehavior, o.selectionBehavior, true)
3120           && compareDeep(requiredBehavior, o.requiredBehavior, true) && compareDeep(precheckBehavior, o.precheckBehavior, true)
3121           && compareDeep(cardinalityBehavior, o.cardinalityBehavior, true) && compareDeep(definition, o.definition, true)
3122           && compareDeep(transform, o.transform, true) && compareDeep(dynamicValue, o.dynamicValue, true)
3123           && compareDeep(action, o.action, true);
3124      }
3125
3126      @Override
3127      public boolean equalsShallow(Base other_) {
3128        if (!super.equalsShallow(other_))
3129          return false;
3130        if (!(other_ instanceof PlanDefinitionActionComponent))
3131          return false;
3132        PlanDefinitionActionComponent o = (PlanDefinitionActionComponent) other_;
3133        return compareValues(prefix, o.prefix, true) && compareValues(title, o.title, true) && compareValues(description, o.description, true)
3134           && compareValues(textEquivalent, o.textEquivalent, true) && compareValues(priority, o.priority, true)
3135           && compareValues(goalId, o.goalId, true) && compareValues(groupingBehavior, o.groupingBehavior, true)
3136           && compareValues(selectionBehavior, o.selectionBehavior, true) && compareValues(requiredBehavior, o.requiredBehavior, true)
3137           && compareValues(precheckBehavior, o.precheckBehavior, true) && compareValues(cardinalityBehavior, o.cardinalityBehavior, true)
3138           && compareValues(transform, o.transform, true);
3139      }
3140
3141      public boolean isEmpty() {
3142        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(prefix, title, description
3143          , textEquivalent, priority, code, reason, documentation, goalId, subject, trigger
3144          , condition, input, output, relatedAction, timing, participant, type, groupingBehavior
3145          , selectionBehavior, requiredBehavior, precheckBehavior, cardinalityBehavior, definition
3146          , transform, dynamicValue, action);
3147      }
3148
3149  public String fhirType() {
3150    return "PlanDefinition.action";
3151
3152  }
3153
3154  }
3155
3156    @Block()
3157    public static class PlanDefinitionActionConditionComponent extends BackboneElement implements IBaseBackboneElement {
3158        /**
3159         * The kind of condition.
3160         */
3161        @Child(name = "kind", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
3162        @Description(shortDefinition="applicability | start | stop", formalDefinition="The kind of condition." )
3163        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-condition-kind")
3164        protected Enumeration<ActionConditionKind> kind;
3165
3166        /**
3167         * An expression that returns true or false, indicating whether the condition is satisfied.
3168         */
3169        @Child(name = "expression", type = {Expression.class}, order=2, min=0, max=1, modifier=false, summary=false)
3170        @Description(shortDefinition="Boolean-valued expression", formalDefinition="An expression that returns true or false, indicating whether the condition is satisfied." )
3171        protected Expression expression;
3172
3173        private static final long serialVersionUID = -455150438L;
3174
3175    /**
3176     * Constructor
3177     */
3178      public PlanDefinitionActionConditionComponent() {
3179        super();
3180      }
3181
3182    /**
3183     * Constructor
3184     */
3185      public PlanDefinitionActionConditionComponent(ActionConditionKind kind) {
3186        super();
3187        this.setKind(kind);
3188      }
3189
3190        /**
3191         * @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
3192         */
3193        public Enumeration<ActionConditionKind> getKindElement() { 
3194          if (this.kind == null)
3195            if (Configuration.errorOnAutoCreate())
3196              throw new Error("Attempt to auto-create PlanDefinitionActionConditionComponent.kind");
3197            else if (Configuration.doAutoCreate())
3198              this.kind = new Enumeration<ActionConditionKind>(new ActionConditionKindEnumFactory()); // bb
3199          return this.kind;
3200        }
3201
3202        public boolean hasKindElement() { 
3203          return this.kind != null && !this.kind.isEmpty();
3204        }
3205
3206        public boolean hasKind() { 
3207          return this.kind != null && !this.kind.isEmpty();
3208        }
3209
3210        /**
3211         * @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
3212         */
3213        public PlanDefinitionActionConditionComponent setKindElement(Enumeration<ActionConditionKind> value) { 
3214          this.kind = value;
3215          return this;
3216        }
3217
3218        /**
3219         * @return The kind of condition.
3220         */
3221        public ActionConditionKind getKind() { 
3222          return this.kind == null ? null : this.kind.getValue();
3223        }
3224
3225        /**
3226         * @param value The kind of condition.
3227         */
3228        public PlanDefinitionActionConditionComponent setKind(ActionConditionKind value) { 
3229            if (this.kind == null)
3230              this.kind = new Enumeration<ActionConditionKind>(new ActionConditionKindEnumFactory());
3231            this.kind.setValue(value);
3232          return this;
3233        }
3234
3235        /**
3236         * @return {@link #expression} (An expression that returns true or false, indicating whether the condition is satisfied.)
3237         */
3238        public Expression getExpression() { 
3239          if (this.expression == null)
3240            if (Configuration.errorOnAutoCreate())
3241              throw new Error("Attempt to auto-create PlanDefinitionActionConditionComponent.expression");
3242            else if (Configuration.doAutoCreate())
3243              this.expression = new Expression(); // cc
3244          return this.expression;
3245        }
3246
3247        public boolean hasExpression() { 
3248          return this.expression != null && !this.expression.isEmpty();
3249        }
3250
3251        /**
3252         * @param value {@link #expression} (An expression that returns true or false, indicating whether the condition is satisfied.)
3253         */
3254        public PlanDefinitionActionConditionComponent setExpression(Expression value) { 
3255          this.expression = value;
3256          return this;
3257        }
3258
3259        protected void listChildren(List<Property> children) {
3260          super.listChildren(children);
3261          children.add(new Property("kind", "code", "The kind of condition.", 0, 1, kind));
3262          children.add(new Property("expression", "Expression", "An expression that returns true or false, indicating whether the condition is satisfied.", 0, 1, expression));
3263        }
3264
3265        @Override
3266        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3267          switch (_hash) {
3268          case 3292052: /*kind*/  return new Property("kind", "code", "The kind of condition.", 0, 1, kind);
3269          case -1795452264: /*expression*/  return new Property("expression", "Expression", "An expression that returns true or false, indicating whether the condition is satisfied.", 0, 1, expression);
3270          default: return super.getNamedProperty(_hash, _name, _checkValid);
3271          }
3272
3273        }
3274
3275      @Override
3276      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3277        switch (hash) {
3278        case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration<ActionConditionKind>
3279        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // Expression
3280        default: return super.getProperty(hash, name, checkValid);
3281        }
3282
3283      }
3284
3285      @Override
3286      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3287        switch (hash) {
3288        case 3292052: // kind
3289          value = new ActionConditionKindEnumFactory().fromType(TypeConvertor.castToCode(value));
3290          this.kind = (Enumeration) value; // Enumeration<ActionConditionKind>
3291          return value;
3292        case -1795452264: // expression
3293          this.expression = TypeConvertor.castToExpression(value); // Expression
3294          return value;
3295        default: return super.setProperty(hash, name, value);
3296        }
3297
3298      }
3299
3300      @Override
3301      public Base setProperty(String name, Base value) throws FHIRException {
3302        if (name.equals("kind")) {
3303          value = new ActionConditionKindEnumFactory().fromType(TypeConvertor.castToCode(value));
3304          this.kind = (Enumeration) value; // Enumeration<ActionConditionKind>
3305        } else if (name.equals("expression")) {
3306          this.expression = TypeConvertor.castToExpression(value); // Expression
3307        } else
3308          return super.setProperty(name, value);
3309        return value;
3310      }
3311
3312      @Override
3313      public Base makeProperty(int hash, String name) throws FHIRException {
3314        switch (hash) {
3315        case 3292052:  return getKindElement();
3316        case -1795452264:  return getExpression();
3317        default: return super.makeProperty(hash, name);
3318        }
3319
3320      }
3321
3322      @Override
3323      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3324        switch (hash) {
3325        case 3292052: /*kind*/ return new String[] {"code"};
3326        case -1795452264: /*expression*/ return new String[] {"Expression"};
3327        default: return super.getTypesForProperty(hash, name);
3328        }
3329
3330      }
3331
3332      @Override
3333      public Base addChild(String name) throws FHIRException {
3334        if (name.equals("kind")) {
3335          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.condition.kind");
3336        }
3337        else if (name.equals("expression")) {
3338          this.expression = new Expression();
3339          return this.expression;
3340        }
3341        else
3342          return super.addChild(name);
3343      }
3344
3345      public PlanDefinitionActionConditionComponent copy() {
3346        PlanDefinitionActionConditionComponent dst = new PlanDefinitionActionConditionComponent();
3347        copyValues(dst);
3348        return dst;
3349      }
3350
3351      public void copyValues(PlanDefinitionActionConditionComponent dst) {
3352        super.copyValues(dst);
3353        dst.kind = kind == null ? null : kind.copy();
3354        dst.expression = expression == null ? null : expression.copy();
3355      }
3356
3357      @Override
3358      public boolean equalsDeep(Base other_) {
3359        if (!super.equalsDeep(other_))
3360          return false;
3361        if (!(other_ instanceof PlanDefinitionActionConditionComponent))
3362          return false;
3363        PlanDefinitionActionConditionComponent o = (PlanDefinitionActionConditionComponent) other_;
3364        return compareDeep(kind, o.kind, true) && compareDeep(expression, o.expression, true);
3365      }
3366
3367      @Override
3368      public boolean equalsShallow(Base other_) {
3369        if (!super.equalsShallow(other_))
3370          return false;
3371        if (!(other_ instanceof PlanDefinitionActionConditionComponent))
3372          return false;
3373        PlanDefinitionActionConditionComponent o = (PlanDefinitionActionConditionComponent) other_;
3374        return compareValues(kind, o.kind, true);
3375      }
3376
3377      public boolean isEmpty() {
3378        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(kind, expression);
3379      }
3380
3381  public String fhirType() {
3382    return "PlanDefinition.action.condition";
3383
3384  }
3385
3386  }
3387
3388    @Block()
3389    public static class PlanDefinitionActionRelatedActionComponent extends BackboneElement implements IBaseBackboneElement {
3390        /**
3391         * The element id of the related action.
3392         */
3393        @Child(name = "actionId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false)
3394        @Description(shortDefinition="What action is this related to", formalDefinition="The element id of the related action." )
3395        protected IdType actionId;
3396
3397        /**
3398         * The relationship of this action to the related action.
3399         */
3400        @Child(name = "relationship", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false)
3401        @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." )
3402        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-relationship-type")
3403        protected Enumeration<ActionRelationshipType> relationship;
3404
3405        /**
3406         * A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.
3407         */
3408        @Child(name = "offset", type = {Duration.class, Range.class}, order=3, min=0, max=1, modifier=false, summary=false)
3409        @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." )
3410        protected DataType offset;
3411
3412        private static final long serialVersionUID = 621784796L;
3413
3414    /**
3415     * Constructor
3416     */
3417      public PlanDefinitionActionRelatedActionComponent() {
3418        super();
3419      }
3420
3421    /**
3422     * Constructor
3423     */
3424      public PlanDefinitionActionRelatedActionComponent(String actionId, ActionRelationshipType relationship) {
3425        super();
3426        this.setActionId(actionId);
3427        this.setRelationship(relationship);
3428      }
3429
3430        /**
3431         * @return {@link #actionId} (The element id of the related action.). This is the underlying object with id, value and extensions. The accessor "getActionId" gives direct access to the value
3432         */
3433        public IdType getActionIdElement() { 
3434          if (this.actionId == null)
3435            if (Configuration.errorOnAutoCreate())
3436              throw new Error("Attempt to auto-create PlanDefinitionActionRelatedActionComponent.actionId");
3437            else if (Configuration.doAutoCreate())
3438              this.actionId = new IdType(); // bb
3439          return this.actionId;
3440        }
3441
3442        public boolean hasActionIdElement() { 
3443          return this.actionId != null && !this.actionId.isEmpty();
3444        }
3445
3446        public boolean hasActionId() { 
3447          return this.actionId != null && !this.actionId.isEmpty();
3448        }
3449
3450        /**
3451         * @param value {@link #actionId} (The element id of the related action.). This is the underlying object with id, value and extensions. The accessor "getActionId" gives direct access to the value
3452         */
3453        public PlanDefinitionActionRelatedActionComponent setActionIdElement(IdType value) { 
3454          this.actionId = value;
3455          return this;
3456        }
3457
3458        /**
3459         * @return The element id of the related action.
3460         */
3461        public String getActionId() { 
3462          return this.actionId == null ? null : this.actionId.getValue();
3463        }
3464
3465        /**
3466         * @param value The element id of the related action.
3467         */
3468        public PlanDefinitionActionRelatedActionComponent setActionId(String value) { 
3469            if (this.actionId == null)
3470              this.actionId = new IdType();
3471            this.actionId.setValue(value);
3472          return this;
3473        }
3474
3475        /**
3476         * @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
3477         */
3478        public Enumeration<ActionRelationshipType> getRelationshipElement() { 
3479          if (this.relationship == null)
3480            if (Configuration.errorOnAutoCreate())
3481              throw new Error("Attempt to auto-create PlanDefinitionActionRelatedActionComponent.relationship");
3482            else if (Configuration.doAutoCreate())
3483              this.relationship = new Enumeration<ActionRelationshipType>(new ActionRelationshipTypeEnumFactory()); // bb
3484          return this.relationship;
3485        }
3486
3487        public boolean hasRelationshipElement() { 
3488          return this.relationship != null && !this.relationship.isEmpty();
3489        }
3490
3491        public boolean hasRelationship() { 
3492          return this.relationship != null && !this.relationship.isEmpty();
3493        }
3494
3495        /**
3496         * @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
3497         */
3498        public PlanDefinitionActionRelatedActionComponent setRelationshipElement(Enumeration<ActionRelationshipType> value) { 
3499          this.relationship = value;
3500          return this;
3501        }
3502
3503        /**
3504         * @return The relationship of this action to the related action.
3505         */
3506        public ActionRelationshipType getRelationship() { 
3507          return this.relationship == null ? null : this.relationship.getValue();
3508        }
3509
3510        /**
3511         * @param value The relationship of this action to the related action.
3512         */
3513        public PlanDefinitionActionRelatedActionComponent setRelationship(ActionRelationshipType value) { 
3514            if (this.relationship == null)
3515              this.relationship = new Enumeration<ActionRelationshipType>(new ActionRelationshipTypeEnumFactory());
3516            this.relationship.setValue(value);
3517          return this;
3518        }
3519
3520        /**
3521         * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.)
3522         */
3523        public DataType getOffset() { 
3524          return this.offset;
3525        }
3526
3527        /**
3528         * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.)
3529         */
3530        public Duration getOffsetDuration() throws FHIRException { 
3531          if (this.offset == null)
3532            this.offset = new Duration();
3533          if (!(this.offset instanceof Duration))
3534            throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.offset.getClass().getName()+" was encountered");
3535          return (Duration) this.offset;
3536        }
3537
3538        public boolean hasOffsetDuration() { 
3539          return this != null && this.offset instanceof Duration;
3540        }
3541
3542        /**
3543         * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.)
3544         */
3545        public Range getOffsetRange() throws FHIRException { 
3546          if (this.offset == null)
3547            this.offset = new Range();
3548          if (!(this.offset instanceof Range))
3549            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.offset.getClass().getName()+" was encountered");
3550          return (Range) this.offset;
3551        }
3552
3553        public boolean hasOffsetRange() { 
3554          return this != null && this.offset instanceof Range;
3555        }
3556
3557        public boolean hasOffset() { 
3558          return this.offset != null && !this.offset.isEmpty();
3559        }
3560
3561        /**
3562         * @param value {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.)
3563         */
3564        public PlanDefinitionActionRelatedActionComponent setOffset(DataType value) { 
3565          if (value != null && !(value instanceof Duration || value instanceof Range))
3566            throw new Error("Not the right type for PlanDefinition.action.relatedAction.offset[x]: "+value.fhirType());
3567          this.offset = value;
3568          return this;
3569        }
3570
3571        protected void listChildren(List<Property> children) {
3572          super.listChildren(children);
3573          children.add(new Property("actionId", "id", "The element id of the related action.", 0, 1, actionId));
3574          children.add(new Property("relationship", "code", "The relationship of this action to the related action.", 0, 1, relationship));
3575          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));
3576        }
3577
3578        @Override
3579        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3580          switch (_hash) {
3581          case -1656172047: /*actionId*/  return new Property("actionId", "id", "The element id of the related action.", 0, 1, actionId);
3582          case -261851592: /*relationship*/  return new Property("relationship", "code", "The relationship of this action to the related action.", 0, 1, relationship);
3583          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);
3584          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);
3585          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);
3586          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);
3587          default: return super.getNamedProperty(_hash, _name, _checkValid);
3588          }
3589
3590        }
3591
3592      @Override
3593      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3594        switch (hash) {
3595        case -1656172047: /*actionId*/ return this.actionId == null ? new Base[0] : new Base[] {this.actionId}; // IdType
3596        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Enumeration<ActionRelationshipType>
3597        case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // DataType
3598        default: return super.getProperty(hash, name, checkValid);
3599        }
3600
3601      }
3602
3603      @Override
3604      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3605        switch (hash) {
3606        case -1656172047: // actionId
3607          this.actionId = TypeConvertor.castToId(value); // IdType
3608          return value;
3609        case -261851592: // relationship
3610          value = new ActionRelationshipTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
3611          this.relationship = (Enumeration) value; // Enumeration<ActionRelationshipType>
3612          return value;
3613        case -1019779949: // offset
3614          this.offset = TypeConvertor.castToType(value); // DataType
3615          return value;
3616        default: return super.setProperty(hash, name, value);
3617        }
3618
3619      }
3620
3621      @Override
3622      public Base setProperty(String name, Base value) throws FHIRException {
3623        if (name.equals("actionId")) {
3624          this.actionId = TypeConvertor.castToId(value); // IdType
3625        } else if (name.equals("relationship")) {
3626          value = new ActionRelationshipTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
3627          this.relationship = (Enumeration) value; // Enumeration<ActionRelationshipType>
3628        } else if (name.equals("offset[x]")) {
3629          this.offset = TypeConvertor.castToType(value); // DataType
3630        } else
3631          return super.setProperty(name, value);
3632        return value;
3633      }
3634
3635      @Override
3636      public Base makeProperty(int hash, String name) throws FHIRException {
3637        switch (hash) {
3638        case -1656172047:  return getActionIdElement();
3639        case -261851592:  return getRelationshipElement();
3640        case -1960684787:  return getOffset();
3641        case -1019779949:  return getOffset();
3642        default: return super.makeProperty(hash, name);
3643        }
3644
3645      }
3646
3647      @Override
3648      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3649        switch (hash) {
3650        case -1656172047: /*actionId*/ return new String[] {"id"};
3651        case -261851592: /*relationship*/ return new String[] {"code"};
3652        case -1019779949: /*offset*/ return new String[] {"Duration", "Range"};
3653        default: return super.getTypesForProperty(hash, name);
3654        }
3655
3656      }
3657
3658      @Override
3659      public Base addChild(String name) throws FHIRException {
3660        if (name.equals("actionId")) {
3661          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.relatedAction.actionId");
3662        }
3663        else if (name.equals("relationship")) {
3664          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.relatedAction.relationship");
3665        }
3666        else if (name.equals("offsetDuration")) {
3667          this.offset = new Duration();
3668          return this.offset;
3669        }
3670        else if (name.equals("offsetRange")) {
3671          this.offset = new Range();
3672          return this.offset;
3673        }
3674        else
3675          return super.addChild(name);
3676      }
3677
3678      public PlanDefinitionActionRelatedActionComponent copy() {
3679        PlanDefinitionActionRelatedActionComponent dst = new PlanDefinitionActionRelatedActionComponent();
3680        copyValues(dst);
3681        return dst;
3682      }
3683
3684      public void copyValues(PlanDefinitionActionRelatedActionComponent dst) {
3685        super.copyValues(dst);
3686        dst.actionId = actionId == null ? null : actionId.copy();
3687        dst.relationship = relationship == null ? null : relationship.copy();
3688        dst.offset = offset == null ? null : offset.copy();
3689      }
3690
3691      @Override
3692      public boolean equalsDeep(Base other_) {
3693        if (!super.equalsDeep(other_))
3694          return false;
3695        if (!(other_ instanceof PlanDefinitionActionRelatedActionComponent))
3696          return false;
3697        PlanDefinitionActionRelatedActionComponent o = (PlanDefinitionActionRelatedActionComponent) other_;
3698        return compareDeep(actionId, o.actionId, true) && compareDeep(relationship, o.relationship, true)
3699           && compareDeep(offset, o.offset, true);
3700      }
3701
3702      @Override
3703      public boolean equalsShallow(Base other_) {
3704        if (!super.equalsShallow(other_))
3705          return false;
3706        if (!(other_ instanceof PlanDefinitionActionRelatedActionComponent))
3707          return false;
3708        PlanDefinitionActionRelatedActionComponent o = (PlanDefinitionActionRelatedActionComponent) other_;
3709        return compareValues(actionId, o.actionId, true) && compareValues(relationship, o.relationship, true)
3710          ;
3711      }
3712
3713      public boolean isEmpty() {
3714        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(actionId, relationship, offset
3715          );
3716      }
3717
3718  public String fhirType() {
3719    return "PlanDefinition.action.relatedAction";
3720
3721  }
3722
3723  }
3724
3725    @Block()
3726    public static class PlanDefinitionActionParticipantComponent extends BackboneElement implements IBaseBackboneElement {
3727        /**
3728         * The type of participant in the action.
3729         */
3730        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
3731        @Description(shortDefinition="patient | practitioner | related-person | device", formalDefinition="The type of participant in the action." )
3732        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/action-participant-type")
3733        protected Enumeration<ActionParticipantType> type;
3734
3735        /**
3736         * The role the participant should play in performing the described action.
3737         */
3738        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
3739        @Description(shortDefinition="E.g. Nurse, Surgeon, Parent", formalDefinition="The role the participant should play in performing the described action." )
3740        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/action-participant-role")
3741        protected CodeableConcept role;
3742
3743        private static final long serialVersionUID = -1152013659L;
3744
3745    /**
3746     * Constructor
3747     */
3748      public PlanDefinitionActionParticipantComponent() {
3749        super();
3750      }
3751
3752    /**
3753     * Constructor
3754     */
3755      public PlanDefinitionActionParticipantComponent(ActionParticipantType type) {
3756        super();
3757        this.setType(type);
3758      }
3759
3760        /**
3761         * @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
3762         */
3763        public Enumeration<ActionParticipantType> getTypeElement() { 
3764          if (this.type == null)
3765            if (Configuration.errorOnAutoCreate())
3766              throw new Error("Attempt to auto-create PlanDefinitionActionParticipantComponent.type");
3767            else if (Configuration.doAutoCreate())
3768              this.type = new Enumeration<ActionParticipantType>(new ActionParticipantTypeEnumFactory()); // bb
3769          return this.type;
3770        }
3771
3772        public boolean hasTypeElement() { 
3773          return this.type != null && !this.type.isEmpty();
3774        }
3775
3776        public boolean hasType() { 
3777          return this.type != null && !this.type.isEmpty();
3778        }
3779
3780        /**
3781         * @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
3782         */
3783        public PlanDefinitionActionParticipantComponent setTypeElement(Enumeration<ActionParticipantType> value) { 
3784          this.type = value;
3785          return this;
3786        }
3787
3788        /**
3789         * @return The type of participant in the action.
3790         */
3791        public ActionParticipantType getType() { 
3792          return this.type == null ? null : this.type.getValue();
3793        }
3794
3795        /**
3796         * @param value The type of participant in the action.
3797         */
3798        public PlanDefinitionActionParticipantComponent setType(ActionParticipantType value) { 
3799            if (this.type == null)
3800              this.type = new Enumeration<ActionParticipantType>(new ActionParticipantTypeEnumFactory());
3801            this.type.setValue(value);
3802          return this;
3803        }
3804
3805        /**
3806         * @return {@link #role} (The role the participant should play in performing the described action.)
3807         */
3808        public CodeableConcept getRole() { 
3809          if (this.role == null)
3810            if (Configuration.errorOnAutoCreate())
3811              throw new Error("Attempt to auto-create PlanDefinitionActionParticipantComponent.role");
3812            else if (Configuration.doAutoCreate())
3813              this.role = new CodeableConcept(); // cc
3814          return this.role;
3815        }
3816
3817        public boolean hasRole() { 
3818          return this.role != null && !this.role.isEmpty();
3819        }
3820
3821        /**
3822         * @param value {@link #role} (The role the participant should play in performing the described action.)
3823         */
3824        public PlanDefinitionActionParticipantComponent setRole(CodeableConcept value) { 
3825          this.role = value;
3826          return this;
3827        }
3828
3829        protected void listChildren(List<Property> children) {
3830          super.listChildren(children);
3831          children.add(new Property("type", "code", "The type of participant in the action.", 0, 1, type));
3832          children.add(new Property("role", "CodeableConcept", "The role the participant should play in performing the described action.", 0, 1, role));
3833        }
3834
3835        @Override
3836        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3837          switch (_hash) {
3838          case 3575610: /*type*/  return new Property("type", "code", "The type of participant in the action.", 0, 1, type);
3839          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "The role the participant should play in performing the described action.", 0, 1, role);
3840          default: return super.getNamedProperty(_hash, _name, _checkValid);
3841          }
3842
3843        }
3844
3845      @Override
3846      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3847        switch (hash) {
3848        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<ActionParticipantType>
3849        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
3850        default: return super.getProperty(hash, name, checkValid);
3851        }
3852
3853      }
3854
3855      @Override
3856      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3857        switch (hash) {
3858        case 3575610: // type
3859          value = new ActionParticipantTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
3860          this.type = (Enumeration) value; // Enumeration<ActionParticipantType>
3861          return value;
3862        case 3506294: // role
3863          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3864          return value;
3865        default: return super.setProperty(hash, name, value);
3866        }
3867
3868      }
3869
3870      @Override
3871      public Base setProperty(String name, Base value) throws FHIRException {
3872        if (name.equals("type")) {
3873          value = new ActionParticipantTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
3874          this.type = (Enumeration) value; // Enumeration<ActionParticipantType>
3875        } else if (name.equals("role")) {
3876          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3877        } else
3878          return super.setProperty(name, value);
3879        return value;
3880      }
3881
3882      @Override
3883      public Base makeProperty(int hash, String name) throws FHIRException {
3884        switch (hash) {
3885        case 3575610:  return getTypeElement();
3886        case 3506294:  return getRole();
3887        default: return super.makeProperty(hash, name);
3888        }
3889
3890      }
3891
3892      @Override
3893      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3894        switch (hash) {
3895        case 3575610: /*type*/ return new String[] {"code"};
3896        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
3897        default: return super.getTypesForProperty(hash, name);
3898        }
3899
3900      }
3901
3902      @Override
3903      public Base addChild(String name) throws FHIRException {
3904        if (name.equals("type")) {
3905          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.participant.type");
3906        }
3907        else if (name.equals("role")) {
3908          this.role = new CodeableConcept();
3909          return this.role;
3910        }
3911        else
3912          return super.addChild(name);
3913      }
3914
3915      public PlanDefinitionActionParticipantComponent copy() {
3916        PlanDefinitionActionParticipantComponent dst = new PlanDefinitionActionParticipantComponent();
3917        copyValues(dst);
3918        return dst;
3919      }
3920
3921      public void copyValues(PlanDefinitionActionParticipantComponent dst) {
3922        super.copyValues(dst);
3923        dst.type = type == null ? null : type.copy();
3924        dst.role = role == null ? null : role.copy();
3925      }
3926
3927      @Override
3928      public boolean equalsDeep(Base other_) {
3929        if (!super.equalsDeep(other_))
3930          return false;
3931        if (!(other_ instanceof PlanDefinitionActionParticipantComponent))
3932          return false;
3933        PlanDefinitionActionParticipantComponent o = (PlanDefinitionActionParticipantComponent) other_;
3934        return compareDeep(type, o.type, true) && compareDeep(role, o.role, true);
3935      }
3936
3937      @Override
3938      public boolean equalsShallow(Base other_) {
3939        if (!super.equalsShallow(other_))
3940          return false;
3941        if (!(other_ instanceof PlanDefinitionActionParticipantComponent))
3942          return false;
3943        PlanDefinitionActionParticipantComponent o = (PlanDefinitionActionParticipantComponent) other_;
3944        return compareValues(type, o.type, true);
3945      }
3946
3947      public boolean isEmpty() {
3948        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, role);
3949      }
3950
3951  public String fhirType() {
3952    return "PlanDefinition.action.participant";
3953
3954  }
3955
3956  }
3957
3958    @Block()
3959    public static class PlanDefinitionActionDynamicValueComponent extends BackboneElement implements IBaseBackboneElement {
3960        /**
3961         * 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).
3962         */
3963        @Child(name = "path", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
3964        @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)." )
3965        protected StringType path;
3966
3967        /**
3968         * An expression specifying the value of the customized element.
3969         */
3970        @Child(name = "expression", type = {Expression.class}, order=2, min=0, max=1, modifier=false, summary=false)
3971        @Description(shortDefinition="An expression that provides the dynamic value for the customization", formalDefinition="An expression specifying the value of the customized element." )
3972        protected Expression expression;
3973
3974        private static final long serialVersionUID = 1064529082L;
3975
3976    /**
3977     * Constructor
3978     */
3979      public PlanDefinitionActionDynamicValueComponent() {
3980        super();
3981      }
3982
3983        /**
3984         * @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
3985         */
3986        public StringType getPathElement() { 
3987          if (this.path == null)
3988            if (Configuration.errorOnAutoCreate())
3989              throw new Error("Attempt to auto-create PlanDefinitionActionDynamicValueComponent.path");
3990            else if (Configuration.doAutoCreate())
3991              this.path = new StringType(); // bb
3992          return this.path;
3993        }
3994
3995        public boolean hasPathElement() { 
3996          return this.path != null && !this.path.isEmpty();
3997        }
3998
3999        public boolean hasPath() { 
4000          return this.path != null && !this.path.isEmpty();
4001        }
4002
4003        /**
4004         * @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
4005         */
4006        public PlanDefinitionActionDynamicValueComponent setPathElement(StringType value) { 
4007          this.path = value;
4008          return this;
4009        }
4010
4011        /**
4012         * @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).
4013         */
4014        public String getPath() { 
4015          return this.path == null ? null : this.path.getValue();
4016        }
4017
4018        /**
4019         * @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).
4020         */
4021        public PlanDefinitionActionDynamicValueComponent setPath(String value) { 
4022          if (Utilities.noString(value))
4023            this.path = null;
4024          else {
4025            if (this.path == null)
4026              this.path = new StringType();
4027            this.path.setValue(value);
4028          }
4029          return this;
4030        }
4031
4032        /**
4033         * @return {@link #expression} (An expression specifying the value of the customized element.)
4034         */
4035        public Expression getExpression() { 
4036          if (this.expression == null)
4037            if (Configuration.errorOnAutoCreate())
4038              throw new Error("Attempt to auto-create PlanDefinitionActionDynamicValueComponent.expression");
4039            else if (Configuration.doAutoCreate())
4040              this.expression = new Expression(); // cc
4041          return this.expression;
4042        }
4043
4044        public boolean hasExpression() { 
4045          return this.expression != null && !this.expression.isEmpty();
4046        }
4047
4048        /**
4049         * @param value {@link #expression} (An expression specifying the value of the customized element.)
4050         */
4051        public PlanDefinitionActionDynamicValueComponent setExpression(Expression value) { 
4052          this.expression = value;
4053          return this;
4054        }
4055
4056        protected void listChildren(List<Property> children) {
4057          super.listChildren(children);
4058          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));
4059          children.add(new Property("expression", "Expression", "An expression specifying the value of the customized element.", 0, 1, expression));
4060        }
4061
4062        @Override
4063        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4064          switch (_hash) {
4065          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);
4066          case -1795452264: /*expression*/  return new Property("expression", "Expression", "An expression specifying the value of the customized element.", 0, 1, expression);
4067          default: return super.getNamedProperty(_hash, _name, _checkValid);
4068          }
4069
4070        }
4071
4072      @Override
4073      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4074        switch (hash) {
4075        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
4076        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // Expression
4077        default: return super.getProperty(hash, name, checkValid);
4078        }
4079
4080      }
4081
4082      @Override
4083      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4084        switch (hash) {
4085        case 3433509: // path
4086          this.path = TypeConvertor.castToString(value); // StringType
4087          return value;
4088        case -1795452264: // expression
4089          this.expression = TypeConvertor.castToExpression(value); // Expression
4090          return value;
4091        default: return super.setProperty(hash, name, value);
4092        }
4093
4094      }
4095
4096      @Override
4097      public Base setProperty(String name, Base value) throws FHIRException {
4098        if (name.equals("path")) {
4099          this.path = TypeConvertor.castToString(value); // StringType
4100        } else if (name.equals("expression")) {
4101          this.expression = TypeConvertor.castToExpression(value); // Expression
4102        } else
4103          return super.setProperty(name, value);
4104        return value;
4105      }
4106
4107      @Override
4108      public Base makeProperty(int hash, String name) throws FHIRException {
4109        switch (hash) {
4110        case 3433509:  return getPathElement();
4111        case -1795452264:  return getExpression();
4112        default: return super.makeProperty(hash, name);
4113        }
4114
4115      }
4116
4117      @Override
4118      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4119        switch (hash) {
4120        case 3433509: /*path*/ return new String[] {"string"};
4121        case -1795452264: /*expression*/ return new String[] {"Expression"};
4122        default: return super.getTypesForProperty(hash, name);
4123        }
4124
4125      }
4126
4127      @Override
4128      public Base addChild(String name) throws FHIRException {
4129        if (name.equals("path")) {
4130          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.action.dynamicValue.path");
4131        }
4132        else if (name.equals("expression")) {
4133          this.expression = new Expression();
4134          return this.expression;
4135        }
4136        else
4137          return super.addChild(name);
4138      }
4139
4140      public PlanDefinitionActionDynamicValueComponent copy() {
4141        PlanDefinitionActionDynamicValueComponent dst = new PlanDefinitionActionDynamicValueComponent();
4142        copyValues(dst);
4143        return dst;
4144      }
4145
4146      public void copyValues(PlanDefinitionActionDynamicValueComponent dst) {
4147        super.copyValues(dst);
4148        dst.path = path == null ? null : path.copy();
4149        dst.expression = expression == null ? null : expression.copy();
4150      }
4151
4152      @Override
4153      public boolean equalsDeep(Base other_) {
4154        if (!super.equalsDeep(other_))
4155          return false;
4156        if (!(other_ instanceof PlanDefinitionActionDynamicValueComponent))
4157          return false;
4158        PlanDefinitionActionDynamicValueComponent o = (PlanDefinitionActionDynamicValueComponent) other_;
4159        return compareDeep(path, o.path, true) && compareDeep(expression, o.expression, true);
4160      }
4161
4162      @Override
4163      public boolean equalsShallow(Base other_) {
4164        if (!super.equalsShallow(other_))
4165          return false;
4166        if (!(other_ instanceof PlanDefinitionActionDynamicValueComponent))
4167          return false;
4168        PlanDefinitionActionDynamicValueComponent o = (PlanDefinitionActionDynamicValueComponent) other_;
4169        return compareValues(path, o.path, true);
4170      }
4171
4172      public boolean isEmpty() {
4173        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(path, expression);
4174      }
4175
4176  public String fhirType() {
4177    return "PlanDefinition.action.dynamicValue";
4178
4179  }
4180
4181  }
4182
4183    /**
4184     * An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.
4185     */
4186    @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true)
4187    @Description(shortDefinition="Canonical identifier for this plan definition, represented as a URI (globally unique)", formalDefinition="An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers." )
4188    protected UriType url;
4189
4190    /**
4191     * 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.
4192     */
4193    @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4194    @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." )
4195    protected List<Identifier> identifier;
4196
4197    /**
4198     * 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.
4199     */
4200    @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
4201    @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." )
4202    protected StringType version;
4203
4204    /**
4205     * 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.
4206     */
4207    @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
4208    @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." )
4209    protected StringType name;
4210
4211    /**
4212     * A short, descriptive, user-friendly title for the plan definition.
4213     */
4214    @Child(name = "title", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
4215    @Description(shortDefinition="Name for this plan definition (human friendly)", formalDefinition="A short, descriptive, user-friendly title for the plan definition." )
4216    protected StringType title;
4217
4218    /**
4219     * An explanatory or alternate title for the plan definition giving additional information about its content.
4220     */
4221    @Child(name = "subtitle", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
4222    @Description(shortDefinition="Subordinate title of the plan definition", formalDefinition="An explanatory or alternate title for the plan definition giving additional information about its content." )
4223    protected StringType subtitle;
4224
4225    /**
4226     * A high-level category for the plan definition that distinguishes the kinds of systems that would be interested in the plan definition.
4227     */
4228    @Child(name = "type", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true)
4229    @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." )
4230    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/plan-definition-type")
4231    protected CodeableConcept type;
4232
4233    /**
4234     * The status of this plan definition. Enables tracking the life-cycle of the content.
4235     */
4236    @Child(name = "status", type = {CodeType.class}, order=7, min=1, max=1, modifier=true, summary=true)
4237    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The status of this plan definition. Enables tracking the life-cycle of the content." )
4238    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
4239    protected Enumeration<PublicationStatus> status;
4240
4241    /**
4242     * 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.
4243     */
4244    @Child(name = "experimental", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=true)
4245    @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." )
4246    protected BooleanType experimental;
4247
4248    /**
4249     * 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.
4250     */
4251    @Child(name = "subject", type = {CodeableConcept.class, Group.class, CanonicalType.class}, order=9, min=0, max=1, modifier=false, summary=false)
4252    @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." )
4253    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/subject-type")
4254    protected DataType subject;
4255
4256    /**
4257     * 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.
4258     */
4259    @Child(name = "date", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=true)
4260    @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." )
4261    protected DateTimeType date;
4262
4263    /**
4264     * The name of the organization or individual that published the plan definition.
4265     */
4266    @Child(name = "publisher", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=true)
4267    @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the organization or individual that published the plan definition." )
4268    protected StringType publisher;
4269
4270    /**
4271     * Contact details to assist a user in finding and communicating with the publisher.
4272     */
4273    @Child(name = "contact", type = {ContactDetail.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4274    @Description(shortDefinition="Contact details for the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." )
4275    protected List<ContactDetail> contact;
4276
4277    /**
4278     * A free text natural language description of the plan definition from a consumer's perspective.
4279     */
4280    @Child(name = "description", type = {MarkdownType.class}, order=13, min=0, max=1, modifier=false, summary=true)
4281    @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." )
4282    protected MarkdownType description;
4283
4284    /**
4285     * 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.
4286     */
4287    @Child(name = "useContext", type = {UsageContext.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4288    @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." )
4289    protected List<UsageContext> useContext;
4290
4291    /**
4292     * A legal or geographic region in which the plan definition is intended to be used.
4293     */
4294    @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4295    @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." )
4296    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction")
4297    protected List<CodeableConcept> jurisdiction;
4298
4299    /**
4300     * Explanation of why this plan definition is needed and why it has been designed as it has.
4301     */
4302    @Child(name = "purpose", type = {MarkdownType.class}, order=16, min=0, max=1, modifier=false, summary=false)
4303    @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." )
4304    protected MarkdownType purpose;
4305
4306    /**
4307     * A detailed description of how the plan definition is used from a clinical perspective.
4308     */
4309    @Child(name = "usage", type = {StringType.class}, order=17, min=0, max=1, modifier=false, summary=false)
4310    @Description(shortDefinition="Describes the clinical usage of the plan", formalDefinition="A detailed description of how the plan definition is used from a clinical perspective." )
4311    protected StringType usage;
4312
4313    /**
4314     * 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.
4315     */
4316    @Child(name = "copyright", type = {MarkdownType.class}, order=18, min=0, max=1, modifier=false, summary=false)
4317    @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." )
4318    protected MarkdownType copyright;
4319
4320    /**
4321     * The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
4322     */
4323    @Child(name = "approvalDate", type = {DateType.class}, order=19, min=0, max=1, modifier=false, summary=false)
4324    @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." )
4325    protected DateType approvalDate;
4326
4327    /**
4328     * The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
4329     */
4330    @Child(name = "lastReviewDate", type = {DateType.class}, order=20, min=0, max=1, modifier=false, summary=false)
4331    @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." )
4332    protected DateType lastReviewDate;
4333
4334    /**
4335     * The period during which the plan definition content was or is planned to be in active use.
4336     */
4337    @Child(name = "effectivePeriod", type = {Period.class}, order=21, min=0, max=1, modifier=false, summary=true)
4338    @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." )
4339    protected Period effectivePeriod;
4340
4341    /**
4342     * 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.
4343     */
4344    @Child(name = "topic", type = {CodeableConcept.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4345    @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." )
4346    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/definition-topic")
4347    protected List<CodeableConcept> topic;
4348
4349    /**
4350     * An individiual or organization primarily involved in the creation and maintenance of the content.
4351     */
4352    @Child(name = "author", type = {ContactDetail.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4353    @Description(shortDefinition="Who authored the content", formalDefinition="An individiual or organization primarily involved in the creation and maintenance of the content." )
4354    protected List<ContactDetail> author;
4355
4356    /**
4357     * An individual or organization primarily responsible for internal coherence of the content.
4358     */
4359    @Child(name = "editor", type = {ContactDetail.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4360    @Description(shortDefinition="Who edited the content", formalDefinition="An individual or organization primarily responsible for internal coherence of the content." )
4361    protected List<ContactDetail> editor;
4362
4363    /**
4364     * An individual or organization primarily responsible for review of some aspect of the content.
4365     */
4366    @Child(name = "reviewer", type = {ContactDetail.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4367    @Description(shortDefinition="Who reviewed the content", formalDefinition="An individual or organization primarily responsible for review of some aspect of the content." )
4368    protected List<ContactDetail> reviewer;
4369
4370    /**
4371     * An individual or organization responsible for officially endorsing the content for use in some setting.
4372     */
4373    @Child(name = "endorser", type = {ContactDetail.class}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4374    @Description(shortDefinition="Who endorsed the content", formalDefinition="An individual or organization responsible for officially endorsing the content for use in some setting." )
4375    protected List<ContactDetail> endorser;
4376
4377    /**
4378     * Related artifacts such as additional documentation, justification, or bibliographic references.
4379     */
4380    @Child(name = "relatedArtifact", type = {RelatedArtifact.class}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4381    @Description(shortDefinition="Additional documentation, citations", formalDefinition="Related artifacts such as additional documentation, justification, or bibliographic references." )
4382    protected List<RelatedArtifact> relatedArtifact;
4383
4384    /**
4385     * A reference to a Library resource containing any formal logic used by the plan definition.
4386     */
4387    @Child(name = "library", type = {CanonicalType.class}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4388    @Description(shortDefinition="Logic used by the plan definition", formalDefinition="A reference to a Library resource containing any formal logic used by the plan definition." )
4389    protected List<CanonicalType> library;
4390
4391    /**
4392     * 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.
4393     */
4394    @Child(name = "goal", type = {}, order=29, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4395    @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." )
4396    protected List<PlanDefinitionGoalComponent> goal;
4397
4398    /**
4399     * 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.
4400     */
4401    @Child(name = "action", type = {}, order=30, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4402    @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." )
4403    protected List<PlanDefinitionActionComponent> action;
4404
4405    private static final long serialVersionUID = 485099011L;
4406
4407  /**
4408   * Constructor
4409   */
4410    public PlanDefinition() {
4411      super();
4412    }
4413
4414  /**
4415   * Constructor
4416   */
4417    public PlanDefinition(PublicationStatus status) {
4418      super();
4419      this.setStatus(status);
4420    }
4421
4422    /**
4423     * @return {@link #url} (An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
4424     */
4425    public UriType getUrlElement() { 
4426      if (this.url == null)
4427        if (Configuration.errorOnAutoCreate())
4428          throw new Error("Attempt to auto-create PlanDefinition.url");
4429        else if (Configuration.doAutoCreate())
4430          this.url = new UriType(); // bb
4431      return this.url;
4432    }
4433
4434    public boolean hasUrlElement() { 
4435      return this.url != null && !this.url.isEmpty();
4436    }
4437
4438    public boolean hasUrl() { 
4439      return this.url != null && !this.url.isEmpty();
4440    }
4441
4442    /**
4443     * @param value {@link #url} (An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
4444     */
4445    public PlanDefinition setUrlElement(UriType value) { 
4446      this.url = value;
4447      return this;
4448    }
4449
4450    /**
4451     * @return An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.
4452     */
4453    public String getUrl() { 
4454      return this.url == null ? null : this.url.getValue();
4455    }
4456
4457    /**
4458     * @param value An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.
4459     */
4460    public PlanDefinition setUrl(String value) { 
4461      if (Utilities.noString(value))
4462        this.url = null;
4463      else {
4464        if (this.url == null)
4465          this.url = new UriType();
4466        this.url.setValue(value);
4467      }
4468      return this;
4469    }
4470
4471    /**
4472     * @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.)
4473     */
4474    public List<Identifier> getIdentifier() { 
4475      if (this.identifier == null)
4476        this.identifier = new ArrayList<Identifier>();
4477      return this.identifier;
4478    }
4479
4480    /**
4481     * @return Returns a reference to <code>this</code> for easy method chaining
4482     */
4483    public PlanDefinition setIdentifier(List<Identifier> theIdentifier) { 
4484      this.identifier = theIdentifier;
4485      return this;
4486    }
4487
4488    public boolean hasIdentifier() { 
4489      if (this.identifier == null)
4490        return false;
4491      for (Identifier item : this.identifier)
4492        if (!item.isEmpty())
4493          return true;
4494      return false;
4495    }
4496
4497    public Identifier addIdentifier() { //3
4498      Identifier t = new Identifier();
4499      if (this.identifier == null)
4500        this.identifier = new ArrayList<Identifier>();
4501      this.identifier.add(t);
4502      return t;
4503    }
4504
4505    public PlanDefinition addIdentifier(Identifier t) { //3
4506      if (t == null)
4507        return this;
4508      if (this.identifier == null)
4509        this.identifier = new ArrayList<Identifier>();
4510      this.identifier.add(t);
4511      return this;
4512    }
4513
4514    /**
4515     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
4516     */
4517    public Identifier getIdentifierFirstRep() { 
4518      if (getIdentifier().isEmpty()) {
4519        addIdentifier();
4520      }
4521      return getIdentifier().get(0);
4522    }
4523
4524    /**
4525     * @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
4526     */
4527    public StringType getVersionElement() { 
4528      if (this.version == null)
4529        if (Configuration.errorOnAutoCreate())
4530          throw new Error("Attempt to auto-create PlanDefinition.version");
4531        else if (Configuration.doAutoCreate())
4532          this.version = new StringType(); // bb
4533      return this.version;
4534    }
4535
4536    public boolean hasVersionElement() { 
4537      return this.version != null && !this.version.isEmpty();
4538    }
4539
4540    public boolean hasVersion() { 
4541      return this.version != null && !this.version.isEmpty();
4542    }
4543
4544    /**
4545     * @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
4546     */
4547    public PlanDefinition setVersionElement(StringType value) { 
4548      this.version = value;
4549      return this;
4550    }
4551
4552    /**
4553     * @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.
4554     */
4555    public String getVersion() { 
4556      return this.version == null ? null : this.version.getValue();
4557    }
4558
4559    /**
4560     * @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.
4561     */
4562    public PlanDefinition setVersion(String value) { 
4563      if (Utilities.noString(value))
4564        this.version = null;
4565      else {
4566        if (this.version == null)
4567          this.version = new StringType();
4568        this.version.setValue(value);
4569      }
4570      return this;
4571    }
4572
4573    /**
4574     * @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
4575     */
4576    public StringType getNameElement() { 
4577      if (this.name == null)
4578        if (Configuration.errorOnAutoCreate())
4579          throw new Error("Attempt to auto-create PlanDefinition.name");
4580        else if (Configuration.doAutoCreate())
4581          this.name = new StringType(); // bb
4582      return this.name;
4583    }
4584
4585    public boolean hasNameElement() { 
4586      return this.name != null && !this.name.isEmpty();
4587    }
4588
4589    public boolean hasName() { 
4590      return this.name != null && !this.name.isEmpty();
4591    }
4592
4593    /**
4594     * @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
4595     */
4596    public PlanDefinition setNameElement(StringType value) { 
4597      this.name = value;
4598      return this;
4599    }
4600
4601    /**
4602     * @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.
4603     */
4604    public String getName() { 
4605      return this.name == null ? null : this.name.getValue();
4606    }
4607
4608    /**
4609     * @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.
4610     */
4611    public PlanDefinition setName(String value) { 
4612      if (Utilities.noString(value))
4613        this.name = null;
4614      else {
4615        if (this.name == null)
4616          this.name = new StringType();
4617        this.name.setValue(value);
4618      }
4619      return this;
4620    }
4621
4622    /**
4623     * @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
4624     */
4625    public StringType getTitleElement() { 
4626      if (this.title == null)
4627        if (Configuration.errorOnAutoCreate())
4628          throw new Error("Attempt to auto-create PlanDefinition.title");
4629        else if (Configuration.doAutoCreate())
4630          this.title = new StringType(); // bb
4631      return this.title;
4632    }
4633
4634    public boolean hasTitleElement() { 
4635      return this.title != null && !this.title.isEmpty();
4636    }
4637
4638    public boolean hasTitle() { 
4639      return this.title != null && !this.title.isEmpty();
4640    }
4641
4642    /**
4643     * @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
4644     */
4645    public PlanDefinition setTitleElement(StringType value) { 
4646      this.title = value;
4647      return this;
4648    }
4649
4650    /**
4651     * @return A short, descriptive, user-friendly title for the plan definition.
4652     */
4653    public String getTitle() { 
4654      return this.title == null ? null : this.title.getValue();
4655    }
4656
4657    /**
4658     * @param value A short, descriptive, user-friendly title for the plan definition.
4659     */
4660    public PlanDefinition setTitle(String value) { 
4661      if (Utilities.noString(value))
4662        this.title = null;
4663      else {
4664        if (this.title == null)
4665          this.title = new StringType();
4666        this.title.setValue(value);
4667      }
4668      return this;
4669    }
4670
4671    /**
4672     * @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
4673     */
4674    public StringType getSubtitleElement() { 
4675      if (this.subtitle == null)
4676        if (Configuration.errorOnAutoCreate())
4677          throw new Error("Attempt to auto-create PlanDefinition.subtitle");
4678        else if (Configuration.doAutoCreate())
4679          this.subtitle = new StringType(); // bb
4680      return this.subtitle;
4681    }
4682
4683    public boolean hasSubtitleElement() { 
4684      return this.subtitle != null && !this.subtitle.isEmpty();
4685    }
4686
4687    public boolean hasSubtitle() { 
4688      return this.subtitle != null && !this.subtitle.isEmpty();
4689    }
4690
4691    /**
4692     * @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
4693     */
4694    public PlanDefinition setSubtitleElement(StringType value) { 
4695      this.subtitle = value;
4696      return this;
4697    }
4698
4699    /**
4700     * @return An explanatory or alternate title for the plan definition giving additional information about its content.
4701     */
4702    public String getSubtitle() { 
4703      return this.subtitle == null ? null : this.subtitle.getValue();
4704    }
4705
4706    /**
4707     * @param value An explanatory or alternate title for the plan definition giving additional information about its content.
4708     */
4709    public PlanDefinition setSubtitle(String value) { 
4710      if (Utilities.noString(value))
4711        this.subtitle = null;
4712      else {
4713        if (this.subtitle == null)
4714          this.subtitle = new StringType();
4715        this.subtitle.setValue(value);
4716      }
4717      return this;
4718    }
4719
4720    /**
4721     * @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.)
4722     */
4723    public CodeableConcept getType() { 
4724      if (this.type == null)
4725        if (Configuration.errorOnAutoCreate())
4726          throw new Error("Attempt to auto-create PlanDefinition.type");
4727        else if (Configuration.doAutoCreate())
4728          this.type = new CodeableConcept(); // cc
4729      return this.type;
4730    }
4731
4732    public boolean hasType() { 
4733      return this.type != null && !this.type.isEmpty();
4734    }
4735
4736    /**
4737     * @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.)
4738     */
4739    public PlanDefinition setType(CodeableConcept value) { 
4740      this.type = value;
4741      return this;
4742    }
4743
4744    /**
4745     * @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
4746     */
4747    public Enumeration<PublicationStatus> getStatusElement() { 
4748      if (this.status == null)
4749        if (Configuration.errorOnAutoCreate())
4750          throw new Error("Attempt to auto-create PlanDefinition.status");
4751        else if (Configuration.doAutoCreate())
4752          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
4753      return this.status;
4754    }
4755
4756    public boolean hasStatusElement() { 
4757      return this.status != null && !this.status.isEmpty();
4758    }
4759
4760    public boolean hasStatus() { 
4761      return this.status != null && !this.status.isEmpty();
4762    }
4763
4764    /**
4765     * @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
4766     */
4767    public PlanDefinition setStatusElement(Enumeration<PublicationStatus> value) { 
4768      this.status = value;
4769      return this;
4770    }
4771
4772    /**
4773     * @return The status of this plan definition. Enables tracking the life-cycle of the content.
4774     */
4775    public PublicationStatus getStatus() { 
4776      return this.status == null ? null : this.status.getValue();
4777    }
4778
4779    /**
4780     * @param value The status of this plan definition. Enables tracking the life-cycle of the content.
4781     */
4782    public PlanDefinition setStatus(PublicationStatus value) { 
4783        if (this.status == null)
4784          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
4785        this.status.setValue(value);
4786      return this;
4787    }
4788
4789    /**
4790     * @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
4791     */
4792    public BooleanType getExperimentalElement() { 
4793      if (this.experimental == null)
4794        if (Configuration.errorOnAutoCreate())
4795          throw new Error("Attempt to auto-create PlanDefinition.experimental");
4796        else if (Configuration.doAutoCreate())
4797          this.experimental = new BooleanType(); // bb
4798      return this.experimental;
4799    }
4800
4801    public boolean hasExperimentalElement() { 
4802      return this.experimental != null && !this.experimental.isEmpty();
4803    }
4804
4805    public boolean hasExperimental() { 
4806      return this.experimental != null && !this.experimental.isEmpty();
4807    }
4808
4809    /**
4810     * @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
4811     */
4812    public PlanDefinition setExperimentalElement(BooleanType value) { 
4813      this.experimental = value;
4814      return this;
4815    }
4816
4817    /**
4818     * @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.
4819     */
4820    public boolean getExperimental() { 
4821      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
4822    }
4823
4824    /**
4825     * @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.
4826     */
4827    public PlanDefinition setExperimental(boolean value) { 
4828        if (this.experimental == null)
4829          this.experimental = new BooleanType();
4830        this.experimental.setValue(value);
4831      return this;
4832    }
4833
4834    /**
4835     * @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.)
4836     */
4837    public DataType getSubject() { 
4838      return this.subject;
4839    }
4840
4841    /**
4842     * @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.)
4843     */
4844    public CodeableConcept getSubjectCodeableConcept() throws FHIRException { 
4845      if (this.subject == null)
4846        this.subject = new CodeableConcept();
4847      if (!(this.subject instanceof CodeableConcept))
4848        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.subject.getClass().getName()+" was encountered");
4849      return (CodeableConcept) this.subject;
4850    }
4851
4852    public boolean hasSubjectCodeableConcept() { 
4853      return this != null && this.subject instanceof CodeableConcept;
4854    }
4855
4856    /**
4857     * @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.)
4858     */
4859    public Reference getSubjectReference() throws FHIRException { 
4860      if (this.subject == null)
4861        this.subject = new Reference();
4862      if (!(this.subject instanceof Reference))
4863        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.subject.getClass().getName()+" was encountered");
4864      return (Reference) this.subject;
4865    }
4866
4867    public boolean hasSubjectReference() { 
4868      return this != null && this.subject instanceof Reference;
4869    }
4870
4871    /**
4872     * @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.)
4873     */
4874    public CanonicalType getSubjectCanonicalType() throws FHIRException { 
4875      if (this.subject == null)
4876        this.subject = new CanonicalType();
4877      if (!(this.subject instanceof CanonicalType))
4878        throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.subject.getClass().getName()+" was encountered");
4879      return (CanonicalType) this.subject;
4880    }
4881
4882    public boolean hasSubjectCanonicalType() { 
4883      return this != null && this.subject instanceof CanonicalType;
4884    }
4885
4886    public boolean hasSubject() { 
4887      return this.subject != null && !this.subject.isEmpty();
4888    }
4889
4890    /**
4891     * @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.)
4892     */
4893    public PlanDefinition setSubject(DataType value) { 
4894      if (value != null && !(value instanceof CodeableConcept || value instanceof Reference || value instanceof CanonicalType))
4895        throw new Error("Not the right type for PlanDefinition.subject[x]: "+value.fhirType());
4896      this.subject = value;
4897      return this;
4898    }
4899
4900    /**
4901     * @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
4902     */
4903    public DateTimeType getDateElement() { 
4904      if (this.date == null)
4905        if (Configuration.errorOnAutoCreate())
4906          throw new Error("Attempt to auto-create PlanDefinition.date");
4907        else if (Configuration.doAutoCreate())
4908          this.date = new DateTimeType(); // bb
4909      return this.date;
4910    }
4911
4912    public boolean hasDateElement() { 
4913      return this.date != null && !this.date.isEmpty();
4914    }
4915
4916    public boolean hasDate() { 
4917      return this.date != null && !this.date.isEmpty();
4918    }
4919
4920    /**
4921     * @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
4922     */
4923    public PlanDefinition setDateElement(DateTimeType value) { 
4924      this.date = value;
4925      return this;
4926    }
4927
4928    /**
4929     * @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.
4930     */
4931    public Date getDate() { 
4932      return this.date == null ? null : this.date.getValue();
4933    }
4934
4935    /**
4936     * @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.
4937     */
4938    public PlanDefinition setDate(Date value) { 
4939      if (value == null)
4940        this.date = null;
4941      else {
4942        if (this.date == null)
4943          this.date = new DateTimeType();
4944        this.date.setValue(value);
4945      }
4946      return this;
4947    }
4948
4949    /**
4950     * @return {@link #publisher} (The name of the organization or individual that published the plan definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
4951     */
4952    public StringType getPublisherElement() { 
4953      if (this.publisher == null)
4954        if (Configuration.errorOnAutoCreate())
4955          throw new Error("Attempt to auto-create PlanDefinition.publisher");
4956        else if (Configuration.doAutoCreate())
4957          this.publisher = new StringType(); // bb
4958      return this.publisher;
4959    }
4960
4961    public boolean hasPublisherElement() { 
4962      return this.publisher != null && !this.publisher.isEmpty();
4963    }
4964
4965    public boolean hasPublisher() { 
4966      return this.publisher != null && !this.publisher.isEmpty();
4967    }
4968
4969    /**
4970     * @param value {@link #publisher} (The name of the organization or individual that published the plan definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
4971     */
4972    public PlanDefinition setPublisherElement(StringType value) { 
4973      this.publisher = value;
4974      return this;
4975    }
4976
4977    /**
4978     * @return The name of the organization or individual that published the plan definition.
4979     */
4980    public String getPublisher() { 
4981      return this.publisher == null ? null : this.publisher.getValue();
4982    }
4983
4984    /**
4985     * @param value The name of the organization or individual that published the plan definition.
4986     */
4987    public PlanDefinition setPublisher(String value) { 
4988      if (Utilities.noString(value))
4989        this.publisher = null;
4990      else {
4991        if (this.publisher == null)
4992          this.publisher = new StringType();
4993        this.publisher.setValue(value);
4994      }
4995      return this;
4996    }
4997
4998    /**
4999     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
5000     */
5001    public List<ContactDetail> getContact() { 
5002      if (this.contact == null)
5003        this.contact = new ArrayList<ContactDetail>();
5004      return this.contact;
5005    }
5006
5007    /**
5008     * @return Returns a reference to <code>this</code> for easy method chaining
5009     */
5010    public PlanDefinition setContact(List<ContactDetail> theContact) { 
5011      this.contact = theContact;
5012      return this;
5013    }
5014
5015    public boolean hasContact() { 
5016      if (this.contact == null)
5017        return false;
5018      for (ContactDetail item : this.contact)
5019        if (!item.isEmpty())
5020          return true;
5021      return false;
5022    }
5023
5024    public ContactDetail addContact() { //3
5025      ContactDetail t = new ContactDetail();
5026      if (this.contact == null)
5027        this.contact = new ArrayList<ContactDetail>();
5028      this.contact.add(t);
5029      return t;
5030    }
5031
5032    public PlanDefinition addContact(ContactDetail t) { //3
5033      if (t == null)
5034        return this;
5035      if (this.contact == null)
5036        this.contact = new ArrayList<ContactDetail>();
5037      this.contact.add(t);
5038      return this;
5039    }
5040
5041    /**
5042     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist {3}
5043     */
5044    public ContactDetail getContactFirstRep() { 
5045      if (getContact().isEmpty()) {
5046        addContact();
5047      }
5048      return getContact().get(0);
5049    }
5050
5051    /**
5052     * @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
5053     */
5054    public MarkdownType getDescriptionElement() { 
5055      if (this.description == null)
5056        if (Configuration.errorOnAutoCreate())
5057          throw new Error("Attempt to auto-create PlanDefinition.description");
5058        else if (Configuration.doAutoCreate())
5059          this.description = new MarkdownType(); // bb
5060      return this.description;
5061    }
5062
5063    public boolean hasDescriptionElement() { 
5064      return this.description != null && !this.description.isEmpty();
5065    }
5066
5067    public boolean hasDescription() { 
5068      return this.description != null && !this.description.isEmpty();
5069    }
5070
5071    /**
5072     * @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
5073     */
5074    public PlanDefinition setDescriptionElement(MarkdownType value) { 
5075      this.description = value;
5076      return this;
5077    }
5078
5079    /**
5080     * @return A free text natural language description of the plan definition from a consumer's perspective.
5081     */
5082    public String getDescription() { 
5083      return this.description == null ? null : this.description.getValue();
5084    }
5085
5086    /**
5087     * @param value A free text natural language description of the plan definition from a consumer's perspective.
5088     */
5089    public PlanDefinition setDescription(String value) { 
5090      if (value == null)
5091        this.description = null;
5092      else {
5093        if (this.description == null)
5094          this.description = new MarkdownType();
5095        this.description.setValue(value);
5096      }
5097      return this;
5098    }
5099
5100    /**
5101     * @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.)
5102     */
5103    public List<UsageContext> getUseContext() { 
5104      if (this.useContext == null)
5105        this.useContext = new ArrayList<UsageContext>();
5106      return this.useContext;
5107    }
5108
5109    /**
5110     * @return Returns a reference to <code>this</code> for easy method chaining
5111     */
5112    public PlanDefinition setUseContext(List<UsageContext> theUseContext) { 
5113      this.useContext = theUseContext;
5114      return this;
5115    }
5116
5117    public boolean hasUseContext() { 
5118      if (this.useContext == null)
5119        return false;
5120      for (UsageContext item : this.useContext)
5121        if (!item.isEmpty())
5122          return true;
5123      return false;
5124    }
5125
5126    public UsageContext addUseContext() { //3
5127      UsageContext t = new UsageContext();
5128      if (this.useContext == null)
5129        this.useContext = new ArrayList<UsageContext>();
5130      this.useContext.add(t);
5131      return t;
5132    }
5133
5134    public PlanDefinition addUseContext(UsageContext t) { //3
5135      if (t == null)
5136        return this;
5137      if (this.useContext == null)
5138        this.useContext = new ArrayList<UsageContext>();
5139      this.useContext.add(t);
5140      return this;
5141    }
5142
5143    /**
5144     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist {3}
5145     */
5146    public UsageContext getUseContextFirstRep() { 
5147      if (getUseContext().isEmpty()) {
5148        addUseContext();
5149      }
5150      return getUseContext().get(0);
5151    }
5152
5153    /**
5154     * @return {@link #jurisdiction} (A legal or geographic region in which the plan definition is intended to be used.)
5155     */
5156    public List<CodeableConcept> getJurisdiction() { 
5157      if (this.jurisdiction == null)
5158        this.jurisdiction = new ArrayList<CodeableConcept>();
5159      return this.jurisdiction;
5160    }
5161
5162    /**
5163     * @return Returns a reference to <code>this</code> for easy method chaining
5164     */
5165    public PlanDefinition setJurisdiction(List<CodeableConcept> theJurisdiction) { 
5166      this.jurisdiction = theJurisdiction;
5167      return this;
5168    }
5169
5170    public boolean hasJurisdiction() { 
5171      if (this.jurisdiction == null)
5172        return false;
5173      for (CodeableConcept item : this.jurisdiction)
5174        if (!item.isEmpty())
5175          return true;
5176      return false;
5177    }
5178
5179    public CodeableConcept addJurisdiction() { //3
5180      CodeableConcept t = new CodeableConcept();
5181      if (this.jurisdiction == null)
5182        this.jurisdiction = new ArrayList<CodeableConcept>();
5183      this.jurisdiction.add(t);
5184      return t;
5185    }
5186
5187    public PlanDefinition addJurisdiction(CodeableConcept t) { //3
5188      if (t == null)
5189        return this;
5190      if (this.jurisdiction == null)
5191        this.jurisdiction = new ArrayList<CodeableConcept>();
5192      this.jurisdiction.add(t);
5193      return this;
5194    }
5195
5196    /**
5197     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist {3}
5198     */
5199    public CodeableConcept getJurisdictionFirstRep() { 
5200      if (getJurisdiction().isEmpty()) {
5201        addJurisdiction();
5202      }
5203      return getJurisdiction().get(0);
5204    }
5205
5206    /**
5207     * @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
5208     */
5209    public MarkdownType getPurposeElement() { 
5210      if (this.purpose == null)
5211        if (Configuration.errorOnAutoCreate())
5212          throw new Error("Attempt to auto-create PlanDefinition.purpose");
5213        else if (Configuration.doAutoCreate())
5214          this.purpose = new MarkdownType(); // bb
5215      return this.purpose;
5216    }
5217
5218    public boolean hasPurposeElement() { 
5219      return this.purpose != null && !this.purpose.isEmpty();
5220    }
5221
5222    public boolean hasPurpose() { 
5223      return this.purpose != null && !this.purpose.isEmpty();
5224    }
5225
5226    /**
5227     * @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
5228     */
5229    public PlanDefinition setPurposeElement(MarkdownType value) { 
5230      this.purpose = value;
5231      return this;
5232    }
5233
5234    /**
5235     * @return Explanation of why this plan definition is needed and why it has been designed as it has.
5236     */
5237    public String getPurpose() { 
5238      return this.purpose == null ? null : this.purpose.getValue();
5239    }
5240
5241    /**
5242     * @param value Explanation of why this plan definition is needed and why it has been designed as it has.
5243     */
5244    public PlanDefinition setPurpose(String value) { 
5245      if (value == null)
5246        this.purpose = null;
5247      else {
5248        if (this.purpose == null)
5249          this.purpose = new MarkdownType();
5250        this.purpose.setValue(value);
5251      }
5252      return this;
5253    }
5254
5255    /**
5256     * @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
5257     */
5258    public StringType getUsageElement() { 
5259      if (this.usage == null)
5260        if (Configuration.errorOnAutoCreate())
5261          throw new Error("Attempt to auto-create PlanDefinition.usage");
5262        else if (Configuration.doAutoCreate())
5263          this.usage = new StringType(); // bb
5264      return this.usage;
5265    }
5266
5267    public boolean hasUsageElement() { 
5268      return this.usage != null && !this.usage.isEmpty();
5269    }
5270
5271    public boolean hasUsage() { 
5272      return this.usage != null && !this.usage.isEmpty();
5273    }
5274
5275    /**
5276     * @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
5277     */
5278    public PlanDefinition setUsageElement(StringType value) { 
5279      this.usage = value;
5280      return this;
5281    }
5282
5283    /**
5284     * @return A detailed description of how the plan definition is used from a clinical perspective.
5285     */
5286    public String getUsage() { 
5287      return this.usage == null ? null : this.usage.getValue();
5288    }
5289
5290    /**
5291     * @param value A detailed description of how the plan definition is used from a clinical perspective.
5292     */
5293    public PlanDefinition setUsage(String value) { 
5294      if (Utilities.noString(value))
5295        this.usage = null;
5296      else {
5297        if (this.usage == null)
5298          this.usage = new StringType();
5299        this.usage.setValue(value);
5300      }
5301      return this;
5302    }
5303
5304    /**
5305     * @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
5306     */
5307    public MarkdownType getCopyrightElement() { 
5308      if (this.copyright == null)
5309        if (Configuration.errorOnAutoCreate())
5310          throw new Error("Attempt to auto-create PlanDefinition.copyright");
5311        else if (Configuration.doAutoCreate())
5312          this.copyright = new MarkdownType(); // bb
5313      return this.copyright;
5314    }
5315
5316    public boolean hasCopyrightElement() { 
5317      return this.copyright != null && !this.copyright.isEmpty();
5318    }
5319
5320    public boolean hasCopyright() { 
5321      return this.copyright != null && !this.copyright.isEmpty();
5322    }
5323
5324    /**
5325     * @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
5326     */
5327    public PlanDefinition setCopyrightElement(MarkdownType value) { 
5328      this.copyright = value;
5329      return this;
5330    }
5331
5332    /**
5333     * @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.
5334     */
5335    public String getCopyright() { 
5336      return this.copyright == null ? null : this.copyright.getValue();
5337    }
5338
5339    /**
5340     * @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.
5341     */
5342    public PlanDefinition setCopyright(String value) { 
5343      if (value == null)
5344        this.copyright = null;
5345      else {
5346        if (this.copyright == null)
5347          this.copyright = new MarkdownType();
5348        this.copyright.setValue(value);
5349      }
5350      return this;
5351    }
5352
5353    /**
5354     * @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
5355     */
5356    public DateType getApprovalDateElement() { 
5357      if (this.approvalDate == null)
5358        if (Configuration.errorOnAutoCreate())
5359          throw new Error("Attempt to auto-create PlanDefinition.approvalDate");
5360        else if (Configuration.doAutoCreate())
5361          this.approvalDate = new DateType(); // bb
5362      return this.approvalDate;
5363    }
5364
5365    public boolean hasApprovalDateElement() { 
5366      return this.approvalDate != null && !this.approvalDate.isEmpty();
5367    }
5368
5369    public boolean hasApprovalDate() { 
5370      return this.approvalDate != null && !this.approvalDate.isEmpty();
5371    }
5372
5373    /**
5374     * @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
5375     */
5376    public PlanDefinition setApprovalDateElement(DateType value) { 
5377      this.approvalDate = value;
5378      return this;
5379    }
5380
5381    /**
5382     * @return The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
5383     */
5384    public Date getApprovalDate() { 
5385      return this.approvalDate == null ? null : this.approvalDate.getValue();
5386    }
5387
5388    /**
5389     * @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.
5390     */
5391    public PlanDefinition setApprovalDate(Date value) { 
5392      if (value == null)
5393        this.approvalDate = null;
5394      else {
5395        if (this.approvalDate == null)
5396          this.approvalDate = new DateType();
5397        this.approvalDate.setValue(value);
5398      }
5399      return this;
5400    }
5401
5402    /**
5403     * @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
5404     */
5405    public DateType getLastReviewDateElement() { 
5406      if (this.lastReviewDate == null)
5407        if (Configuration.errorOnAutoCreate())
5408          throw new Error("Attempt to auto-create PlanDefinition.lastReviewDate");
5409        else if (Configuration.doAutoCreate())
5410          this.lastReviewDate = new DateType(); // bb
5411      return this.lastReviewDate;
5412    }
5413
5414    public boolean hasLastReviewDateElement() { 
5415      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
5416    }
5417
5418    public boolean hasLastReviewDate() { 
5419      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
5420    }
5421
5422    /**
5423     * @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
5424     */
5425    public PlanDefinition setLastReviewDateElement(DateType value) { 
5426      this.lastReviewDate = value;
5427      return this;
5428    }
5429
5430    /**
5431     * @return The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
5432     */
5433    public Date getLastReviewDate() { 
5434      return this.lastReviewDate == null ? null : this.lastReviewDate.getValue();
5435    }
5436
5437    /**
5438     * @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.
5439     */
5440    public PlanDefinition setLastReviewDate(Date value) { 
5441      if (value == null)
5442        this.lastReviewDate = null;
5443      else {
5444        if (this.lastReviewDate == null)
5445          this.lastReviewDate = new DateType();
5446        this.lastReviewDate.setValue(value);
5447      }
5448      return this;
5449    }
5450
5451    /**
5452     * @return {@link #effectivePeriod} (The period during which the plan definition content was or is planned to be in active use.)
5453     */
5454    public Period getEffectivePeriod() { 
5455      if (this.effectivePeriod == null)
5456        if (Configuration.errorOnAutoCreate())
5457          throw new Error("Attempt to auto-create PlanDefinition.effectivePeriod");
5458        else if (Configuration.doAutoCreate())
5459          this.effectivePeriod = new Period(); // cc
5460      return this.effectivePeriod;
5461    }
5462
5463    public boolean hasEffectivePeriod() { 
5464      return this.effectivePeriod != null && !this.effectivePeriod.isEmpty();
5465    }
5466
5467    /**
5468     * @param value {@link #effectivePeriod} (The period during which the plan definition content was or is planned to be in active use.)
5469     */
5470    public PlanDefinition setEffectivePeriod(Period value) { 
5471      this.effectivePeriod = value;
5472      return this;
5473    }
5474
5475    /**
5476     * @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.)
5477     */
5478    public List<CodeableConcept> getTopic() { 
5479      if (this.topic == null)
5480        this.topic = new ArrayList<CodeableConcept>();
5481      return this.topic;
5482    }
5483
5484    /**
5485     * @return Returns a reference to <code>this</code> for easy method chaining
5486     */
5487    public PlanDefinition setTopic(List<CodeableConcept> theTopic) { 
5488      this.topic = theTopic;
5489      return this;
5490    }
5491
5492    public boolean hasTopic() { 
5493      if (this.topic == null)
5494        return false;
5495      for (CodeableConcept item : this.topic)
5496        if (!item.isEmpty())
5497          return true;
5498      return false;
5499    }
5500
5501    public CodeableConcept addTopic() { //3
5502      CodeableConcept t = new CodeableConcept();
5503      if (this.topic == null)
5504        this.topic = new ArrayList<CodeableConcept>();
5505      this.topic.add(t);
5506      return t;
5507    }
5508
5509    public PlanDefinition addTopic(CodeableConcept t) { //3
5510      if (t == null)
5511        return this;
5512      if (this.topic == null)
5513        this.topic = new ArrayList<CodeableConcept>();
5514      this.topic.add(t);
5515      return this;
5516    }
5517
5518    /**
5519     * @return The first repetition of repeating field {@link #topic}, creating it if it does not already exist {3}
5520     */
5521    public CodeableConcept getTopicFirstRep() { 
5522      if (getTopic().isEmpty()) {
5523        addTopic();
5524      }
5525      return getTopic().get(0);
5526    }
5527
5528    /**
5529     * @return {@link #author} (An individiual or organization primarily involved in the creation and maintenance of the content.)
5530     */
5531    public List<ContactDetail> getAuthor() { 
5532      if (this.author == null)
5533        this.author = new ArrayList<ContactDetail>();
5534      return this.author;
5535    }
5536
5537    /**
5538     * @return Returns a reference to <code>this</code> for easy method chaining
5539     */
5540    public PlanDefinition setAuthor(List<ContactDetail> theAuthor) { 
5541      this.author = theAuthor;
5542      return this;
5543    }
5544
5545    public boolean hasAuthor() { 
5546      if (this.author == null)
5547        return false;
5548      for (ContactDetail item : this.author)
5549        if (!item.isEmpty())
5550          return true;
5551      return false;
5552    }
5553
5554    public ContactDetail addAuthor() { //3
5555      ContactDetail t = new ContactDetail();
5556      if (this.author == null)
5557        this.author = new ArrayList<ContactDetail>();
5558      this.author.add(t);
5559      return t;
5560    }
5561
5562    public PlanDefinition addAuthor(ContactDetail t) { //3
5563      if (t == null)
5564        return this;
5565      if (this.author == null)
5566        this.author = new ArrayList<ContactDetail>();
5567      this.author.add(t);
5568      return this;
5569    }
5570
5571    /**
5572     * @return The first repetition of repeating field {@link #author}, creating it if it does not already exist {3}
5573     */
5574    public ContactDetail getAuthorFirstRep() { 
5575      if (getAuthor().isEmpty()) {
5576        addAuthor();
5577      }
5578      return getAuthor().get(0);
5579    }
5580
5581    /**
5582     * @return {@link #editor} (An individual or organization primarily responsible for internal coherence of the content.)
5583     */
5584    public List<ContactDetail> getEditor() { 
5585      if (this.editor == null)
5586        this.editor = new ArrayList<ContactDetail>();
5587      return this.editor;
5588    }
5589
5590    /**
5591     * @return Returns a reference to <code>this</code> for easy method chaining
5592     */
5593    public PlanDefinition setEditor(List<ContactDetail> theEditor) { 
5594      this.editor = theEditor;
5595      return this;
5596    }
5597
5598    public boolean hasEditor() { 
5599      if (this.editor == null)
5600        return false;
5601      for (ContactDetail item : this.editor)
5602        if (!item.isEmpty())
5603          return true;
5604      return false;
5605    }
5606
5607    public ContactDetail addEditor() { //3
5608      ContactDetail t = new ContactDetail();
5609      if (this.editor == null)
5610        this.editor = new ArrayList<ContactDetail>();
5611      this.editor.add(t);
5612      return t;
5613    }
5614
5615    public PlanDefinition addEditor(ContactDetail t) { //3
5616      if (t == null)
5617        return this;
5618      if (this.editor == null)
5619        this.editor = new ArrayList<ContactDetail>();
5620      this.editor.add(t);
5621      return this;
5622    }
5623
5624    /**
5625     * @return The first repetition of repeating field {@link #editor}, creating it if it does not already exist {3}
5626     */
5627    public ContactDetail getEditorFirstRep() { 
5628      if (getEditor().isEmpty()) {
5629        addEditor();
5630      }
5631      return getEditor().get(0);
5632    }
5633
5634    /**
5635     * @return {@link #reviewer} (An individual or organization primarily responsible for review of some aspect of the content.)
5636     */
5637    public List<ContactDetail> getReviewer() { 
5638      if (this.reviewer == null)
5639        this.reviewer = new ArrayList<ContactDetail>();
5640      return this.reviewer;
5641    }
5642
5643    /**
5644     * @return Returns a reference to <code>this</code> for easy method chaining
5645     */
5646    public PlanDefinition setReviewer(List<ContactDetail> theReviewer) { 
5647      this.reviewer = theReviewer;
5648      return this;
5649    }
5650
5651    public boolean hasReviewer() { 
5652      if (this.reviewer == null)
5653        return false;
5654      for (ContactDetail item : this.reviewer)
5655        if (!item.isEmpty())
5656          return true;
5657      return false;
5658    }
5659
5660    public ContactDetail addReviewer() { //3
5661      ContactDetail t = new ContactDetail();
5662      if (this.reviewer == null)
5663        this.reviewer = new ArrayList<ContactDetail>();
5664      this.reviewer.add(t);
5665      return t;
5666    }
5667
5668    public PlanDefinition addReviewer(ContactDetail t) { //3
5669      if (t == null)
5670        return this;
5671      if (this.reviewer == null)
5672        this.reviewer = new ArrayList<ContactDetail>();
5673      this.reviewer.add(t);
5674      return this;
5675    }
5676
5677    /**
5678     * @return The first repetition of repeating field {@link #reviewer}, creating it if it does not already exist {3}
5679     */
5680    public ContactDetail getReviewerFirstRep() { 
5681      if (getReviewer().isEmpty()) {
5682        addReviewer();
5683      }
5684      return getReviewer().get(0);
5685    }
5686
5687    /**
5688     * @return {@link #endorser} (An individual or organization responsible for officially endorsing the content for use in some setting.)
5689     */
5690    public List<ContactDetail> getEndorser() { 
5691      if (this.endorser == null)
5692        this.endorser = new ArrayList<ContactDetail>();
5693      return this.endorser;
5694    }
5695
5696    /**
5697     * @return Returns a reference to <code>this</code> for easy method chaining
5698     */
5699    public PlanDefinition setEndorser(List<ContactDetail> theEndorser) { 
5700      this.endorser = theEndorser;
5701      return this;
5702    }
5703
5704    public boolean hasEndorser() { 
5705      if (this.endorser == null)
5706        return false;
5707      for (ContactDetail item : this.endorser)
5708        if (!item.isEmpty())
5709          return true;
5710      return false;
5711    }
5712
5713    public ContactDetail addEndorser() { //3
5714      ContactDetail t = new ContactDetail();
5715      if (this.endorser == null)
5716        this.endorser = new ArrayList<ContactDetail>();
5717      this.endorser.add(t);
5718      return t;
5719    }
5720
5721    public PlanDefinition addEndorser(ContactDetail t) { //3
5722      if (t == null)
5723        return this;
5724      if (this.endorser == null)
5725        this.endorser = new ArrayList<ContactDetail>();
5726      this.endorser.add(t);
5727      return this;
5728    }
5729
5730    /**
5731     * @return The first repetition of repeating field {@link #endorser}, creating it if it does not already exist {3}
5732     */
5733    public ContactDetail getEndorserFirstRep() { 
5734      if (getEndorser().isEmpty()) {
5735        addEndorser();
5736      }
5737      return getEndorser().get(0);
5738    }
5739
5740    /**
5741     * @return {@link #relatedArtifact} (Related artifacts such as additional documentation, justification, or bibliographic references.)
5742     */
5743    public List<RelatedArtifact> getRelatedArtifact() { 
5744      if (this.relatedArtifact == null)
5745        this.relatedArtifact = new ArrayList<RelatedArtifact>();
5746      return this.relatedArtifact;
5747    }
5748
5749    /**
5750     * @return Returns a reference to <code>this</code> for easy method chaining
5751     */
5752    public PlanDefinition setRelatedArtifact(List<RelatedArtifact> theRelatedArtifact) { 
5753      this.relatedArtifact = theRelatedArtifact;
5754      return this;
5755    }
5756
5757    public boolean hasRelatedArtifact() { 
5758      if (this.relatedArtifact == null)
5759        return false;
5760      for (RelatedArtifact item : this.relatedArtifact)
5761        if (!item.isEmpty())
5762          return true;
5763      return false;
5764    }
5765
5766    public RelatedArtifact addRelatedArtifact() { //3
5767      RelatedArtifact t = new RelatedArtifact();
5768      if (this.relatedArtifact == null)
5769        this.relatedArtifact = new ArrayList<RelatedArtifact>();
5770      this.relatedArtifact.add(t);
5771      return t;
5772    }
5773
5774    public PlanDefinition addRelatedArtifact(RelatedArtifact t) { //3
5775      if (t == null)
5776        return this;
5777      if (this.relatedArtifact == null)
5778        this.relatedArtifact = new ArrayList<RelatedArtifact>();
5779      this.relatedArtifact.add(t);
5780      return this;
5781    }
5782
5783    /**
5784     * @return The first repetition of repeating field {@link #relatedArtifact}, creating it if it does not already exist {3}
5785     */
5786    public RelatedArtifact getRelatedArtifactFirstRep() { 
5787      if (getRelatedArtifact().isEmpty()) {
5788        addRelatedArtifact();
5789      }
5790      return getRelatedArtifact().get(0);
5791    }
5792
5793    /**
5794     * @return {@link #library} (A reference to a Library resource containing any formal logic used by the plan definition.)
5795     */
5796    public List<CanonicalType> getLibrary() { 
5797      if (this.library == null)
5798        this.library = new ArrayList<CanonicalType>();
5799      return this.library;
5800    }
5801
5802    /**
5803     * @return Returns a reference to <code>this</code> for easy method chaining
5804     */
5805    public PlanDefinition setLibrary(List<CanonicalType> theLibrary) { 
5806      this.library = theLibrary;
5807      return this;
5808    }
5809
5810    public boolean hasLibrary() { 
5811      if (this.library == null)
5812        return false;
5813      for (CanonicalType item : this.library)
5814        if (!item.isEmpty())
5815          return true;
5816      return false;
5817    }
5818
5819    /**
5820     * @return {@link #library} (A reference to a Library resource containing any formal logic used by the plan definition.)
5821     */
5822    public CanonicalType addLibraryElement() {//2 
5823      CanonicalType t = new CanonicalType();
5824      if (this.library == null)
5825        this.library = new ArrayList<CanonicalType>();
5826      this.library.add(t);
5827      return t;
5828    }
5829
5830    /**
5831     * @param value {@link #library} (A reference to a Library resource containing any formal logic used by the plan definition.)
5832     */
5833    public PlanDefinition addLibrary(String value) { //1
5834      CanonicalType t = new CanonicalType();
5835      t.setValue(value);
5836      if (this.library == null)
5837        this.library = new ArrayList<CanonicalType>();
5838      this.library.add(t);
5839      return this;
5840    }
5841
5842    /**
5843     * @param value {@link #library} (A reference to a Library resource containing any formal logic used by the plan definition.)
5844     */
5845    public boolean hasLibrary(String value) { 
5846      if (this.library == null)
5847        return false;
5848      for (CanonicalType v : this.library)
5849        if (v.getValue().equals(value)) // canonical
5850          return true;
5851      return false;
5852    }
5853
5854    /**
5855     * @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.)
5856     */
5857    public List<PlanDefinitionGoalComponent> getGoal() { 
5858      if (this.goal == null)
5859        this.goal = new ArrayList<PlanDefinitionGoalComponent>();
5860      return this.goal;
5861    }
5862
5863    /**
5864     * @return Returns a reference to <code>this</code> for easy method chaining
5865     */
5866    public PlanDefinition setGoal(List<PlanDefinitionGoalComponent> theGoal) { 
5867      this.goal = theGoal;
5868      return this;
5869    }
5870
5871    public boolean hasGoal() { 
5872      if (this.goal == null)
5873        return false;
5874      for (PlanDefinitionGoalComponent item : this.goal)
5875        if (!item.isEmpty())
5876          return true;
5877      return false;
5878    }
5879
5880    public PlanDefinitionGoalComponent addGoal() { //3
5881      PlanDefinitionGoalComponent t = new PlanDefinitionGoalComponent();
5882      if (this.goal == null)
5883        this.goal = new ArrayList<PlanDefinitionGoalComponent>();
5884      this.goal.add(t);
5885      return t;
5886    }
5887
5888    public PlanDefinition addGoal(PlanDefinitionGoalComponent t) { //3
5889      if (t == null)
5890        return this;
5891      if (this.goal == null)
5892        this.goal = new ArrayList<PlanDefinitionGoalComponent>();
5893      this.goal.add(t);
5894      return this;
5895    }
5896
5897    /**
5898     * @return The first repetition of repeating field {@link #goal}, creating it if it does not already exist {3}
5899     */
5900    public PlanDefinitionGoalComponent getGoalFirstRep() { 
5901      if (getGoal().isEmpty()) {
5902        addGoal();
5903      }
5904      return getGoal().get(0);
5905    }
5906
5907    /**
5908     * @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.)
5909     */
5910    public List<PlanDefinitionActionComponent> getAction() { 
5911      if (this.action == null)
5912        this.action = new ArrayList<PlanDefinitionActionComponent>();
5913      return this.action;
5914    }
5915
5916    /**
5917     * @return Returns a reference to <code>this</code> for easy method chaining
5918     */
5919    public PlanDefinition setAction(List<PlanDefinitionActionComponent> theAction) { 
5920      this.action = theAction;
5921      return this;
5922    }
5923
5924    public boolean hasAction() { 
5925      if (this.action == null)
5926        return false;
5927      for (PlanDefinitionActionComponent item : this.action)
5928        if (!item.isEmpty())
5929          return true;
5930      return false;
5931    }
5932
5933    public PlanDefinitionActionComponent addAction() { //3
5934      PlanDefinitionActionComponent t = new PlanDefinitionActionComponent();
5935      if (this.action == null)
5936        this.action = new ArrayList<PlanDefinitionActionComponent>();
5937      this.action.add(t);
5938      return t;
5939    }
5940
5941    public PlanDefinition addAction(PlanDefinitionActionComponent t) { //3
5942      if (t == null)
5943        return this;
5944      if (this.action == null)
5945        this.action = new ArrayList<PlanDefinitionActionComponent>();
5946      this.action.add(t);
5947      return this;
5948    }
5949
5950    /**
5951     * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist {3}
5952     */
5953    public PlanDefinitionActionComponent getActionFirstRep() { 
5954      if (getAction().isEmpty()) {
5955        addAction();
5956      }
5957      return getAction().get(0);
5958    }
5959
5960      protected void listChildren(List<Property> children) {
5961        super.listChildren(children);
5962        children.add(new Property("url", "uri", "An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.", 0, 1, url));
5963        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));
5964        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));
5965        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));
5966        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the plan definition.", 0, 1, title));
5967        children.add(new Property("subtitle", "string", "An explanatory or alternate title for the plan definition giving additional information about its content.", 0, 1, subtitle));
5968        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));
5969        children.add(new Property("status", "code", "The status of this plan definition. Enables tracking the life-cycle of the content.", 0, 1, status));
5970        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));
5971        children.add(new Property("subject[x]", "CodeableConcept|Reference(Group)|canonical(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));
5972        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));
5973        children.add(new Property("publisher", "string", "The name of the organization or individual that published the plan definition.", 0, 1, publisher));
5974        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));
5975        children.add(new Property("description", "markdown", "A free text natural language description of the plan definition from a consumer's perspective.", 0, 1, description));
5976        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));
5977        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));
5978        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));
5979        children.add(new Property("usage", "string", "A detailed description of how the plan definition is used from a clinical perspective.", 0, 1, usage));
5980        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));
5981        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));
5982        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));
5983        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));
5984        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));
5985        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));
5986        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));
5987        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));
5988        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));
5989        children.add(new Property("relatedArtifact", "RelatedArtifact", "Related artifacts such as additional documentation, justification, or bibliographic references.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact));
5990        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));
5991        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));
5992        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));
5993      }
5994
5995      @Override
5996      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5997        switch (_hash) {
5998        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.", 0, 1, url);
5999        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);
6000        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);
6001        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);
6002        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the plan definition.", 0, 1, title);
6003        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);
6004        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);
6005        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);
6006        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);
6007        case -573640748: /*subject[x]*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)|canonical(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);
6008        case -1867885268: /*subject*/  return new Property("subject[x]", "CodeableConcept|Reference(Group)|canonical(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);
6009        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);
6010        case 772938623: /*subjectReference*/  return new Property("subject[x]", "Reference(Group)", "A code, group definition, or canonical reference that describes  or identifies the intended subject of the plan definition. Canonical references are allowed to support the definition of protocols for drug and substance quality specifications, and is allowed to reference a MedicinalProductDefinition, SubstanceDefinition, AdministrableProductDefinition, ManufacturedItemDefinition, or PackagedProductDefinition resource.", 0, 1, subject);
6011        case -1768521432: /*subjectCanonical*/  return new Property("subject[x]", "canonical(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);
6012        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);
6013        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the organization or individual that published the plan definition.", 0, 1, publisher);
6014        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);
6015        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);
6016        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);
6017        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);
6018        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);
6019        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);
6020        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);
6021        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);
6022        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);
6023        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);
6024        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);
6025        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);
6026        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);
6027        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);
6028        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);
6029        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);
6030        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);
6031        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);
6032        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);
6033        default: return super.getNamedProperty(_hash, _name, _checkValid);
6034        }
6035
6036      }
6037
6038      @Override
6039      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6040        switch (hash) {
6041        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
6042        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
6043        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
6044        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
6045        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
6046        case -2060497896: /*subtitle*/ return this.subtitle == null ? new Base[0] : new Base[] {this.subtitle}; // StringType
6047        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
6048        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
6049        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
6050        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // DataType
6051        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
6052        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
6053        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
6054        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
6055        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
6056        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
6057        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
6058        case 111574433: /*usage*/ return this.usage == null ? new Base[0] : new Base[] {this.usage}; // StringType
6059        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
6060        case 223539345: /*approvalDate*/ return this.approvalDate == null ? new Base[0] : new Base[] {this.approvalDate}; // DateType
6061        case -1687512484: /*lastReviewDate*/ return this.lastReviewDate == null ? new Base[0] : new Base[] {this.lastReviewDate}; // DateType
6062        case -403934648: /*effectivePeriod*/ return this.effectivePeriod == null ? new Base[0] : new Base[] {this.effectivePeriod}; // Period
6063        case 110546223: /*topic*/ return this.topic == null ? new Base[0] : this.topic.toArray(new Base[this.topic.size()]); // CodeableConcept
6064        case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // ContactDetail
6065        case -1307827859: /*editor*/ return this.editor == null ? new Base[0] : this.editor.toArray(new Base[this.editor.size()]); // ContactDetail
6066        case -261190139: /*reviewer*/ return this.reviewer == null ? new Base[0] : this.reviewer.toArray(new Base[this.reviewer.size()]); // ContactDetail
6067        case 1740277666: /*endorser*/ return this.endorser == null ? new Base[0] : this.endorser.toArray(new Base[this.endorser.size()]); // ContactDetail
6068        case 666807069: /*relatedArtifact*/ return this.relatedArtifact == null ? new Base[0] : this.relatedArtifact.toArray(new Base[this.relatedArtifact.size()]); // RelatedArtifact
6069        case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // CanonicalType
6070        case 3178259: /*goal*/ return this.goal == null ? new Base[0] : this.goal.toArray(new Base[this.goal.size()]); // PlanDefinitionGoalComponent
6071        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // PlanDefinitionActionComponent
6072        default: return super.getProperty(hash, name, checkValid);
6073        }
6074
6075      }
6076
6077      @Override
6078      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6079        switch (hash) {
6080        case 116079: // url
6081          this.url = TypeConvertor.castToUri(value); // UriType
6082          return value;
6083        case -1618432855: // identifier
6084          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
6085          return value;
6086        case 351608024: // version
6087          this.version = TypeConvertor.castToString(value); // StringType
6088          return value;
6089        case 3373707: // name
6090          this.name = TypeConvertor.castToString(value); // StringType
6091          return value;
6092        case 110371416: // title
6093          this.title = TypeConvertor.castToString(value); // StringType
6094          return value;
6095        case -2060497896: // subtitle
6096          this.subtitle = TypeConvertor.castToString(value); // StringType
6097          return value;
6098        case 3575610: // type
6099          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6100          return value;
6101        case -892481550: // status
6102          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
6103          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
6104          return value;
6105        case -404562712: // experimental
6106          this.experimental = TypeConvertor.castToBoolean(value); // BooleanType
6107          return value;
6108        case -1867885268: // subject
6109          this.subject = TypeConvertor.castToType(value); // DataType
6110          return value;
6111        case 3076014: // date
6112          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
6113          return value;
6114        case 1447404028: // publisher
6115          this.publisher = TypeConvertor.castToString(value); // StringType
6116          return value;
6117        case 951526432: // contact
6118          this.getContact().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
6119          return value;
6120        case -1724546052: // description
6121          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
6122          return value;
6123        case -669707736: // useContext
6124          this.getUseContext().add(TypeConvertor.castToUsageContext(value)); // UsageContext
6125          return value;
6126        case -507075711: // jurisdiction
6127          this.getJurisdiction().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
6128          return value;
6129        case -220463842: // purpose
6130          this.purpose = TypeConvertor.castToMarkdown(value); // MarkdownType
6131          return value;
6132        case 111574433: // usage
6133          this.usage = TypeConvertor.castToString(value); // StringType
6134          return value;
6135        case 1522889671: // copyright
6136          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
6137          return value;
6138        case 223539345: // approvalDate
6139          this.approvalDate = TypeConvertor.castToDate(value); // DateType
6140          return value;
6141        case -1687512484: // lastReviewDate
6142          this.lastReviewDate = TypeConvertor.castToDate(value); // DateType
6143          return value;
6144        case -403934648: // effectivePeriod
6145          this.effectivePeriod = TypeConvertor.castToPeriod(value); // Period
6146          return value;
6147        case 110546223: // topic
6148          this.getTopic().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
6149          return value;
6150        case -1406328437: // author
6151          this.getAuthor().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
6152          return value;
6153        case -1307827859: // editor
6154          this.getEditor().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
6155          return value;
6156        case -261190139: // reviewer
6157          this.getReviewer().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
6158          return value;
6159        case 1740277666: // endorser
6160          this.getEndorser().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
6161          return value;
6162        case 666807069: // relatedArtifact
6163          this.getRelatedArtifact().add(TypeConvertor.castToRelatedArtifact(value)); // RelatedArtifact
6164          return value;
6165        case 166208699: // library
6166          this.getLibrary().add(TypeConvertor.castToCanonical(value)); // CanonicalType
6167          return value;
6168        case 3178259: // goal
6169          this.getGoal().add((PlanDefinitionGoalComponent) value); // PlanDefinitionGoalComponent
6170          return value;
6171        case -1422950858: // action
6172          this.getAction().add((PlanDefinitionActionComponent) value); // PlanDefinitionActionComponent
6173          return value;
6174        default: return super.setProperty(hash, name, value);
6175        }
6176
6177      }
6178
6179      @Override
6180      public Base setProperty(String name, Base value) throws FHIRException {
6181        if (name.equals("url")) {
6182          this.url = TypeConvertor.castToUri(value); // UriType
6183        } else if (name.equals("identifier")) {
6184          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
6185        } else if (name.equals("version")) {
6186          this.version = TypeConvertor.castToString(value); // StringType
6187        } else if (name.equals("name")) {
6188          this.name = TypeConvertor.castToString(value); // StringType
6189        } else if (name.equals("title")) {
6190          this.title = TypeConvertor.castToString(value); // StringType
6191        } else if (name.equals("subtitle")) {
6192          this.subtitle = TypeConvertor.castToString(value); // StringType
6193        } else if (name.equals("type")) {
6194          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6195        } else if (name.equals("status")) {
6196          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
6197          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
6198        } else if (name.equals("experimental")) {
6199          this.experimental = TypeConvertor.castToBoolean(value); // BooleanType
6200        } else if (name.equals("subject[x]")) {
6201          this.subject = TypeConvertor.castToType(value); // DataType
6202        } else if (name.equals("date")) {
6203          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
6204        } else if (name.equals("publisher")) {
6205          this.publisher = TypeConvertor.castToString(value); // StringType
6206        } else if (name.equals("contact")) {
6207          this.getContact().add(TypeConvertor.castToContactDetail(value));
6208        } else if (name.equals("description")) {
6209          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
6210        } else if (name.equals("useContext")) {
6211          this.getUseContext().add(TypeConvertor.castToUsageContext(value));
6212        } else if (name.equals("jurisdiction")) {
6213          this.getJurisdiction().add(TypeConvertor.castToCodeableConcept(value));
6214        } else if (name.equals("purpose")) {
6215          this.purpose = TypeConvertor.castToMarkdown(value); // MarkdownType
6216        } else if (name.equals("usage")) {
6217          this.usage = TypeConvertor.castToString(value); // StringType
6218        } else if (name.equals("copyright")) {
6219          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
6220        } else if (name.equals("approvalDate")) {
6221          this.approvalDate = TypeConvertor.castToDate(value); // DateType
6222        } else if (name.equals("lastReviewDate")) {
6223          this.lastReviewDate = TypeConvertor.castToDate(value); // DateType
6224        } else if (name.equals("effectivePeriod")) {
6225          this.effectivePeriod = TypeConvertor.castToPeriod(value); // Period
6226        } else if (name.equals("topic")) {
6227          this.getTopic().add(TypeConvertor.castToCodeableConcept(value));
6228        } else if (name.equals("author")) {
6229          this.getAuthor().add(TypeConvertor.castToContactDetail(value));
6230        } else if (name.equals("editor")) {
6231          this.getEditor().add(TypeConvertor.castToContactDetail(value));
6232        } else if (name.equals("reviewer")) {
6233          this.getReviewer().add(TypeConvertor.castToContactDetail(value));
6234        } else if (name.equals("endorser")) {
6235          this.getEndorser().add(TypeConvertor.castToContactDetail(value));
6236        } else if (name.equals("relatedArtifact")) {
6237          this.getRelatedArtifact().add(TypeConvertor.castToRelatedArtifact(value));
6238        } else if (name.equals("library")) {
6239          this.getLibrary().add(TypeConvertor.castToCanonical(value));
6240        } else if (name.equals("goal")) {
6241          this.getGoal().add((PlanDefinitionGoalComponent) value);
6242        } else if (name.equals("action")) {
6243          this.getAction().add((PlanDefinitionActionComponent) value);
6244        } else
6245          return super.setProperty(name, value);
6246        return value;
6247      }
6248
6249      @Override
6250      public Base makeProperty(int hash, String name) throws FHIRException {
6251        switch (hash) {
6252        case 116079:  return getUrlElement();
6253        case -1618432855:  return addIdentifier(); 
6254        case 351608024:  return getVersionElement();
6255        case 3373707:  return getNameElement();
6256        case 110371416:  return getTitleElement();
6257        case -2060497896:  return getSubtitleElement();
6258        case 3575610:  return getType();
6259        case -892481550:  return getStatusElement();
6260        case -404562712:  return getExperimentalElement();
6261        case -573640748:  return getSubject();
6262        case -1867885268:  return getSubject();
6263        case 3076014:  return getDateElement();
6264        case 1447404028:  return getPublisherElement();
6265        case 951526432:  return addContact(); 
6266        case -1724546052:  return getDescriptionElement();
6267        case -669707736:  return addUseContext(); 
6268        case -507075711:  return addJurisdiction(); 
6269        case -220463842:  return getPurposeElement();
6270        case 111574433:  return getUsageElement();
6271        case 1522889671:  return getCopyrightElement();
6272        case 223539345:  return getApprovalDateElement();
6273        case -1687512484:  return getLastReviewDateElement();
6274        case -403934648:  return getEffectivePeriod();
6275        case 110546223:  return addTopic(); 
6276        case -1406328437:  return addAuthor(); 
6277        case -1307827859:  return addEditor(); 
6278        case -261190139:  return addReviewer(); 
6279        case 1740277666:  return addEndorser(); 
6280        case 666807069:  return addRelatedArtifact(); 
6281        case 166208699:  return addLibraryElement();
6282        case 3178259:  return addGoal(); 
6283        case -1422950858:  return addAction(); 
6284        default: return super.makeProperty(hash, name);
6285        }
6286
6287      }
6288
6289      @Override
6290      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6291        switch (hash) {
6292        case 116079: /*url*/ return new String[] {"uri"};
6293        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
6294        case 351608024: /*version*/ return new String[] {"string"};
6295        case 3373707: /*name*/ return new String[] {"string"};
6296        case 110371416: /*title*/ return new String[] {"string"};
6297        case -2060497896: /*subtitle*/ return new String[] {"string"};
6298        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
6299        case -892481550: /*status*/ return new String[] {"code"};
6300        case -404562712: /*experimental*/ return new String[] {"boolean"};
6301        case -1867885268: /*subject*/ return new String[] {"CodeableConcept", "Reference", "canonical"};
6302        case 3076014: /*date*/ return new String[] {"dateTime"};
6303        case 1447404028: /*publisher*/ return new String[] {"string"};
6304        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
6305        case -1724546052: /*description*/ return new String[] {"markdown"};
6306        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
6307        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
6308        case -220463842: /*purpose*/ return new String[] {"markdown"};
6309        case 111574433: /*usage*/ return new String[] {"string"};
6310        case 1522889671: /*copyright*/ return new String[] {"markdown"};
6311        case 223539345: /*approvalDate*/ return new String[] {"date"};
6312        case -1687512484: /*lastReviewDate*/ return new String[] {"date"};
6313        case -403934648: /*effectivePeriod*/ return new String[] {"Period"};
6314        case 110546223: /*topic*/ return new String[] {"CodeableConcept"};
6315        case -1406328437: /*author*/ return new String[] {"ContactDetail"};
6316        case -1307827859: /*editor*/ return new String[] {"ContactDetail"};
6317        case -261190139: /*reviewer*/ return new String[] {"ContactDetail"};
6318        case 1740277666: /*endorser*/ return new String[] {"ContactDetail"};
6319        case 666807069: /*relatedArtifact*/ return new String[] {"RelatedArtifact"};
6320        case 166208699: /*library*/ return new String[] {"canonical"};
6321        case 3178259: /*goal*/ return new String[] {};
6322        case -1422950858: /*action*/ return new String[] {};
6323        default: return super.getTypesForProperty(hash, name);
6324        }
6325
6326      }
6327
6328      @Override
6329      public Base addChild(String name) throws FHIRException {
6330        if (name.equals("url")) {
6331          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.url");
6332        }
6333        else if (name.equals("identifier")) {
6334          return addIdentifier();
6335        }
6336        else if (name.equals("version")) {
6337          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.version");
6338        }
6339        else if (name.equals("name")) {
6340          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.name");
6341        }
6342        else if (name.equals("title")) {
6343          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.title");
6344        }
6345        else if (name.equals("subtitle")) {
6346          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.subtitle");
6347        }
6348        else if (name.equals("type")) {
6349          this.type = new CodeableConcept();
6350          return this.type;
6351        }
6352        else if (name.equals("status")) {
6353          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.status");
6354        }
6355        else if (name.equals("experimental")) {
6356          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.experimental");
6357        }
6358        else if (name.equals("subjectCodeableConcept")) {
6359          this.subject = new CodeableConcept();
6360          return this.subject;
6361        }
6362        else if (name.equals("subjectReference")) {
6363          this.subject = new Reference();
6364          return this.subject;
6365        }
6366        else if (name.equals("subjectCanonical")) {
6367          this.subject = new CanonicalType();
6368          return this.subject;
6369        }
6370        else if (name.equals("date")) {
6371          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.date");
6372        }
6373        else if (name.equals("publisher")) {
6374          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.publisher");
6375        }
6376        else if (name.equals("contact")) {
6377          return addContact();
6378        }
6379        else if (name.equals("description")) {
6380          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.description");
6381        }
6382        else if (name.equals("useContext")) {
6383          return addUseContext();
6384        }
6385        else if (name.equals("jurisdiction")) {
6386          return addJurisdiction();
6387        }
6388        else if (name.equals("purpose")) {
6389          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.purpose");
6390        }
6391        else if (name.equals("usage")) {
6392          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.usage");
6393        }
6394        else if (name.equals("copyright")) {
6395          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.copyright");
6396        }
6397        else if (name.equals("approvalDate")) {
6398          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.approvalDate");
6399        }
6400        else if (name.equals("lastReviewDate")) {
6401          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.lastReviewDate");
6402        }
6403        else if (name.equals("effectivePeriod")) {
6404          this.effectivePeriod = new Period();
6405          return this.effectivePeriod;
6406        }
6407        else if (name.equals("topic")) {
6408          return addTopic();
6409        }
6410        else if (name.equals("author")) {
6411          return addAuthor();
6412        }
6413        else if (name.equals("editor")) {
6414          return addEditor();
6415        }
6416        else if (name.equals("reviewer")) {
6417          return addReviewer();
6418        }
6419        else if (name.equals("endorser")) {
6420          return addEndorser();
6421        }
6422        else if (name.equals("relatedArtifact")) {
6423          return addRelatedArtifact();
6424        }
6425        else if (name.equals("library")) {
6426          throw new FHIRException("Cannot call addChild on a primitive type PlanDefinition.library");
6427        }
6428        else if (name.equals("goal")) {
6429          return addGoal();
6430        }
6431        else if (name.equals("action")) {
6432          return addAction();
6433        }
6434        else
6435          return super.addChild(name);
6436      }
6437
6438  public String fhirType() {
6439    return "PlanDefinition";
6440
6441  }
6442
6443      public PlanDefinition copy() {
6444        PlanDefinition dst = new PlanDefinition();
6445        copyValues(dst);
6446        return dst;
6447      }
6448
6449      public void copyValues(PlanDefinition dst) {
6450        super.copyValues(dst);
6451        dst.url = url == null ? null : url.copy();
6452        if (identifier != null) {
6453          dst.identifier = new ArrayList<Identifier>();
6454          for (Identifier i : identifier)
6455            dst.identifier.add(i.copy());
6456        };
6457        dst.version = version == null ? null : version.copy();
6458        dst.name = name == null ? null : name.copy();
6459        dst.title = title == null ? null : title.copy();
6460        dst.subtitle = subtitle == null ? null : subtitle.copy();
6461        dst.type = type == null ? null : type.copy();
6462        dst.status = status == null ? null : status.copy();
6463        dst.experimental = experimental == null ? null : experimental.copy();
6464        dst.subject = subject == null ? null : subject.copy();
6465        dst.date = date == null ? null : date.copy();
6466        dst.publisher = publisher == null ? null : publisher.copy();
6467        if (contact != null) {
6468          dst.contact = new ArrayList<ContactDetail>();
6469          for (ContactDetail i : contact)
6470            dst.contact.add(i.copy());
6471        };
6472        dst.description = description == null ? null : description.copy();
6473        if (useContext != null) {
6474          dst.useContext = new ArrayList<UsageContext>();
6475          for (UsageContext i : useContext)
6476            dst.useContext.add(i.copy());
6477        };
6478        if (jurisdiction != null) {
6479          dst.jurisdiction = new ArrayList<CodeableConcept>();
6480          for (CodeableConcept i : jurisdiction)
6481            dst.jurisdiction.add(i.copy());
6482        };
6483        dst.purpose = purpose == null ? null : purpose.copy();
6484        dst.usage = usage == null ? null : usage.copy();
6485        dst.copyright = copyright == null ? null : copyright.copy();
6486        dst.approvalDate = approvalDate == null ? null : approvalDate.copy();
6487        dst.lastReviewDate = lastReviewDate == null ? null : lastReviewDate.copy();
6488        dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy();
6489        if (topic != null) {
6490          dst.topic = new ArrayList<CodeableConcept>();
6491          for (CodeableConcept i : topic)
6492            dst.topic.add(i.copy());
6493        };
6494        if (author != null) {
6495          dst.author = new ArrayList<ContactDetail>();
6496          for (ContactDetail i : author)
6497            dst.author.add(i.copy());
6498        };
6499        if (editor != null) {
6500          dst.editor = new ArrayList<ContactDetail>();
6501          for (ContactDetail i : editor)
6502            dst.editor.add(i.copy());
6503        };
6504        if (reviewer != null) {
6505          dst.reviewer = new ArrayList<ContactDetail>();
6506          for (ContactDetail i : reviewer)
6507            dst.reviewer.add(i.copy());
6508        };
6509        if (endorser != null) {
6510          dst.endorser = new ArrayList<ContactDetail>();
6511          for (ContactDetail i : endorser)
6512            dst.endorser.add(i.copy());
6513        };
6514        if (relatedArtifact != null) {
6515          dst.relatedArtifact = new ArrayList<RelatedArtifact>();
6516          for (RelatedArtifact i : relatedArtifact)
6517            dst.relatedArtifact.add(i.copy());
6518        };
6519        if (library != null) {
6520          dst.library = new ArrayList<CanonicalType>();
6521          for (CanonicalType i : library)
6522            dst.library.add(i.copy());
6523        };
6524        if (goal != null) {
6525          dst.goal = new ArrayList<PlanDefinitionGoalComponent>();
6526          for (PlanDefinitionGoalComponent i : goal)
6527            dst.goal.add(i.copy());
6528        };
6529        if (action != null) {
6530          dst.action = new ArrayList<PlanDefinitionActionComponent>();
6531          for (PlanDefinitionActionComponent i : action)
6532            dst.action.add(i.copy());
6533        };
6534      }
6535
6536      protected PlanDefinition typedCopy() {
6537        return copy();
6538      }
6539
6540      @Override
6541      public boolean equalsDeep(Base other_) {
6542        if (!super.equalsDeep(other_))
6543          return false;
6544        if (!(other_ instanceof PlanDefinition))
6545          return false;
6546        PlanDefinition o = (PlanDefinition) other_;
6547        return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true)
6548           && compareDeep(name, o.name, true) && compareDeep(title, o.title, true) && compareDeep(subtitle, o.subtitle, true)
6549           && compareDeep(type, o.type, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true)
6550           && compareDeep(subject, o.subject, true) && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true)
6551           && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true)
6552           && compareDeep(jurisdiction, o.jurisdiction, true) && compareDeep(purpose, o.purpose, true) && compareDeep(usage, o.usage, true)
6553           && compareDeep(copyright, o.copyright, true) && compareDeep(approvalDate, o.approvalDate, true)
6554           && compareDeep(lastReviewDate, o.lastReviewDate, true) && compareDeep(effectivePeriod, o.effectivePeriod, true)
6555           && compareDeep(topic, o.topic, true) && compareDeep(author, o.author, true) && compareDeep(editor, o.editor, true)
6556           && compareDeep(reviewer, o.reviewer, true) && compareDeep(endorser, o.endorser, true) && compareDeep(relatedArtifact, o.relatedArtifact, true)
6557           && compareDeep(library, o.library, true) && compareDeep(goal, o.goal, true) && compareDeep(action, o.action, true)
6558          ;
6559      }
6560
6561      @Override
6562      public boolean equalsShallow(Base other_) {
6563        if (!super.equalsShallow(other_))
6564          return false;
6565        if (!(other_ instanceof PlanDefinition))
6566          return false;
6567        PlanDefinition o = (PlanDefinition) other_;
6568        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true)
6569           && compareValues(title, o.title, true) && compareValues(subtitle, o.subtitle, true) && compareValues(status, o.status, true)
6570           && compareValues(experimental, o.experimental, true) && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true)
6571           && compareValues(description, o.description, true) && compareValues(purpose, o.purpose, true) && compareValues(usage, o.usage, true)
6572           && compareValues(copyright, o.copyright, true) && compareValues(approvalDate, o.approvalDate, true)
6573           && compareValues(lastReviewDate, o.lastReviewDate, true) && compareValues(library, o.library, true)
6574          ;
6575      }
6576
6577      public boolean isEmpty() {
6578        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, identifier, version
6579          , name, title, subtitle, type, status, experimental, subject, date, publisher
6580          , contact, description, useContext, jurisdiction, purpose, usage, copyright, approvalDate
6581          , lastReviewDate, effectivePeriod, topic, author, editor, reviewer, endorser, relatedArtifact
6582          , library, goal, action);
6583      }
6584
6585  @Override
6586  public ResourceType getResourceType() {
6587    return ResourceType.PlanDefinition;
6588   }
6589
6590 /**
6591   * Search parameter: <b>composed-of</b>
6592   * <p>
6593   * Description: <b>What resource is being referenced</b><br>
6594   * Type: <b>reference</b><br>
6595   * Path: <b>PlanDefinition.relatedArtifact.where(type='composed-of').resource</b><br>
6596   * </p>
6597   */
6598  @SearchParamDefinition(name="composed-of", path="PlanDefinition.relatedArtifact.where(type='composed-of').resource", description="What resource is being referenced", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CarePlan.class, CareTeam.class, CatalogEntry.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, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.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, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Media.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationStatement.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.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, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchDefinition.class, ResearchElementDefinition.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, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
6599  public static final String SP_COMPOSED_OF = "composed-of";
6600 /**
6601   * <b>Fluent Client</b> search parameter constant for <b>composed-of</b>
6602   * <p>
6603   * Description: <b>What resource is being referenced</b><br>
6604   * Type: <b>reference</b><br>
6605   * Path: <b>PlanDefinition.relatedArtifact.where(type='composed-of').resource</b><br>
6606   * </p>
6607   */
6608  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COMPOSED_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_COMPOSED_OF);
6609
6610/**
6611   * Constant for fluent queries to be used to add include statements. Specifies
6612   * the path value of "<b>PlanDefinition:composed-of</b>".
6613   */
6614  public static final ca.uhn.fhir.model.api.Include INCLUDE_COMPOSED_OF = new ca.uhn.fhir.model.api.Include("PlanDefinition:composed-of").toLocked();
6615
6616 /**
6617   * Search parameter: <b>context-quantity</b>
6618   * <p>
6619   * Description: <b>A quantity- or range-valued use context assigned to the plan definition</b><br>
6620   * Type: <b>quantity</b><br>
6621   * Path: <b>(PlanDefinition.useContext.value as Quantity) | (PlanDefinition.useContext.value as Range)</b><br>
6622   * </p>
6623   */
6624  @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" )
6625  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
6626 /**
6627   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
6628   * <p>
6629   * Description: <b>A quantity- or range-valued use context assigned to the plan definition</b><br>
6630   * Type: <b>quantity</b><br>
6631   * Path: <b>(PlanDefinition.useContext.value as Quantity) | (PlanDefinition.useContext.value as Range)</b><br>
6632   * </p>
6633   */
6634  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_CONTEXT_QUANTITY);
6635
6636 /**
6637   * Search parameter: <b>context-type-quantity</b>
6638   * <p>
6639   * Description: <b>A use context type and quantity- or range-based value assigned to the plan definition</b><br>
6640   * Type: <b>composite</b><br>
6641   * Path: <b>PlanDefinition.useContext</b><br>
6642   * </p>
6643   */
6644  @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"} )
6645  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
6646 /**
6647   * <b>Fluent Client</b> search parameter constant for <b>context-type-quantity</b>
6648   * <p>
6649   * Description: <b>A use context type and quantity- or range-based value assigned to the plan definition</b><br>
6650   * Type: <b>composite</b><br>
6651   * Path: <b>PlanDefinition.useContext</b><br>
6652   * </p>
6653   */
6654  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);
6655
6656 /**
6657   * Search parameter: <b>context-type-value</b>
6658   * <p>
6659   * Description: <b>A use context type and value assigned to the plan definition</b><br>
6660   * Type: <b>composite</b><br>
6661   * Path: <b>PlanDefinition.useContext</b><br>
6662   * </p>
6663   */
6664  @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"} )
6665  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
6666 /**
6667   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
6668   * <p>
6669   * Description: <b>A use context type and value assigned to the plan definition</b><br>
6670   * Type: <b>composite</b><br>
6671   * Path: <b>PlanDefinition.useContext</b><br>
6672   * </p>
6673   */
6674  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);
6675
6676 /**
6677   * Search parameter: <b>context-type</b>
6678   * <p>
6679   * Description: <b>A type of use context assigned to the plan definition</b><br>
6680   * Type: <b>token</b><br>
6681   * Path: <b>PlanDefinition.useContext.code</b><br>
6682   * </p>
6683   */
6684  @SearchParamDefinition(name="context-type", path="PlanDefinition.useContext.code", description="A type of use context assigned to the plan definition", type="token" )
6685  public static final String SP_CONTEXT_TYPE = "context-type";
6686 /**
6687   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
6688   * <p>
6689   * Description: <b>A type of use context assigned to the plan definition</b><br>
6690   * Type: <b>token</b><br>
6691   * Path: <b>PlanDefinition.useContext.code</b><br>
6692   * </p>
6693   */
6694  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT_TYPE);
6695
6696 /**
6697   * Search parameter: <b>context</b>
6698   * <p>
6699   * Description: <b>A use context assigned to the plan definition</b><br>
6700   * Type: <b>token</b><br>
6701   * Path: <b>(PlanDefinition.useContext.value as CodeableConcept)</b><br>
6702   * </p>
6703   */
6704  @SearchParamDefinition(name="context", path="(PlanDefinition.useContext.value as CodeableConcept)", description="A use context assigned to the plan definition", type="token" )
6705  public static final String SP_CONTEXT = "context";
6706 /**
6707   * <b>Fluent Client</b> search parameter constant for <b>context</b>
6708   * <p>
6709   * Description: <b>A use context assigned to the plan definition</b><br>
6710   * Type: <b>token</b><br>
6711   * Path: <b>(PlanDefinition.useContext.value as CodeableConcept)</b><br>
6712   * </p>
6713   */
6714  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT);
6715
6716 /**
6717   * Search parameter: <b>date</b>
6718   * <p>
6719   * Description: <b>The plan definition publication date</b><br>
6720   * Type: <b>date</b><br>
6721   * Path: <b>PlanDefinition.date</b><br>
6722   * </p>
6723   */
6724  @SearchParamDefinition(name="date", path="PlanDefinition.date", description="The plan definition publication date", type="date" )
6725  public static final String SP_DATE = "date";
6726 /**
6727   * <b>Fluent Client</b> search parameter constant for <b>date</b>
6728   * <p>
6729   * Description: <b>The plan definition publication date</b><br>
6730   * Type: <b>date</b><br>
6731   * Path: <b>PlanDefinition.date</b><br>
6732   * </p>
6733   */
6734  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
6735
6736 /**
6737   * Search parameter: <b>definition</b>
6738   * <p>
6739   * Description: <b>Activity or plan definitions used by plan definition</b><br>
6740   * Type: <b>reference</b><br>
6741   * Path: <b>PlanDefinition.action.definition</b><br>
6742   * </p>
6743   */
6744  @SearchParamDefinition(name="definition", path="PlanDefinition.action.definition", description="Activity or plan definitions used by plan definition", type="reference", target={ActivityDefinition.class, PlanDefinition.class, Questionnaire.class } )
6745  public static final String SP_DEFINITION = "definition";
6746 /**
6747   * <b>Fluent Client</b> search parameter constant for <b>definition</b>
6748   * <p>
6749   * Description: <b>Activity or plan definitions used by plan definition</b><br>
6750   * Type: <b>reference</b><br>
6751   * Path: <b>PlanDefinition.action.definition</b><br>
6752   * </p>
6753   */
6754  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEFINITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEFINITION);
6755
6756/**
6757   * Constant for fluent queries to be used to add include statements. Specifies
6758   * the path value of "<b>PlanDefinition:definition</b>".
6759   */
6760  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEFINITION = new ca.uhn.fhir.model.api.Include("PlanDefinition:definition").toLocked();
6761
6762 /**
6763   * Search parameter: <b>depends-on</b>
6764   * <p>
6765   * Description: <b>What resource is being referenced</b><br>
6766   * Type: <b>reference</b><br>
6767   * Path: <b>PlanDefinition.relatedArtifact.where(type='depends-on').resource | PlanDefinition.library</b><br>
6768   * </p>
6769   */
6770  @SearchParamDefinition(name="depends-on", path="PlanDefinition.relatedArtifact.where(type='depends-on').resource | PlanDefinition.library", description="What resource is being referenced", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CarePlan.class, CareTeam.class, CatalogEntry.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, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.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, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Media.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationStatement.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.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, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchDefinition.class, ResearchElementDefinition.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, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
6771  public static final String SP_DEPENDS_ON = "depends-on";
6772 /**
6773   * <b>Fluent Client</b> search parameter constant for <b>depends-on</b>
6774   * <p>
6775   * Description: <b>What resource is being referenced</b><br>
6776   * Type: <b>reference</b><br>
6777   * Path: <b>PlanDefinition.relatedArtifact.where(type='depends-on').resource | PlanDefinition.library</b><br>
6778   * </p>
6779   */
6780  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEPENDS_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEPENDS_ON);
6781
6782/**
6783   * Constant for fluent queries to be used to add include statements. Specifies
6784   * the path value of "<b>PlanDefinition:depends-on</b>".
6785   */
6786  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEPENDS_ON = new ca.uhn.fhir.model.api.Include("PlanDefinition:depends-on").toLocked();
6787
6788 /**
6789   * Search parameter: <b>derived-from</b>
6790   * <p>
6791   * Description: <b>What resource is being referenced</b><br>
6792   * Type: <b>reference</b><br>
6793   * Path: <b>PlanDefinition.relatedArtifact.where(type='derived-from').resource</b><br>
6794   * </p>
6795   */
6796  @SearchParamDefinition(name="derived-from", path="PlanDefinition.relatedArtifact.where(type='derived-from').resource", description="What resource is being referenced", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CarePlan.class, CareTeam.class, CatalogEntry.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, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.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, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Media.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationStatement.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.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, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchDefinition.class, ResearchElementDefinition.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, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
6797  public static final String SP_DERIVED_FROM = "derived-from";
6798 /**
6799   * <b>Fluent Client</b> search parameter constant for <b>derived-from</b>
6800   * <p>
6801   * Description: <b>What resource is being referenced</b><br>
6802   * Type: <b>reference</b><br>
6803   * Path: <b>PlanDefinition.relatedArtifact.where(type='derived-from').resource</b><br>
6804   * </p>
6805   */
6806  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DERIVED_FROM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DERIVED_FROM);
6807
6808/**
6809   * Constant for fluent queries to be used to add include statements. Specifies
6810   * the path value of "<b>PlanDefinition:derived-from</b>".
6811   */
6812  public static final ca.uhn.fhir.model.api.Include INCLUDE_DERIVED_FROM = new ca.uhn.fhir.model.api.Include("PlanDefinition:derived-from").toLocked();
6813
6814 /**
6815   * Search parameter: <b>description</b>
6816   * <p>
6817   * Description: <b>The description of the plan definition</b><br>
6818   * Type: <b>string</b><br>
6819   * Path: <b>PlanDefinition.description</b><br>
6820   * </p>
6821   */
6822  @SearchParamDefinition(name="description", path="PlanDefinition.description", description="The description of the plan definition", type="string" )
6823  public static final String SP_DESCRIPTION = "description";
6824 /**
6825   * <b>Fluent Client</b> search parameter constant for <b>description</b>
6826   * <p>
6827   * Description: <b>The description of the plan definition</b><br>
6828   * Type: <b>string</b><br>
6829   * Path: <b>PlanDefinition.description</b><br>
6830   * </p>
6831   */
6832  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
6833
6834 /**
6835   * Search parameter: <b>effective</b>
6836   * <p>
6837   * Description: <b>The time during which the plan definition is intended to be in use</b><br>
6838   * Type: <b>date</b><br>
6839   * Path: <b>PlanDefinition.effectivePeriod</b><br>
6840   * </p>
6841   */
6842  @SearchParamDefinition(name="effective", path="PlanDefinition.effectivePeriod", description="The time during which the plan definition is intended to be in use", type="date" )
6843  public static final String SP_EFFECTIVE = "effective";
6844 /**
6845   * <b>Fluent Client</b> search parameter constant for <b>effective</b>
6846   * <p>
6847   * Description: <b>The time during which the plan definition is intended to be in use</b><br>
6848   * Type: <b>date</b><br>
6849   * Path: <b>PlanDefinition.effectivePeriod</b><br>
6850   * </p>
6851   */
6852  public static final ca.uhn.fhir.rest.gclient.DateClientParam EFFECTIVE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EFFECTIVE);
6853
6854 /**
6855   * Search parameter: <b>identifier</b>
6856   * <p>
6857   * Description: <b>External identifier for the plan definition</b><br>
6858   * Type: <b>token</b><br>
6859   * Path: <b>PlanDefinition.identifier</b><br>
6860   * </p>
6861   */
6862  @SearchParamDefinition(name="identifier", path="PlanDefinition.identifier", description="External identifier for the plan definition", type="token" )
6863  public static final String SP_IDENTIFIER = "identifier";
6864 /**
6865   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
6866   * <p>
6867   * Description: <b>External identifier for the plan definition</b><br>
6868   * Type: <b>token</b><br>
6869   * Path: <b>PlanDefinition.identifier</b><br>
6870   * </p>
6871   */
6872  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
6873
6874 /**
6875   * Search parameter: <b>jurisdiction</b>
6876   * <p>
6877   * Description: <b>Intended jurisdiction for the plan definition</b><br>
6878   * Type: <b>token</b><br>
6879   * Path: <b>PlanDefinition.jurisdiction</b><br>
6880   * </p>
6881   */
6882  @SearchParamDefinition(name="jurisdiction", path="PlanDefinition.jurisdiction", description="Intended jurisdiction for the plan definition", type="token" )
6883  public static final String SP_JURISDICTION = "jurisdiction";
6884 /**
6885   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
6886   * <p>
6887   * Description: <b>Intended jurisdiction for the plan definition</b><br>
6888   * Type: <b>token</b><br>
6889   * Path: <b>PlanDefinition.jurisdiction</b><br>
6890   * </p>
6891   */
6892  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
6893
6894 /**
6895   * Search parameter: <b>name</b>
6896   * <p>
6897   * Description: <b>Computationally friendly name of the plan definition</b><br>
6898   * Type: <b>string</b><br>
6899   * Path: <b>PlanDefinition.name</b><br>
6900   * </p>
6901   */
6902  @SearchParamDefinition(name="name", path="PlanDefinition.name", description="Computationally friendly name of the plan definition", type="string" )
6903  public static final String SP_NAME = "name";
6904 /**
6905   * <b>Fluent Client</b> search parameter constant for <b>name</b>
6906   * <p>
6907   * Description: <b>Computationally friendly name of the plan definition</b><br>
6908   * Type: <b>string</b><br>
6909   * Path: <b>PlanDefinition.name</b><br>
6910   * </p>
6911   */
6912  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
6913
6914 /**
6915   * Search parameter: <b>predecessor</b>
6916   * <p>
6917   * Description: <b>What resource is being referenced</b><br>
6918   * Type: <b>reference</b><br>
6919   * Path: <b>PlanDefinition.relatedArtifact.where(type='predecessor').resource</b><br>
6920   * </p>
6921   */
6922  @SearchParamDefinition(name="predecessor", path="PlanDefinition.relatedArtifact.where(type='predecessor').resource", description="What resource is being referenced", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CarePlan.class, CareTeam.class, CatalogEntry.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, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.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, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Media.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationStatement.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.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, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchDefinition.class, ResearchElementDefinition.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, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
6923  public static final String SP_PREDECESSOR = "predecessor";
6924 /**
6925   * <b>Fluent Client</b> search parameter constant for <b>predecessor</b>
6926   * <p>
6927   * Description: <b>What resource is being referenced</b><br>
6928   * Type: <b>reference</b><br>
6929   * Path: <b>PlanDefinition.relatedArtifact.where(type='predecessor').resource</b><br>
6930   * </p>
6931   */
6932  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PREDECESSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PREDECESSOR);
6933
6934/**
6935   * Constant for fluent queries to be used to add include statements. Specifies
6936   * the path value of "<b>PlanDefinition:predecessor</b>".
6937   */
6938  public static final ca.uhn.fhir.model.api.Include INCLUDE_PREDECESSOR = new ca.uhn.fhir.model.api.Include("PlanDefinition:predecessor").toLocked();
6939
6940 /**
6941   * Search parameter: <b>publisher</b>
6942   * <p>
6943   * Description: <b>Name of the publisher of the plan definition</b><br>
6944   * Type: <b>string</b><br>
6945   * Path: <b>PlanDefinition.publisher</b><br>
6946   * </p>
6947   */
6948  @SearchParamDefinition(name="publisher", path="PlanDefinition.publisher", description="Name of the publisher of the plan definition", type="string" )
6949  public static final String SP_PUBLISHER = "publisher";
6950 /**
6951   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
6952   * <p>
6953   * Description: <b>Name of the publisher of the plan definition</b><br>
6954   * Type: <b>string</b><br>
6955   * Path: <b>PlanDefinition.publisher</b><br>
6956   * </p>
6957   */
6958  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
6959
6960 /**
6961   * Search parameter: <b>status</b>
6962   * <p>
6963   * Description: <b>The current status of the plan definition</b><br>
6964   * Type: <b>token</b><br>
6965   * Path: <b>PlanDefinition.status</b><br>
6966   * </p>
6967   */
6968  @SearchParamDefinition(name="status", path="PlanDefinition.status", description="The current status of the plan definition", type="token" )
6969  public static final String SP_STATUS = "status";
6970 /**
6971   * <b>Fluent Client</b> search parameter constant for <b>status</b>
6972   * <p>
6973   * Description: <b>The current status of the plan definition</b><br>
6974   * Type: <b>token</b><br>
6975   * Path: <b>PlanDefinition.status</b><br>
6976   * </p>
6977   */
6978  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
6979
6980 /**
6981   * Search parameter: <b>successor</b>
6982   * <p>
6983   * Description: <b>What resource is being referenced</b><br>
6984   * Type: <b>reference</b><br>
6985   * Path: <b>PlanDefinition.relatedArtifact.where(type='successor').resource</b><br>
6986   * </p>
6987   */
6988  @SearchParamDefinition(name="successor", path="PlanDefinition.relatedArtifact.where(type='successor').resource", description="What resource is being referenced", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CarePlan.class, CareTeam.class, CatalogEntry.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, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.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, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Media.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationStatement.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.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, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchDefinition.class, ResearchElementDefinition.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, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
6989  public static final String SP_SUCCESSOR = "successor";
6990 /**
6991   * <b>Fluent Client</b> search parameter constant for <b>successor</b>
6992   * <p>
6993   * Description: <b>What resource is being referenced</b><br>
6994   * Type: <b>reference</b><br>
6995   * Path: <b>PlanDefinition.relatedArtifact.where(type='successor').resource</b><br>
6996   * </p>
6997   */
6998  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUCCESSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUCCESSOR);
6999
7000/**
7001   * Constant for fluent queries to be used to add include statements. Specifies
7002   * the path value of "<b>PlanDefinition:successor</b>".
7003   */
7004  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUCCESSOR = new ca.uhn.fhir.model.api.Include("PlanDefinition:successor").toLocked();
7005
7006 /**
7007   * Search parameter: <b>title</b>
7008   * <p>
7009   * Description: <b>The human-friendly name of the plan definition</b><br>
7010   * Type: <b>string</b><br>
7011   * Path: <b>PlanDefinition.title</b><br>
7012   * </p>
7013   */
7014  @SearchParamDefinition(name="title", path="PlanDefinition.title", description="The human-friendly name of the plan definition", type="string" )
7015  public static final String SP_TITLE = "title";
7016 /**
7017   * <b>Fluent Client</b> search parameter constant for <b>title</b>
7018   * <p>
7019   * Description: <b>The human-friendly name of the plan definition</b><br>
7020   * Type: <b>string</b><br>
7021   * Path: <b>PlanDefinition.title</b><br>
7022   * </p>
7023   */
7024  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
7025
7026 /**
7027   * Search parameter: <b>topic</b>
7028   * <p>
7029   * Description: <b>Topics associated with the module</b><br>
7030   * Type: <b>token</b><br>
7031   * Path: <b>PlanDefinition.topic</b><br>
7032   * </p>
7033   */
7034  @SearchParamDefinition(name="topic", path="PlanDefinition.topic", description="Topics associated with the module", type="token" )
7035  public static final String SP_TOPIC = "topic";
7036 /**
7037   * <b>Fluent Client</b> search parameter constant for <b>topic</b>
7038   * <p>
7039   * Description: <b>Topics associated with the module</b><br>
7040   * Type: <b>token</b><br>
7041   * Path: <b>PlanDefinition.topic</b><br>
7042   * </p>
7043   */
7044  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC);
7045
7046 /**
7047   * Search parameter: <b>type</b>
7048   * <p>
7049   * Description: <b>The type of artifact the plan (e.g. order-set, eca-rule, protocol)</b><br>
7050   * Type: <b>token</b><br>
7051   * Path: <b>PlanDefinition.type</b><br>
7052   * </p>
7053   */
7054  @SearchParamDefinition(name="type", path="PlanDefinition.type", description="The type of artifact the plan (e.g. order-set, eca-rule, protocol)", type="token" )
7055  public static final String SP_TYPE = "type";
7056 /**
7057   * <b>Fluent Client</b> search parameter constant for <b>type</b>
7058   * <p>
7059   * Description: <b>The type of artifact the plan (e.g. order-set, eca-rule, protocol)</b><br>
7060   * Type: <b>token</b><br>
7061   * Path: <b>PlanDefinition.type</b><br>
7062   * </p>
7063   */
7064  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
7065
7066 /**
7067   * Search parameter: <b>url</b>
7068   * <p>
7069   * Description: <b>The uri that identifies the plan definition</b><br>
7070   * Type: <b>uri</b><br>
7071   * Path: <b>PlanDefinition.url</b><br>
7072   * </p>
7073   */
7074  @SearchParamDefinition(name="url", path="PlanDefinition.url", description="The uri that identifies the plan definition", type="uri" )
7075  public static final String SP_URL = "url";
7076 /**
7077   * <b>Fluent Client</b> search parameter constant for <b>url</b>
7078   * <p>
7079   * Description: <b>The uri that identifies the plan definition</b><br>
7080   * Type: <b>uri</b><br>
7081   * Path: <b>PlanDefinition.url</b><br>
7082   * </p>
7083   */
7084  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
7085
7086 /**
7087   * Search parameter: <b>version</b>
7088   * <p>
7089   * Description: <b>The business version of the plan definition</b><br>
7090   * Type: <b>token</b><br>
7091   * Path: <b>PlanDefinition.version</b><br>
7092   * </p>
7093   */
7094  @SearchParamDefinition(name="version", path="PlanDefinition.version", description="The business version of the plan definition", type="token" )
7095  public static final String SP_VERSION = "version";
7096 /**
7097   * <b>Fluent Client</b> search parameter constant for <b>version</b>
7098   * <p>
7099   * Description: <b>The business version of the plan definition</b><br>
7100   * Type: <b>token</b><br>
7101   * Path: <b>PlanDefinition.version</b><br>
7102   * </p>
7103   */
7104  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
7105
7106
7107}
7108