001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017package ca.uhn.fhir.model.dstu2.resource;
018
019import java.math.BigDecimal;
020import java.net.URI;
021import java.util.*;
022import ca.uhn.fhir.model.api.*;
023import ca.uhn.fhir.model.api.annotation.*;
024import ca.uhn.fhir.rest.gclient.*;
025
026import ca.uhn.fhir.model.dstu2.valueset.AccountStatusEnum;
027import ca.uhn.fhir.model.dstu2.valueset.ActionListEnum;
028import ca.uhn.fhir.model.dstu2.composite.AddressDt;
029import ca.uhn.fhir.model.dstu2.valueset.AdjudicationCodesEnum;
030import ca.uhn.fhir.model.dstu2.valueset.AdjudicationErrorCodesEnum;
031import ca.uhn.fhir.model.dstu2.valueset.AdjustmentReasonCodesEnum;
032import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum;
033import ca.uhn.fhir.model.dstu2.valueset.AdmitSourceEnum;
034import ca.uhn.fhir.model.dstu2.resource.AllergyIntolerance;
035import ca.uhn.fhir.model.dstu2.valueset.AllergyIntoleranceCategoryEnum;
036import ca.uhn.fhir.model.dstu2.valueset.AllergyIntoleranceCertaintyEnum;
037import ca.uhn.fhir.model.dstu2.valueset.AllergyIntoleranceCriticalityEnum;
038import ca.uhn.fhir.model.dstu2.valueset.AllergyIntoleranceSeverityEnum;
039import ca.uhn.fhir.model.dstu2.valueset.AllergyIntoleranceStatusEnum;
040import ca.uhn.fhir.model.dstu2.valueset.AllergyIntoleranceTypeEnum;
041import ca.uhn.fhir.model.dstu2.composite.AnnotationDt;
042import ca.uhn.fhir.model.dstu2.valueset.AnswerFormatEnum;
043import ca.uhn.fhir.model.dstu2.resource.Appointment;
044import ca.uhn.fhir.model.dstu2.valueset.AppointmentStatusEnum;
045import ca.uhn.fhir.model.dstu2.valueset.AssertionDirectionTypeEnum;
046import ca.uhn.fhir.model.dstu2.valueset.AssertionOperatorTypeEnum;
047import ca.uhn.fhir.model.dstu2.valueset.AssertionResponseTypesEnum;
048import ca.uhn.fhir.model.dstu2.composite.AttachmentDt;
049import ca.uhn.fhir.model.dstu2.valueset.AuditEventActionEnum;
050import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectLifecycleEnum;
051import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectRoleEnum;
052import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectTypeEnum;
053import ca.uhn.fhir.model.dstu2.valueset.AuditEventOutcomeEnum;
054import ca.uhn.fhir.model.dstu2.valueset.AuditEventParticipantNetworkTypeEnum;
055import ca.uhn.fhir.model.dstu2.valueset.AuditEventSourceTypeEnum;
056import ca.uhn.fhir.model.dstu2.valueset.BindingStrengthEnum;
057import ca.uhn.fhir.model.dstu2.resource.BodySite;
058import ca.uhn.fhir.model.dstu2.valueset.BundleTypeEnum;
059import ca.uhn.fhir.model.dstu2.resource.CarePlan;
060import ca.uhn.fhir.model.dstu2.valueset.CarePlanActivityStatusEnum;
061import ca.uhn.fhir.model.dstu2.valueset.CarePlanRelationshipEnum;
062import ca.uhn.fhir.model.dstu2.valueset.CarePlanStatusEnum;
063import ca.uhn.fhir.model.dstu2.resource.Claim;
064import ca.uhn.fhir.model.dstu2.resource.ClaimResponse;
065import ca.uhn.fhir.model.dstu2.valueset.ClaimTypeEnum;
066import ca.uhn.fhir.model.dstu2.resource.ClinicalImpression;
067import ca.uhn.fhir.model.dstu2.valueset.ClinicalImpressionStatusEnum;
068import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt;
069import ca.uhn.fhir.model.dstu2.composite.CodingDt;
070import ca.uhn.fhir.model.dstu2.resource.CommunicationRequest;
071import ca.uhn.fhir.model.dstu2.valueset.CommunicationRequestStatusEnum;
072import ca.uhn.fhir.model.dstu2.valueset.CommunicationStatusEnum;
073import ca.uhn.fhir.model.dstu2.resource.Composition;
074import ca.uhn.fhir.model.dstu2.valueset.CompositionAttestationModeEnum;
075import ca.uhn.fhir.model.dstu2.valueset.CompositionStatusEnum;
076import ca.uhn.fhir.model.dstu2.valueset.ConceptMapEquivalenceEnum;
077import ca.uhn.fhir.model.dstu2.resource.Condition;
078import ca.uhn.fhir.model.dstu2.valueset.ConditionCategoryCodesEnum;
079import ca.uhn.fhir.model.dstu2.valueset.ConditionClinicalStatusCodesEnum;
080import ca.uhn.fhir.model.dstu2.valueset.ConditionVerificationStatusEnum;
081import ca.uhn.fhir.model.dstu2.valueset.ConditionalDeleteStatusEnum;
082import ca.uhn.fhir.model.dstu2.resource.Conformance;
083import ca.uhn.fhir.model.dstu2.valueset.ConformanceEventModeEnum;
084import ca.uhn.fhir.model.dstu2.valueset.ConformanceResourceStatusEnum;
085import ca.uhn.fhir.model.dstu2.valueset.ConformanceStatementKindEnum;
086import ca.uhn.fhir.model.dstu2.composite.ContactPointDt;
087import ca.uhn.fhir.model.dstu2.valueset.ContentTypeEnum;
088import ca.uhn.fhir.model.dstu2.resource.Contract;
089import ca.uhn.fhir.model.dstu2.resource.Coverage;
090import ca.uhn.fhir.model.dstu2.valueset.DataElementStringencyEnum;
091import ca.uhn.fhir.model.dstu2.valueset.DaysOfWeekEnum;
092import ca.uhn.fhir.model.dstu2.valueset.DetectedIssueSeverityEnum;
093import ca.uhn.fhir.model.dstu2.resource.Device;
094import ca.uhn.fhir.model.dstu2.resource.DeviceComponent;
095import ca.uhn.fhir.model.dstu2.resource.DeviceMetric;
096import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCalibrationStateEnum;
097import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCalibrationTypeEnum;
098import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCategoryEnum;
099import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricColorEnum;
100import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricOperationalStatusEnum;
101import ca.uhn.fhir.model.dstu2.valueset.DeviceStatusEnum;
102import ca.uhn.fhir.model.dstu2.resource.DeviceUseRequest;
103import ca.uhn.fhir.model.dstu2.valueset.DeviceUseRequestPriorityEnum;
104import ca.uhn.fhir.model.dstu2.valueset.DeviceUseRequestStatusEnum;
105import ca.uhn.fhir.model.dstu2.resource.DiagnosticOrder;
106import ca.uhn.fhir.model.dstu2.valueset.DiagnosticOrderPriorityEnum;
107import ca.uhn.fhir.model.dstu2.valueset.DiagnosticOrderStatusEnum;
108import ca.uhn.fhir.model.dstu2.resource.DiagnosticReport;
109import ca.uhn.fhir.model.dstu2.valueset.DiagnosticReportStatusEnum;
110import ca.uhn.fhir.model.dstu2.valueset.DigitalMediaTypeEnum;
111import ca.uhn.fhir.model.dstu2.valueset.DocumentModeEnum;
112import ca.uhn.fhir.model.dstu2.resource.DocumentReference;
113import ca.uhn.fhir.model.dstu2.valueset.DocumentReferenceStatusEnum;
114import ca.uhn.fhir.model.dstu2.valueset.DocumentRelationshipTypeEnum;
115import ca.uhn.fhir.model.dstu2.composite.ElementDefinitionDt;
116import ca.uhn.fhir.model.dstu2.resource.EligibilityRequest;
117import ca.uhn.fhir.model.dstu2.resource.Encounter;
118import ca.uhn.fhir.model.dstu2.valueset.EncounterClassEnum;
119import ca.uhn.fhir.model.dstu2.valueset.EncounterLocationStatusEnum;
120import ca.uhn.fhir.model.dstu2.valueset.EncounterStateEnum;
121import ca.uhn.fhir.model.dstu2.resource.EnrollmentRequest;
122import ca.uhn.fhir.model.dstu2.resource.EpisodeOfCare;
123import ca.uhn.fhir.model.dstu2.valueset.EpisodeOfCareStatusEnum;
124import ca.uhn.fhir.model.dstu2.valueset.ExtensionContextEnum;
125import ca.uhn.fhir.model.dstu2.valueset.FamilyHistoryStatusEnum;
126import ca.uhn.fhir.model.dstu2.resource.FamilyMemberHistory;
127import ca.uhn.fhir.model.dstu2.valueset.FilterOperatorEnum;
128import ca.uhn.fhir.model.dstu2.valueset.FlagStatusEnum;
129import ca.uhn.fhir.model.dstu2.resource.Goal;
130import ca.uhn.fhir.model.dstu2.valueset.GoalPriorityEnum;
131import ca.uhn.fhir.model.dstu2.valueset.GoalStatusEnum;
132import ca.uhn.fhir.model.dstu2.resource.Group;
133import ca.uhn.fhir.model.dstu2.valueset.GroupTypeEnum;
134import ca.uhn.fhir.model.dstu2.valueset.GuideDependencyTypeEnum;
135import ca.uhn.fhir.model.dstu2.valueset.GuidePageKindEnum;
136import ca.uhn.fhir.model.dstu2.valueset.GuideResourcePurposeEnum;
137import ca.uhn.fhir.model.dstu2.valueset.HTTPVerbEnum;
138import ca.uhn.fhir.model.dstu2.resource.HealthcareService;
139import ca.uhn.fhir.model.dstu2.composite.HumanNameDt;
140import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
141import ca.uhn.fhir.model.dstu2.valueset.IdentifierTypeCodesEnum;
142import ca.uhn.fhir.model.dstu2.valueset.IdentityAssuranceLevelEnum;
143import ca.uhn.fhir.model.dstu2.resource.ImagingObjectSelection;
144import ca.uhn.fhir.model.dstu2.resource.ImagingStudy;
145import ca.uhn.fhir.model.dstu2.resource.Immunization;
146import ca.uhn.fhir.model.dstu2.valueset.InstanceAvailabilityEnum;
147import ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum;
148import ca.uhn.fhir.model.dstu2.valueset.IssueTypeEnum;
149import ca.uhn.fhir.model.dstu2.valueset.KOStitleEnum;
150import ca.uhn.fhir.model.dstu2.valueset.LinkTypeEnum;
151import ca.uhn.fhir.model.dstu2.valueset.ListModeEnum;
152import ca.uhn.fhir.model.dstu2.valueset.ListOrderCodesEnum;
153import ca.uhn.fhir.model.dstu2.valueset.ListStatusEnum;
154import ca.uhn.fhir.model.dstu2.resource.Location;
155import ca.uhn.fhir.model.dstu2.valueset.LocationModeEnum;
156import ca.uhn.fhir.model.dstu2.valueset.LocationStatusEnum;
157import ca.uhn.fhir.model.dstu2.valueset.LocationTypeEnum;
158import ca.uhn.fhir.model.dstu2.valueset.MaritalStatusCodesEnum;
159import ca.uhn.fhir.model.dstu2.valueset.MeasmntPrincipleEnum;
160import ca.uhn.fhir.model.dstu2.resource.Media;
161import ca.uhn.fhir.model.dstu2.resource.Medication;
162import ca.uhn.fhir.model.dstu2.valueset.MedicationAdministrationStatusEnum;
163import ca.uhn.fhir.model.dstu2.valueset.MedicationDispenseStatusEnum;
164import ca.uhn.fhir.model.dstu2.resource.MedicationOrder;
165import ca.uhn.fhir.model.dstu2.valueset.MedicationOrderStatusEnum;
166import ca.uhn.fhir.model.dstu2.resource.MedicationStatement;
167import ca.uhn.fhir.model.dstu2.valueset.MedicationStatementStatusEnum;
168import ca.uhn.fhir.model.dstu2.valueset.MessageEventEnum;
169import ca.uhn.fhir.model.dstu2.valueset.MessageSignificanceCategoryEnum;
170import ca.uhn.fhir.model.dstu2.valueset.MessageTransportEnum;
171import ca.uhn.fhir.model.dstu2.resource.NamingSystem;
172import ca.uhn.fhir.model.dstu2.valueset.NamingSystemIdentifierTypeEnum;
173import ca.uhn.fhir.model.dstu2.valueset.NamingSystemTypeEnum;
174import ca.uhn.fhir.model.dstu2.valueset.NoteTypeEnum;
175import ca.uhn.fhir.model.dstu2.resource.NutritionOrder;
176import ca.uhn.fhir.model.dstu2.valueset.NutritionOrderStatusEnum;
177import ca.uhn.fhir.model.dstu2.resource.Observation;
178import ca.uhn.fhir.model.dstu2.valueset.ObservationRelationshipTypeEnum;
179import ca.uhn.fhir.model.dstu2.valueset.ObservationStatusEnum;
180import ca.uhn.fhir.model.dstu2.resource.OperationDefinition;
181import ca.uhn.fhir.model.dstu2.valueset.OperationKindEnum;
182import ca.uhn.fhir.model.dstu2.resource.OperationOutcome;
183import ca.uhn.fhir.model.dstu2.valueset.OperationParameterUseEnum;
184import ca.uhn.fhir.model.dstu2.resource.Order;
185import ca.uhn.fhir.model.dstu2.valueset.OrderStatusEnum;
186import ca.uhn.fhir.model.dstu2.resource.Organization;
187import ca.uhn.fhir.model.dstu2.valueset.ParticipantRequiredEnum;
188import ca.uhn.fhir.model.dstu2.valueset.ParticipantStatusEnum;
189import ca.uhn.fhir.model.dstu2.valueset.ParticipantTypeEnum;
190import ca.uhn.fhir.model.dstu2.valueset.ParticipationStatusEnum;
191import ca.uhn.fhir.model.dstu2.resource.Patient;
192import ca.uhn.fhir.model.dstu2.valueset.PayeeTypeCodesEnum;
193import ca.uhn.fhir.model.dstu2.composite.PeriodDt;
194import ca.uhn.fhir.model.dstu2.resource.Person;
195import ca.uhn.fhir.model.dstu2.resource.Practitioner;
196import ca.uhn.fhir.model.dstu2.resource.Procedure;
197import ca.uhn.fhir.model.dstu2.resource.ProcedureRequest;
198import ca.uhn.fhir.model.dstu2.valueset.ProcedureRequestPriorityEnum;
199import ca.uhn.fhir.model.dstu2.valueset.ProcedureRequestStatusEnum;
200import ca.uhn.fhir.model.dstu2.valueset.ProcedureStatusEnum;
201import ca.uhn.fhir.model.dstu2.resource.ProcessRequest;
202import ca.uhn.fhir.model.dstu2.valueset.ProvenanceEntityRoleEnum;
203import ca.uhn.fhir.model.dstu2.composite.QuantityDt;
204import ca.uhn.fhir.model.dstu2.resource.Questionnaire;
205import ca.uhn.fhir.model.dstu2.resource.QuestionnaireResponse;
206import ca.uhn.fhir.model.dstu2.valueset.QuestionnaireResponseStatusEnum;
207import ca.uhn.fhir.model.dstu2.valueset.QuestionnaireStatusEnum;
208import ca.uhn.fhir.model.dstu2.composite.RangeDt;
209import ca.uhn.fhir.model.dstu2.composite.RatioDt;
210import ca.uhn.fhir.model.dstu2.valueset.ReferralMethodEnum;
211import ca.uhn.fhir.model.dstu2.resource.ReferralRequest;
212import ca.uhn.fhir.model.dstu2.valueset.ReferralStatusEnum;
213import ca.uhn.fhir.model.dstu2.resource.RelatedPerson;
214import ca.uhn.fhir.model.dstu2.valueset.RemittanceOutcomeEnum;
215import ca.uhn.fhir.model.dstu2.valueset.ResourceTypeEnum;
216import ca.uhn.fhir.model.dstu2.valueset.ResourceVersionPolicyEnum;
217import ca.uhn.fhir.model.dstu2.valueset.ResponseTypeEnum;
218import ca.uhn.fhir.model.dstu2.valueset.RestfulConformanceModeEnum;
219import ca.uhn.fhir.model.dstu2.valueset.RestfulSecurityServiceEnum;
220import ca.uhn.fhir.model.dstu2.resource.RiskAssessment;
221import ca.uhn.fhir.model.dstu2.valueset.RulesetCodesEnum;
222import ca.uhn.fhir.model.dstu2.composite.SampledDataDt;
223import ca.uhn.fhir.model.dstu2.resource.Schedule;
224import ca.uhn.fhir.model.dstu2.valueset.SearchEntryModeEnum;
225import ca.uhn.fhir.model.dstu2.valueset.SearchModifierCodeEnum;
226import ca.uhn.fhir.model.dstu2.valueset.SearchParamTypeEnum;
227import ca.uhn.fhir.model.dstu2.valueset.ServiceProvisionConditionsEnum;
228import ca.uhn.fhir.model.dstu2.composite.SignatureDt;
229import ca.uhn.fhir.model.dstu2.resource.Slot;
230import ca.uhn.fhir.model.dstu2.valueset.SlotStatusEnum;
231import ca.uhn.fhir.model.dstu2.resource.Specimen;
232import ca.uhn.fhir.model.dstu2.valueset.SpecimenStatusEnum;
233import ca.uhn.fhir.model.dstu2.resource.StructureDefinition;
234import ca.uhn.fhir.model.dstu2.valueset.StructureDefinitionKindEnum;
235import ca.uhn.fhir.model.dstu2.valueset.SubscriptionChannelTypeEnum;
236import ca.uhn.fhir.model.dstu2.valueset.SubscriptionStatusEnum;
237import ca.uhn.fhir.model.dstu2.resource.Substance;
238import ca.uhn.fhir.model.dstu2.valueset.SubstanceCategoryCodesEnum;
239import ca.uhn.fhir.model.dstu2.valueset.SupplyDeliveryStatusEnum;
240import ca.uhn.fhir.model.dstu2.resource.SupplyRequest;
241import ca.uhn.fhir.model.dstu2.valueset.SupplyRequestStatusEnum;
242import ca.uhn.fhir.model.dstu2.valueset.SystemRestfulInteractionEnum;
243import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
244import ca.uhn.fhir.model.dstu2.composite.TimingDt;
245import ca.uhn.fhir.model.dstu2.valueset.TransactionModeEnum;
246import ca.uhn.fhir.model.dstu2.valueset.TypeRestfulInteractionEnum;
247import ca.uhn.fhir.model.dstu2.valueset.UnknownContentCodeEnum;
248import ca.uhn.fhir.model.dstu2.valueset.UseEnum;
249import ca.uhn.fhir.model.dstu2.resource.ValueSet;
250import ca.uhn.fhir.model.dstu2.valueset.VisionBaseEnum;
251import ca.uhn.fhir.model.dstu2.valueset.VisionEyesEnum;
252import ca.uhn.fhir.model.dstu2.resource.VisionPrescription;
253import ca.uhn.fhir.model.dstu2.valueset.XPathUsageTypeEnum;
254import ca.uhn.fhir.model.api.IResource;
255import ca.uhn.fhir.model.dstu2.composite.AgeDt;
256import ca.uhn.fhir.model.dstu2.composite.BoundCodeableConceptDt;
257import ca.uhn.fhir.model.dstu2.composite.DurationDt;
258import ca.uhn.fhir.model.dstu2.composite.MoneyDt;
259import ca.uhn.fhir.model.dstu2.composite.NarrativeDt;
260import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt;
261import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt;
262import ca.uhn.fhir.model.primitive.Base64BinaryDt;
263import ca.uhn.fhir.model.primitive.BooleanDt;
264import ca.uhn.fhir.model.primitive.BoundCodeDt;
265import ca.uhn.fhir.model.primitive.CodeDt;
266import ca.uhn.fhir.model.primitive.DateDt;
267import ca.uhn.fhir.model.primitive.DateTimeDt;
268import ca.uhn.fhir.model.primitive.DecimalDt;
269import ca.uhn.fhir.model.primitive.IdDt;
270import ca.uhn.fhir.model.primitive.InstantDt;
271import ca.uhn.fhir.model.primitive.IntegerDt;
272import ca.uhn.fhir.model.primitive.OidDt;
273import ca.uhn.fhir.model.primitive.PositiveIntDt;
274import ca.uhn.fhir.model.primitive.StringDt;
275import ca.uhn.fhir.model.primitive.TimeDt;
276import ca.uhn.fhir.model.primitive.UnsignedIntDt;
277import ca.uhn.fhir.model.primitive.UriDt;
278
279
280/**
281 * HAPI/FHIR <b>CarePlan</b> Resource
282 * ()
283 *
284 * <p>
285 * <b>Definition:</b>
286 * 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.
287 * </p> 
288 *
289 * <p>
290 * <b>Requirements:</b>
291 * 
292 * </p> 
293 *
294 * <p>
295 * <b>Profile Definition:</b>
296 * <a href="http://hl7.org/fhir/profiles/CarePlan">http://hl7.org/fhir/profiles/CarePlan</a> 
297 * </p>
298 *
299 */
300@ResourceDef(name="CarePlan", profile="http://hl7.org/fhir/profiles/CarePlan", id="careplan")
301public class CarePlan extends ca.uhn.fhir.model.dstu2.resource.BaseResource
302    implements  IResource 
303    {
304
305        /**
306         * Search parameter constant for <b>patient</b>
307         * <p>
308         * Description: <b></b><br>
309         * Type: <b>reference</b><br>
310         * Path: <b>CarePlan.subject</b><br>
311         * </p>
312         */
313        @SearchParamDefinition(name="patient", path="CarePlan.subject", description="", type="reference" 
314, providesMembershipIn={
315 @Compartment(name="Patient")   }
316, target={
317 ca.uhn.fhir.model.dstu2.resource.Patient.class         }
318 )
319        public static final String SP_PATIENT = "patient";
320
321        /**
322         * <b>Fluent Client</b> search parameter constant for <b>patient</b>
323         * <p>
324         * Description: <b></b><br>
325         * Type: <b>reference</b><br>
326         * Path: <b>CarePlan.subject</b><br>
327         * </p>
328         */
329        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
330
331        /**
332         * Search parameter constant for <b>subject</b>
333         * <p>
334         * Description: <b></b><br>
335         * Type: <b>reference</b><br>
336         * Path: <b>CarePlan.subject</b><br>
337         * </p>
338         */
339        @SearchParamDefinition(name="subject", path="CarePlan.subject", description="", type="reference" 
340 )
341        public static final String SP_SUBJECT = "subject";
342
343        /**
344         * <b>Fluent Client</b> search parameter constant for <b>subject</b>
345         * <p>
346         * Description: <b></b><br>
347         * Type: <b>reference</b><br>
348         * Path: <b>CarePlan.subject</b><br>
349         * </p>
350         */
351        public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT);
352
353        /**
354         * Search parameter constant for <b>condition</b>
355         * <p>
356         * Description: <b></b><br>
357         * Type: <b>reference</b><br>
358         * Path: <b>CarePlan.addresses</b><br>
359         * </p>
360         */
361        @SearchParamDefinition(name="condition", path="CarePlan.addresses", description="", type="reference" 
362 )
363        public static final String SP_CONDITION = "condition";
364
365        /**
366         * <b>Fluent Client</b> search parameter constant for <b>condition</b>
367         * <p>
368         * Description: <b></b><br>
369         * Type: <b>reference</b><br>
370         * Path: <b>CarePlan.addresses</b><br>
371         * </p>
372         */
373        public static final ReferenceClientParam CONDITION = new ReferenceClientParam(SP_CONDITION);
374
375        /**
376         * Search parameter constant for <b>date</b>
377         * <p>
378         * Description: <b></b><br>
379         * Type: <b>date</b><br>
380         * Path: <b>CarePlan.period</b><br>
381         * </p>
382         */
383        @SearchParamDefinition(name="date", path="CarePlan.period", description="", type="date" 
384 )
385        public static final String SP_DATE = "date";
386
387        /**
388         * <b>Fluent Client</b> search parameter constant for <b>date</b>
389         * <p>
390         * Description: <b></b><br>
391         * Type: <b>date</b><br>
392         * Path: <b>CarePlan.period</b><br>
393         * </p>
394         */
395        public static final DateClientParam DATE = new DateClientParam(SP_DATE);
396
397        /**
398         * Search parameter constant for <b>participant</b>
399         * <p>
400         * Description: <b></b><br>
401         * Type: <b>reference</b><br>
402         * Path: <b>CarePlan.participant.member</b><br>
403         * </p>
404         */
405        @SearchParamDefinition(name="participant", path="CarePlan.participant.member", description="", type="reference" 
406, providesMembershipIn={
407 @Compartment(name="Patient") ,  @Compartment(name="Encounter") ,  @Compartment(name="RelatedPerson")   }
408 )
409        public static final String SP_PARTICIPANT = "participant";
410
411        /**
412         * <b>Fluent Client</b> search parameter constant for <b>participant</b>
413         * <p>
414         * Description: <b></b><br>
415         * Type: <b>reference</b><br>
416         * Path: <b>CarePlan.participant.member</b><br>
417         * </p>
418         */
419        public static final ReferenceClientParam PARTICIPANT = new ReferenceClientParam(SP_PARTICIPANT);
420
421        /**
422         * Search parameter constant for <b>activitycode</b>
423         * <p>
424         * Description: <b></b><br>
425         * Type: <b>token</b><br>
426         * Path: <b>CarePlan.activity.detail.code</b><br>
427         * </p>
428         */
429        @SearchParamDefinition(name="activitycode", path="CarePlan.activity.detail.code", description="", type="token" 
430 )
431        public static final String SP_ACTIVITYCODE = "activitycode";
432
433        /**
434         * <b>Fluent Client</b> search parameter constant for <b>activitycode</b>
435         * <p>
436         * Description: <b></b><br>
437         * Type: <b>token</b><br>
438         * Path: <b>CarePlan.activity.detail.code</b><br>
439         * </p>
440         */
441        public static final TokenClientParam ACTIVITYCODE = new TokenClientParam(SP_ACTIVITYCODE);
442
443        /**
444         * Search parameter constant for <b>activitydate</b>
445         * <p>
446         * Description: <b>Specified date occurs within period specified by CarePlan.activity.timingSchedule</b><br>
447         * Type: <b>date</b><br>
448         * Path: <b>CarePlan.activity.detail.scheduled[x]</b><br>
449         * </p>
450         */
451        @SearchParamDefinition(name="activitydate", path="CarePlan.activity.detail.scheduled[x]", description="Specified date occurs within period specified by CarePlan.activity.timingSchedule", type="date" 
452 )
453        public static final String SP_ACTIVITYDATE = "activitydate";
454
455        /**
456         * <b>Fluent Client</b> search parameter constant for <b>activitydate</b>
457         * <p>
458         * Description: <b>Specified date occurs within period specified by CarePlan.activity.timingSchedule</b><br>
459         * Type: <b>date</b><br>
460         * Path: <b>CarePlan.activity.detail.scheduled[x]</b><br>
461         * </p>
462         */
463        public static final DateClientParam ACTIVITYDATE = new DateClientParam(SP_ACTIVITYDATE);
464
465        /**
466         * Search parameter constant for <b>activityreference</b>
467         * <p>
468         * Description: <b></b><br>
469         * Type: <b>reference</b><br>
470         * Path: <b>CarePlan.activity.reference</b><br>
471         * </p>
472         */
473        @SearchParamDefinition(name="activityreference", path="CarePlan.activity.reference", description="", type="reference" 
474 )
475        public static final String SP_ACTIVITYREFERENCE = "activityreference";
476
477        /**
478         * <b>Fluent Client</b> search parameter constant for <b>activityreference</b>
479         * <p>
480         * Description: <b></b><br>
481         * Type: <b>reference</b><br>
482         * Path: <b>CarePlan.activity.reference</b><br>
483         * </p>
484         */
485        public static final ReferenceClientParam ACTIVITYREFERENCE = new ReferenceClientParam(SP_ACTIVITYREFERENCE);
486
487        /**
488         * Search parameter constant for <b>performer</b>
489         * <p>
490         * Description: <b>Matches if the practitioner is listed as a performer in any of the \&quot;simple\&quot; activities.  (For performers of the detailed activities, chain through the activitydetail search parameter.)</b><br>
491         * Type: <b>reference</b><br>
492         * Path: <b>CarePlan.activity.detail.performer</b><br>
493         * </p>
494         */
495        @SearchParamDefinition(name="performer", path="CarePlan.activity.detail.performer", description="Matches if the practitioner is listed as a performer in any of the \"simple\" activities.  (For performers of the detailed activities, chain through the activitydetail search parameter.)", type="reference" 
496, providesMembershipIn={
497 @Compartment(name="Patient") ,  @Compartment(name="Encounter") ,  @Compartment(name="RelatedPerson")   }
498 )
499        public static final String SP_PERFORMER = "performer";
500
501        /**
502         * <b>Fluent Client</b> search parameter constant for <b>performer</b>
503         * <p>
504         * Description: <b>Matches if the practitioner is listed as a performer in any of the \&quot;simple\&quot; activities.  (For performers of the detailed activities, chain through the activitydetail search parameter.)</b><br>
505         * Type: <b>reference</b><br>
506         * Path: <b>CarePlan.activity.detail.performer</b><br>
507         * </p>
508         */
509        public static final ReferenceClientParam PERFORMER = new ReferenceClientParam(SP_PERFORMER);
510
511        /**
512         * Search parameter constant for <b>goal</b>
513         * <p>
514         * Description: <b></b><br>
515         * Type: <b>reference</b><br>
516         * Path: <b>CarePlan.goal</b><br>
517         * </p>
518         */
519        @SearchParamDefinition(name="goal", path="CarePlan.goal", description="", type="reference" 
520 )
521        public static final String SP_GOAL = "goal";
522
523        /**
524         * <b>Fluent Client</b> search parameter constant for <b>goal</b>
525         * <p>
526         * Description: <b></b><br>
527         * Type: <b>reference</b><br>
528         * Path: <b>CarePlan.goal</b><br>
529         * </p>
530         */
531        public static final ReferenceClientParam GOAL = new ReferenceClientParam(SP_GOAL);
532
533        /**
534         * Search parameter constant for <b>relatedcode</b>
535         * <p>
536         * Description: <b></b><br>
537         * Type: <b>token</b><br>
538         * Path: <b>CarePlan.relatedPlan.code</b><br>
539         * </p>
540         */
541        @SearchParamDefinition(name="relatedcode", path="CarePlan.relatedPlan.code", description="", type="token" 
542 )
543        public static final String SP_RELATEDCODE = "relatedcode";
544
545        /**
546         * <b>Fluent Client</b> search parameter constant for <b>relatedcode</b>
547         * <p>
548         * Description: <b></b><br>
549         * Type: <b>token</b><br>
550         * Path: <b>CarePlan.relatedPlan.code</b><br>
551         * </p>
552         */
553        public static final TokenClientParam RELATEDCODE = new TokenClientParam(SP_RELATEDCODE);
554
555        /**
556         * Search parameter constant for <b>relatedplan</b>
557         * <p>
558         * Description: <b></b><br>
559         * Type: <b>reference</b><br>
560         * Path: <b>CarePlan.relatedPlan.plan</b><br>
561         * </p>
562         */
563        @SearchParamDefinition(name="relatedplan", path="CarePlan.relatedPlan.plan", description="", type="reference" 
564 )
565        public static final String SP_RELATEDPLAN = "relatedplan";
566
567        /**
568         * <b>Fluent Client</b> search parameter constant for <b>relatedplan</b>
569         * <p>
570         * Description: <b></b><br>
571         * Type: <b>reference</b><br>
572         * Path: <b>CarePlan.relatedPlan.plan</b><br>
573         * </p>
574         */
575        public static final ReferenceClientParam RELATEDPLAN = new ReferenceClientParam(SP_RELATEDPLAN);
576
577        /**
578         * Search parameter constant for <b>relatedcode-relatedplan</b>
579         * <p>
580         * Description: <b>A combination of the type of relationship and the related plan</b><br>
581         * Type: <b>composite</b><br>
582         * Path: <b>relatedcode &amp; relatedplan</b><br>
583         * </p>
584         */
585        @SearchParamDefinition(name="relatedcode-relatedplan", path="relatedcode & relatedplan", description="A combination of the type of relationship and the related plan", type="composite"  , compositeOf={  "relatedcode",  "relatedplan" } 
586 )
587        public static final String SP_RELATEDCODE_RELATEDPLAN = "relatedcode-relatedplan";
588
589        /**
590         * <b>Fluent Client</b> search parameter constant for <b>relatedcode-relatedplan</b>
591         * <p>
592         * Description: <b>A combination of the type of relationship and the related plan</b><br>
593         * Type: <b>composite</b><br>
594         * Path: <b>relatedcode &amp; relatedplan</b><br>
595         * </p>
596         */
597        public static final CompositeClientParam<TokenClientParam, ReferenceClientParam> RELATEDCODE_RELATEDPLAN = new CompositeClientParam<TokenClientParam, ReferenceClientParam>(SP_RELATEDCODE_RELATEDPLAN);
598
599
600        /**
601         * Constant for fluent queries to be used to add include statements. Specifies
602         * the path value of "<b>CarePlan:activityreference</b>".
603         */
604        public static final Include INCLUDE_ACTIVITYREFERENCE = new Include("CarePlan:activityreference");
605
606        /**
607         * Constant for fluent queries to be used to add include statements. Specifies
608         * the path value of "<b>CarePlan:condition</b>".
609         */
610        public static final Include INCLUDE_CONDITION = new Include("CarePlan:condition");
611
612        /**
613         * Constant for fluent queries to be used to add include statements. Specifies
614         * the path value of "<b>CarePlan:goal</b>".
615         */
616        public static final Include INCLUDE_GOAL = new Include("CarePlan:goal");
617
618        /**
619         * Constant for fluent queries to be used to add include statements. Specifies
620         * the path value of "<b>CarePlan:participant</b>".
621         */
622        public static final Include INCLUDE_PARTICIPANT = new Include("CarePlan:participant");
623
624        /**
625         * Constant for fluent queries to be used to add include statements. Specifies
626         * the path value of "<b>CarePlan:patient</b>".
627         */
628        public static final Include INCLUDE_PATIENT = new Include("CarePlan:patient");
629
630        /**
631         * Constant for fluent queries to be used to add include statements. Specifies
632         * the path value of "<b>CarePlan:performer</b>".
633         */
634        public static final Include INCLUDE_PERFORMER = new Include("CarePlan:performer");
635
636        /**
637         * Constant for fluent queries to be used to add include statements. Specifies
638         * the path value of "<b>CarePlan:relatedplan</b>".
639         */
640        public static final Include INCLUDE_RELATEDPLAN = new Include("CarePlan:relatedplan");
641
642        /**
643         * Constant for fluent queries to be used to add include statements. Specifies
644         * the path value of "<b>CarePlan:subject</b>".
645         */
646        public static final Include INCLUDE_SUBJECT = new Include("CarePlan:subject");
647
648
649        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)       
650        @Description(
651                shortDefinition="",
652                formalDefinition="This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)"
653        )
654        private java.util.List<IdentifierDt> myIdentifier;
655        
656        @Child(name="subject", order=1, min=0, max=1, summary=true, modifier=false, type={
657                ca.uhn.fhir.model.dstu2.resource.Patient.class, 
658                ca.uhn.fhir.model.dstu2.resource.Group.class
659        })
660        @Description(
661                shortDefinition="",
662                formalDefinition="Identifies the patient or group whose intended care is described by the plan."
663        )
664        private ResourceReferenceDt mySubject;
665        
666        @Child(name="status", type=CodeDt.class, order=2, min=1, max=1, summary=true, modifier=true)    
667        @Description(
668                shortDefinition="",
669                formalDefinition="Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record."
670        )
671        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/care-plan-status")
672        private BoundCodeDt<CarePlanStatusEnum> myStatus;
673        
674        @Child(name="context", order=3, min=0, max=1, summary=true, modifier=false, type={
675                ca.uhn.fhir.model.dstu2.resource.Encounter.class, 
676                ca.uhn.fhir.model.dstu2.resource.EpisodeOfCare.class
677        })
678        @Description(
679                shortDefinition="",
680                formalDefinition="Identifies the context in which this particular CarePlan is defined."
681        )
682        private ResourceReferenceDt myContext;
683        
684        @Child(name="period", type=PeriodDt.class, order=4, min=0, max=1, summary=true, modifier=false) 
685        @Description(
686                shortDefinition="",
687                formalDefinition="Indicates when the plan did (or is intended to) come into effect and end."
688        )
689        private PeriodDt myPeriod;
690        
691        @Child(name="author", order=5, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false, type={
692                ca.uhn.fhir.model.dstu2.resource.Patient.class, 
693                ca.uhn.fhir.model.dstu2.resource.Practitioner.class, 
694                ca.uhn.fhir.model.dstu2.resource.RelatedPerson.class, 
695                ca.uhn.fhir.model.dstu2.resource.Organization.class
696        })
697        @Description(
698                shortDefinition="",
699                formalDefinition="Identifies the individual(s) or ogranization who is responsible for the content of the care plan."
700        )
701        private java.util.List<ResourceReferenceDt> myAuthor;
702        
703        @Child(name="modified", type=DateTimeDt.class, order=6, min=0, max=1, summary=true, modifier=false)     
704        @Description(
705                shortDefinition="",
706                formalDefinition="Identifies the most recent date on which the plan has been revised."
707        )
708        private DateTimeDt myModified;
709        
710        @Child(name="category", type=CodeableConceptDt.class, order=7, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)    
711        @Description(
712                shortDefinition="",
713                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."
714        )
715        private java.util.List<CodeableConceptDt> myCategory;
716        
717        @Child(name="description", type=StringDt.class, order=8, min=0, max=1, summary=true, modifier=false)    
718        @Description(
719                shortDefinition="",
720                formalDefinition="A description of the scope and nature of the plan"
721        )
722        private StringDt myDescription;
723        
724        @Child(name="addresses", order=9, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false, type={
725                ca.uhn.fhir.model.dstu2.resource.Condition.class
726        })
727        @Description(
728                shortDefinition="",
729                formalDefinition="Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan."
730        )
731        private java.util.List<ResourceReferenceDt> myAddresses;
732        
733        @Child(name="support", order=10, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
734                IResource.class
735        })
736        @Description(
737                shortDefinition="",
738                formalDefinition="Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include co-morbidities, recent procedures, limitations, recent assessments, etc."
739        )
740        private java.util.List<ResourceReferenceDt> mySupport;
741        
742        @Child(name="relatedPlan", order=11, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)     
743        @Description(
744                shortDefinition="",
745                formalDefinition="Identifies CarePlans with some sort of formal relationship to the current plan."
746        )
747        private java.util.List<RelatedPlan> myRelatedPlan;
748        
749        @Child(name="participant", order=12, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)     
750        @Description(
751                shortDefinition="",
752                formalDefinition="Identifies all people and organizations who are expected to be involved in the care envisioned by this plan."
753        )
754        private java.util.List<Participant> myParticipant;
755        
756        @Child(name="goal", order=13, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
757                ca.uhn.fhir.model.dstu2.resource.Goal.class
758        })
759        @Description(
760                shortDefinition="",
761                formalDefinition="Describes the intended objective(s) of carrying out the care plan."
762        )
763        private java.util.List<ResourceReferenceDt> myGoal;
764        
765        @Child(name="activity", order=14, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)        
766        @Description(
767                shortDefinition="",
768                formalDefinition="Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc."
769        )
770        private java.util.List<Activity> myActivity;
771        
772        @Child(name="note", type=AnnotationDt.class, order=15, min=0, max=1, summary=false, modifier=false)     
773        @Description(
774                shortDefinition="",
775                formalDefinition="General notes about the care plan not covered elsewhere"
776        )
777        private AnnotationDt myNote;
778        
779
780        @Override
781        public boolean isEmpty() {
782                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  mySubject,  myStatus,  myContext,  myPeriod,  myAuthor,  myModified,  myCategory,  myDescription,  myAddresses,  mySupport,  myRelatedPlan,  myParticipant,  myGoal,  myActivity,  myNote);
783        }
784        
785        @Override
786        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
787                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, mySubject, myStatus, myContext, myPeriod, myAuthor, myModified, myCategory, myDescription, myAddresses, mySupport, myRelatedPlan, myParticipant, myGoal, myActivity, myNote);
788        }
789
790        /**
791         * Gets the value(s) for <b>identifier</b> ().
792         * creating it if it does
793         * not exist. Will not return <code>null</code>.
794         *
795     * <p>
796     * <b>Definition:</b>
797     * This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)
798     * </p> 
799         */
800        public java.util.List<IdentifierDt> getIdentifier() {  
801                if (myIdentifier == null) {
802                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
803                }
804                return myIdentifier;
805        }
806
807        /**
808         * Sets the value(s) for <b>identifier</b> ()
809         *
810     * <p>
811     * <b>Definition:</b>
812     * This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)
813     * </p> 
814         */
815        public CarePlan setIdentifier(java.util.List<IdentifierDt> theValue) {
816                myIdentifier = theValue;
817                return this;
818        }
819        
820        
821
822        /**
823         * Adds and returns a new value for <b>identifier</b> ()
824         *
825     * <p>
826     * <b>Definition:</b>
827     * This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)
828     * </p> 
829         */
830        public IdentifierDt addIdentifier() {
831                IdentifierDt newType = new IdentifierDt();
832                getIdentifier().add(newType);
833                return newType; 
834        }
835
836        /**
837         * Adds a given new value for <b>identifier</b> ()
838         *
839         * <p>
840         * <b>Definition:</b>
841         * This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)
842         * </p>
843         * @param theValue The identifier to add (must not be <code>null</code>)
844         */
845        public CarePlan addIdentifier(IdentifierDt theValue) {
846                if (theValue == null) {
847                        throw new NullPointerException("theValue must not be null");
848                }
849                getIdentifier().add(theValue);
850                return this;
851        }
852
853        /**
854         * Gets the first repetition for <b>identifier</b> (),
855         * creating it if it does not already exist.
856         *
857     * <p>
858     * <b>Definition:</b>
859     * This records identifiers associated with this care plan that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)
860     * </p> 
861         */
862        public IdentifierDt getIdentifierFirstRep() {
863                if (getIdentifier().isEmpty()) {
864                        return addIdentifier();
865                }
866                return getIdentifier().get(0); 
867        }
868  
869        /**
870         * Gets the value(s) for <b>subject</b> ().
871         * creating it if it does
872         * not exist. Will not return <code>null</code>.
873         *
874     * <p>
875     * <b>Definition:</b>
876     * Identifies the patient or group whose intended care is described by the plan.
877     * </p> 
878         */
879        public ResourceReferenceDt getSubject() {  
880                if (mySubject == null) {
881                        mySubject = new ResourceReferenceDt();
882                }
883                return mySubject;
884        }
885
886        /**
887         * Sets the value(s) for <b>subject</b> ()
888         *
889     * <p>
890     * <b>Definition:</b>
891     * Identifies the patient or group whose intended care is described by the plan.
892     * </p> 
893         */
894        public CarePlan setSubject(ResourceReferenceDt theValue) {
895                mySubject = theValue;
896                return this;
897        }
898        
899        
900
901  
902        /**
903         * Gets the value(s) for <b>status</b> ().
904         * creating it if it does
905         * not exist. Will not return <code>null</code>.
906         *
907     * <p>
908     * <b>Definition:</b>
909     * Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.
910     * </p> 
911         */
912        public BoundCodeDt<CarePlanStatusEnum> getStatusElement() {  
913                if (myStatus == null) {
914                        myStatus = new BoundCodeDt<CarePlanStatusEnum>(CarePlanStatusEnum.VALUESET_BINDER);
915                }
916                return myStatus;
917        }
918
919        
920        /**
921         * Gets the value(s) for <b>status</b> ().
922         * creating it if it does
923         * not exist. This method may return <code>null</code>.
924         *
925     * <p>
926     * <b>Definition:</b>
927     * Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.
928     * </p> 
929         */
930        public String getStatus() {  
931                return getStatusElement().getValue();
932        }
933
934        /**
935         * Sets the value(s) for <b>status</b> ()
936         *
937     * <p>
938     * <b>Definition:</b>
939     * Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.
940     * </p> 
941         */
942        public CarePlan setStatus(BoundCodeDt<CarePlanStatusEnum> theValue) {
943                myStatus = theValue;
944                return this;
945        }
946        
947        
948
949        /**
950         * Sets the value(s) for <b>status</b> ()
951         *
952     * <p>
953     * <b>Definition:</b>
954     * Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.
955     * </p> 
956         */
957        public CarePlan setStatus(CarePlanStatusEnum theValue) {
958                setStatus(new BoundCodeDt<CarePlanStatusEnum>(CarePlanStatusEnum.VALUESET_BINDER, theValue));
959                
960/*
961                getStatusElement().setValueAsEnum(theValue);
962*/
963                return this;
964        }
965
966  
967        /**
968         * Gets the value(s) for <b>context</b> ().
969         * creating it if it does
970         * not exist. Will not return <code>null</code>.
971         *
972     * <p>
973     * <b>Definition:</b>
974     * Identifies the context in which this particular CarePlan is defined.
975     * </p> 
976         */
977        public ResourceReferenceDt getContext() {  
978                if (myContext == null) {
979                        myContext = new ResourceReferenceDt();
980                }
981                return myContext;
982        }
983
984        /**
985         * Sets the value(s) for <b>context</b> ()
986         *
987     * <p>
988     * <b>Definition:</b>
989     * Identifies the context in which this particular CarePlan is defined.
990     * </p> 
991         */
992        public CarePlan setContext(ResourceReferenceDt theValue) {
993                myContext = theValue;
994                return this;
995        }
996        
997        
998
999  
1000        /**
1001         * Gets the value(s) for <b>period</b> ().
1002         * creating it if it does
1003         * not exist. Will not return <code>null</code>.
1004         *
1005     * <p>
1006     * <b>Definition:</b>
1007     * Indicates when the plan did (or is intended to) come into effect and end.
1008     * </p> 
1009         */
1010        public PeriodDt getPeriod() {  
1011                if (myPeriod == null) {
1012                        myPeriod = new PeriodDt();
1013                }
1014                return myPeriod;
1015        }
1016
1017        /**
1018         * Sets the value(s) for <b>period</b> ()
1019         *
1020     * <p>
1021     * <b>Definition:</b>
1022     * Indicates when the plan did (or is intended to) come into effect and end.
1023     * </p> 
1024         */
1025        public CarePlan setPeriod(PeriodDt theValue) {
1026                myPeriod = theValue;
1027                return this;
1028        }
1029        
1030        
1031
1032  
1033        /**
1034         * Gets the value(s) for <b>author</b> ().
1035         * creating it if it does
1036         * not exist. Will not return <code>null</code>.
1037         *
1038     * <p>
1039     * <b>Definition:</b>
1040     * Identifies the individual(s) or ogranization who is responsible for the content of the care plan.
1041     * </p> 
1042         */
1043        public java.util.List<ResourceReferenceDt> getAuthor() {  
1044                if (myAuthor == null) {
1045                        myAuthor = new java.util.ArrayList<ResourceReferenceDt>();
1046                }
1047                return myAuthor;
1048        }
1049
1050        /**
1051         * Sets the value(s) for <b>author</b> ()
1052         *
1053     * <p>
1054     * <b>Definition:</b>
1055     * Identifies the individual(s) or ogranization who is responsible for the content of the care plan.
1056     * </p> 
1057         */
1058        public CarePlan setAuthor(java.util.List<ResourceReferenceDt> theValue) {
1059                myAuthor = theValue;
1060                return this;
1061        }
1062        
1063        
1064
1065        /**
1066         * Adds and returns a new value for <b>author</b> ()
1067         *
1068     * <p>
1069     * <b>Definition:</b>
1070     * Identifies the individual(s) or ogranization who is responsible for the content of the care plan.
1071     * </p> 
1072         */
1073        public ResourceReferenceDt addAuthor() {
1074                ResourceReferenceDt newType = new ResourceReferenceDt();
1075                getAuthor().add(newType);
1076                return newType; 
1077        }
1078  
1079        /**
1080         * Gets the value(s) for <b>modified</b> ().
1081         * creating it if it does
1082         * not exist. Will not return <code>null</code>.
1083         *
1084     * <p>
1085     * <b>Definition:</b>
1086     * Identifies the most recent date on which the plan has been revised.
1087     * </p> 
1088         */
1089        public DateTimeDt getModifiedElement() {  
1090                if (myModified == null) {
1091                        myModified = new DateTimeDt();
1092                }
1093                return myModified;
1094        }
1095
1096        
1097        /**
1098         * Gets the value(s) for <b>modified</b> ().
1099         * creating it if it does
1100         * not exist. This method may return <code>null</code>.
1101         *
1102     * <p>
1103     * <b>Definition:</b>
1104     * Identifies the most recent date on which the plan has been revised.
1105     * </p> 
1106         */
1107        public Date getModified() {  
1108                return getModifiedElement().getValue();
1109        }
1110
1111        /**
1112         * Sets the value(s) for <b>modified</b> ()
1113         *
1114     * <p>
1115     * <b>Definition:</b>
1116     * Identifies the most recent date on which the plan has been revised.
1117     * </p> 
1118         */
1119        public CarePlan setModified(DateTimeDt theValue) {
1120                myModified = theValue;
1121                return this;
1122        }
1123        
1124        
1125
1126        /**
1127         * Sets the value for <b>modified</b> ()
1128         *
1129     * <p>
1130     * <b>Definition:</b>
1131     * Identifies the most recent date on which the plan has been revised.
1132     * </p> 
1133         */
1134        public CarePlan setModifiedWithSecondsPrecision( Date theDate) {
1135                myModified = new DateTimeDt(theDate); 
1136                return this; 
1137        }
1138
1139        /**
1140         * Sets the value for <b>modified</b> ()
1141         *
1142     * <p>
1143     * <b>Definition:</b>
1144     * Identifies the most recent date on which the plan has been revised.
1145     * </p> 
1146         */
1147        public CarePlan setModified( Date theDate,  TemporalPrecisionEnum thePrecision) {
1148                myModified = new DateTimeDt(theDate, thePrecision); 
1149                return this; 
1150        }
1151
1152 
1153        /**
1154         * Gets the value(s) for <b>category</b> ().
1155         * creating it if it does
1156         * not exist. Will not return <code>null</code>.
1157         *
1158     * <p>
1159     * <b>Definition:</b>
1160     * Identifies what \&quot;kind\&quot; of plan this is to support differentiation between multiple co-existing plans; e.g. \&quot;Home health\&quot;, \&quot;psychiatric\&quot;, \&quot;asthma\&quot;, \&quot;disease management\&quot;, \&quot;wellness plan\&quot;, etc.
1161     * </p> 
1162         */
1163        public java.util.List<CodeableConceptDt> getCategory() {  
1164                if (myCategory == null) {
1165                        myCategory = new java.util.ArrayList<CodeableConceptDt>();
1166                }
1167                return myCategory;
1168        }
1169
1170        /**
1171         * Sets the value(s) for <b>category</b> ()
1172         *
1173     * <p>
1174     * <b>Definition:</b>
1175     * Identifies what \&quot;kind\&quot; of plan this is to support differentiation between multiple co-existing plans; e.g. \&quot;Home health\&quot;, \&quot;psychiatric\&quot;, \&quot;asthma\&quot;, \&quot;disease management\&quot;, \&quot;wellness plan\&quot;, etc.
1176     * </p> 
1177         */
1178        public CarePlan setCategory(java.util.List<CodeableConceptDt> theValue) {
1179                myCategory = theValue;
1180                return this;
1181        }
1182        
1183        
1184
1185        /**
1186         * Adds and returns a new value for <b>category</b> ()
1187         *
1188     * <p>
1189     * <b>Definition:</b>
1190     * Identifies what \&quot;kind\&quot; of plan this is to support differentiation between multiple co-existing plans; e.g. \&quot;Home health\&quot;, \&quot;psychiatric\&quot;, \&quot;asthma\&quot;, \&quot;disease management\&quot;, \&quot;wellness plan\&quot;, etc.
1191     * </p> 
1192         */
1193        public CodeableConceptDt addCategory() {
1194                CodeableConceptDt newType = new CodeableConceptDt();
1195                getCategory().add(newType);
1196                return newType; 
1197        }
1198
1199        /**
1200         * Adds a given new value for <b>category</b> ()
1201         *
1202         * <p>
1203         * <b>Definition:</b>
1204         * Identifies what \&quot;kind\&quot; of plan this is to support differentiation between multiple co-existing plans; e.g. \&quot;Home health\&quot;, \&quot;psychiatric\&quot;, \&quot;asthma\&quot;, \&quot;disease management\&quot;, \&quot;wellness plan\&quot;, etc.
1205         * </p>
1206         * @param theValue The category to add (must not be <code>null</code>)
1207         */
1208        public CarePlan addCategory(CodeableConceptDt theValue) {
1209                if (theValue == null) {
1210                        throw new NullPointerException("theValue must not be null");
1211                }
1212                getCategory().add(theValue);
1213                return this;
1214        }
1215
1216        /**
1217         * Gets the first repetition for <b>category</b> (),
1218         * creating it if it does not already exist.
1219         *
1220     * <p>
1221     * <b>Definition:</b>
1222     * Identifies what \&quot;kind\&quot; of plan this is to support differentiation between multiple co-existing plans; e.g. \&quot;Home health\&quot;, \&quot;psychiatric\&quot;, \&quot;asthma\&quot;, \&quot;disease management\&quot;, \&quot;wellness plan\&quot;, etc.
1223     * </p> 
1224         */
1225        public CodeableConceptDt getCategoryFirstRep() {
1226                if (getCategory().isEmpty()) {
1227                        return addCategory();
1228                }
1229                return getCategory().get(0); 
1230        }
1231  
1232        /**
1233         * Gets the value(s) for <b>description</b> ().
1234         * creating it if it does
1235         * not exist. Will not return <code>null</code>.
1236         *
1237     * <p>
1238     * <b>Definition:</b>
1239     * A description of the scope and nature of the plan
1240     * </p> 
1241         */
1242        public StringDt getDescriptionElement() {  
1243                if (myDescription == null) {
1244                        myDescription = new StringDt();
1245                }
1246                return myDescription;
1247        }
1248
1249        
1250        /**
1251         * Gets the value(s) for <b>description</b> ().
1252         * creating it if it does
1253         * not exist. This method may return <code>null</code>.
1254         *
1255     * <p>
1256     * <b>Definition:</b>
1257     * A description of the scope and nature of the plan
1258     * </p> 
1259         */
1260        public String getDescription() {  
1261                return getDescriptionElement().getValue();
1262        }
1263
1264        /**
1265         * Sets the value(s) for <b>description</b> ()
1266         *
1267     * <p>
1268     * <b>Definition:</b>
1269     * A description of the scope and nature of the plan
1270     * </p> 
1271         */
1272        public CarePlan setDescription(StringDt theValue) {
1273                myDescription = theValue;
1274                return this;
1275        }
1276        
1277        
1278
1279        /**
1280         * Sets the value for <b>description</b> ()
1281         *
1282     * <p>
1283     * <b>Definition:</b>
1284     * A description of the scope and nature of the plan
1285     * </p> 
1286         */
1287        public CarePlan setDescription( String theString) {
1288                myDescription = new StringDt(theString); 
1289                return this; 
1290        }
1291
1292 
1293        /**
1294         * Gets the value(s) for <b>addresses</b> ().
1295         * creating it if it does
1296         * not exist. Will not return <code>null</code>.
1297         *
1298     * <p>
1299     * <b>Definition:</b>
1300     * Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.
1301     * </p> 
1302         */
1303        public java.util.List<ResourceReferenceDt> getAddresses() {  
1304                if (myAddresses == null) {
1305                        myAddresses = new java.util.ArrayList<ResourceReferenceDt>();
1306                }
1307                return myAddresses;
1308        }
1309
1310        /**
1311         * Sets the value(s) for <b>addresses</b> ()
1312         *
1313     * <p>
1314     * <b>Definition:</b>
1315     * Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.
1316     * </p> 
1317         */
1318        public CarePlan setAddresses(java.util.List<ResourceReferenceDt> theValue) {
1319                myAddresses = theValue;
1320                return this;
1321        }
1322        
1323        
1324
1325        /**
1326         * Adds and returns a new value for <b>addresses</b> ()
1327         *
1328     * <p>
1329     * <b>Definition:</b>
1330     * Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.
1331     * </p> 
1332         */
1333        public ResourceReferenceDt addAddresses() {
1334                ResourceReferenceDt newType = new ResourceReferenceDt();
1335                getAddresses().add(newType);
1336                return newType; 
1337        }
1338  
1339        /**
1340         * Gets the value(s) for <b>support</b> ().
1341         * creating it if it does
1342         * not exist. Will not return <code>null</code>.
1343         *
1344     * <p>
1345     * <b>Definition:</b>
1346     * Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include co-morbidities, recent procedures, limitations, recent assessments, etc.
1347     * </p> 
1348         */
1349        public java.util.List<ResourceReferenceDt> getSupport() {  
1350                if (mySupport == null) {
1351                        mySupport = new java.util.ArrayList<ResourceReferenceDt>();
1352                }
1353                return mySupport;
1354        }
1355
1356        /**
1357         * Sets the value(s) for <b>support</b> ()
1358         *
1359     * <p>
1360     * <b>Definition:</b>
1361     * Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include co-morbidities, recent procedures, limitations, recent assessments, etc.
1362     * </p> 
1363         */
1364        public CarePlan setSupport(java.util.List<ResourceReferenceDt> theValue) {
1365                mySupport = theValue;
1366                return this;
1367        }
1368        
1369        
1370
1371        /**
1372         * Adds and returns a new value for <b>support</b> ()
1373         *
1374     * <p>
1375     * <b>Definition:</b>
1376     * Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include co-morbidities, recent procedures, limitations, recent assessments, etc.
1377     * </p> 
1378         */
1379        public ResourceReferenceDt addSupport() {
1380                ResourceReferenceDt newType = new ResourceReferenceDt();
1381                getSupport().add(newType);
1382                return newType; 
1383        }
1384  
1385        /**
1386         * Gets the value(s) for <b>relatedPlan</b> ().
1387         * creating it if it does
1388         * not exist. Will not return <code>null</code>.
1389         *
1390     * <p>
1391     * <b>Definition:</b>
1392     * Identifies CarePlans with some sort of formal relationship to the current plan.
1393     * </p> 
1394         */
1395        public java.util.List<RelatedPlan> getRelatedPlan() {  
1396                if (myRelatedPlan == null) {
1397                        myRelatedPlan = new java.util.ArrayList<RelatedPlan>();
1398                }
1399                return myRelatedPlan;
1400        }
1401
1402        /**
1403         * Sets the value(s) for <b>relatedPlan</b> ()
1404         *
1405     * <p>
1406     * <b>Definition:</b>
1407     * Identifies CarePlans with some sort of formal relationship to the current plan.
1408     * </p> 
1409         */
1410        public CarePlan setRelatedPlan(java.util.List<RelatedPlan> theValue) {
1411                myRelatedPlan = theValue;
1412                return this;
1413        }
1414        
1415        
1416
1417        /**
1418         * Adds and returns a new value for <b>relatedPlan</b> ()
1419         *
1420     * <p>
1421     * <b>Definition:</b>
1422     * Identifies CarePlans with some sort of formal relationship to the current plan.
1423     * </p> 
1424         */
1425        public RelatedPlan addRelatedPlan() {
1426                RelatedPlan newType = new RelatedPlan();
1427                getRelatedPlan().add(newType);
1428                return newType; 
1429        }
1430
1431        /**
1432         * Adds a given new value for <b>relatedPlan</b> ()
1433         *
1434         * <p>
1435         * <b>Definition:</b>
1436         * Identifies CarePlans with some sort of formal relationship to the current plan.
1437         * </p>
1438         * @param theValue The relatedPlan to add (must not be <code>null</code>)
1439         */
1440        public CarePlan addRelatedPlan(RelatedPlan theValue) {
1441                if (theValue == null) {
1442                        throw new NullPointerException("theValue must not be null");
1443                }
1444                getRelatedPlan().add(theValue);
1445                return this;
1446        }
1447
1448        /**
1449         * Gets the first repetition for <b>relatedPlan</b> (),
1450         * creating it if it does not already exist.
1451         *
1452     * <p>
1453     * <b>Definition:</b>
1454     * Identifies CarePlans with some sort of formal relationship to the current plan.
1455     * </p> 
1456         */
1457        public RelatedPlan getRelatedPlanFirstRep() {
1458                if (getRelatedPlan().isEmpty()) {
1459                        return addRelatedPlan();
1460                }
1461                return getRelatedPlan().get(0); 
1462        }
1463  
1464        /**
1465         * Gets the value(s) for <b>participant</b> ().
1466         * creating it if it does
1467         * not exist. Will not return <code>null</code>.
1468         *
1469     * <p>
1470     * <b>Definition:</b>
1471     * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.
1472     * </p> 
1473         */
1474        public java.util.List<Participant> getParticipant() {  
1475                if (myParticipant == null) {
1476                        myParticipant = new java.util.ArrayList<Participant>();
1477                }
1478                return myParticipant;
1479        }
1480
1481        /**
1482         * Sets the value(s) for <b>participant</b> ()
1483         *
1484     * <p>
1485     * <b>Definition:</b>
1486     * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.
1487     * </p> 
1488         */
1489        public CarePlan setParticipant(java.util.List<Participant> theValue) {
1490                myParticipant = theValue;
1491                return this;
1492        }
1493        
1494        
1495
1496        /**
1497         * Adds and returns a new value for <b>participant</b> ()
1498         *
1499     * <p>
1500     * <b>Definition:</b>
1501     * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.
1502     * </p> 
1503         */
1504        public Participant addParticipant() {
1505                Participant newType = new Participant();
1506                getParticipant().add(newType);
1507                return newType; 
1508        }
1509
1510        /**
1511         * Adds a given new value for <b>participant</b> ()
1512         *
1513         * <p>
1514         * <b>Definition:</b>
1515         * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.
1516         * </p>
1517         * @param theValue The participant to add (must not be <code>null</code>)
1518         */
1519        public CarePlan addParticipant(Participant theValue) {
1520                if (theValue == null) {
1521                        throw new NullPointerException("theValue must not be null");
1522                }
1523                getParticipant().add(theValue);
1524                return this;
1525        }
1526
1527        /**
1528         * Gets the first repetition for <b>participant</b> (),
1529         * creating it if it does not already exist.
1530         *
1531     * <p>
1532     * <b>Definition:</b>
1533     * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.
1534     * </p> 
1535         */
1536        public Participant getParticipantFirstRep() {
1537                if (getParticipant().isEmpty()) {
1538                        return addParticipant();
1539                }
1540                return getParticipant().get(0); 
1541        }
1542  
1543        /**
1544         * Gets the value(s) for <b>goal</b> ().
1545         * creating it if it does
1546         * not exist. Will not return <code>null</code>.
1547         *
1548     * <p>
1549     * <b>Definition:</b>
1550     * Describes the intended objective(s) of carrying out the care plan.
1551     * </p> 
1552         */
1553        public java.util.List<ResourceReferenceDt> getGoal() {  
1554                if (myGoal == null) {
1555                        myGoal = new java.util.ArrayList<ResourceReferenceDt>();
1556                }
1557                return myGoal;
1558        }
1559
1560        /**
1561         * Sets the value(s) for <b>goal</b> ()
1562         *
1563     * <p>
1564     * <b>Definition:</b>
1565     * Describes the intended objective(s) of carrying out the care plan.
1566     * </p> 
1567         */
1568        public CarePlan setGoal(java.util.List<ResourceReferenceDt> theValue) {
1569                myGoal = theValue;
1570                return this;
1571        }
1572        
1573        
1574
1575        /**
1576         * Adds and returns a new value for <b>goal</b> ()
1577         *
1578     * <p>
1579     * <b>Definition:</b>
1580     * Describes the intended objective(s) of carrying out the care plan.
1581     * </p> 
1582         */
1583        public ResourceReferenceDt addGoal() {
1584                ResourceReferenceDt newType = new ResourceReferenceDt();
1585                getGoal().add(newType);
1586                return newType; 
1587        }
1588  
1589        /**
1590         * Gets the value(s) for <b>activity</b> ().
1591         * creating it if it does
1592         * not exist. Will not return <code>null</code>.
1593         *
1594     * <p>
1595     * <b>Definition:</b>
1596     * Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.
1597     * </p> 
1598         */
1599        public java.util.List<Activity> getActivity() {  
1600                if (myActivity == null) {
1601                        myActivity = new java.util.ArrayList<Activity>();
1602                }
1603                return myActivity;
1604        }
1605
1606        /**
1607         * Sets the value(s) for <b>activity</b> ()
1608         *
1609     * <p>
1610     * <b>Definition:</b>
1611     * Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.
1612     * </p> 
1613         */
1614        public CarePlan setActivity(java.util.List<Activity> theValue) {
1615                myActivity = theValue;
1616                return this;
1617        }
1618        
1619        
1620
1621        /**
1622         * Adds and returns a new value for <b>activity</b> ()
1623         *
1624     * <p>
1625     * <b>Definition:</b>
1626     * Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.
1627     * </p> 
1628         */
1629        public Activity addActivity() {
1630                Activity newType = new Activity();
1631                getActivity().add(newType);
1632                return newType; 
1633        }
1634
1635        /**
1636         * Adds a given new value for <b>activity</b> ()
1637         *
1638         * <p>
1639         * <b>Definition:</b>
1640         * Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.
1641         * </p>
1642         * @param theValue The activity to add (must not be <code>null</code>)
1643         */
1644        public CarePlan addActivity(Activity theValue) {
1645                if (theValue == null) {
1646                        throw new NullPointerException("theValue must not be null");
1647                }
1648                getActivity().add(theValue);
1649                return this;
1650        }
1651
1652        /**
1653         * Gets the first repetition for <b>activity</b> (),
1654         * creating it if it does not already exist.
1655         *
1656     * <p>
1657     * <b>Definition:</b>
1658     * Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.
1659     * </p> 
1660         */
1661        public Activity getActivityFirstRep() {
1662                if (getActivity().isEmpty()) {
1663                        return addActivity();
1664                }
1665                return getActivity().get(0); 
1666        }
1667  
1668        /**
1669         * Gets the value(s) for <b>note</b> ().
1670         * creating it if it does
1671         * not exist. Will not return <code>null</code>.
1672         *
1673     * <p>
1674     * <b>Definition:</b>
1675     * General notes about the care plan not covered elsewhere
1676     * </p> 
1677         */
1678        public AnnotationDt getNote() {  
1679                if (myNote == null) {
1680                        myNote = new AnnotationDt();
1681                }
1682                return myNote;
1683        }
1684
1685        /**
1686         * Sets the value(s) for <b>note</b> ()
1687         *
1688     * <p>
1689     * <b>Definition:</b>
1690     * General notes about the care plan not covered elsewhere
1691     * </p> 
1692         */
1693        public CarePlan setNote(AnnotationDt theValue) {
1694                myNote = theValue;
1695                return this;
1696        }
1697        
1698        
1699
1700  
1701        /**
1702         * Block class for child element: <b>CarePlan.relatedPlan</b> ()
1703         *
1704     * <p>
1705     * <b>Definition:</b>
1706     * Identifies CarePlans with some sort of formal relationship to the current plan.
1707     * </p> 
1708         */
1709        @Block()        
1710        public static class RelatedPlan 
1711            extends  BaseIdentifiableElement  
1712            implements IResourceBlock {
1713        
1714        @Child(name="code", type=CodeDt.class, order=0, min=0, max=1, summary=false, modifier=false)    
1715        @Description(
1716                shortDefinition="",
1717                formalDefinition="Identifies the type of relationship this plan has to the target plan."
1718        )
1719        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/care-plan-relationship")
1720        private BoundCodeDt<CarePlanRelationshipEnum> myCode;
1721        
1722        @Child(name="plan", order=1, min=1, max=1, summary=false, modifier=false, type={
1723                ca.uhn.fhir.model.dstu2.resource.CarePlan.class
1724        })
1725        @Description(
1726                shortDefinition="",
1727                formalDefinition="A reference to the plan to which a relationship is asserted."
1728        )
1729        private ResourceReferenceDt myPlan;
1730        
1731
1732        @Override
1733        public boolean isEmpty() {
1734                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myCode,  myPlan);
1735        }
1736        
1737        @Override
1738        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1739                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myPlan);
1740        }
1741
1742        /**
1743         * Gets the value(s) for <b>code</b> ().
1744         * creating it if it does
1745         * not exist. Will not return <code>null</code>.
1746         *
1747     * <p>
1748     * <b>Definition:</b>
1749     * Identifies the type of relationship this plan has to the target plan.
1750     * </p> 
1751         */
1752        public BoundCodeDt<CarePlanRelationshipEnum> getCodeElement() {  
1753                if (myCode == null) {
1754                        myCode = new BoundCodeDt<CarePlanRelationshipEnum>(CarePlanRelationshipEnum.VALUESET_BINDER);
1755                }
1756                return myCode;
1757        }
1758
1759        
1760        /**
1761         * Gets the value(s) for <b>code</b> ().
1762         * creating it if it does
1763         * not exist. This method may return <code>null</code>.
1764         *
1765     * <p>
1766     * <b>Definition:</b>
1767     * Identifies the type of relationship this plan has to the target plan.
1768     * </p> 
1769         */
1770        public String getCode() {  
1771                return getCodeElement().getValue();
1772        }
1773
1774        /**
1775         * Sets the value(s) for <b>code</b> ()
1776         *
1777     * <p>
1778     * <b>Definition:</b>
1779     * Identifies the type of relationship this plan has to the target plan.
1780     * </p> 
1781         */
1782        public RelatedPlan setCode(BoundCodeDt<CarePlanRelationshipEnum> theValue) {
1783                myCode = theValue;
1784                return this;
1785        }
1786        
1787        
1788
1789        /**
1790         * Sets the value(s) for <b>code</b> ()
1791         *
1792     * <p>
1793     * <b>Definition:</b>
1794     * Identifies the type of relationship this plan has to the target plan.
1795     * </p> 
1796         */
1797        public RelatedPlan setCode(CarePlanRelationshipEnum theValue) {
1798                setCode(new BoundCodeDt<CarePlanRelationshipEnum>(CarePlanRelationshipEnum.VALUESET_BINDER, theValue));
1799                
1800/*
1801                getCodeElement().setValueAsEnum(theValue);
1802*/
1803                return this;
1804        }
1805
1806  
1807        /**
1808         * Gets the value(s) for <b>plan</b> ().
1809         * creating it if it does
1810         * not exist. Will not return <code>null</code>.
1811         *
1812     * <p>
1813     * <b>Definition:</b>
1814     * A reference to the plan to which a relationship is asserted.
1815     * </p> 
1816         */
1817        public ResourceReferenceDt getPlan() {  
1818                if (myPlan == null) {
1819                        myPlan = new ResourceReferenceDt();
1820                }
1821                return myPlan;
1822        }
1823
1824        /**
1825         * Sets the value(s) for <b>plan</b> ()
1826         *
1827     * <p>
1828     * <b>Definition:</b>
1829     * A reference to the plan to which a relationship is asserted.
1830     * </p> 
1831         */
1832        public RelatedPlan setPlan(ResourceReferenceDt theValue) {
1833                myPlan = theValue;
1834                return this;
1835        }
1836        
1837        
1838
1839  
1840
1841
1842        }
1843
1844
1845        /**
1846         * Block class for child element: <b>CarePlan.participant</b> ()
1847         *
1848     * <p>
1849     * <b>Definition:</b>
1850     * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.
1851     * </p> 
1852         */
1853        @Block()        
1854        public static class Participant 
1855            extends  BaseIdentifiableElement  
1856            implements IResourceBlock {
1857        
1858        @Child(name="role", type=CodeableConceptDt.class, order=0, min=0, max=1, summary=false, modifier=false) 
1859        @Description(
1860                shortDefinition="",
1861                formalDefinition="Indicates specific responsibility of an individual within the care plan; e.g. \"Primary physician\", \"Team coordinator\", \"Caregiver\", etc."
1862        )
1863        private CodeableConceptDt myRole;
1864        
1865        @Child(name="member", order=1, min=0, max=1, summary=false, modifier=false, type={
1866                ca.uhn.fhir.model.dstu2.resource.Practitioner.class, 
1867                ca.uhn.fhir.model.dstu2.resource.RelatedPerson.class, 
1868                ca.uhn.fhir.model.dstu2.resource.Patient.class, 
1869                ca.uhn.fhir.model.dstu2.resource.Organization.class
1870        })
1871        @Description(
1872                shortDefinition="",
1873                formalDefinition="The specific person or organization who is participating/expected to participate in the care plan."
1874        )
1875        private ResourceReferenceDt myMember;
1876        
1877
1878        @Override
1879        public boolean isEmpty() {
1880                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myRole,  myMember);
1881        }
1882        
1883        @Override
1884        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1885                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRole, myMember);
1886        }
1887
1888        /**
1889         * Gets the value(s) for <b>role</b> ().
1890         * creating it if it does
1891         * not exist. Will not return <code>null</code>.
1892         *
1893     * <p>
1894     * <b>Definition:</b>
1895     * Indicates specific responsibility of an individual within the care plan; e.g. \&quot;Primary physician\&quot;, \&quot;Team coordinator\&quot;, \&quot;Caregiver\&quot;, etc.
1896     * </p> 
1897         */
1898        public CodeableConceptDt getRole() {  
1899                if (myRole == null) {
1900                        myRole = new CodeableConceptDt();
1901                }
1902                return myRole;
1903        }
1904
1905        /**
1906         * Sets the value(s) for <b>role</b> ()
1907         *
1908     * <p>
1909     * <b>Definition:</b>
1910     * Indicates specific responsibility of an individual within the care plan; e.g. \&quot;Primary physician\&quot;, \&quot;Team coordinator\&quot;, \&quot;Caregiver\&quot;, etc.
1911     * </p> 
1912         */
1913        public Participant setRole(CodeableConceptDt theValue) {
1914                myRole = theValue;
1915                return this;
1916        }
1917        
1918        
1919
1920  
1921        /**
1922         * Gets the value(s) for <b>member</b> ().
1923         * creating it if it does
1924         * not exist. Will not return <code>null</code>.
1925         *
1926     * <p>
1927     * <b>Definition:</b>
1928     * The specific person or organization who is participating/expected to participate in the care plan.
1929     * </p> 
1930         */
1931        public ResourceReferenceDt getMember() {  
1932                if (myMember == null) {
1933                        myMember = new ResourceReferenceDt();
1934                }
1935                return myMember;
1936        }
1937
1938        /**
1939         * Sets the value(s) for <b>member</b> ()
1940         *
1941     * <p>
1942     * <b>Definition:</b>
1943     * The specific person or organization who is participating/expected to participate in the care plan.
1944     * </p> 
1945         */
1946        public Participant setMember(ResourceReferenceDt theValue) {
1947                myMember = theValue;
1948                return this;
1949        }
1950        
1951        
1952
1953  
1954
1955
1956        }
1957
1958
1959        /**
1960         * Block class for child element: <b>CarePlan.activity</b> ()
1961         *
1962     * <p>
1963     * <b>Definition:</b>
1964     * Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.
1965     * </p> 
1966         */
1967        @Block()        
1968        public static class Activity 
1969            extends  BaseIdentifiableElement  
1970            implements IResourceBlock {
1971        
1972        @Child(name="actionResulting", order=0, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
1973                IResource.class
1974        })
1975        @Description(
1976                shortDefinition="",
1977                formalDefinition="Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc."
1978        )
1979        private java.util.List<ResourceReferenceDt> myActionResulting;
1980        
1981        @Child(name="progress", type=AnnotationDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)        
1982        @Description(
1983                shortDefinition="",
1984                formalDefinition="Notes about the adherence/status/progress of the activity"
1985        )
1986        private java.util.List<AnnotationDt> myProgress;
1987        
1988        @Child(name="reference", order=2, min=0, max=1, summary=false, modifier=false, type={
1989                ca.uhn.fhir.model.dstu2.resource.Appointment.class, 
1990                ca.uhn.fhir.model.dstu2.resource.CommunicationRequest.class, 
1991                ca.uhn.fhir.model.dstu2.resource.DeviceUseRequest.class, 
1992                ca.uhn.fhir.model.dstu2.resource.DiagnosticOrder.class, 
1993                ca.uhn.fhir.model.dstu2.resource.MedicationOrder.class, 
1994                ca.uhn.fhir.model.dstu2.resource.NutritionOrder.class, 
1995                ca.uhn.fhir.model.dstu2.resource.Order.class, 
1996                ca.uhn.fhir.model.dstu2.resource.ProcedureRequest.class, 
1997                ca.uhn.fhir.model.dstu2.resource.ProcessRequest.class, 
1998                ca.uhn.fhir.model.dstu2.resource.ReferralRequest.class, 
1999                ca.uhn.fhir.model.dstu2.resource.SupplyRequest.class, 
2000                ca.uhn.fhir.model.dstu2.resource.VisionPrescription.class
2001        })
2002        @Description(
2003                shortDefinition="",
2004                formalDefinition="The details of the proposed activity represented in a specific resource"
2005        )
2006        private ResourceReferenceDt myReference;
2007        
2008        @Child(name="detail", order=3, min=0, max=1, summary=false, modifier=false)     
2009        @Description(
2010                shortDefinition="",
2011                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."
2012        )
2013        private ActivityDetail myDetail;
2014        
2015
2016        @Override
2017        public boolean isEmpty() {
2018                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myActionResulting,  myProgress,  myReference,  myDetail);
2019        }
2020        
2021        @Override
2022        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2023                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myActionResulting, myProgress, myReference, myDetail);
2024        }
2025
2026        /**
2027         * Gets the value(s) for <b>actionResulting</b> ().
2028         * creating it if it does
2029         * not exist. Will not return <code>null</code>.
2030         *
2031     * <p>
2032     * <b>Definition:</b>
2033     * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.
2034     * </p> 
2035         */
2036        public java.util.List<ResourceReferenceDt> getActionResulting() {  
2037                if (myActionResulting == null) {
2038                        myActionResulting = new java.util.ArrayList<ResourceReferenceDt>();
2039                }
2040                return myActionResulting;
2041        }
2042
2043        /**
2044         * Sets the value(s) for <b>actionResulting</b> ()
2045         *
2046     * <p>
2047     * <b>Definition:</b>
2048     * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.
2049     * </p> 
2050         */
2051        public Activity setActionResulting(java.util.List<ResourceReferenceDt> theValue) {
2052                myActionResulting = theValue;
2053                return this;
2054        }
2055        
2056        
2057
2058        /**
2059         * Adds and returns a new value for <b>actionResulting</b> ()
2060         *
2061     * <p>
2062     * <b>Definition:</b>
2063     * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.
2064     * </p> 
2065         */
2066        public ResourceReferenceDt addActionResulting() {
2067                ResourceReferenceDt newType = new ResourceReferenceDt();
2068                getActionResulting().add(newType);
2069                return newType; 
2070        }
2071  
2072        /**
2073         * Gets the value(s) for <b>progress</b> ().
2074         * creating it if it does
2075         * not exist. Will not return <code>null</code>.
2076         *
2077     * <p>
2078     * <b>Definition:</b>
2079     * Notes about the adherence/status/progress of the activity
2080     * </p> 
2081         */
2082        public java.util.List<AnnotationDt> getProgress() {  
2083                if (myProgress == null) {
2084                        myProgress = new java.util.ArrayList<AnnotationDt>();
2085                }
2086                return myProgress;
2087        }
2088
2089        /**
2090         * Sets the value(s) for <b>progress</b> ()
2091         *
2092     * <p>
2093     * <b>Definition:</b>
2094     * Notes about the adherence/status/progress of the activity
2095     * </p> 
2096         */
2097        public Activity setProgress(java.util.List<AnnotationDt> theValue) {
2098                myProgress = theValue;
2099                return this;
2100        }
2101        
2102        
2103
2104        /**
2105         * Adds and returns a new value for <b>progress</b> ()
2106         *
2107     * <p>
2108     * <b>Definition:</b>
2109     * Notes about the adherence/status/progress of the activity
2110     * </p> 
2111         */
2112        public AnnotationDt addProgress() {
2113                AnnotationDt newType = new AnnotationDt();
2114                getProgress().add(newType);
2115                return newType; 
2116        }
2117
2118        /**
2119         * Adds a given new value for <b>progress</b> ()
2120         *
2121         * <p>
2122         * <b>Definition:</b>
2123         * Notes about the adherence/status/progress of the activity
2124         * </p>
2125         * @param theValue The progress to add (must not be <code>null</code>)
2126         */
2127        public Activity addProgress(AnnotationDt theValue) {
2128                if (theValue == null) {
2129                        throw new NullPointerException("theValue must not be null");
2130                }
2131                getProgress().add(theValue);
2132                return this;
2133        }
2134
2135        /**
2136         * Gets the first repetition for <b>progress</b> (),
2137         * creating it if it does not already exist.
2138         *
2139     * <p>
2140     * <b>Definition:</b>
2141     * Notes about the adherence/status/progress of the activity
2142     * </p> 
2143         */
2144        public AnnotationDt getProgressFirstRep() {
2145                if (getProgress().isEmpty()) {
2146                        return addProgress();
2147                }
2148                return getProgress().get(0); 
2149        }
2150  
2151        /**
2152         * Gets the value(s) for <b>reference</b> ().
2153         * creating it if it does
2154         * not exist. Will not return <code>null</code>.
2155         *
2156     * <p>
2157     * <b>Definition:</b>
2158     * The details of the proposed activity represented in a specific resource
2159     * </p> 
2160         */
2161        public ResourceReferenceDt getReference() {  
2162                if (myReference == null) {
2163                        myReference = new ResourceReferenceDt();
2164                }
2165                return myReference;
2166        }
2167
2168        /**
2169         * Sets the value(s) for <b>reference</b> ()
2170         *
2171     * <p>
2172     * <b>Definition:</b>
2173     * The details of the proposed activity represented in a specific resource
2174     * </p> 
2175         */
2176        public Activity setReference(ResourceReferenceDt theValue) {
2177                myReference = theValue;
2178                return this;
2179        }
2180        
2181        
2182
2183  
2184        /**
2185         * Gets the value(s) for <b>detail</b> ().
2186         * creating it if it does
2187         * not exist. Will not return <code>null</code>.
2188         *
2189     * <p>
2190     * <b>Definition:</b>
2191     * 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.
2192     * </p> 
2193         */
2194        public ActivityDetail getDetail() {  
2195                if (myDetail == null) {
2196                        myDetail = new ActivityDetail();
2197                }
2198                return myDetail;
2199        }
2200
2201        /**
2202         * Sets the value(s) for <b>detail</b> ()
2203         *
2204     * <p>
2205     * <b>Definition:</b>
2206     * 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.
2207     * </p> 
2208         */
2209        public Activity setDetail(ActivityDetail theValue) {
2210                myDetail = theValue;
2211                return this;
2212        }
2213        
2214        
2215
2216  
2217
2218
2219        }
2220
2221        /**
2222         * Block class for child element: <b>CarePlan.activity.detail</b> ()
2223         *
2224     * <p>
2225     * <b>Definition:</b>
2226     * 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.
2227     * </p> 
2228         */
2229        @Block()        
2230        public static class ActivityDetail 
2231            extends  BaseIdentifiableElement  
2232            implements IResourceBlock {
2233        
2234        @Child(name="category", type=CodeableConceptDt.class, order=0, min=0, max=1, summary=false, modifier=false)     
2235        @Description(
2236                shortDefinition="",
2237                formalDefinition="High-level categorization of the type of activity in a care plan."
2238        )
2239        private CodeableConceptDt myCategory;
2240        
2241        @Child(name="code", type=CodeableConceptDt.class, order=1, min=0, max=1, summary=false, modifier=false) 
2242        @Description(
2243                shortDefinition="",
2244                formalDefinition="Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter."
2245        )
2246        private CodeableConceptDt myCode;
2247        
2248        @Child(name="reasonCode", type=CodeableConceptDt.class, order=2, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false) 
2249        @Description(
2250                shortDefinition="",
2251                formalDefinition="Provides the rationale that drove the inclusion of this particular activity as part of the plan."
2252        )
2253        private java.util.List<CodeableConceptDt> myReasonCode;
2254        
2255        @Child(name="reasonReference", order=3, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
2256                ca.uhn.fhir.model.dstu2.resource.Condition.class
2257        })
2258        @Description(
2259                shortDefinition="",
2260                formalDefinition="Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan."
2261        )
2262        private java.util.List<ResourceReferenceDt> myReasonReference;
2263        
2264        @Child(name="goal", order=4, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
2265                ca.uhn.fhir.model.dstu2.resource.Goal.class
2266        })
2267        @Description(
2268                shortDefinition="",
2269                formalDefinition="Internal reference that identifies the goals that this activity is intended to contribute towards meeting"
2270        )
2271        private java.util.List<ResourceReferenceDt> myGoal;
2272        
2273        @Child(name="status", type=CodeDt.class, order=5, min=0, max=1, summary=false, modifier=true)   
2274        @Description(
2275                shortDefinition="",
2276                formalDefinition="Identifies what progress is being made for the specific activity."
2277        )
2278        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/care-plan-activity-status")
2279        private BoundCodeDt<CarePlanActivityStatusEnum> myStatus;
2280        
2281        @Child(name="statusReason", type=CodeableConceptDt.class, order=6, min=0, max=1, summary=false, modifier=false) 
2282        @Description(
2283                shortDefinition="",
2284                formalDefinition="Provides reason why the activity isn't yet started, is on hold, was cancelled, etc."
2285        )
2286        private CodeableConceptDt myStatusReason;
2287        
2288        @Child(name="prohibited", type=BooleanDt.class, order=7, min=1, max=1, summary=false, modifier=true)    
2289        @Description(
2290                shortDefinition="",
2291                formalDefinition="If true, indicates that the described activity is one that must NOT be engaged in when following the plan."
2292        )
2293        private BooleanDt myProhibited;
2294        
2295        @Child(name="scheduled", order=8, min=0, max=1, summary=false, modifier=false, type={
2296                TimingDt.class, 
2297                PeriodDt.class, 
2298                StringDt.class
2299        })
2300        @Description(
2301                shortDefinition="",
2302                formalDefinition="The period, timing or frequency upon which the described activity is to occur."
2303        )
2304        private IDatatype myScheduled;
2305        
2306        @Child(name="location", order=9, min=0, max=1, summary=false, modifier=false, type={
2307                ca.uhn.fhir.model.dstu2.resource.Location.class
2308        })
2309        @Description(
2310                shortDefinition="",
2311                formalDefinition="Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc."
2312        )
2313        private ResourceReferenceDt myLocation;
2314        
2315        @Child(name="performer", order=10, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
2316                ca.uhn.fhir.model.dstu2.resource.Practitioner.class, 
2317                ca.uhn.fhir.model.dstu2.resource.Organization.class, 
2318                ca.uhn.fhir.model.dstu2.resource.RelatedPerson.class, 
2319                ca.uhn.fhir.model.dstu2.resource.Patient.class
2320        })
2321        @Description(
2322                shortDefinition="",
2323                formalDefinition="Identifies who's expected to be involved in the activity."
2324        )
2325        private java.util.List<ResourceReferenceDt> myPerformer;
2326        
2327        @Child(name="product", order=11, min=0, max=1, summary=false, modifier=false, type={
2328                CodeableConceptDt.class, 
2329                Medication.class, 
2330                Substance.class
2331        })
2332        @Description(
2333                shortDefinition="",
2334                formalDefinition="Identifies the food, drug or other product to be consumed or supplied in the activity."
2335        )
2336        private IDatatype myProduct;
2337        
2338        @Child(name="dailyAmount", type=SimpleQuantityDt.class, order=12, min=0, max=1, summary=false, modifier=false)  
2339        @Description(
2340                shortDefinition="",
2341                formalDefinition="Identifies the quantity expected to be consumed in a given day."
2342        )
2343        private SimpleQuantityDt myDailyAmount;
2344        
2345        @Child(name="quantity", type=SimpleQuantityDt.class, order=13, min=0, max=1, summary=false, modifier=false)     
2346        @Description(
2347                shortDefinition="",
2348                formalDefinition="Identifies the quantity expected to be supplied, administered or consumed by the subject"
2349        )
2350        private SimpleQuantityDt myQuantity;
2351        
2352        @Child(name="description", type=StringDt.class, order=14, min=0, max=1, summary=false, modifier=false)  
2353        @Description(
2354                shortDefinition="",
2355                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."
2356        )
2357        private StringDt myDescription;
2358        
2359
2360        @Override
2361        public boolean isEmpty() {
2362                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myCategory,  myCode,  myReasonCode,  myReasonReference,  myGoal,  myStatus,  myStatusReason,  myProhibited,  myScheduled,  myLocation,  myPerformer,  myProduct,  myDailyAmount,  myQuantity,  myDescription);
2363        }
2364        
2365        @Override
2366        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2367                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCategory, myCode, myReasonCode, myReasonReference, myGoal, myStatus, myStatusReason, myProhibited, myScheduled, myLocation, myPerformer, myProduct, myDailyAmount, myQuantity, myDescription);
2368        }
2369
2370        /**
2371         * Gets the value(s) for <b>category</b> ().
2372         * creating it if it does
2373         * not exist. Will not return <code>null</code>.
2374         *
2375     * <p>
2376     * <b>Definition:</b>
2377     * High-level categorization of the type of activity in a care plan.
2378     * </p> 
2379         */
2380        public CodeableConceptDt getCategory() {  
2381                if (myCategory == null) {
2382                        myCategory = new CodeableConceptDt();
2383                }
2384                return myCategory;
2385        }
2386
2387        /**
2388         * Sets the value(s) for <b>category</b> ()
2389         *
2390     * <p>
2391     * <b>Definition:</b>
2392     * High-level categorization of the type of activity in a care plan.
2393     * </p> 
2394         */
2395        public ActivityDetail setCategory(CodeableConceptDt theValue) {
2396                myCategory = theValue;
2397                return this;
2398        }
2399        
2400        
2401
2402  
2403        /**
2404         * Gets the value(s) for <b>code</b> ().
2405         * creating it if it does
2406         * not exist. Will not return <code>null</code>.
2407         *
2408     * <p>
2409     * <b>Definition:</b>
2410     * Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.
2411     * </p> 
2412         */
2413        public CodeableConceptDt getCode() {  
2414                if (myCode == null) {
2415                        myCode = new CodeableConceptDt();
2416                }
2417                return myCode;
2418        }
2419
2420        /**
2421         * Sets the value(s) for <b>code</b> ()
2422         *
2423     * <p>
2424     * <b>Definition:</b>
2425     * Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.
2426     * </p> 
2427         */
2428        public ActivityDetail setCode(CodeableConceptDt theValue) {
2429                myCode = theValue;
2430                return this;
2431        }
2432        
2433        
2434
2435  
2436        /**
2437         * Gets the value(s) for <b>reasonCode</b> ().
2438         * creating it if it does
2439         * not exist. Will not return <code>null</code>.
2440         *
2441     * <p>
2442     * <b>Definition:</b>
2443     * Provides the rationale that drove the inclusion of this particular activity as part of the plan.
2444     * </p> 
2445         */
2446        public java.util.List<CodeableConceptDt> getReasonCode() {  
2447                if (myReasonCode == null) {
2448                        myReasonCode = new java.util.ArrayList<CodeableConceptDt>();
2449                }
2450                return myReasonCode;
2451        }
2452
2453        /**
2454         * Sets the value(s) for <b>reasonCode</b> ()
2455         *
2456     * <p>
2457     * <b>Definition:</b>
2458     * Provides the rationale that drove the inclusion of this particular activity as part of the plan.
2459     * </p> 
2460         */
2461        public ActivityDetail setReasonCode(java.util.List<CodeableConceptDt> theValue) {
2462                myReasonCode = theValue;
2463                return this;
2464        }
2465        
2466        
2467
2468        /**
2469         * Adds and returns a new value for <b>reasonCode</b> ()
2470         *
2471     * <p>
2472     * <b>Definition:</b>
2473     * Provides the rationale that drove the inclusion of this particular activity as part of the plan.
2474     * </p> 
2475         */
2476        public CodeableConceptDt addReasonCode() {
2477                CodeableConceptDt newType = new CodeableConceptDt();
2478                getReasonCode().add(newType);
2479                return newType; 
2480        }
2481
2482        /**
2483         * Adds a given new value for <b>reasonCode</b> ()
2484         *
2485         * <p>
2486         * <b>Definition:</b>
2487         * Provides the rationale that drove the inclusion of this particular activity as part of the plan.
2488         * </p>
2489         * @param theValue The reasonCode to add (must not be <code>null</code>)
2490         */
2491        public ActivityDetail addReasonCode(CodeableConceptDt theValue) {
2492                if (theValue == null) {
2493                        throw new NullPointerException("theValue must not be null");
2494                }
2495                getReasonCode().add(theValue);
2496                return this;
2497        }
2498
2499        /**
2500         * Gets the first repetition for <b>reasonCode</b> (),
2501         * creating it if it does not already exist.
2502         *
2503     * <p>
2504     * <b>Definition:</b>
2505     * Provides the rationale that drove the inclusion of this particular activity as part of the plan.
2506     * </p> 
2507         */
2508        public CodeableConceptDt getReasonCodeFirstRep() {
2509                if (getReasonCode().isEmpty()) {
2510                        return addReasonCode();
2511                }
2512                return getReasonCode().get(0); 
2513        }
2514  
2515        /**
2516         * Gets the value(s) for <b>reasonReference</b> ().
2517         * creating it if it does
2518         * not exist. Will not return <code>null</code>.
2519         *
2520     * <p>
2521     * <b>Definition:</b>
2522     * Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.
2523     * </p> 
2524         */
2525        public java.util.List<ResourceReferenceDt> getReasonReference() {  
2526                if (myReasonReference == null) {
2527                        myReasonReference = new java.util.ArrayList<ResourceReferenceDt>();
2528                }
2529                return myReasonReference;
2530        }
2531
2532        /**
2533         * Sets the value(s) for <b>reasonReference</b> ()
2534         *
2535     * <p>
2536     * <b>Definition:</b>
2537     * Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.
2538     * </p> 
2539         */
2540        public ActivityDetail setReasonReference(java.util.List<ResourceReferenceDt> theValue) {
2541                myReasonReference = theValue;
2542                return this;
2543        }
2544        
2545        
2546
2547        /**
2548         * Adds and returns a new value for <b>reasonReference</b> ()
2549         *
2550     * <p>
2551     * <b>Definition:</b>
2552     * Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.
2553     * </p> 
2554         */
2555        public ResourceReferenceDt addReasonReference() {
2556                ResourceReferenceDt newType = new ResourceReferenceDt();
2557                getReasonReference().add(newType);
2558                return newType; 
2559        }
2560  
2561        /**
2562         * Gets the value(s) for <b>goal</b> ().
2563         * creating it if it does
2564         * not exist. Will not return <code>null</code>.
2565         *
2566     * <p>
2567     * <b>Definition:</b>
2568     * Internal reference that identifies the goals that this activity is intended to contribute towards meeting
2569     * </p> 
2570         */
2571        public java.util.List<ResourceReferenceDt> getGoal() {  
2572                if (myGoal == null) {
2573                        myGoal = new java.util.ArrayList<ResourceReferenceDt>();
2574                }
2575                return myGoal;
2576        }
2577
2578        /**
2579         * Sets the value(s) for <b>goal</b> ()
2580         *
2581     * <p>
2582     * <b>Definition:</b>
2583     * Internal reference that identifies the goals that this activity is intended to contribute towards meeting
2584     * </p> 
2585         */
2586        public ActivityDetail setGoal(java.util.List<ResourceReferenceDt> theValue) {
2587                myGoal = theValue;
2588                return this;
2589        }
2590        
2591        
2592
2593        /**
2594         * Adds and returns a new value for <b>goal</b> ()
2595         *
2596     * <p>
2597     * <b>Definition:</b>
2598     * Internal reference that identifies the goals that this activity is intended to contribute towards meeting
2599     * </p> 
2600         */
2601        public ResourceReferenceDt addGoal() {
2602                ResourceReferenceDt newType = new ResourceReferenceDt();
2603                getGoal().add(newType);
2604                return newType; 
2605        }
2606  
2607        /**
2608         * Gets the value(s) for <b>status</b> ().
2609         * creating it if it does
2610         * not exist. Will not return <code>null</code>.
2611         *
2612     * <p>
2613     * <b>Definition:</b>
2614     * Identifies what progress is being made for the specific activity.
2615     * </p> 
2616         */
2617        public BoundCodeDt<CarePlanActivityStatusEnum> getStatusElement() {  
2618                if (myStatus == null) {
2619                        myStatus = new BoundCodeDt<CarePlanActivityStatusEnum>(CarePlanActivityStatusEnum.VALUESET_BINDER);
2620                }
2621                return myStatus;
2622        }
2623
2624        
2625        /**
2626         * Gets the value(s) for <b>status</b> ().
2627         * creating it if it does
2628         * not exist. This method may return <code>null</code>.
2629         *
2630     * <p>
2631     * <b>Definition:</b>
2632     * Identifies what progress is being made for the specific activity.
2633     * </p> 
2634         */
2635        public String getStatus() {  
2636                return getStatusElement().getValue();
2637        }
2638
2639        /**
2640         * Sets the value(s) for <b>status</b> ()
2641         *
2642     * <p>
2643     * <b>Definition:</b>
2644     * Identifies what progress is being made for the specific activity.
2645     * </p> 
2646         */
2647        public ActivityDetail setStatus(BoundCodeDt<CarePlanActivityStatusEnum> theValue) {
2648                myStatus = theValue;
2649                return this;
2650        }
2651        
2652        
2653
2654        /**
2655         * Sets the value(s) for <b>status</b> ()
2656         *
2657     * <p>
2658     * <b>Definition:</b>
2659     * Identifies what progress is being made for the specific activity.
2660     * </p> 
2661         */
2662        public ActivityDetail setStatus(CarePlanActivityStatusEnum theValue) {
2663                setStatus(new BoundCodeDt<CarePlanActivityStatusEnum>(CarePlanActivityStatusEnum.VALUESET_BINDER, theValue));
2664                
2665/*
2666                getStatusElement().setValueAsEnum(theValue);
2667*/
2668                return this;
2669        }
2670
2671  
2672        /**
2673         * Gets the value(s) for <b>statusReason</b> ().
2674         * creating it if it does
2675         * not exist. Will not return <code>null</code>.
2676         *
2677     * <p>
2678     * <b>Definition:</b>
2679     * Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.
2680     * </p> 
2681         */
2682        public CodeableConceptDt getStatusReason() {  
2683                if (myStatusReason == null) {
2684                        myStatusReason = new CodeableConceptDt();
2685                }
2686                return myStatusReason;
2687        }
2688
2689        /**
2690         * Sets the value(s) for <b>statusReason</b> ()
2691         *
2692     * <p>
2693     * <b>Definition:</b>
2694     * Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.
2695     * </p> 
2696         */
2697        public ActivityDetail setStatusReason(CodeableConceptDt theValue) {
2698                myStatusReason = theValue;
2699                return this;
2700        }
2701        
2702        
2703
2704  
2705        /**
2706         * Gets the value(s) for <b>prohibited</b> ().
2707         * creating it if it does
2708         * not exist. Will not return <code>null</code>.
2709         *
2710     * <p>
2711     * <b>Definition:</b>
2712     * If true, indicates that the described activity is one that must NOT be engaged in when following the plan.
2713     * </p> 
2714         */
2715        public BooleanDt getProhibitedElement() {  
2716                if (myProhibited == null) {
2717                        myProhibited = new BooleanDt();
2718                }
2719                return myProhibited;
2720        }
2721
2722        
2723        /**
2724         * Gets the value(s) for <b>prohibited</b> ().
2725         * creating it if it does
2726         * not exist. This method may return <code>null</code>.
2727         *
2728     * <p>
2729     * <b>Definition:</b>
2730     * If true, indicates that the described activity is one that must NOT be engaged in when following the plan.
2731     * </p> 
2732         */
2733        public Boolean getProhibited() {  
2734                return getProhibitedElement().getValue();
2735        }
2736
2737        /**
2738         * Sets the value(s) for <b>prohibited</b> ()
2739         *
2740     * <p>
2741     * <b>Definition:</b>
2742     * If true, indicates that the described activity is one that must NOT be engaged in when following the plan.
2743     * </p> 
2744         */
2745        public ActivityDetail setProhibited(BooleanDt theValue) {
2746                myProhibited = theValue;
2747                return this;
2748        }
2749        
2750        
2751
2752        /**
2753         * Sets the value for <b>prohibited</b> ()
2754         *
2755     * <p>
2756     * <b>Definition:</b>
2757     * If true, indicates that the described activity is one that must NOT be engaged in when following the plan.
2758     * </p> 
2759         */
2760        public ActivityDetail setProhibited( boolean theBoolean) {
2761                myProhibited = new BooleanDt(theBoolean); 
2762                return this; 
2763        }
2764
2765 
2766        /**
2767         * Gets the value(s) for <b>scheduled[x]</b> ().
2768         * creating it if it does
2769         * not exist. Will not return <code>null</code>.
2770         *
2771     * <p>
2772     * <b>Definition:</b>
2773     * The period, timing or frequency upon which the described activity is to occur.
2774     * </p> 
2775         */
2776        public IDatatype getScheduled() {  
2777                return myScheduled;
2778        }
2779
2780        /**
2781         * Sets the value(s) for <b>scheduled[x]</b> ()
2782         *
2783     * <p>
2784     * <b>Definition:</b>
2785     * The period, timing or frequency upon which the described activity is to occur.
2786     * </p> 
2787         */
2788        public ActivityDetail setScheduled(IDatatype theValue) {
2789                myScheduled = theValue;
2790                return this;
2791        }
2792        
2793        
2794
2795  
2796        /**
2797         * Gets the value(s) for <b>location</b> ().
2798         * creating it if it does
2799         * not exist. Will not return <code>null</code>.
2800         *
2801     * <p>
2802     * <b>Definition:</b>
2803     * Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.
2804     * </p> 
2805         */
2806        public ResourceReferenceDt getLocation() {  
2807                if (myLocation == null) {
2808                        myLocation = new ResourceReferenceDt();
2809                }
2810                return myLocation;
2811        }
2812
2813        /**
2814         * Sets the value(s) for <b>location</b> ()
2815         *
2816     * <p>
2817     * <b>Definition:</b>
2818     * Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.
2819     * </p> 
2820         */
2821        public ActivityDetail setLocation(ResourceReferenceDt theValue) {
2822                myLocation = theValue;
2823                return this;
2824        }
2825        
2826        
2827
2828  
2829        /**
2830         * Gets the value(s) for <b>performer</b> ().
2831         * creating it if it does
2832         * not exist. Will not return <code>null</code>.
2833         *
2834     * <p>
2835     * <b>Definition:</b>
2836     * Identifies who's expected to be involved in the activity.
2837     * </p> 
2838         */
2839        public java.util.List<ResourceReferenceDt> getPerformer() {  
2840                if (myPerformer == null) {
2841                        myPerformer = new java.util.ArrayList<ResourceReferenceDt>();
2842                }
2843                return myPerformer;
2844        }
2845
2846        /**
2847         * Sets the value(s) for <b>performer</b> ()
2848         *
2849     * <p>
2850     * <b>Definition:</b>
2851     * Identifies who's expected to be involved in the activity.
2852     * </p> 
2853         */
2854        public ActivityDetail setPerformer(java.util.List<ResourceReferenceDt> theValue) {
2855                myPerformer = theValue;
2856                return this;
2857        }
2858        
2859        
2860
2861        /**
2862         * Adds and returns a new value for <b>performer</b> ()
2863         *
2864     * <p>
2865     * <b>Definition:</b>
2866     * Identifies who's expected to be involved in the activity.
2867     * </p> 
2868         */
2869        public ResourceReferenceDt addPerformer() {
2870                ResourceReferenceDt newType = new ResourceReferenceDt();
2871                getPerformer().add(newType);
2872                return newType; 
2873        }
2874  
2875        /**
2876         * Gets the value(s) for <b>product[x]</b> ().
2877         * creating it if it does
2878         * not exist. Will not return <code>null</code>.
2879         *
2880     * <p>
2881     * <b>Definition:</b>
2882     * Identifies the food, drug or other product to be consumed or supplied in the activity.
2883     * </p> 
2884         */
2885        public IDatatype getProduct() {  
2886                return myProduct;
2887        }
2888
2889        /**
2890         * Sets the value(s) for <b>product[x]</b> ()
2891         *
2892     * <p>
2893     * <b>Definition:</b>
2894     * Identifies the food, drug or other product to be consumed or supplied in the activity.
2895     * </p> 
2896         */
2897        public ActivityDetail setProduct(IDatatype theValue) {
2898                myProduct = theValue;
2899                return this;
2900        }
2901        
2902        
2903
2904  
2905        /**
2906         * Gets the value(s) for <b>dailyAmount</b> ().
2907         * creating it if it does
2908         * not exist. Will not return <code>null</code>.
2909         *
2910     * <p>
2911     * <b>Definition:</b>
2912     * Identifies the quantity expected to be consumed in a given day.
2913     * </p> 
2914         */
2915        public SimpleQuantityDt getDailyAmount() {  
2916                if (myDailyAmount == null) {
2917                        myDailyAmount = new SimpleQuantityDt();
2918                }
2919                return myDailyAmount;
2920        }
2921
2922        /**
2923         * Sets the value(s) for <b>dailyAmount</b> ()
2924         *
2925     * <p>
2926     * <b>Definition:</b>
2927     * Identifies the quantity expected to be consumed in a given day.
2928     * </p> 
2929         */
2930        public ActivityDetail setDailyAmount(SimpleQuantityDt theValue) {
2931                myDailyAmount = theValue;
2932                return this;
2933        }
2934        
2935        
2936
2937  
2938        /**
2939         * Gets the value(s) for <b>quantity</b> ().
2940         * creating it if it does
2941         * not exist. Will not return <code>null</code>.
2942         *
2943     * <p>
2944     * <b>Definition:</b>
2945     * Identifies the quantity expected to be supplied, administered or consumed by the subject
2946     * </p> 
2947         */
2948        public SimpleQuantityDt getQuantity() {  
2949                if (myQuantity == null) {
2950                        myQuantity = new SimpleQuantityDt();
2951                }
2952                return myQuantity;
2953        }
2954
2955        /**
2956         * Sets the value(s) for <b>quantity</b> ()
2957         *
2958     * <p>
2959     * <b>Definition:</b>
2960     * Identifies the quantity expected to be supplied, administered or consumed by the subject
2961     * </p> 
2962         */
2963        public ActivityDetail setQuantity(SimpleQuantityDt theValue) {
2964                myQuantity = theValue;
2965                return this;
2966        }
2967        
2968        
2969
2970  
2971        /**
2972         * Gets the value(s) for <b>description</b> ().
2973         * creating it if it does
2974         * not exist. Will not return <code>null</code>.
2975         *
2976     * <p>
2977     * <b>Definition:</b>
2978     * 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.
2979     * </p> 
2980         */
2981        public StringDt getDescriptionElement() {  
2982                if (myDescription == null) {
2983                        myDescription = new StringDt();
2984                }
2985                return myDescription;
2986        }
2987
2988        
2989        /**
2990         * Gets the value(s) for <b>description</b> ().
2991         * creating it if it does
2992         * not exist. This method may return <code>null</code>.
2993         *
2994     * <p>
2995     * <b>Definition:</b>
2996     * 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.
2997     * </p> 
2998         */
2999        public String getDescription() {  
3000                return getDescriptionElement().getValue();
3001        }
3002
3003        /**
3004         * Sets the value(s) for <b>description</b> ()
3005         *
3006     * <p>
3007     * <b>Definition:</b>
3008     * 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.
3009     * </p> 
3010         */
3011        public ActivityDetail setDescription(StringDt theValue) {
3012                myDescription = theValue;
3013                return this;
3014        }
3015        
3016        
3017
3018        /**
3019         * Sets the value for <b>description</b> ()
3020         *
3021     * <p>
3022     * <b>Definition:</b>
3023     * 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.
3024     * </p> 
3025         */
3026        public ActivityDetail setDescription( String theString) {
3027                myDescription = new StringDt(theString); 
3028                return this; 
3029        }
3030
3031 
3032
3033
3034        }
3035
3036
3037
3038
3039
3040    @Override
3041    public String getResourceName() {
3042        return "CarePlan";
3043    }
3044    
3045    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
3046        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
3047    }
3048
3049
3050}