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