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>Provenance</b> Resource
320 * (infrastructure.information)
321 *
322 * <p>
323 * <b>Definition:</b>
324 * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.
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/Provenance">http://hl7.org/fhir/profiles/Provenance</a> 
335 * </p>
336 *
337 */
338@ResourceDef(name="Provenance", profile="http://hl7.org/fhir/profiles/Provenance", id="provenance")
339public class Provenance extends ca.uhn.fhir.model.dstu2.resource.BaseResource
340    implements  IResource     {
341
342        /**
343         * Search parameter constant for <b>target</b>
344         * <p>
345         * Description: <b></b><br>
346         * Type: <b>reference</b><br>
347         * Path: <b>Provenance.target</b><br>
348         * </p>
349         */
350        @SearchParamDefinition(name="target", path="Provenance.target", description="", type="reference"  )
351        public static final String SP_TARGET = "target";
352
353        /**
354         * <b>Fluent Client</b> search parameter constant for <b>target</b>
355         * <p>
356         * Description: <b></b><br>
357         * Type: <b>reference</b><br>
358         * Path: <b>Provenance.target</b><br>
359         * </p>
360         */
361        public static final ReferenceClientParam TARGET = new ReferenceClientParam(SP_TARGET);
362
363        /**
364         * Search parameter constant for <b>start</b>
365         * <p>
366         * Description: <b></b><br>
367         * Type: <b>date</b><br>
368         * Path: <b>Provenance.period.start</b><br>
369         * </p>
370         */
371        @SearchParamDefinition(name="start", path="Provenance.period.start", description="", type="date"  )
372        public static final String SP_START = "start";
373
374        /**
375         * <b>Fluent Client</b> search parameter constant for <b>start</b>
376         * <p>
377         * Description: <b></b><br>
378         * Type: <b>date</b><br>
379         * Path: <b>Provenance.period.start</b><br>
380         * </p>
381         */
382        public static final DateClientParam START = new DateClientParam(SP_START);
383
384        /**
385         * Search parameter constant for <b>end</b>
386         * <p>
387         * Description: <b></b><br>
388         * Type: <b>date</b><br>
389         * Path: <b>Provenance.period.end</b><br>
390         * </p>
391         */
392        @SearchParamDefinition(name="end", path="Provenance.period.end", description="", type="date"  )
393        public static final String SP_END = "end";
394
395        /**
396         * <b>Fluent Client</b> search parameter constant for <b>end</b>
397         * <p>
398         * Description: <b></b><br>
399         * Type: <b>date</b><br>
400         * Path: <b>Provenance.period.end</b><br>
401         * </p>
402         */
403        public static final DateClientParam END = new DateClientParam(SP_END);
404
405        /**
406         * Search parameter constant for <b>location</b>
407         * <p>
408         * Description: <b></b><br>
409         * Type: <b>reference</b><br>
410         * Path: <b>Provenance.location</b><br>
411         * </p>
412         */
413        @SearchParamDefinition(name="location", path="Provenance.location", description="", type="reference"  )
414        public static final String SP_LOCATION = "location";
415
416        /**
417         * <b>Fluent Client</b> search parameter constant for <b>location</b>
418         * <p>
419         * Description: <b></b><br>
420         * Type: <b>reference</b><br>
421         * Path: <b>Provenance.location</b><br>
422         * </p>
423         */
424        public static final ReferenceClientParam LOCATION = new ReferenceClientParam(SP_LOCATION);
425
426        /**
427         * Search parameter constant for <b>agent</b>
428         * <p>
429         * Description: <b></b><br>
430         * Type: <b>reference</b><br>
431         * Path: <b>Provenance.agent.actor</b><br>
432         * </p>
433         */
434        @SearchParamDefinition(name="agent", path="Provenance.agent.actor", description="", type="reference"  )
435        public static final String SP_AGENT = "agent";
436
437        /**
438         * <b>Fluent Client</b> search parameter constant for <b>agent</b>
439         * <p>
440         * Description: <b></b><br>
441         * Type: <b>reference</b><br>
442         * Path: <b>Provenance.agent.actor</b><br>
443         * </p>
444         */
445        public static final ReferenceClientParam AGENT = new ReferenceClientParam(SP_AGENT);
446
447        /**
448         * Search parameter constant for <b>userid</b>
449         * <p>
450         * Description: <b></b><br>
451         * Type: <b>token</b><br>
452         * Path: <b>Provenance.agent.userId</b><br>
453         * </p>
454         */
455        @SearchParamDefinition(name="userid", path="Provenance.agent.userId", description="", type="token"  )
456        public static final String SP_USERID = "userid";
457
458        /**
459         * <b>Fluent Client</b> search parameter constant for <b>userid</b>
460         * <p>
461         * Description: <b></b><br>
462         * Type: <b>token</b><br>
463         * Path: <b>Provenance.agent.userId</b><br>
464         * </p>
465         */
466        public static final TokenClientParam USERID = new TokenClientParam(SP_USERID);
467
468        /**
469         * Search parameter constant for <b>patient</b>
470         * <p>
471         * Description: <b></b><br>
472         * Type: <b>reference</b><br>
473         * Path: <b>Provenance.target</b><br>
474         * </p>
475         */
476        @SearchParamDefinition(name="patient", path="Provenance.target", description="", type="reference"  )
477        public static final String SP_PATIENT = "patient";
478
479        /**
480         * <b>Fluent Client</b> search parameter constant for <b>patient</b>
481         * <p>
482         * Description: <b></b><br>
483         * Type: <b>reference</b><br>
484         * Path: <b>Provenance.target</b><br>
485         * </p>
486         */
487        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
488
489        /**
490         * Search parameter constant for <b>sigtype</b>
491         * <p>
492         * Description: <b></b><br>
493         * Type: <b>token</b><br>
494         * Path: <b>Provenance.signature.type</b><br>
495         * </p>
496         */
497        @SearchParamDefinition(name="sigtype", path="Provenance.signature.type", description="", type="token"  )
498        public static final String SP_SIGTYPE = "sigtype";
499
500        /**
501         * <b>Fluent Client</b> search parameter constant for <b>sigtype</b>
502         * <p>
503         * Description: <b></b><br>
504         * Type: <b>token</b><br>
505         * Path: <b>Provenance.signature.type</b><br>
506         * </p>
507         */
508        public static final TokenClientParam SIGTYPE = new TokenClientParam(SP_SIGTYPE);
509
510        /**
511         * Search parameter constant for <b>entitytype</b>
512         * <p>
513         * Description: <b></b><br>
514         * Type: <b>token</b><br>
515         * Path: <b>Provenance.entity.type</b><br>
516         * </p>
517         */
518        @SearchParamDefinition(name="entitytype", path="Provenance.entity.type", description="", type="token"  )
519        public static final String SP_ENTITYTYPE = "entitytype";
520
521        /**
522         * <b>Fluent Client</b> search parameter constant for <b>entitytype</b>
523         * <p>
524         * Description: <b></b><br>
525         * Type: <b>token</b><br>
526         * Path: <b>Provenance.entity.type</b><br>
527         * </p>
528         */
529        public static final TokenClientParam ENTITYTYPE = new TokenClientParam(SP_ENTITYTYPE);
530
531        /**
532         * Search parameter constant for <b>entity</b>
533         * <p>
534         * Description: <b></b><br>
535         * Type: <b>uri</b><br>
536         * Path: <b>Provenance.entity.reference</b><br>
537         * </p>
538         */
539        @SearchParamDefinition(name="entity", path="Provenance.entity.reference", description="", type="uri"  )
540        public static final String SP_ENTITY = "entity";
541
542        /**
543         * <b>Fluent Client</b> search parameter constant for <b>entity</b>
544         * <p>
545         * Description: <b></b><br>
546         * Type: <b>uri</b><br>
547         * Path: <b>Provenance.entity.reference</b><br>
548         * </p>
549         */
550        public static final UriClientParam ENTITY = new UriClientParam(SP_ENTITY);
551
552
553        /**
554         * Constant for fluent queries to be used to add include statements. Specifies
555         * the path value of "<b>Provenance:agent</b>".
556         */
557        public static final Include INCLUDE_AGENT = new Include("Provenance:agent");
558
559        /**
560         * Constant for fluent queries to be used to add include statements. Specifies
561         * the path value of "<b>Provenance:location</b>".
562         */
563        public static final Include INCLUDE_LOCATION = new Include("Provenance:location");
564
565        /**
566         * Constant for fluent queries to be used to add include statements. Specifies
567         * the path value of "<b>Provenance:patient</b>".
568         */
569        public static final Include INCLUDE_PATIENT = new Include("Provenance:patient");
570
571        /**
572         * Constant for fluent queries to be used to add include statements. Specifies
573         * the path value of "<b>Provenance:target</b>".
574         */
575        public static final Include INCLUDE_TARGET = new Include("Provenance:target");
576
577
578        @Child(name="target", order=0, min=1, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
579                IResource.class })
580        @Description(
581                shortDefinition="what",
582                formalDefinition="The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity"
583        )
584        private java.util.List<ResourceReferenceDt> myTarget;
585        
586        @Child(name="period", type=PeriodDt.class, order=1, min=0, max=1, summary=false, modifier=false)        
587        @Description(
588                shortDefinition="when.done",
589                formalDefinition="The period during which the activity occurred"
590        )
591        private PeriodDt myPeriod;
592        
593        @Child(name="recorded", type=InstantDt.class, order=2, min=1, max=1, summary=false, modifier=false)     
594        @Description(
595                shortDefinition="when.recorded",
596                formalDefinition="The instant of time at which the activity was recorded"
597        )
598        private InstantDt myRecorded;
599        
600        @Child(name="reason", type=CodeableConceptDt.class, order=3, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)     
601        @Description(
602                shortDefinition="why",
603                formalDefinition="The reason that the activity was taking place"
604        )
605        private java.util.List<CodeableConceptDt> myReason;
606        
607        @Child(name="activity", type=CodeableConceptDt.class, order=4, min=0, max=1, summary=false, modifier=false)     
608        @Description(
609                shortDefinition="why",
610                formalDefinition="An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities"
611        )
612        private CodeableConceptDt myActivity;
613        
614        @Child(name="location", order=5, min=0, max=1, summary=false, modifier=false, type={
615                ca.uhn.fhir.model.dstu2.resource.Location.class })
616        @Description(
617                shortDefinition="where",
618                formalDefinition="Where the activity occurred, if relevant"
619        )
620        private ResourceReferenceDt myLocation;
621        
622        @Child(name="policy", type=UriDt.class, order=6, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false) 
623        @Description(
624                shortDefinition="",
625                formalDefinition="Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc."
626        )
627        private java.util.List<UriDt> myPolicy;
628        
629        @Child(name="agent", order=7, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)    
630        @Description(
631                shortDefinition="who",
632                formalDefinition="An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility"
633        )
634        private java.util.List<Agent> myAgent;
635        
636        @Child(name="entity", order=8, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)   
637        @Description(
638                shortDefinition="",
639                formalDefinition="An entity used in this activity"
640        )
641        private java.util.List<Entity> myEntity;
642        
643        @Child(name="signature", type=SignatureDt.class, order=9, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)        
644        @Description(
645                shortDefinition="",
646                formalDefinition="A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated."
647        )
648        private java.util.List<SignatureDt> mySignature;
649        
650
651        @Override
652        public boolean isEmpty() {
653                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myTarget,  myPeriod,  myRecorded,  myReason,  myActivity,  myLocation,  myPolicy,  myAgent,  myEntity,  mySignature);
654        }
655        
656        @Override
657        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
658                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myTarget, myPeriod, myRecorded, myReason, myActivity, myLocation, myPolicy, myAgent, myEntity, mySignature);
659        }
660
661        /**
662         * Gets the value(s) for <b>target</b> (what).
663         * creating it if it does
664         * not exist. Will not return <code>null</code>.
665         *
666     * <p>
667     * <b>Definition:</b>
668     * The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity
669     * </p> 
670         */
671        public java.util.List<ResourceReferenceDt> getTarget() {  
672                if (myTarget == null) {
673                        myTarget = new java.util.ArrayList<ResourceReferenceDt>();
674                }
675                return myTarget;
676        }
677
678        /**
679         * Sets the value(s) for <b>target</b> (what)
680         *
681     * <p>
682     * <b>Definition:</b>
683     * The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity
684     * </p> 
685         */
686        public Provenance setTarget(java.util.List<ResourceReferenceDt> theValue) {
687                myTarget = theValue;
688                return this;
689        }
690        
691        
692
693        /**
694         * Adds and returns a new value for <b>target</b> (what)
695         *
696     * <p>
697     * <b>Definition:</b>
698     * The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity
699     * </p> 
700         */
701        public ResourceReferenceDt addTarget() {
702                ResourceReferenceDt newType = new ResourceReferenceDt();
703                getTarget().add(newType);
704                return newType; 
705        }
706  
707        /**
708         * Gets the value(s) for <b>period</b> (when.done).
709         * creating it if it does
710         * not exist. Will not return <code>null</code>.
711         *
712     * <p>
713     * <b>Definition:</b>
714     * The period during which the activity occurred
715     * </p> 
716         */
717        public PeriodDt getPeriod() {  
718                if (myPeriod == null) {
719                        myPeriod = new PeriodDt();
720                }
721                return myPeriod;
722        }
723
724        /**
725         * Sets the value(s) for <b>period</b> (when.done)
726         *
727     * <p>
728     * <b>Definition:</b>
729     * The period during which the activity occurred
730     * </p> 
731         */
732        public Provenance setPeriod(PeriodDt theValue) {
733                myPeriod = theValue;
734                return this;
735        }
736        
737        
738
739  
740        /**
741         * Gets the value(s) for <b>recorded</b> (when.recorded).
742         * creating it if it does
743         * not exist. Will not return <code>null</code>.
744         *
745     * <p>
746     * <b>Definition:</b>
747     * The instant of time at which the activity was recorded
748     * </p> 
749         */
750        public InstantDt getRecordedElement() {  
751                if (myRecorded == null) {
752                        myRecorded = new InstantDt();
753                }
754                return myRecorded;
755        }
756
757        
758        /**
759         * Gets the value(s) for <b>recorded</b> (when.recorded).
760         * creating it if it does
761         * not exist. Will not return <code>null</code>.
762         *
763     * <p>
764     * <b>Definition:</b>
765     * The instant of time at which the activity was recorded
766     * </p> 
767         */
768        public Date getRecorded() {  
769                return getRecordedElement().getValue();
770        }
771
772        /**
773         * Sets the value(s) for <b>recorded</b> (when.recorded)
774         *
775     * <p>
776     * <b>Definition:</b>
777     * The instant of time at which the activity was recorded
778     * </p> 
779         */
780        public Provenance setRecorded(InstantDt theValue) {
781                myRecorded = theValue;
782                return this;
783        }
784        
785        
786
787        /**
788         * Sets the value for <b>recorded</b> (when.recorded)
789         *
790     * <p>
791     * <b>Definition:</b>
792     * The instant of time at which the activity was recorded
793     * </p> 
794         */
795        public Provenance setRecordedWithMillisPrecision( Date theDate) {
796                myRecorded = new InstantDt(theDate); 
797                return this; 
798        }
799
800        /**
801         * Sets the value for <b>recorded</b> (when.recorded)
802         *
803     * <p>
804     * <b>Definition:</b>
805     * The instant of time at which the activity was recorded
806     * </p> 
807         */
808        public Provenance setRecorded( Date theDate,  TemporalPrecisionEnum thePrecision) {
809                myRecorded = new InstantDt(theDate, thePrecision); 
810                return this; 
811        }
812
813 
814        /**
815         * Gets the value(s) for <b>reason</b> (why).
816         * creating it if it does
817         * not exist. Will not return <code>null</code>.
818         *
819     * <p>
820     * <b>Definition:</b>
821     * The reason that the activity was taking place
822     * </p> 
823         */
824        public java.util.List<CodeableConceptDt> getReason() {  
825                if (myReason == null) {
826                        myReason = new java.util.ArrayList<CodeableConceptDt>();
827                }
828                return myReason;
829        }
830
831        /**
832         * Sets the value(s) for <b>reason</b> (why)
833         *
834     * <p>
835     * <b>Definition:</b>
836     * The reason that the activity was taking place
837     * </p> 
838         */
839        public Provenance setReason(java.util.List<CodeableConceptDt> theValue) {
840                myReason = theValue;
841                return this;
842        }
843        
844        
845
846        /**
847         * Adds and returns a new value for <b>reason</b> (why)
848         *
849     * <p>
850     * <b>Definition:</b>
851     * The reason that the activity was taking place
852     * </p> 
853         */
854        public CodeableConceptDt addReason() {
855                CodeableConceptDt newType = new CodeableConceptDt();
856                getReason().add(newType);
857                return newType; 
858        }
859
860        /**
861         * Adds a given new value for <b>reason</b> (why)
862         *
863         * <p>
864         * <b>Definition:</b>
865         * The reason that the activity was taking place
866         * </p>
867         * @param theValue The reason to add (must not be <code>null</code>)
868         */
869        public Provenance addReason(CodeableConceptDt theValue) {
870                if (theValue == null) {
871                        throw new NullPointerException("theValue must not be null");
872                }
873                getReason().add(theValue);
874                return this;
875        }
876
877        /**
878         * Gets the first repetition for <b>reason</b> (why),
879         * creating it if it does not already exist.
880         *
881     * <p>
882     * <b>Definition:</b>
883     * The reason that the activity was taking place
884     * </p> 
885         */
886        public CodeableConceptDt getReasonFirstRep() {
887                if (getReason().isEmpty()) {
888                        return addReason();
889                }
890                return getReason().get(0); 
891        }
892  
893        /**
894         * Gets the value(s) for <b>activity</b> (why).
895         * creating it if it does
896         * not exist. Will not return <code>null</code>.
897         *
898     * <p>
899     * <b>Definition:</b>
900     * An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities
901     * </p> 
902         */
903        public CodeableConceptDt getActivity() {  
904                if (myActivity == null) {
905                        myActivity = new CodeableConceptDt();
906                }
907                return myActivity;
908        }
909
910        /**
911         * Sets the value(s) for <b>activity</b> (why)
912         *
913     * <p>
914     * <b>Definition:</b>
915     * An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities
916     * </p> 
917         */
918        public Provenance setActivity(CodeableConceptDt theValue) {
919                myActivity = theValue;
920                return this;
921        }
922        
923        
924
925  
926        /**
927         * Gets the value(s) for <b>location</b> (where).
928         * creating it if it does
929         * not exist. Will not return <code>null</code>.
930         *
931     * <p>
932     * <b>Definition:</b>
933     * Where the activity occurred, if relevant
934     * </p> 
935         */
936        public ResourceReferenceDt getLocation() {  
937                if (myLocation == null) {
938                        myLocation = new ResourceReferenceDt();
939                }
940                return myLocation;
941        }
942
943        /**
944         * Sets the value(s) for <b>location</b> (where)
945         *
946     * <p>
947     * <b>Definition:</b>
948     * Where the activity occurred, if relevant
949     * </p> 
950         */
951        public Provenance setLocation(ResourceReferenceDt theValue) {
952                myLocation = theValue;
953                return this;
954        }
955        
956        
957
958  
959        /**
960         * Gets the value(s) for <b>policy</b> ().
961         * creating it if it does
962         * not exist. Will not return <code>null</code>.
963         *
964     * <p>
965     * <b>Definition:</b>
966     * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.
967     * </p> 
968         */
969        public java.util.List<UriDt> getPolicy() {  
970                if (myPolicy == null) {
971                        myPolicy = new java.util.ArrayList<UriDt>();
972                }
973                return myPolicy;
974        }
975
976        /**
977         * Sets the value(s) for <b>policy</b> ()
978         *
979     * <p>
980     * <b>Definition:</b>
981     * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.
982     * </p> 
983         */
984        public Provenance setPolicy(java.util.List<UriDt> theValue) {
985                myPolicy = theValue;
986                return this;
987        }
988        
989        
990
991        /**
992         * Adds and returns a new value for <b>policy</b> ()
993         *
994     * <p>
995     * <b>Definition:</b>
996     * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.
997     * </p> 
998         */
999        public UriDt addPolicy() {
1000                UriDt newType = new UriDt();
1001                getPolicy().add(newType);
1002                return newType; 
1003        }
1004
1005        /**
1006         * Adds a given new value for <b>policy</b> ()
1007         *
1008         * <p>
1009         * <b>Definition:</b>
1010         * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.
1011         * </p>
1012         * @param theValue The policy to add (must not be <code>null</code>)
1013         */
1014        public Provenance addPolicy(UriDt theValue) {
1015                if (theValue == null) {
1016                        throw new NullPointerException("theValue must not be null");
1017                }
1018                getPolicy().add(theValue);
1019                return this;
1020        }
1021
1022        /**
1023         * Gets the first repetition for <b>policy</b> (),
1024         * creating it if it does not already exist.
1025         *
1026     * <p>
1027     * <b>Definition:</b>
1028     * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.
1029     * </p> 
1030         */
1031        public UriDt getPolicyFirstRep() {
1032                if (getPolicy().isEmpty()) {
1033                        return addPolicy();
1034                }
1035                return getPolicy().get(0); 
1036        }
1037        /**
1038         * Adds a new value for <b>policy</b> ()
1039         *
1040     * <p>
1041     * <b>Definition:</b>
1042     * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.
1043     * </p> 
1044     *
1045     * @return Returns a reference to this object, to allow for simple chaining.
1046         */
1047        public Provenance addPolicy( String theUri) {
1048                if (myPolicy == null) {
1049                        myPolicy = new java.util.ArrayList<UriDt>();
1050                }
1051                myPolicy.add(new UriDt(theUri));
1052                return this; 
1053        }
1054
1055 
1056        /**
1057         * Gets the value(s) for <b>agent</b> (who).
1058         * creating it if it does
1059         * not exist. Will not return <code>null</code>.
1060         *
1061     * <p>
1062     * <b>Definition:</b>
1063     * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility
1064     * </p> 
1065         */
1066        public java.util.List<Agent> getAgent() {  
1067                if (myAgent == null) {
1068                        myAgent = new java.util.ArrayList<Agent>();
1069                }
1070                return myAgent;
1071        }
1072
1073        /**
1074         * Sets the value(s) for <b>agent</b> (who)
1075         *
1076     * <p>
1077     * <b>Definition:</b>
1078     * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility
1079     * </p> 
1080         */
1081        public Provenance setAgent(java.util.List<Agent> theValue) {
1082                myAgent = theValue;
1083                return this;
1084        }
1085        
1086        
1087
1088        /**
1089         * Adds and returns a new value for <b>agent</b> (who)
1090         *
1091     * <p>
1092     * <b>Definition:</b>
1093     * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility
1094     * </p> 
1095         */
1096        public Agent addAgent() {
1097                Agent newType = new Agent();
1098                getAgent().add(newType);
1099                return newType; 
1100        }
1101
1102        /**
1103         * Adds a given new value for <b>agent</b> (who)
1104         *
1105         * <p>
1106         * <b>Definition:</b>
1107         * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility
1108         * </p>
1109         * @param theValue The agent to add (must not be <code>null</code>)
1110         */
1111        public Provenance addAgent(Agent theValue) {
1112                if (theValue == null) {
1113                        throw new NullPointerException("theValue must not be null");
1114                }
1115                getAgent().add(theValue);
1116                return this;
1117        }
1118
1119        /**
1120         * Gets the first repetition for <b>agent</b> (who),
1121         * creating it if it does not already exist.
1122         *
1123     * <p>
1124     * <b>Definition:</b>
1125     * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility
1126     * </p> 
1127         */
1128        public Agent getAgentFirstRep() {
1129                if (getAgent().isEmpty()) {
1130                        return addAgent();
1131                }
1132                return getAgent().get(0); 
1133        }
1134  
1135        /**
1136         * Gets the value(s) for <b>entity</b> ().
1137         * creating it if it does
1138         * not exist. Will not return <code>null</code>.
1139         *
1140     * <p>
1141     * <b>Definition:</b>
1142     * An entity used in this activity
1143     * </p> 
1144         */
1145        public java.util.List<Entity> getEntity() {  
1146                if (myEntity == null) {
1147                        myEntity = new java.util.ArrayList<Entity>();
1148                }
1149                return myEntity;
1150        }
1151
1152        /**
1153         * Sets the value(s) for <b>entity</b> ()
1154         *
1155     * <p>
1156     * <b>Definition:</b>
1157     * An entity used in this activity
1158     * </p> 
1159         */
1160        public Provenance setEntity(java.util.List<Entity> theValue) {
1161                myEntity = theValue;
1162                return this;
1163        }
1164        
1165        
1166
1167        /**
1168         * Adds and returns a new value for <b>entity</b> ()
1169         *
1170     * <p>
1171     * <b>Definition:</b>
1172     * An entity used in this activity
1173     * </p> 
1174         */
1175        public Entity addEntity() {
1176                Entity newType = new Entity();
1177                getEntity().add(newType);
1178                return newType; 
1179        }
1180
1181        /**
1182         * Adds a given new value for <b>entity</b> ()
1183         *
1184         * <p>
1185         * <b>Definition:</b>
1186         * An entity used in this activity
1187         * </p>
1188         * @param theValue The entity to add (must not be <code>null</code>)
1189         */
1190        public Provenance addEntity(Entity theValue) {
1191                if (theValue == null) {
1192                        throw new NullPointerException("theValue must not be null");
1193                }
1194                getEntity().add(theValue);
1195                return this;
1196        }
1197
1198        /**
1199         * Gets the first repetition for <b>entity</b> (),
1200         * creating it if it does not already exist.
1201         *
1202     * <p>
1203     * <b>Definition:</b>
1204     * An entity used in this activity
1205     * </p> 
1206         */
1207        public Entity getEntityFirstRep() {
1208                if (getEntity().isEmpty()) {
1209                        return addEntity();
1210                }
1211                return getEntity().get(0); 
1212        }
1213  
1214        /**
1215         * Gets the value(s) for <b>signature</b> ().
1216         * creating it if it does
1217         * not exist. Will not return <code>null</code>.
1218         *
1219     * <p>
1220     * <b>Definition:</b>
1221     * A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.
1222     * </p> 
1223         */
1224        public java.util.List<SignatureDt> getSignature() {  
1225                if (mySignature == null) {
1226                        mySignature = new java.util.ArrayList<SignatureDt>();
1227                }
1228                return mySignature;
1229        }
1230
1231        /**
1232         * Sets the value(s) for <b>signature</b> ()
1233         *
1234     * <p>
1235     * <b>Definition:</b>
1236     * A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.
1237     * </p> 
1238         */
1239        public Provenance setSignature(java.util.List<SignatureDt> theValue) {
1240                mySignature = theValue;
1241                return this;
1242        }
1243        
1244        
1245
1246        /**
1247         * Adds and returns a new value for <b>signature</b> ()
1248         *
1249     * <p>
1250     * <b>Definition:</b>
1251     * A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.
1252     * </p> 
1253         */
1254        public SignatureDt addSignature() {
1255                SignatureDt newType = new SignatureDt();
1256                getSignature().add(newType);
1257                return newType; 
1258        }
1259
1260        /**
1261         * Adds a given new value for <b>signature</b> ()
1262         *
1263         * <p>
1264         * <b>Definition:</b>
1265         * A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.
1266         * </p>
1267         * @param theValue The signature to add (must not be <code>null</code>)
1268         */
1269        public Provenance addSignature(SignatureDt theValue) {
1270                if (theValue == null) {
1271                        throw new NullPointerException("theValue must not be null");
1272                }
1273                getSignature().add(theValue);
1274                return this;
1275        }
1276
1277        /**
1278         * Gets the first repetition for <b>signature</b> (),
1279         * creating it if it does not already exist.
1280         *
1281     * <p>
1282     * <b>Definition:</b>
1283     * A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.
1284     * </p> 
1285         */
1286        public SignatureDt getSignatureFirstRep() {
1287                if (getSignature().isEmpty()) {
1288                        return addSignature();
1289                }
1290                return getSignature().get(0); 
1291        }
1292  
1293        /**
1294         * Block class for child element: <b>Provenance.agent</b> (who)
1295         *
1296     * <p>
1297     * <b>Definition:</b>
1298     * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility
1299     * </p> 
1300         */
1301        @Block()        
1302        public static class Agent 
1303            extends  BaseIdentifiableElement        implements IResourceBlock {
1304        
1305        @Child(name="role", type=CodingDt.class, order=0, min=1, max=1, summary=false, modifier=false)  
1306        @Description(
1307                shortDefinition="",
1308                formalDefinition="The function of the agent with respect to the activity."
1309        )
1310        private CodingDt myRole;
1311        
1312        @Child(name="actor", order=1, min=0, max=1, summary=false, modifier=false, type={
1313                ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.RelatedPerson.class,           ca.uhn.fhir.model.dstu2.resource.Patient.class,                 ca.uhn.fhir.model.dstu2.resource.Device.class,          ca.uhn.fhir.model.dstu2.resource.Organization.class     })
1314        @Description(
1315                shortDefinition="who.actor",
1316                formalDefinition="The individual, device or organization that participated in the event"
1317        )
1318        private ResourceReferenceDt myActor;
1319        
1320        @Child(name="userId", type=IdentifierDt.class, order=2, min=0, max=1, summary=false, modifier=false)    
1321        @Description(
1322                shortDefinition="who.actor",
1323                formalDefinition="The identity of the agent as known by the authorization system"
1324        )
1325        private IdentifierDt myUserId;
1326        
1327        @Child(name="relatedAgent", order=3, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)     
1328        @Description(
1329                shortDefinition="",
1330                formalDefinition="A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents.  For example, this human author used this device, or one person acted on another's behest"
1331        )
1332        private java.util.List<AgentRelatedAgent> myRelatedAgent;
1333        
1334
1335        @Override
1336        public boolean isEmpty() {
1337                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myRole,  myActor,  myUserId,  myRelatedAgent);
1338        }
1339        
1340        @Override
1341        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1342                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRole, myActor, myUserId, myRelatedAgent);
1343        }
1344
1345        /**
1346         * Gets the value(s) for <b>role</b> ().
1347         * creating it if it does
1348         * not exist. Will not return <code>null</code>.
1349         *
1350     * <p>
1351     * <b>Definition:</b>
1352     * The function of the agent with respect to the activity.
1353     * </p> 
1354         */
1355        public CodingDt getRole() {  
1356                if (myRole == null) {
1357                        myRole = new CodingDt();
1358                }
1359                return myRole;
1360        }
1361
1362        /**
1363         * Sets the value(s) for <b>role</b> ()
1364         *
1365     * <p>
1366     * <b>Definition:</b>
1367     * The function of the agent with respect to the activity.
1368     * </p> 
1369         */
1370        public Agent setRole(CodingDt theValue) {
1371                myRole = theValue;
1372                return this;
1373        }
1374        
1375        
1376
1377  
1378        /**
1379         * Gets the value(s) for <b>actor</b> (who.actor).
1380         * creating it if it does
1381         * not exist. Will not return <code>null</code>.
1382         *
1383     * <p>
1384     * <b>Definition:</b>
1385     * The individual, device or organization that participated in the event
1386     * </p> 
1387         */
1388        public ResourceReferenceDt getActor() {  
1389                if (myActor == null) {
1390                        myActor = new ResourceReferenceDt();
1391                }
1392                return myActor;
1393        }
1394
1395        /**
1396         * Sets the value(s) for <b>actor</b> (who.actor)
1397         *
1398     * <p>
1399     * <b>Definition:</b>
1400     * The individual, device or organization that participated in the event
1401     * </p> 
1402         */
1403        public Agent setActor(ResourceReferenceDt theValue) {
1404                myActor = theValue;
1405                return this;
1406        }
1407        
1408        
1409
1410  
1411        /**
1412         * Gets the value(s) for <b>userId</b> (who.actor).
1413         * creating it if it does
1414         * not exist. Will not return <code>null</code>.
1415         *
1416     * <p>
1417     * <b>Definition:</b>
1418     * The identity of the agent as known by the authorization system
1419     * </p> 
1420         */
1421        public IdentifierDt getUserId() {  
1422                if (myUserId == null) {
1423                        myUserId = new IdentifierDt();
1424                }
1425                return myUserId;
1426        }
1427
1428        /**
1429         * Sets the value(s) for <b>userId</b> (who.actor)
1430         *
1431     * <p>
1432     * <b>Definition:</b>
1433     * The identity of the agent as known by the authorization system
1434     * </p> 
1435         */
1436        public Agent setUserId(IdentifierDt theValue) {
1437                myUserId = theValue;
1438                return this;
1439        }
1440        
1441        
1442
1443  
1444        /**
1445         * Gets the value(s) for <b>relatedAgent</b> ().
1446         * creating it if it does
1447         * not exist. Will not return <code>null</code>.
1448         *
1449     * <p>
1450     * <b>Definition:</b>
1451     * A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents.  For example, this human author used this device, or one person acted on another's behest
1452     * </p> 
1453         */
1454        public java.util.List<AgentRelatedAgent> getRelatedAgent() {  
1455                if (myRelatedAgent == null) {
1456                        myRelatedAgent = new java.util.ArrayList<AgentRelatedAgent>();
1457                }
1458                return myRelatedAgent;
1459        }
1460
1461        /**
1462         * Sets the value(s) for <b>relatedAgent</b> ()
1463         *
1464     * <p>
1465     * <b>Definition:</b>
1466     * A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents.  For example, this human author used this device, or one person acted on another's behest
1467     * </p> 
1468         */
1469        public Agent setRelatedAgent(java.util.List<AgentRelatedAgent> theValue) {
1470                myRelatedAgent = theValue;
1471                return this;
1472        }
1473        
1474        
1475
1476        /**
1477         * Adds and returns a new value for <b>relatedAgent</b> ()
1478         *
1479     * <p>
1480     * <b>Definition:</b>
1481     * A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents.  For example, this human author used this device, or one person acted on another's behest
1482     * </p> 
1483         */
1484        public AgentRelatedAgent addRelatedAgent() {
1485                AgentRelatedAgent newType = new AgentRelatedAgent();
1486                getRelatedAgent().add(newType);
1487                return newType; 
1488        }
1489
1490        /**
1491         * Adds a given new value for <b>relatedAgent</b> ()
1492         *
1493         * <p>
1494         * <b>Definition:</b>
1495         * A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents.  For example, this human author used this device, or one person acted on another's behest
1496         * </p>
1497         * @param theValue The relatedAgent to add (must not be <code>null</code>)
1498         */
1499        public Agent addRelatedAgent(AgentRelatedAgent theValue) {
1500                if (theValue == null) {
1501                        throw new NullPointerException("theValue must not be null");
1502                }
1503                getRelatedAgent().add(theValue);
1504                return this;
1505        }
1506
1507        /**
1508         * Gets the first repetition for <b>relatedAgent</b> (),
1509         * creating it if it does not already exist.
1510         *
1511     * <p>
1512     * <b>Definition:</b>
1513     * A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents.  For example, this human author used this device, or one person acted on another's behest
1514     * </p> 
1515         */
1516        public AgentRelatedAgent getRelatedAgentFirstRep() {
1517                if (getRelatedAgent().isEmpty()) {
1518                        return addRelatedAgent();
1519                }
1520                return getRelatedAgent().get(0); 
1521        }
1522  
1523
1524
1525        }
1526
1527        /**
1528         * Block class for child element: <b>Provenance.agent.relatedAgent</b> ()
1529         *
1530     * <p>
1531     * <b>Definition:</b>
1532     * A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents.  For example, this human author used this device, or one person acted on another's behest
1533     * </p> 
1534         */
1535        @Block()        
1536        public static class AgentRelatedAgent 
1537            extends  BaseIdentifiableElement        implements IResourceBlock {
1538        
1539        @Child(name="type", type=CodeableConceptDt.class, order=0, min=1, max=1, summary=false, modifier=false) 
1540        @Description(
1541                shortDefinition="",
1542                formalDefinition="The type of relationship between agents"
1543        )
1544        private CodeableConceptDt myType;
1545        
1546        @Child(name="target", type=UriDt.class, order=1, min=1, max=1, summary=false, modifier=false)   
1547        @Description(
1548                shortDefinition="",
1549                formalDefinition="An internal reference to another agent listed in this provenance by its identifier"
1550        )
1551        private UriDt myTarget;
1552        
1553
1554        @Override
1555        public boolean isEmpty() {
1556                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myType,  myTarget);
1557        }
1558        
1559        @Override
1560        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1561                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myTarget);
1562        }
1563
1564        /**
1565         * Gets the value(s) for <b>type</b> ().
1566         * creating it if it does
1567         * not exist. Will not return <code>null</code>.
1568         *
1569     * <p>
1570     * <b>Definition:</b>
1571     * The type of relationship between agents
1572     * </p> 
1573         */
1574        public CodeableConceptDt getType() {  
1575                if (myType == null) {
1576                        myType = new CodeableConceptDt();
1577                }
1578                return myType;
1579        }
1580
1581        /**
1582         * Sets the value(s) for <b>type</b> ()
1583         *
1584     * <p>
1585     * <b>Definition:</b>
1586     * The type of relationship between agents
1587     * </p> 
1588         */
1589        public AgentRelatedAgent setType(CodeableConceptDt theValue) {
1590                myType = theValue;
1591                return this;
1592        }
1593        
1594        
1595
1596  
1597        /**
1598         * Gets the value(s) for <b>target</b> ().
1599         * creating it if it does
1600         * not exist. Will not return <code>null</code>.
1601         *
1602     * <p>
1603     * <b>Definition:</b>
1604     * An internal reference to another agent listed in this provenance by its identifier
1605     * </p> 
1606         */
1607        public UriDt getTargetElement() {  
1608                if (myTarget == null) {
1609                        myTarget = new UriDt();
1610                }
1611                return myTarget;
1612        }
1613
1614        
1615        /**
1616         * Gets the value(s) for <b>target</b> ().
1617         * creating it if it does
1618         * not exist. Will not return <code>null</code>.
1619         *
1620     * <p>
1621     * <b>Definition:</b>
1622     * An internal reference to another agent listed in this provenance by its identifier
1623     * </p> 
1624         */
1625        public String getTarget() {  
1626                return getTargetElement().getValue();
1627        }
1628
1629        /**
1630         * Sets the value(s) for <b>target</b> ()
1631         *
1632     * <p>
1633     * <b>Definition:</b>
1634     * An internal reference to another agent listed in this provenance by its identifier
1635     * </p> 
1636         */
1637        public AgentRelatedAgent setTarget(UriDt theValue) {
1638                myTarget = theValue;
1639                return this;
1640        }
1641        
1642        
1643
1644        /**
1645         * Sets the value for <b>target</b> ()
1646         *
1647     * <p>
1648     * <b>Definition:</b>
1649     * An internal reference to another agent listed in this provenance by its identifier
1650     * </p> 
1651         */
1652        public AgentRelatedAgent setTarget( String theUri) {
1653                myTarget = new UriDt(theUri); 
1654                return this; 
1655        }
1656
1657 
1658
1659
1660        }
1661
1662
1663
1664        /**
1665         * Block class for child element: <b>Provenance.entity</b> ()
1666         *
1667     * <p>
1668     * <b>Definition:</b>
1669     * An entity used in this activity
1670     * </p> 
1671         */
1672        @Block()        
1673        public static class Entity 
1674            extends  BaseIdentifiableElement        implements IResourceBlock {
1675        
1676        @Child(name="role", type=CodeDt.class, order=0, min=1, max=1, summary=false, modifier=false)    
1677        @Description(
1678                shortDefinition="",
1679                formalDefinition="How the entity was used during the activity"
1680        )
1681        private BoundCodeDt<ProvenanceEntityRoleEnum> myRole;
1682        
1683        @Child(name="type", type=CodingDt.class, order=1, min=1, max=1, summary=false, modifier=false)  
1684        @Description(
1685                shortDefinition="",
1686                formalDefinition="The type of the entity. If the entity is a resource, then this is a resource type"
1687        )
1688        private CodingDt myType;
1689        
1690        @Child(name="reference", type=UriDt.class, order=2, min=1, max=1, summary=false, modifier=false)        
1691        @Description(
1692                shortDefinition="",
1693                formalDefinition="Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative"
1694        )
1695        private UriDt myReference;
1696        
1697        @Child(name="display", type=StringDt.class, order=3, min=0, max=1, summary=false, modifier=false)       
1698        @Description(
1699                shortDefinition="",
1700                formalDefinition="Human-readable description of the entity"
1701        )
1702        private StringDt myDisplay;
1703        
1704        @Child(name="agent", type=Agent.class, order=4, min=0, max=1, summary=false, modifier=false)    
1705        @Description(
1706                shortDefinition="",
1707                formalDefinition="The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity"
1708        )
1709        private Agent myAgent;
1710        
1711
1712        @Override
1713        public boolean isEmpty() {
1714                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myRole,  myType,  myReference,  myDisplay,  myAgent);
1715        }
1716        
1717        @Override
1718        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1719                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRole, myType, myReference, myDisplay, myAgent);
1720        }
1721
1722        /**
1723         * Gets the value(s) for <b>role</b> ().
1724         * creating it if it does
1725         * not exist. Will not return <code>null</code>.
1726         *
1727     * <p>
1728     * <b>Definition:</b>
1729     * How the entity was used during the activity
1730     * </p> 
1731         */
1732        public BoundCodeDt<ProvenanceEntityRoleEnum> getRoleElement() {  
1733                if (myRole == null) {
1734                        myRole = new BoundCodeDt<ProvenanceEntityRoleEnum>(ProvenanceEntityRoleEnum.VALUESET_BINDER);
1735                }
1736                return myRole;
1737        }
1738
1739        
1740        /**
1741         * Gets the value(s) for <b>role</b> ().
1742         * creating it if it does
1743         * not exist. Will not return <code>null</code>.
1744         *
1745     * <p>
1746     * <b>Definition:</b>
1747     * How the entity was used during the activity
1748     * </p> 
1749         */
1750        public String getRole() {  
1751                return getRoleElement().getValue();
1752        }
1753
1754        /**
1755         * Sets the value(s) for <b>role</b> ()
1756         *
1757     * <p>
1758     * <b>Definition:</b>
1759     * How the entity was used during the activity
1760     * </p> 
1761         */
1762        public Entity setRole(BoundCodeDt<ProvenanceEntityRoleEnum> theValue) {
1763                myRole = theValue;
1764                return this;
1765        }
1766        
1767        
1768
1769        /**
1770         * Sets the value(s) for <b>role</b> ()
1771         *
1772     * <p>
1773     * <b>Definition:</b>
1774     * How the entity was used during the activity
1775     * </p> 
1776         */
1777        public Entity setRole(ProvenanceEntityRoleEnum theValue) {
1778                setRole(new BoundCodeDt<ProvenanceEntityRoleEnum>(ProvenanceEntityRoleEnum.VALUESET_BINDER, theValue));
1779                
1780/*
1781                getRoleElement().setValueAsEnum(theValue);
1782*/
1783                return this;
1784        }
1785
1786  
1787        /**
1788         * Gets the value(s) for <b>type</b> ().
1789         * creating it if it does
1790         * not exist. Will not return <code>null</code>.
1791         *
1792     * <p>
1793     * <b>Definition:</b>
1794     * The type of the entity. If the entity is a resource, then this is a resource type
1795     * </p> 
1796         */
1797        public CodingDt getType() {  
1798                if (myType == null) {
1799                        myType = new CodingDt();
1800                }
1801                return myType;
1802        }
1803
1804        /**
1805         * Sets the value(s) for <b>type</b> ()
1806         *
1807     * <p>
1808     * <b>Definition:</b>
1809     * The type of the entity. If the entity is a resource, then this is a resource type
1810     * </p> 
1811         */
1812        public Entity setType(CodingDt theValue) {
1813                myType = theValue;
1814                return this;
1815        }
1816        
1817        
1818
1819  
1820        /**
1821         * Gets the value(s) for <b>reference</b> ().
1822         * creating it if it does
1823         * not exist. Will not return <code>null</code>.
1824         *
1825     * <p>
1826     * <b>Definition:</b>
1827     * Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative
1828     * </p> 
1829         */
1830        public UriDt getReferenceElement() {  
1831                if (myReference == null) {
1832                        myReference = new UriDt();
1833                }
1834                return myReference;
1835        }
1836
1837        
1838        /**
1839         * Gets the value(s) for <b>reference</b> ().
1840         * creating it if it does
1841         * not exist. Will not return <code>null</code>.
1842         *
1843     * <p>
1844     * <b>Definition:</b>
1845     * Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative
1846     * </p> 
1847         */
1848        public String getReference() {  
1849                return getReferenceElement().getValue();
1850        }
1851
1852        /**
1853         * Sets the value(s) for <b>reference</b> ()
1854         *
1855     * <p>
1856     * <b>Definition:</b>
1857     * Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative
1858     * </p> 
1859         */
1860        public Entity setReference(UriDt theValue) {
1861                myReference = theValue;
1862                return this;
1863        }
1864        
1865        
1866
1867        /**
1868         * Sets the value for <b>reference</b> ()
1869         *
1870     * <p>
1871     * <b>Definition:</b>
1872     * Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative
1873     * </p> 
1874         */
1875        public Entity setReference( String theUri) {
1876                myReference = new UriDt(theUri); 
1877                return this; 
1878        }
1879
1880 
1881        /**
1882         * Gets the value(s) for <b>display</b> ().
1883         * creating it if it does
1884         * not exist. Will not return <code>null</code>.
1885         *
1886     * <p>
1887     * <b>Definition:</b>
1888     * Human-readable description of the entity
1889     * </p> 
1890         */
1891        public StringDt getDisplayElement() {  
1892                if (myDisplay == null) {
1893                        myDisplay = new StringDt();
1894                }
1895                return myDisplay;
1896        }
1897
1898        
1899        /**
1900         * Gets the value(s) for <b>display</b> ().
1901         * creating it if it does
1902         * not exist. Will not return <code>null</code>.
1903         *
1904     * <p>
1905     * <b>Definition:</b>
1906     * Human-readable description of the entity
1907     * </p> 
1908         */
1909        public String getDisplay() {  
1910                return getDisplayElement().getValue();
1911        }
1912
1913        /**
1914         * Sets the value(s) for <b>display</b> ()
1915         *
1916     * <p>
1917     * <b>Definition:</b>
1918     * Human-readable description of the entity
1919     * </p> 
1920         */
1921        public Entity setDisplay(StringDt theValue) {
1922                myDisplay = theValue;
1923                return this;
1924        }
1925        
1926        
1927
1928        /**
1929         * Sets the value for <b>display</b> ()
1930         *
1931     * <p>
1932     * <b>Definition:</b>
1933     * Human-readable description of the entity
1934     * </p> 
1935         */
1936        public Entity setDisplay( String theString) {
1937                myDisplay = new StringDt(theString); 
1938                return this; 
1939        }
1940
1941 
1942        /**
1943         * Gets the value(s) for <b>agent</b> ().
1944         * creating it if it does
1945         * not exist. Will not return <code>null</code>.
1946         *
1947     * <p>
1948     * <b>Definition:</b>
1949     * The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity
1950     * </p> 
1951         */
1952        public Agent getAgent() {  
1953                if (myAgent == null) {
1954                        myAgent = new Agent();
1955                }
1956                return myAgent;
1957        }
1958
1959        /**
1960         * Sets the value(s) for <b>agent</b> ()
1961         *
1962     * <p>
1963     * <b>Definition:</b>
1964     * The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity
1965     * </p> 
1966         */
1967        public Entity setAgent(Agent theValue) {
1968                myAgent = theValue;
1969                return this;
1970        }
1971        
1972        
1973
1974  
1975
1976
1977        }
1978
1979
1980
1981
1982    @Override
1983    public String getResourceName() {
1984        return "Provenance";
1985    }
1986    
1987    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
1988        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
1989    }
1990
1991
1992}