001package org.hl7.fhir.dstu3.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
035import java.util.ArrayList;
036import java.util.List;
037
038import org.hl7.fhir.exceptions.FHIRException;
039import org.hl7.fhir.exceptions.FHIRFormatError;
040import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
041import org.hl7.fhir.utilities.Utilities;
042
043import ca.uhn.fhir.model.api.annotation.Block;
044import ca.uhn.fhir.model.api.annotation.Child;
045import ca.uhn.fhir.model.api.annotation.Description;
046import ca.uhn.fhir.model.api.annotation.ResourceDef;
047import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
048/**
049 * Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.
050 */
051@ResourceDef(name="CarePlan", profile="http://hl7.org/fhir/Profile/CarePlan")
052public class CarePlan extends DomainResource {
053
054    public enum CarePlanStatus {
055        /**
056         * The plan is in development or awaiting use but is not yet intended to be acted upon.
057         */
058        DRAFT, 
059        /**
060         * The plan is intended to be followed and used as part of patient care.
061         */
062        ACTIVE, 
063        /**
064         * The plan has been temporarily stopped but is expected to resume in the future.
065         */
066        SUSPENDED, 
067        /**
068         * The plan is no longer in use and is not expected to be followed or used in patient care.
069         */
070        COMPLETED, 
071        /**
072         * The plan was entered in error and voided.
073         */
074        ENTEREDINERROR, 
075        /**
076         * The plan has been terminated prior to reaching completion (though it may have been replaced by a new plan).
077         */
078        CANCELLED, 
079        /**
080         * The authoring system doesn't know the current state of the care plan.
081         */
082        UNKNOWN, 
083        /**
084         * added to help the parsers with the generic types
085         */
086        NULL;
087        public static CarePlanStatus fromCode(String codeString) throws FHIRException {
088            if (codeString == null || "".equals(codeString))
089                return null;
090        if ("draft".equals(codeString))
091          return DRAFT;
092        if ("active".equals(codeString))
093          return ACTIVE;
094        if ("suspended".equals(codeString))
095          return SUSPENDED;
096        if ("completed".equals(codeString))
097          return COMPLETED;
098        if ("entered-in-error".equals(codeString))
099          return ENTEREDINERROR;
100        if ("cancelled".equals(codeString))
101          return CANCELLED;
102        if ("unknown".equals(codeString))
103          return UNKNOWN;
104        if (Configuration.isAcceptInvalidEnums())
105          return null;
106        else
107          throw new FHIRException("Unknown CarePlanStatus code '"+codeString+"'");
108        }
109        public String toCode() {
110          switch (this) {
111            case DRAFT: return "draft";
112            case ACTIVE: return "active";
113            case SUSPENDED: return "suspended";
114            case COMPLETED: return "completed";
115            case ENTEREDINERROR: return "entered-in-error";
116            case CANCELLED: return "cancelled";
117            case UNKNOWN: return "unknown";
118            case NULL: return null;
119            default: return "?";
120          }
121        }
122        public String getSystem() {
123          switch (this) {
124            case DRAFT: return "http://hl7.org/fhir/care-plan-status";
125            case ACTIVE: return "http://hl7.org/fhir/care-plan-status";
126            case SUSPENDED: return "http://hl7.org/fhir/care-plan-status";
127            case COMPLETED: return "http://hl7.org/fhir/care-plan-status";
128            case ENTEREDINERROR: return "http://hl7.org/fhir/care-plan-status";
129            case CANCELLED: return "http://hl7.org/fhir/care-plan-status";
130            case UNKNOWN: return "http://hl7.org/fhir/care-plan-status";
131            case NULL: return null;
132            default: return "?";
133          }
134        }
135        public String getDefinition() {
136          switch (this) {
137            case DRAFT: return "The plan is in development or awaiting use but is not yet intended to be acted upon.";
138            case ACTIVE: return "The plan is intended to be followed and used as part of patient care.";
139            case SUSPENDED: return "The plan has been temporarily stopped but is expected to resume in the future.";
140            case COMPLETED: return "The plan is no longer in use and is not expected to be followed or used in patient care.";
141            case ENTEREDINERROR: return "The plan was entered in error and voided.";
142            case CANCELLED: return "The plan has been terminated prior to reaching completion (though it may have been replaced by a new plan).";
143            case UNKNOWN: return "The authoring system doesn't know the current state of the care plan.";
144            case NULL: return null;
145            default: return "?";
146          }
147        }
148        public String getDisplay() {
149          switch (this) {
150            case DRAFT: return "Pending";
151            case ACTIVE: return "Active";
152            case SUSPENDED: return "Suspended";
153            case COMPLETED: return "Completed";
154            case ENTEREDINERROR: return "Entered In Error";
155            case CANCELLED: return "Cancelled";
156            case UNKNOWN: return "Unknown";
157            case NULL: return null;
158            default: return "?";
159          }
160        }
161    }
162
163  public static class CarePlanStatusEnumFactory implements EnumFactory<CarePlanStatus> {
164    public CarePlanStatus fromCode(String codeString) throws IllegalArgumentException {
165      if (codeString == null || "".equals(codeString))
166            if (codeString == null || "".equals(codeString))
167                return null;
168        if ("draft".equals(codeString))
169          return CarePlanStatus.DRAFT;
170        if ("active".equals(codeString))
171          return CarePlanStatus.ACTIVE;
172        if ("suspended".equals(codeString))
173          return CarePlanStatus.SUSPENDED;
174        if ("completed".equals(codeString))
175          return CarePlanStatus.COMPLETED;
176        if ("entered-in-error".equals(codeString))
177          return CarePlanStatus.ENTEREDINERROR;
178        if ("cancelled".equals(codeString))
179          return CarePlanStatus.CANCELLED;
180        if ("unknown".equals(codeString))
181          return CarePlanStatus.UNKNOWN;
182        throw new IllegalArgumentException("Unknown CarePlanStatus code '"+codeString+"'");
183        }
184        public Enumeration<CarePlanStatus> fromType(PrimitiveType<?> code) throws FHIRException {
185          if (code == null)
186            return null;
187          if (code.isEmpty())
188            return new Enumeration<CarePlanStatus>(this);
189          String codeString = code.asStringValue();
190          if (codeString == null || "".equals(codeString))
191            return null;
192        if ("draft".equals(codeString))
193          return new Enumeration<CarePlanStatus>(this, CarePlanStatus.DRAFT);
194        if ("active".equals(codeString))
195          return new Enumeration<CarePlanStatus>(this, CarePlanStatus.ACTIVE);
196        if ("suspended".equals(codeString))
197          return new Enumeration<CarePlanStatus>(this, CarePlanStatus.SUSPENDED);
198        if ("completed".equals(codeString))
199          return new Enumeration<CarePlanStatus>(this, CarePlanStatus.COMPLETED);
200        if ("entered-in-error".equals(codeString))
201          return new Enumeration<CarePlanStatus>(this, CarePlanStatus.ENTEREDINERROR);
202        if ("cancelled".equals(codeString))
203          return new Enumeration<CarePlanStatus>(this, CarePlanStatus.CANCELLED);
204        if ("unknown".equals(codeString))
205          return new Enumeration<CarePlanStatus>(this, CarePlanStatus.UNKNOWN);
206        throw new FHIRException("Unknown CarePlanStatus code '"+codeString+"'");
207        }
208    public String toCode(CarePlanStatus code) {
209       if (code == CarePlanStatus.NULL)
210           return null;
211       if (code == CarePlanStatus.DRAFT)
212        return "draft";
213      if (code == CarePlanStatus.ACTIVE)
214        return "active";
215      if (code == CarePlanStatus.SUSPENDED)
216        return "suspended";
217      if (code == CarePlanStatus.COMPLETED)
218        return "completed";
219      if (code == CarePlanStatus.ENTEREDINERROR)
220        return "entered-in-error";
221      if (code == CarePlanStatus.CANCELLED)
222        return "cancelled";
223      if (code == CarePlanStatus.UNKNOWN)
224        return "unknown";
225      return "?";
226   }
227    public String toSystem(CarePlanStatus code) {
228      return code.getSystem();
229      }
230    }
231
232    public enum CarePlanIntent {
233        /**
234         * The care plan is a suggestion made by someone/something that doesn't have an intention to ensure it occurs and without providing an authorization to act
235         */
236        PROPOSAL, 
237        /**
238         * The care plan represents an intention to ensure something occurs without providing an authorization for others to act
239         */
240        PLAN, 
241        /**
242         * The care plan represents a request/demand and authorization for action
243         */
244        ORDER, 
245        /**
246         * The care plan represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests.
247
248Refer to [[[RequestGroup]]] for additional information on how this status is used
249         */
250        OPTION, 
251        /**
252         * added to help the parsers with the generic types
253         */
254        NULL;
255        public static CarePlanIntent fromCode(String codeString) throws FHIRException {
256            if (codeString == null || "".equals(codeString))
257                return null;
258        if ("proposal".equals(codeString))
259          return PROPOSAL;
260        if ("plan".equals(codeString))
261          return PLAN;
262        if ("order".equals(codeString))
263          return ORDER;
264        if ("option".equals(codeString))
265          return OPTION;
266        if (Configuration.isAcceptInvalidEnums())
267          return null;
268        else
269          throw new FHIRException("Unknown CarePlanIntent code '"+codeString+"'");
270        }
271        public String toCode() {
272          switch (this) {
273            case PROPOSAL: return "proposal";
274            case PLAN: return "plan";
275            case ORDER: return "order";
276            case OPTION: return "option";
277            case NULL: return null;
278            default: return "?";
279          }
280        }
281        public String getSystem() {
282          switch (this) {
283            case PROPOSAL: return "http://hl7.org/fhir/care-plan-intent";
284            case PLAN: return "http://hl7.org/fhir/care-plan-intent";
285            case ORDER: return "http://hl7.org/fhir/care-plan-intent";
286            case OPTION: return "http://hl7.org/fhir/care-plan-intent";
287            case NULL: return null;
288            default: return "?";
289          }
290        }
291        public String getDefinition() {
292          switch (this) {
293            case PROPOSAL: return "The care plan is a suggestion made by someone/something that doesn't have an intention to ensure it occurs and without providing an authorization to act";
294            case PLAN: return "The care plan represents an intention to ensure something occurs without providing an authorization for others to act";
295            case ORDER: return "The care plan represents a request/demand and authorization for action";
296            case OPTION: return "The care plan represents a component or option for a RequestGroup that establishes timing, conditionality and/or other constraints among a set of requests.\n\nRefer to [[[RequestGroup]]] for additional information on how this status is used";
297            case NULL: return null;
298            default: return "?";
299          }
300        }
301        public String getDisplay() {
302          switch (this) {
303            case PROPOSAL: return "Proposal";
304            case PLAN: return "Plan";
305            case ORDER: return "Order";
306            case OPTION: return "Option";
307            case NULL: return null;
308            default: return "?";
309          }
310        }
311    }
312
313  public static class CarePlanIntentEnumFactory implements EnumFactory<CarePlanIntent> {
314    public CarePlanIntent fromCode(String codeString) throws IllegalArgumentException {
315      if (codeString == null || "".equals(codeString))
316            if (codeString == null || "".equals(codeString))
317                return null;
318        if ("proposal".equals(codeString))
319          return CarePlanIntent.PROPOSAL;
320        if ("plan".equals(codeString))
321          return CarePlanIntent.PLAN;
322        if ("order".equals(codeString))
323          return CarePlanIntent.ORDER;
324        if ("option".equals(codeString))
325          return CarePlanIntent.OPTION;
326        throw new IllegalArgumentException("Unknown CarePlanIntent code '"+codeString+"'");
327        }
328        public Enumeration<CarePlanIntent> fromType(PrimitiveType<?> code) throws FHIRException {
329          if (code == null)
330            return null;
331          if (code.isEmpty())
332            return new Enumeration<CarePlanIntent>(this);
333          String codeString = code.asStringValue();
334          if (codeString == null || "".equals(codeString))
335            return null;
336        if ("proposal".equals(codeString))
337          return new Enumeration<CarePlanIntent>(this, CarePlanIntent.PROPOSAL);
338        if ("plan".equals(codeString))
339          return new Enumeration<CarePlanIntent>(this, CarePlanIntent.PLAN);
340        if ("order".equals(codeString))
341          return new Enumeration<CarePlanIntent>(this, CarePlanIntent.ORDER);
342        if ("option".equals(codeString))
343          return new Enumeration<CarePlanIntent>(this, CarePlanIntent.OPTION);
344        throw new FHIRException("Unknown CarePlanIntent code '"+codeString+"'");
345        }
346    public String toCode(CarePlanIntent code) {
347       if (code == CarePlanIntent.NULL)
348           return null;
349       if (code == CarePlanIntent.PROPOSAL)
350        return "proposal";
351      if (code == CarePlanIntent.PLAN)
352        return "plan";
353      if (code == CarePlanIntent.ORDER)
354        return "order";
355      if (code == CarePlanIntent.OPTION)
356        return "option";
357      return "?";
358   }
359    public String toSystem(CarePlanIntent code) {
360      return code.getSystem();
361      }
362    }
363
364    public enum CarePlanActivityStatus {
365        /**
366         * Activity is planned but no action has yet been taken.
367         */
368        NOTSTARTED, 
369        /**
370         * Appointment or other booking has occurred but activity has not yet begun.
371         */
372        SCHEDULED, 
373        /**
374         * Activity has been started but is not yet complete.
375         */
376        INPROGRESS, 
377        /**
378         * Activity was started but has temporarily ceased with an expectation of resumption at a future time.
379         */
380        ONHOLD, 
381        /**
382         * The activities have been completed (more or less) as planned.
383         */
384        COMPLETED, 
385        /**
386         * The activities have been ended prior to completion (perhaps even before they were started).
387         */
388        CANCELLED, 
389        /**
390         * The authoring system doesn't know the current state of the activity.
391         */
392        UNKNOWN, 
393        /**
394         * added to help the parsers with the generic types
395         */
396        NULL;
397        public static CarePlanActivityStatus fromCode(String codeString) throws FHIRException {
398            if (codeString == null || "".equals(codeString))
399                return null;
400        if ("not-started".equals(codeString))
401          return NOTSTARTED;
402        if ("scheduled".equals(codeString))
403          return SCHEDULED;
404        if ("in-progress".equals(codeString))
405          return INPROGRESS;
406        if ("on-hold".equals(codeString))
407          return ONHOLD;
408        if ("completed".equals(codeString))
409          return COMPLETED;
410        if ("cancelled".equals(codeString))
411          return CANCELLED;
412        if ("unknown".equals(codeString))
413          return UNKNOWN;
414        if (Configuration.isAcceptInvalidEnums())
415          return null;
416        else
417          throw new FHIRException("Unknown CarePlanActivityStatus code '"+codeString+"'");
418        }
419        public String toCode() {
420          switch (this) {
421            case NOTSTARTED: return "not-started";
422            case SCHEDULED: return "scheduled";
423            case INPROGRESS: return "in-progress";
424            case ONHOLD: return "on-hold";
425            case COMPLETED: return "completed";
426            case CANCELLED: return "cancelled";
427            case UNKNOWN: return "unknown";
428            case NULL: return null;
429            default: return "?";
430          }
431        }
432        public String getSystem() {
433          switch (this) {
434            case NOTSTARTED: return "http://hl7.org/fhir/care-plan-activity-status";
435            case SCHEDULED: return "http://hl7.org/fhir/care-plan-activity-status";
436            case INPROGRESS: return "http://hl7.org/fhir/care-plan-activity-status";
437            case ONHOLD: return "http://hl7.org/fhir/care-plan-activity-status";
438            case COMPLETED: return "http://hl7.org/fhir/care-plan-activity-status";
439            case CANCELLED: return "http://hl7.org/fhir/care-plan-activity-status";
440            case UNKNOWN: return "http://hl7.org/fhir/care-plan-activity-status";
441            case NULL: return null;
442            default: return "?";
443          }
444        }
445        public String getDefinition() {
446          switch (this) {
447            case NOTSTARTED: return "Activity is planned but no action has yet been taken.";
448            case SCHEDULED: return "Appointment or other booking has occurred but activity has not yet begun.";
449            case INPROGRESS: return "Activity has been started but is not yet complete.";
450            case ONHOLD: return "Activity was started but has temporarily ceased with an expectation of resumption at a future time.";
451            case COMPLETED: return "The activities have been completed (more or less) as planned.";
452            case CANCELLED: return "The activities have been ended prior to completion (perhaps even before they were started).";
453            case UNKNOWN: return "The authoring system doesn't know the current state of the activity.";
454            case NULL: return null;
455            default: return "?";
456          }
457        }
458        public String getDisplay() {
459          switch (this) {
460            case NOTSTARTED: return "Not Started";
461            case SCHEDULED: return "Scheduled";
462            case INPROGRESS: return "In Progress";
463            case ONHOLD: return "On Hold";
464            case COMPLETED: return "Completed";
465            case CANCELLED: return "Cancelled";
466            case UNKNOWN: return "Unknown";
467            case NULL: return null;
468            default: return "?";
469          }
470        }
471    }
472
473  public static class CarePlanActivityStatusEnumFactory implements EnumFactory<CarePlanActivityStatus> {
474    public CarePlanActivityStatus fromCode(String codeString) throws IllegalArgumentException {
475      if (codeString == null || "".equals(codeString))
476            if (codeString == null || "".equals(codeString))
477                return null;
478        if ("not-started".equals(codeString))
479          return CarePlanActivityStatus.NOTSTARTED;
480        if ("scheduled".equals(codeString))
481          return CarePlanActivityStatus.SCHEDULED;
482        if ("in-progress".equals(codeString))
483          return CarePlanActivityStatus.INPROGRESS;
484        if ("on-hold".equals(codeString))
485          return CarePlanActivityStatus.ONHOLD;
486        if ("completed".equals(codeString))
487          return CarePlanActivityStatus.COMPLETED;
488        if ("cancelled".equals(codeString))
489          return CarePlanActivityStatus.CANCELLED;
490        if ("unknown".equals(codeString))
491          return CarePlanActivityStatus.UNKNOWN;
492        throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'");
493        }
494        public Enumeration<CarePlanActivityStatus> fromType(PrimitiveType<?> code) throws FHIRException {
495          if (code == null)
496            return null;
497          if (code.isEmpty())
498            return new Enumeration<CarePlanActivityStatus>(this);
499          String codeString = code.asStringValue();
500          if (codeString == null || "".equals(codeString))
501            return null;
502        if ("not-started".equals(codeString))
503          return new Enumeration<CarePlanActivityStatus>(this, CarePlanActivityStatus.NOTSTARTED);
504        if ("scheduled".equals(codeString))
505          return new Enumeration<CarePlanActivityStatus>(this, CarePlanActivityStatus.SCHEDULED);
506        if ("in-progress".equals(codeString))
507          return new Enumeration<CarePlanActivityStatus>(this, CarePlanActivityStatus.INPROGRESS);
508        if ("on-hold".equals(codeString))
509          return new Enumeration<CarePlanActivityStatus>(this, CarePlanActivityStatus.ONHOLD);
510        if ("completed".equals(codeString))
511          return new Enumeration<CarePlanActivityStatus>(this, CarePlanActivityStatus.COMPLETED);
512        if ("cancelled".equals(codeString))
513          return new Enumeration<CarePlanActivityStatus>(this, CarePlanActivityStatus.CANCELLED);
514        if ("unknown".equals(codeString))
515          return new Enumeration<CarePlanActivityStatus>(this, CarePlanActivityStatus.UNKNOWN);
516        throw new FHIRException("Unknown CarePlanActivityStatus code '"+codeString+"'");
517        }
518    public String toCode(CarePlanActivityStatus code) {
519       if (code == CarePlanActivityStatus.NULL)
520           return null;
521       if (code == CarePlanActivityStatus.NOTSTARTED)
522        return "not-started";
523      if (code == CarePlanActivityStatus.SCHEDULED)
524        return "scheduled";
525      if (code == CarePlanActivityStatus.INPROGRESS)
526        return "in-progress";
527      if (code == CarePlanActivityStatus.ONHOLD)
528        return "on-hold";
529      if (code == CarePlanActivityStatus.COMPLETED)
530        return "completed";
531      if (code == CarePlanActivityStatus.CANCELLED)
532        return "cancelled";
533      if (code == CarePlanActivityStatus.UNKNOWN)
534        return "unknown";
535      return "?";
536   }
537    public String toSystem(CarePlanActivityStatus code) {
538      return code.getSystem();
539      }
540    }
541
542    @Block()
543    public static class CarePlanActivityComponent extends BackboneElement implements IBaseBackboneElement {
544        /**
545         * Identifies the outcome at the point when the status of the activity is assessed.  For example, the outcome of an education activity could be patient understands (or not).
546         */
547        @Child(name = "outcomeCodeableConcept", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
548        @Description(shortDefinition="Results of the activity", formalDefinition="Identifies the outcome at the point when the status of the activity is assessed.  For example, the outcome of an education activity could be patient understands (or not)." )
549        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/care-plan-activity-outcome")
550        protected List<CodeableConcept> outcomeCodeableConcept;
551
552        /**
553         * Details of the outcome or action resulting from the activity.  The reference to an "event" resource, such as Procedure or Encounter or Observation, is the result/outcome of the activity itself.  The activity can be conveyed using CarePlan.activity.detail OR using the CarePlan.activity.reference (a reference to a ?request? resource).
554         */
555        @Child(name = "outcomeReference", type = {Reference.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
556        @Description(shortDefinition="Appointment, Encounter, Procedure, etc.", formalDefinition="Details of the outcome or action resulting from the activity.  The reference to an \"event\" resource, such as Procedure or Encounter or Observation, is the result/outcome of the activity itself.  The activity can be conveyed using CarePlan.activity.detail OR using the CarePlan.activity.reference (a reference to a ?request? resource)." )
557        protected List<Reference> outcomeReference;
558        /**
559         * The actual objects that are the target of the reference (Details of the outcome or action resulting from the activity.  The reference to an "event" resource, such as Procedure or Encounter or Observation, is the result/outcome of the activity itself.  The activity can be conveyed using CarePlan.activity.detail OR using the CarePlan.activity.reference (a reference to a ?request? resource).)
560         */
561        protected List<Resource> outcomeReferenceTarget;
562
563
564        /**
565         * Notes about the adherence/status/progress of the activity.
566         */
567        @Child(name = "progress", type = {Annotation.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
568        @Description(shortDefinition="Comments about the activity status/progress", formalDefinition="Notes about the adherence/status/progress of the activity." )
569        protected List<Annotation> progress;
570
571        /**
572         * The details of the proposed activity represented in a specific resource.
573         */
574        @Child(name = "reference", type = {Appointment.class, CommunicationRequest.class, DeviceRequest.class, MedicationRequest.class, NutritionOrder.class, Task.class, ProcedureRequest.class, ReferralRequest.class, VisionPrescription.class, RequestGroup.class}, order=4, min=0, max=1, modifier=false, summary=false)
575        @Description(shortDefinition="Activity details defined in specific resource", formalDefinition="The details of the proposed activity represented in a specific resource." )
576        protected Reference reference;
577
578        /**
579         * The actual object that is the target of the reference (The details of the proposed activity represented in a specific resource.)
580         */
581        protected Resource referenceTarget;
582
583        /**
584         * A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.
585         */
586        @Child(name = "detail", type = {}, order=5, min=0, max=1, modifier=false, summary=false)
587        @Description(shortDefinition="In-line definition of activity", formalDefinition="A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc." )
588        protected CarePlanActivityDetailComponent detail;
589
590        private static final long serialVersionUID = -609287300L;
591
592    /**
593     * Constructor
594     */
595      public CarePlanActivityComponent() {
596        super();
597      }
598
599        /**
600         * @return {@link #outcomeCodeableConcept} (Identifies the outcome at the point when the status of the activity is assessed.  For example, the outcome of an education activity could be patient understands (or not).)
601         */
602        public List<CodeableConcept> getOutcomeCodeableConcept() { 
603          if (this.outcomeCodeableConcept == null)
604            this.outcomeCodeableConcept = new ArrayList<CodeableConcept>();
605          return this.outcomeCodeableConcept;
606        }
607
608        /**
609         * @return Returns a reference to <code>this</code> for easy method chaining
610         */
611        public CarePlanActivityComponent setOutcomeCodeableConcept(List<CodeableConcept> theOutcomeCodeableConcept) { 
612          this.outcomeCodeableConcept = theOutcomeCodeableConcept;
613          return this;
614        }
615
616        public boolean hasOutcomeCodeableConcept() { 
617          if (this.outcomeCodeableConcept == null)
618            return false;
619          for (CodeableConcept item : this.outcomeCodeableConcept)
620            if (!item.isEmpty())
621              return true;
622          return false;
623        }
624
625        public CodeableConcept addOutcomeCodeableConcept() { //3
626          CodeableConcept t = new CodeableConcept();
627          if (this.outcomeCodeableConcept == null)
628            this.outcomeCodeableConcept = new ArrayList<CodeableConcept>();
629          this.outcomeCodeableConcept.add(t);
630          return t;
631        }
632
633        public CarePlanActivityComponent addOutcomeCodeableConcept(CodeableConcept t) { //3
634          if (t == null)
635            return this;
636          if (this.outcomeCodeableConcept == null)
637            this.outcomeCodeableConcept = new ArrayList<CodeableConcept>();
638          this.outcomeCodeableConcept.add(t);
639          return this;
640        }
641
642        /**
643         * @return The first repetition of repeating field {@link #outcomeCodeableConcept}, creating it if it does not already exist
644         */
645        public CodeableConcept getOutcomeCodeableConceptFirstRep() { 
646          if (getOutcomeCodeableConcept().isEmpty()) {
647            addOutcomeCodeableConcept();
648          }
649          return getOutcomeCodeableConcept().get(0);
650        }
651
652        /**
653         * @return {@link #outcomeReference} (Details of the outcome or action resulting from the activity.  The reference to an "event" resource, such as Procedure or Encounter or Observation, is the result/outcome of the activity itself.  The activity can be conveyed using CarePlan.activity.detail OR using the CarePlan.activity.reference (a reference to a ?request? resource).)
654         */
655        public List<Reference> getOutcomeReference() { 
656          if (this.outcomeReference == null)
657            this.outcomeReference = new ArrayList<Reference>();
658          return this.outcomeReference;
659        }
660
661        /**
662         * @return Returns a reference to <code>this</code> for easy method chaining
663         */
664        public CarePlanActivityComponent setOutcomeReference(List<Reference> theOutcomeReference) { 
665          this.outcomeReference = theOutcomeReference;
666          return this;
667        }
668
669        public boolean hasOutcomeReference() { 
670          if (this.outcomeReference == null)
671            return false;
672          for (Reference item : this.outcomeReference)
673            if (!item.isEmpty())
674              return true;
675          return false;
676        }
677
678        public Reference addOutcomeReference() { //3
679          Reference t = new Reference();
680          if (this.outcomeReference == null)
681            this.outcomeReference = new ArrayList<Reference>();
682          this.outcomeReference.add(t);
683          return t;
684        }
685
686        public CarePlanActivityComponent addOutcomeReference(Reference t) { //3
687          if (t == null)
688            return this;
689          if (this.outcomeReference == null)
690            this.outcomeReference = new ArrayList<Reference>();
691          this.outcomeReference.add(t);
692          return this;
693        }
694
695        /**
696         * @return The first repetition of repeating field {@link #outcomeReference}, creating it if it does not already exist
697         */
698        public Reference getOutcomeReferenceFirstRep() { 
699          if (getOutcomeReference().isEmpty()) {
700            addOutcomeReference();
701          }
702          return getOutcomeReference().get(0);
703        }
704
705        /**
706         * @return {@link #progress} (Notes about the adherence/status/progress of the activity.)
707         */
708        public List<Annotation> getProgress() { 
709          if (this.progress == null)
710            this.progress = new ArrayList<Annotation>();
711          return this.progress;
712        }
713
714        /**
715         * @return Returns a reference to <code>this</code> for easy method chaining
716         */
717        public CarePlanActivityComponent setProgress(List<Annotation> theProgress) { 
718          this.progress = theProgress;
719          return this;
720        }
721
722        public boolean hasProgress() { 
723          if (this.progress == null)
724            return false;
725          for (Annotation item : this.progress)
726            if (!item.isEmpty())
727              return true;
728          return false;
729        }
730
731        public Annotation addProgress() { //3
732          Annotation t = new Annotation();
733          if (this.progress == null)
734            this.progress = new ArrayList<Annotation>();
735          this.progress.add(t);
736          return t;
737        }
738
739        public CarePlanActivityComponent addProgress(Annotation t) { //3
740          if (t == null)
741            return this;
742          if (this.progress == null)
743            this.progress = new ArrayList<Annotation>();
744          this.progress.add(t);
745          return this;
746        }
747
748        /**
749         * @return The first repetition of repeating field {@link #progress}, creating it if it does not already exist
750         */
751        public Annotation getProgressFirstRep() { 
752          if (getProgress().isEmpty()) {
753            addProgress();
754          }
755          return getProgress().get(0);
756        }
757
758        /**
759         * @return {@link #reference} (The details of the proposed activity represented in a specific resource.)
760         */
761        public Reference getReference() { 
762          if (this.reference == null)
763            if (Configuration.errorOnAutoCreate())
764              throw new Error("Attempt to auto-create CarePlanActivityComponent.reference");
765            else if (Configuration.doAutoCreate())
766              this.reference = new Reference(); // cc
767          return this.reference;
768        }
769
770        public boolean hasReference() { 
771          return this.reference != null && !this.reference.isEmpty();
772        }
773
774        /**
775         * @param value {@link #reference} (The details of the proposed activity represented in a specific resource.)
776         */
777        public CarePlanActivityComponent setReference(Reference value)  { 
778          this.reference = value;
779          return this;
780        }
781
782        /**
783         * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The details of the proposed activity represented in a specific resource.)
784         */
785        public Resource getReferenceTarget() { 
786          return this.referenceTarget;
787        }
788
789        /**
790         * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The details of the proposed activity represented in a specific resource.)
791         */
792        public CarePlanActivityComponent setReferenceTarget(Resource value) { 
793          this.referenceTarget = value;
794          return this;
795        }
796
797        /**
798         * @return {@link #detail} (A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.)
799         */
800        public CarePlanActivityDetailComponent getDetail() { 
801          if (this.detail == null)
802            if (Configuration.errorOnAutoCreate())
803              throw new Error("Attempt to auto-create CarePlanActivityComponent.detail");
804            else if (Configuration.doAutoCreate())
805              this.detail = new CarePlanActivityDetailComponent(); // cc
806          return this.detail;
807        }
808
809        public boolean hasDetail() { 
810          return this.detail != null && !this.detail.isEmpty();
811        }
812
813        /**
814         * @param value {@link #detail} (A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.)
815         */
816        public CarePlanActivityComponent setDetail(CarePlanActivityDetailComponent value)  { 
817          this.detail = value;
818          return this;
819        }
820
821        protected void listChildren(List<Property> children) {
822          super.listChildren(children);
823          children.add(new Property("outcomeCodeableConcept", "CodeableConcept", "Identifies the outcome at the point when the status of the activity is assessed.  For example, the outcome of an education activity could be patient understands (or not).", 0, java.lang.Integer.MAX_VALUE, outcomeCodeableConcept));
824          children.add(new Property("outcomeReference", "Reference(Any)", "Details of the outcome or action resulting from the activity.  The reference to an \"event\" resource, such as Procedure or Encounter or Observation, is the result/outcome of the activity itself.  The activity can be conveyed using CarePlan.activity.detail OR using the CarePlan.activity.reference (a reference to a ?request? resource).", 0, java.lang.Integer.MAX_VALUE, outcomeReference));
825          children.add(new Property("progress", "Annotation", "Notes about the adherence/status/progress of the activity.", 0, java.lang.Integer.MAX_VALUE, progress));
826          children.add(new Property("reference", "Reference(Appointment|CommunicationRequest|DeviceRequest|MedicationRequest|NutritionOrder|Task|ProcedureRequest|ReferralRequest|VisionPrescription|RequestGroup)", "The details of the proposed activity represented in a specific resource.", 0, 1, reference));
827          children.add(new Property("detail", "", "A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.", 0, 1, detail));
828        }
829
830        @Override
831        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
832          switch (_hash) {
833          case -511913489: /*outcomeCodeableConcept*/  return new Property("outcomeCodeableConcept", "CodeableConcept", "Identifies the outcome at the point when the status of the activity is assessed.  For example, the outcome of an education activity could be patient understands (or not).", 0, java.lang.Integer.MAX_VALUE, outcomeCodeableConcept);
834          case -782273511: /*outcomeReference*/  return new Property("outcomeReference", "Reference(Any)", "Details of the outcome or action resulting from the activity.  The reference to an \"event\" resource, such as Procedure or Encounter or Observation, is the result/outcome of the activity itself.  The activity can be conveyed using CarePlan.activity.detail OR using the CarePlan.activity.reference (a reference to a ?request? resource).", 0, java.lang.Integer.MAX_VALUE, outcomeReference);
835          case -1001078227: /*progress*/  return new Property("progress", "Annotation", "Notes about the adherence/status/progress of the activity.", 0, java.lang.Integer.MAX_VALUE, progress);
836          case -925155509: /*reference*/  return new Property("reference", "Reference(Appointment|CommunicationRequest|DeviceRequest|MedicationRequest|NutritionOrder|Task|ProcedureRequest|ReferralRequest|VisionPrescription|RequestGroup)", "The details of the proposed activity represented in a specific resource.", 0, 1, reference);
837          case -1335224239: /*detail*/  return new Property("detail", "", "A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.", 0, 1, detail);
838          default: return super.getNamedProperty(_hash, _name, _checkValid);
839          }
840
841        }
842
843      @Override
844      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
845        switch (hash) {
846        case -511913489: /*outcomeCodeableConcept*/ return this.outcomeCodeableConcept == null ? new Base[0] : this.outcomeCodeableConcept.toArray(new Base[this.outcomeCodeableConcept.size()]); // CodeableConcept
847        case -782273511: /*outcomeReference*/ return this.outcomeReference == null ? new Base[0] : this.outcomeReference.toArray(new Base[this.outcomeReference.size()]); // Reference
848        case -1001078227: /*progress*/ return this.progress == null ? new Base[0] : this.progress.toArray(new Base[this.progress.size()]); // Annotation
849        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
850        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // CarePlanActivityDetailComponent
851        default: return super.getProperty(hash, name, checkValid);
852        }
853
854      }
855
856      @Override
857      public Base setProperty(int hash, String name, Base value) throws FHIRException {
858        switch (hash) {
859        case -511913489: // outcomeCodeableConcept
860          this.getOutcomeCodeableConcept().add(castToCodeableConcept(value)); // CodeableConcept
861          return value;
862        case -782273511: // outcomeReference
863          this.getOutcomeReference().add(castToReference(value)); // Reference
864          return value;
865        case -1001078227: // progress
866          this.getProgress().add(castToAnnotation(value)); // Annotation
867          return value;
868        case -925155509: // reference
869          this.reference = castToReference(value); // Reference
870          return value;
871        case -1335224239: // detail
872          this.detail = (CarePlanActivityDetailComponent) value; // CarePlanActivityDetailComponent
873          return value;
874        default: return super.setProperty(hash, name, value);
875        }
876
877      }
878
879      @Override
880      public Base setProperty(String name, Base value) throws FHIRException {
881        if (name.equals("outcomeCodeableConcept")) {
882          this.getOutcomeCodeableConcept().add(castToCodeableConcept(value));
883        } else if (name.equals("outcomeReference")) {
884          this.getOutcomeReference().add(castToReference(value));
885        } else if (name.equals("progress")) {
886          this.getProgress().add(castToAnnotation(value));
887        } else if (name.equals("reference")) {
888          this.reference = castToReference(value); // Reference
889        } else if (name.equals("detail")) {
890          this.detail = (CarePlanActivityDetailComponent) value; // CarePlanActivityDetailComponent
891        } else
892          return super.setProperty(name, value);
893        return value;
894      }
895
896      @Override
897      public Base makeProperty(int hash, String name) throws FHIRException {
898        switch (hash) {
899        case -511913489:  return addOutcomeCodeableConcept(); 
900        case -782273511:  return addOutcomeReference(); 
901        case -1001078227:  return addProgress(); 
902        case -925155509:  return getReference(); 
903        case -1335224239:  return getDetail(); 
904        default: return super.makeProperty(hash, name);
905        }
906
907      }
908
909      @Override
910      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
911        switch (hash) {
912        case -511913489: /*outcomeCodeableConcept*/ return new String[] {"CodeableConcept"};
913        case -782273511: /*outcomeReference*/ return new String[] {"Reference"};
914        case -1001078227: /*progress*/ return new String[] {"Annotation"};
915        case -925155509: /*reference*/ return new String[] {"Reference"};
916        case -1335224239: /*detail*/ return new String[] {};
917        default: return super.getTypesForProperty(hash, name);
918        }
919
920      }
921
922      @Override
923      public Base addChild(String name) throws FHIRException {
924        if (name.equals("outcomeCodeableConcept")) {
925          return addOutcomeCodeableConcept();
926        }
927        else if (name.equals("outcomeReference")) {
928          return addOutcomeReference();
929        }
930        else if (name.equals("progress")) {
931          return addProgress();
932        }
933        else if (name.equals("reference")) {
934          this.reference = new Reference();
935          return this.reference;
936        }
937        else if (name.equals("detail")) {
938          this.detail = new CarePlanActivityDetailComponent();
939          return this.detail;
940        }
941        else
942          return super.addChild(name);
943      }
944
945      public CarePlanActivityComponent copy() {
946        CarePlanActivityComponent dst = new CarePlanActivityComponent();
947        copyValues(dst);
948        if (outcomeCodeableConcept != null) {
949          dst.outcomeCodeableConcept = new ArrayList<CodeableConcept>();
950          for (CodeableConcept i : outcomeCodeableConcept)
951            dst.outcomeCodeableConcept.add(i.copy());
952        };
953        if (outcomeReference != null) {
954          dst.outcomeReference = new ArrayList<Reference>();
955          for (Reference i : outcomeReference)
956            dst.outcomeReference.add(i.copy());
957        };
958        if (progress != null) {
959          dst.progress = new ArrayList<Annotation>();
960          for (Annotation i : progress)
961            dst.progress.add(i.copy());
962        };
963        dst.reference = reference == null ? null : reference.copy();
964        dst.detail = detail == null ? null : detail.copy();
965        return dst;
966      }
967
968      @Override
969      public boolean equalsDeep(Base other_) {
970        if (!super.equalsDeep(other_))
971          return false;
972        if (!(other_ instanceof CarePlanActivityComponent))
973          return false;
974        CarePlanActivityComponent o = (CarePlanActivityComponent) other_;
975        return compareDeep(outcomeCodeableConcept, o.outcomeCodeableConcept, true) && compareDeep(outcomeReference, o.outcomeReference, true)
976           && compareDeep(progress, o.progress, true) && compareDeep(reference, o.reference, true) && compareDeep(detail, o.detail, true)
977          ;
978      }
979
980      @Override
981      public boolean equalsShallow(Base other_) {
982        if (!super.equalsShallow(other_))
983          return false;
984        if (!(other_ instanceof CarePlanActivityComponent))
985          return false;
986        CarePlanActivityComponent o = (CarePlanActivityComponent) other_;
987        return true;
988      }
989
990      public boolean isEmpty() {
991        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(outcomeCodeableConcept, outcomeReference
992          , progress, reference, detail);
993      }
994
995  public String fhirType() {
996    return "CarePlan.activity";
997
998  }
999
1000  }
1001
1002    @Block()
1003    public static class CarePlanActivityDetailComponent extends BackboneElement implements IBaseBackboneElement {
1004        /**
1005         * High-level categorization of the type of activity in a care plan.
1006         */
1007        @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
1008        @Description(shortDefinition="diet | drug | encounter | observation | procedure | supply | other", formalDefinition="High-level categorization of the type of activity in a care plan." )
1009        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/care-plan-activity-category")
1010        protected CodeableConcept category;
1011
1012        /**
1013         * Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.
1014         */
1015        @Child(name = "definition", type = {PlanDefinition.class, ActivityDefinition.class, Questionnaire.class}, order=2, min=0, max=1, modifier=false, summary=false)
1016        @Description(shortDefinition="Protocol or definition", formalDefinition="Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with." )
1017        protected Reference definition;
1018
1019        /**
1020         * The actual object that is the target of the reference (Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.)
1021         */
1022        protected Resource definitionTarget;
1023
1024        /**
1025         * Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.
1026         */
1027        @Child(name = "code", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
1028        @Description(shortDefinition="Detail type of activity", formalDefinition="Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter." )
1029        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/care-plan-activity")
1030        protected CodeableConcept code;
1031
1032        /**
1033         * Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited.
1034         */
1035        @Child(name = "reasonCode", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1036        @Description(shortDefinition="Why activity should be done or why activity was prohibited", formalDefinition="Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited." )
1037        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/activity-reason")
1038        protected List<CodeableConcept> reasonCode;
1039
1040        /**
1041         * Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.
1042         */
1043        @Child(name = "reasonReference", type = {Condition.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1044        @Description(shortDefinition="Condition triggering need for activity", formalDefinition="Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan." )
1045        protected List<Reference> reasonReference;
1046        /**
1047         * The actual objects that are the target of the reference (Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.)
1048         */
1049        protected List<Condition> reasonReferenceTarget;
1050
1051
1052        /**
1053         * Internal reference that identifies the goals that this activity is intended to contribute towards meeting.
1054         */
1055        @Child(name = "goal", type = {Goal.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1056        @Description(shortDefinition="Goals this activity relates to", formalDefinition="Internal reference that identifies the goals that this activity is intended to contribute towards meeting." )
1057        protected List<Reference> goal;
1058        /**
1059         * The actual objects that are the target of the reference (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.)
1060         */
1061        protected List<Goal> goalTarget;
1062
1063
1064        /**
1065         * Identifies what progress is being made for the specific activity.
1066         */
1067        @Child(name = "status", type = {CodeType.class}, order=7, min=1, max=1, modifier=true, summary=false)
1068        @Description(shortDefinition="not-started | scheduled | in-progress | on-hold | completed | cancelled | unknown", formalDefinition="Identifies what progress is being made for the specific activity." )
1069        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/care-plan-activity-status")
1070        protected Enumeration<CarePlanActivityStatus> status;
1071
1072        /**
1073         * Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.
1074         */
1075        @Child(name = "statusReason", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
1076        @Description(shortDefinition="Reason for current status", formalDefinition="Provides reason why the activity isn't yet started, is on hold, was cancelled, etc." )
1077        protected StringType statusReason;
1078
1079        /**
1080         * If true, indicates that the described activity is one that must NOT be engaged in when following the plan.  If false, indicates that the described activity is one that should be engaged in when following the plan.
1081         */
1082        @Child(name = "prohibited", type = {BooleanType.class}, order=9, min=0, max=1, modifier=true, summary=false)
1083        @Description(shortDefinition="Do NOT do", formalDefinition="If true, indicates that the described activity is one that must NOT be engaged in when following the plan.  If false, indicates that the described activity is one that should be engaged in when following the plan." )
1084        protected BooleanType prohibited;
1085
1086        /**
1087         * The period, timing or frequency upon which the described activity is to occur.
1088         */
1089        @Child(name = "scheduled", type = {Timing.class, Period.class, StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
1090        @Description(shortDefinition="When activity is to occur", formalDefinition="The period, timing or frequency upon which the described activity is to occur." )
1091        protected Type scheduled;
1092
1093        /**
1094         * Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.
1095         */
1096        @Child(name = "location", type = {Location.class}, order=11, min=0, max=1, modifier=false, summary=false)
1097        @Description(shortDefinition="Where it should happen", formalDefinition="Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc." )
1098        protected Reference location;
1099
1100        /**
1101         * The actual object that is the target of the reference (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.)
1102         */
1103        protected Location locationTarget;
1104
1105        /**
1106         * Identifies who's expected to be involved in the activity.
1107         */
1108        @Child(name = "performer", type = {Practitioner.class, Organization.class, RelatedPerson.class, Patient.class, CareTeam.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1109        @Description(shortDefinition="Who will be responsible?", formalDefinition="Identifies who's expected to be involved in the activity." )
1110        protected List<Reference> performer;
1111        /**
1112         * The actual objects that are the target of the reference (Identifies who's expected to be involved in the activity.)
1113         */
1114        protected List<Resource> performerTarget;
1115
1116
1117        /**
1118         * Identifies the food, drug or other product to be consumed or supplied in the activity.
1119         */
1120        @Child(name = "product", type = {CodeableConcept.class, Medication.class, Substance.class}, order=13, min=0, max=1, modifier=false, summary=false)
1121        @Description(shortDefinition="What is to be administered/supplied", formalDefinition="Identifies the food, drug or other product to be consumed or supplied in the activity." )
1122        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medication-codes")
1123        protected Type product;
1124
1125        /**
1126         * Identifies the quantity expected to be consumed in a given day.
1127         */
1128        @Child(name = "dailyAmount", type = {SimpleQuantity.class}, order=14, min=0, max=1, modifier=false, summary=false)
1129        @Description(shortDefinition="How to consume/day?", formalDefinition="Identifies the quantity expected to be consumed in a given day." )
1130        protected SimpleQuantity dailyAmount;
1131
1132        /**
1133         * Identifies the quantity expected to be supplied, administered or consumed by the subject.
1134         */
1135        @Child(name = "quantity", type = {SimpleQuantity.class}, order=15, min=0, max=1, modifier=false, summary=false)
1136        @Description(shortDefinition="How much to administer/supply/consume", formalDefinition="Identifies the quantity expected to be supplied, administered or consumed by the subject." )
1137        protected SimpleQuantity quantity;
1138
1139        /**
1140         * This provides a textual description of constraints on the intended activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.
1141         */
1142        @Child(name = "description", type = {StringType.class}, order=16, min=0, max=1, modifier=false, summary=false)
1143        @Description(shortDefinition="Extra info describing activity to perform", formalDefinition="This provides a textual description of constraints on the intended activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc." )
1144        protected StringType description;
1145
1146        private static final long serialVersionUID = -549984462L;
1147
1148    /**
1149     * Constructor
1150     */
1151      public CarePlanActivityDetailComponent() {
1152        super();
1153      }
1154
1155    /**
1156     * Constructor
1157     */
1158      public CarePlanActivityDetailComponent(Enumeration<CarePlanActivityStatus> status) {
1159        super();
1160        this.status = status;
1161      }
1162
1163        /**
1164         * @return {@link #category} (High-level categorization of the type of activity in a care plan.)
1165         */
1166        public CodeableConcept getCategory() { 
1167          if (this.category == null)
1168            if (Configuration.errorOnAutoCreate())
1169              throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.category");
1170            else if (Configuration.doAutoCreate())
1171              this.category = new CodeableConcept(); // cc
1172          return this.category;
1173        }
1174
1175        public boolean hasCategory() { 
1176          return this.category != null && !this.category.isEmpty();
1177        }
1178
1179        /**
1180         * @param value {@link #category} (High-level categorization of the type of activity in a care plan.)
1181         */
1182        public CarePlanActivityDetailComponent setCategory(CodeableConcept value)  { 
1183          this.category = value;
1184          return this;
1185        }
1186
1187        /**
1188         * @return {@link #definition} (Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.)
1189         */
1190        public Reference getDefinition() { 
1191          if (this.definition == null)
1192            if (Configuration.errorOnAutoCreate())
1193              throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.definition");
1194            else if (Configuration.doAutoCreate())
1195              this.definition = new Reference(); // cc
1196          return this.definition;
1197        }
1198
1199        public boolean hasDefinition() { 
1200          return this.definition != null && !this.definition.isEmpty();
1201        }
1202
1203        /**
1204         * @param value {@link #definition} (Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.)
1205         */
1206        public CarePlanActivityDetailComponent setDefinition(Reference value)  { 
1207          this.definition = value;
1208          return this;
1209        }
1210
1211        /**
1212         * @return {@link #definition} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.)
1213         */
1214        public Resource getDefinitionTarget() { 
1215          return this.definitionTarget;
1216        }
1217
1218        /**
1219         * @param value {@link #definition} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.)
1220         */
1221        public CarePlanActivityDetailComponent setDefinitionTarget(Resource value) { 
1222          this.definitionTarget = value;
1223          return this;
1224        }
1225
1226        /**
1227         * @return {@link #code} (Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.)
1228         */
1229        public CodeableConcept getCode() { 
1230          if (this.code == null)
1231            if (Configuration.errorOnAutoCreate())
1232              throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.code");
1233            else if (Configuration.doAutoCreate())
1234              this.code = new CodeableConcept(); // cc
1235          return this.code;
1236        }
1237
1238        public boolean hasCode() { 
1239          return this.code != null && !this.code.isEmpty();
1240        }
1241
1242        /**
1243         * @param value {@link #code} (Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.)
1244         */
1245        public CarePlanActivityDetailComponent setCode(CodeableConcept value)  { 
1246          this.code = value;
1247          return this;
1248        }
1249
1250        /**
1251         * @return {@link #reasonCode} (Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited.)
1252         */
1253        public List<CodeableConcept> getReasonCode() { 
1254          if (this.reasonCode == null)
1255            this.reasonCode = new ArrayList<CodeableConcept>();
1256          return this.reasonCode;
1257        }
1258
1259        /**
1260         * @return Returns a reference to <code>this</code> for easy method chaining
1261         */
1262        public CarePlanActivityDetailComponent setReasonCode(List<CodeableConcept> theReasonCode) { 
1263          this.reasonCode = theReasonCode;
1264          return this;
1265        }
1266
1267        public boolean hasReasonCode() { 
1268          if (this.reasonCode == null)
1269            return false;
1270          for (CodeableConcept item : this.reasonCode)
1271            if (!item.isEmpty())
1272              return true;
1273          return false;
1274        }
1275
1276        public CodeableConcept addReasonCode() { //3
1277          CodeableConcept t = new CodeableConcept();
1278          if (this.reasonCode == null)
1279            this.reasonCode = new ArrayList<CodeableConcept>();
1280          this.reasonCode.add(t);
1281          return t;
1282        }
1283
1284        public CarePlanActivityDetailComponent addReasonCode(CodeableConcept t) { //3
1285          if (t == null)
1286            return this;
1287          if (this.reasonCode == null)
1288            this.reasonCode = new ArrayList<CodeableConcept>();
1289          this.reasonCode.add(t);
1290          return this;
1291        }
1292
1293        /**
1294         * @return The first repetition of repeating field {@link #reasonCode}, creating it if it does not already exist
1295         */
1296        public CodeableConcept getReasonCodeFirstRep() { 
1297          if (getReasonCode().isEmpty()) {
1298            addReasonCode();
1299          }
1300          return getReasonCode().get(0);
1301        }
1302
1303        /**
1304         * @return {@link #reasonReference} (Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.)
1305         */
1306        public List<Reference> getReasonReference() { 
1307          if (this.reasonReference == null)
1308            this.reasonReference = new ArrayList<Reference>();
1309          return this.reasonReference;
1310        }
1311
1312        /**
1313         * @return Returns a reference to <code>this</code> for easy method chaining
1314         */
1315        public CarePlanActivityDetailComponent setReasonReference(List<Reference> theReasonReference) { 
1316          this.reasonReference = theReasonReference;
1317          return this;
1318        }
1319
1320        public boolean hasReasonReference() { 
1321          if (this.reasonReference == null)
1322            return false;
1323          for (Reference item : this.reasonReference)
1324            if (!item.isEmpty())
1325              return true;
1326          return false;
1327        }
1328
1329        public Reference addReasonReference() { //3
1330          Reference t = new Reference();
1331          if (this.reasonReference == null)
1332            this.reasonReference = new ArrayList<Reference>();
1333          this.reasonReference.add(t);
1334          return t;
1335        }
1336
1337        public CarePlanActivityDetailComponent addReasonReference(Reference t) { //3
1338          if (t == null)
1339            return this;
1340          if (this.reasonReference == null)
1341            this.reasonReference = new ArrayList<Reference>();
1342          this.reasonReference.add(t);
1343          return this;
1344        }
1345
1346        /**
1347         * @return The first repetition of repeating field {@link #reasonReference}, creating it if it does not already exist
1348         */
1349        public Reference getReasonReferenceFirstRep() { 
1350          if (getReasonReference().isEmpty()) {
1351            addReasonReference();
1352          }
1353          return getReasonReference().get(0);
1354        }
1355
1356        /**
1357         * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.)
1358         */
1359        public List<Reference> getGoal() { 
1360          if (this.goal == null)
1361            this.goal = new ArrayList<Reference>();
1362          return this.goal;
1363        }
1364
1365        /**
1366         * @return Returns a reference to <code>this</code> for easy method chaining
1367         */
1368        public CarePlanActivityDetailComponent setGoal(List<Reference> theGoal) { 
1369          this.goal = theGoal;
1370          return this;
1371        }
1372
1373        public boolean hasGoal() { 
1374          if (this.goal == null)
1375            return false;
1376          for (Reference item : this.goal)
1377            if (!item.isEmpty())
1378              return true;
1379          return false;
1380        }
1381
1382        public Reference addGoal() { //3
1383          Reference t = new Reference();
1384          if (this.goal == null)
1385            this.goal = new ArrayList<Reference>();
1386          this.goal.add(t);
1387          return t;
1388        }
1389
1390        public CarePlanActivityDetailComponent addGoal(Reference t) { //3
1391          if (t == null)
1392            return this;
1393          if (this.goal == null)
1394            this.goal = new ArrayList<Reference>();
1395          this.goal.add(t);
1396          return this;
1397        }
1398
1399        /**
1400         * @return The first repetition of repeating field {@link #goal}, creating it if it does not already exist
1401         */
1402        public Reference getGoalFirstRep() { 
1403          if (getGoal().isEmpty()) {
1404            addGoal();
1405          }
1406          return getGoal().get(0);
1407        }
1408
1409        /**
1410         * @return {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1411         */
1412        public Enumeration<CarePlanActivityStatus> getStatusElement() { 
1413          if (this.status == null)
1414            if (Configuration.errorOnAutoCreate())
1415              throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.status");
1416            else if (Configuration.doAutoCreate())
1417              this.status = new Enumeration<CarePlanActivityStatus>(new CarePlanActivityStatusEnumFactory()); // bb
1418          return this.status;
1419        }
1420
1421        public boolean hasStatusElement() { 
1422          return this.status != null && !this.status.isEmpty();
1423        }
1424
1425        public boolean hasStatus() { 
1426          return this.status != null && !this.status.isEmpty();
1427        }
1428
1429        /**
1430         * @param value {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1431         */
1432        public CarePlanActivityDetailComponent setStatusElement(Enumeration<CarePlanActivityStatus> value) { 
1433          this.status = value;
1434          return this;
1435        }
1436
1437        /**
1438         * @return Identifies what progress is being made for the specific activity.
1439         */
1440        public CarePlanActivityStatus getStatus() { 
1441          return this.status == null ? null : this.status.getValue();
1442        }
1443
1444        /**
1445         * @param value Identifies what progress is being made for the specific activity.
1446         */
1447        public CarePlanActivityDetailComponent setStatus(CarePlanActivityStatus value) { 
1448            if (this.status == null)
1449              this.status = new Enumeration<CarePlanActivityStatus>(new CarePlanActivityStatusEnumFactory());
1450            this.status.setValue(value);
1451          return this;
1452        }
1453
1454        /**
1455         * @return {@link #statusReason} (Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusReason" gives direct access to the value
1456         */
1457        public StringType getStatusReasonElement() { 
1458          if (this.statusReason == null)
1459            if (Configuration.errorOnAutoCreate())
1460              throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.statusReason");
1461            else if (Configuration.doAutoCreate())
1462              this.statusReason = new StringType(); // bb
1463          return this.statusReason;
1464        }
1465
1466        public boolean hasStatusReasonElement() { 
1467          return this.statusReason != null && !this.statusReason.isEmpty();
1468        }
1469
1470        public boolean hasStatusReason() { 
1471          return this.statusReason != null && !this.statusReason.isEmpty();
1472        }
1473
1474        /**
1475         * @param value {@link #statusReason} (Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusReason" gives direct access to the value
1476         */
1477        public CarePlanActivityDetailComponent setStatusReasonElement(StringType value) { 
1478          this.statusReason = value;
1479          return this;
1480        }
1481
1482        /**
1483         * @return Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.
1484         */
1485        public String getStatusReason() { 
1486          return this.statusReason == null ? null : this.statusReason.getValue();
1487        }
1488
1489        /**
1490         * @param value Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.
1491         */
1492        public CarePlanActivityDetailComponent setStatusReason(String value) { 
1493          if (Utilities.noString(value))
1494            this.statusReason = null;
1495          else {
1496            if (this.statusReason == null)
1497              this.statusReason = new StringType();
1498            this.statusReason.setValue(value);
1499          }
1500          return this;
1501        }
1502
1503        /**
1504         * @return {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.  If false, indicates that the described activity is one that should be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value
1505         */
1506        public BooleanType getProhibitedElement() { 
1507          if (this.prohibited == null)
1508            if (Configuration.errorOnAutoCreate())
1509              throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.prohibited");
1510            else if (Configuration.doAutoCreate())
1511              this.prohibited = new BooleanType(); // bb
1512          return this.prohibited;
1513        }
1514
1515        public boolean hasProhibitedElement() { 
1516          return this.prohibited != null && !this.prohibited.isEmpty();
1517        }
1518
1519        public boolean hasProhibited() { 
1520          return this.prohibited != null && !this.prohibited.isEmpty();
1521        }
1522
1523        /**
1524         * @param value {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.  If false, indicates that the described activity is one that should be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value
1525         */
1526        public CarePlanActivityDetailComponent setProhibitedElement(BooleanType value) { 
1527          this.prohibited = value;
1528          return this;
1529        }
1530
1531        /**
1532         * @return If true, indicates that the described activity is one that must NOT be engaged in when following the plan.  If false, indicates that the described activity is one that should be engaged in when following the plan.
1533         */
1534        public boolean getProhibited() { 
1535          return this.prohibited == null || this.prohibited.isEmpty() ? false : this.prohibited.getValue();
1536        }
1537
1538        /**
1539         * @param value If true, indicates that the described activity is one that must NOT be engaged in when following the plan.  If false, indicates that the described activity is one that should be engaged in when following the plan.
1540         */
1541        public CarePlanActivityDetailComponent setProhibited(boolean value) { 
1542            if (this.prohibited == null)
1543              this.prohibited = new BooleanType();
1544            this.prohibited.setValue(value);
1545          return this;
1546        }
1547
1548        /**
1549         * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.)
1550         */
1551        public Type getScheduled() { 
1552          return this.scheduled;
1553        }
1554
1555        /**
1556         * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.)
1557         */
1558        public Timing getScheduledTiming() throws FHIRException { 
1559          if (this.scheduled == null)
1560            return null;
1561          if (!(this.scheduled instanceof Timing))
1562            throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered");
1563          return (Timing) this.scheduled;
1564        }
1565
1566        public boolean hasScheduledTiming() {
1567            return this.scheduled instanceof Timing;
1568        }
1569
1570        /**
1571         * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.)
1572         */
1573        public Period getScheduledPeriod() throws FHIRException { 
1574          if (this.scheduled == null)
1575            return null;
1576          if (!(this.scheduled instanceof Period))
1577            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered");
1578          return (Period) this.scheduled;
1579        }
1580
1581        public boolean hasScheduledPeriod() {
1582            return this.scheduled instanceof Period;
1583        }
1584
1585        /**
1586         * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.)
1587         */
1588        public StringType getScheduledStringType() throws FHIRException { 
1589          if (this.scheduled == null)
1590            return null;
1591          if (!(this.scheduled instanceof StringType))
1592            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.scheduled.getClass().getName()+" was encountered");
1593          return (StringType) this.scheduled;
1594        }
1595
1596        public boolean hasScheduledStringType() {
1597            return this.scheduled instanceof StringType;
1598        }
1599
1600        public boolean hasScheduled() { 
1601          return this.scheduled != null && !this.scheduled.isEmpty();
1602        }
1603
1604        /**
1605         * @param value {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.)
1606         */
1607        public CarePlanActivityDetailComponent setScheduled(Type value) throws FHIRFormatError { 
1608          if (value != null && !(value instanceof Timing || value instanceof Period || value instanceof StringType))
1609            throw new FHIRFormatError("Not the right type for CarePlan.activity.detail.scheduled[x]: "+value.fhirType());
1610          this.scheduled = value;
1611          return this;
1612        }
1613
1614        /**
1615         * @return {@link #location} (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.)
1616         */
1617        public Reference getLocation() { 
1618          if (this.location == null)
1619            if (Configuration.errorOnAutoCreate())
1620              throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.location");
1621            else if (Configuration.doAutoCreate())
1622              this.location = new Reference(); // cc
1623          return this.location;
1624        }
1625
1626        public boolean hasLocation() { 
1627          return this.location != null && !this.location.isEmpty();
1628        }
1629
1630        /**
1631         * @param value {@link #location} (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.)
1632         */
1633        public CarePlanActivityDetailComponent setLocation(Reference value)  { 
1634          this.location = value;
1635          return this;
1636        }
1637
1638        /**
1639         * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.)
1640         */
1641        public Location getLocationTarget() { 
1642          if (this.locationTarget == null)
1643            if (Configuration.errorOnAutoCreate())
1644              throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.location");
1645            else if (Configuration.doAutoCreate())
1646              this.locationTarget = new Location(); // aa
1647          return this.locationTarget;
1648        }
1649
1650        /**
1651         * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.)
1652         */
1653        public CarePlanActivityDetailComponent setLocationTarget(Location value) { 
1654          this.locationTarget = value;
1655          return this;
1656        }
1657
1658        /**
1659         * @return {@link #performer} (Identifies who's expected to be involved in the activity.)
1660         */
1661        public List<Reference> getPerformer() { 
1662          if (this.performer == null)
1663            this.performer = new ArrayList<Reference>();
1664          return this.performer;
1665        }
1666
1667        /**
1668         * @return Returns a reference to <code>this</code> for easy method chaining
1669         */
1670        public CarePlanActivityDetailComponent setPerformer(List<Reference> thePerformer) { 
1671          this.performer = thePerformer;
1672          return this;
1673        }
1674
1675        public boolean hasPerformer() { 
1676          if (this.performer == null)
1677            return false;
1678          for (Reference item : this.performer)
1679            if (!item.isEmpty())
1680              return true;
1681          return false;
1682        }
1683
1684        public Reference addPerformer() { //3
1685          Reference t = new Reference();
1686          if (this.performer == null)
1687            this.performer = new ArrayList<Reference>();
1688          this.performer.add(t);
1689          return t;
1690        }
1691
1692        public CarePlanActivityDetailComponent addPerformer(Reference t) { //3
1693          if (t == null)
1694            return this;
1695          if (this.performer == null)
1696            this.performer = new ArrayList<Reference>();
1697          this.performer.add(t);
1698          return this;
1699        }
1700
1701        /**
1702         * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist
1703         */
1704        public Reference getPerformerFirstRep() { 
1705          if (getPerformer().isEmpty()) {
1706            addPerformer();
1707          }
1708          return getPerformer().get(0);
1709        }
1710
1711        /**
1712         * @return {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.)
1713         */
1714        public Type getProduct() { 
1715          return this.product;
1716        }
1717
1718        /**
1719         * @return {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.)
1720         */
1721        public CodeableConcept getProductCodeableConcept() throws FHIRException { 
1722          if (this.product == null)
1723            return null;
1724          if (!(this.product instanceof CodeableConcept))
1725            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.product.getClass().getName()+" was encountered");
1726          return (CodeableConcept) this.product;
1727        }
1728
1729        public boolean hasProductCodeableConcept() {
1730            return this.product instanceof CodeableConcept;
1731        }
1732
1733        /**
1734         * @return {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.)
1735         */
1736        public Reference getProductReference() throws FHIRException { 
1737          if (this.product == null)
1738            return null;
1739          if (!(this.product instanceof Reference))
1740            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.product.getClass().getName()+" was encountered");
1741          return (Reference) this.product;
1742        }
1743
1744        public boolean hasProductReference() {
1745            return this.product instanceof Reference;
1746        }
1747
1748        public boolean hasProduct() { 
1749          return this.product != null && !this.product.isEmpty();
1750        }
1751
1752        /**
1753         * @param value {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.)
1754         */
1755        public CarePlanActivityDetailComponent setProduct(Type value) throws FHIRFormatError { 
1756          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
1757            throw new FHIRFormatError("Not the right type for CarePlan.activity.detail.product[x]: "+value.fhirType());
1758          this.product = value;
1759          return this;
1760        }
1761
1762        /**
1763         * @return {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.)
1764         */
1765        public SimpleQuantity getDailyAmount() { 
1766          if (this.dailyAmount == null)
1767            if (Configuration.errorOnAutoCreate())
1768              throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.dailyAmount");
1769            else if (Configuration.doAutoCreate())
1770              this.dailyAmount = new SimpleQuantity(); // cc
1771          return this.dailyAmount;
1772        }
1773
1774        public boolean hasDailyAmount() { 
1775          return this.dailyAmount != null && !this.dailyAmount.isEmpty();
1776        }
1777
1778        /**
1779         * @param value {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.)
1780         */
1781        public CarePlanActivityDetailComponent setDailyAmount(SimpleQuantity value)  { 
1782          this.dailyAmount = value;
1783          return this;
1784        }
1785
1786        /**
1787         * @return {@link #quantity} (Identifies the quantity expected to be supplied, administered or consumed by the subject.)
1788         */
1789        public SimpleQuantity getQuantity() { 
1790          if (this.quantity == null)
1791            if (Configuration.errorOnAutoCreate())
1792              throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.quantity");
1793            else if (Configuration.doAutoCreate())
1794              this.quantity = new SimpleQuantity(); // cc
1795          return this.quantity;
1796        }
1797
1798        public boolean hasQuantity() { 
1799          return this.quantity != null && !this.quantity.isEmpty();
1800        }
1801
1802        /**
1803         * @param value {@link #quantity} (Identifies the quantity expected to be supplied, administered or consumed by the subject.)
1804         */
1805        public CarePlanActivityDetailComponent setQuantity(SimpleQuantity value)  { 
1806          this.quantity = value;
1807          return this;
1808        }
1809
1810        /**
1811         * @return {@link #description} (This provides a textual description of constraints on the intended activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1812         */
1813        public StringType getDescriptionElement() { 
1814          if (this.description == null)
1815            if (Configuration.errorOnAutoCreate())
1816              throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.description");
1817            else if (Configuration.doAutoCreate())
1818              this.description = new StringType(); // bb
1819          return this.description;
1820        }
1821
1822        public boolean hasDescriptionElement() { 
1823          return this.description != null && !this.description.isEmpty();
1824        }
1825
1826        public boolean hasDescription() { 
1827          return this.description != null && !this.description.isEmpty();
1828        }
1829
1830        /**
1831         * @param value {@link #description} (This provides a textual description of constraints on the intended activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1832         */
1833        public CarePlanActivityDetailComponent setDescriptionElement(StringType value) { 
1834          this.description = value;
1835          return this;
1836        }
1837
1838        /**
1839         * @return This provides a textual description of constraints on the intended activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.
1840         */
1841        public String getDescription() { 
1842          return this.description == null ? null : this.description.getValue();
1843        }
1844
1845        /**
1846         * @param value This provides a textual description of constraints on the intended activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.
1847         */
1848        public CarePlanActivityDetailComponent setDescription(String value) { 
1849          if (Utilities.noString(value))
1850            this.description = null;
1851          else {
1852            if (this.description == null)
1853              this.description = new StringType();
1854            this.description.setValue(value);
1855          }
1856          return this;
1857        }
1858
1859        protected void listChildren(List<Property> children) {
1860          super.listChildren(children);
1861          children.add(new Property("category", "CodeableConcept", "High-level categorization of the type of activity in a care plan.", 0, 1, category));
1862          children.add(new Property("definition", "Reference(PlanDefinition|ActivityDefinition|Questionnaire)", "Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.", 0, 1, definition));
1863          children.add(new Property("code", "CodeableConcept", "Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.", 0, 1, code));
1864          children.add(new Property("reasonCode", "CodeableConcept", "Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited.", 0, java.lang.Integer.MAX_VALUE, reasonCode));
1865          children.add(new Property("reasonReference", "Reference(Condition)", "Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.", 0, java.lang.Integer.MAX_VALUE, reasonReference));
1866          children.add(new Property("goal", "Reference(Goal)", "Internal reference that identifies the goals that this activity is intended to contribute towards meeting.", 0, java.lang.Integer.MAX_VALUE, goal));
1867          children.add(new Property("status", "code", "Identifies what progress is being made for the specific activity.", 0, 1, status));
1868          children.add(new Property("statusReason", "string", "Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.", 0, 1, statusReason));
1869          children.add(new Property("prohibited", "boolean", "If true, indicates that the described activity is one that must NOT be engaged in when following the plan.  If false, indicates that the described activity is one that should be engaged in when following the plan.", 0, 1, prohibited));
1870          children.add(new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, scheduled));
1871          children.add(new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.", 0, 1, location));
1872          children.add(new Property("performer", "Reference(Practitioner|Organization|RelatedPerson|Patient|CareTeam)", "Identifies who's expected to be involved in the activity.", 0, java.lang.Integer.MAX_VALUE, performer));
1873          children.add(new Property("product[x]", "CodeableConcept|Reference(Medication|Substance)", "Identifies the food, drug or other product to be consumed or supplied in the activity.", 0, 1, product));
1874          children.add(new Property("dailyAmount", "SimpleQuantity", "Identifies the quantity expected to be consumed in a given day.", 0, 1, dailyAmount));
1875          children.add(new Property("quantity", "SimpleQuantity", "Identifies the quantity expected to be supplied, administered or consumed by the subject.", 0, 1, quantity));
1876          children.add(new Property("description", "string", "This provides a textual description of constraints on the intended activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.", 0, 1, description));
1877        }
1878
1879        @Override
1880        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1881          switch (_hash) {
1882          case 50511102: /*category*/  return new Property("category", "CodeableConcept", "High-level categorization of the type of activity in a care plan.", 0, 1, category);
1883          case -1014418093: /*definition*/  return new Property("definition", "Reference(PlanDefinition|ActivityDefinition|Questionnaire)", "Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.", 0, 1, definition);
1884          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.", 0, 1, code);
1885          case 722137681: /*reasonCode*/  return new Property("reasonCode", "CodeableConcept", "Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
1886          case -1146218137: /*reasonReference*/  return new Property("reasonReference", "Reference(Condition)", "Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.", 0, java.lang.Integer.MAX_VALUE, reasonReference);
1887          case 3178259: /*goal*/  return new Property("goal", "Reference(Goal)", "Internal reference that identifies the goals that this activity is intended to contribute towards meeting.", 0, java.lang.Integer.MAX_VALUE, goal);
1888          case -892481550: /*status*/  return new Property("status", "code", "Identifies what progress is being made for the specific activity.", 0, 1, status);
1889          case 2051346646: /*statusReason*/  return new Property("statusReason", "string", "Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.", 0, 1, statusReason);
1890          case 663275198: /*prohibited*/  return new Property("prohibited", "boolean", "If true, indicates that the described activity is one that must NOT be engaged in when following the plan.  If false, indicates that the described activity is one that should be engaged in when following the plan.", 0, 1, prohibited);
1891          case 1162627251: /*scheduled[x]*/  return new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, scheduled);
1892          case -160710483: /*scheduled*/  return new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, scheduled);
1893          case 998483799: /*scheduledTiming*/  return new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, scheduled);
1894          case 880422094: /*scheduledPeriod*/  return new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, scheduled);
1895          case 980162334: /*scheduledString*/  return new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, 1, scheduled);
1896          case 1901043637: /*location*/  return new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.", 0, 1, location);
1897          case 481140686: /*performer*/  return new Property("performer", "Reference(Practitioner|Organization|RelatedPerson|Patient|CareTeam)", "Identifies who's expected to be involved in the activity.", 0, java.lang.Integer.MAX_VALUE, performer);
1898          case 1753005361: /*product[x]*/  return new Property("product[x]", "CodeableConcept|Reference(Medication|Substance)", "Identifies the food, drug or other product to be consumed or supplied in the activity.", 0, 1, product);
1899          case -309474065: /*product*/  return new Property("product[x]", "CodeableConcept|Reference(Medication|Substance)", "Identifies the food, drug or other product to be consumed or supplied in the activity.", 0, 1, product);
1900          case 906854066: /*productCodeableConcept*/  return new Property("product[x]", "CodeableConcept|Reference(Medication|Substance)", "Identifies the food, drug or other product to be consumed or supplied in the activity.", 0, 1, product);
1901          case -669667556: /*productReference*/  return new Property("product[x]", "CodeableConcept|Reference(Medication|Substance)", "Identifies the food, drug or other product to be consumed or supplied in the activity.", 0, 1, product);
1902          case -768908335: /*dailyAmount*/  return new Property("dailyAmount", "SimpleQuantity", "Identifies the quantity expected to be consumed in a given day.", 0, 1, dailyAmount);
1903          case -1285004149: /*quantity*/  return new Property("quantity", "SimpleQuantity", "Identifies the quantity expected to be supplied, administered or consumed by the subject.", 0, 1, quantity);
1904          case -1724546052: /*description*/  return new Property("description", "string", "This provides a textual description of constraints on the intended activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.", 0, 1, description);
1905          default: return super.getNamedProperty(_hash, _name, _checkValid);
1906          }
1907
1908        }
1909
1910      @Override
1911      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1912        switch (hash) {
1913        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept
1914        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // Reference
1915        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1916        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
1917        case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
1918        case 3178259: /*goal*/ return this.goal == null ? new Base[0] : this.goal.toArray(new Base[this.goal.size()]); // Reference
1919        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<CarePlanActivityStatus>
1920        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // StringType
1921        case 663275198: /*prohibited*/ return this.prohibited == null ? new Base[0] : new Base[] {this.prohibited}; // BooleanType
1922        case -160710483: /*scheduled*/ return this.scheduled == null ? new Base[0] : new Base[] {this.scheduled}; // Type
1923        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
1924        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // Reference
1925        case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // Type
1926        case -768908335: /*dailyAmount*/ return this.dailyAmount == null ? new Base[0] : new Base[] {this.dailyAmount}; // SimpleQuantity
1927        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity
1928        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1929        default: return super.getProperty(hash, name, checkValid);
1930        }
1931
1932      }
1933
1934      @Override
1935      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1936        switch (hash) {
1937        case 50511102: // category
1938          this.category = castToCodeableConcept(value); // CodeableConcept
1939          return value;
1940        case -1014418093: // definition
1941          this.definition = castToReference(value); // Reference
1942          return value;
1943        case 3059181: // code
1944          this.code = castToCodeableConcept(value); // CodeableConcept
1945          return value;
1946        case 722137681: // reasonCode
1947          this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
1948          return value;
1949        case -1146218137: // reasonReference
1950          this.getReasonReference().add(castToReference(value)); // Reference
1951          return value;
1952        case 3178259: // goal
1953          this.getGoal().add(castToReference(value)); // Reference
1954          return value;
1955        case -892481550: // status
1956          value = new CarePlanActivityStatusEnumFactory().fromType(castToCode(value));
1957          this.status = (Enumeration) value; // Enumeration<CarePlanActivityStatus>
1958          return value;
1959        case 2051346646: // statusReason
1960          this.statusReason = castToString(value); // StringType
1961          return value;
1962        case 663275198: // prohibited
1963          this.prohibited = castToBoolean(value); // BooleanType
1964          return value;
1965        case -160710483: // scheduled
1966          this.scheduled = castToType(value); // Type
1967          return value;
1968        case 1901043637: // location
1969          this.location = castToReference(value); // Reference
1970          return value;
1971        case 481140686: // performer
1972          this.getPerformer().add(castToReference(value)); // Reference
1973          return value;
1974        case -309474065: // product
1975          this.product = castToType(value); // Type
1976          return value;
1977        case -768908335: // dailyAmount
1978          this.dailyAmount = castToSimpleQuantity(value); // SimpleQuantity
1979          return value;
1980        case -1285004149: // quantity
1981          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
1982          return value;
1983        case -1724546052: // description
1984          this.description = castToString(value); // StringType
1985          return value;
1986        default: return super.setProperty(hash, name, value);
1987        }
1988
1989      }
1990
1991      @Override
1992      public Base setProperty(String name, Base value) throws FHIRException {
1993        if (name.equals("category")) {
1994          this.category = castToCodeableConcept(value); // CodeableConcept
1995        } else if (name.equals("definition")) {
1996          this.definition = castToReference(value); // Reference
1997        } else if (name.equals("code")) {
1998          this.code = castToCodeableConcept(value); // CodeableConcept
1999        } else if (name.equals("reasonCode")) {
2000          this.getReasonCode().add(castToCodeableConcept(value));
2001        } else if (name.equals("reasonReference")) {
2002          this.getReasonReference().add(castToReference(value));
2003        } else if (name.equals("goal")) {
2004          this.getGoal().add(castToReference(value));
2005        } else if (name.equals("status")) {
2006          value = new CarePlanActivityStatusEnumFactory().fromType(castToCode(value));
2007          this.status = (Enumeration) value; // Enumeration<CarePlanActivityStatus>
2008        } else if (name.equals("statusReason")) {
2009          this.statusReason = castToString(value); // StringType
2010        } else if (name.equals("prohibited")) {
2011          this.prohibited = castToBoolean(value); // BooleanType
2012        } else if (name.equals("scheduled[x]")) {
2013          this.scheduled = castToType(value); // Type
2014        } else if (name.equals("location")) {
2015          this.location = castToReference(value); // Reference
2016        } else if (name.equals("performer")) {
2017          this.getPerformer().add(castToReference(value));
2018        } else if (name.equals("product[x]")) {
2019          this.product = castToType(value); // Type
2020        } else if (name.equals("dailyAmount")) {
2021          this.dailyAmount = castToSimpleQuantity(value); // SimpleQuantity
2022        } else if (name.equals("quantity")) {
2023          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
2024        } else if (name.equals("description")) {
2025          this.description = castToString(value); // StringType
2026        } else
2027          return super.setProperty(name, value);
2028        return value;
2029      }
2030
2031      @Override
2032      public Base makeProperty(int hash, String name) throws FHIRException {
2033        switch (hash) {
2034        case 50511102:  return getCategory(); 
2035        case -1014418093:  return getDefinition(); 
2036        case 3059181:  return getCode(); 
2037        case 722137681:  return addReasonCode(); 
2038        case -1146218137:  return addReasonReference(); 
2039        case 3178259:  return addGoal(); 
2040        case -892481550:  return getStatusElement();
2041        case 2051346646:  return getStatusReasonElement();
2042        case 663275198:  return getProhibitedElement();
2043        case 1162627251:  return getScheduled(); 
2044        case -160710483:  return getScheduled(); 
2045        case 1901043637:  return getLocation(); 
2046        case 481140686:  return addPerformer(); 
2047        case 1753005361:  return getProduct(); 
2048        case -309474065:  return getProduct(); 
2049        case -768908335:  return getDailyAmount(); 
2050        case -1285004149:  return getQuantity(); 
2051        case -1724546052:  return getDescriptionElement();
2052        default: return super.makeProperty(hash, name);
2053        }
2054
2055      }
2056
2057      @Override
2058      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2059        switch (hash) {
2060        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2061        case -1014418093: /*definition*/ return new String[] {"Reference"};
2062        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2063        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
2064        case -1146218137: /*reasonReference*/ return new String[] {"Reference"};
2065        case 3178259: /*goal*/ return new String[] {"Reference"};
2066        case -892481550: /*status*/ return new String[] {"code"};
2067        case 2051346646: /*statusReason*/ return new String[] {"string"};
2068        case 663275198: /*prohibited*/ return new String[] {"boolean"};
2069        case -160710483: /*scheduled*/ return new String[] {"Timing", "Period", "string"};
2070        case 1901043637: /*location*/ return new String[] {"Reference"};
2071        case 481140686: /*performer*/ return new String[] {"Reference"};
2072        case -309474065: /*product*/ return new String[] {"CodeableConcept", "Reference"};
2073        case -768908335: /*dailyAmount*/ return new String[] {"SimpleQuantity"};
2074        case -1285004149: /*quantity*/ return new String[] {"SimpleQuantity"};
2075        case -1724546052: /*description*/ return new String[] {"string"};
2076        default: return super.getTypesForProperty(hash, name);
2077        }
2078
2079      }
2080
2081      @Override
2082      public Base addChild(String name) throws FHIRException {
2083        if (name.equals("category")) {
2084          this.category = new CodeableConcept();
2085          return this.category;
2086        }
2087        else if (name.equals("definition")) {
2088          this.definition = new Reference();
2089          return this.definition;
2090        }
2091        else if (name.equals("code")) {
2092          this.code = new CodeableConcept();
2093          return this.code;
2094        }
2095        else if (name.equals("reasonCode")) {
2096          return addReasonCode();
2097        }
2098        else if (name.equals("reasonReference")) {
2099          return addReasonReference();
2100        }
2101        else if (name.equals("goal")) {
2102          return addGoal();
2103        }
2104        else if (name.equals("status")) {
2105          throw new FHIRException("Cannot call addChild on a singleton property CarePlan.status");
2106        }
2107        else if (name.equals("statusReason")) {
2108          throw new FHIRException("Cannot call addChild on a singleton property CarePlan.statusReason");
2109        }
2110        else if (name.equals("prohibited")) {
2111          throw new FHIRException("Cannot call addChild on a singleton property CarePlan.prohibited");
2112        }
2113        else if (name.equals("scheduledTiming")) {
2114          this.scheduled = new Timing();
2115          return this.scheduled;
2116        }
2117        else if (name.equals("scheduledPeriod")) {
2118          this.scheduled = new Period();
2119          return this.scheduled;
2120        }
2121        else if (name.equals("scheduledString")) {
2122          this.scheduled = new StringType();
2123          return this.scheduled;
2124        }
2125        else if (name.equals("location")) {
2126          this.location = new Reference();
2127          return this.location;
2128        }
2129        else if (name.equals("performer")) {
2130          return addPerformer();
2131        }
2132        else if (name.equals("productCodeableConcept")) {
2133          this.product = new CodeableConcept();
2134          return this.product;
2135        }
2136        else if (name.equals("productReference")) {
2137          this.product = new Reference();
2138          return this.product;
2139        }
2140        else if (name.equals("dailyAmount")) {
2141          this.dailyAmount = new SimpleQuantity();
2142          return this.dailyAmount;
2143        }
2144        else if (name.equals("quantity")) {
2145          this.quantity = new SimpleQuantity();
2146          return this.quantity;
2147        }
2148        else if (name.equals("description")) {
2149          throw new FHIRException("Cannot call addChild on a singleton property CarePlan.description");
2150        }
2151        else
2152          return super.addChild(name);
2153      }
2154
2155      public CarePlanActivityDetailComponent copy() {
2156        CarePlanActivityDetailComponent dst = new CarePlanActivityDetailComponent();
2157        copyValues(dst);
2158        dst.category = category == null ? null : category.copy();
2159        dst.definition = definition == null ? null : definition.copy();
2160        dst.code = code == null ? null : code.copy();
2161        if (reasonCode != null) {
2162          dst.reasonCode = new ArrayList<CodeableConcept>();
2163          for (CodeableConcept i : reasonCode)
2164            dst.reasonCode.add(i.copy());
2165        };
2166        if (reasonReference != null) {
2167          dst.reasonReference = new ArrayList<Reference>();
2168          for (Reference i : reasonReference)
2169            dst.reasonReference.add(i.copy());
2170        };
2171        if (goal != null) {
2172          dst.goal = new ArrayList<Reference>();
2173          for (Reference i : goal)
2174            dst.goal.add(i.copy());
2175        };
2176        dst.status = status == null ? null : status.copy();
2177        dst.statusReason = statusReason == null ? null : statusReason.copy();
2178        dst.prohibited = prohibited == null ? null : prohibited.copy();
2179        dst.scheduled = scheduled == null ? null : scheduled.copy();
2180        dst.location = location == null ? null : location.copy();
2181        if (performer != null) {
2182          dst.performer = new ArrayList<Reference>();
2183          for (Reference i : performer)
2184            dst.performer.add(i.copy());
2185        };
2186        dst.product = product == null ? null : product.copy();
2187        dst.dailyAmount = dailyAmount == null ? null : dailyAmount.copy();
2188        dst.quantity = quantity == null ? null : quantity.copy();
2189        dst.description = description == null ? null : description.copy();
2190        return dst;
2191      }
2192
2193      @Override
2194      public boolean equalsDeep(Base other_) {
2195        if (!super.equalsDeep(other_))
2196          return false;
2197        if (!(other_ instanceof CarePlanActivityDetailComponent))
2198          return false;
2199        CarePlanActivityDetailComponent o = (CarePlanActivityDetailComponent) other_;
2200        return compareDeep(category, o.category, true) && compareDeep(definition, o.definition, true) && compareDeep(code, o.code, true)
2201           && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
2202           && compareDeep(goal, o.goal, true) && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true)
2203           && compareDeep(prohibited, o.prohibited, true) && compareDeep(scheduled, o.scheduled, true) && compareDeep(location, o.location, true)
2204           && compareDeep(performer, o.performer, true) && compareDeep(product, o.product, true) && compareDeep(dailyAmount, o.dailyAmount, true)
2205           && compareDeep(quantity, o.quantity, true) && compareDeep(description, o.description, true);
2206      }
2207
2208      @Override
2209      public boolean equalsShallow(Base other_) {
2210        if (!super.equalsShallow(other_))
2211          return false;
2212        if (!(other_ instanceof CarePlanActivityDetailComponent))
2213          return false;
2214        CarePlanActivityDetailComponent o = (CarePlanActivityDetailComponent) other_;
2215        return compareValues(status, o.status, true) && compareValues(statusReason, o.statusReason, true) && compareValues(prohibited, o.prohibited, true)
2216           && compareValues(description, o.description, true);
2217      }
2218
2219      public boolean isEmpty() {
2220        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, definition, code
2221          , reasonCode, reasonReference, goal, status, statusReason, prohibited, scheduled
2222          , location, performer, product, dailyAmount, quantity, description);
2223      }
2224
2225  public String fhirType() {
2226    return "CarePlan.activity.detail";
2227
2228  }
2229
2230  }
2231
2232    /**
2233     * This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).
2234     */
2235    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2236    @Description(shortDefinition="External Ids for this plan", formalDefinition="This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)." )
2237    protected List<Identifier> identifier;
2238
2239    /**
2240     * Identifies the protocol, questionnaire, guideline or other specification the care plan should be conducted in accordance with.
2241     */
2242    @Child(name = "definition", type = {PlanDefinition.class, Questionnaire.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2243    @Description(shortDefinition="Protocol or definition", formalDefinition="Identifies the protocol, questionnaire, guideline or other specification the care plan should be conducted in accordance with." )
2244    protected List<Reference> definition;
2245    /**
2246     * The actual objects that are the target of the reference (Identifies the protocol, questionnaire, guideline or other specification the care plan should be conducted in accordance with.)
2247     */
2248    protected List<Resource> definitionTarget;
2249
2250
2251    /**
2252     * A care plan that is fulfilled in whole or in part by this care plan.
2253     */
2254    @Child(name = "basedOn", type = {CarePlan.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2255    @Description(shortDefinition="Fulfills care plan", formalDefinition="A care plan that is fulfilled in whole or in part by this care plan." )
2256    protected List<Reference> basedOn;
2257    /**
2258     * The actual objects that are the target of the reference (A care plan that is fulfilled in whole or in part by this care plan.)
2259     */
2260    protected List<CarePlan> basedOnTarget;
2261
2262
2263    /**
2264     * Completed or terminated care plan whose function is taken by this new care plan.
2265     */
2266    @Child(name = "replaces", type = {CarePlan.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2267    @Description(shortDefinition="CarePlan replaced by this CarePlan", formalDefinition="Completed or terminated care plan whose function is taken by this new care plan." )
2268    protected List<Reference> replaces;
2269    /**
2270     * The actual objects that are the target of the reference (Completed or terminated care plan whose function is taken by this new care plan.)
2271     */
2272    protected List<CarePlan> replacesTarget;
2273
2274
2275    /**
2276     * A larger care plan of which this particular care plan is a component or step.
2277     */
2278    @Child(name = "partOf", type = {CarePlan.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2279    @Description(shortDefinition="Part of referenced CarePlan", formalDefinition="A larger care plan of which this particular care plan is a component or step." )
2280    protected List<Reference> partOf;
2281    /**
2282     * The actual objects that are the target of the reference (A larger care plan of which this particular care plan is a component or step.)
2283     */
2284    protected List<CarePlan> partOfTarget;
2285
2286
2287    /**
2288     * Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.
2289     */
2290    @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true)
2291    @Description(shortDefinition="draft | active | suspended | completed | entered-in-error | cancelled | unknown", formalDefinition="Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record." )
2292    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/care-plan-status")
2293    protected Enumeration<CarePlanStatus> status;
2294
2295    /**
2296     * Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain.
2297     */
2298    @Child(name = "intent", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true)
2299    @Description(shortDefinition="proposal | plan | order | option", formalDefinition="Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain." )
2300    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/care-plan-intent")
2301    protected Enumeration<CarePlanIntent> intent;
2302
2303    /**
2304     * Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans; e.g. "Home health", "psychiatric", "asthma", "disease management", "wellness plan", etc.
2305     */
2306    @Child(name = "category", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2307    @Description(shortDefinition="Type of plan", formalDefinition="Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc." )
2308    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/care-plan-category")
2309    protected List<CodeableConcept> category;
2310
2311    /**
2312     * Human-friendly name for the CarePlan.
2313     */
2314    @Child(name = "title", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true)
2315    @Description(shortDefinition="Human-friendly name for the CarePlan", formalDefinition="Human-friendly name for the CarePlan." )
2316    protected StringType title;
2317
2318    /**
2319     * A description of the scope and nature of the plan.
2320     */
2321    @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true)
2322    @Description(shortDefinition="Summary of nature of plan", formalDefinition="A description of the scope and nature of the plan." )
2323    protected StringType description;
2324
2325    /**
2326     * Identifies the patient or group whose intended care is described by the plan.
2327     */
2328    @Child(name = "subject", type = {Patient.class, Group.class}, order=10, min=1, max=1, modifier=false, summary=true)
2329    @Description(shortDefinition="Who care plan is for", formalDefinition="Identifies the patient or group whose intended care is described by the plan." )
2330    protected Reference subject;
2331
2332    /**
2333     * The actual object that is the target of the reference (Identifies the patient or group whose intended care is described by the plan.)
2334     */
2335    protected Resource subjectTarget;
2336
2337    /**
2338     * Identifies the original context in which this particular CarePlan was created.
2339     */
2340    @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=11, min=0, max=1, modifier=false, summary=true)
2341    @Description(shortDefinition="Created in context of", formalDefinition="Identifies the original context in which this particular CarePlan was created." )
2342    protected Reference context;
2343
2344    /**
2345     * The actual object that is the target of the reference (Identifies the original context in which this particular CarePlan was created.)
2346     */
2347    protected Resource contextTarget;
2348
2349    /**
2350     * Indicates when the plan did (or is intended to) come into effect and end.
2351     */
2352    @Child(name = "period", type = {Period.class}, order=12, min=0, max=1, modifier=false, summary=true)
2353    @Description(shortDefinition="Time period plan covers", formalDefinition="Indicates when the plan did (or is intended to) come into effect and end." )
2354    protected Period period;
2355
2356    /**
2357     * Identifies the individual(s) or ogranization who is responsible for the content of the care plan.
2358     */
2359    @Child(name = "author", type = {Patient.class, Practitioner.class, RelatedPerson.class, Organization.class, CareTeam.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2360    @Description(shortDefinition="Who is responsible for contents of the plan", formalDefinition="Identifies the individual(s) or ogranization who is responsible for the content of the care plan." )
2361    protected List<Reference> author;
2362    /**
2363     * The actual objects that are the target of the reference (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.)
2364     */
2365    protected List<Resource> authorTarget;
2366
2367
2368    /**
2369     * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.
2370     */
2371    @Child(name = "careTeam", type = {CareTeam.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2372    @Description(shortDefinition="Who's involved in plan?", formalDefinition="Identifies all people and organizations who are expected to be involved in the care envisioned by this plan." )
2373    protected List<Reference> careTeam;
2374    /**
2375     * The actual objects that are the target of the reference (Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.)
2376     */
2377    protected List<CareTeam> careTeamTarget;
2378
2379
2380    /**
2381     * Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.
2382     */
2383    @Child(name = "addresses", type = {Condition.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2384    @Description(shortDefinition="Health issues this plan addresses", formalDefinition="Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan." )
2385    protected List<Reference> addresses;
2386    /**
2387     * The actual objects that are the target of the reference (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.)
2388     */
2389    protected List<Condition> addressesTarget;
2390
2391
2392    /**
2393     * Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include co-morbidities, recent procedures, limitations, recent assessments, etc.
2394     */
2395    @Child(name = "supportingInfo", type = {Reference.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2396    @Description(shortDefinition="Information considered as part of plan", formalDefinition="Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include co-morbidities, recent procedures, limitations, recent assessments, etc." )
2397    protected List<Reference> supportingInfo;
2398    /**
2399     * The actual objects that are the target of the reference (Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include co-morbidities, recent procedures, limitations, recent assessments, etc.)
2400     */
2401    protected List<Resource> supportingInfoTarget;
2402
2403
2404    /**
2405     * Describes the intended objective(s) of carrying out the care plan.
2406     */
2407    @Child(name = "goal", type = {Goal.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2408    @Description(shortDefinition="Desired outcome of plan", formalDefinition="Describes the intended objective(s) of carrying out the care plan." )
2409    protected List<Reference> goal;
2410    /**
2411     * The actual objects that are the target of the reference (Describes the intended objective(s) of carrying out the care plan.)
2412     */
2413    protected List<Goal> goalTarget;
2414
2415
2416    /**
2417     * Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.
2418     */
2419    @Child(name = "activity", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2420    @Description(shortDefinition="Action to occur as part of plan", formalDefinition="Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc." )
2421    protected List<CarePlanActivityComponent> activity;
2422
2423    /**
2424     * General notes about the care plan not covered elsewhere.
2425     */
2426    @Child(name = "note", type = {Annotation.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2427    @Description(shortDefinition="Comments about the plan", formalDefinition="General notes about the care plan not covered elsewhere." )
2428    protected List<Annotation> note;
2429
2430    private static final long serialVersionUID = 995943625L;
2431
2432  /**
2433   * Constructor
2434   */
2435    public CarePlan() {
2436      super();
2437    }
2438
2439  /**
2440   * Constructor
2441   */
2442    public CarePlan(Enumeration<CarePlanStatus> status, Enumeration<CarePlanIntent> intent, Reference subject) {
2443      super();
2444      this.status = status;
2445      this.intent = intent;
2446      this.subject = subject;
2447    }
2448
2449    /**
2450     * @return {@link #identifier} (This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).)
2451     */
2452    public List<Identifier> getIdentifier() { 
2453      if (this.identifier == null)
2454        this.identifier = new ArrayList<Identifier>();
2455      return this.identifier;
2456    }
2457
2458    /**
2459     * @return Returns a reference to <code>this</code> for easy method chaining
2460     */
2461    public CarePlan setIdentifier(List<Identifier> theIdentifier) { 
2462      this.identifier = theIdentifier;
2463      return this;
2464    }
2465
2466    public boolean hasIdentifier() { 
2467      if (this.identifier == null)
2468        return false;
2469      for (Identifier item : this.identifier)
2470        if (!item.isEmpty())
2471          return true;
2472      return false;
2473    }
2474
2475    public Identifier addIdentifier() { //3
2476      Identifier t = new Identifier();
2477      if (this.identifier == null)
2478        this.identifier = new ArrayList<Identifier>();
2479      this.identifier.add(t);
2480      return t;
2481    }
2482
2483    public CarePlan addIdentifier(Identifier t) { //3
2484      if (t == null)
2485        return this;
2486      if (this.identifier == null)
2487        this.identifier = new ArrayList<Identifier>();
2488      this.identifier.add(t);
2489      return this;
2490    }
2491
2492    /**
2493     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
2494     */
2495    public Identifier getIdentifierFirstRep() { 
2496      if (getIdentifier().isEmpty()) {
2497        addIdentifier();
2498      }
2499      return getIdentifier().get(0);
2500    }
2501
2502    /**
2503     * @return {@link #definition} (Identifies the protocol, questionnaire, guideline or other specification the care plan should be conducted in accordance with.)
2504     */
2505    public List<Reference> getDefinition() { 
2506      if (this.definition == null)
2507        this.definition = new ArrayList<Reference>();
2508      return this.definition;
2509    }
2510
2511    /**
2512     * @return Returns a reference to <code>this</code> for easy method chaining
2513     */
2514    public CarePlan setDefinition(List<Reference> theDefinition) { 
2515      this.definition = theDefinition;
2516      return this;
2517    }
2518
2519    public boolean hasDefinition() { 
2520      if (this.definition == null)
2521        return false;
2522      for (Reference item : this.definition)
2523        if (!item.isEmpty())
2524          return true;
2525      return false;
2526    }
2527
2528    public Reference addDefinition() { //3
2529      Reference t = new Reference();
2530      if (this.definition == null)
2531        this.definition = new ArrayList<Reference>();
2532      this.definition.add(t);
2533      return t;
2534    }
2535
2536    public CarePlan addDefinition(Reference t) { //3
2537      if (t == null)
2538        return this;
2539      if (this.definition == null)
2540        this.definition = new ArrayList<Reference>();
2541      this.definition.add(t);
2542      return this;
2543    }
2544
2545    /**
2546     * @return The first repetition of repeating field {@link #definition}, creating it if it does not already exist
2547     */
2548    public Reference getDefinitionFirstRep() { 
2549      if (getDefinition().isEmpty()) {
2550        addDefinition();
2551      }
2552      return getDefinition().get(0);
2553    }
2554
2555    /**
2556     * @return {@link #basedOn} (A care plan that is fulfilled in whole or in part by this care plan.)
2557     */
2558    public List<Reference> getBasedOn() { 
2559      if (this.basedOn == null)
2560        this.basedOn = new ArrayList<Reference>();
2561      return this.basedOn;
2562    }
2563
2564    /**
2565     * @return Returns a reference to <code>this</code> for easy method chaining
2566     */
2567    public CarePlan setBasedOn(List<Reference> theBasedOn) { 
2568      this.basedOn = theBasedOn;
2569      return this;
2570    }
2571
2572    public boolean hasBasedOn() { 
2573      if (this.basedOn == null)
2574        return false;
2575      for (Reference item : this.basedOn)
2576        if (!item.isEmpty())
2577          return true;
2578      return false;
2579    }
2580
2581    public Reference addBasedOn() { //3
2582      Reference t = new Reference();
2583      if (this.basedOn == null)
2584        this.basedOn = new ArrayList<Reference>();
2585      this.basedOn.add(t);
2586      return t;
2587    }
2588
2589    public CarePlan addBasedOn(Reference t) { //3
2590      if (t == null)
2591        return this;
2592      if (this.basedOn == null)
2593        this.basedOn = new ArrayList<Reference>();
2594      this.basedOn.add(t);
2595      return this;
2596    }
2597
2598    /**
2599     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist
2600     */
2601    public Reference getBasedOnFirstRep() { 
2602      if (getBasedOn().isEmpty()) {
2603        addBasedOn();
2604      }
2605      return getBasedOn().get(0);
2606    }
2607
2608    /**
2609     * @return {@link #replaces} (Completed or terminated care plan whose function is taken by this new care plan.)
2610     */
2611    public List<Reference> getReplaces() { 
2612      if (this.replaces == null)
2613        this.replaces = new ArrayList<Reference>();
2614      return this.replaces;
2615    }
2616
2617    /**
2618     * @return Returns a reference to <code>this</code> for easy method chaining
2619     */
2620    public CarePlan setReplaces(List<Reference> theReplaces) { 
2621      this.replaces = theReplaces;
2622      return this;
2623    }
2624
2625    public boolean hasReplaces() { 
2626      if (this.replaces == null)
2627        return false;
2628      for (Reference item : this.replaces)
2629        if (!item.isEmpty())
2630          return true;
2631      return false;
2632    }
2633
2634    public Reference addReplaces() { //3
2635      Reference t = new Reference();
2636      if (this.replaces == null)
2637        this.replaces = new ArrayList<Reference>();
2638      this.replaces.add(t);
2639      return t;
2640    }
2641
2642    public CarePlan addReplaces(Reference t) { //3
2643      if (t == null)
2644        return this;
2645      if (this.replaces == null)
2646        this.replaces = new ArrayList<Reference>();
2647      this.replaces.add(t);
2648      return this;
2649    }
2650
2651    /**
2652     * @return The first repetition of repeating field {@link #replaces}, creating it if it does not already exist
2653     */
2654    public Reference getReplacesFirstRep() { 
2655      if (getReplaces().isEmpty()) {
2656        addReplaces();
2657      }
2658      return getReplaces().get(0);
2659    }
2660
2661    /**
2662     * @return {@link #partOf} (A larger care plan of which this particular care plan is a component or step.)
2663     */
2664    public List<Reference> getPartOf() { 
2665      if (this.partOf == null)
2666        this.partOf = new ArrayList<Reference>();
2667      return this.partOf;
2668    }
2669
2670    /**
2671     * @return Returns a reference to <code>this</code> for easy method chaining
2672     */
2673    public CarePlan setPartOf(List<Reference> thePartOf) { 
2674      this.partOf = thePartOf;
2675      return this;
2676    }
2677
2678    public boolean hasPartOf() { 
2679      if (this.partOf == null)
2680        return false;
2681      for (Reference item : this.partOf)
2682        if (!item.isEmpty())
2683          return true;
2684      return false;
2685    }
2686
2687    public Reference addPartOf() { //3
2688      Reference t = new Reference();
2689      if (this.partOf == null)
2690        this.partOf = new ArrayList<Reference>();
2691      this.partOf.add(t);
2692      return t;
2693    }
2694
2695    public CarePlan addPartOf(Reference t) { //3
2696      if (t == null)
2697        return this;
2698      if (this.partOf == null)
2699        this.partOf = new ArrayList<Reference>();
2700      this.partOf.add(t);
2701      return this;
2702    }
2703
2704    /**
2705     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist
2706     */
2707    public Reference getPartOfFirstRep() { 
2708      if (getPartOf().isEmpty()) {
2709        addPartOf();
2710      }
2711      return getPartOf().get(0);
2712    }
2713
2714
2715
2716    /**
2717     * @return {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2718     */
2719    public Enumeration<CarePlanStatus> getStatusElement() { 
2720      if (this.status == null)
2721        if (Configuration.errorOnAutoCreate())
2722          throw new Error("Attempt to auto-create CarePlan.status");
2723        else if (Configuration.doAutoCreate())
2724          this.status = new Enumeration<CarePlanStatus>(new CarePlanStatusEnumFactory()); // bb
2725      return this.status;
2726    }
2727
2728    public boolean hasStatusElement() { 
2729      return this.status != null && !this.status.isEmpty();
2730    }
2731
2732    public boolean hasStatus() { 
2733      return this.status != null && !this.status.isEmpty();
2734    }
2735
2736    /**
2737     * @param value {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2738     */
2739    public CarePlan setStatusElement(Enumeration<CarePlanStatus> value) { 
2740      this.status = value;
2741      return this;
2742    }
2743
2744    /**
2745     * @return Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.
2746     */
2747    public CarePlanStatus getStatus() { 
2748      return this.status == null ? null : this.status.getValue();
2749    }
2750
2751    /**
2752     * @param value Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.
2753     */
2754    public CarePlan setStatus(CarePlanStatus value) { 
2755        if (this.status == null)
2756          this.status = new Enumeration<CarePlanStatus>(new CarePlanStatusEnumFactory());
2757        this.status.setValue(value);
2758      return this;
2759    }
2760
2761    /**
2762     * @return {@link #intent} (Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value
2763     */
2764    public Enumeration<CarePlanIntent> getIntentElement() { 
2765      if (this.intent == null)
2766        if (Configuration.errorOnAutoCreate())
2767          throw new Error("Attempt to auto-create CarePlan.intent");
2768        else if (Configuration.doAutoCreate())
2769          this.intent = new Enumeration<CarePlanIntent>(new CarePlanIntentEnumFactory()); // bb
2770      return this.intent;
2771    }
2772
2773    public boolean hasIntentElement() { 
2774      return this.intent != null && !this.intent.isEmpty();
2775    }
2776
2777    public boolean hasIntent() { 
2778      return this.intent != null && !this.intent.isEmpty();
2779    }
2780
2781    /**
2782     * @param value {@link #intent} (Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain.). This is the underlying object with id, value and extensions. The accessor "getIntent" gives direct access to the value
2783     */
2784    public CarePlan setIntentElement(Enumeration<CarePlanIntent> value) { 
2785      this.intent = value;
2786      return this;
2787    }
2788
2789    /**
2790     * @return Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain.
2791     */
2792    public CarePlanIntent getIntent() { 
2793      return this.intent == null ? null : this.intent.getValue();
2794    }
2795
2796    /**
2797     * @param value Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain.
2798     */
2799    public CarePlan setIntent(CarePlanIntent value) { 
2800        if (this.intent == null)
2801          this.intent = new Enumeration<CarePlanIntent>(new CarePlanIntentEnumFactory());
2802        this.intent.setValue(value);
2803      return this;
2804    }
2805
2806    /**
2807     * @return {@link #category} (Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans; e.g. "Home health", "psychiatric", "asthma", "disease management", "wellness plan", etc.)
2808     */
2809    public List<CodeableConcept> getCategory() { 
2810      if (this.category == null)
2811        this.category = new ArrayList<CodeableConcept>();
2812      return this.category;
2813    }
2814
2815    /**
2816     * @return Returns a reference to <code>this</code> for easy method chaining
2817     */
2818    public CarePlan setCategory(List<CodeableConcept> theCategory) { 
2819      this.category = theCategory;
2820      return this;
2821    }
2822
2823    public boolean hasCategory() { 
2824      if (this.category == null)
2825        return false;
2826      for (CodeableConcept item : this.category)
2827        if (!item.isEmpty())
2828          return true;
2829      return false;
2830    }
2831
2832    public CodeableConcept addCategory() { //3
2833      CodeableConcept t = new CodeableConcept();
2834      if (this.category == null)
2835        this.category = new ArrayList<CodeableConcept>();
2836      this.category.add(t);
2837      return t;
2838    }
2839
2840    public CarePlan addCategory(CodeableConcept t) { //3
2841      if (t == null)
2842        return this;
2843      if (this.category == null)
2844        this.category = new ArrayList<CodeableConcept>();
2845      this.category.add(t);
2846      return this;
2847    }
2848
2849    /**
2850     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist
2851     */
2852    public CodeableConcept getCategoryFirstRep() { 
2853      if (getCategory().isEmpty()) {
2854        addCategory();
2855      }
2856      return getCategory().get(0);
2857    }
2858
2859    /**
2860     * @return {@link #title} (Human-friendly name for the CarePlan.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2861     */
2862    public StringType getTitleElement() { 
2863      if (this.title == null)
2864        if (Configuration.errorOnAutoCreate())
2865          throw new Error("Attempt to auto-create CarePlan.title");
2866        else if (Configuration.doAutoCreate())
2867          this.title = new StringType(); // bb
2868      return this.title;
2869    }
2870
2871    public boolean hasTitleElement() { 
2872      return this.title != null && !this.title.isEmpty();
2873    }
2874
2875    public boolean hasTitle() { 
2876      return this.title != null && !this.title.isEmpty();
2877    }
2878
2879    /**
2880     * @param value {@link #title} (Human-friendly name for the CarePlan.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
2881     */
2882    public CarePlan setTitleElement(StringType value) { 
2883      this.title = value;
2884      return this;
2885    }
2886
2887    /**
2888     * @return Human-friendly name for the CarePlan.
2889     */
2890    public String getTitle() { 
2891      return this.title == null ? null : this.title.getValue();
2892    }
2893
2894    /**
2895     * @param value Human-friendly name for the CarePlan.
2896     */
2897    public CarePlan setTitle(String value) { 
2898      if (Utilities.noString(value))
2899        this.title = null;
2900      else {
2901        if (this.title == null)
2902          this.title = new StringType();
2903        this.title.setValue(value);
2904      }
2905      return this;
2906    }
2907
2908    /**
2909     * @return {@link #description} (A description of the scope and nature of the plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2910     */
2911    public StringType getDescriptionElement() { 
2912      if (this.description == null)
2913        if (Configuration.errorOnAutoCreate())
2914          throw new Error("Attempt to auto-create CarePlan.description");
2915        else if (Configuration.doAutoCreate())
2916          this.description = new StringType(); // bb
2917      return this.description;
2918    }
2919
2920    public boolean hasDescriptionElement() { 
2921      return this.description != null && !this.description.isEmpty();
2922    }
2923
2924    public boolean hasDescription() { 
2925      return this.description != null && !this.description.isEmpty();
2926    }
2927
2928    /**
2929     * @param value {@link #description} (A description of the scope and nature of the plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2930     */
2931    public CarePlan setDescriptionElement(StringType value) { 
2932      this.description = value;
2933      return this;
2934    }
2935
2936    /**
2937     * @return A description of the scope and nature of the plan.
2938     */
2939    public String getDescription() { 
2940      return this.description == null ? null : this.description.getValue();
2941    }
2942
2943    /**
2944     * @param value A description of the scope and nature of the plan.
2945     */
2946    public CarePlan setDescription(String value) { 
2947      if (Utilities.noString(value))
2948        this.description = null;
2949      else {
2950        if (this.description == null)
2951          this.description = new StringType();
2952        this.description.setValue(value);
2953      }
2954      return this;
2955    }
2956
2957    /**
2958     * @return {@link #subject} (Identifies the patient or group whose intended care is described by the plan.)
2959     */
2960    public Reference getSubject() { 
2961      if (this.subject == null)
2962        if (Configuration.errorOnAutoCreate())
2963          throw new Error("Attempt to auto-create CarePlan.subject");
2964        else if (Configuration.doAutoCreate())
2965          this.subject = new Reference(); // cc
2966      return this.subject;
2967    }
2968
2969    public boolean hasSubject() { 
2970      return this.subject != null && !this.subject.isEmpty();
2971    }
2972
2973    /**
2974     * @param value {@link #subject} (Identifies the patient or group whose intended care is described by the plan.)
2975     */
2976    public CarePlan setSubject(Reference value)  { 
2977      this.subject = value;
2978      return this;
2979    }
2980
2981    /**
2982     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient or group whose intended care is described by the plan.)
2983     */
2984    public Resource getSubjectTarget() { 
2985      return this.subjectTarget;
2986    }
2987
2988    /**
2989     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient or group whose intended care is described by the plan.)
2990     */
2991    public CarePlan setSubjectTarget(Resource value) { 
2992      this.subjectTarget = value;
2993      return this;
2994    }
2995
2996    /**
2997     * @return {@link #context} (Identifies the original context in which this particular CarePlan was created.)
2998     */
2999    public Reference getContext() { 
3000      if (this.context == null)
3001        if (Configuration.errorOnAutoCreate())
3002          throw new Error("Attempt to auto-create CarePlan.context");
3003        else if (Configuration.doAutoCreate())
3004          this.context = new Reference(); // cc
3005      return this.context;
3006    }
3007
3008    public boolean hasContext() { 
3009      return this.context != null && !this.context.isEmpty();
3010    }
3011
3012    /**
3013     * @param value {@link #context} (Identifies the original context in which this particular CarePlan was created.)
3014     */
3015    public CarePlan setContext(Reference value)  { 
3016      this.context = value;
3017      return this;
3018    }
3019
3020    /**
3021     * @return {@link #context} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the original context in which this particular CarePlan was created.)
3022     */
3023    public Resource getContextTarget() { 
3024      return this.contextTarget;
3025    }
3026
3027    /**
3028     * @param value {@link #context} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the original context in which this particular CarePlan was created.)
3029     */
3030    public CarePlan setContextTarget(Resource value) { 
3031      this.contextTarget = value;
3032      return this;
3033    }
3034
3035    /**
3036     * @return {@link #period} (Indicates when the plan did (or is intended to) come into effect and end.)
3037     */
3038    public Period getPeriod() { 
3039      if (this.period == null)
3040        if (Configuration.errorOnAutoCreate())
3041          throw new Error("Attempt to auto-create CarePlan.period");
3042        else if (Configuration.doAutoCreate())
3043          this.period = new Period(); // cc
3044      return this.period;
3045    }
3046
3047    public boolean hasPeriod() { 
3048      return this.period != null && !this.period.isEmpty();
3049    }
3050
3051    /**
3052     * @param value {@link #period} (Indicates when the plan did (or is intended to) come into effect and end.)
3053     */
3054    public CarePlan setPeriod(Period value)  { 
3055      this.period = value;
3056      return this;
3057    }
3058
3059    /**
3060     * @return {@link #author} (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.)
3061     */
3062    public List<Reference> getAuthor() { 
3063      if (this.author == null)
3064        this.author = new ArrayList<Reference>();
3065      return this.author;
3066    }
3067
3068    /**
3069     * @return Returns a reference to <code>this</code> for easy method chaining
3070     */
3071    public CarePlan setAuthor(List<Reference> theAuthor) { 
3072      this.author = theAuthor;
3073      return this;
3074    }
3075
3076    public boolean hasAuthor() { 
3077      if (this.author == null)
3078        return false;
3079      for (Reference item : this.author)
3080        if (!item.isEmpty())
3081          return true;
3082      return false;
3083    }
3084
3085    public Reference addAuthor() { //3
3086      Reference t = new Reference();
3087      if (this.author == null)
3088        this.author = new ArrayList<Reference>();
3089      this.author.add(t);
3090      return t;
3091    }
3092
3093    public CarePlan addAuthor(Reference t) { //3
3094      if (t == null)
3095        return this;
3096      if (this.author == null)
3097        this.author = new ArrayList<Reference>();
3098      this.author.add(t);
3099      return this;
3100    }
3101
3102    /**
3103     * @return The first repetition of repeating field {@link #author}, creating it if it does not already exist
3104     */
3105    public Reference getAuthorFirstRep() { 
3106      if (getAuthor().isEmpty()) {
3107        addAuthor();
3108      }
3109      return getAuthor().get(0);
3110    }
3111
3112    /**
3113     * @return {@link #careTeam} (Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.)
3114     */
3115    public List<Reference> getCareTeam() { 
3116      if (this.careTeam == null)
3117        this.careTeam = new ArrayList<Reference>();
3118      return this.careTeam;
3119    }
3120
3121    /**
3122     * @return Returns a reference to <code>this</code> for easy method chaining
3123     */
3124    public CarePlan setCareTeam(List<Reference> theCareTeam) { 
3125      this.careTeam = theCareTeam;
3126      return this;
3127    }
3128
3129    public boolean hasCareTeam() { 
3130      if (this.careTeam == null)
3131        return false;
3132      for (Reference item : this.careTeam)
3133        if (!item.isEmpty())
3134          return true;
3135      return false;
3136    }
3137
3138    public Reference addCareTeam() { //3
3139      Reference t = new Reference();
3140      if (this.careTeam == null)
3141        this.careTeam = new ArrayList<Reference>();
3142      this.careTeam.add(t);
3143      return t;
3144    }
3145
3146    public CarePlan addCareTeam(Reference t) { //3
3147      if (t == null)
3148        return this;
3149      if (this.careTeam == null)
3150        this.careTeam = new ArrayList<Reference>();
3151      this.careTeam.add(t);
3152      return this;
3153    }
3154
3155    /**
3156     * @return The first repetition of repeating field {@link #careTeam}, creating it if it does not already exist
3157     */
3158    public Reference getCareTeamFirstRep() { 
3159      if (getCareTeam().isEmpty()) {
3160        addCareTeam();
3161      }
3162      return getCareTeam().get(0);
3163    }
3164
3165    /**
3166     * @return {@link #addresses} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.)
3167     */
3168    public List<Reference> getAddresses() { 
3169      if (this.addresses == null)
3170        this.addresses = new ArrayList<Reference>();
3171      return this.addresses;
3172    }
3173
3174    /**
3175     * @return Returns a reference to <code>this</code> for easy method chaining
3176     */
3177    public CarePlan setAddresses(List<Reference> theAddresses) { 
3178      this.addresses = theAddresses;
3179      return this;
3180    }
3181
3182    public boolean hasAddresses() { 
3183      if (this.addresses == null)
3184        return false;
3185      for (Reference item : this.addresses)
3186        if (!item.isEmpty())
3187          return true;
3188      return false;
3189    }
3190
3191    public Reference addAddresses() { //3
3192      Reference t = new Reference();
3193      if (this.addresses == null)
3194        this.addresses = new ArrayList<Reference>();
3195      this.addresses.add(t);
3196      return t;
3197    }
3198
3199    public CarePlan addAddresses(Reference t) { //3
3200      if (t == null)
3201        return this;
3202      if (this.addresses == null)
3203        this.addresses = new ArrayList<Reference>();
3204      this.addresses.add(t);
3205      return this;
3206    }
3207
3208    /**
3209     * @return The first repetition of repeating field {@link #addresses}, creating it if it does not already exist
3210     */
3211    public Reference getAddressesFirstRep() { 
3212      if (getAddresses().isEmpty()) {
3213        addAddresses();
3214      }
3215      return getAddresses().get(0);
3216    }
3217
3218    /**
3219     * @return {@link #supportingInfo} (Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include co-morbidities, recent procedures, limitations, recent assessments, etc.)
3220     */
3221    public List<Reference> getSupportingInfo() { 
3222      if (this.supportingInfo == null)
3223        this.supportingInfo = new ArrayList<Reference>();
3224      return this.supportingInfo;
3225    }
3226
3227    /**
3228     * @return Returns a reference to <code>this</code> for easy method chaining
3229     */
3230    public CarePlan setSupportingInfo(List<Reference> theSupportingInfo) { 
3231      this.supportingInfo = theSupportingInfo;
3232      return this;
3233    }
3234
3235    public boolean hasSupportingInfo() { 
3236      if (this.supportingInfo == null)
3237        return false;
3238      for (Reference item : this.supportingInfo)
3239        if (!item.isEmpty())
3240          return true;
3241      return false;
3242    }
3243
3244    public Reference addSupportingInfo() { //3
3245      Reference t = new Reference();
3246      if (this.supportingInfo == null)
3247        this.supportingInfo = new ArrayList<Reference>();
3248      this.supportingInfo.add(t);
3249      return t;
3250    }
3251
3252    public CarePlan addSupportingInfo(Reference t) { //3
3253      if (t == null)
3254        return this;
3255      if (this.supportingInfo == null)
3256        this.supportingInfo = new ArrayList<Reference>();
3257      this.supportingInfo.add(t);
3258      return this;
3259    }
3260
3261    /**
3262     * @return The first repetition of repeating field {@link #supportingInfo}, creating it if it does not already exist
3263     */
3264    public Reference getSupportingInfoFirstRep() { 
3265      if (getSupportingInfo().isEmpty()) {
3266        addSupportingInfo();
3267      }
3268      return getSupportingInfo().get(0);
3269    }
3270
3271    /**
3272     * @return {@link #goal} (Describes the intended objective(s) of carrying out the care plan.)
3273     */
3274    public List<Reference> getGoal() { 
3275      if (this.goal == null)
3276        this.goal = new ArrayList<Reference>();
3277      return this.goal;
3278    }
3279
3280    /**
3281     * @return Returns a reference to <code>this</code> for easy method chaining
3282     */
3283    public CarePlan setGoal(List<Reference> theGoal) { 
3284      this.goal = theGoal;
3285      return this;
3286    }
3287
3288    public boolean hasGoal() { 
3289      if (this.goal == null)
3290        return false;
3291      for (Reference item : this.goal)
3292        if (!item.isEmpty())
3293          return true;
3294      return false;
3295    }
3296
3297    public Reference addGoal() { //3
3298      Reference t = new Reference();
3299      if (this.goal == null)
3300        this.goal = new ArrayList<Reference>();
3301      this.goal.add(t);
3302      return t;
3303    }
3304
3305    public CarePlan addGoal(Reference t) { //3
3306      if (t == null)
3307        return this;
3308      if (this.goal == null)
3309        this.goal = new ArrayList<Reference>();
3310      this.goal.add(t);
3311      return this;
3312    }
3313
3314    /**
3315     * @return The first repetition of repeating field {@link #goal}, creating it if it does not already exist
3316     */
3317    public Reference getGoalFirstRep() { 
3318      if (getGoal().isEmpty()) {
3319        addGoal();
3320      }
3321      return getGoal().get(0);
3322    }
3323
3324    /**
3325     * @return {@link #activity} (Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.)
3326     */
3327    public List<CarePlanActivityComponent> getActivity() { 
3328      if (this.activity == null)
3329        this.activity = new ArrayList<CarePlanActivityComponent>();
3330      return this.activity;
3331    }
3332
3333    /**
3334     * @return Returns a reference to <code>this</code> for easy method chaining
3335     */
3336    public CarePlan setActivity(List<CarePlanActivityComponent> theActivity) { 
3337      this.activity = theActivity;
3338      return this;
3339    }
3340
3341    public boolean hasActivity() { 
3342      if (this.activity == null)
3343        return false;
3344      for (CarePlanActivityComponent item : this.activity)
3345        if (!item.isEmpty())
3346          return true;
3347      return false;
3348    }
3349
3350    public CarePlanActivityComponent addActivity() { //3
3351      CarePlanActivityComponent t = new CarePlanActivityComponent();
3352      if (this.activity == null)
3353        this.activity = new ArrayList<CarePlanActivityComponent>();
3354      this.activity.add(t);
3355      return t;
3356    }
3357
3358    public CarePlan addActivity(CarePlanActivityComponent t) { //3
3359      if (t == null)
3360        return this;
3361      if (this.activity == null)
3362        this.activity = new ArrayList<CarePlanActivityComponent>();
3363      this.activity.add(t);
3364      return this;
3365    }
3366
3367    /**
3368     * @return The first repetition of repeating field {@link #activity}, creating it if it does not already exist
3369     */
3370    public CarePlanActivityComponent getActivityFirstRep() { 
3371      if (getActivity().isEmpty()) {
3372        addActivity();
3373      }
3374      return getActivity().get(0);
3375    }
3376
3377    /**
3378     * @return {@link #note} (General notes about the care plan not covered elsewhere.)
3379     */
3380    public List<Annotation> getNote() { 
3381      if (this.note == null)
3382        this.note = new ArrayList<Annotation>();
3383      return this.note;
3384    }
3385
3386    /**
3387     * @return Returns a reference to <code>this</code> for easy method chaining
3388     */
3389    public CarePlan setNote(List<Annotation> theNote) { 
3390      this.note = theNote;
3391      return this;
3392    }
3393
3394    public boolean hasNote() { 
3395      if (this.note == null)
3396        return false;
3397      for (Annotation item : this.note)
3398        if (!item.isEmpty())
3399          return true;
3400      return false;
3401    }
3402
3403    public Annotation addNote() { //3
3404      Annotation t = new Annotation();
3405      if (this.note == null)
3406        this.note = new ArrayList<Annotation>();
3407      this.note.add(t);
3408      return t;
3409    }
3410
3411    public CarePlan addNote(Annotation t) { //3
3412      if (t == null)
3413        return this;
3414      if (this.note == null)
3415        this.note = new ArrayList<Annotation>();
3416      this.note.add(t);
3417      return this;
3418    }
3419
3420    /**
3421     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
3422     */
3423    public Annotation getNoteFirstRep() { 
3424      if (getNote().isEmpty()) {
3425        addNote();
3426      }
3427      return getNote().get(0);
3428    }
3429
3430      protected void listChildren(List<Property> children) {
3431        super.listChildren(children);
3432        children.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier));
3433        children.add(new Property("definition", "Reference(PlanDefinition|Questionnaire)", "Identifies the protocol, questionnaire, guideline or other specification the care plan should be conducted in accordance with.", 0, java.lang.Integer.MAX_VALUE, definition));
3434        children.add(new Property("basedOn", "Reference(CarePlan)", "A care plan that is fulfilled in whole or in part by this care plan.", 0, java.lang.Integer.MAX_VALUE, basedOn));
3435        children.add(new Property("replaces", "Reference(CarePlan)", "Completed or terminated care plan whose function is taken by this new care plan.", 0, java.lang.Integer.MAX_VALUE, replaces));
3436        children.add(new Property("partOf", "Reference(CarePlan)", "A larger care plan of which this particular care plan is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf));
3437        children.add(new Property("status", "code", "Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.", 0, 1, status));
3438        children.add(new Property("intent", "code", "Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain.", 0, 1, intent));
3439        children.add(new Property("category", "CodeableConcept", "Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc.", 0, java.lang.Integer.MAX_VALUE, category));
3440        children.add(new Property("title", "string", "Human-friendly name for the CarePlan.", 0, 1, title));
3441        children.add(new Property("description", "string", "A description of the scope and nature of the plan.", 0, 1, description));
3442        children.add(new Property("subject", "Reference(Patient|Group)", "Identifies the patient or group whose intended care is described by the plan.", 0, 1, subject));
3443        children.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "Identifies the original context in which this particular CarePlan was created.", 0, 1, context));
3444        children.add(new Property("period", "Period", "Indicates when the plan did (or is intended to) come into effect and end.", 0, 1, period));
3445        children.add(new Property("author", "Reference(Patient|Practitioner|RelatedPerson|Organization|CareTeam)", "Identifies the individual(s) or ogranization who is responsible for the content of the care plan.", 0, java.lang.Integer.MAX_VALUE, author));
3446        children.add(new Property("careTeam", "Reference(CareTeam)", "Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.", 0, java.lang.Integer.MAX_VALUE, careTeam));
3447        children.add(new Property("addresses", "Reference(Condition)", "Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.", 0, java.lang.Integer.MAX_VALUE, addresses));
3448        children.add(new Property("supportingInfo", "Reference(Any)", "Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include co-morbidities, recent procedures, limitations, recent assessments, etc.", 0, java.lang.Integer.MAX_VALUE, supportingInfo));
3449        children.add(new Property("goal", "Reference(Goal)", "Describes the intended objective(s) of carrying out the care plan.", 0, java.lang.Integer.MAX_VALUE, goal));
3450        children.add(new Property("activity", "", "Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.", 0, java.lang.Integer.MAX_VALUE, activity));
3451        children.add(new Property("note", "Annotation", "General notes about the care plan not covered elsewhere.", 0, java.lang.Integer.MAX_VALUE, note));
3452      }
3453
3454      @Override
3455      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3456        switch (_hash) {
3457        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).", 0, java.lang.Integer.MAX_VALUE, identifier);
3458        case -1014418093: /*definition*/  return new Property("definition", "Reference(PlanDefinition|Questionnaire)", "Identifies the protocol, questionnaire, guideline or other specification the care plan should be conducted in accordance with.", 0, java.lang.Integer.MAX_VALUE, definition);
3459        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(CarePlan)", "A care plan that is fulfilled in whole or in part by this care plan.", 0, java.lang.Integer.MAX_VALUE, basedOn);
3460        case -430332865: /*replaces*/  return new Property("replaces", "Reference(CarePlan)", "Completed or terminated care plan whose function is taken by this new care plan.", 0, java.lang.Integer.MAX_VALUE, replaces);
3461        case -995410646: /*partOf*/  return new Property("partOf", "Reference(CarePlan)", "A larger care plan of which this particular care plan is a component or step.", 0, java.lang.Integer.MAX_VALUE, partOf);
3462        case -892481550: /*status*/  return new Property("status", "code", "Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.", 0, 1, status);
3463        case -1183762788: /*intent*/  return new Property("intent", "code", "Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain.", 0, 1, intent);
3464        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc.", 0, java.lang.Integer.MAX_VALUE, category);
3465        case 110371416: /*title*/  return new Property("title", "string", "Human-friendly name for the CarePlan.", 0, 1, title);
3466        case -1724546052: /*description*/  return new Property("description", "string", "A description of the scope and nature of the plan.", 0, 1, description);
3467        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "Identifies the patient or group whose intended care is described by the plan.", 0, 1, subject);
3468        case 951530927: /*context*/  return new Property("context", "Reference(Encounter|EpisodeOfCare)", "Identifies the original context in which this particular CarePlan was created.", 0, 1, context);
3469        case -991726143: /*period*/  return new Property("period", "Period", "Indicates when the plan did (or is intended to) come into effect and end.", 0, 1, period);
3470        case -1406328437: /*author*/  return new Property("author", "Reference(Patient|Practitioner|RelatedPerson|Organization|CareTeam)", "Identifies the individual(s) or ogranization who is responsible for the content of the care plan.", 0, java.lang.Integer.MAX_VALUE, author);
3471        case -7323378: /*careTeam*/  return new Property("careTeam", "Reference(CareTeam)", "Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.", 0, java.lang.Integer.MAX_VALUE, careTeam);
3472        case 874544034: /*addresses*/  return new Property("addresses", "Reference(Condition)", "Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.", 0, java.lang.Integer.MAX_VALUE, addresses);
3473        case 1922406657: /*supportingInfo*/  return new Property("supportingInfo", "Reference(Any)", "Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include co-morbidities, recent procedures, limitations, recent assessments, etc.", 0, java.lang.Integer.MAX_VALUE, supportingInfo);
3474        case 3178259: /*goal*/  return new Property("goal", "Reference(Goal)", "Describes the intended objective(s) of carrying out the care plan.", 0, java.lang.Integer.MAX_VALUE, goal);
3475        case -1655966961: /*activity*/  return new Property("activity", "", "Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.", 0, java.lang.Integer.MAX_VALUE, activity);
3476        case 3387378: /*note*/  return new Property("note", "Annotation", "General notes about the care plan not covered elsewhere.", 0, java.lang.Integer.MAX_VALUE, note);
3477        default: return super.getNamedProperty(_hash, _name, _checkValid);
3478        }
3479
3480      }
3481
3482      @Override
3483      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3484        switch (hash) {
3485        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3486        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : this.definition.toArray(new Base[this.definition.size()]); // Reference
3487        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
3488        case -430332865: /*replaces*/ return this.replaces == null ? new Base[0] : this.replaces.toArray(new Base[this.replaces.size()]); // Reference
3489        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
3490        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<CarePlanStatus>
3491        case -1183762788: /*intent*/ return this.intent == null ? new Base[0] : new Base[] {this.intent}; // Enumeration<CarePlanIntent>
3492        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
3493        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
3494        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
3495        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
3496        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference
3497        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
3498        case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference
3499        case -7323378: /*careTeam*/ return this.careTeam == null ? new Base[0] : this.careTeam.toArray(new Base[this.careTeam.size()]); // Reference
3500        case 874544034: /*addresses*/ return this.addresses == null ? new Base[0] : this.addresses.toArray(new Base[this.addresses.size()]); // Reference
3501        case 1922406657: /*supportingInfo*/ return this.supportingInfo == null ? new Base[0] : this.supportingInfo.toArray(new Base[this.supportingInfo.size()]); // Reference
3502        case 3178259: /*goal*/ return this.goal == null ? new Base[0] : this.goal.toArray(new Base[this.goal.size()]); // Reference
3503        case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : this.activity.toArray(new Base[this.activity.size()]); // CarePlanActivityComponent
3504        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
3505        default: return super.getProperty(hash, name, checkValid);
3506        }
3507
3508      }
3509
3510      @Override
3511      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3512        switch (hash) {
3513        case -1618432855: // identifier
3514          this.getIdentifier().add(castToIdentifier(value)); // Identifier
3515          return value;
3516        case -1014418093: // definition
3517          this.getDefinition().add(castToReference(value)); // Reference
3518          return value;
3519        case -332612366: // basedOn
3520          this.getBasedOn().add(castToReference(value)); // Reference
3521          return value;
3522        case -430332865: // replaces
3523          this.getReplaces().add(castToReference(value)); // Reference
3524          return value;
3525        case -995410646: // partOf
3526          this.getPartOf().add(castToReference(value)); // Reference
3527          return value;
3528        case -892481550: // status
3529          value = new CarePlanStatusEnumFactory().fromType(castToCode(value));
3530          this.status = (Enumeration) value; // Enumeration<CarePlanStatus>
3531          return value;
3532        case -1183762788: // intent
3533          value = new CarePlanIntentEnumFactory().fromType(castToCode(value));
3534          this.intent = (Enumeration) value; // Enumeration<CarePlanIntent>
3535          return value;
3536        case 50511102: // category
3537          this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept
3538          return value;
3539        case 110371416: // title
3540          this.title = castToString(value); // StringType
3541          return value;
3542        case -1724546052: // description
3543          this.description = castToString(value); // StringType
3544          return value;
3545        case -1867885268: // subject
3546          this.subject = castToReference(value); // Reference
3547          return value;
3548        case 951530927: // context
3549          this.context = castToReference(value); // Reference
3550          return value;
3551        case -991726143: // period
3552          this.period = castToPeriod(value); // Period
3553          return value;
3554        case -1406328437: // author
3555          this.getAuthor().add(castToReference(value)); // Reference
3556          return value;
3557        case -7323378: // careTeam
3558          this.getCareTeam().add(castToReference(value)); // Reference
3559          return value;
3560        case 874544034: // addresses
3561          this.getAddresses().add(castToReference(value)); // Reference
3562          return value;
3563        case 1922406657: // supportingInfo
3564          this.getSupportingInfo().add(castToReference(value)); // Reference
3565          return value;
3566        case 3178259: // goal
3567          this.getGoal().add(castToReference(value)); // Reference
3568          return value;
3569        case -1655966961: // activity
3570          this.getActivity().add((CarePlanActivityComponent) value); // CarePlanActivityComponent
3571          return value;
3572        case 3387378: // note
3573          this.getNote().add(castToAnnotation(value)); // Annotation
3574          return value;
3575        default: return super.setProperty(hash, name, value);
3576        }
3577
3578      }
3579
3580      @Override
3581      public Base setProperty(String name, Base value) throws FHIRException {
3582        if (name.equals("identifier")) {
3583          this.getIdentifier().add(castToIdentifier(value));
3584        } else if (name.equals("definition")) {
3585          this.getDefinition().add(castToReference(value));
3586        } else if (name.equals("basedOn")) {
3587          this.getBasedOn().add(castToReference(value));
3588        } else if (name.equals("replaces")) {
3589          this.getReplaces().add(castToReference(value));
3590        } else if (name.equals("partOf")) {
3591          this.getPartOf().add(castToReference(value));
3592        } else if (name.equals("status")) {
3593          value = new CarePlanStatusEnumFactory().fromType(castToCode(value));
3594          this.status = (Enumeration) value; // Enumeration<CarePlanStatus>
3595        } else if (name.equals("intent")) {
3596          value = new CarePlanIntentEnumFactory().fromType(castToCode(value));
3597          this.intent = (Enumeration) value; // Enumeration<CarePlanIntent>
3598        } else if (name.equals("category")) {
3599          this.getCategory().add(castToCodeableConcept(value));
3600        } else if (name.equals("title")) {
3601          this.title = castToString(value); // StringType
3602        } else if (name.equals("description")) {
3603          this.description = castToString(value); // StringType
3604        } else if (name.equals("subject")) {
3605          this.subject = castToReference(value); // Reference
3606        } else if (name.equals("context")) {
3607          this.context = castToReference(value); // Reference
3608        } else if (name.equals("period")) {
3609          this.period = castToPeriod(value); // Period
3610        } else if (name.equals("author")) {
3611          this.getAuthor().add(castToReference(value));
3612        } else if (name.equals("careTeam")) {
3613          this.getCareTeam().add(castToReference(value));
3614        } else if (name.equals("addresses")) {
3615          this.getAddresses().add(castToReference(value));
3616        } else if (name.equals("supportingInfo")) {
3617          this.getSupportingInfo().add(castToReference(value));
3618        } else if (name.equals("goal")) {
3619          this.getGoal().add(castToReference(value));
3620        } else if (name.equals("activity")) {
3621          this.getActivity().add((CarePlanActivityComponent) value);
3622        } else if (name.equals("note")) {
3623          this.getNote().add(castToAnnotation(value));
3624        } else
3625          return super.setProperty(name, value);
3626        return value;
3627      }
3628
3629      @Override
3630      public Base makeProperty(int hash, String name) throws FHIRException {
3631        switch (hash) {
3632        case -1618432855:  return addIdentifier(); 
3633        case -1014418093:  return addDefinition(); 
3634        case -332612366:  return addBasedOn(); 
3635        case -430332865:  return addReplaces(); 
3636        case -995410646:  return addPartOf(); 
3637        case -892481550:  return getStatusElement();
3638        case -1183762788:  return getIntentElement();
3639        case 50511102:  return addCategory(); 
3640        case 110371416:  return getTitleElement();
3641        case -1724546052:  return getDescriptionElement();
3642        case -1867885268:  return getSubject(); 
3643        case 951530927:  return getContext(); 
3644        case -991726143:  return getPeriod(); 
3645        case -1406328437:  return addAuthor(); 
3646        case -7323378:  return addCareTeam(); 
3647        case 874544034:  return addAddresses(); 
3648        case 1922406657:  return addSupportingInfo(); 
3649        case 3178259:  return addGoal(); 
3650        case -1655966961:  return addActivity(); 
3651        case 3387378:  return addNote(); 
3652        default: return super.makeProperty(hash, name);
3653        }
3654
3655      }
3656
3657      @Override
3658      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3659        switch (hash) {
3660        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3661        case -1014418093: /*definition*/ return new String[] {"Reference"};
3662        case -332612366: /*basedOn*/ return new String[] {"Reference"};
3663        case -430332865: /*replaces*/ return new String[] {"Reference"};
3664        case -995410646: /*partOf*/ return new String[] {"Reference"};
3665        case -892481550: /*status*/ return new String[] {"code"};
3666        case -1183762788: /*intent*/ return new String[] {"code"};
3667        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
3668        case 110371416: /*title*/ return new String[] {"string"};
3669        case -1724546052: /*description*/ return new String[] {"string"};
3670        case -1867885268: /*subject*/ return new String[] {"Reference"};
3671        case 951530927: /*context*/ return new String[] {"Reference"};
3672        case -991726143: /*period*/ return new String[] {"Period"};
3673        case -1406328437: /*author*/ return new String[] {"Reference"};
3674        case -7323378: /*careTeam*/ return new String[] {"Reference"};
3675        case 874544034: /*addresses*/ return new String[] {"Reference"};
3676        case 1922406657: /*supportingInfo*/ return new String[] {"Reference"};
3677        case 3178259: /*goal*/ return new String[] {"Reference"};
3678        case -1655966961: /*activity*/ return new String[] {};
3679        case 3387378: /*note*/ return new String[] {"Annotation"};
3680        default: return super.getTypesForProperty(hash, name);
3681        }
3682
3683      }
3684
3685      @Override
3686      public Base addChild(String name) throws FHIRException {
3687        if (name.equals("identifier")) {
3688          return addIdentifier();
3689        }
3690        else if (name.equals("definition")) {
3691          return addDefinition();
3692        }
3693        else if (name.equals("basedOn")) {
3694          return addBasedOn();
3695        }
3696        else if (name.equals("replaces")) {
3697          return addReplaces();
3698        }
3699        else if (name.equals("partOf")) {
3700          return addPartOf();
3701        }
3702        else if (name.equals("status")) {
3703          throw new FHIRException("Cannot call addChild on a singleton property CarePlan.status");
3704        }
3705        else if (name.equals("intent")) {
3706          throw new FHIRException("Cannot call addChild on a singleton property CarePlan.intent");
3707        }
3708        else if (name.equals("category")) {
3709          return addCategory();
3710        }
3711        else if (name.equals("title")) {
3712          throw new FHIRException("Cannot call addChild on a singleton property CarePlan.title");
3713        }
3714        else if (name.equals("description")) {
3715          throw new FHIRException("Cannot call addChild on a singleton property CarePlan.description");
3716        }
3717        else if (name.equals("subject")) {
3718          this.subject = new Reference();
3719          return this.subject;
3720        }
3721        else if (name.equals("context")) {
3722          this.context = new Reference();
3723          return this.context;
3724        }
3725        else if (name.equals("period")) {
3726          this.period = new Period();
3727          return this.period;
3728        }
3729        else if (name.equals("author")) {
3730          return addAuthor();
3731        }
3732        else if (name.equals("careTeam")) {
3733          return addCareTeam();
3734        }
3735        else if (name.equals("addresses")) {
3736          return addAddresses();
3737        }
3738        else if (name.equals("supportingInfo")) {
3739          return addSupportingInfo();
3740        }
3741        else if (name.equals("goal")) {
3742          return addGoal();
3743        }
3744        else if (name.equals("activity")) {
3745          return addActivity();
3746        }
3747        else if (name.equals("note")) {
3748          return addNote();
3749        }
3750        else
3751          return super.addChild(name);
3752      }
3753
3754  public String fhirType() {
3755    return "CarePlan";
3756
3757  }
3758
3759      public CarePlan copy() {
3760        CarePlan dst = new CarePlan();
3761        copyValues(dst);
3762        if (identifier != null) {
3763          dst.identifier = new ArrayList<Identifier>();
3764          for (Identifier i : identifier)
3765            dst.identifier.add(i.copy());
3766        };
3767        if (definition != null) {
3768          dst.definition = new ArrayList<Reference>();
3769          for (Reference i : definition)
3770            dst.definition.add(i.copy());
3771        };
3772        if (basedOn != null) {
3773          dst.basedOn = new ArrayList<Reference>();
3774          for (Reference i : basedOn)
3775            dst.basedOn.add(i.copy());
3776        };
3777        if (replaces != null) {
3778          dst.replaces = new ArrayList<Reference>();
3779          for (Reference i : replaces)
3780            dst.replaces.add(i.copy());
3781        };
3782        if (partOf != null) {
3783          dst.partOf = new ArrayList<Reference>();
3784          for (Reference i : partOf)
3785            dst.partOf.add(i.copy());
3786        };
3787        dst.status = status == null ? null : status.copy();
3788        dst.intent = intent == null ? null : intent.copy();
3789        if (category != null) {
3790          dst.category = new ArrayList<CodeableConcept>();
3791          for (CodeableConcept i : category)
3792            dst.category.add(i.copy());
3793        };
3794        dst.title = title == null ? null : title.copy();
3795        dst.description = description == null ? null : description.copy();
3796        dst.subject = subject == null ? null : subject.copy();
3797        dst.context = context == null ? null : context.copy();
3798        dst.period = period == null ? null : period.copy();
3799        if (author != null) {
3800          dst.author = new ArrayList<Reference>();
3801          for (Reference i : author)
3802            dst.author.add(i.copy());
3803        };
3804        if (careTeam != null) {
3805          dst.careTeam = new ArrayList<Reference>();
3806          for (Reference i : careTeam)
3807            dst.careTeam.add(i.copy());
3808        };
3809        if (addresses != null) {
3810          dst.addresses = new ArrayList<Reference>();
3811          for (Reference i : addresses)
3812            dst.addresses.add(i.copy());
3813        };
3814        if (supportingInfo != null) {
3815          dst.supportingInfo = new ArrayList<Reference>();
3816          for (Reference i : supportingInfo)
3817            dst.supportingInfo.add(i.copy());
3818        };
3819        if (goal != null) {
3820          dst.goal = new ArrayList<Reference>();
3821          for (Reference i : goal)
3822            dst.goal.add(i.copy());
3823        };
3824        if (activity != null) {
3825          dst.activity = new ArrayList<CarePlanActivityComponent>();
3826          for (CarePlanActivityComponent i : activity)
3827            dst.activity.add(i.copy());
3828        };
3829        if (note != null) {
3830          dst.note = new ArrayList<Annotation>();
3831          for (Annotation i : note)
3832            dst.note.add(i.copy());
3833        };
3834        return dst;
3835      }
3836
3837      protected CarePlan typedCopy() {
3838        return copy();
3839      }
3840
3841      @Override
3842      public boolean equalsDeep(Base other_) {
3843        if (!super.equalsDeep(other_))
3844          return false;
3845        if (!(other_ instanceof CarePlan))
3846          return false;
3847        CarePlan o = (CarePlan) other_;
3848        return compareDeep(identifier, o.identifier, true) && compareDeep(definition, o.definition, true)
3849           && compareDeep(basedOn, o.basedOn, true) && compareDeep(replaces, o.replaces, true) && compareDeep(partOf, o.partOf, true)
3850           && compareDeep(status, o.status, true) && compareDeep(intent, o.intent, true) && compareDeep(category, o.category, true)
3851           && compareDeep(title, o.title, true) && compareDeep(description, o.description, true) && compareDeep(subject, o.subject, true)
3852           && compareDeep(context, o.context, true) && compareDeep(period, o.period, true) && compareDeep(author, o.author, true)
3853           && compareDeep(careTeam, o.careTeam, true) && compareDeep(addresses, o.addresses, true) && compareDeep(supportingInfo, o.supportingInfo, true)
3854           && compareDeep(goal, o.goal, true) && compareDeep(activity, o.activity, true) && compareDeep(note, o.note, true)
3855          ;
3856      }
3857
3858      @Override
3859      public boolean equalsShallow(Base other_) {
3860        if (!super.equalsShallow(other_))
3861          return false;
3862        if (!(other_ instanceof CarePlan))
3863          return false;
3864        CarePlan o = (CarePlan) other_;
3865        return compareValues(status, o.status, true) && compareValues(intent, o.intent, true) && compareValues(title, o.title, true)
3866           && compareValues(description, o.description, true);
3867      }
3868
3869      public boolean isEmpty() {
3870        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, definition, basedOn
3871          , replaces, partOf, status, intent, category, title, description, subject, context
3872          , period, author, careTeam, addresses, supportingInfo, goal, activity, note
3873          );
3874      }
3875
3876  @Override
3877  public ResourceType getResourceType() {
3878    return ResourceType.CarePlan;
3879   }
3880
3881 /**
3882   * Search parameter: <b>date</b>
3883   * <p>
3884   * Description: <b>Time period plan covers</b><br>
3885   * Type: <b>date</b><br>
3886   * Path: <b>CarePlan.period</b><br>
3887   * </p>
3888   */
3889  @SearchParamDefinition(name="date", path="CarePlan.period", description="Time period plan covers", type="date" )
3890  public static final String SP_DATE = "date";
3891 /**
3892   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3893   * <p>
3894   * Description: <b>Time period plan covers</b><br>
3895   * Type: <b>date</b><br>
3896   * Path: <b>CarePlan.period</b><br>
3897   * </p>
3898   */
3899  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
3900
3901 /**
3902   * Search parameter: <b>care-team</b>
3903   * <p>
3904   * Description: <b>Who's involved in plan?</b><br>
3905   * Type: <b>reference</b><br>
3906   * Path: <b>CarePlan.careTeam</b><br>
3907   * </p>
3908   */
3909  @SearchParamDefinition(name="care-team", path="CarePlan.careTeam", description="Who's involved in plan?", type="reference", target={CareTeam.class } )
3910  public static final String SP_CARE_TEAM = "care-team";
3911 /**
3912   * <b>Fluent Client</b> search parameter constant for <b>care-team</b>
3913   * <p>
3914   * Description: <b>Who's involved in plan?</b><br>
3915   * Type: <b>reference</b><br>
3916   * Path: <b>CarePlan.careTeam</b><br>
3917   * </p>
3918   */
3919  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CARE_TEAM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CARE_TEAM);
3920
3921/**
3922   * Constant for fluent queries to be used to add include statements. Specifies
3923   * the path value of "<b>CarePlan:care-team</b>".
3924   */
3925  public static final ca.uhn.fhir.model.api.Include INCLUDE_CARE_TEAM = new ca.uhn.fhir.model.api.Include("CarePlan:care-team").toLocked();
3926
3927 /**
3928   * Search parameter: <b>identifier</b>
3929   * <p>
3930   * Description: <b>External Ids for this plan</b><br>
3931   * Type: <b>token</b><br>
3932   * Path: <b>CarePlan.identifier</b><br>
3933   * </p>
3934   */
3935  @SearchParamDefinition(name="identifier", path="CarePlan.identifier", description="External Ids for this plan", type="token" )
3936  public static final String SP_IDENTIFIER = "identifier";
3937 /**
3938   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3939   * <p>
3940   * Description: <b>External Ids for this plan</b><br>
3941   * Type: <b>token</b><br>
3942   * Path: <b>CarePlan.identifier</b><br>
3943   * </p>
3944   */
3945  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3946
3947 /**
3948   * Search parameter: <b>performer</b>
3949   * <p>
3950   * Description: <b>Matches if the practitioner is listed as a performer in any of the "simple" activities.  (For performers of the detailed activities, chain through the activitydetail search parameter.)</b><br>
3951   * Type: <b>reference</b><br>
3952   * Path: <b>CarePlan.activity.detail.performer</b><br>
3953   * </p>
3954   */
3955  @SearchParamDefinition(name="performer", path="CarePlan.activity.detail.performer", description="Matches if the practitioner is listed as a performer in any of the \"simple\" activities.  (For performers of the detailed activities, chain through the activitydetail search parameter.)", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={CareTeam.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class } )
3956  public static final String SP_PERFORMER = "performer";
3957 /**
3958   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
3959   * <p>
3960   * Description: <b>Matches if the practitioner is listed as a performer in any of the "simple" activities.  (For performers of the detailed activities, chain through the activitydetail search parameter.)</b><br>
3961   * Type: <b>reference</b><br>
3962   * Path: <b>CarePlan.activity.detail.performer</b><br>
3963   * </p>
3964   */
3965  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
3966
3967/**
3968   * Constant for fluent queries to be used to add include statements. Specifies
3969   * the path value of "<b>CarePlan:performer</b>".
3970   */
3971  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("CarePlan:performer").toLocked();
3972
3973 /**
3974   * Search parameter: <b>goal</b>
3975   * <p>
3976   * Description: <b>Desired outcome of plan</b><br>
3977   * Type: <b>reference</b><br>
3978   * Path: <b>CarePlan.goal</b><br>
3979   * </p>
3980   */
3981  @SearchParamDefinition(name="goal", path="CarePlan.goal", description="Desired outcome of plan", type="reference", target={Goal.class } )
3982  public static final String SP_GOAL = "goal";
3983 /**
3984   * <b>Fluent Client</b> search parameter constant for <b>goal</b>
3985   * <p>
3986   * Description: <b>Desired outcome of plan</b><br>
3987   * Type: <b>reference</b><br>
3988   * Path: <b>CarePlan.goal</b><br>
3989   * </p>
3990   */
3991  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam GOAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_GOAL);
3992
3993/**
3994   * Constant for fluent queries to be used to add include statements. Specifies
3995   * the path value of "<b>CarePlan:goal</b>".
3996   */
3997  public static final ca.uhn.fhir.model.api.Include INCLUDE_GOAL = new ca.uhn.fhir.model.api.Include("CarePlan:goal").toLocked();
3998
3999 /**
4000   * Search parameter: <b>subject</b>
4001   * <p>
4002   * Description: <b>Who care plan is for</b><br>
4003   * Type: <b>reference</b><br>
4004   * Path: <b>CarePlan.subject</b><br>
4005   * </p>
4006   */
4007  @SearchParamDefinition(name="subject", path="CarePlan.subject", description="Who care plan is for", type="reference", target={Group.class, Patient.class } )
4008  public static final String SP_SUBJECT = "subject";
4009 /**
4010   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
4011   * <p>
4012   * Description: <b>Who care plan is for</b><br>
4013   * Type: <b>reference</b><br>
4014   * Path: <b>CarePlan.subject</b><br>
4015   * </p>
4016   */
4017  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
4018
4019/**
4020   * Constant for fluent queries to be used to add include statements. Specifies
4021   * the path value of "<b>CarePlan:subject</b>".
4022   */
4023  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("CarePlan:subject").toLocked();
4024
4025 /**
4026   * Search parameter: <b>replaces</b>
4027   * <p>
4028   * Description: <b>CarePlan replaced by this CarePlan</b><br>
4029   * Type: <b>reference</b><br>
4030   * Path: <b>CarePlan.replaces</b><br>
4031   * </p>
4032   */
4033  @SearchParamDefinition(name="replaces", path="CarePlan.replaces", description="CarePlan replaced by this CarePlan", type="reference", target={CarePlan.class } )
4034  public static final String SP_REPLACES = "replaces";
4035 /**
4036   * <b>Fluent Client</b> search parameter constant for <b>replaces</b>
4037   * <p>
4038   * Description: <b>CarePlan replaced by this CarePlan</b><br>
4039   * Type: <b>reference</b><br>
4040   * Path: <b>CarePlan.replaces</b><br>
4041   * </p>
4042   */
4043  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REPLACES = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REPLACES);
4044
4045/**
4046   * Constant for fluent queries to be used to add include statements. Specifies
4047   * the path value of "<b>CarePlan:replaces</b>".
4048   */
4049  public static final ca.uhn.fhir.model.api.Include INCLUDE_REPLACES = new ca.uhn.fhir.model.api.Include("CarePlan:replaces").toLocked();
4050
4051 /**
4052   * Search parameter: <b>part-of</b>
4053   * <p>
4054   * Description: <b>Part of referenced CarePlan</b><br>
4055   * Type: <b>reference</b><br>
4056   * Path: <b>CarePlan.partOf</b><br>
4057   * </p>
4058   */
4059  @SearchParamDefinition(name="part-of", path="CarePlan.partOf", description="Part of referenced CarePlan", type="reference", target={CarePlan.class } )
4060  public static final String SP_PART_OF = "part-of";
4061 /**
4062   * <b>Fluent Client</b> search parameter constant for <b>part-of</b>
4063   * <p>
4064   * Description: <b>Part of referenced CarePlan</b><br>
4065   * Type: <b>reference</b><br>
4066   * Path: <b>CarePlan.partOf</b><br>
4067   * </p>
4068   */
4069  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF);
4070
4071/**
4072   * Constant for fluent queries to be used to add include statements. Specifies
4073   * the path value of "<b>CarePlan:part-of</b>".
4074   */
4075  public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("CarePlan:part-of").toLocked();
4076
4077 /**
4078   * Search parameter: <b>encounter</b>
4079   * <p>
4080   * Description: <b>Created in context of</b><br>
4081   * Type: <b>reference</b><br>
4082   * Path: <b>CarePlan.context</b><br>
4083   * </p>
4084   */
4085  @SearchParamDefinition(name="encounter", path="CarePlan.context", description="Created in context of", type="reference", target={Encounter.class } )
4086  public static final String SP_ENCOUNTER = "encounter";
4087 /**
4088   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
4089   * <p>
4090   * Description: <b>Created in context of</b><br>
4091   * Type: <b>reference</b><br>
4092   * Path: <b>CarePlan.context</b><br>
4093   * </p>
4094   */
4095  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
4096
4097/**
4098   * Constant for fluent queries to be used to add include statements. Specifies
4099   * the path value of "<b>CarePlan:encounter</b>".
4100   */
4101  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("CarePlan:encounter").toLocked();
4102
4103 /**
4104   * Search parameter: <b>intent</b>
4105   * <p>
4106   * Description: <b>proposal | plan | order | option</b><br>
4107   * Type: <b>token</b><br>
4108   * Path: <b>CarePlan.intent</b><br>
4109   * </p>
4110   */
4111  @SearchParamDefinition(name="intent", path="CarePlan.intent", description="proposal | plan | order | option", type="token" )
4112  public static final String SP_INTENT = "intent";
4113 /**
4114   * <b>Fluent Client</b> search parameter constant for <b>intent</b>
4115   * <p>
4116   * Description: <b>proposal | plan | order | option</b><br>
4117   * Type: <b>token</b><br>
4118   * Path: <b>CarePlan.intent</b><br>
4119   * </p>
4120   */
4121  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INTENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INTENT);
4122
4123 /**
4124   * Search parameter: <b>activity-reference</b>
4125   * <p>
4126   * Description: <b>Activity details defined in specific resource</b><br>
4127   * Type: <b>reference</b><br>
4128   * Path: <b>CarePlan.activity.reference</b><br>
4129   * </p>
4130   */
4131  @SearchParamDefinition(name="activity-reference", path="CarePlan.activity.reference", description="Activity details defined in specific resource", type="reference", target={Appointment.class, CommunicationRequest.class, DeviceRequest.class, MedicationRequest.class, NutritionOrder.class, ProcedureRequest.class, ReferralRequest.class, RequestGroup.class, Task.class, VisionPrescription.class } )
4132  public static final String SP_ACTIVITY_REFERENCE = "activity-reference";
4133 /**
4134   * <b>Fluent Client</b> search parameter constant for <b>activity-reference</b>
4135   * <p>
4136   * Description: <b>Activity details defined in specific resource</b><br>
4137   * Type: <b>reference</b><br>
4138   * Path: <b>CarePlan.activity.reference</b><br>
4139   * </p>
4140   */
4141  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTIVITY_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTIVITY_REFERENCE);
4142
4143/**
4144   * Constant for fluent queries to be used to add include statements. Specifies
4145   * the path value of "<b>CarePlan:activity-reference</b>".
4146   */
4147  public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTIVITY_REFERENCE = new ca.uhn.fhir.model.api.Include("CarePlan:activity-reference").toLocked();
4148
4149 /**
4150   * Search parameter: <b>condition</b>
4151   * <p>
4152   * Description: <b>Health issues this plan addresses</b><br>
4153   * Type: <b>reference</b><br>
4154   * Path: <b>CarePlan.addresses</b><br>
4155   * </p>
4156   */
4157  @SearchParamDefinition(name="condition", path="CarePlan.addresses", description="Health issues this plan addresses", type="reference", target={Condition.class } )
4158  public static final String SP_CONDITION = "condition";
4159 /**
4160   * <b>Fluent Client</b> search parameter constant for <b>condition</b>
4161   * <p>
4162   * Description: <b>Health issues this plan addresses</b><br>
4163   * Type: <b>reference</b><br>
4164   * Path: <b>CarePlan.addresses</b><br>
4165   * </p>
4166   */
4167  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION);
4168
4169/**
4170   * Constant for fluent queries to be used to add include statements. Specifies
4171   * the path value of "<b>CarePlan:condition</b>".
4172   */
4173  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("CarePlan:condition").toLocked();
4174
4175 /**
4176   * Search parameter: <b>based-on</b>
4177   * <p>
4178   * Description: <b>Fulfills care plan</b><br>
4179   * Type: <b>reference</b><br>
4180   * Path: <b>CarePlan.basedOn</b><br>
4181   * </p>
4182   */
4183  @SearchParamDefinition(name="based-on", path="CarePlan.basedOn", description="Fulfills care plan", type="reference", target={CarePlan.class } )
4184  public static final String SP_BASED_ON = "based-on";
4185 /**
4186   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
4187   * <p>
4188   * Description: <b>Fulfills care plan</b><br>
4189   * Type: <b>reference</b><br>
4190   * Path: <b>CarePlan.basedOn</b><br>
4191   * </p>
4192   */
4193  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
4194
4195/**
4196   * Constant for fluent queries to be used to add include statements. Specifies
4197   * the path value of "<b>CarePlan:based-on</b>".
4198   */
4199  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("CarePlan:based-on").toLocked();
4200
4201 /**
4202   * Search parameter: <b>patient</b>
4203   * <p>
4204   * Description: <b>Who care plan is for</b><br>
4205   * Type: <b>reference</b><br>
4206   * Path: <b>CarePlan.subject</b><br>
4207   * </p>
4208   */
4209  @SearchParamDefinition(name="patient", path="CarePlan.subject", description="Who care plan is for", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } )
4210  public static final String SP_PATIENT = "patient";
4211 /**
4212   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
4213   * <p>
4214   * Description: <b>Who care plan is for</b><br>
4215   * Type: <b>reference</b><br>
4216   * Path: <b>CarePlan.subject</b><br>
4217   * </p>
4218   */
4219  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
4220
4221/**
4222   * Constant for fluent queries to be used to add include statements. Specifies
4223   * the path value of "<b>CarePlan:patient</b>".
4224   */
4225  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("CarePlan:patient").toLocked();
4226
4227 /**
4228   * Search parameter: <b>context</b>
4229   * <p>
4230   * Description: <b>Created in context of</b><br>
4231   * Type: <b>reference</b><br>
4232   * Path: <b>CarePlan.context</b><br>
4233   * </p>
4234   */
4235  @SearchParamDefinition(name="context", path="CarePlan.context", description="Created in context of", type="reference", target={Encounter.class, EpisodeOfCare.class } )
4236  public static final String SP_CONTEXT = "context";
4237 /**
4238   * <b>Fluent Client</b> search parameter constant for <b>context</b>
4239   * <p>
4240   * Description: <b>Created in context of</b><br>
4241   * Type: <b>reference</b><br>
4242   * Path: <b>CarePlan.context</b><br>
4243   * </p>
4244   */
4245  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTEXT);
4246
4247/**
4248   * Constant for fluent queries to be used to add include statements. Specifies
4249   * the path value of "<b>CarePlan:context</b>".
4250   */
4251  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTEXT = new ca.uhn.fhir.model.api.Include("CarePlan:context").toLocked();
4252
4253 /**
4254   * Search parameter: <b>activity-date</b>
4255   * <p>
4256   * Description: <b>Specified date occurs within period specified by CarePlan.activity.timingSchedule</b><br>
4257   * Type: <b>date</b><br>
4258   * Path: <b>CarePlan.activity.detail.scheduled[x]</b><br>
4259   * </p>
4260   */
4261  @SearchParamDefinition(name="activity-date", path="CarePlan.activity.detail.scheduled", description="Specified date occurs within period specified by CarePlan.activity.timingSchedule", type="date" )
4262  public static final String SP_ACTIVITY_DATE = "activity-date";
4263 /**
4264   * <b>Fluent Client</b> search parameter constant for <b>activity-date</b>
4265   * <p>
4266   * Description: <b>Specified date occurs within period specified by CarePlan.activity.timingSchedule</b><br>
4267   * Type: <b>date</b><br>
4268   * Path: <b>CarePlan.activity.detail.scheduled[x]</b><br>
4269   * </p>
4270   */
4271  public static final ca.uhn.fhir.rest.gclient.DateClientParam ACTIVITY_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ACTIVITY_DATE);
4272
4273 /**
4274   * Search parameter: <b>definition</b>
4275   * <p>
4276   * Description: <b>Protocol or definition</b><br>
4277   * Type: <b>reference</b><br>
4278   * Path: <b>CarePlan.definition</b><br>
4279   * </p>
4280   */
4281  @SearchParamDefinition(name="definition", path="CarePlan.definition", description="Protocol or definition", type="reference", target={PlanDefinition.class, Questionnaire.class } )
4282  public static final String SP_DEFINITION = "definition";
4283 /**
4284   * <b>Fluent Client</b> search parameter constant for <b>definition</b>
4285   * <p>
4286   * Description: <b>Protocol or definition</b><br>
4287   * Type: <b>reference</b><br>
4288   * Path: <b>CarePlan.definition</b><br>
4289   * </p>
4290   */
4291  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEFINITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEFINITION);
4292
4293/**
4294   * Constant for fluent queries to be used to add include statements. Specifies
4295   * the path value of "<b>CarePlan:definition</b>".
4296   */
4297  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEFINITION = new ca.uhn.fhir.model.api.Include("CarePlan:definition").toLocked();
4298
4299 /**
4300   * Search parameter: <b>category</b>
4301   * <p>
4302   * Description: <b>Type of plan</b><br>
4303   * Type: <b>token</b><br>
4304   * Path: <b>CarePlan.category</b><br>
4305   * </p>
4306   */
4307  @SearchParamDefinition(name="category", path="CarePlan.category", description="Type of plan", type="token" )
4308  public static final String SP_CATEGORY = "category";
4309 /**
4310   * <b>Fluent Client</b> search parameter constant for <b>category</b>
4311   * <p>
4312   * Description: <b>Type of plan</b><br>
4313   * Type: <b>token</b><br>
4314   * Path: <b>CarePlan.category</b><br>
4315   * </p>
4316   */
4317  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
4318
4319 /**
4320   * Search parameter: <b>activity-code</b>
4321   * <p>
4322   * Description: <b>Detail type of activity</b><br>
4323   * Type: <b>token</b><br>
4324   * Path: <b>CarePlan.activity.detail.code</b><br>
4325   * </p>
4326   */
4327  @SearchParamDefinition(name="activity-code", path="CarePlan.activity.detail.code", description="Detail type of activity", type="token" )
4328  public static final String SP_ACTIVITY_CODE = "activity-code";
4329 /**
4330   * <b>Fluent Client</b> search parameter constant for <b>activity-code</b>
4331   * <p>
4332   * Description: <b>Detail type of activity</b><br>
4333   * Type: <b>token</b><br>
4334   * Path: <b>CarePlan.activity.detail.code</b><br>
4335   * </p>
4336   */
4337  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVITY_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTIVITY_CODE);
4338
4339 /**
4340   * Search parameter: <b>status</b>
4341   * <p>
4342   * Description: <b>draft | active | suspended | completed | entered-in-error | cancelled | unknown</b><br>
4343   * Type: <b>token</b><br>
4344   * Path: <b>CarePlan.status</b><br>
4345   * </p>
4346   */
4347  @SearchParamDefinition(name="status", path="CarePlan.status", description="draft | active | suspended | completed | entered-in-error | cancelled | unknown", type="token" )
4348  public static final String SP_STATUS = "status";
4349 /**
4350   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4351   * <p>
4352   * Description: <b>draft | active | suspended | completed | entered-in-error | cancelled | unknown</b><br>
4353   * Type: <b>token</b><br>
4354   * Path: <b>CarePlan.status</b><br>
4355   * </p>
4356   */
4357  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4358
4359
4360}