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