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>EpisodeOfCare</b> Resource
282 * (workflow.encounter)
283 *
284 * <p>
285 * <b>Definition:</b>
286 * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.
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/EpisodeOfCare">http://hl7.org/fhir/profiles/EpisodeOfCare</a> 
297 * </p>
298 *
299 */
300@ResourceDef(name="EpisodeOfCare", profile="http://hl7.org/fhir/profiles/EpisodeOfCare", id="episodeofcare")
301public class EpisodeOfCare 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>EpisodeOfCare.patient</b><br>
311         * </p>
312         */
313        @SearchParamDefinition(name="patient", path="EpisodeOfCare.patient", 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>EpisodeOfCare.patient</b><br>
327         * </p>
328         */
329        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
330
331        /**
332         * Search parameter constant for <b>identifier</b>
333         * <p>
334         * Description: <b></b><br>
335         * Type: <b>token</b><br>
336         * Path: <b>EpisodeOfCare.identifier</b><br>
337         * </p>
338         */
339        @SearchParamDefinition(name="identifier", path="EpisodeOfCare.identifier", description="", type="token" 
340 )
341        public static final String SP_IDENTIFIER = "identifier";
342
343        /**
344         * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
345         * <p>
346         * Description: <b></b><br>
347         * Type: <b>token</b><br>
348         * Path: <b>EpisodeOfCare.identifier</b><br>
349         * </p>
350         */
351        public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
352
353        /**
354         * Search parameter constant for <b>status</b>
355         * <p>
356         * Description: <b>The current status of the Episode of Care as provided (does not check the status history collection)</b><br>
357         * Type: <b>token</b><br>
358         * Path: <b>EpisodeOfCare.status</b><br>
359         * </p>
360         */
361        @SearchParamDefinition(name="status", path="EpisodeOfCare.status", description="The current status of the Episode of Care as provided (does not check the status history collection)", type="token" 
362 )
363        public static final String SP_STATUS = "status";
364
365        /**
366         * <b>Fluent Client</b> search parameter constant for <b>status</b>
367         * <p>
368         * Description: <b>The current status of the Episode of Care as provided (does not check the status history collection)</b><br>
369         * Type: <b>token</b><br>
370         * Path: <b>EpisodeOfCare.status</b><br>
371         * </p>
372         */
373        public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS);
374
375        /**
376         * Search parameter constant for <b>organization</b>
377         * <p>
378         * Description: <b>The organization that has assumed the specific responsibilities of this EpisodeOfCare</b><br>
379         * Type: <b>reference</b><br>
380         * Path: <b>EpisodeOfCare.managingOrganization</b><br>
381         * </p>
382         */
383        @SearchParamDefinition(name="organization", path="EpisodeOfCare.managingOrganization", description="The organization that has assumed the specific responsibilities of this EpisodeOfCare", type="reference" 
384, target={
385 ca.uhn.fhir.model.dstu2.resource.Organization.class    }
386 )
387        public static final String SP_ORGANIZATION = "organization";
388
389        /**
390         * <b>Fluent Client</b> search parameter constant for <b>organization</b>
391         * <p>
392         * Description: <b>The organization that has assumed the specific responsibilities of this EpisodeOfCare</b><br>
393         * Type: <b>reference</b><br>
394         * Path: <b>EpisodeOfCare.managingOrganization</b><br>
395         * </p>
396         */
397        public static final ReferenceClientParam ORGANIZATION = new ReferenceClientParam(SP_ORGANIZATION);
398
399        /**
400         * Search parameter constant for <b>date</b>
401         * <p>
402         * Description: <b>The provided date search value falls within the episode of care's period</b><br>
403         * Type: <b>date</b><br>
404         * Path: <b>EpisodeOfCare.period</b><br>
405         * </p>
406         */
407        @SearchParamDefinition(name="date", path="EpisodeOfCare.period", description="The provided date search value falls within the episode of care's period", type="date" 
408 )
409        public static final String SP_DATE = "date";
410
411        /**
412         * <b>Fluent Client</b> search parameter constant for <b>date</b>
413         * <p>
414         * Description: <b>The provided date search value falls within the episode of care's period</b><br>
415         * Type: <b>date</b><br>
416         * Path: <b>EpisodeOfCare.period</b><br>
417         * </p>
418         */
419        public static final DateClientParam DATE = new DateClientParam(SP_DATE);
420
421        /**
422         * Search parameter constant for <b>type</b>
423         * <p>
424         * Description: <b></b><br>
425         * Type: <b>token</b><br>
426         * Path: <b>EpisodeOfCare.type</b><br>
427         * </p>
428         */
429        @SearchParamDefinition(name="type", path="EpisodeOfCare.type", description="", type="token" 
430 )
431        public static final String SP_TYPE = "type";
432
433        /**
434         * <b>Fluent Client</b> search parameter constant for <b>type</b>
435         * <p>
436         * Description: <b></b><br>
437         * Type: <b>token</b><br>
438         * Path: <b>EpisodeOfCare.type</b><br>
439         * </p>
440         */
441        public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE);
442
443        /**
444         * Search parameter constant for <b>condition</b>
445         * <p>
446         * Description: <b></b><br>
447         * Type: <b>reference</b><br>
448         * Path: <b>EpisodeOfCare.condition</b><br>
449         * </p>
450         */
451        @SearchParamDefinition(name="condition", path="EpisodeOfCare.condition", description="", type="reference" 
452, target={
453 ca.uhn.fhir.model.dstu2.resource.Condition.class       }
454 )
455        public static final String SP_CONDITION = "condition";
456
457        /**
458         * <b>Fluent Client</b> search parameter constant for <b>condition</b>
459         * <p>
460         * Description: <b></b><br>
461         * Type: <b>reference</b><br>
462         * Path: <b>EpisodeOfCare.condition</b><br>
463         * </p>
464         */
465        public static final ReferenceClientParam CONDITION = new ReferenceClientParam(SP_CONDITION);
466
467        /**
468         * Search parameter constant for <b>incomingreferral</b>
469         * <p>
470         * Description: <b>Incoming Referral Request</b><br>
471         * Type: <b>reference</b><br>
472         * Path: <b>EpisodeOfCare.referralRequest</b><br>
473         * </p>
474         */
475        @SearchParamDefinition(name="incomingreferral", path="EpisodeOfCare.referralRequest", description="Incoming Referral Request", type="reference" 
476, target={
477 ca.uhn.fhir.model.dstu2.resource.ReferralRequest.class         }
478 )
479        public static final String SP_INCOMINGREFERRAL = "incomingreferral";
480
481        /**
482         * <b>Fluent Client</b> search parameter constant for <b>incomingreferral</b>
483         * <p>
484         * Description: <b>Incoming Referral Request</b><br>
485         * Type: <b>reference</b><br>
486         * Path: <b>EpisodeOfCare.referralRequest</b><br>
487         * </p>
488         */
489        public static final ReferenceClientParam INCOMINGREFERRAL = new ReferenceClientParam(SP_INCOMINGREFERRAL);
490
491        /**
492         * Search parameter constant for <b>care-manager</b>
493         * <p>
494         * Description: <b></b><br>
495         * Type: <b>reference</b><br>
496         * Path: <b>EpisodeOfCare.careManager</b><br>
497         * </p>
498         */
499        @SearchParamDefinition(name="care-manager", path="EpisodeOfCare.careManager", description="", type="reference" 
500, providesMembershipIn={
501 @Compartment(name="Encounter")         }
502, target={
503 ca.uhn.fhir.model.dstu2.resource.Practitioner.class    }
504 )
505        public static final String SP_CARE_MANAGER = "care-manager";
506
507        /**
508         * <b>Fluent Client</b> search parameter constant for <b>care-manager</b>
509         * <p>
510         * Description: <b></b><br>
511         * Type: <b>reference</b><br>
512         * Path: <b>EpisodeOfCare.careManager</b><br>
513         * </p>
514         */
515        public static final ReferenceClientParam CARE_MANAGER = new ReferenceClientParam(SP_CARE_MANAGER);
516
517        /**
518         * Search parameter constant for <b>team-member</b>
519         * <p>
520         * Description: <b>A Practitioner or Organization allocated to the care team for this EpisodeOfCare</b><br>
521         * Type: <b>reference</b><br>
522         * Path: <b>EpisodeOfCare.careTeam.member</b><br>
523         * </p>
524         */
525        @SearchParamDefinition(name="team-member", path="EpisodeOfCare.careTeam.member", description="A Practitioner or Organization allocated to the care team for this EpisodeOfCare", type="reference" 
526, providesMembershipIn={
527 @Compartment(name="Encounter")         }
528 )
529        public static final String SP_TEAM_MEMBER = "team-member";
530
531        /**
532         * <b>Fluent Client</b> search parameter constant for <b>team-member</b>
533         * <p>
534         * Description: <b>A Practitioner or Organization allocated to the care team for this EpisodeOfCare</b><br>
535         * Type: <b>reference</b><br>
536         * Path: <b>EpisodeOfCare.careTeam.member</b><br>
537         * </p>
538         */
539        public static final ReferenceClientParam TEAM_MEMBER = new ReferenceClientParam(SP_TEAM_MEMBER);
540
541
542        /**
543         * Constant for fluent queries to be used to add include statements. Specifies
544         * the path value of "<b>EpisodeOfCare:care-manager</b>".
545         */
546        public static final Include INCLUDE_CARE_MANAGER = new Include("EpisodeOfCare:care-manager");
547
548        /**
549         * Constant for fluent queries to be used to add include statements. Specifies
550         * the path value of "<b>EpisodeOfCare:condition</b>".
551         */
552        public static final Include INCLUDE_CONDITION = new Include("EpisodeOfCare:condition");
553
554        /**
555         * Constant for fluent queries to be used to add include statements. Specifies
556         * the path value of "<b>EpisodeOfCare:incomingreferral</b>".
557         */
558        public static final Include INCLUDE_INCOMINGREFERRAL = new Include("EpisodeOfCare:incomingreferral");
559
560        /**
561         * Constant for fluent queries to be used to add include statements. Specifies
562         * the path value of "<b>EpisodeOfCare:organization</b>".
563         */
564        public static final Include INCLUDE_ORGANIZATION = new Include("EpisodeOfCare:organization");
565
566        /**
567         * Constant for fluent queries to be used to add include statements. Specifies
568         * the path value of "<b>EpisodeOfCare:patient</b>".
569         */
570        public static final Include INCLUDE_PATIENT = new Include("EpisodeOfCare:patient");
571
572        /**
573         * Constant for fluent queries to be used to add include statements. Specifies
574         * the path value of "<b>EpisodeOfCare:team-member</b>".
575         */
576        public static final Include INCLUDE_TEAM_MEMBER = new Include("EpisodeOfCare:team-member");
577
578
579        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
580        @Description(
581                shortDefinition="id",
582                formalDefinition="Identifier(s) by which this EpisodeOfCare is known"
583        )
584        private java.util.List<IdentifierDt> myIdentifier;
585        
586        @Child(name="status", type=CodeDt.class, order=1, min=1, max=1, summary=true, modifier=true)    
587        @Description(
588                shortDefinition="status",
589                formalDefinition="planned | waitlist | active | onhold | finished | cancelled"
590        )
591        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/episode-of-care-status")
592        private BoundCodeDt<EpisodeOfCareStatusEnum> myStatus;
593        
594        @Child(name="statusHistory", order=2, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)    
595        @Description(
596                shortDefinition="",
597                formalDefinition="The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)"
598        )
599        private java.util.List<StatusHistory> myStatusHistory;
600        
601        @Child(name="type", type=CodeableConceptDt.class, order=3, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)        
602        @Description(
603                shortDefinition="class",
604                formalDefinition="A classification of the type of encounter; e.g. specialist referral, disease management, type of funded care"
605        )
606        private java.util.List<CodeableConceptDt> myType;
607        
608        @Child(name="condition", order=4, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
609                ca.uhn.fhir.model.dstu2.resource.Condition.class
610        })
611        @Description(
612                shortDefinition="what",
613                formalDefinition="A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for"
614        )
615        private java.util.List<ResourceReferenceDt> myCondition;
616        
617        @Child(name="patient", order=5, min=1, max=1, summary=true, modifier=false, type={
618                ca.uhn.fhir.model.dstu2.resource.Patient.class
619        })
620        @Description(
621                shortDefinition="who.focus",
622                formalDefinition="The patient that this EpisodeOfCare applies to"
623        )
624        private ResourceReferenceDt myPatient;
625        
626        @Child(name="managingOrganization", order=6, min=0, max=1, summary=true, modifier=false, type={
627                ca.uhn.fhir.model.dstu2.resource.Organization.class
628        })
629        @Description(
630                shortDefinition="",
631                formalDefinition="The organization that has assumed the specific responsibilities for the specified duration"
632        )
633        private ResourceReferenceDt myManagingOrganization;
634        
635        @Child(name="period", type=PeriodDt.class, order=7, min=0, max=1, summary=true, modifier=false) 
636        @Description(
637                shortDefinition="when.init",
638                formalDefinition="The interval during which the managing organization assumes the defined responsibility"
639        )
640        private PeriodDt myPeriod;
641        
642        @Child(name="referralRequest", order=8, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
643                ca.uhn.fhir.model.dstu2.resource.ReferralRequest.class
644        })
645        @Description(
646                shortDefinition="",
647                formalDefinition="Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals"
648        )
649        private java.util.List<ResourceReferenceDt> myReferralRequest;
650        
651        @Child(name="careManager", order=9, min=0, max=1, summary=false, modifier=false, type={
652                ca.uhn.fhir.model.dstu2.resource.Practitioner.class
653        })
654        @Description(
655                shortDefinition="",
656                formalDefinition="The practitioner that is the care manager/care co-ordinator for this patient"
657        )
658        private ResourceReferenceDt myCareManager;
659        
660        @Child(name="careTeam", order=10, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)        
661        @Description(
662                shortDefinition="",
663                formalDefinition="The list of practitioners that may be facilitating this episode of care for specific purposes"
664        )
665        private java.util.List<CareTeam> myCareTeam;
666        
667
668        @Override
669        public boolean isEmpty() {
670                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myStatus,  myStatusHistory,  myType,  myCondition,  myPatient,  myManagingOrganization,  myPeriod,  myReferralRequest,  myCareManager,  myCareTeam);
671        }
672        
673        @Override
674        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
675                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myStatus, myStatusHistory, myType, myCondition, myPatient, myManagingOrganization, myPeriod, myReferralRequest, myCareManager, myCareTeam);
676        }
677
678        /**
679         * Gets the value(s) for <b>identifier</b> (id).
680         * creating it if it does
681         * not exist. Will not return <code>null</code>.
682         *
683     * <p>
684     * <b>Definition:</b>
685     * Identifier(s) by which this EpisodeOfCare is known
686     * </p> 
687         */
688        public java.util.List<IdentifierDt> getIdentifier() {  
689                if (myIdentifier == null) {
690                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
691                }
692                return myIdentifier;
693        }
694
695        /**
696         * Sets the value(s) for <b>identifier</b> (id)
697         *
698     * <p>
699     * <b>Definition:</b>
700     * Identifier(s) by which this EpisodeOfCare is known
701     * </p> 
702         */
703        public EpisodeOfCare setIdentifier(java.util.List<IdentifierDt> theValue) {
704                myIdentifier = theValue;
705                return this;
706        }
707        
708        
709
710        /**
711         * Adds and returns a new value for <b>identifier</b> (id)
712         *
713     * <p>
714     * <b>Definition:</b>
715     * Identifier(s) by which this EpisodeOfCare is known
716     * </p> 
717         */
718        public IdentifierDt addIdentifier() {
719                IdentifierDt newType = new IdentifierDt();
720                getIdentifier().add(newType);
721                return newType; 
722        }
723
724        /**
725         * Adds a given new value for <b>identifier</b> (id)
726         *
727         * <p>
728         * <b>Definition:</b>
729         * Identifier(s) by which this EpisodeOfCare is known
730         * </p>
731         * @param theValue The identifier to add (must not be <code>null</code>)
732         */
733        public EpisodeOfCare addIdentifier(IdentifierDt theValue) {
734                if (theValue == null) {
735                        throw new NullPointerException("theValue must not be null");
736                }
737                getIdentifier().add(theValue);
738                return this;
739        }
740
741        /**
742         * Gets the first repetition for <b>identifier</b> (id),
743         * creating it if it does not already exist.
744         *
745     * <p>
746     * <b>Definition:</b>
747     * Identifier(s) by which this EpisodeOfCare is known
748     * </p> 
749         */
750        public IdentifierDt getIdentifierFirstRep() {
751                if (getIdentifier().isEmpty()) {
752                        return addIdentifier();
753                }
754                return getIdentifier().get(0); 
755        }
756  
757        /**
758         * Gets the value(s) for <b>status</b> (status).
759         * creating it if it does
760         * not exist. Will not return <code>null</code>.
761         *
762     * <p>
763     * <b>Definition:</b>
764     * planned | waitlist | active | onhold | finished | cancelled
765     * </p> 
766         */
767        public BoundCodeDt<EpisodeOfCareStatusEnum> getStatusElement() {  
768                if (myStatus == null) {
769                        myStatus = new BoundCodeDt<EpisodeOfCareStatusEnum>(EpisodeOfCareStatusEnum.VALUESET_BINDER);
770                }
771                return myStatus;
772        }
773
774        
775        /**
776         * Gets the value(s) for <b>status</b> (status).
777         * creating it if it does
778         * not exist. This method may return <code>null</code>.
779         *
780     * <p>
781     * <b>Definition:</b>
782     * planned | waitlist | active | onhold | finished | cancelled
783     * </p> 
784         */
785        public String getStatus() {  
786                return getStatusElement().getValue();
787        }
788
789        /**
790         * Sets the value(s) for <b>status</b> (status)
791         *
792     * <p>
793     * <b>Definition:</b>
794     * planned | waitlist | active | onhold | finished | cancelled
795     * </p> 
796         */
797        public EpisodeOfCare setStatus(BoundCodeDt<EpisodeOfCareStatusEnum> theValue) {
798                myStatus = theValue;
799                return this;
800        }
801        
802        
803
804        /**
805         * Sets the value(s) for <b>status</b> (status)
806         *
807     * <p>
808     * <b>Definition:</b>
809     * planned | waitlist | active | onhold | finished | cancelled
810     * </p> 
811         */
812        public EpisodeOfCare setStatus(EpisodeOfCareStatusEnum theValue) {
813                setStatus(new BoundCodeDt<EpisodeOfCareStatusEnum>(EpisodeOfCareStatusEnum.VALUESET_BINDER, theValue));
814                
815/*
816                getStatusElement().setValueAsEnum(theValue);
817*/
818                return this;
819        }
820
821  
822        /**
823         * Gets the value(s) for <b>statusHistory</b> ().
824         * creating it if it does
825         * not exist. Will not return <code>null</code>.
826         *
827     * <p>
828     * <b>Definition:</b>
829     * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)
830     * </p> 
831         */
832        public java.util.List<StatusHistory> getStatusHistory() {  
833                if (myStatusHistory == null) {
834                        myStatusHistory = new java.util.ArrayList<StatusHistory>();
835                }
836                return myStatusHistory;
837        }
838
839        /**
840         * Sets the value(s) for <b>statusHistory</b> ()
841         *
842     * <p>
843     * <b>Definition:</b>
844     * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)
845     * </p> 
846         */
847        public EpisodeOfCare setStatusHistory(java.util.List<StatusHistory> theValue) {
848                myStatusHistory = theValue;
849                return this;
850        }
851        
852        
853
854        /**
855         * Adds and returns a new value for <b>statusHistory</b> ()
856         *
857     * <p>
858     * <b>Definition:</b>
859     * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)
860     * </p> 
861         */
862        public StatusHistory addStatusHistory() {
863                StatusHistory newType = new StatusHistory();
864                getStatusHistory().add(newType);
865                return newType; 
866        }
867
868        /**
869         * Adds a given new value for <b>statusHistory</b> ()
870         *
871         * <p>
872         * <b>Definition:</b>
873         * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)
874         * </p>
875         * @param theValue The statusHistory to add (must not be <code>null</code>)
876         */
877        public EpisodeOfCare addStatusHistory(StatusHistory theValue) {
878                if (theValue == null) {
879                        throw new NullPointerException("theValue must not be null");
880                }
881                getStatusHistory().add(theValue);
882                return this;
883        }
884
885        /**
886         * Gets the first repetition for <b>statusHistory</b> (),
887         * creating it if it does not already exist.
888         *
889     * <p>
890     * <b>Definition:</b>
891     * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)
892     * </p> 
893         */
894        public StatusHistory getStatusHistoryFirstRep() {
895                if (getStatusHistory().isEmpty()) {
896                        return addStatusHistory();
897                }
898                return getStatusHistory().get(0); 
899        }
900  
901        /**
902         * Gets the value(s) for <b>type</b> (class).
903         * creating it if it does
904         * not exist. Will not return <code>null</code>.
905         *
906     * <p>
907     * <b>Definition:</b>
908     * A classification of the type of encounter; e.g. specialist referral, disease management, type of funded care
909     * </p> 
910         */
911        public java.util.List<CodeableConceptDt> getType() {  
912                if (myType == null) {
913                        myType = new java.util.ArrayList<CodeableConceptDt>();
914                }
915                return myType;
916        }
917
918        /**
919         * Sets the value(s) for <b>type</b> (class)
920         *
921     * <p>
922     * <b>Definition:</b>
923     * A classification of the type of encounter; e.g. specialist referral, disease management, type of funded care
924     * </p> 
925         */
926        public EpisodeOfCare setType(java.util.List<CodeableConceptDt> theValue) {
927                myType = theValue;
928                return this;
929        }
930        
931        
932
933        /**
934         * Adds and returns a new value for <b>type</b> (class)
935         *
936     * <p>
937     * <b>Definition:</b>
938     * A classification of the type of encounter; e.g. specialist referral, disease management, type of funded care
939     * </p> 
940         */
941        public CodeableConceptDt addType() {
942                CodeableConceptDt newType = new CodeableConceptDt();
943                getType().add(newType);
944                return newType; 
945        }
946
947        /**
948         * Adds a given new value for <b>type</b> (class)
949         *
950         * <p>
951         * <b>Definition:</b>
952         * A classification of the type of encounter; e.g. specialist referral, disease management, type of funded care
953         * </p>
954         * @param theValue The type to add (must not be <code>null</code>)
955         */
956        public EpisodeOfCare addType(CodeableConceptDt theValue) {
957                if (theValue == null) {
958                        throw new NullPointerException("theValue must not be null");
959                }
960                getType().add(theValue);
961                return this;
962        }
963
964        /**
965         * Gets the first repetition for <b>type</b> (class),
966         * creating it if it does not already exist.
967         *
968     * <p>
969     * <b>Definition:</b>
970     * A classification of the type of encounter; e.g. specialist referral, disease management, type of funded care
971     * </p> 
972         */
973        public CodeableConceptDt getTypeFirstRep() {
974                if (getType().isEmpty()) {
975                        return addType();
976                }
977                return getType().get(0); 
978        }
979  
980        /**
981         * Gets the value(s) for <b>condition</b> (what).
982         * creating it if it does
983         * not exist. Will not return <code>null</code>.
984         *
985     * <p>
986     * <b>Definition:</b>
987     * A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for
988     * </p> 
989         */
990        public java.util.List<ResourceReferenceDt> getCondition() {  
991                if (myCondition == null) {
992                        myCondition = new java.util.ArrayList<ResourceReferenceDt>();
993                }
994                return myCondition;
995        }
996
997        /**
998         * Sets the value(s) for <b>condition</b> (what)
999         *
1000     * <p>
1001     * <b>Definition:</b>
1002     * A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for
1003     * </p> 
1004         */
1005        public EpisodeOfCare setCondition(java.util.List<ResourceReferenceDt> theValue) {
1006                myCondition = theValue;
1007                return this;
1008        }
1009        
1010        
1011
1012        /**
1013         * Adds and returns a new value for <b>condition</b> (what)
1014         *
1015     * <p>
1016     * <b>Definition:</b>
1017     * A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for
1018     * </p> 
1019         */
1020        public ResourceReferenceDt addCondition() {
1021                ResourceReferenceDt newType = new ResourceReferenceDt();
1022                getCondition().add(newType);
1023                return newType; 
1024        }
1025  
1026        /**
1027         * Gets the value(s) for <b>patient</b> (who.focus).
1028         * creating it if it does
1029         * not exist. Will not return <code>null</code>.
1030         *
1031     * <p>
1032     * <b>Definition:</b>
1033     * The patient that this EpisodeOfCare applies to
1034     * </p> 
1035         */
1036        public ResourceReferenceDt getPatient() {  
1037                if (myPatient == null) {
1038                        myPatient = new ResourceReferenceDt();
1039                }
1040                return myPatient;
1041        }
1042
1043        /**
1044         * Sets the value(s) for <b>patient</b> (who.focus)
1045         *
1046     * <p>
1047     * <b>Definition:</b>
1048     * The patient that this EpisodeOfCare applies to
1049     * </p> 
1050         */
1051        public EpisodeOfCare setPatient(ResourceReferenceDt theValue) {
1052                myPatient = theValue;
1053                return this;
1054        }
1055        
1056        
1057
1058  
1059        /**
1060         * Gets the value(s) for <b>managingOrganization</b> ().
1061         * creating it if it does
1062         * not exist. Will not return <code>null</code>.
1063         *
1064     * <p>
1065     * <b>Definition:</b>
1066     * The organization that has assumed the specific responsibilities for the specified duration
1067     * </p> 
1068         */
1069        public ResourceReferenceDt getManagingOrganization() {  
1070                if (myManagingOrganization == null) {
1071                        myManagingOrganization = new ResourceReferenceDt();
1072                }
1073                return myManagingOrganization;
1074        }
1075
1076        /**
1077         * Sets the value(s) for <b>managingOrganization</b> ()
1078         *
1079     * <p>
1080     * <b>Definition:</b>
1081     * The organization that has assumed the specific responsibilities for the specified duration
1082     * </p> 
1083         */
1084        public EpisodeOfCare setManagingOrganization(ResourceReferenceDt theValue) {
1085                myManagingOrganization = theValue;
1086                return this;
1087        }
1088        
1089        
1090
1091  
1092        /**
1093         * Gets the value(s) for <b>period</b> (when.init).
1094         * creating it if it does
1095         * not exist. Will not return <code>null</code>.
1096         *
1097     * <p>
1098     * <b>Definition:</b>
1099     * The interval during which the managing organization assumes the defined responsibility
1100     * </p> 
1101         */
1102        public PeriodDt getPeriod() {  
1103                if (myPeriod == null) {
1104                        myPeriod = new PeriodDt();
1105                }
1106                return myPeriod;
1107        }
1108
1109        /**
1110         * Sets the value(s) for <b>period</b> (when.init)
1111         *
1112     * <p>
1113     * <b>Definition:</b>
1114     * The interval during which the managing organization assumes the defined responsibility
1115     * </p> 
1116         */
1117        public EpisodeOfCare setPeriod(PeriodDt theValue) {
1118                myPeriod = theValue;
1119                return this;
1120        }
1121        
1122        
1123
1124  
1125        /**
1126         * Gets the value(s) for <b>referralRequest</b> ().
1127         * creating it if it does
1128         * not exist. Will not return <code>null</code>.
1129         *
1130     * <p>
1131     * <b>Definition:</b>
1132     * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals
1133     * </p> 
1134         */
1135        public java.util.List<ResourceReferenceDt> getReferralRequest() {  
1136                if (myReferralRequest == null) {
1137                        myReferralRequest = new java.util.ArrayList<ResourceReferenceDt>();
1138                }
1139                return myReferralRequest;
1140        }
1141
1142        /**
1143         * Sets the value(s) for <b>referralRequest</b> ()
1144         *
1145     * <p>
1146     * <b>Definition:</b>
1147     * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals
1148     * </p> 
1149         */
1150        public EpisodeOfCare setReferralRequest(java.util.List<ResourceReferenceDt> theValue) {
1151                myReferralRequest = theValue;
1152                return this;
1153        }
1154        
1155        
1156
1157        /**
1158         * Adds and returns a new value for <b>referralRequest</b> ()
1159         *
1160     * <p>
1161     * <b>Definition:</b>
1162     * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals
1163     * </p> 
1164         */
1165        public ResourceReferenceDt addReferralRequest() {
1166                ResourceReferenceDt newType = new ResourceReferenceDt();
1167                getReferralRequest().add(newType);
1168                return newType; 
1169        }
1170  
1171        /**
1172         * Gets the value(s) for <b>careManager</b> ().
1173         * creating it if it does
1174         * not exist. Will not return <code>null</code>.
1175         *
1176     * <p>
1177     * <b>Definition:</b>
1178     * The practitioner that is the care manager/care co-ordinator for this patient
1179     * </p> 
1180         */
1181        public ResourceReferenceDt getCareManager() {  
1182                if (myCareManager == null) {
1183                        myCareManager = new ResourceReferenceDt();
1184                }
1185                return myCareManager;
1186        }
1187
1188        /**
1189         * Sets the value(s) for <b>careManager</b> ()
1190         *
1191     * <p>
1192     * <b>Definition:</b>
1193     * The practitioner that is the care manager/care co-ordinator for this patient
1194     * </p> 
1195         */
1196        public EpisodeOfCare setCareManager(ResourceReferenceDt theValue) {
1197                myCareManager = theValue;
1198                return this;
1199        }
1200        
1201        
1202
1203  
1204        /**
1205         * Gets the value(s) for <b>careTeam</b> ().
1206         * creating it if it does
1207         * not exist. Will not return <code>null</code>.
1208         *
1209     * <p>
1210     * <b>Definition:</b>
1211     * The list of practitioners that may be facilitating this episode of care for specific purposes
1212     * </p> 
1213         */
1214        public java.util.List<CareTeam> getCareTeam() {  
1215                if (myCareTeam == null) {
1216                        myCareTeam = new java.util.ArrayList<CareTeam>();
1217                }
1218                return myCareTeam;
1219        }
1220
1221        /**
1222         * Sets the value(s) for <b>careTeam</b> ()
1223         *
1224     * <p>
1225     * <b>Definition:</b>
1226     * The list of practitioners that may be facilitating this episode of care for specific purposes
1227     * </p> 
1228         */
1229        public EpisodeOfCare setCareTeam(java.util.List<CareTeam> theValue) {
1230                myCareTeam = theValue;
1231                return this;
1232        }
1233        
1234        
1235
1236        /**
1237         * Adds and returns a new value for <b>careTeam</b> ()
1238         *
1239     * <p>
1240     * <b>Definition:</b>
1241     * The list of practitioners that may be facilitating this episode of care for specific purposes
1242     * </p> 
1243         */
1244        public CareTeam addCareTeam() {
1245                CareTeam newType = new CareTeam();
1246                getCareTeam().add(newType);
1247                return newType; 
1248        }
1249
1250        /**
1251         * Adds a given new value for <b>careTeam</b> ()
1252         *
1253         * <p>
1254         * <b>Definition:</b>
1255         * The list of practitioners that may be facilitating this episode of care for specific purposes
1256         * </p>
1257         * @param theValue The careTeam to add (must not be <code>null</code>)
1258         */
1259        public EpisodeOfCare addCareTeam(CareTeam theValue) {
1260                if (theValue == null) {
1261                        throw new NullPointerException("theValue must not be null");
1262                }
1263                getCareTeam().add(theValue);
1264                return this;
1265        }
1266
1267        /**
1268         * Gets the first repetition for <b>careTeam</b> (),
1269         * creating it if it does not already exist.
1270         *
1271     * <p>
1272     * <b>Definition:</b>
1273     * The list of practitioners that may be facilitating this episode of care for specific purposes
1274     * </p> 
1275         */
1276        public CareTeam getCareTeamFirstRep() {
1277                if (getCareTeam().isEmpty()) {
1278                        return addCareTeam();
1279                }
1280                return getCareTeam().get(0); 
1281        }
1282  
1283        /**
1284         * Block class for child element: <b>EpisodeOfCare.statusHistory</b> ()
1285         *
1286     * <p>
1287     * <b>Definition:</b>
1288     * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)
1289     * </p> 
1290         */
1291        @Block()        
1292        public static class StatusHistory 
1293            extends  BaseIdentifiableElement  
1294            implements IResourceBlock {
1295        
1296        @Child(name="status", type=CodeDt.class, order=0, min=1, max=1, summary=false, modifier=false)  
1297        @Description(
1298                shortDefinition="",
1299                formalDefinition="planned | waitlist | active | onhold | finished | cancelled"
1300        )
1301        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/episode-of-care-status")
1302        private BoundCodeDt<EpisodeOfCareStatusEnum> myStatus;
1303        
1304        @Child(name="period", type=PeriodDt.class, order=1, min=1, max=1, summary=false, modifier=false)        
1305        @Description(
1306                shortDefinition="",
1307                formalDefinition="The period during this EpisodeOfCare that the specific status applied"
1308        )
1309        private PeriodDt myPeriod;
1310        
1311
1312        @Override
1313        public boolean isEmpty() {
1314                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myStatus,  myPeriod);
1315        }
1316        
1317        @Override
1318        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1319                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myStatus, myPeriod);
1320        }
1321
1322        /**
1323         * Gets the value(s) for <b>status</b> ().
1324         * creating it if it does
1325         * not exist. Will not return <code>null</code>.
1326         *
1327     * <p>
1328     * <b>Definition:</b>
1329     * planned | waitlist | active | onhold | finished | cancelled
1330     * </p> 
1331         */
1332        public BoundCodeDt<EpisodeOfCareStatusEnum> getStatusElement() {  
1333                if (myStatus == null) {
1334                        myStatus = new BoundCodeDt<EpisodeOfCareStatusEnum>(EpisodeOfCareStatusEnum.VALUESET_BINDER);
1335                }
1336                return myStatus;
1337        }
1338
1339        
1340        /**
1341         * Gets the value(s) for <b>status</b> ().
1342         * creating it if it does
1343         * not exist. This method may return <code>null</code>.
1344         *
1345     * <p>
1346     * <b>Definition:</b>
1347     * planned | waitlist | active | onhold | finished | cancelled
1348     * </p> 
1349         */
1350        public String getStatus() {  
1351                return getStatusElement().getValue();
1352        }
1353
1354        /**
1355         * Sets the value(s) for <b>status</b> ()
1356         *
1357     * <p>
1358     * <b>Definition:</b>
1359     * planned | waitlist | active | onhold | finished | cancelled
1360     * </p> 
1361         */
1362        public StatusHistory setStatus(BoundCodeDt<EpisodeOfCareStatusEnum> theValue) {
1363                myStatus = theValue;
1364                return this;
1365        }
1366        
1367        
1368
1369        /**
1370         * Sets the value(s) for <b>status</b> ()
1371         *
1372     * <p>
1373     * <b>Definition:</b>
1374     * planned | waitlist | active | onhold | finished | cancelled
1375     * </p> 
1376         */
1377        public StatusHistory setStatus(EpisodeOfCareStatusEnum theValue) {
1378                setStatus(new BoundCodeDt<EpisodeOfCareStatusEnum>(EpisodeOfCareStatusEnum.VALUESET_BINDER, theValue));
1379                
1380/*
1381                getStatusElement().setValueAsEnum(theValue);
1382*/
1383                return this;
1384        }
1385
1386  
1387        /**
1388         * Gets the value(s) for <b>period</b> ().
1389         * creating it if it does
1390         * not exist. Will not return <code>null</code>.
1391         *
1392     * <p>
1393     * <b>Definition:</b>
1394     * The period during this EpisodeOfCare that the specific status applied
1395     * </p> 
1396         */
1397        public PeriodDt getPeriod() {  
1398                if (myPeriod == null) {
1399                        myPeriod = new PeriodDt();
1400                }
1401                return myPeriod;
1402        }
1403
1404        /**
1405         * Sets the value(s) for <b>period</b> ()
1406         *
1407     * <p>
1408     * <b>Definition:</b>
1409     * The period during this EpisodeOfCare that the specific status applied
1410     * </p> 
1411         */
1412        public StatusHistory setPeriod(PeriodDt theValue) {
1413                myPeriod = theValue;
1414                return this;
1415        }
1416        
1417        
1418
1419  
1420
1421
1422        }
1423
1424
1425        /**
1426         * Block class for child element: <b>EpisodeOfCare.careTeam</b> ()
1427         *
1428     * <p>
1429     * <b>Definition:</b>
1430     * The list of practitioners that may be facilitating this episode of care for specific purposes
1431     * </p> 
1432         */
1433        @Block()        
1434        public static class CareTeam 
1435            extends  BaseIdentifiableElement  
1436            implements IResourceBlock {
1437        
1438        @Child(name="role", type=CodeableConceptDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)       
1439        @Description(
1440                shortDefinition="",
1441                formalDefinition="The role this team member is taking within this episode of care"
1442        )
1443        private java.util.List<CodeableConceptDt> myRole;
1444        
1445        @Child(name="period", type=PeriodDt.class, order=1, min=0, max=1, summary=false, modifier=false)        
1446        @Description(
1447                shortDefinition="",
1448                formalDefinition="The period of time this practitioner is performing some role within the episode of care"
1449        )
1450        private PeriodDt myPeriod;
1451        
1452        @Child(name="member", order=2, min=0, max=1, summary=false, modifier=false, type={
1453                ca.uhn.fhir.model.dstu2.resource.Practitioner.class, 
1454                ca.uhn.fhir.model.dstu2.resource.Organization.class
1455        })
1456        @Description(
1457                shortDefinition="who",
1458                formalDefinition="The practitioner (or Organization) within the team"
1459        )
1460        private ResourceReferenceDt myMember;
1461        
1462
1463        @Override
1464        public boolean isEmpty() {
1465                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myRole,  myPeriod,  myMember);
1466        }
1467        
1468        @Override
1469        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1470                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRole, myPeriod, myMember);
1471        }
1472
1473        /**
1474         * Gets the value(s) for <b>role</b> ().
1475         * creating it if it does
1476         * not exist. Will not return <code>null</code>.
1477         *
1478     * <p>
1479     * <b>Definition:</b>
1480     * The role this team member is taking within this episode of care
1481     * </p> 
1482         */
1483        public java.util.List<CodeableConceptDt> getRole() {  
1484                if (myRole == null) {
1485                        myRole = new java.util.ArrayList<CodeableConceptDt>();
1486                }
1487                return myRole;
1488        }
1489
1490        /**
1491         * Sets the value(s) for <b>role</b> ()
1492         *
1493     * <p>
1494     * <b>Definition:</b>
1495     * The role this team member is taking within this episode of care
1496     * </p> 
1497         */
1498        public CareTeam setRole(java.util.List<CodeableConceptDt> theValue) {
1499                myRole = theValue;
1500                return this;
1501        }
1502        
1503        
1504
1505        /**
1506         * Adds and returns a new value for <b>role</b> ()
1507         *
1508     * <p>
1509     * <b>Definition:</b>
1510     * The role this team member is taking within this episode of care
1511     * </p> 
1512         */
1513        public CodeableConceptDt addRole() {
1514                CodeableConceptDt newType = new CodeableConceptDt();
1515                getRole().add(newType);
1516                return newType; 
1517        }
1518
1519        /**
1520         * Adds a given new value for <b>role</b> ()
1521         *
1522         * <p>
1523         * <b>Definition:</b>
1524         * The role this team member is taking within this episode of care
1525         * </p>
1526         * @param theValue The role to add (must not be <code>null</code>)
1527         */
1528        public CareTeam addRole(CodeableConceptDt theValue) {
1529                if (theValue == null) {
1530                        throw new NullPointerException("theValue must not be null");
1531                }
1532                getRole().add(theValue);
1533                return this;
1534        }
1535
1536        /**
1537         * Gets the first repetition for <b>role</b> (),
1538         * creating it if it does not already exist.
1539         *
1540     * <p>
1541     * <b>Definition:</b>
1542     * The role this team member is taking within this episode of care
1543     * </p> 
1544         */
1545        public CodeableConceptDt getRoleFirstRep() {
1546                if (getRole().isEmpty()) {
1547                        return addRole();
1548                }
1549                return getRole().get(0); 
1550        }
1551  
1552        /**
1553         * Gets the value(s) for <b>period</b> ().
1554         * creating it if it does
1555         * not exist. Will not return <code>null</code>.
1556         *
1557     * <p>
1558     * <b>Definition:</b>
1559     * The period of time this practitioner is performing some role within the episode of care
1560     * </p> 
1561         */
1562        public PeriodDt getPeriod() {  
1563                if (myPeriod == null) {
1564                        myPeriod = new PeriodDt();
1565                }
1566                return myPeriod;
1567        }
1568
1569        /**
1570         * Sets the value(s) for <b>period</b> ()
1571         *
1572     * <p>
1573     * <b>Definition:</b>
1574     * The period of time this practitioner is performing some role within the episode of care
1575     * </p> 
1576         */
1577        public CareTeam setPeriod(PeriodDt theValue) {
1578                myPeriod = theValue;
1579                return this;
1580        }
1581        
1582        
1583
1584  
1585        /**
1586         * Gets the value(s) for <b>member</b> (who).
1587         * creating it if it does
1588         * not exist. Will not return <code>null</code>.
1589         *
1590     * <p>
1591     * <b>Definition:</b>
1592     * The practitioner (or Organization) within the team
1593     * </p> 
1594         */
1595        public ResourceReferenceDt getMember() {  
1596                if (myMember == null) {
1597                        myMember = new ResourceReferenceDt();
1598                }
1599                return myMember;
1600        }
1601
1602        /**
1603         * Sets the value(s) for <b>member</b> (who)
1604         *
1605     * <p>
1606     * <b>Definition:</b>
1607     * The practitioner (or Organization) within the team
1608     * </p> 
1609         */
1610        public CareTeam setMember(ResourceReferenceDt theValue) {
1611                myMember = theValue;
1612                return this;
1613        }
1614        
1615        
1616
1617  
1618
1619
1620        }
1621
1622
1623
1624
1625    @Override
1626    public String getResourceName() {
1627        return "EpisodeOfCare";
1628    }
1629    
1630    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
1631        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
1632    }
1633
1634
1635}