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.valueset.AnimalSpeciesEnum;
042import ca.uhn.fhir.model.dstu2.composite.AnnotationDt;
043import ca.uhn.fhir.model.dstu2.valueset.AnswerFormatEnum;
044import ca.uhn.fhir.model.dstu2.resource.Appointment;
045import ca.uhn.fhir.model.dstu2.valueset.AppointmentStatusEnum;
046import ca.uhn.fhir.model.dstu2.valueset.AssertionDirectionTypeEnum;
047import ca.uhn.fhir.model.dstu2.valueset.AssertionOperatorTypeEnum;
048import ca.uhn.fhir.model.dstu2.valueset.AssertionResponseTypesEnum;
049import ca.uhn.fhir.model.dstu2.composite.AttachmentDt;
050import ca.uhn.fhir.model.dstu2.valueset.AuditEventActionEnum;
051import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectLifecycleEnum;
052import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectRoleEnum;
053import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectTypeEnum;
054import ca.uhn.fhir.model.dstu2.valueset.AuditEventOutcomeEnum;
055import ca.uhn.fhir.model.dstu2.valueset.AuditEventParticipantNetworkTypeEnum;
056import ca.uhn.fhir.model.dstu2.valueset.AuditEventSourceTypeEnum;
057import ca.uhn.fhir.model.dstu2.valueset.BindingStrengthEnum;
058import ca.uhn.fhir.model.dstu2.resource.BodySite;
059import ca.uhn.fhir.model.dstu2.valueset.BundleTypeEnum;
060import ca.uhn.fhir.model.dstu2.resource.CarePlan;
061import ca.uhn.fhir.model.dstu2.valueset.CarePlanActivityCategoryEnum;
062import ca.uhn.fhir.model.dstu2.valueset.CarePlanActivityStatusEnum;
063import ca.uhn.fhir.model.dstu2.valueset.CarePlanRelationshipEnum;
064import ca.uhn.fhir.model.dstu2.valueset.CarePlanStatusEnum;
065import ca.uhn.fhir.model.dstu2.resource.Claim;
066import ca.uhn.fhir.model.dstu2.resource.ClaimResponse;
067import ca.uhn.fhir.model.dstu2.valueset.ClaimTypeEnum;
068import ca.uhn.fhir.model.dstu2.resource.ClinicalImpression;
069import ca.uhn.fhir.model.dstu2.valueset.ClinicalImpressionStatusEnum;
070import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt;
071import ca.uhn.fhir.model.dstu2.composite.CodingDt;
072import ca.uhn.fhir.model.dstu2.resource.CommunicationRequest;
073import ca.uhn.fhir.model.dstu2.valueset.CommunicationRequestStatusEnum;
074import ca.uhn.fhir.model.dstu2.valueset.CommunicationStatusEnum;
075import ca.uhn.fhir.model.dstu2.resource.Composition;
076import ca.uhn.fhir.model.dstu2.valueset.CompositionAttestationModeEnum;
077import ca.uhn.fhir.model.dstu2.valueset.CompositionStatusEnum;
078import ca.uhn.fhir.model.dstu2.valueset.ConceptMapEquivalenceEnum;
079import ca.uhn.fhir.model.dstu2.resource.Condition;
080import ca.uhn.fhir.model.dstu2.valueset.ConditionCategoryCodesEnum;
081import ca.uhn.fhir.model.dstu2.valueset.ConditionClinicalStatusCodesEnum;
082import ca.uhn.fhir.model.dstu2.valueset.ConditionVerificationStatusEnum;
083import ca.uhn.fhir.model.dstu2.valueset.ConditionalDeleteStatusEnum;
084import ca.uhn.fhir.model.dstu2.valueset.ConditionsCodesEnum;
085import ca.uhn.fhir.model.dstu2.resource.Conformance;
086import ca.uhn.fhir.model.dstu2.valueset.ConformanceEventModeEnum;
087import ca.uhn.fhir.model.dstu2.valueset.ConformanceResourceStatusEnum;
088import ca.uhn.fhir.model.dstu2.valueset.ConformanceStatementKindEnum;
089import ca.uhn.fhir.model.dstu2.composite.ContactPointDt;
090import ca.uhn.fhir.model.dstu2.valueset.ContentTypeEnum;
091import ca.uhn.fhir.model.dstu2.resource.Contract;
092import ca.uhn.fhir.model.dstu2.valueset.ContractActionCodesEnum;
093import ca.uhn.fhir.model.dstu2.valueset.ContractActorRoleCodesEnum;
094import ca.uhn.fhir.model.dstu2.valueset.ContractSubtypeCodesEnum;
095import ca.uhn.fhir.model.dstu2.valueset.ContractTermTypeCodesEnum;
096import ca.uhn.fhir.model.dstu2.valueset.ContractTypeCodesEnum;
097import ca.uhn.fhir.model.dstu2.resource.Coverage;
098import ca.uhn.fhir.model.dstu2.valueset.DataElementStringencyEnum;
099import ca.uhn.fhir.model.dstu2.valueset.DaysOfWeekEnum;
100import ca.uhn.fhir.model.dstu2.valueset.DetectedIssueSeverityEnum;
101import ca.uhn.fhir.model.dstu2.resource.Device;
102import ca.uhn.fhir.model.dstu2.resource.DeviceComponent;
103import ca.uhn.fhir.model.dstu2.resource.DeviceMetric;
104import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCalibrationStateEnum;
105import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCalibrationTypeEnum;
106import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCategoryEnum;
107import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricColorEnum;
108import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricOperationalStatusEnum;
109import ca.uhn.fhir.model.dstu2.valueset.DeviceStatusEnum;
110import ca.uhn.fhir.model.dstu2.resource.DeviceUseRequest;
111import ca.uhn.fhir.model.dstu2.valueset.DeviceUseRequestPriorityEnum;
112import ca.uhn.fhir.model.dstu2.valueset.DeviceUseRequestStatusEnum;
113import ca.uhn.fhir.model.dstu2.resource.DiagnosticOrder;
114import ca.uhn.fhir.model.dstu2.valueset.DiagnosticOrderPriorityEnum;
115import ca.uhn.fhir.model.dstu2.valueset.DiagnosticOrderStatusEnum;
116import ca.uhn.fhir.model.dstu2.resource.DiagnosticReport;
117import ca.uhn.fhir.model.dstu2.valueset.DiagnosticReportStatusEnum;
118import ca.uhn.fhir.model.dstu2.valueset.DigitalMediaTypeEnum;
119import ca.uhn.fhir.model.dstu2.valueset.DocumentModeEnum;
120import ca.uhn.fhir.model.dstu2.resource.DocumentReference;
121import ca.uhn.fhir.model.dstu2.valueset.DocumentReferenceStatusEnum;
122import ca.uhn.fhir.model.dstu2.valueset.DocumentRelationshipTypeEnum;
123import ca.uhn.fhir.model.dstu2.composite.ElementDefinitionDt;
124import ca.uhn.fhir.model.dstu2.resource.EligibilityRequest;
125import ca.uhn.fhir.model.dstu2.resource.Encounter;
126import ca.uhn.fhir.model.dstu2.valueset.EncounterClassEnum;
127import ca.uhn.fhir.model.dstu2.valueset.EncounterLocationStatusEnum;
128import ca.uhn.fhir.model.dstu2.valueset.EncounterStateEnum;
129import ca.uhn.fhir.model.dstu2.valueset.EncounterTypeEnum;
130import ca.uhn.fhir.model.dstu2.resource.EnrollmentRequest;
131import ca.uhn.fhir.model.dstu2.valueset.EnteralFormulaTypeCodesEnum;
132import ca.uhn.fhir.model.dstu2.resource.EpisodeOfCare;
133import ca.uhn.fhir.model.dstu2.valueset.EpisodeOfCareStatusEnum;
134import ca.uhn.fhir.model.dstu2.valueset.ExceptionCodesEnum;
135import ca.uhn.fhir.model.dstu2.valueset.ExtensionContextEnum;
136import ca.uhn.fhir.model.dstu2.valueset.FamilyHistoryStatusEnum;
137import ca.uhn.fhir.model.dstu2.resource.FamilyMemberHistory;
138import ca.uhn.fhir.model.dstu2.valueset.FilterOperatorEnum;
139import ca.uhn.fhir.model.dstu2.valueset.FlagCategoryCodesEnum;
140import ca.uhn.fhir.model.dstu2.valueset.FlagStatusEnum;
141import ca.uhn.fhir.model.dstu2.valueset.FluidConsistencyTypeCodesEnum;
142import ca.uhn.fhir.model.dstu2.resource.Goal;
143import ca.uhn.fhir.model.dstu2.valueset.GoalCategoryEnum;
144import ca.uhn.fhir.model.dstu2.valueset.GoalPriorityEnum;
145import ca.uhn.fhir.model.dstu2.valueset.GoalStartEventEnum;
146import ca.uhn.fhir.model.dstu2.valueset.GoalStatusEnum;
147import ca.uhn.fhir.model.dstu2.valueset.GoalStatusReasonEnum;
148import ca.uhn.fhir.model.dstu2.resource.Group;
149import ca.uhn.fhir.model.dstu2.valueset.GroupTypeEnum;
150import ca.uhn.fhir.model.dstu2.valueset.GuideDependencyTypeEnum;
151import ca.uhn.fhir.model.dstu2.valueset.GuidePageKindEnum;
152import ca.uhn.fhir.model.dstu2.valueset.GuideResourcePurposeEnum;
153import ca.uhn.fhir.model.dstu2.valueset.HTTPVerbEnum;
154import ca.uhn.fhir.model.dstu2.resource.HealthcareService;
155import ca.uhn.fhir.model.dstu2.composite.HumanNameDt;
156import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
157import ca.uhn.fhir.model.dstu2.valueset.IdentifierTypeCodesEnum;
158import ca.uhn.fhir.model.dstu2.valueset.IdentityAssuranceLevelEnum;
159import ca.uhn.fhir.model.dstu2.resource.ImagingObjectSelection;
160import ca.uhn.fhir.model.dstu2.resource.ImagingStudy;
161import ca.uhn.fhir.model.dstu2.resource.Immunization;
162import ca.uhn.fhir.model.dstu2.valueset.ImmunizationReasonCodesEnum;
163import ca.uhn.fhir.model.dstu2.valueset.ImmunizationRecommendationDateCriterionCodesEnum;
164import ca.uhn.fhir.model.dstu2.valueset.ImmunizationRecommendationStatusCodesEnum;
165import ca.uhn.fhir.model.dstu2.valueset.ImmunizationRouteCodesEnum;
166import ca.uhn.fhir.model.dstu2.valueset.InstanceAvailabilityEnum;
167import ca.uhn.fhir.model.dstu2.valueset.InterventionCodesEnum;
168import ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum;
169import ca.uhn.fhir.model.dstu2.valueset.IssueTypeEnum;
170import ca.uhn.fhir.model.dstu2.valueset.KOStitleEnum;
171import ca.uhn.fhir.model.dstu2.valueset.LateralityEnum;
172import ca.uhn.fhir.model.dstu2.valueset.LinkTypeEnum;
173import ca.uhn.fhir.model.dstu2.valueset.ListModeEnum;
174import ca.uhn.fhir.model.dstu2.valueset.ListOrderCodesEnum;
175import ca.uhn.fhir.model.dstu2.valueset.ListStatusEnum;
176import ca.uhn.fhir.model.dstu2.resource.Location;
177import ca.uhn.fhir.model.dstu2.valueset.LocationModeEnum;
178import ca.uhn.fhir.model.dstu2.valueset.LocationStatusEnum;
179import ca.uhn.fhir.model.dstu2.valueset.LocationTypeEnum;
180import ca.uhn.fhir.model.dstu2.valueset.MaritalStatusCodesEnum;
181import ca.uhn.fhir.model.dstu2.valueset.MeasmntPrincipleEnum;
182import ca.uhn.fhir.model.dstu2.resource.Media;
183import ca.uhn.fhir.model.dstu2.resource.Medication;
184import ca.uhn.fhir.model.dstu2.valueset.MedicationAdministrationStatusEnum;
185import ca.uhn.fhir.model.dstu2.valueset.MedicationDispenseStatusEnum;
186import ca.uhn.fhir.model.dstu2.resource.MedicationOrder;
187import ca.uhn.fhir.model.dstu2.valueset.MedicationOrderStatusEnum;
188import ca.uhn.fhir.model.dstu2.resource.MedicationStatement;
189import ca.uhn.fhir.model.dstu2.valueset.MedicationStatementStatusEnum;
190import ca.uhn.fhir.model.dstu2.valueset.MessageEventEnum;
191import ca.uhn.fhir.model.dstu2.valueset.MessageSignificanceCategoryEnum;
192import ca.uhn.fhir.model.dstu2.valueset.MessageTransportEnum;
193import ca.uhn.fhir.model.dstu2.resource.NamingSystem;
194import ca.uhn.fhir.model.dstu2.valueset.NamingSystemIdentifierTypeEnum;
195import ca.uhn.fhir.model.dstu2.valueset.NamingSystemTypeEnum;
196import ca.uhn.fhir.model.dstu2.valueset.NoteTypeEnum;
197import ca.uhn.fhir.model.dstu2.valueset.NutrientModifierCodesEnum;
198import ca.uhn.fhir.model.dstu2.resource.NutritionOrder;
199import ca.uhn.fhir.model.dstu2.valueset.NutritionOrderStatusEnum;
200import ca.uhn.fhir.model.dstu2.resource.Observation;
201import ca.uhn.fhir.model.dstu2.valueset.ObservationCategoryCodesEnum;
202import ca.uhn.fhir.model.dstu2.valueset.ObservationRelationshipTypeEnum;
203import ca.uhn.fhir.model.dstu2.valueset.ObservationStatusEnum;
204import ca.uhn.fhir.model.dstu2.resource.OperationDefinition;
205import ca.uhn.fhir.model.dstu2.valueset.OperationKindEnum;
206import ca.uhn.fhir.model.dstu2.resource.OperationOutcome;
207import ca.uhn.fhir.model.dstu2.valueset.OperationParameterUseEnum;
208import ca.uhn.fhir.model.dstu2.resource.Order;
209import ca.uhn.fhir.model.dstu2.valueset.OrderStatusEnum;
210import ca.uhn.fhir.model.dstu2.resource.Organization;
211import ca.uhn.fhir.model.dstu2.valueset.OrganizationTypeEnum;
212import ca.uhn.fhir.model.dstu2.valueset.ParticipantRequiredEnum;
213import ca.uhn.fhir.model.dstu2.valueset.ParticipantStatusEnum;
214import ca.uhn.fhir.model.dstu2.valueset.ParticipantTypeEnum;
215import ca.uhn.fhir.model.dstu2.valueset.ParticipationStatusEnum;
216import ca.uhn.fhir.model.dstu2.resource.Patient;
217import ca.uhn.fhir.model.dstu2.valueset.PayeeTypeCodesEnum;
218import ca.uhn.fhir.model.dstu2.valueset.PaymentStatusCodesEnum;
219import ca.uhn.fhir.model.dstu2.valueset.PaymentTypeCodesEnum;
220import ca.uhn.fhir.model.dstu2.composite.PeriodDt;
221import ca.uhn.fhir.model.dstu2.resource.Person;
222import ca.uhn.fhir.model.dstu2.resource.Practitioner;
223import ca.uhn.fhir.model.dstu2.valueset.PractitionerRoleEnum;
224import ca.uhn.fhir.model.dstu2.valueset.PractitionerSpecialtyEnum;
225import ca.uhn.fhir.model.dstu2.valueset.PriorityCodesEnum;
226import ca.uhn.fhir.model.dstu2.resource.Procedure;
227import ca.uhn.fhir.model.dstu2.resource.ProcedureRequest;
228import ca.uhn.fhir.model.dstu2.valueset.ProcedureRequestPriorityEnum;
229import ca.uhn.fhir.model.dstu2.valueset.ProcedureRequestStatusEnum;
230import ca.uhn.fhir.model.dstu2.valueset.ProcedureStatusEnum;
231import ca.uhn.fhir.model.dstu2.resource.ProcessRequest;
232import ca.uhn.fhir.model.dstu2.valueset.ProvenanceEntityRoleEnum;
233import ca.uhn.fhir.model.dstu2.composite.QuantityDt;
234import ca.uhn.fhir.model.dstu2.resource.Questionnaire;
235import ca.uhn.fhir.model.dstu2.resource.QuestionnaireResponse;
236import ca.uhn.fhir.model.dstu2.valueset.QuestionnaireResponseStatusEnum;
237import ca.uhn.fhir.model.dstu2.valueset.QuestionnaireStatusEnum;
238import ca.uhn.fhir.model.dstu2.composite.RangeDt;
239import ca.uhn.fhir.model.dstu2.composite.RatioDt;
240import ca.uhn.fhir.model.dstu2.valueset.ReferralMethodEnum;
241import ca.uhn.fhir.model.dstu2.resource.ReferralRequest;
242import ca.uhn.fhir.model.dstu2.valueset.ReferralStatusEnum;
243import ca.uhn.fhir.model.dstu2.resource.RelatedPerson;
244import ca.uhn.fhir.model.dstu2.valueset.RemittanceOutcomeEnum;
245import ca.uhn.fhir.model.dstu2.valueset.ResourceTypeEnum;
246import ca.uhn.fhir.model.dstu2.valueset.ResourceVersionPolicyEnum;
247import ca.uhn.fhir.model.dstu2.valueset.ResponseTypeEnum;
248import ca.uhn.fhir.model.dstu2.valueset.RestfulConformanceModeEnum;
249import ca.uhn.fhir.model.dstu2.valueset.RestfulSecurityServiceEnum;
250import ca.uhn.fhir.model.dstu2.resource.RiskAssessment;
251import ca.uhn.fhir.model.dstu2.valueset.RulesetCodesEnum;
252import ca.uhn.fhir.model.dstu2.composite.SampledDataDt;
253import ca.uhn.fhir.model.dstu2.resource.Schedule;
254import ca.uhn.fhir.model.dstu2.valueset.SearchEntryModeEnum;
255import ca.uhn.fhir.model.dstu2.valueset.SearchModifierCodeEnum;
256import ca.uhn.fhir.model.dstu2.valueset.SearchParamTypeEnum;
257import ca.uhn.fhir.model.dstu2.valueset.ServiceProvisionConditionsEnum;
258import ca.uhn.fhir.model.dstu2.composite.SignatureDt;
259import ca.uhn.fhir.model.dstu2.resource.Slot;
260import ca.uhn.fhir.model.dstu2.valueset.SlotStatusEnum;
261import ca.uhn.fhir.model.dstu2.resource.Specimen;
262import ca.uhn.fhir.model.dstu2.valueset.SpecimenCollectionMethodEnum;
263import ca.uhn.fhir.model.dstu2.valueset.SpecimenStatusEnum;
264import ca.uhn.fhir.model.dstu2.resource.StructureDefinition;
265import ca.uhn.fhir.model.dstu2.valueset.StructureDefinitionKindEnum;
266import ca.uhn.fhir.model.dstu2.valueset.SubscriptionChannelTypeEnum;
267import ca.uhn.fhir.model.dstu2.valueset.SubscriptionStatusEnum;
268import ca.uhn.fhir.model.dstu2.valueset.SubscriptionTagEnum;
269import ca.uhn.fhir.model.dstu2.resource.Substance;
270import ca.uhn.fhir.model.dstu2.valueset.SubstanceCategoryCodesEnum;
271import ca.uhn.fhir.model.dstu2.valueset.SupplementTypeCodesEnum;
272import ca.uhn.fhir.model.dstu2.valueset.SupplyDeliveryStatusEnum;
273import ca.uhn.fhir.model.dstu2.resource.SupplyRequest;
274import ca.uhn.fhir.model.dstu2.valueset.SupplyRequestReasonEnum;
275import ca.uhn.fhir.model.dstu2.valueset.SupplyRequestStatusEnum;
276import ca.uhn.fhir.model.dstu2.valueset.SurfaceCodesEnum;
277import ca.uhn.fhir.model.dstu2.valueset.SystemRestfulInteractionEnum;
278import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
279import ca.uhn.fhir.model.dstu2.valueset.TextureModifiedFoodTypeCodesEnum;
280import ca.uhn.fhir.model.dstu2.valueset.TextureModifierCodesEnum;
281import ca.uhn.fhir.model.dstu2.composite.TimingDt;
282import ca.uhn.fhir.model.dstu2.valueset.TransactionModeEnum;
283import ca.uhn.fhir.model.dstu2.valueset.TypeRestfulInteractionEnum;
284import ca.uhn.fhir.model.dstu2.valueset.UDICodesEnum;
285import ca.uhn.fhir.model.dstu2.valueset.UnknownContentCodeEnum;
286import ca.uhn.fhir.model.dstu2.valueset.UseEnum;
287import ca.uhn.fhir.model.dstu2.resource.ValueSet;
288import ca.uhn.fhir.model.dstu2.valueset.VisionBaseEnum;
289import ca.uhn.fhir.model.dstu2.valueset.VisionEyesEnum;
290import ca.uhn.fhir.model.dstu2.resource.VisionPrescription;
291import ca.uhn.fhir.model.dstu2.valueset.XPathUsageTypeEnum;
292import ca.uhn.fhir.model.api.IResource;
293import ca.uhn.fhir.model.dstu2.composite.AgeDt;
294import ca.uhn.fhir.model.dstu2.composite.BoundCodeableConceptDt;
295import ca.uhn.fhir.model.dstu2.composite.DurationDt;
296import ca.uhn.fhir.model.dstu2.composite.MoneyDt;
297import ca.uhn.fhir.model.dstu2.composite.NarrativeDt;
298import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt;
299import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt;
300import ca.uhn.fhir.model.primitive.Base64BinaryDt;
301import ca.uhn.fhir.model.primitive.BooleanDt;
302import ca.uhn.fhir.model.primitive.BoundCodeDt;
303import ca.uhn.fhir.model.primitive.CodeDt;
304import ca.uhn.fhir.model.primitive.DateDt;
305import ca.uhn.fhir.model.primitive.DateTimeDt;
306import ca.uhn.fhir.model.primitive.DecimalDt;
307import ca.uhn.fhir.model.primitive.IdDt;
308import ca.uhn.fhir.model.primitive.InstantDt;
309import ca.uhn.fhir.model.primitive.IntegerDt;
310import ca.uhn.fhir.model.primitive.OidDt;
311import ca.uhn.fhir.model.primitive.PositiveIntDt;
312import ca.uhn.fhir.model.primitive.StringDt;
313import ca.uhn.fhir.model.primitive.TimeDt;
314import ca.uhn.fhir.model.primitive.UnsignedIntDt;
315import ca.uhn.fhir.model.primitive.UriDt;
316
317
318/**
319 * HAPI/FHIR <b>EpisodeOfCare</b> Resource
320 * (workflow.encounter)
321 *
322 * <p>
323 * <b>Definition:</b>
324 * 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.
325 * </p> 
326 *
327 * <p>
328 * <b>Requirements:</b>
329 * 
330 * </p> 
331 *
332 * <p>
333 * <b>Profile Definition:</b>
334 * <a href="http://hl7.org/fhir/profiles/EpisodeOfCare">http://hl7.org/fhir/profiles/EpisodeOfCare</a> 
335 * </p>
336 *
337 */
338@ResourceDef(name="EpisodeOfCare", profile="http://hl7.org/fhir/profiles/EpisodeOfCare", id="episodeofcare")
339public class EpisodeOfCare extends ca.uhn.fhir.model.dstu2.resource.BaseResource
340    implements  IResource     {
341
342        /**
343         * Search parameter constant for <b>patient</b>
344         * <p>
345         * Description: <b></b><br>
346         * Type: <b>reference</b><br>
347         * Path: <b>EpisodeOfCare.patient</b><br>
348         * </p>
349         */
350        @SearchParamDefinition(name="patient", path="EpisodeOfCare.patient", description="", type="reference"  )
351        public static final String SP_PATIENT = "patient";
352
353        /**
354         * <b>Fluent Client</b> search parameter constant for <b>patient</b>
355         * <p>
356         * Description: <b></b><br>
357         * Type: <b>reference</b><br>
358         * Path: <b>EpisodeOfCare.patient</b><br>
359         * </p>
360         */
361        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
362
363        /**
364         * Search parameter constant for <b>identifier</b>
365         * <p>
366         * Description: <b></b><br>
367         * Type: <b>token</b><br>
368         * Path: <b>EpisodeOfCare.identifier</b><br>
369         * </p>
370         */
371        @SearchParamDefinition(name="identifier", path="EpisodeOfCare.identifier", description="", type="token"  )
372        public static final String SP_IDENTIFIER = "identifier";
373
374        /**
375         * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
376         * <p>
377         * Description: <b></b><br>
378         * Type: <b>token</b><br>
379         * Path: <b>EpisodeOfCare.identifier</b><br>
380         * </p>
381         */
382        public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
383
384        /**
385         * Search parameter constant for <b>status</b>
386         * <p>
387         * Description: <b>The current status of the Episode of Care as provided (does not check the status history collection)</b><br>
388         * Type: <b>token</b><br>
389         * Path: <b>EpisodeOfCare.status</b><br>
390         * </p>
391         */
392        @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"  )
393        public static final String SP_STATUS = "status";
394
395        /**
396         * <b>Fluent Client</b> search parameter constant for <b>status</b>
397         * <p>
398         * Description: <b>The current status of the Episode of Care as provided (does not check the status history collection)</b><br>
399         * Type: <b>token</b><br>
400         * Path: <b>EpisodeOfCare.status</b><br>
401         * </p>
402         */
403        public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS);
404
405        /**
406         * Search parameter constant for <b>organization</b>
407         * <p>
408         * Description: <b>The organization that has assumed the specific responsibilities of this EpisodeOfCare</b><br>
409         * Type: <b>reference</b><br>
410         * Path: <b>EpisodeOfCare.managingOrganization</b><br>
411         * </p>
412         */
413        @SearchParamDefinition(name="organization", path="EpisodeOfCare.managingOrganization", description="The organization that has assumed the specific responsibilities of this EpisodeOfCare", type="reference"  )
414        public static final String SP_ORGANIZATION = "organization";
415
416        /**
417         * <b>Fluent Client</b> search parameter constant for <b>organization</b>
418         * <p>
419         * Description: <b>The organization that has assumed the specific responsibilities of this EpisodeOfCare</b><br>
420         * Type: <b>reference</b><br>
421         * Path: <b>EpisodeOfCare.managingOrganization</b><br>
422         * </p>
423         */
424        public static final ReferenceClientParam ORGANIZATION = new ReferenceClientParam(SP_ORGANIZATION);
425
426        /**
427         * Search parameter constant for <b>date</b>
428         * <p>
429         * Description: <b>The provided date search value falls within the episode of care's period</b><br>
430         * Type: <b>date</b><br>
431         * Path: <b>EpisodeOfCare.period</b><br>
432         * </p>
433         */
434        @SearchParamDefinition(name="date", path="EpisodeOfCare.period", description="The provided date search value falls within the episode of care's period", type="date"  )
435        public static final String SP_DATE = "date";
436
437        /**
438         * <b>Fluent Client</b> search parameter constant for <b>date</b>
439         * <p>
440         * Description: <b>The provided date search value falls within the episode of care's period</b><br>
441         * Type: <b>date</b><br>
442         * Path: <b>EpisodeOfCare.period</b><br>
443         * </p>
444         */
445        public static final DateClientParam DATE = new DateClientParam(SP_DATE);
446
447        /**
448         * Search parameter constant for <b>type</b>
449         * <p>
450         * Description: <b></b><br>
451         * Type: <b>token</b><br>
452         * Path: <b>EpisodeOfCare.type</b><br>
453         * </p>
454         */
455        @SearchParamDefinition(name="type", path="EpisodeOfCare.type", description="", type="token"  )
456        public static final String SP_TYPE = "type";
457
458        /**
459         * <b>Fluent Client</b> search parameter constant for <b>type</b>
460         * <p>
461         * Description: <b></b><br>
462         * Type: <b>token</b><br>
463         * Path: <b>EpisodeOfCare.type</b><br>
464         * </p>
465         */
466        public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE);
467
468        /**
469         * Search parameter constant for <b>condition</b>
470         * <p>
471         * Description: <b></b><br>
472         * Type: <b>reference</b><br>
473         * Path: <b>EpisodeOfCare.condition</b><br>
474         * </p>
475         */
476        @SearchParamDefinition(name="condition", path="EpisodeOfCare.condition", description="", type="reference"  )
477        public static final String SP_CONDITION = "condition";
478
479        /**
480         * <b>Fluent Client</b> search parameter constant for <b>condition</b>
481         * <p>
482         * Description: <b></b><br>
483         * Type: <b>reference</b><br>
484         * Path: <b>EpisodeOfCare.condition</b><br>
485         * </p>
486         */
487        public static final ReferenceClientParam CONDITION = new ReferenceClientParam(SP_CONDITION);
488
489        /**
490         * Search parameter constant for <b>incomingreferral</b>
491         * <p>
492         * Description: <b>Incoming Referral Request</b><br>
493         * Type: <b>reference</b><br>
494         * Path: <b>EpisodeOfCare.referralRequest</b><br>
495         * </p>
496         */
497        @SearchParamDefinition(name="incomingreferral", path="EpisodeOfCare.referralRequest", description="Incoming Referral Request", type="reference"  )
498        public static final String SP_INCOMINGREFERRAL = "incomingreferral";
499
500        /**
501         * <b>Fluent Client</b> search parameter constant for <b>incomingreferral</b>
502         * <p>
503         * Description: <b>Incoming Referral Request</b><br>
504         * Type: <b>reference</b><br>
505         * Path: <b>EpisodeOfCare.referralRequest</b><br>
506         * </p>
507         */
508        public static final ReferenceClientParam INCOMINGREFERRAL = new ReferenceClientParam(SP_INCOMINGREFERRAL);
509
510        /**
511         * Search parameter constant for <b>care-manager</b>
512         * <p>
513         * Description: <b></b><br>
514         * Type: <b>reference</b><br>
515         * Path: <b>EpisodeOfCare.careManager</b><br>
516         * </p>
517         */
518        @SearchParamDefinition(name="care-manager", path="EpisodeOfCare.careManager", description="", type="reference"  )
519        public static final String SP_CARE_MANAGER = "care-manager";
520
521        /**
522         * <b>Fluent Client</b> search parameter constant for <b>care-manager</b>
523         * <p>
524         * Description: <b></b><br>
525         * Type: <b>reference</b><br>
526         * Path: <b>EpisodeOfCare.careManager</b><br>
527         * </p>
528         */
529        public static final ReferenceClientParam CARE_MANAGER = new ReferenceClientParam(SP_CARE_MANAGER);
530
531        /**
532         * 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        @SearchParamDefinition(name="team-member", path="EpisodeOfCare.careTeam.member", description="A Practitioner or Organization allocated to the care team for this EpisodeOfCare", type="reference"  )
540        public static final String SP_TEAM_MEMBER = "team-member";
541
542        /**
543         * <b>Fluent Client</b> search parameter constant for <b>team-member</b>
544         * <p>
545         * Description: <b>A Practitioner or Organization allocated to the care team for this EpisodeOfCare</b><br>
546         * Type: <b>reference</b><br>
547         * Path: <b>EpisodeOfCare.careTeam.member</b><br>
548         * </p>
549         */
550        public static final ReferenceClientParam TEAM_MEMBER = new ReferenceClientParam(SP_TEAM_MEMBER);
551
552
553        /**
554         * Constant for fluent queries to be used to add include statements. Specifies
555         * the path value of "<b>EpisodeOfCare:care-manager</b>".
556         */
557        public static final Include INCLUDE_CARE_MANAGER = new Include("EpisodeOfCare:care-manager");
558
559        /**
560         * Constant for fluent queries to be used to add include statements. Specifies
561         * the path value of "<b>EpisodeOfCare:condition</b>".
562         */
563        public static final Include INCLUDE_CONDITION = new Include("EpisodeOfCare:condition");
564
565        /**
566         * Constant for fluent queries to be used to add include statements. Specifies
567         * the path value of "<b>EpisodeOfCare:incomingreferral</b>".
568         */
569        public static final Include INCLUDE_INCOMINGREFERRAL = new Include("EpisodeOfCare:incomingreferral");
570
571        /**
572         * Constant for fluent queries to be used to add include statements. Specifies
573         * the path value of "<b>EpisodeOfCare:organization</b>".
574         */
575        public static final Include INCLUDE_ORGANIZATION = new Include("EpisodeOfCare:organization");
576
577        /**
578         * Constant for fluent queries to be used to add include statements. Specifies
579         * the path value of "<b>EpisodeOfCare:patient</b>".
580         */
581        public static final Include INCLUDE_PATIENT = new Include("EpisodeOfCare:patient");
582
583        /**
584         * Constant for fluent queries to be used to add include statements. Specifies
585         * the path value of "<b>EpisodeOfCare:team-member</b>".
586         */
587        public static final Include INCLUDE_TEAM_MEMBER = new Include("EpisodeOfCare:team-member");
588
589
590        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
591        @Description(
592                shortDefinition="id",
593                formalDefinition="Identifier(s) by which this EpisodeOfCare is known"
594        )
595        private java.util.List<IdentifierDt> myIdentifier;
596        
597        @Child(name="status", type=CodeDt.class, order=1, min=1, max=1, summary=true, modifier=true)    
598        @Description(
599                shortDefinition="status",
600                formalDefinition="planned | waitlist | active | onhold | finished | cancelled"
601        )
602        private BoundCodeDt<EpisodeOfCareStatusEnum> myStatus;
603        
604        @Child(name="statusHistory", order=2, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)    
605        @Description(
606                shortDefinition="",
607                formalDefinition="The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)"
608        )
609        private java.util.List<StatusHistory> myStatusHistory;
610        
611        @Child(name="type", type=CodeableConceptDt.class, order=3, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)        
612        @Description(
613                shortDefinition="class",
614                formalDefinition="A classification of the type of encounter; e.g. specialist referral, disease management, type of funded care"
615        )
616        private java.util.List<CodeableConceptDt> myType;
617        
618        @Child(name="condition", order=4, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
619                ca.uhn.fhir.model.dstu2.resource.Condition.class        })
620        @Description(
621                shortDefinition="what",
622                formalDefinition="A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for"
623        )
624        private java.util.List<ResourceReferenceDt> myCondition;
625        
626        @Child(name="patient", order=5, min=1, max=1, summary=true, modifier=false, type={
627                ca.uhn.fhir.model.dstu2.resource.Patient.class  })
628        @Description(
629                shortDefinition="who.focus",
630                formalDefinition="The patient that this EpisodeOfCare applies to"
631        )
632        private ResourceReferenceDt myPatient;
633        
634        @Child(name="managingOrganization", order=6, min=0, max=1, summary=true, modifier=false, type={
635                ca.uhn.fhir.model.dstu2.resource.Organization.class     })
636        @Description(
637                shortDefinition="",
638                formalDefinition="The organization that has assumed the specific responsibilities for the specified duration"
639        )
640        private ResourceReferenceDt myManagingOrganization;
641        
642        @Child(name="period", type=PeriodDt.class, order=7, min=0, max=1, summary=true, modifier=false) 
643        @Description(
644                shortDefinition="when.init",
645                formalDefinition="The interval during which the managing organization assumes the defined responsibility"
646        )
647        private PeriodDt myPeriod;
648        
649        @Child(name="referralRequest", order=8, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
650                ca.uhn.fhir.model.dstu2.resource.ReferralRequest.class  })
651        @Description(
652                shortDefinition="",
653                formalDefinition="Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals"
654        )
655        private java.util.List<ResourceReferenceDt> myReferralRequest;
656        
657        @Child(name="careManager", order=9, min=0, max=1, summary=false, modifier=false, type={
658                ca.uhn.fhir.model.dstu2.resource.Practitioner.class     })
659        @Description(
660                shortDefinition="",
661                formalDefinition="The practitioner that is the care manager/care co-ordinator for this patient"
662        )
663        private ResourceReferenceDt myCareManager;
664        
665        @Child(name="careTeam", order=10, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)        
666        @Description(
667                shortDefinition="",
668                formalDefinition="The list of practitioners that may be facilitating this episode of care for specific purposes"
669        )
670        private java.util.List<CareTeam> myCareTeam;
671        
672
673        @Override
674        public boolean isEmpty() {
675                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myStatus,  myStatusHistory,  myType,  myCondition,  myPatient,  myManagingOrganization,  myPeriod,  myReferralRequest,  myCareManager,  myCareTeam);
676        }
677        
678        @Override
679        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
680                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myStatus, myStatusHistory, myType, myCondition, myPatient, myManagingOrganization, myPeriod, myReferralRequest, myCareManager, myCareTeam);
681        }
682
683        /**
684         * Gets the value(s) for <b>identifier</b> (id).
685         * creating it if it does
686         * not exist. Will not return <code>null</code>.
687         *
688     * <p>
689     * <b>Definition:</b>
690     * Identifier(s) by which this EpisodeOfCare is known
691     * </p> 
692         */
693        public java.util.List<IdentifierDt> getIdentifier() {  
694                if (myIdentifier == null) {
695                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
696                }
697                return myIdentifier;
698        }
699
700        /**
701         * Sets the value(s) for <b>identifier</b> (id)
702         *
703     * <p>
704     * <b>Definition:</b>
705     * Identifier(s) by which this EpisodeOfCare is known
706     * </p> 
707         */
708        public EpisodeOfCare setIdentifier(java.util.List<IdentifierDt> theValue) {
709                myIdentifier = theValue;
710                return this;
711        }
712        
713        
714
715        /**
716         * Adds and returns a new value for <b>identifier</b> (id)
717         *
718     * <p>
719     * <b>Definition:</b>
720     * Identifier(s) by which this EpisodeOfCare is known
721     * </p> 
722         */
723        public IdentifierDt addIdentifier() {
724                IdentifierDt newType = new IdentifierDt();
725                getIdentifier().add(newType);
726                return newType; 
727        }
728
729        /**
730         * Adds a given new value for <b>identifier</b> (id)
731         *
732         * <p>
733         * <b>Definition:</b>
734         * Identifier(s) by which this EpisodeOfCare is known
735         * </p>
736         * @param theValue The identifier to add (must not be <code>null</code>)
737         */
738        public EpisodeOfCare addIdentifier(IdentifierDt theValue) {
739                if (theValue == null) {
740                        throw new NullPointerException("theValue must not be null");
741                }
742                getIdentifier().add(theValue);
743                return this;
744        }
745
746        /**
747         * Gets the first repetition for <b>identifier</b> (id),
748         * creating it if it does not already exist.
749         *
750     * <p>
751     * <b>Definition:</b>
752     * Identifier(s) by which this EpisodeOfCare is known
753     * </p> 
754         */
755        public IdentifierDt getIdentifierFirstRep() {
756                if (getIdentifier().isEmpty()) {
757                        return addIdentifier();
758                }
759                return getIdentifier().get(0); 
760        }
761  
762        /**
763         * Gets the value(s) for <b>status</b> (status).
764         * creating it if it does
765         * not exist. Will not return <code>null</code>.
766         *
767     * <p>
768     * <b>Definition:</b>
769     * planned | waitlist | active | onhold | finished | cancelled
770     * </p> 
771         */
772        public BoundCodeDt<EpisodeOfCareStatusEnum> getStatusElement() {  
773                if (myStatus == null) {
774                        myStatus = new BoundCodeDt<EpisodeOfCareStatusEnum>(EpisodeOfCareStatusEnum.VALUESET_BINDER);
775                }
776                return myStatus;
777        }
778
779        
780        /**
781         * Gets the value(s) for <b>status</b> (status).
782         * creating it if it does
783         * not exist. Will not return <code>null</code>.
784         *
785     * <p>
786     * <b>Definition:</b>
787     * planned | waitlist | active | onhold | finished | cancelled
788     * </p> 
789         */
790        public String getStatus() {  
791                return getStatusElement().getValue();
792        }
793
794        /**
795         * Sets the value(s) for <b>status</b> (status)
796         *
797     * <p>
798     * <b>Definition:</b>
799     * planned | waitlist | active | onhold | finished | cancelled
800     * </p> 
801         */
802        public EpisodeOfCare setStatus(BoundCodeDt<EpisodeOfCareStatusEnum> theValue) {
803                myStatus = theValue;
804                return this;
805        }
806        
807        
808
809        /**
810         * Sets the value(s) for <b>status</b> (status)
811         *
812     * <p>
813     * <b>Definition:</b>
814     * planned | waitlist | active | onhold | finished | cancelled
815     * </p> 
816         */
817        public EpisodeOfCare setStatus(EpisodeOfCareStatusEnum theValue) {
818                setStatus(new BoundCodeDt<EpisodeOfCareStatusEnum>(EpisodeOfCareStatusEnum.VALUESET_BINDER, theValue));
819                
820/*
821                getStatusElement().setValueAsEnum(theValue);
822*/
823                return this;
824        }
825
826  
827        /**
828         * Gets the value(s) for <b>statusHistory</b> ().
829         * creating it if it does
830         * not exist. Will not return <code>null</code>.
831         *
832     * <p>
833     * <b>Definition:</b>
834     * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)
835     * </p> 
836         */
837        public java.util.List<StatusHistory> getStatusHistory() {  
838                if (myStatusHistory == null) {
839                        myStatusHistory = new java.util.ArrayList<StatusHistory>();
840                }
841                return myStatusHistory;
842        }
843
844        /**
845         * Sets the value(s) for <b>statusHistory</b> ()
846         *
847     * <p>
848     * <b>Definition:</b>
849     * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)
850     * </p> 
851         */
852        public EpisodeOfCare setStatusHistory(java.util.List<StatusHistory> theValue) {
853                myStatusHistory = theValue;
854                return this;
855        }
856        
857        
858
859        /**
860         * Adds and returns a new value for <b>statusHistory</b> ()
861         *
862     * <p>
863     * <b>Definition:</b>
864     * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)
865     * </p> 
866         */
867        public StatusHistory addStatusHistory() {
868                StatusHistory newType = new StatusHistory();
869                getStatusHistory().add(newType);
870                return newType; 
871        }
872
873        /**
874         * Adds a given new value for <b>statusHistory</b> ()
875         *
876         * <p>
877         * <b>Definition:</b>
878         * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)
879         * </p>
880         * @param theValue The statusHistory to add (must not be <code>null</code>)
881         */
882        public EpisodeOfCare addStatusHistory(StatusHistory theValue) {
883                if (theValue == null) {
884                        throw new NullPointerException("theValue must not be null");
885                }
886                getStatusHistory().add(theValue);
887                return this;
888        }
889
890        /**
891         * Gets the first repetition for <b>statusHistory</b> (),
892         * creating it if it does not already exist.
893         *
894     * <p>
895     * <b>Definition:</b>
896     * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)
897     * </p> 
898         */
899        public StatusHistory getStatusHistoryFirstRep() {
900                if (getStatusHistory().isEmpty()) {
901                        return addStatusHistory();
902                }
903                return getStatusHistory().get(0); 
904        }
905  
906        /**
907         * Gets the value(s) for <b>type</b> (class).
908         * creating it if it does
909         * not exist. Will not return <code>null</code>.
910         *
911     * <p>
912     * <b>Definition:</b>
913     * A classification of the type of encounter; e.g. specialist referral, disease management, type of funded care
914     * </p> 
915         */
916        public java.util.List<CodeableConceptDt> getType() {  
917                if (myType == null) {
918                        myType = new java.util.ArrayList<CodeableConceptDt>();
919                }
920                return myType;
921        }
922
923        /**
924         * Sets the value(s) for <b>type</b> (class)
925         *
926     * <p>
927     * <b>Definition:</b>
928     * A classification of the type of encounter; e.g. specialist referral, disease management, type of funded care
929     * </p> 
930         */
931        public EpisodeOfCare setType(java.util.List<CodeableConceptDt> theValue) {
932                myType = theValue;
933                return this;
934        }
935        
936        
937
938        /**
939         * Adds and returns a new value for <b>type</b> (class)
940         *
941     * <p>
942     * <b>Definition:</b>
943     * A classification of the type of encounter; e.g. specialist referral, disease management, type of funded care
944     * </p> 
945         */
946        public CodeableConceptDt addType() {
947                CodeableConceptDt newType = new CodeableConceptDt();
948                getType().add(newType);
949                return newType; 
950        }
951
952        /**
953         * Adds a given new value for <b>type</b> (class)
954         *
955         * <p>
956         * <b>Definition:</b>
957         * A classification of the type of encounter; e.g. specialist referral, disease management, type of funded care
958         * </p>
959         * @param theValue The type to add (must not be <code>null</code>)
960         */
961        public EpisodeOfCare addType(CodeableConceptDt theValue) {
962                if (theValue == null) {
963                        throw new NullPointerException("theValue must not be null");
964                }
965                getType().add(theValue);
966                return this;
967        }
968
969        /**
970         * Gets the first repetition for <b>type</b> (class),
971         * creating it if it does not already exist.
972         *
973     * <p>
974     * <b>Definition:</b>
975     * A classification of the type of encounter; e.g. specialist referral, disease management, type of funded care
976     * </p> 
977         */
978        public CodeableConceptDt getTypeFirstRep() {
979                if (getType().isEmpty()) {
980                        return addType();
981                }
982                return getType().get(0); 
983        }
984  
985        /**
986         * Gets the value(s) for <b>condition</b> (what).
987         * creating it if it does
988         * not exist. Will not return <code>null</code>.
989         *
990     * <p>
991     * <b>Definition:</b>
992     * A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for
993     * </p> 
994         */
995        public java.util.List<ResourceReferenceDt> getCondition() {  
996                if (myCondition == null) {
997                        myCondition = new java.util.ArrayList<ResourceReferenceDt>();
998                }
999                return myCondition;
1000        }
1001
1002        /**
1003         * Sets the value(s) for <b>condition</b> (what)
1004         *
1005     * <p>
1006     * <b>Definition:</b>
1007     * A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for
1008     * </p> 
1009         */
1010        public EpisodeOfCare setCondition(java.util.List<ResourceReferenceDt> theValue) {
1011                myCondition = theValue;
1012                return this;
1013        }
1014        
1015        
1016
1017        /**
1018         * Adds and returns a new value for <b>condition</b> (what)
1019         *
1020     * <p>
1021     * <b>Definition:</b>
1022     * A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for
1023     * </p> 
1024         */
1025        public ResourceReferenceDt addCondition() {
1026                ResourceReferenceDt newType = new ResourceReferenceDt();
1027                getCondition().add(newType);
1028                return newType; 
1029        }
1030  
1031        /**
1032         * Gets the value(s) for <b>patient</b> (who.focus).
1033         * creating it if it does
1034         * not exist. Will not return <code>null</code>.
1035         *
1036     * <p>
1037     * <b>Definition:</b>
1038     * The patient that this EpisodeOfCare applies to
1039     * </p> 
1040         */
1041        public ResourceReferenceDt getPatient() {  
1042                if (myPatient == null) {
1043                        myPatient = new ResourceReferenceDt();
1044                }
1045                return myPatient;
1046        }
1047
1048        /**
1049         * Sets the value(s) for <b>patient</b> (who.focus)
1050         *
1051     * <p>
1052     * <b>Definition:</b>
1053     * The patient that this EpisodeOfCare applies to
1054     * </p> 
1055         */
1056        public EpisodeOfCare setPatient(ResourceReferenceDt theValue) {
1057                myPatient = theValue;
1058                return this;
1059        }
1060        
1061        
1062
1063  
1064        /**
1065         * Gets the value(s) for <b>managingOrganization</b> ().
1066         * creating it if it does
1067         * not exist. Will not return <code>null</code>.
1068         *
1069     * <p>
1070     * <b>Definition:</b>
1071     * The organization that has assumed the specific responsibilities for the specified duration
1072     * </p> 
1073         */
1074        public ResourceReferenceDt getManagingOrganization() {  
1075                if (myManagingOrganization == null) {
1076                        myManagingOrganization = new ResourceReferenceDt();
1077                }
1078                return myManagingOrganization;
1079        }
1080
1081        /**
1082         * Sets the value(s) for <b>managingOrganization</b> ()
1083         *
1084     * <p>
1085     * <b>Definition:</b>
1086     * The organization that has assumed the specific responsibilities for the specified duration
1087     * </p> 
1088         */
1089        public EpisodeOfCare setManagingOrganization(ResourceReferenceDt theValue) {
1090                myManagingOrganization = theValue;
1091                return this;
1092        }
1093        
1094        
1095
1096  
1097        /**
1098         * Gets the value(s) for <b>period</b> (when.init).
1099         * creating it if it does
1100         * not exist. Will not return <code>null</code>.
1101         *
1102     * <p>
1103     * <b>Definition:</b>
1104     * The interval during which the managing organization assumes the defined responsibility
1105     * </p> 
1106         */
1107        public PeriodDt getPeriod() {  
1108                if (myPeriod == null) {
1109                        myPeriod = new PeriodDt();
1110                }
1111                return myPeriod;
1112        }
1113
1114        /**
1115         * Sets the value(s) for <b>period</b> (when.init)
1116         *
1117     * <p>
1118     * <b>Definition:</b>
1119     * The interval during which the managing organization assumes the defined responsibility
1120     * </p> 
1121         */
1122        public EpisodeOfCare setPeriod(PeriodDt theValue) {
1123                myPeriod = theValue;
1124                return this;
1125        }
1126        
1127        
1128
1129  
1130        /**
1131         * Gets the value(s) for <b>referralRequest</b> ().
1132         * creating it if it does
1133         * not exist. Will not return <code>null</code>.
1134         *
1135     * <p>
1136     * <b>Definition:</b>
1137     * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals
1138     * </p> 
1139         */
1140        public java.util.List<ResourceReferenceDt> getReferralRequest() {  
1141                if (myReferralRequest == null) {
1142                        myReferralRequest = new java.util.ArrayList<ResourceReferenceDt>();
1143                }
1144                return myReferralRequest;
1145        }
1146
1147        /**
1148         * Sets the value(s) for <b>referralRequest</b> ()
1149         *
1150     * <p>
1151     * <b>Definition:</b>
1152     * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals
1153     * </p> 
1154         */
1155        public EpisodeOfCare setReferralRequest(java.util.List<ResourceReferenceDt> theValue) {
1156                myReferralRequest = theValue;
1157                return this;
1158        }
1159        
1160        
1161
1162        /**
1163         * Adds and returns a new value for <b>referralRequest</b> ()
1164         *
1165     * <p>
1166     * <b>Definition:</b>
1167     * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals
1168     * </p> 
1169         */
1170        public ResourceReferenceDt addReferralRequest() {
1171                ResourceReferenceDt newType = new ResourceReferenceDt();
1172                getReferralRequest().add(newType);
1173                return newType; 
1174        }
1175  
1176        /**
1177         * Gets the value(s) for <b>careManager</b> ().
1178         * creating it if it does
1179         * not exist. Will not return <code>null</code>.
1180         *
1181     * <p>
1182     * <b>Definition:</b>
1183     * The practitioner that is the care manager/care co-ordinator for this patient
1184     * </p> 
1185         */
1186        public ResourceReferenceDt getCareManager() {  
1187                if (myCareManager == null) {
1188                        myCareManager = new ResourceReferenceDt();
1189                }
1190                return myCareManager;
1191        }
1192
1193        /**
1194         * Sets the value(s) for <b>careManager</b> ()
1195         *
1196     * <p>
1197     * <b>Definition:</b>
1198     * The practitioner that is the care manager/care co-ordinator for this patient
1199     * </p> 
1200         */
1201        public EpisodeOfCare setCareManager(ResourceReferenceDt theValue) {
1202                myCareManager = theValue;
1203                return this;
1204        }
1205        
1206        
1207
1208  
1209        /**
1210         * Gets the value(s) for <b>careTeam</b> ().
1211         * creating it if it does
1212         * not exist. Will not return <code>null</code>.
1213         *
1214     * <p>
1215     * <b>Definition:</b>
1216     * The list of practitioners that may be facilitating this episode of care for specific purposes
1217     * </p> 
1218         */
1219        public java.util.List<CareTeam> getCareTeam() {  
1220                if (myCareTeam == null) {
1221                        myCareTeam = new java.util.ArrayList<CareTeam>();
1222                }
1223                return myCareTeam;
1224        }
1225
1226        /**
1227         * Sets the value(s) for <b>careTeam</b> ()
1228         *
1229     * <p>
1230     * <b>Definition:</b>
1231     * The list of practitioners that may be facilitating this episode of care for specific purposes
1232     * </p> 
1233         */
1234        public EpisodeOfCare setCareTeam(java.util.List<CareTeam> theValue) {
1235                myCareTeam = theValue;
1236                return this;
1237        }
1238        
1239        
1240
1241        /**
1242         * Adds and returns a new value for <b>careTeam</b> ()
1243         *
1244     * <p>
1245     * <b>Definition:</b>
1246     * The list of practitioners that may be facilitating this episode of care for specific purposes
1247     * </p> 
1248         */
1249        public CareTeam addCareTeam() {
1250                CareTeam newType = new CareTeam();
1251                getCareTeam().add(newType);
1252                return newType; 
1253        }
1254
1255        /**
1256         * Adds a given new value for <b>careTeam</b> ()
1257         *
1258         * <p>
1259         * <b>Definition:</b>
1260         * The list of practitioners that may be facilitating this episode of care for specific purposes
1261         * </p>
1262         * @param theValue The careTeam to add (must not be <code>null</code>)
1263         */
1264        public EpisodeOfCare addCareTeam(CareTeam theValue) {
1265                if (theValue == null) {
1266                        throw new NullPointerException("theValue must not be null");
1267                }
1268                getCareTeam().add(theValue);
1269                return this;
1270        }
1271
1272        /**
1273         * Gets the first repetition for <b>careTeam</b> (),
1274         * creating it if it does not already exist.
1275         *
1276     * <p>
1277     * <b>Definition:</b>
1278     * The list of practitioners that may be facilitating this episode of care for specific purposes
1279     * </p> 
1280         */
1281        public CareTeam getCareTeamFirstRep() {
1282                if (getCareTeam().isEmpty()) {
1283                        return addCareTeam();
1284                }
1285                return getCareTeam().get(0); 
1286        }
1287  
1288        /**
1289         * Block class for child element: <b>EpisodeOfCare.statusHistory</b> ()
1290         *
1291     * <p>
1292     * <b>Definition:</b>
1293     * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)
1294     * </p> 
1295         */
1296        @Block()        
1297        public static class StatusHistory 
1298            extends  BaseIdentifiableElement        implements IResourceBlock {
1299        
1300        @Child(name="status", type=CodeDt.class, order=0, min=1, max=1, summary=false, modifier=false)  
1301        @Description(
1302                shortDefinition="",
1303                formalDefinition="planned | waitlist | active | onhold | finished | cancelled"
1304        )
1305        private BoundCodeDt<EpisodeOfCareStatusEnum> myStatus;
1306        
1307        @Child(name="period", type=PeriodDt.class, order=1, min=1, max=1, summary=false, modifier=false)        
1308        @Description(
1309                shortDefinition="",
1310                formalDefinition="The period during this EpisodeOfCare that the specific status applied"
1311        )
1312        private PeriodDt myPeriod;
1313        
1314
1315        @Override
1316        public boolean isEmpty() {
1317                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myStatus,  myPeriod);
1318        }
1319        
1320        @Override
1321        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1322                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myStatus, myPeriod);
1323        }
1324
1325        /**
1326         * Gets the value(s) for <b>status</b> ().
1327         * creating it if it does
1328         * not exist. Will not return <code>null</code>.
1329         *
1330     * <p>
1331     * <b>Definition:</b>
1332     * planned | waitlist | active | onhold | finished | cancelled
1333     * </p> 
1334         */
1335        public BoundCodeDt<EpisodeOfCareStatusEnum> getStatusElement() {  
1336                if (myStatus == null) {
1337                        myStatus = new BoundCodeDt<EpisodeOfCareStatusEnum>(EpisodeOfCareStatusEnum.VALUESET_BINDER);
1338                }
1339                return myStatus;
1340        }
1341
1342        
1343        /**
1344         * Gets the value(s) for <b>status</b> ().
1345         * creating it if it does
1346         * not exist. Will not return <code>null</code>.
1347         *
1348     * <p>
1349     * <b>Definition:</b>
1350     * planned | waitlist | active | onhold | finished | cancelled
1351     * </p> 
1352         */
1353        public String getStatus() {  
1354                return getStatusElement().getValue();
1355        }
1356
1357        /**
1358         * Sets the value(s) for <b>status</b> ()
1359         *
1360     * <p>
1361     * <b>Definition:</b>
1362     * planned | waitlist | active | onhold | finished | cancelled
1363     * </p> 
1364         */
1365        public StatusHistory setStatus(BoundCodeDt<EpisodeOfCareStatusEnum> theValue) {
1366                myStatus = theValue;
1367                return this;
1368        }
1369        
1370        
1371
1372        /**
1373         * Sets the value(s) for <b>status</b> ()
1374         *
1375     * <p>
1376     * <b>Definition:</b>
1377     * planned | waitlist | active | onhold | finished | cancelled
1378     * </p> 
1379         */
1380        public StatusHistory setStatus(EpisodeOfCareStatusEnum theValue) {
1381                setStatus(new BoundCodeDt<EpisodeOfCareStatusEnum>(EpisodeOfCareStatusEnum.VALUESET_BINDER, theValue));
1382                
1383/*
1384                getStatusElement().setValueAsEnum(theValue);
1385*/
1386                return this;
1387        }
1388
1389  
1390        /**
1391         * Gets the value(s) for <b>period</b> ().
1392         * creating it if it does
1393         * not exist. Will not return <code>null</code>.
1394         *
1395     * <p>
1396     * <b>Definition:</b>
1397     * The period during this EpisodeOfCare that the specific status applied
1398     * </p> 
1399         */
1400        public PeriodDt getPeriod() {  
1401                if (myPeriod == null) {
1402                        myPeriod = new PeriodDt();
1403                }
1404                return myPeriod;
1405        }
1406
1407        /**
1408         * Sets the value(s) for <b>period</b> ()
1409         *
1410     * <p>
1411     * <b>Definition:</b>
1412     * The period during this EpisodeOfCare that the specific status applied
1413     * </p> 
1414         */
1415        public StatusHistory setPeriod(PeriodDt theValue) {
1416                myPeriod = theValue;
1417                return this;
1418        }
1419        
1420        
1421
1422  
1423
1424
1425        }
1426
1427
1428        /**
1429         * Block class for child element: <b>EpisodeOfCare.careTeam</b> ()
1430         *
1431     * <p>
1432     * <b>Definition:</b>
1433     * The list of practitioners that may be facilitating this episode of care for specific purposes
1434     * </p> 
1435         */
1436        @Block()        
1437        public static class CareTeam 
1438            extends  BaseIdentifiableElement        implements IResourceBlock {
1439        
1440        @Child(name="role", type=CodeableConceptDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)       
1441        @Description(
1442                shortDefinition="",
1443                formalDefinition="The role this team member is taking within this episode of care"
1444        )
1445        private java.util.List<CodeableConceptDt> myRole;
1446        
1447        @Child(name="period", type=PeriodDt.class, order=1, min=0, max=1, summary=false, modifier=false)        
1448        @Description(
1449                shortDefinition="",
1450                formalDefinition="The period of time this practitioner is performing some role within the episode of care"
1451        )
1452        private PeriodDt myPeriod;
1453        
1454        @Child(name="member", order=2, min=0, max=1, summary=false, modifier=false, type={
1455                ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.Organization.class     })
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}