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>DocumentReference</b> Resource
320 * (infrastructure.documents)
321 *
322 * <p>
323 * <b>Definition:</b>
324 * A reference to a document .
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/DocumentReference">http://hl7.org/fhir/profiles/DocumentReference</a> 
335 * </p>
336 *
337 */
338@ResourceDef(name="DocumentReference", profile="http://hl7.org/fhir/profiles/DocumentReference", id="documentreference")
339public class DocumentReference extends ca.uhn.fhir.model.dstu2.resource.BaseResource
340    implements  IResource     {
341
342        /**
343         * Search parameter constant for <b>identifier</b>
344         * <p>
345         * Description: <b></b><br>
346         * Type: <b>token</b><br>
347         * Path: <b>DocumentReference.masterIdentifier | DocumentReference.identifier</b><br>
348         * </p>
349         */
350        @SearchParamDefinition(name="identifier", path="DocumentReference.masterIdentifier | DocumentReference.identifier", description="", type="token"  )
351        public static final String SP_IDENTIFIER = "identifier";
352
353        /**
354         * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
355         * <p>
356         * Description: <b></b><br>
357         * Type: <b>token</b><br>
358         * Path: <b>DocumentReference.masterIdentifier | DocumentReference.identifier</b><br>
359         * </p>
360         */
361        public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
362
363        /**
364         * Search parameter constant for <b>subject</b>
365         * <p>
366         * Description: <b></b><br>
367         * Type: <b>reference</b><br>
368         * Path: <b>DocumentReference.subject</b><br>
369         * </p>
370         */
371        @SearchParamDefinition(name="subject", path="DocumentReference.subject", description="", type="reference"  )
372        public static final String SP_SUBJECT = "subject";
373
374        /**
375         * <b>Fluent Client</b> search parameter constant for <b>subject</b>
376         * <p>
377         * Description: <b></b><br>
378         * Type: <b>reference</b><br>
379         * Path: <b>DocumentReference.subject</b><br>
380         * </p>
381         */
382        public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT);
383
384        /**
385         * Search parameter constant for <b>type</b>
386         * <p>
387         * Description: <b></b><br>
388         * Type: <b>token</b><br>
389         * Path: <b>DocumentReference.type</b><br>
390         * </p>
391         */
392        @SearchParamDefinition(name="type", path="DocumentReference.type", description="", type="token"  )
393        public static final String SP_TYPE = "type";
394
395        /**
396         * <b>Fluent Client</b> search parameter constant for <b>type</b>
397         * <p>
398         * Description: <b></b><br>
399         * Type: <b>token</b><br>
400         * Path: <b>DocumentReference.type</b><br>
401         * </p>
402         */
403        public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE);
404
405        /**
406         * Search parameter constant for <b>class</b>
407         * <p>
408         * Description: <b></b><br>
409         * Type: <b>token</b><br>
410         * Path: <b>DocumentReference.class</b><br>
411         * </p>
412         */
413        @SearchParamDefinition(name="class", path="DocumentReference.class", description="", type="token"  )
414        public static final String SP_CLASS = "class";
415
416        /**
417         * <b>Fluent Client</b> search parameter constant for <b>class</b>
418         * <p>
419         * Description: <b></b><br>
420         * Type: <b>token</b><br>
421         * Path: <b>DocumentReference.class</b><br>
422         * </p>
423         */
424        public static final TokenClientParam CLASS = new TokenClientParam(SP_CLASS);
425
426        /**
427         * Search parameter constant for <b>author</b>
428         * <p>
429         * Description: <b></b><br>
430         * Type: <b>reference</b><br>
431         * Path: <b>DocumentReference.author</b><br>
432         * </p>
433         */
434        @SearchParamDefinition(name="author", path="DocumentReference.author", description="", type="reference"  )
435        public static final String SP_AUTHOR = "author";
436
437        /**
438         * <b>Fluent Client</b> search parameter constant for <b>author</b>
439         * <p>
440         * Description: <b></b><br>
441         * Type: <b>reference</b><br>
442         * Path: <b>DocumentReference.author</b><br>
443         * </p>
444         */
445        public static final ReferenceClientParam AUTHOR = new ReferenceClientParam(SP_AUTHOR);
446
447        /**
448         * Search parameter constant for <b>custodian</b>
449         * <p>
450         * Description: <b></b><br>
451         * Type: <b>reference</b><br>
452         * Path: <b>DocumentReference.custodian</b><br>
453         * </p>
454         */
455        @SearchParamDefinition(name="custodian", path="DocumentReference.custodian", description="", type="reference"  )
456        public static final String SP_CUSTODIAN = "custodian";
457
458        /**
459         * <b>Fluent Client</b> search parameter constant for <b>custodian</b>
460         * <p>
461         * Description: <b></b><br>
462         * Type: <b>reference</b><br>
463         * Path: <b>DocumentReference.custodian</b><br>
464         * </p>
465         */
466        public static final ReferenceClientParam CUSTODIAN = new ReferenceClientParam(SP_CUSTODIAN);
467
468        /**
469         * Search parameter constant for <b>authenticator</b>
470         * <p>
471         * Description: <b></b><br>
472         * Type: <b>reference</b><br>
473         * Path: <b>DocumentReference.authenticator</b><br>
474         * </p>
475         */
476        @SearchParamDefinition(name="authenticator", path="DocumentReference.authenticator", description="", type="reference"  )
477        public static final String SP_AUTHENTICATOR = "authenticator";
478
479        /**
480         * <b>Fluent Client</b> search parameter constant for <b>authenticator</b>
481         * <p>
482         * Description: <b></b><br>
483         * Type: <b>reference</b><br>
484         * Path: <b>DocumentReference.authenticator</b><br>
485         * </p>
486         */
487        public static final ReferenceClientParam AUTHENTICATOR = new ReferenceClientParam(SP_AUTHENTICATOR);
488
489        /**
490         * Search parameter constant for <b>created</b>
491         * <p>
492         * Description: <b></b><br>
493         * Type: <b>date</b><br>
494         * Path: <b>DocumentReference.created</b><br>
495         * </p>
496         */
497        @SearchParamDefinition(name="created", path="DocumentReference.created", description="", type="date"  )
498        public static final String SP_CREATED = "created";
499
500        /**
501         * <b>Fluent Client</b> search parameter constant for <b>created</b>
502         * <p>
503         * Description: <b></b><br>
504         * Type: <b>date</b><br>
505         * Path: <b>DocumentReference.created</b><br>
506         * </p>
507         */
508        public static final DateClientParam CREATED = new DateClientParam(SP_CREATED);
509
510        /**
511         * Search parameter constant for <b>indexed</b>
512         * <p>
513         * Description: <b></b><br>
514         * Type: <b>date</b><br>
515         * Path: <b>DocumentReference.indexed</b><br>
516         * </p>
517         */
518        @SearchParamDefinition(name="indexed", path="DocumentReference.indexed", description="", type="date"  )
519        public static final String SP_INDEXED = "indexed";
520
521        /**
522         * <b>Fluent Client</b> search parameter constant for <b>indexed</b>
523         * <p>
524         * Description: <b></b><br>
525         * Type: <b>date</b><br>
526         * Path: <b>DocumentReference.indexed</b><br>
527         * </p>
528         */
529        public static final DateClientParam INDEXED = new DateClientParam(SP_INDEXED);
530
531        /**
532         * Search parameter constant for <b>status</b>
533         * <p>
534         * Description: <b></b><br>
535         * Type: <b>token</b><br>
536         * Path: <b>DocumentReference.status</b><br>
537         * </p>
538         */
539        @SearchParamDefinition(name="status", path="DocumentReference.status", description="", type="token"  )
540        public static final String SP_STATUS = "status";
541
542        /**
543         * <b>Fluent Client</b> search parameter constant for <b>status</b>
544         * <p>
545         * Description: <b></b><br>
546         * Type: <b>token</b><br>
547         * Path: <b>DocumentReference.status</b><br>
548         * </p>
549         */
550        public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS);
551
552        /**
553         * Search parameter constant for <b>relatesto</b>
554         * <p>
555         * Description: <b></b><br>
556         * Type: <b>reference</b><br>
557         * Path: <b>DocumentReference.relatesTo.target</b><br>
558         * </p>
559         */
560        @SearchParamDefinition(name="relatesto", path="DocumentReference.relatesTo.target", description="", type="reference"  )
561        public static final String SP_RELATESTO = "relatesto";
562
563        /**
564         * <b>Fluent Client</b> search parameter constant for <b>relatesto</b>
565         * <p>
566         * Description: <b></b><br>
567         * Type: <b>reference</b><br>
568         * Path: <b>DocumentReference.relatesTo.target</b><br>
569         * </p>
570         */
571        public static final ReferenceClientParam RELATESTO = new ReferenceClientParam(SP_RELATESTO);
572
573        /**
574         * Search parameter constant for <b>relation</b>
575         * <p>
576         * Description: <b></b><br>
577         * Type: <b>token</b><br>
578         * Path: <b>DocumentReference.relatesTo.code</b><br>
579         * </p>
580         */
581        @SearchParamDefinition(name="relation", path="DocumentReference.relatesTo.code", description="", type="token"  )
582        public static final String SP_RELATION = "relation";
583
584        /**
585         * <b>Fluent Client</b> search parameter constant for <b>relation</b>
586         * <p>
587         * Description: <b></b><br>
588         * Type: <b>token</b><br>
589         * Path: <b>DocumentReference.relatesTo.code</b><br>
590         * </p>
591         */
592        public static final TokenClientParam RELATION = new TokenClientParam(SP_RELATION);
593
594        /**
595         * Search parameter constant for <b>description</b>
596         * <p>
597         * Description: <b></b><br>
598         * Type: <b>string</b><br>
599         * Path: <b>DocumentReference.description</b><br>
600         * </p>
601         */
602        @SearchParamDefinition(name="description", path="DocumentReference.description", description="", type="string"  )
603        public static final String SP_DESCRIPTION = "description";
604
605        /**
606         * <b>Fluent Client</b> search parameter constant for <b>description</b>
607         * <p>
608         * Description: <b></b><br>
609         * Type: <b>string</b><br>
610         * Path: <b>DocumentReference.description</b><br>
611         * </p>
612         */
613        public static final StringClientParam DESCRIPTION = new StringClientParam(SP_DESCRIPTION);
614
615        /**
616         * Search parameter constant for <b>securitylabel</b>
617         * <p>
618         * Description: <b></b><br>
619         * Type: <b>token</b><br>
620         * Path: <b>DocumentReference.securityLabel</b><br>
621         * </p>
622         */
623        @SearchParamDefinition(name="securitylabel", path="DocumentReference.securityLabel", description="", type="token"  )
624        public static final String SP_SECURITYLABEL = "securitylabel";
625
626        /**
627         * <b>Fluent Client</b> search parameter constant for <b>securitylabel</b>
628         * <p>
629         * Description: <b></b><br>
630         * Type: <b>token</b><br>
631         * Path: <b>DocumentReference.securityLabel</b><br>
632         * </p>
633         */
634        public static final TokenClientParam SECURITYLABEL = new TokenClientParam(SP_SECURITYLABEL);
635
636        /**
637         * Search parameter constant for <b>format</b>
638         * <p>
639         * Description: <b></b><br>
640         * Type: <b>token</b><br>
641         * Path: <b>DocumentReference.content.format</b><br>
642         * </p>
643         */
644        @SearchParamDefinition(name="format", path="DocumentReference.content.format", description="", type="token"  )
645        public static final String SP_FORMAT = "format";
646
647        /**
648         * <b>Fluent Client</b> search parameter constant for <b>format</b>
649         * <p>
650         * Description: <b></b><br>
651         * Type: <b>token</b><br>
652         * Path: <b>DocumentReference.content.format</b><br>
653         * </p>
654         */
655        public static final TokenClientParam FORMAT = new TokenClientParam(SP_FORMAT);
656
657        /**
658         * Search parameter constant for <b>language</b>
659         * <p>
660         * Description: <b></b><br>
661         * Type: <b>token</b><br>
662         * Path: <b>DocumentReference.content.attachment.language</b><br>
663         * </p>
664         */
665        @SearchParamDefinition(name="language", path="DocumentReference.content.attachment.language", description="", type="token"  )
666        public static final String SP_LANGUAGE = "language";
667
668        /**
669         * <b>Fluent Client</b> search parameter constant for <b>language</b>
670         * <p>
671         * Description: <b></b><br>
672         * Type: <b>token</b><br>
673         * Path: <b>DocumentReference.content.attachment.language</b><br>
674         * </p>
675         */
676        public static final TokenClientParam LANGUAGE = new TokenClientParam(SP_LANGUAGE);
677
678        /**
679         * Search parameter constant for <b>location</b>
680         * <p>
681         * Description: <b></b><br>
682         * Type: <b>uri</b><br>
683         * Path: <b>DocumentReference.content.attachment.url</b><br>
684         * </p>
685         */
686        @SearchParamDefinition(name="location", path="DocumentReference.content.attachment.url", description="", type="uri"  )
687        public static final String SP_LOCATION = "location";
688
689        /**
690         * <b>Fluent Client</b> search parameter constant for <b>location</b>
691         * <p>
692         * Description: <b></b><br>
693         * Type: <b>uri</b><br>
694         * Path: <b>DocumentReference.content.attachment.url</b><br>
695         * </p>
696         */
697        public static final UriClientParam LOCATION = new UriClientParam(SP_LOCATION);
698
699        /**
700         * Search parameter constant for <b>event</b>
701         * <p>
702         * Description: <b></b><br>
703         * Type: <b>token</b><br>
704         * Path: <b>DocumentReference.context.event</b><br>
705         * </p>
706         */
707        @SearchParamDefinition(name="event", path="DocumentReference.context.event", description="", type="token"  )
708        public static final String SP_EVENT = "event";
709
710        /**
711         * <b>Fluent Client</b> search parameter constant for <b>event</b>
712         * <p>
713         * Description: <b></b><br>
714         * Type: <b>token</b><br>
715         * Path: <b>DocumentReference.context.event</b><br>
716         * </p>
717         */
718        public static final TokenClientParam EVENT = new TokenClientParam(SP_EVENT);
719
720        /**
721         * Search parameter constant for <b>period</b>
722         * <p>
723         * Description: <b></b><br>
724         * Type: <b>date</b><br>
725         * Path: <b>DocumentReference.context.period</b><br>
726         * </p>
727         */
728        @SearchParamDefinition(name="period", path="DocumentReference.context.period", description="", type="date"  )
729        public static final String SP_PERIOD = "period";
730
731        /**
732         * <b>Fluent Client</b> search parameter constant for <b>period</b>
733         * <p>
734         * Description: <b></b><br>
735         * Type: <b>date</b><br>
736         * Path: <b>DocumentReference.context.period</b><br>
737         * </p>
738         */
739        public static final DateClientParam PERIOD = new DateClientParam(SP_PERIOD);
740
741        /**
742         * Search parameter constant for <b>facility</b>
743         * <p>
744         * Description: <b></b><br>
745         * Type: <b>token</b><br>
746         * Path: <b>DocumentReference.context.facilityType</b><br>
747         * </p>
748         */
749        @SearchParamDefinition(name="facility", path="DocumentReference.context.facilityType", description="", type="token"  )
750        public static final String SP_FACILITY = "facility";
751
752        /**
753         * <b>Fluent Client</b> search parameter constant for <b>facility</b>
754         * <p>
755         * Description: <b></b><br>
756         * Type: <b>token</b><br>
757         * Path: <b>DocumentReference.context.facilityType</b><br>
758         * </p>
759         */
760        public static final TokenClientParam FACILITY = new TokenClientParam(SP_FACILITY);
761
762        /**
763         * Search parameter constant for <b>patient</b>
764         * <p>
765         * Description: <b></b><br>
766         * Type: <b>reference</b><br>
767         * Path: <b>DocumentReference.subject</b><br>
768         * </p>
769         */
770        @SearchParamDefinition(name="patient", path="DocumentReference.subject", description="", type="reference"  )
771        public static final String SP_PATIENT = "patient";
772
773        /**
774         * <b>Fluent Client</b> search parameter constant for <b>patient</b>
775         * <p>
776         * Description: <b></b><br>
777         * Type: <b>reference</b><br>
778         * Path: <b>DocumentReference.subject</b><br>
779         * </p>
780         */
781        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
782
783        /**
784         * Search parameter constant for <b>setting</b>
785         * <p>
786         * Description: <b></b><br>
787         * Type: <b>token</b><br>
788         * Path: <b>DocumentReference.context.practiceSetting</b><br>
789         * </p>
790         */
791        @SearchParamDefinition(name="setting", path="DocumentReference.context.practiceSetting", description="", type="token"  )
792        public static final String SP_SETTING = "setting";
793
794        /**
795         * <b>Fluent Client</b> search parameter constant for <b>setting</b>
796         * <p>
797         * Description: <b></b><br>
798         * Type: <b>token</b><br>
799         * Path: <b>DocumentReference.context.practiceSetting</b><br>
800         * </p>
801         */
802        public static final TokenClientParam SETTING = new TokenClientParam(SP_SETTING);
803
804        /**
805         * Search parameter constant for <b>related-id</b>
806         * <p>
807         * Description: <b></b><br>
808         * Type: <b>token</b><br>
809         * Path: <b>DocumentReference.context.related.identifier</b><br>
810         * </p>
811         */
812        @SearchParamDefinition(name="related-id", path="DocumentReference.context.related.identifier", description="", type="token"  )
813        public static final String SP_RELATED_ID = "related-id";
814
815        /**
816         * <b>Fluent Client</b> search parameter constant for <b>related-id</b>
817         * <p>
818         * Description: <b></b><br>
819         * Type: <b>token</b><br>
820         * Path: <b>DocumentReference.context.related.identifier</b><br>
821         * </p>
822         */
823        public static final TokenClientParam RELATED_ID = new TokenClientParam(SP_RELATED_ID);
824
825        /**
826         * Search parameter constant for <b>related-ref</b>
827         * <p>
828         * Description: <b></b><br>
829         * Type: <b>reference</b><br>
830         * Path: <b>DocumentReference.context.related.ref</b><br>
831         * </p>
832         */
833        @SearchParamDefinition(name="related-ref", path="DocumentReference.context.related.ref", description="", type="reference"  )
834        public static final String SP_RELATED_REF = "related-ref";
835
836        /**
837         * <b>Fluent Client</b> search parameter constant for <b>related-ref</b>
838         * <p>
839         * Description: <b></b><br>
840         * Type: <b>reference</b><br>
841         * Path: <b>DocumentReference.context.related.ref</b><br>
842         * </p>
843         */
844        public static final ReferenceClientParam RELATED_REF = new ReferenceClientParam(SP_RELATED_REF);
845
846        /**
847         * Search parameter constant for <b>encounter</b>
848         * <p>
849         * Description: <b></b><br>
850         * Type: <b>reference</b><br>
851         * Path: <b>DocumentReference.context.encounter</b><br>
852         * </p>
853         */
854        @SearchParamDefinition(name="encounter", path="DocumentReference.context.encounter", description="", type="reference"  )
855        public static final String SP_ENCOUNTER = "encounter";
856
857        /**
858         * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
859         * <p>
860         * Description: <b></b><br>
861         * Type: <b>reference</b><br>
862         * Path: <b>DocumentReference.context.encounter</b><br>
863         * </p>
864         */
865        public static final ReferenceClientParam ENCOUNTER = new ReferenceClientParam(SP_ENCOUNTER);
866
867        /**
868         * Search parameter constant for <b>relatesto-relation</b>
869         * <p>
870         * Description: <b>Combination of relation and relatesTo</b><br>
871         * Type: <b>composite</b><br>
872         * Path: <b>relatesto &amp; relation</b><br>
873         * </p>
874         */
875        @SearchParamDefinition(name="relatesto-relation", path="relatesto & relation", description="Combination of relation and relatesTo", type="composite"  , compositeOf={  "relatesto",  "relation" }  )
876        public static final String SP_RELATESTO_RELATION = "relatesto-relation";
877
878        /**
879         * <b>Fluent Client</b> search parameter constant for <b>relatesto-relation</b>
880         * <p>
881         * Description: <b>Combination of relation and relatesTo</b><br>
882         * Type: <b>composite</b><br>
883         * Path: <b>relatesto &amp; relation</b><br>
884         * </p>
885         */
886        public static final CompositeClientParam<ReferenceClientParam, TokenClientParam> RELATESTO_RELATION = new CompositeClientParam<ReferenceClientParam, TokenClientParam>(SP_RELATESTO_RELATION);
887
888
889        /**
890         * Constant for fluent queries to be used to add include statements. Specifies
891         * the path value of "<b>DocumentReference:authenticator</b>".
892         */
893        public static final Include INCLUDE_AUTHENTICATOR = new Include("DocumentReference:authenticator");
894
895        /**
896         * Constant for fluent queries to be used to add include statements. Specifies
897         * the path value of "<b>DocumentReference:author</b>".
898         */
899        public static final Include INCLUDE_AUTHOR = new Include("DocumentReference:author");
900
901        /**
902         * Constant for fluent queries to be used to add include statements. Specifies
903         * the path value of "<b>DocumentReference:custodian</b>".
904         */
905        public static final Include INCLUDE_CUSTODIAN = new Include("DocumentReference:custodian");
906
907        /**
908         * Constant for fluent queries to be used to add include statements. Specifies
909         * the path value of "<b>DocumentReference:encounter</b>".
910         */
911        public static final Include INCLUDE_ENCOUNTER = new Include("DocumentReference:encounter");
912
913        /**
914         * Constant for fluent queries to be used to add include statements. Specifies
915         * the path value of "<b>DocumentReference:patient</b>".
916         */
917        public static final Include INCLUDE_PATIENT = new Include("DocumentReference:patient");
918
919        /**
920         * Constant for fluent queries to be used to add include statements. Specifies
921         * the path value of "<b>DocumentReference:related-ref</b>".
922         */
923        public static final Include INCLUDE_RELATED_REF = new Include("DocumentReference:related-ref");
924
925        /**
926         * Constant for fluent queries to be used to add include statements. Specifies
927         * the path value of "<b>DocumentReference:relatesto</b>".
928         */
929        public static final Include INCLUDE_RELATESTO = new Include("DocumentReference:relatesto");
930
931        /**
932         * Constant for fluent queries to be used to add include statements. Specifies
933         * the path value of "<b>DocumentReference:subject</b>".
934         */
935        public static final Include INCLUDE_SUBJECT = new Include("DocumentReference:subject");
936
937
938        @Child(name="masterIdentifier", type=IdentifierDt.class, order=0, min=0, max=1, summary=false, modifier=false)  
939        @Description(
940                shortDefinition="id",
941                formalDefinition="Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document"
942        )
943        private IdentifierDt myMasterIdentifier;
944        
945        @Child(name="identifier", type=IdentifierDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
946        @Description(
947                shortDefinition="id",
948                formalDefinition="Other identifiers associated with the document, including version independent identifiers"
949        )
950        private java.util.List<IdentifierDt> myIdentifier;
951        
952        @Child(name="subject", order=2, min=0, max=1, summary=false, modifier=false, type={
953                ca.uhn.fhir.model.dstu2.resource.Patient.class,                 ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.Group.class,           ca.uhn.fhir.model.dstu2.resource.Device.class   })
954        @Description(
955                shortDefinition="who.focus",
956                formalDefinition="Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)"
957        )
958        private ResourceReferenceDt mySubject;
959        
960        @Child(name="type", type=CodeableConceptDt.class, order=3, min=1, max=1, summary=false, modifier=false) 
961        @Description(
962                shortDefinition="class",
963                formalDefinition="Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced."
964        )
965        private CodeableConceptDt myType;
966        
967        @Child(name="class", type=CodeableConceptDt.class, order=4, min=0, max=1, summary=false, modifier=false)        
968        @Description(
969                shortDefinition="class",
970                formalDefinition="A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type"
971        )
972        private CodeableConceptDt myClassElement;
973        
974        @Child(name="author", order=5, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
975                ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.Organization.class,            ca.uhn.fhir.model.dstu2.resource.Device.class,          ca.uhn.fhir.model.dstu2.resource.Patient.class,                 ca.uhn.fhir.model.dstu2.resource.RelatedPerson.class    })
976        @Description(
977                shortDefinition="who.author",
978                formalDefinition="Identifies who is responsible for adding the information to the document"
979        )
980        private java.util.List<ResourceReferenceDt> myAuthor;
981        
982        @Child(name="custodian", order=6, min=0, max=1, summary=false, modifier=false, type={
983                ca.uhn.fhir.model.dstu2.resource.Organization.class     })
984        @Description(
985                shortDefinition="",
986                formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the document"
987        )
988        private ResourceReferenceDt myCustodian;
989        
990        @Child(name="authenticator", order=7, min=0, max=1, summary=false, modifier=false, type={
991                ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.Organization.class     })
992        @Description(
993                shortDefinition="who.witness",
994                formalDefinition="Which person or organization authenticates that this document is valid"
995        )
996        private ResourceReferenceDt myAuthenticator;
997        
998        @Child(name="created", type=DateTimeDt.class, order=8, min=0, max=1, summary=false, modifier=false)     
999        @Description(
1000                shortDefinition="when.done",
1001                formalDefinition="When the document was created"
1002        )
1003        private DateTimeDt myCreated;
1004        
1005        @Child(name="indexed", type=InstantDt.class, order=9, min=1, max=1, summary=false, modifier=false)      
1006        @Description(
1007                shortDefinition="when.recorded",
1008                formalDefinition="When the document reference was created"
1009        )
1010        private InstantDt myIndexed;
1011        
1012        @Child(name="status", type=CodeDt.class, order=10, min=1, max=1, summary=false, modifier=true)  
1013        @Description(
1014                shortDefinition="status",
1015                formalDefinition="The status of this document reference"
1016        )
1017        private BoundCodeDt<DocumentReferenceStatusEnum> myStatus;
1018        
1019        @Child(name="docStatus", type=CodeableConceptDt.class, order=11, min=0, max=1, summary=false, modifier=false)   
1020        @Description(
1021                shortDefinition="status",
1022                formalDefinition="The status of the underlying document"
1023        )
1024        private CodeableConceptDt myDocStatus;
1025        
1026        @Child(name="relatesTo", order=12, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=true)        
1027        @Description(
1028                shortDefinition="",
1029                formalDefinition="Relationships that this document has with other document references that already exist"
1030        )
1031        private java.util.List<RelatesTo> myRelatesTo;
1032        
1033        @Child(name="description", type=StringDt.class, order=13, min=0, max=1, summary=false, modifier=false)  
1034        @Description(
1035                shortDefinition="",
1036                formalDefinition="Human-readable description of the source document. This is sometimes known as the \"title\""
1037        )
1038        private StringDt myDescription;
1039        
1040        @Child(name="securityLabel", type=CodeableConceptDt.class, order=14, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)     
1041        @Description(
1042                shortDefinition="",
1043                formalDefinition="A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \"reference\" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to"
1044        )
1045        private java.util.List<CodeableConceptDt> mySecurityLabel;
1046        
1047        @Child(name="content", order=15, min=1, max=Child.MAX_UNLIMITED, summary=false, modifier=false) 
1048        @Description(
1049                shortDefinition="",
1050                formalDefinition="The document and format referenced. There may be multiple content element repetitions, each with a different format."
1051        )
1052        private java.util.List<Content> myContent;
1053        
1054        @Child(name="context", order=16, min=0, max=1, summary=false, modifier=false)   
1055        @Description(
1056                shortDefinition="",
1057                formalDefinition="The clinical context in which the document was prepared"
1058        )
1059        private Context myContext;
1060        
1061
1062        @Override
1063        public boolean isEmpty() {
1064                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myMasterIdentifier,  myIdentifier,  mySubject,  myType,  myClassElement,  myAuthor,  myCustodian,  myAuthenticator,  myCreated,  myIndexed,  myStatus,  myDocStatus,  myRelatesTo,  myDescription,  mySecurityLabel,  myContent,  myContext);
1065        }
1066        
1067        @Override
1068        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1069                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myMasterIdentifier, myIdentifier, mySubject, myType, myClassElement, myAuthor, myCustodian, myAuthenticator, myCreated, myIndexed, myStatus, myDocStatus, myRelatesTo, myDescription, mySecurityLabel, myContent, myContext);
1070        }
1071
1072        /**
1073         * Gets the value(s) for <b>masterIdentifier</b> (id).
1074         * creating it if it does
1075         * not exist. Will not return <code>null</code>.
1076         *
1077     * <p>
1078     * <b>Definition:</b>
1079     * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document
1080     * </p> 
1081         */
1082        public IdentifierDt getMasterIdentifier() {  
1083                if (myMasterIdentifier == null) {
1084                        myMasterIdentifier = new IdentifierDt();
1085                }
1086                return myMasterIdentifier;
1087        }
1088
1089        /**
1090         * Sets the value(s) for <b>masterIdentifier</b> (id)
1091         *
1092     * <p>
1093     * <b>Definition:</b>
1094     * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document
1095     * </p> 
1096         */
1097        public DocumentReference setMasterIdentifier(IdentifierDt theValue) {
1098                myMasterIdentifier = theValue;
1099                return this;
1100        }
1101        
1102        
1103
1104  
1105        /**
1106         * Gets the value(s) for <b>identifier</b> (id).
1107         * creating it if it does
1108         * not exist. Will not return <code>null</code>.
1109         *
1110     * <p>
1111     * <b>Definition:</b>
1112     * Other identifiers associated with the document, including version independent identifiers
1113     * </p> 
1114         */
1115        public java.util.List<IdentifierDt> getIdentifier() {  
1116                if (myIdentifier == null) {
1117                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
1118                }
1119                return myIdentifier;
1120        }
1121
1122        /**
1123         * Sets the value(s) for <b>identifier</b> (id)
1124         *
1125     * <p>
1126     * <b>Definition:</b>
1127     * Other identifiers associated with the document, including version independent identifiers
1128     * </p> 
1129         */
1130        public DocumentReference setIdentifier(java.util.List<IdentifierDt> theValue) {
1131                myIdentifier = theValue;
1132                return this;
1133        }
1134        
1135        
1136
1137        /**
1138         * Adds and returns a new value for <b>identifier</b> (id)
1139         *
1140     * <p>
1141     * <b>Definition:</b>
1142     * Other identifiers associated with the document, including version independent identifiers
1143     * </p> 
1144         */
1145        public IdentifierDt addIdentifier() {
1146                IdentifierDt newType = new IdentifierDt();
1147                getIdentifier().add(newType);
1148                return newType; 
1149        }
1150
1151        /**
1152         * Adds a given new value for <b>identifier</b> (id)
1153         *
1154         * <p>
1155         * <b>Definition:</b>
1156         * Other identifiers associated with the document, including version independent identifiers
1157         * </p>
1158         * @param theValue The identifier to add (must not be <code>null</code>)
1159         */
1160        public DocumentReference addIdentifier(IdentifierDt theValue) {
1161                if (theValue == null) {
1162                        throw new NullPointerException("theValue must not be null");
1163                }
1164                getIdentifier().add(theValue);
1165                return this;
1166        }
1167
1168        /**
1169         * Gets the first repetition for <b>identifier</b> (id),
1170         * creating it if it does not already exist.
1171         *
1172     * <p>
1173     * <b>Definition:</b>
1174     * Other identifiers associated with the document, including version independent identifiers
1175     * </p> 
1176         */
1177        public IdentifierDt getIdentifierFirstRep() {
1178                if (getIdentifier().isEmpty()) {
1179                        return addIdentifier();
1180                }
1181                return getIdentifier().get(0); 
1182        }
1183  
1184        /**
1185         * Gets the value(s) for <b>subject</b> (who.focus).
1186         * creating it if it does
1187         * not exist. Will not return <code>null</code>.
1188         *
1189     * <p>
1190     * <b>Definition:</b>
1191     * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)
1192     * </p> 
1193         */
1194        public ResourceReferenceDt getSubject() {  
1195                if (mySubject == null) {
1196                        mySubject = new ResourceReferenceDt();
1197                }
1198                return mySubject;
1199        }
1200
1201        /**
1202         * Sets the value(s) for <b>subject</b> (who.focus)
1203         *
1204     * <p>
1205     * <b>Definition:</b>
1206     * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)
1207     * </p> 
1208         */
1209        public DocumentReference setSubject(ResourceReferenceDt theValue) {
1210                mySubject = theValue;
1211                return this;
1212        }
1213        
1214        
1215
1216  
1217        /**
1218         * Gets the value(s) for <b>type</b> (class).
1219         * creating it if it does
1220         * not exist. Will not return <code>null</code>.
1221         *
1222     * <p>
1223     * <b>Definition:</b>
1224     * Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.
1225     * </p> 
1226         */
1227        public CodeableConceptDt getType() {  
1228                if (myType == null) {
1229                        myType = new CodeableConceptDt();
1230                }
1231                return myType;
1232        }
1233
1234        /**
1235         * Sets the value(s) for <b>type</b> (class)
1236         *
1237     * <p>
1238     * <b>Definition:</b>
1239     * Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.
1240     * </p> 
1241         */
1242        public DocumentReference setType(CodeableConceptDt theValue) {
1243                myType = theValue;
1244                return this;
1245        }
1246        
1247        
1248
1249  
1250        /**
1251         * Gets the value(s) for <b>class</b> (class).
1252         * creating it if it does
1253         * not exist. Will not return <code>null</code>.
1254         *
1255     * <p>
1256     * <b>Definition:</b>
1257     * A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type
1258     * </p> 
1259         */
1260        public CodeableConceptDt getClassElement() {  
1261                if (myClassElement == null) {
1262                        myClassElement = new CodeableConceptDt();
1263                }
1264                return myClassElement;
1265        }
1266
1267        /**
1268         * Sets the value(s) for <b>class</b> (class)
1269         *
1270     * <p>
1271     * <b>Definition:</b>
1272     * A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type
1273     * </p> 
1274         */
1275        public DocumentReference setClassElement(CodeableConceptDt theValue) {
1276                myClassElement = theValue;
1277                return this;
1278        }
1279        
1280        
1281
1282  
1283        /**
1284         * Gets the value(s) for <b>author</b> (who.author).
1285         * creating it if it does
1286         * not exist. Will not return <code>null</code>.
1287         *
1288     * <p>
1289     * <b>Definition:</b>
1290     * Identifies who is responsible for adding the information to the document
1291     * </p> 
1292         */
1293        public java.util.List<ResourceReferenceDt> getAuthor() {  
1294                if (myAuthor == null) {
1295                        myAuthor = new java.util.ArrayList<ResourceReferenceDt>();
1296                }
1297                return myAuthor;
1298        }
1299
1300        /**
1301         * Sets the value(s) for <b>author</b> (who.author)
1302         *
1303     * <p>
1304     * <b>Definition:</b>
1305     * Identifies who is responsible for adding the information to the document
1306     * </p> 
1307         */
1308        public DocumentReference setAuthor(java.util.List<ResourceReferenceDt> theValue) {
1309                myAuthor = theValue;
1310                return this;
1311        }
1312        
1313        
1314
1315        /**
1316         * Adds and returns a new value for <b>author</b> (who.author)
1317         *
1318     * <p>
1319     * <b>Definition:</b>
1320     * Identifies who is responsible for adding the information to the document
1321     * </p> 
1322         */
1323        public ResourceReferenceDt addAuthor() {
1324                ResourceReferenceDt newType = new ResourceReferenceDt();
1325                getAuthor().add(newType);
1326                return newType; 
1327        }
1328  
1329        /**
1330         * Gets the value(s) for <b>custodian</b> ().
1331         * creating it if it does
1332         * not exist. Will not return <code>null</code>.
1333         *
1334     * <p>
1335     * <b>Definition:</b>
1336     * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document
1337     * </p> 
1338         */
1339        public ResourceReferenceDt getCustodian() {  
1340                if (myCustodian == null) {
1341                        myCustodian = new ResourceReferenceDt();
1342                }
1343                return myCustodian;
1344        }
1345
1346        /**
1347         * Sets the value(s) for <b>custodian</b> ()
1348         *
1349     * <p>
1350     * <b>Definition:</b>
1351     * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document
1352     * </p> 
1353         */
1354        public DocumentReference setCustodian(ResourceReferenceDt theValue) {
1355                myCustodian = theValue;
1356                return this;
1357        }
1358        
1359        
1360
1361  
1362        /**
1363         * Gets the value(s) for <b>authenticator</b> (who.witness).
1364         * creating it if it does
1365         * not exist. Will not return <code>null</code>.
1366         *
1367     * <p>
1368     * <b>Definition:</b>
1369     * Which person or organization authenticates that this document is valid
1370     * </p> 
1371         */
1372        public ResourceReferenceDt getAuthenticator() {  
1373                if (myAuthenticator == null) {
1374                        myAuthenticator = new ResourceReferenceDt();
1375                }
1376                return myAuthenticator;
1377        }
1378
1379        /**
1380         * Sets the value(s) for <b>authenticator</b> (who.witness)
1381         *
1382     * <p>
1383     * <b>Definition:</b>
1384     * Which person or organization authenticates that this document is valid
1385     * </p> 
1386         */
1387        public DocumentReference setAuthenticator(ResourceReferenceDt theValue) {
1388                myAuthenticator = theValue;
1389                return this;
1390        }
1391        
1392        
1393
1394  
1395        /**
1396         * Gets the value(s) for <b>created</b> (when.done).
1397         * creating it if it does
1398         * not exist. Will not return <code>null</code>.
1399         *
1400     * <p>
1401     * <b>Definition:</b>
1402     * When the document was created
1403     * </p> 
1404         */
1405        public DateTimeDt getCreatedElement() {  
1406                if (myCreated == null) {
1407                        myCreated = new DateTimeDt();
1408                }
1409                return myCreated;
1410        }
1411
1412        
1413        /**
1414         * Gets the value(s) for <b>created</b> (when.done).
1415         * creating it if it does
1416         * not exist. Will not return <code>null</code>.
1417         *
1418     * <p>
1419     * <b>Definition:</b>
1420     * When the document was created
1421     * </p> 
1422         */
1423        public Date getCreated() {  
1424                return getCreatedElement().getValue();
1425        }
1426
1427        /**
1428         * Sets the value(s) for <b>created</b> (when.done)
1429         *
1430     * <p>
1431     * <b>Definition:</b>
1432     * When the document was created
1433     * </p> 
1434         */
1435        public DocumentReference setCreated(DateTimeDt theValue) {
1436                myCreated = theValue;
1437                return this;
1438        }
1439        
1440        
1441
1442        /**
1443         * Sets the value for <b>created</b> (when.done)
1444         *
1445     * <p>
1446     * <b>Definition:</b>
1447     * When the document was created
1448     * </p> 
1449         */
1450        public DocumentReference setCreated( Date theDate,  TemporalPrecisionEnum thePrecision) {
1451                myCreated = new DateTimeDt(theDate, thePrecision); 
1452                return this; 
1453        }
1454
1455        /**
1456         * Sets the value for <b>created</b> (when.done)
1457         *
1458     * <p>
1459     * <b>Definition:</b>
1460     * When the document was created
1461     * </p> 
1462         */
1463        public DocumentReference setCreatedWithSecondsPrecision( Date theDate) {
1464                myCreated = new DateTimeDt(theDate); 
1465                return this; 
1466        }
1467
1468 
1469        /**
1470         * Gets the value(s) for <b>indexed</b> (when.recorded).
1471         * creating it if it does
1472         * not exist. Will not return <code>null</code>.
1473         *
1474     * <p>
1475     * <b>Definition:</b>
1476     * When the document reference was created
1477     * </p> 
1478         */
1479        public InstantDt getIndexedElement() {  
1480                if (myIndexed == null) {
1481                        myIndexed = new InstantDt();
1482                }
1483                return myIndexed;
1484        }
1485
1486        
1487        /**
1488         * Gets the value(s) for <b>indexed</b> (when.recorded).
1489         * creating it if it does
1490         * not exist. Will not return <code>null</code>.
1491         *
1492     * <p>
1493     * <b>Definition:</b>
1494     * When the document reference was created
1495     * </p> 
1496         */
1497        public Date getIndexed() {  
1498                return getIndexedElement().getValue();
1499        }
1500
1501        /**
1502         * Sets the value(s) for <b>indexed</b> (when.recorded)
1503         *
1504     * <p>
1505     * <b>Definition:</b>
1506     * When the document reference was created
1507     * </p> 
1508         */
1509        public DocumentReference setIndexed(InstantDt theValue) {
1510                myIndexed = theValue;
1511                return this;
1512        }
1513        
1514        
1515
1516        /**
1517         * Sets the value for <b>indexed</b> (when.recorded)
1518         *
1519     * <p>
1520     * <b>Definition:</b>
1521     * When the document reference was created
1522     * </p> 
1523         */
1524        public DocumentReference setIndexedWithMillisPrecision( Date theDate) {
1525                myIndexed = new InstantDt(theDate); 
1526                return this; 
1527        }
1528
1529        /**
1530         * Sets the value for <b>indexed</b> (when.recorded)
1531         *
1532     * <p>
1533     * <b>Definition:</b>
1534     * When the document reference was created
1535     * </p> 
1536         */
1537        public DocumentReference setIndexed( Date theDate,  TemporalPrecisionEnum thePrecision) {
1538                myIndexed = new InstantDt(theDate, thePrecision); 
1539                return this; 
1540        }
1541
1542 
1543        /**
1544         * Gets the value(s) for <b>status</b> (status).
1545         * creating it if it does
1546         * not exist. Will not return <code>null</code>.
1547         *
1548     * <p>
1549     * <b>Definition:</b>
1550     * The status of this document reference
1551     * </p> 
1552         */
1553        public BoundCodeDt<DocumentReferenceStatusEnum> getStatusElement() {  
1554                if (myStatus == null) {
1555                        myStatus = new BoundCodeDt<DocumentReferenceStatusEnum>(DocumentReferenceStatusEnum.VALUESET_BINDER);
1556                }
1557                return myStatus;
1558        }
1559
1560        
1561        /**
1562         * Gets the value(s) for <b>status</b> (status).
1563         * creating it if it does
1564         * not exist. Will not return <code>null</code>.
1565         *
1566     * <p>
1567     * <b>Definition:</b>
1568     * The status of this document reference
1569     * </p> 
1570         */
1571        public String getStatus() {  
1572                return getStatusElement().getValue();
1573        }
1574
1575        /**
1576         * Sets the value(s) for <b>status</b> (status)
1577         *
1578     * <p>
1579     * <b>Definition:</b>
1580     * The status of this document reference
1581     * </p> 
1582         */
1583        public DocumentReference setStatus(BoundCodeDt<DocumentReferenceStatusEnum> theValue) {
1584                myStatus = theValue;
1585                return this;
1586        }
1587        
1588        
1589
1590        /**
1591         * Sets the value(s) for <b>status</b> (status)
1592         *
1593     * <p>
1594     * <b>Definition:</b>
1595     * The status of this document reference
1596     * </p> 
1597         */
1598        public DocumentReference setStatus(DocumentReferenceStatusEnum theValue) {
1599                setStatus(new BoundCodeDt<DocumentReferenceStatusEnum>(DocumentReferenceStatusEnum.VALUESET_BINDER, theValue));
1600                
1601/*
1602                getStatusElement().setValueAsEnum(theValue);
1603*/
1604                return this;
1605        }
1606
1607  
1608        /**
1609         * Gets the value(s) for <b>docStatus</b> (status).
1610         * creating it if it does
1611         * not exist. Will not return <code>null</code>.
1612         *
1613     * <p>
1614     * <b>Definition:</b>
1615     * The status of the underlying document
1616     * </p> 
1617         */
1618        public CodeableConceptDt getDocStatus() {  
1619                if (myDocStatus == null) {
1620                        myDocStatus = new CodeableConceptDt();
1621                }
1622                return myDocStatus;
1623        }
1624
1625        /**
1626         * Sets the value(s) for <b>docStatus</b> (status)
1627         *
1628     * <p>
1629     * <b>Definition:</b>
1630     * The status of the underlying document
1631     * </p> 
1632         */
1633        public DocumentReference setDocStatus(CodeableConceptDt theValue) {
1634                myDocStatus = theValue;
1635                return this;
1636        }
1637        
1638        
1639
1640  
1641        /**
1642         * Gets the value(s) for <b>relatesTo</b> ().
1643         * creating it if it does
1644         * not exist. Will not return <code>null</code>.
1645         *
1646     * <p>
1647     * <b>Definition:</b>
1648     * Relationships that this document has with other document references that already exist
1649     * </p> 
1650         */
1651        public java.util.List<RelatesTo> getRelatesTo() {  
1652                if (myRelatesTo == null) {
1653                        myRelatesTo = new java.util.ArrayList<RelatesTo>();
1654                }
1655                return myRelatesTo;
1656        }
1657
1658        /**
1659         * Sets the value(s) for <b>relatesTo</b> ()
1660         *
1661     * <p>
1662     * <b>Definition:</b>
1663     * Relationships that this document has with other document references that already exist
1664     * </p> 
1665         */
1666        public DocumentReference setRelatesTo(java.util.List<RelatesTo> theValue) {
1667                myRelatesTo = theValue;
1668                return this;
1669        }
1670        
1671        
1672
1673        /**
1674         * Adds and returns a new value for <b>relatesTo</b> ()
1675         *
1676     * <p>
1677     * <b>Definition:</b>
1678     * Relationships that this document has with other document references that already exist
1679     * </p> 
1680         */
1681        public RelatesTo addRelatesTo() {
1682                RelatesTo newType = new RelatesTo();
1683                getRelatesTo().add(newType);
1684                return newType; 
1685        }
1686
1687        /**
1688         * Adds a given new value for <b>relatesTo</b> ()
1689         *
1690         * <p>
1691         * <b>Definition:</b>
1692         * Relationships that this document has with other document references that already exist
1693         * </p>
1694         * @param theValue The relatesTo to add (must not be <code>null</code>)
1695         */
1696        public DocumentReference addRelatesTo(RelatesTo theValue) {
1697                if (theValue == null) {
1698                        throw new NullPointerException("theValue must not be null");
1699                }
1700                getRelatesTo().add(theValue);
1701                return this;
1702        }
1703
1704        /**
1705         * Gets the first repetition for <b>relatesTo</b> (),
1706         * creating it if it does not already exist.
1707         *
1708     * <p>
1709     * <b>Definition:</b>
1710     * Relationships that this document has with other document references that already exist
1711     * </p> 
1712         */
1713        public RelatesTo getRelatesToFirstRep() {
1714                if (getRelatesTo().isEmpty()) {
1715                        return addRelatesTo();
1716                }
1717                return getRelatesTo().get(0); 
1718        }
1719  
1720        /**
1721         * Gets the value(s) for <b>description</b> ().
1722         * creating it if it does
1723         * not exist. Will not return <code>null</code>.
1724         *
1725     * <p>
1726     * <b>Definition:</b>
1727     * Human-readable description of the source document. This is sometimes known as the \&quot;title\&quot;
1728     * </p> 
1729         */
1730        public StringDt getDescriptionElement() {  
1731                if (myDescription == null) {
1732                        myDescription = new StringDt();
1733                }
1734                return myDescription;
1735        }
1736
1737        
1738        /**
1739         * Gets the value(s) for <b>description</b> ().
1740         * creating it if it does
1741         * not exist. Will not return <code>null</code>.
1742         *
1743     * <p>
1744     * <b>Definition:</b>
1745     * Human-readable description of the source document. This is sometimes known as the \&quot;title\&quot;
1746     * </p> 
1747         */
1748        public String getDescription() {  
1749                return getDescriptionElement().getValue();
1750        }
1751
1752        /**
1753         * Sets the value(s) for <b>description</b> ()
1754         *
1755     * <p>
1756     * <b>Definition:</b>
1757     * Human-readable description of the source document. This is sometimes known as the \&quot;title\&quot;
1758     * </p> 
1759         */
1760        public DocumentReference setDescription(StringDt theValue) {
1761                myDescription = theValue;
1762                return this;
1763        }
1764        
1765        
1766
1767        /**
1768         * Sets the value for <b>description</b> ()
1769         *
1770     * <p>
1771     * <b>Definition:</b>
1772     * Human-readable description of the source document. This is sometimes known as the \&quot;title\&quot;
1773     * </p> 
1774         */
1775        public DocumentReference setDescription( String theString) {
1776                myDescription = new StringDt(theString); 
1777                return this; 
1778        }
1779
1780 
1781        /**
1782         * Gets the value(s) for <b>securityLabel</b> ().
1783         * creating it if it does
1784         * not exist. Will not return <code>null</code>.
1785         *
1786     * <p>
1787     * <b>Definition:</b>
1788     * A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \&quot;reference\&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to
1789     * </p> 
1790         */
1791        public java.util.List<CodeableConceptDt> getSecurityLabel() {  
1792                if (mySecurityLabel == null) {
1793                        mySecurityLabel = new java.util.ArrayList<CodeableConceptDt>();
1794                }
1795                return mySecurityLabel;
1796        }
1797
1798        /**
1799         * Sets the value(s) for <b>securityLabel</b> ()
1800         *
1801     * <p>
1802     * <b>Definition:</b>
1803     * A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \&quot;reference\&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to
1804     * </p> 
1805         */
1806        public DocumentReference setSecurityLabel(java.util.List<CodeableConceptDt> theValue) {
1807                mySecurityLabel = theValue;
1808                return this;
1809        }
1810        
1811        
1812
1813        /**
1814         * Adds and returns a new value for <b>securityLabel</b> ()
1815         *
1816     * <p>
1817     * <b>Definition:</b>
1818     * A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \&quot;reference\&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to
1819     * </p> 
1820         */
1821        public CodeableConceptDt addSecurityLabel() {
1822                CodeableConceptDt newType = new CodeableConceptDt();
1823                getSecurityLabel().add(newType);
1824                return newType; 
1825        }
1826
1827        /**
1828         * Adds a given new value for <b>securityLabel</b> ()
1829         *
1830         * <p>
1831         * <b>Definition:</b>
1832         * A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \&quot;reference\&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to
1833         * </p>
1834         * @param theValue The securityLabel to add (must not be <code>null</code>)
1835         */
1836        public DocumentReference addSecurityLabel(CodeableConceptDt theValue) {
1837                if (theValue == null) {
1838                        throw new NullPointerException("theValue must not be null");
1839                }
1840                getSecurityLabel().add(theValue);
1841                return this;
1842        }
1843
1844        /**
1845         * Gets the first repetition for <b>securityLabel</b> (),
1846         * creating it if it does not already exist.
1847         *
1848     * <p>
1849     * <b>Definition:</b>
1850     * A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \&quot;reference\&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to
1851     * </p> 
1852         */
1853        public CodeableConceptDt getSecurityLabelFirstRep() {
1854                if (getSecurityLabel().isEmpty()) {
1855                        return addSecurityLabel();
1856                }
1857                return getSecurityLabel().get(0); 
1858        }
1859  
1860        /**
1861         * Gets the value(s) for <b>content</b> ().
1862         * creating it if it does
1863         * not exist. Will not return <code>null</code>.
1864         *
1865     * <p>
1866     * <b>Definition:</b>
1867     * The document and format referenced. There may be multiple content element repetitions, each with a different format.
1868     * </p> 
1869         */
1870        public java.util.List<Content> getContent() {  
1871                if (myContent == null) {
1872                        myContent = new java.util.ArrayList<Content>();
1873                }
1874                return myContent;
1875        }
1876
1877        /**
1878         * Sets the value(s) for <b>content</b> ()
1879         *
1880     * <p>
1881     * <b>Definition:</b>
1882     * The document and format referenced. There may be multiple content element repetitions, each with a different format.
1883     * </p> 
1884         */
1885        public DocumentReference setContent(java.util.List<Content> theValue) {
1886                myContent = theValue;
1887                return this;
1888        }
1889        
1890        
1891
1892        /**
1893         * Adds and returns a new value for <b>content</b> ()
1894         *
1895     * <p>
1896     * <b>Definition:</b>
1897     * The document and format referenced. There may be multiple content element repetitions, each with a different format.
1898     * </p> 
1899         */
1900        public Content addContent() {
1901                Content newType = new Content();
1902                getContent().add(newType);
1903                return newType; 
1904        }
1905
1906        /**
1907         * Adds a given new value for <b>content</b> ()
1908         *
1909         * <p>
1910         * <b>Definition:</b>
1911         * The document and format referenced. There may be multiple content element repetitions, each with a different format.
1912         * </p>
1913         * @param theValue The content to add (must not be <code>null</code>)
1914         */
1915        public DocumentReference addContent(Content theValue) {
1916                if (theValue == null) {
1917                        throw new NullPointerException("theValue must not be null");
1918                }
1919                getContent().add(theValue);
1920                return this;
1921        }
1922
1923        /**
1924         * Gets the first repetition for <b>content</b> (),
1925         * creating it if it does not already exist.
1926         *
1927     * <p>
1928     * <b>Definition:</b>
1929     * The document and format referenced. There may be multiple content element repetitions, each with a different format.
1930     * </p> 
1931         */
1932        public Content getContentFirstRep() {
1933                if (getContent().isEmpty()) {
1934                        return addContent();
1935                }
1936                return getContent().get(0); 
1937        }
1938  
1939        /**
1940         * Gets the value(s) for <b>context</b> ().
1941         * creating it if it does
1942         * not exist. Will not return <code>null</code>.
1943         *
1944     * <p>
1945     * <b>Definition:</b>
1946     * The clinical context in which the document was prepared
1947     * </p> 
1948         */
1949        public Context getContext() {  
1950                if (myContext == null) {
1951                        myContext = new Context();
1952                }
1953                return myContext;
1954        }
1955
1956        /**
1957         * Sets the value(s) for <b>context</b> ()
1958         *
1959     * <p>
1960     * <b>Definition:</b>
1961     * The clinical context in which the document was prepared
1962     * </p> 
1963         */
1964        public DocumentReference setContext(Context theValue) {
1965                myContext = theValue;
1966                return this;
1967        }
1968        
1969        
1970
1971  
1972        /**
1973         * Block class for child element: <b>DocumentReference.relatesTo</b> ()
1974         *
1975     * <p>
1976     * <b>Definition:</b>
1977     * Relationships that this document has with other document references that already exist
1978     * </p> 
1979         */
1980        @Block()        
1981        public static class RelatesTo 
1982            extends  BaseIdentifiableElement        implements IResourceBlock {
1983        
1984        @Child(name="code", type=CodeDt.class, order=0, min=1, max=1, summary=false, modifier=false)    
1985        @Description(
1986                shortDefinition="",
1987                formalDefinition="The type of relationship that this document has with anther document"
1988        )
1989        private BoundCodeDt<DocumentRelationshipTypeEnum> myCode;
1990        
1991        @Child(name="target", order=1, min=1, max=1, summary=false, modifier=false, type={
1992                ca.uhn.fhir.model.dstu2.resource.DocumentReference.class        })
1993        @Description(
1994                shortDefinition="",
1995                formalDefinition="The target document of this relationship"
1996        )
1997        private ResourceReferenceDt myTarget;
1998        
1999
2000        @Override
2001        public boolean isEmpty() {
2002                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myCode,  myTarget);
2003        }
2004        
2005        @Override
2006        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2007                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myTarget);
2008        }
2009
2010        /**
2011         * Gets the value(s) for <b>code</b> ().
2012         * creating it if it does
2013         * not exist. Will not return <code>null</code>.
2014         *
2015     * <p>
2016     * <b>Definition:</b>
2017     * The type of relationship that this document has with anther document
2018     * </p> 
2019         */
2020        public BoundCodeDt<DocumentRelationshipTypeEnum> getCodeElement() {  
2021                if (myCode == null) {
2022                        myCode = new BoundCodeDt<DocumentRelationshipTypeEnum>(DocumentRelationshipTypeEnum.VALUESET_BINDER);
2023                }
2024                return myCode;
2025        }
2026
2027        
2028        /**
2029         * Gets the value(s) for <b>code</b> ().
2030         * creating it if it does
2031         * not exist. Will not return <code>null</code>.
2032         *
2033     * <p>
2034     * <b>Definition:</b>
2035     * The type of relationship that this document has with anther document
2036     * </p> 
2037         */
2038        public String getCode() {  
2039                return getCodeElement().getValue();
2040        }
2041
2042        /**
2043         * Sets the value(s) for <b>code</b> ()
2044         *
2045     * <p>
2046     * <b>Definition:</b>
2047     * The type of relationship that this document has with anther document
2048     * </p> 
2049         */
2050        public RelatesTo setCode(BoundCodeDt<DocumentRelationshipTypeEnum> theValue) {
2051                myCode = theValue;
2052                return this;
2053        }
2054        
2055        
2056
2057        /**
2058         * Sets the value(s) for <b>code</b> ()
2059         *
2060     * <p>
2061     * <b>Definition:</b>
2062     * The type of relationship that this document has with anther document
2063     * </p> 
2064         */
2065        public RelatesTo setCode(DocumentRelationshipTypeEnum theValue) {
2066                setCode(new BoundCodeDt<DocumentRelationshipTypeEnum>(DocumentRelationshipTypeEnum.VALUESET_BINDER, theValue));
2067                
2068/*
2069                getCodeElement().setValueAsEnum(theValue);
2070*/
2071                return this;
2072        }
2073
2074  
2075        /**
2076         * Gets the value(s) for <b>target</b> ().
2077         * creating it if it does
2078         * not exist. Will not return <code>null</code>.
2079         *
2080     * <p>
2081     * <b>Definition:</b>
2082     * The target document of this relationship
2083     * </p> 
2084         */
2085        public ResourceReferenceDt getTarget() {  
2086                if (myTarget == null) {
2087                        myTarget = new ResourceReferenceDt();
2088                }
2089                return myTarget;
2090        }
2091
2092        /**
2093         * Sets the value(s) for <b>target</b> ()
2094         *
2095     * <p>
2096     * <b>Definition:</b>
2097     * The target document of this relationship
2098     * </p> 
2099         */
2100        public RelatesTo setTarget(ResourceReferenceDt theValue) {
2101                myTarget = theValue;
2102                return this;
2103        }
2104        
2105        
2106
2107  
2108
2109
2110        }
2111
2112
2113        /**
2114         * Block class for child element: <b>DocumentReference.content</b> ()
2115         *
2116     * <p>
2117     * <b>Definition:</b>
2118     * The document and format referenced. There may be multiple content element repetitions, each with a different format.
2119     * </p> 
2120         */
2121        @Block()        
2122        public static class Content 
2123            extends  BaseIdentifiableElement        implements IResourceBlock {
2124        
2125        @Child(name="attachment", type=AttachmentDt.class, order=0, min=1, max=1, summary=false, modifier=false)        
2126        @Description(
2127                shortDefinition="",
2128                formalDefinition="The document or url of the document along with critical metadata to prove content has integrity."
2129        )
2130        private AttachmentDt myAttachment;
2131        
2132        @Child(name="format", type=CodingDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
2133        @Description(
2134                shortDefinition="",
2135                formalDefinition="An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType"
2136        )
2137        private java.util.List<CodingDt> myFormat;
2138        
2139
2140        @Override
2141        public boolean isEmpty() {
2142                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myAttachment,  myFormat);
2143        }
2144        
2145        @Override
2146        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2147                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myAttachment, myFormat);
2148        }
2149
2150        /**
2151         * Gets the value(s) for <b>attachment</b> ().
2152         * creating it if it does
2153         * not exist. Will not return <code>null</code>.
2154         *
2155     * <p>
2156     * <b>Definition:</b>
2157     * The document or url of the document along with critical metadata to prove content has integrity.
2158     * </p> 
2159         */
2160        public AttachmentDt getAttachment() {  
2161                if (myAttachment == null) {
2162                        myAttachment = new AttachmentDt();
2163                }
2164                return myAttachment;
2165        }
2166
2167        /**
2168         * Sets the value(s) for <b>attachment</b> ()
2169         *
2170     * <p>
2171     * <b>Definition:</b>
2172     * The document or url of the document along with critical metadata to prove content has integrity.
2173     * </p> 
2174         */
2175        public Content setAttachment(AttachmentDt theValue) {
2176                myAttachment = theValue;
2177                return this;
2178        }
2179        
2180        
2181
2182  
2183        /**
2184         * Gets the value(s) for <b>format</b> ().
2185         * creating it if it does
2186         * not exist. Will not return <code>null</code>.
2187         *
2188     * <p>
2189     * <b>Definition:</b>
2190     * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType
2191     * </p> 
2192         */
2193        public java.util.List<CodingDt> getFormat() {  
2194                if (myFormat == null) {
2195                        myFormat = new java.util.ArrayList<CodingDt>();
2196                }
2197                return myFormat;
2198        }
2199
2200        /**
2201         * Sets the value(s) for <b>format</b> ()
2202         *
2203     * <p>
2204     * <b>Definition:</b>
2205     * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType
2206     * </p> 
2207         */
2208        public Content setFormat(java.util.List<CodingDt> theValue) {
2209                myFormat = theValue;
2210                return this;
2211        }
2212        
2213        
2214
2215        /**
2216         * Adds and returns a new value for <b>format</b> ()
2217         *
2218     * <p>
2219     * <b>Definition:</b>
2220     * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType
2221     * </p> 
2222         */
2223        public CodingDt addFormat() {
2224                CodingDt newType = new CodingDt();
2225                getFormat().add(newType);
2226                return newType; 
2227        }
2228
2229        /**
2230         * Adds a given new value for <b>format</b> ()
2231         *
2232         * <p>
2233         * <b>Definition:</b>
2234         * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType
2235         * </p>
2236         * @param theValue The format to add (must not be <code>null</code>)
2237         */
2238        public Content addFormat(CodingDt theValue) {
2239                if (theValue == null) {
2240                        throw new NullPointerException("theValue must not be null");
2241                }
2242                getFormat().add(theValue);
2243                return this;
2244        }
2245
2246        /**
2247         * Gets the first repetition for <b>format</b> (),
2248         * creating it if it does not already exist.
2249         *
2250     * <p>
2251     * <b>Definition:</b>
2252     * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType
2253     * </p> 
2254         */
2255        public CodingDt getFormatFirstRep() {
2256                if (getFormat().isEmpty()) {
2257                        return addFormat();
2258                }
2259                return getFormat().get(0); 
2260        }
2261  
2262
2263
2264        }
2265
2266
2267        /**
2268         * Block class for child element: <b>DocumentReference.context</b> ()
2269         *
2270     * <p>
2271     * <b>Definition:</b>
2272     * The clinical context in which the document was prepared
2273     * </p> 
2274         */
2275        @Block()        
2276        public static class Context 
2277            extends  BaseIdentifiableElement        implements IResourceBlock {
2278        
2279        @Child(name="encounter", order=0, min=0, max=1, summary=false, modifier=false, type={
2280                ca.uhn.fhir.model.dstu2.resource.Encounter.class        })
2281        @Description(
2282                shortDefinition="context",
2283                formalDefinition="Describes the clinical encounter or type of care that the document content is associated with"
2284        )
2285        private ResourceReferenceDt myEncounter;
2286        
2287        @Child(name="event", type=CodeableConceptDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
2288        @Description(
2289                shortDefinition="",
2290                formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act"
2291        )
2292        private java.util.List<CodeableConceptDt> myEvent;
2293        
2294        @Child(name="period", type=PeriodDt.class, order=2, min=0, max=1, summary=false, modifier=false)        
2295        @Description(
2296                shortDefinition="",
2297                formalDefinition="The time period over which the service that is described by the document was provided"
2298        )
2299        private PeriodDt myPeriod;
2300        
2301        @Child(name="facilityType", type=CodeableConceptDt.class, order=3, min=0, max=1, summary=false, modifier=false) 
2302        @Description(
2303                shortDefinition="",
2304                formalDefinition="The kind of facility where the patient was seen"
2305        )
2306        private CodeableConceptDt myFacilityType;
2307        
2308        @Child(name="practiceSetting", type=CodeableConceptDt.class, order=4, min=0, max=1, summary=false, modifier=false)      
2309        @Description(
2310                shortDefinition="",
2311                formalDefinition="This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty"
2312        )
2313        private CodeableConceptDt myPracticeSetting;
2314        
2315        @Child(name="sourcePatientInfo", order=5, min=0, max=1, summary=false, modifier=false, type={
2316                ca.uhn.fhir.model.dstu2.resource.Patient.class  })
2317        @Description(
2318                shortDefinition="",
2319                formalDefinition="The Patient Information as known when the document was published. May be a reference to a version specific, or contained"
2320        )
2321        private ResourceReferenceDt mySourcePatientInfo;
2322        
2323        @Child(name="related", order=6, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)  
2324        @Description(
2325                shortDefinition="",
2326                formalDefinition="Related identifiers or resources associated with the DocumentReference."
2327        )
2328        private java.util.List<ContextRelated> myRelated;
2329        
2330
2331        @Override
2332        public boolean isEmpty() {
2333                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myEncounter,  myEvent,  myPeriod,  myFacilityType,  myPracticeSetting,  mySourcePatientInfo,  myRelated);
2334        }
2335        
2336        @Override
2337        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2338                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myEncounter, myEvent, myPeriod, myFacilityType, myPracticeSetting, mySourcePatientInfo, myRelated);
2339        }
2340
2341        /**
2342         * Gets the value(s) for <b>encounter</b> (context).
2343         * creating it if it does
2344         * not exist. Will not return <code>null</code>.
2345         *
2346     * <p>
2347     * <b>Definition:</b>
2348     * Describes the clinical encounter or type of care that the document content is associated with
2349     * </p> 
2350         */
2351        public ResourceReferenceDt getEncounter() {  
2352                if (myEncounter == null) {
2353                        myEncounter = new ResourceReferenceDt();
2354                }
2355                return myEncounter;
2356        }
2357
2358        /**
2359         * Sets the value(s) for <b>encounter</b> (context)
2360         *
2361     * <p>
2362     * <b>Definition:</b>
2363     * Describes the clinical encounter or type of care that the document content is associated with
2364     * </p> 
2365         */
2366        public Context setEncounter(ResourceReferenceDt theValue) {
2367                myEncounter = theValue;
2368                return this;
2369        }
2370        
2371        
2372
2373  
2374        /**
2375         * Gets the value(s) for <b>event</b> ().
2376         * creating it if it does
2377         * not exist. Will not return <code>null</code>.
2378         *
2379     * <p>
2380     * <b>Definition:</b>
2381     * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \&quot;History and Physical Report\&quot; in which the procedure being documented is necessarily a \&quot;History and Physical\&quot; act
2382     * </p> 
2383         */
2384        public java.util.List<CodeableConceptDt> getEvent() {  
2385                if (myEvent == null) {
2386                        myEvent = new java.util.ArrayList<CodeableConceptDt>();
2387                }
2388                return myEvent;
2389        }
2390
2391        /**
2392         * Sets the value(s) for <b>event</b> ()
2393         *
2394     * <p>
2395     * <b>Definition:</b>
2396     * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \&quot;History and Physical Report\&quot; in which the procedure being documented is necessarily a \&quot;History and Physical\&quot; act
2397     * </p> 
2398         */
2399        public Context setEvent(java.util.List<CodeableConceptDt> theValue) {
2400                myEvent = theValue;
2401                return this;
2402        }
2403        
2404        
2405
2406        /**
2407         * Adds and returns a new value for <b>event</b> ()
2408         *
2409     * <p>
2410     * <b>Definition:</b>
2411     * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \&quot;History and Physical Report\&quot; in which the procedure being documented is necessarily a \&quot;History and Physical\&quot; act
2412     * </p> 
2413         */
2414        public CodeableConceptDt addEvent() {
2415                CodeableConceptDt newType = new CodeableConceptDt();
2416                getEvent().add(newType);
2417                return newType; 
2418        }
2419
2420        /**
2421         * Adds a given new value for <b>event</b> ()
2422         *
2423         * <p>
2424         * <b>Definition:</b>
2425         * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \&quot;History and Physical Report\&quot; in which the procedure being documented is necessarily a \&quot;History and Physical\&quot; act
2426         * </p>
2427         * @param theValue The event to add (must not be <code>null</code>)
2428         */
2429        public Context addEvent(CodeableConceptDt theValue) {
2430                if (theValue == null) {
2431                        throw new NullPointerException("theValue must not be null");
2432                }
2433                getEvent().add(theValue);
2434                return this;
2435        }
2436
2437        /**
2438         * Gets the first repetition for <b>event</b> (),
2439         * creating it if it does not already exist.
2440         *
2441     * <p>
2442     * <b>Definition:</b>
2443     * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \&quot;History and Physical Report\&quot; in which the procedure being documented is necessarily a \&quot;History and Physical\&quot; act
2444     * </p> 
2445         */
2446        public CodeableConceptDt getEventFirstRep() {
2447                if (getEvent().isEmpty()) {
2448                        return addEvent();
2449                }
2450                return getEvent().get(0); 
2451        }
2452  
2453        /**
2454         * Gets the value(s) for <b>period</b> ().
2455         * creating it if it does
2456         * not exist. Will not return <code>null</code>.
2457         *
2458     * <p>
2459     * <b>Definition:</b>
2460     * The time period over which the service that is described by the document was provided
2461     * </p> 
2462         */
2463        public PeriodDt getPeriod() {  
2464                if (myPeriod == null) {
2465                        myPeriod = new PeriodDt();
2466                }
2467                return myPeriod;
2468        }
2469
2470        /**
2471         * Sets the value(s) for <b>period</b> ()
2472         *
2473     * <p>
2474     * <b>Definition:</b>
2475     * The time period over which the service that is described by the document was provided
2476     * </p> 
2477         */
2478        public Context setPeriod(PeriodDt theValue) {
2479                myPeriod = theValue;
2480                return this;
2481        }
2482        
2483        
2484
2485  
2486        /**
2487         * Gets the value(s) for <b>facilityType</b> ().
2488         * creating it if it does
2489         * not exist. Will not return <code>null</code>.
2490         *
2491     * <p>
2492     * <b>Definition:</b>
2493     * The kind of facility where the patient was seen
2494     * </p> 
2495         */
2496        public CodeableConceptDt getFacilityType() {  
2497                if (myFacilityType == null) {
2498                        myFacilityType = new CodeableConceptDt();
2499                }
2500                return myFacilityType;
2501        }
2502
2503        /**
2504         * Sets the value(s) for <b>facilityType</b> ()
2505         *
2506     * <p>
2507     * <b>Definition:</b>
2508     * The kind of facility where the patient was seen
2509     * </p> 
2510         */
2511        public Context setFacilityType(CodeableConceptDt theValue) {
2512                myFacilityType = theValue;
2513                return this;
2514        }
2515        
2516        
2517
2518  
2519        /**
2520         * Gets the value(s) for <b>practiceSetting</b> ().
2521         * creating it if it does
2522         * not exist. Will not return <code>null</code>.
2523         *
2524     * <p>
2525     * <b>Definition:</b>
2526     * This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty
2527     * </p> 
2528         */
2529        public CodeableConceptDt getPracticeSetting() {  
2530                if (myPracticeSetting == null) {
2531                        myPracticeSetting = new CodeableConceptDt();
2532                }
2533                return myPracticeSetting;
2534        }
2535
2536        /**
2537         * Sets the value(s) for <b>practiceSetting</b> ()
2538         *
2539     * <p>
2540     * <b>Definition:</b>
2541     * This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty
2542     * </p> 
2543         */
2544        public Context setPracticeSetting(CodeableConceptDt theValue) {
2545                myPracticeSetting = theValue;
2546                return this;
2547        }
2548        
2549        
2550
2551  
2552        /**
2553         * Gets the value(s) for <b>sourcePatientInfo</b> ().
2554         * creating it if it does
2555         * not exist. Will not return <code>null</code>.
2556         *
2557     * <p>
2558     * <b>Definition:</b>
2559     * The Patient Information as known when the document was published. May be a reference to a version specific, or contained
2560     * </p> 
2561         */
2562        public ResourceReferenceDt getSourcePatientInfo() {  
2563                if (mySourcePatientInfo == null) {
2564                        mySourcePatientInfo = new ResourceReferenceDt();
2565                }
2566                return mySourcePatientInfo;
2567        }
2568
2569        /**
2570         * Sets the value(s) for <b>sourcePatientInfo</b> ()
2571         *
2572     * <p>
2573     * <b>Definition:</b>
2574     * The Patient Information as known when the document was published. May be a reference to a version specific, or contained
2575     * </p> 
2576         */
2577        public Context setSourcePatientInfo(ResourceReferenceDt theValue) {
2578                mySourcePatientInfo = theValue;
2579                return this;
2580        }
2581        
2582        
2583
2584  
2585        /**
2586         * Gets the value(s) for <b>related</b> ().
2587         * creating it if it does
2588         * not exist. Will not return <code>null</code>.
2589         *
2590     * <p>
2591     * <b>Definition:</b>
2592     * Related identifiers or resources associated with the DocumentReference.
2593     * </p> 
2594         */
2595        public java.util.List<ContextRelated> getRelated() {  
2596                if (myRelated == null) {
2597                        myRelated = new java.util.ArrayList<ContextRelated>();
2598                }
2599                return myRelated;
2600        }
2601
2602        /**
2603         * Sets the value(s) for <b>related</b> ()
2604         *
2605     * <p>
2606     * <b>Definition:</b>
2607     * Related identifiers or resources associated with the DocumentReference.
2608     * </p> 
2609         */
2610        public Context setRelated(java.util.List<ContextRelated> theValue) {
2611                myRelated = theValue;
2612                return this;
2613        }
2614        
2615        
2616
2617        /**
2618         * Adds and returns a new value for <b>related</b> ()
2619         *
2620     * <p>
2621     * <b>Definition:</b>
2622     * Related identifiers or resources associated with the DocumentReference.
2623     * </p> 
2624         */
2625        public ContextRelated addRelated() {
2626                ContextRelated newType = new ContextRelated();
2627                getRelated().add(newType);
2628                return newType; 
2629        }
2630
2631        /**
2632         * Adds a given new value for <b>related</b> ()
2633         *
2634         * <p>
2635         * <b>Definition:</b>
2636         * Related identifiers or resources associated with the DocumentReference.
2637         * </p>
2638         * @param theValue The related to add (must not be <code>null</code>)
2639         */
2640        public Context addRelated(ContextRelated theValue) {
2641                if (theValue == null) {
2642                        throw new NullPointerException("theValue must not be null");
2643                }
2644                getRelated().add(theValue);
2645                return this;
2646        }
2647
2648        /**
2649         * Gets the first repetition for <b>related</b> (),
2650         * creating it if it does not already exist.
2651         *
2652     * <p>
2653     * <b>Definition:</b>
2654     * Related identifiers or resources associated with the DocumentReference.
2655     * </p> 
2656         */
2657        public ContextRelated getRelatedFirstRep() {
2658                if (getRelated().isEmpty()) {
2659                        return addRelated();
2660                }
2661                return getRelated().get(0); 
2662        }
2663  
2664
2665
2666        }
2667
2668        /**
2669         * Block class for child element: <b>DocumentReference.context.related</b> ()
2670         *
2671     * <p>
2672     * <b>Definition:</b>
2673     * Related identifiers or resources associated with the DocumentReference.
2674     * </p> 
2675         */
2676        @Block()        
2677        public static class ContextRelated 
2678            extends  BaseIdentifiableElement        implements IResourceBlock {
2679        
2680        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1, summary=false, modifier=false)        
2681        @Description(
2682                shortDefinition="",
2683                formalDefinition="Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing."
2684        )
2685        private IdentifierDt myIdentifier;
2686        
2687        @Child(name="ref", order=1, min=0, max=1, summary=false, modifier=false, type={
2688                IResource.class })
2689        @Description(
2690                shortDefinition="",
2691                formalDefinition="Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing."
2692        )
2693        private ResourceReferenceDt myRef;
2694        
2695
2696        @Override
2697        public boolean isEmpty() {
2698                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myRef);
2699        }
2700        
2701        @Override
2702        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2703                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myRef);
2704        }
2705
2706        /**
2707         * Gets the value(s) for <b>identifier</b> ().
2708         * creating it if it does
2709         * not exist. Will not return <code>null</code>.
2710         *
2711     * <p>
2712     * <b>Definition:</b>
2713     * Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.
2714     * </p> 
2715         */
2716        public IdentifierDt getIdentifier() {  
2717                if (myIdentifier == null) {
2718                        myIdentifier = new IdentifierDt();
2719                }
2720                return myIdentifier;
2721        }
2722
2723        /**
2724         * Sets the value(s) for <b>identifier</b> ()
2725         *
2726     * <p>
2727     * <b>Definition:</b>
2728     * Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.
2729     * </p> 
2730         */
2731        public ContextRelated setIdentifier(IdentifierDt theValue) {
2732                myIdentifier = theValue;
2733                return this;
2734        }
2735        
2736        
2737
2738  
2739        /**
2740         * Gets the value(s) for <b>ref</b> ().
2741         * creating it if it does
2742         * not exist. Will not return <code>null</code>.
2743         *
2744     * <p>
2745     * <b>Definition:</b>
2746     * Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.
2747     * </p> 
2748         */
2749        public ResourceReferenceDt getRef() {  
2750                if (myRef == null) {
2751                        myRef = new ResourceReferenceDt();
2752                }
2753                return myRef;
2754        }
2755
2756        /**
2757         * Sets the value(s) for <b>ref</b> ()
2758         *
2759     * <p>
2760     * <b>Definition:</b>
2761     * Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.
2762     * </p> 
2763         */
2764        public ContextRelated setRef(ResourceReferenceDt theValue) {
2765                myRef = theValue;
2766                return this;
2767        }
2768        
2769        
2770
2771  
2772
2773
2774        }
2775
2776
2777
2778
2779
2780    @Override
2781    public String getResourceName() {
2782        return "DocumentReference";
2783    }
2784    
2785    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
2786        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
2787    }
2788
2789
2790}