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>AuditEvent</b> Resource
320 * ()
321 *
322 * <p>
323 * <b>Definition:</b>
324 * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage
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/AuditEvent">http://hl7.org/fhir/profiles/AuditEvent</a> 
335 * </p>
336 *
337 */
338@ResourceDef(name="AuditEvent", profile="http://hl7.org/fhir/profiles/AuditEvent", id="auditevent")
339public class AuditEvent extends ca.uhn.fhir.model.dstu2.resource.BaseResource
340    implements  IResource     {
341
342        /**
343         * Search parameter constant for <b>type</b>
344         * <p>
345         * Description: <b></b><br>
346         * Type: <b>token</b><br>
347         * Path: <b>AuditEvent.event.type</b><br>
348         * </p>
349         */
350        @SearchParamDefinition(name="type", path="AuditEvent.event.type", description="", type="token"  )
351        public static final String SP_TYPE = "type";
352
353        /**
354         * <b>Fluent Client</b> search parameter constant for <b>type</b>
355         * <p>
356         * Description: <b></b><br>
357         * Type: <b>token</b><br>
358         * Path: <b>AuditEvent.event.type</b><br>
359         * </p>
360         */
361        public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE);
362
363        /**
364         * Search parameter constant for <b>action</b>
365         * <p>
366         * Description: <b></b><br>
367         * Type: <b>token</b><br>
368         * Path: <b>AuditEvent.event.action</b><br>
369         * </p>
370         */
371        @SearchParamDefinition(name="action", path="AuditEvent.event.action", description="", type="token"  )
372        public static final String SP_ACTION = "action";
373
374        /**
375         * <b>Fluent Client</b> search parameter constant for <b>action</b>
376         * <p>
377         * Description: <b></b><br>
378         * Type: <b>token</b><br>
379         * Path: <b>AuditEvent.event.action</b><br>
380         * </p>
381         */
382        public static final TokenClientParam ACTION = new TokenClientParam(SP_ACTION);
383
384        /**
385         * Search parameter constant for <b>date</b>
386         * <p>
387         * Description: <b></b><br>
388         * Type: <b>date</b><br>
389         * Path: <b>AuditEvent.event.dateTime</b><br>
390         * </p>
391         */
392        @SearchParamDefinition(name="date", path="AuditEvent.event.dateTime", description="", type="date"  )
393        public static final String SP_DATE = "date";
394
395        /**
396         * <b>Fluent Client</b> search parameter constant for <b>date</b>
397         * <p>
398         * Description: <b></b><br>
399         * Type: <b>date</b><br>
400         * Path: <b>AuditEvent.event.dateTime</b><br>
401         * </p>
402         */
403        public static final DateClientParam DATE = new DateClientParam(SP_DATE);
404
405        /**
406         * Search parameter constant for <b>subtype</b>
407         * <p>
408         * Description: <b></b><br>
409         * Type: <b>token</b><br>
410         * Path: <b>AuditEvent.event.subtype</b><br>
411         * </p>
412         */
413        @SearchParamDefinition(name="subtype", path="AuditEvent.event.subtype", description="", type="token"  )
414        public static final String SP_SUBTYPE = "subtype";
415
416        /**
417         * <b>Fluent Client</b> search parameter constant for <b>subtype</b>
418         * <p>
419         * Description: <b></b><br>
420         * Type: <b>token</b><br>
421         * Path: <b>AuditEvent.event.subtype</b><br>
422         * </p>
423         */
424        public static final TokenClientParam SUBTYPE = new TokenClientParam(SP_SUBTYPE);
425
426        /**
427         * Search parameter constant for <b>user</b>
428         * <p>
429         * Description: <b></b><br>
430         * Type: <b>token</b><br>
431         * Path: <b>AuditEvent.participant.userId</b><br>
432         * </p>
433         */
434        @SearchParamDefinition(name="user", path="AuditEvent.participant.userId", description="", type="token"  )
435        public static final String SP_USER = "user";
436
437        /**
438         * <b>Fluent Client</b> search parameter constant for <b>user</b>
439         * <p>
440         * Description: <b></b><br>
441         * Type: <b>token</b><br>
442         * Path: <b>AuditEvent.participant.userId</b><br>
443         * </p>
444         */
445        public static final TokenClientParam USER = new TokenClientParam(SP_USER);
446
447        /**
448         * Search parameter constant for <b>name</b>
449         * <p>
450         * Description: <b></b><br>
451         * Type: <b>string</b><br>
452         * Path: <b>AuditEvent.participant.name</b><br>
453         * </p>
454         */
455        @SearchParamDefinition(name="name", path="AuditEvent.participant.name", description="", type="string"  )
456        public static final String SP_NAME = "name";
457
458        /**
459         * <b>Fluent Client</b> search parameter constant for <b>name</b>
460         * <p>
461         * Description: <b></b><br>
462         * Type: <b>string</b><br>
463         * Path: <b>AuditEvent.participant.name</b><br>
464         * </p>
465         */
466        public static final StringClientParam NAME = new StringClientParam(SP_NAME);
467
468        /**
469         * Search parameter constant for <b>address</b>
470         * <p>
471         * Description: <b></b><br>
472         * Type: <b>token</b><br>
473         * Path: <b>AuditEvent.participant.network.address</b><br>
474         * </p>
475         */
476        @SearchParamDefinition(name="address", path="AuditEvent.participant.network.address", description="", type="token"  )
477        public static final String SP_ADDRESS = "address";
478
479        /**
480         * <b>Fluent Client</b> search parameter constant for <b>address</b>
481         * <p>
482         * Description: <b></b><br>
483         * Type: <b>token</b><br>
484         * Path: <b>AuditEvent.participant.network.address</b><br>
485         * </p>
486         */
487        public static final TokenClientParam ADDRESS = new TokenClientParam(SP_ADDRESS);
488
489        /**
490         * Search parameter constant for <b>source</b>
491         * <p>
492         * Description: <b></b><br>
493         * Type: <b>token</b><br>
494         * Path: <b>AuditEvent.source.identifier</b><br>
495         * </p>
496         */
497        @SearchParamDefinition(name="source", path="AuditEvent.source.identifier", description="", type="token"  )
498        public static final String SP_SOURCE = "source";
499
500        /**
501         * <b>Fluent Client</b> search parameter constant for <b>source</b>
502         * <p>
503         * Description: <b></b><br>
504         * Type: <b>token</b><br>
505         * Path: <b>AuditEvent.source.identifier</b><br>
506         * </p>
507         */
508        public static final TokenClientParam SOURCE = new TokenClientParam(SP_SOURCE);
509
510        /**
511         * Search parameter constant for <b>site</b>
512         * <p>
513         * Description: <b></b><br>
514         * Type: <b>token</b><br>
515         * Path: <b>AuditEvent.source.site</b><br>
516         * </p>
517         */
518        @SearchParamDefinition(name="site", path="AuditEvent.source.site", description="", type="token"  )
519        public static final String SP_SITE = "site";
520
521        /**
522         * <b>Fluent Client</b> search parameter constant for <b>site</b>
523         * <p>
524         * Description: <b></b><br>
525         * Type: <b>token</b><br>
526         * Path: <b>AuditEvent.source.site</b><br>
527         * </p>
528         */
529        public static final TokenClientParam SITE = new TokenClientParam(SP_SITE);
530
531        /**
532         * Search parameter constant for <b>object-type</b>
533         * <p>
534         * Description: <b></b><br>
535         * Type: <b>token</b><br>
536         * Path: <b>AuditEvent.object.type</b><br>
537         * </p>
538         */
539        @SearchParamDefinition(name="object-type", path="AuditEvent.object.type", description="", type="token"  )
540        public static final String SP_OBJECT_TYPE = "object-type";
541
542        /**
543         * <b>Fluent Client</b> search parameter constant for <b>object-type</b>
544         * <p>
545         * Description: <b></b><br>
546         * Type: <b>token</b><br>
547         * Path: <b>AuditEvent.object.type</b><br>
548         * </p>
549         */
550        public static final TokenClientParam OBJECT_TYPE = new TokenClientParam(SP_OBJECT_TYPE);
551
552        /**
553         * Search parameter constant for <b>identity</b>
554         * <p>
555         * Description: <b></b><br>
556         * Type: <b>token</b><br>
557         * Path: <b>AuditEvent.object.identifier</b><br>
558         * </p>
559         */
560        @SearchParamDefinition(name="identity", path="AuditEvent.object.identifier", description="", type="token"  )
561        public static final String SP_IDENTITY = "identity";
562
563        /**
564         * <b>Fluent Client</b> search parameter constant for <b>identity</b>
565         * <p>
566         * Description: <b></b><br>
567         * Type: <b>token</b><br>
568         * Path: <b>AuditEvent.object.identifier</b><br>
569         * </p>
570         */
571        public static final TokenClientParam IDENTITY = new TokenClientParam(SP_IDENTITY);
572
573        /**
574         * Search parameter constant for <b>reference</b>
575         * <p>
576         * Description: <b></b><br>
577         * Type: <b>reference</b><br>
578         * Path: <b>AuditEvent.object.reference</b><br>
579         * </p>
580         */
581        @SearchParamDefinition(name="reference", path="AuditEvent.object.reference", description="", type="reference"  )
582        public static final String SP_REFERENCE = "reference";
583
584        /**
585         * <b>Fluent Client</b> search parameter constant for <b>reference</b>
586         * <p>
587         * Description: <b></b><br>
588         * Type: <b>reference</b><br>
589         * Path: <b>AuditEvent.object.reference</b><br>
590         * </p>
591         */
592        public static final ReferenceClientParam REFERENCE = new ReferenceClientParam(SP_REFERENCE);
593
594        /**
595         * Search parameter constant for <b>desc</b>
596         * <p>
597         * Description: <b></b><br>
598         * Type: <b>string</b><br>
599         * Path: <b>AuditEvent.object.name</b><br>
600         * </p>
601         */
602        @SearchParamDefinition(name="desc", path="AuditEvent.object.name", description="", type="string"  )
603        public static final String SP_DESC = "desc";
604
605        /**
606         * <b>Fluent Client</b> search parameter constant for <b>desc</b>
607         * <p>
608         * Description: <b></b><br>
609         * Type: <b>string</b><br>
610         * Path: <b>AuditEvent.object.name</b><br>
611         * </p>
612         */
613        public static final StringClientParam DESC = new StringClientParam(SP_DESC);
614
615        /**
616         * Search parameter constant for <b>patient</b>
617         * <p>
618         * Description: <b></b><br>
619         * Type: <b>reference</b><br>
620         * Path: <b>AuditEvent.participant.reference | AuditEvent.object.reference</b><br>
621         * </p>
622         */
623        @SearchParamDefinition(name="patient", path="AuditEvent.participant.reference | AuditEvent.object.reference", description="", type="reference"  )
624        public static final String SP_PATIENT = "patient";
625
626        /**
627         * <b>Fluent Client</b> search parameter constant for <b>patient</b>
628         * <p>
629         * Description: <b></b><br>
630         * Type: <b>reference</b><br>
631         * Path: <b>AuditEvent.participant.reference | AuditEvent.object.reference</b><br>
632         * </p>
633         */
634        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
635
636        /**
637         * Search parameter constant for <b>altid</b>
638         * <p>
639         * Description: <b></b><br>
640         * Type: <b>token</b><br>
641         * Path: <b>AuditEvent.participant.altId</b><br>
642         * </p>
643         */
644        @SearchParamDefinition(name="altid", path="AuditEvent.participant.altId", description="", type="token"  )
645        public static final String SP_ALTID = "altid";
646
647        /**
648         * <b>Fluent Client</b> search parameter constant for <b>altid</b>
649         * <p>
650         * Description: <b></b><br>
651         * Type: <b>token</b><br>
652         * Path: <b>AuditEvent.participant.altId</b><br>
653         * </p>
654         */
655        public static final TokenClientParam ALTID = new TokenClientParam(SP_ALTID);
656
657        /**
658         * Search parameter constant for <b>participant</b>
659         * <p>
660         * Description: <b></b><br>
661         * Type: <b>reference</b><br>
662         * Path: <b>AuditEvent.participant.reference</b><br>
663         * </p>
664         */
665        @SearchParamDefinition(name="participant", path="AuditEvent.participant.reference", description="", type="reference"  )
666        public static final String SP_PARTICIPANT = "participant";
667
668        /**
669         * <b>Fluent Client</b> search parameter constant for <b>participant</b>
670         * <p>
671         * Description: <b></b><br>
672         * Type: <b>reference</b><br>
673         * Path: <b>AuditEvent.participant.reference</b><br>
674         * </p>
675         */
676        public static final ReferenceClientParam PARTICIPANT = new ReferenceClientParam(SP_PARTICIPANT);
677
678        /**
679         * Search parameter constant for <b>policy</b>
680         * <p>
681         * Description: <b></b><br>
682         * Type: <b>uri</b><br>
683         * Path: <b>AuditEvent.participant.policy</b><br>
684         * </p>
685         */
686        @SearchParamDefinition(name="policy", path="AuditEvent.participant.policy", description="", type="uri"  )
687        public static final String SP_POLICY = "policy";
688
689        /**
690         * <b>Fluent Client</b> search parameter constant for <b>policy</b>
691         * <p>
692         * Description: <b></b><br>
693         * Type: <b>uri</b><br>
694         * Path: <b>AuditEvent.participant.policy</b><br>
695         * </p>
696         */
697        public static final UriClientParam POLICY = new UriClientParam(SP_POLICY);
698
699
700        /**
701         * Constant for fluent queries to be used to add include statements. Specifies
702         * the path value of "<b>AuditEvent:participant</b>".
703         */
704        public static final Include INCLUDE_PARTICIPANT = new Include("AuditEvent:participant");
705
706        /**
707         * Constant for fluent queries to be used to add include statements. Specifies
708         * the path value of "<b>AuditEvent:patient</b>".
709         */
710        public static final Include INCLUDE_PATIENT = new Include("AuditEvent:patient");
711
712        /**
713         * Constant for fluent queries to be used to add include statements. Specifies
714         * the path value of "<b>AuditEvent:reference</b>".
715         */
716        public static final Include INCLUDE_REFERENCE = new Include("AuditEvent:reference");
717
718
719        @Child(name="event", order=0, min=1, max=1, summary=false, modifier=false)      
720        @Description(
721                shortDefinition="",
722                formalDefinition="Identifies the name, action type, time, and disposition of the audited event"
723        )
724        private Event myEvent;
725        
726        @Child(name="participant", order=1, min=1, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
727        @Description(
728                shortDefinition="",
729                formalDefinition=""
730        )
731        private java.util.List<Participant> myParticipant;
732        
733        @Child(name="source", order=2, min=1, max=1, summary=false, modifier=false)     
734        @Description(
735                shortDefinition="",
736                formalDefinition=""
737        )
738        private Source mySource;
739        
740        @Child(name="object", order=3, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)   
741        @Description(
742                shortDefinition="",
743                formalDefinition="Specific instances of data or objects that have been accessed"
744        )
745        private java.util.List<ObjectElement> myObject;
746        
747
748        @Override
749        public boolean isEmpty() {
750                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myEvent,  myParticipant,  mySource,  myObject);
751        }
752        
753        @Override
754        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
755                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myEvent, myParticipant, mySource, myObject);
756        }
757
758        /**
759         * Gets the value(s) for <b>event</b> ().
760         * creating it if it does
761         * not exist. Will not return <code>null</code>.
762         *
763     * <p>
764     * <b>Definition:</b>
765     * Identifies the name, action type, time, and disposition of the audited event
766     * </p> 
767         */
768        public Event getEvent() {  
769                if (myEvent == null) {
770                        myEvent = new Event();
771                }
772                return myEvent;
773        }
774
775        /**
776         * Sets the value(s) for <b>event</b> ()
777         *
778     * <p>
779     * <b>Definition:</b>
780     * Identifies the name, action type, time, and disposition of the audited event
781     * </p> 
782         */
783        public AuditEvent setEvent(Event theValue) {
784                myEvent = theValue;
785                return this;
786        }
787        
788        
789
790  
791        /**
792         * Gets the value(s) for <b>participant</b> ().
793         * creating it if it does
794         * not exist. Will not return <code>null</code>.
795         *
796     * <p>
797     * <b>Definition:</b>
798     * 
799     * </p> 
800         */
801        public java.util.List<Participant> getParticipant() {  
802                if (myParticipant == null) {
803                        myParticipant = new java.util.ArrayList<Participant>();
804                }
805                return myParticipant;
806        }
807
808        /**
809         * Sets the value(s) for <b>participant</b> ()
810         *
811     * <p>
812     * <b>Definition:</b>
813     * 
814     * </p> 
815         */
816        public AuditEvent setParticipant(java.util.List<Participant> theValue) {
817                myParticipant = theValue;
818                return this;
819        }
820        
821        
822
823        /**
824         * Adds and returns a new value for <b>participant</b> ()
825         *
826     * <p>
827     * <b>Definition:</b>
828     * 
829     * </p> 
830         */
831        public Participant addParticipant() {
832                Participant newType = new Participant();
833                getParticipant().add(newType);
834                return newType; 
835        }
836
837        /**
838         * Adds a given new value for <b>participant</b> ()
839         *
840         * <p>
841         * <b>Definition:</b>
842         * 
843         * </p>
844         * @param theValue The participant to add (must not be <code>null</code>)
845         */
846        public AuditEvent addParticipant(Participant theValue) {
847                if (theValue == null) {
848                        throw new NullPointerException("theValue must not be null");
849                }
850                getParticipant().add(theValue);
851                return this;
852        }
853
854        /**
855         * Gets the first repetition for <b>participant</b> (),
856         * creating it if it does not already exist.
857         *
858     * <p>
859     * <b>Definition:</b>
860     * 
861     * </p> 
862         */
863        public Participant getParticipantFirstRep() {
864                if (getParticipant().isEmpty()) {
865                        return addParticipant();
866                }
867                return getParticipant().get(0); 
868        }
869  
870        /**
871         * Gets the value(s) for <b>source</b> ().
872         * creating it if it does
873         * not exist. Will not return <code>null</code>.
874         *
875     * <p>
876     * <b>Definition:</b>
877     * 
878     * </p> 
879         */
880        public Source getSource() {  
881                if (mySource == null) {
882                        mySource = new Source();
883                }
884                return mySource;
885        }
886
887        /**
888         * Sets the value(s) for <b>source</b> ()
889         *
890     * <p>
891     * <b>Definition:</b>
892     * 
893     * </p> 
894         */
895        public AuditEvent setSource(Source theValue) {
896                mySource = theValue;
897                return this;
898        }
899        
900        
901
902  
903        /**
904         * Gets the value(s) for <b>object</b> ().
905         * creating it if it does
906         * not exist. Will not return <code>null</code>.
907         *
908     * <p>
909     * <b>Definition:</b>
910     * Specific instances of data or objects that have been accessed
911     * </p> 
912         */
913        public java.util.List<ObjectElement> getObject() {  
914                if (myObject == null) {
915                        myObject = new java.util.ArrayList<ObjectElement>();
916                }
917                return myObject;
918        }
919
920        /**
921         * Sets the value(s) for <b>object</b> ()
922         *
923     * <p>
924     * <b>Definition:</b>
925     * Specific instances of data or objects that have been accessed
926     * </p> 
927         */
928        public AuditEvent setObject(java.util.List<ObjectElement> theValue) {
929                myObject = theValue;
930                return this;
931        }
932        
933        
934
935        /**
936         * Adds and returns a new value for <b>object</b> ()
937         *
938     * <p>
939     * <b>Definition:</b>
940     * Specific instances of data or objects that have been accessed
941     * </p> 
942         */
943        public ObjectElement addObject() {
944                ObjectElement newType = new ObjectElement();
945                getObject().add(newType);
946                return newType; 
947        }
948
949        /**
950         * Adds a given new value for <b>object</b> ()
951         *
952         * <p>
953         * <b>Definition:</b>
954         * Specific instances of data or objects that have been accessed
955         * </p>
956         * @param theValue The object to add (must not be <code>null</code>)
957         */
958        public AuditEvent addObject(ObjectElement theValue) {
959                if (theValue == null) {
960                        throw new NullPointerException("theValue must not be null");
961                }
962                getObject().add(theValue);
963                return this;
964        }
965
966        /**
967         * Gets the first repetition for <b>object</b> (),
968         * creating it if it does not already exist.
969         *
970     * <p>
971     * <b>Definition:</b>
972     * Specific instances of data or objects that have been accessed
973     * </p> 
974         */
975        public ObjectElement getObjectFirstRep() {
976                if (getObject().isEmpty()) {
977                        return addObject();
978                }
979                return getObject().get(0); 
980        }
981  
982        /**
983         * Block class for child element: <b>AuditEvent.event</b> ()
984         *
985     * <p>
986     * <b>Definition:</b>
987     * Identifies the name, action type, time, and disposition of the audited event
988     * </p> 
989         */
990        @Block()        
991        public static class Event 
992            extends  BaseIdentifiableElement        implements IResourceBlock {
993        
994        @Child(name="type", type=CodingDt.class, order=0, min=1, max=1, summary=true, modifier=false)   
995        @Description(
996                shortDefinition="",
997                formalDefinition="Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function"
998        )
999        private CodingDt myType;
1000        
1001        @Child(name="subtype", type=CodingDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)      
1002        @Description(
1003                shortDefinition="",
1004                formalDefinition="Identifier for the category of event"
1005        )
1006        private java.util.List<CodingDt> mySubtype;
1007        
1008        @Child(name="action", type=CodeDt.class, order=2, min=0, max=1, summary=true, modifier=false)   
1009        @Description(
1010                shortDefinition="",
1011                formalDefinition="Indicator for type of action performed during the event that generated the audit"
1012        )
1013        private BoundCodeDt<AuditEventActionEnum> myAction;
1014        
1015        @Child(name="dateTime", type=InstantDt.class, order=3, min=1, max=1, summary=true, modifier=false)      
1016        @Description(
1017                shortDefinition="",
1018                formalDefinition="The time when the event occurred on the source"
1019        )
1020        private InstantDt myDateTime;
1021        
1022        @Child(name="outcome", type=CodeDt.class, order=4, min=0, max=1, summary=true, modifier=false)  
1023        @Description(
1024                shortDefinition="",
1025                formalDefinition="Indicates whether the event succeeded or failed"
1026        )
1027        private BoundCodeDt<AuditEventOutcomeEnum> myOutcome;
1028        
1029        @Child(name="outcomeDesc", type=StringDt.class, order=5, min=0, max=1, summary=true, modifier=false)    
1030        @Description(
1031                shortDefinition="",
1032                formalDefinition="A free text description of the outcome of the event"
1033        )
1034        private StringDt myOutcomeDesc;
1035        
1036        @Child(name="purposeOfEvent", type=CodingDt.class, order=6, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)       
1037        @Description(
1038                shortDefinition="",
1039                formalDefinition="The purposeOfUse (reason) that was used during the event being recorded."
1040        )
1041        private java.util.List<CodingDt> myPurposeOfEvent;
1042        
1043
1044        @Override
1045        public boolean isEmpty() {
1046                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myType,  mySubtype,  myAction,  myDateTime,  myOutcome,  myOutcomeDesc,  myPurposeOfEvent);
1047        }
1048        
1049        @Override
1050        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1051                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, mySubtype, myAction, myDateTime, myOutcome, myOutcomeDesc, myPurposeOfEvent);
1052        }
1053
1054        /**
1055         * Gets the value(s) for <b>type</b> ().
1056         * creating it if it does
1057         * not exist. Will not return <code>null</code>.
1058         *
1059     * <p>
1060     * <b>Definition:</b>
1061     * Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function
1062     * </p> 
1063         */
1064        public CodingDt getType() {  
1065                if (myType == null) {
1066                        myType = new CodingDt();
1067                }
1068                return myType;
1069        }
1070
1071        /**
1072         * Sets the value(s) for <b>type</b> ()
1073         *
1074     * <p>
1075     * <b>Definition:</b>
1076     * Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function
1077     * </p> 
1078         */
1079        public Event setType(CodingDt theValue) {
1080                myType = theValue;
1081                return this;
1082        }
1083        
1084        
1085
1086  
1087        /**
1088         * Gets the value(s) for <b>subtype</b> ().
1089         * creating it if it does
1090         * not exist. Will not return <code>null</code>.
1091         *
1092     * <p>
1093     * <b>Definition:</b>
1094     * Identifier for the category of event
1095     * </p> 
1096         */
1097        public java.util.List<CodingDt> getSubtype() {  
1098                if (mySubtype == null) {
1099                        mySubtype = new java.util.ArrayList<CodingDt>();
1100                }
1101                return mySubtype;
1102        }
1103
1104        /**
1105         * Sets the value(s) for <b>subtype</b> ()
1106         *
1107     * <p>
1108     * <b>Definition:</b>
1109     * Identifier for the category of event
1110     * </p> 
1111         */
1112        public Event setSubtype(java.util.List<CodingDt> theValue) {
1113                mySubtype = theValue;
1114                return this;
1115        }
1116        
1117        
1118
1119        /**
1120         * Adds and returns a new value for <b>subtype</b> ()
1121         *
1122     * <p>
1123     * <b>Definition:</b>
1124     * Identifier for the category of event
1125     * </p> 
1126         */
1127        public CodingDt addSubtype() {
1128                CodingDt newType = new CodingDt();
1129                getSubtype().add(newType);
1130                return newType; 
1131        }
1132
1133        /**
1134         * Adds a given new value for <b>subtype</b> ()
1135         *
1136         * <p>
1137         * <b>Definition:</b>
1138         * Identifier for the category of event
1139         * </p>
1140         * @param theValue The subtype to add (must not be <code>null</code>)
1141         */
1142        public Event addSubtype(CodingDt theValue) {
1143                if (theValue == null) {
1144                        throw new NullPointerException("theValue must not be null");
1145                }
1146                getSubtype().add(theValue);
1147                return this;
1148        }
1149
1150        /**
1151         * Gets the first repetition for <b>subtype</b> (),
1152         * creating it if it does not already exist.
1153         *
1154     * <p>
1155     * <b>Definition:</b>
1156     * Identifier for the category of event
1157     * </p> 
1158         */
1159        public CodingDt getSubtypeFirstRep() {
1160                if (getSubtype().isEmpty()) {
1161                        return addSubtype();
1162                }
1163                return getSubtype().get(0); 
1164        }
1165  
1166        /**
1167         * Gets the value(s) for <b>action</b> ().
1168         * creating it if it does
1169         * not exist. Will not return <code>null</code>.
1170         *
1171     * <p>
1172     * <b>Definition:</b>
1173     * Indicator for type of action performed during the event that generated the audit
1174     * </p> 
1175         */
1176        public BoundCodeDt<AuditEventActionEnum> getActionElement() {  
1177                if (myAction == null) {
1178                        myAction = new BoundCodeDt<AuditEventActionEnum>(AuditEventActionEnum.VALUESET_BINDER);
1179                }
1180                return myAction;
1181        }
1182
1183        
1184        /**
1185         * Gets the value(s) for <b>action</b> ().
1186         * creating it if it does
1187         * not exist. Will not return <code>null</code>.
1188         *
1189     * <p>
1190     * <b>Definition:</b>
1191     * Indicator for type of action performed during the event that generated the audit
1192     * </p> 
1193         */
1194        public String getAction() {  
1195                return getActionElement().getValue();
1196        }
1197
1198        /**
1199         * Sets the value(s) for <b>action</b> ()
1200         *
1201     * <p>
1202     * <b>Definition:</b>
1203     * Indicator for type of action performed during the event that generated the audit
1204     * </p> 
1205         */
1206        public Event setAction(BoundCodeDt<AuditEventActionEnum> theValue) {
1207                myAction = theValue;
1208                return this;
1209        }
1210        
1211        
1212
1213        /**
1214         * Sets the value(s) for <b>action</b> ()
1215         *
1216     * <p>
1217     * <b>Definition:</b>
1218     * Indicator for type of action performed during the event that generated the audit
1219     * </p> 
1220         */
1221        public Event setAction(AuditEventActionEnum theValue) {
1222                setAction(new BoundCodeDt<AuditEventActionEnum>(AuditEventActionEnum.VALUESET_BINDER, theValue));
1223                
1224/*
1225                getActionElement().setValueAsEnum(theValue);
1226*/
1227                return this;
1228        }
1229
1230  
1231        /**
1232         * Gets the value(s) for <b>dateTime</b> ().
1233         * creating it if it does
1234         * not exist. Will not return <code>null</code>.
1235         *
1236     * <p>
1237     * <b>Definition:</b>
1238     * The time when the event occurred on the source
1239     * </p> 
1240         */
1241        public InstantDt getDateTimeElement() {  
1242                if (myDateTime == null) {
1243                        myDateTime = new InstantDt();
1244                }
1245                return myDateTime;
1246        }
1247
1248        
1249        /**
1250         * Gets the value(s) for <b>dateTime</b> ().
1251         * creating it if it does
1252         * not exist. Will not return <code>null</code>.
1253         *
1254     * <p>
1255     * <b>Definition:</b>
1256     * The time when the event occurred on the source
1257     * </p> 
1258         */
1259        public Date getDateTime() {  
1260                return getDateTimeElement().getValue();
1261        }
1262
1263        /**
1264         * Sets the value(s) for <b>dateTime</b> ()
1265         *
1266     * <p>
1267     * <b>Definition:</b>
1268     * The time when the event occurred on the source
1269     * </p> 
1270         */
1271        public Event setDateTime(InstantDt theValue) {
1272                myDateTime = theValue;
1273                return this;
1274        }
1275        
1276        
1277
1278        /**
1279         * Sets the value for <b>dateTime</b> ()
1280         *
1281     * <p>
1282     * <b>Definition:</b>
1283     * The time when the event occurred on the source
1284     * </p> 
1285         */
1286        public Event setDateTimeWithMillisPrecision( Date theDate) {
1287                myDateTime = new InstantDt(theDate); 
1288                return this; 
1289        }
1290
1291        /**
1292         * Sets the value for <b>dateTime</b> ()
1293         *
1294     * <p>
1295     * <b>Definition:</b>
1296     * The time when the event occurred on the source
1297     * </p> 
1298         */
1299        public Event setDateTime( Date theDate,  TemporalPrecisionEnum thePrecision) {
1300                myDateTime = new InstantDt(theDate, thePrecision); 
1301                return this; 
1302        }
1303
1304 
1305        /**
1306         * Gets the value(s) for <b>outcome</b> ().
1307         * creating it if it does
1308         * not exist. Will not return <code>null</code>.
1309         *
1310     * <p>
1311     * <b>Definition:</b>
1312     * Indicates whether the event succeeded or failed
1313     * </p> 
1314         */
1315        public BoundCodeDt<AuditEventOutcomeEnum> getOutcomeElement() {  
1316                if (myOutcome == null) {
1317                        myOutcome = new BoundCodeDt<AuditEventOutcomeEnum>(AuditEventOutcomeEnum.VALUESET_BINDER);
1318                }
1319                return myOutcome;
1320        }
1321
1322        
1323        /**
1324         * Gets the value(s) for <b>outcome</b> ().
1325         * creating it if it does
1326         * not exist. Will not return <code>null</code>.
1327         *
1328     * <p>
1329     * <b>Definition:</b>
1330     * Indicates whether the event succeeded or failed
1331     * </p> 
1332         */
1333        public String getOutcome() {  
1334                return getOutcomeElement().getValue();
1335        }
1336
1337        /**
1338         * Sets the value(s) for <b>outcome</b> ()
1339         *
1340     * <p>
1341     * <b>Definition:</b>
1342     * Indicates whether the event succeeded or failed
1343     * </p> 
1344         */
1345        public Event setOutcome(BoundCodeDt<AuditEventOutcomeEnum> theValue) {
1346                myOutcome = theValue;
1347                return this;
1348        }
1349        
1350        
1351
1352        /**
1353         * Sets the value(s) for <b>outcome</b> ()
1354         *
1355     * <p>
1356     * <b>Definition:</b>
1357     * Indicates whether the event succeeded or failed
1358     * </p> 
1359         */
1360        public Event setOutcome(AuditEventOutcomeEnum theValue) {
1361                setOutcome(new BoundCodeDt<AuditEventOutcomeEnum>(AuditEventOutcomeEnum.VALUESET_BINDER, theValue));
1362                
1363/*
1364                getOutcomeElement().setValueAsEnum(theValue);
1365*/
1366                return this;
1367        }
1368
1369  
1370        /**
1371         * Gets the value(s) for <b>outcomeDesc</b> ().
1372         * creating it if it does
1373         * not exist. Will not return <code>null</code>.
1374         *
1375     * <p>
1376     * <b>Definition:</b>
1377     * A free text description of the outcome of the event
1378     * </p> 
1379         */
1380        public StringDt getOutcomeDescElement() {  
1381                if (myOutcomeDesc == null) {
1382                        myOutcomeDesc = new StringDt();
1383                }
1384                return myOutcomeDesc;
1385        }
1386
1387        
1388        /**
1389         * Gets the value(s) for <b>outcomeDesc</b> ().
1390         * creating it if it does
1391         * not exist. Will not return <code>null</code>.
1392         *
1393     * <p>
1394     * <b>Definition:</b>
1395     * A free text description of the outcome of the event
1396     * </p> 
1397         */
1398        public String getOutcomeDesc() {  
1399                return getOutcomeDescElement().getValue();
1400        }
1401
1402        /**
1403         * Sets the value(s) for <b>outcomeDesc</b> ()
1404         *
1405     * <p>
1406     * <b>Definition:</b>
1407     * A free text description of the outcome of the event
1408     * </p> 
1409         */
1410        public Event setOutcomeDesc(StringDt theValue) {
1411                myOutcomeDesc = theValue;
1412                return this;
1413        }
1414        
1415        
1416
1417        /**
1418         * Sets the value for <b>outcomeDesc</b> ()
1419         *
1420     * <p>
1421     * <b>Definition:</b>
1422     * A free text description of the outcome of the event
1423     * </p> 
1424         */
1425        public Event setOutcomeDesc( String theString) {
1426                myOutcomeDesc = new StringDt(theString); 
1427                return this; 
1428        }
1429
1430 
1431        /**
1432         * Gets the value(s) for <b>purposeOfEvent</b> ().
1433         * creating it if it does
1434         * not exist. Will not return <code>null</code>.
1435         *
1436     * <p>
1437     * <b>Definition:</b>
1438     * The purposeOfUse (reason) that was used during the event being recorded.
1439     * </p> 
1440         */
1441        public java.util.List<CodingDt> getPurposeOfEvent() {  
1442                if (myPurposeOfEvent == null) {
1443                        myPurposeOfEvent = new java.util.ArrayList<CodingDt>();
1444                }
1445                return myPurposeOfEvent;
1446        }
1447
1448        /**
1449         * Sets the value(s) for <b>purposeOfEvent</b> ()
1450         *
1451     * <p>
1452     * <b>Definition:</b>
1453     * The purposeOfUse (reason) that was used during the event being recorded.
1454     * </p> 
1455         */
1456        public Event setPurposeOfEvent(java.util.List<CodingDt> theValue) {
1457                myPurposeOfEvent = theValue;
1458                return this;
1459        }
1460        
1461        
1462
1463        /**
1464         * Adds and returns a new value for <b>purposeOfEvent</b> ()
1465         *
1466     * <p>
1467     * <b>Definition:</b>
1468     * The purposeOfUse (reason) that was used during the event being recorded.
1469     * </p> 
1470         */
1471        public CodingDt addPurposeOfEvent() {
1472                CodingDt newType = new CodingDt();
1473                getPurposeOfEvent().add(newType);
1474                return newType; 
1475        }
1476
1477        /**
1478         * Adds a given new value for <b>purposeOfEvent</b> ()
1479         *
1480         * <p>
1481         * <b>Definition:</b>
1482         * The purposeOfUse (reason) that was used during the event being recorded.
1483         * </p>
1484         * @param theValue The purposeOfEvent to add (must not be <code>null</code>)
1485         */
1486        public Event addPurposeOfEvent(CodingDt theValue) {
1487                if (theValue == null) {
1488                        throw new NullPointerException("theValue must not be null");
1489                }
1490                getPurposeOfEvent().add(theValue);
1491                return this;
1492        }
1493
1494        /**
1495         * Gets the first repetition for <b>purposeOfEvent</b> (),
1496         * creating it if it does not already exist.
1497         *
1498     * <p>
1499     * <b>Definition:</b>
1500     * The purposeOfUse (reason) that was used during the event being recorded.
1501     * </p> 
1502         */
1503        public CodingDt getPurposeOfEventFirstRep() {
1504                if (getPurposeOfEvent().isEmpty()) {
1505                        return addPurposeOfEvent();
1506                }
1507                return getPurposeOfEvent().get(0); 
1508        }
1509  
1510
1511
1512        }
1513
1514
1515        /**
1516         * Block class for child element: <b>AuditEvent.participant</b> ()
1517         *
1518     * <p>
1519     * <b>Definition:</b>
1520     * 
1521     * </p> 
1522         */
1523        @Block()        
1524        public static class Participant 
1525            extends  BaseIdentifiableElement        implements IResourceBlock {
1526        
1527        @Child(name="role", type=CodeableConceptDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)       
1528        @Description(
1529                shortDefinition="",
1530                formalDefinition="Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context"
1531        )
1532        private java.util.List<CodeableConceptDt> myRole;
1533        
1534        @Child(name="reference", order=1, min=0, max=1, summary=true, modifier=false, type={
1535                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    })
1536        @Description(
1537                shortDefinition="",
1538                formalDefinition="Direct reference to a resource that identifies the participant"
1539        )
1540        private ResourceReferenceDt myReference;
1541        
1542        @Child(name="userId", type=IdentifierDt.class, order=2, min=0, max=1, summary=true, modifier=false)     
1543        @Description(
1544                shortDefinition="",
1545                formalDefinition="Unique identifier for the user actively participating in the event"
1546        )
1547        private IdentifierDt myUserId;
1548        
1549        @Child(name="altId", type=StringDt.class, order=3, min=0, max=1, summary=false, modifier=false) 
1550        @Description(
1551                shortDefinition="",
1552                formalDefinition="Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available"
1553        )
1554        private StringDt myAltId;
1555        
1556        @Child(name="name", type=StringDt.class, order=4, min=0, max=1, summary=false, modifier=false)  
1557        @Description(
1558                shortDefinition="",
1559                formalDefinition="Human-meaningful name for the user"
1560        )
1561        private StringDt myName;
1562        
1563        @Child(name="requestor", type=BooleanDt.class, order=5, min=1, max=1, summary=false, modifier=false)    
1564        @Description(
1565                shortDefinition="",
1566                formalDefinition="Indicator that the user is or is not the requestor, or initiator, for the event being audited."
1567        )
1568        private BooleanDt myRequestor;
1569        
1570        @Child(name="location", order=6, min=0, max=1, summary=false, modifier=false, type={
1571                ca.uhn.fhir.model.dstu2.resource.Location.class })
1572        @Description(
1573                shortDefinition="",
1574                formalDefinition="Where the event occurred"
1575        )
1576        private ResourceReferenceDt myLocation;
1577        
1578        @Child(name="policy", type=UriDt.class, order=7, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false) 
1579        @Description(
1580                shortDefinition="",
1581                formalDefinition="The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used."
1582        )
1583        private java.util.List<UriDt> myPolicy;
1584        
1585        @Child(name="media", type=CodingDt.class, order=8, min=0, max=1, summary=false, modifier=false) 
1586        @Description(
1587                shortDefinition="",
1588                formalDefinition="Type of media involved. Used when the event is about exporting/importing onto media"
1589        )
1590        private CodingDt myMedia;
1591        
1592        @Child(name="network", order=9, min=0, max=1, summary=false, modifier=false)    
1593        @Description(
1594                shortDefinition="",
1595                formalDefinition="Logical network location for application activity, if the activity has a network location"
1596        )
1597        private ParticipantNetwork myNetwork;
1598        
1599        @Child(name="purposeOfUse", type=CodingDt.class, order=10, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)       
1600        @Description(
1601                shortDefinition="",
1602                formalDefinition="The reason (purpose of use), specific to this participant, that was used during the event being recorded."
1603        )
1604        private java.util.List<CodingDt> myPurposeOfUse;
1605        
1606
1607        @Override
1608        public boolean isEmpty() {
1609                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myRole,  myReference,  myUserId,  myAltId,  myName,  myRequestor,  myLocation,  myPolicy,  myMedia,  myNetwork,  myPurposeOfUse);
1610        }
1611        
1612        @Override
1613        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1614                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRole, myReference, myUserId, myAltId, myName, myRequestor, myLocation, myPolicy, myMedia, myNetwork, myPurposeOfUse);
1615        }
1616
1617        /**
1618         * Gets the value(s) for <b>role</b> ().
1619         * creating it if it does
1620         * not exist. Will not return <code>null</code>.
1621         *
1622     * <p>
1623     * <b>Definition:</b>
1624     * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context
1625     * </p> 
1626         */
1627        public java.util.List<CodeableConceptDt> getRole() {  
1628                if (myRole == null) {
1629                        myRole = new java.util.ArrayList<CodeableConceptDt>();
1630                }
1631                return myRole;
1632        }
1633
1634        /**
1635         * Sets the value(s) for <b>role</b> ()
1636         *
1637     * <p>
1638     * <b>Definition:</b>
1639     * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context
1640     * </p> 
1641         */
1642        public Participant setRole(java.util.List<CodeableConceptDt> theValue) {
1643                myRole = theValue;
1644                return this;
1645        }
1646        
1647        
1648
1649        /**
1650         * Adds and returns a new value for <b>role</b> ()
1651         *
1652     * <p>
1653     * <b>Definition:</b>
1654     * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context
1655     * </p> 
1656         */
1657        public CodeableConceptDt addRole() {
1658                CodeableConceptDt newType = new CodeableConceptDt();
1659                getRole().add(newType);
1660                return newType; 
1661        }
1662
1663        /**
1664         * Adds a given new value for <b>role</b> ()
1665         *
1666         * <p>
1667         * <b>Definition:</b>
1668         * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context
1669         * </p>
1670         * @param theValue The role to add (must not be <code>null</code>)
1671         */
1672        public Participant addRole(CodeableConceptDt theValue) {
1673                if (theValue == null) {
1674                        throw new NullPointerException("theValue must not be null");
1675                }
1676                getRole().add(theValue);
1677                return this;
1678        }
1679
1680        /**
1681         * Gets the first repetition for <b>role</b> (),
1682         * creating it if it does not already exist.
1683         *
1684     * <p>
1685     * <b>Definition:</b>
1686     * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context
1687     * </p> 
1688         */
1689        public CodeableConceptDt getRoleFirstRep() {
1690                if (getRole().isEmpty()) {
1691                        return addRole();
1692                }
1693                return getRole().get(0); 
1694        }
1695  
1696        /**
1697         * Gets the value(s) for <b>reference</b> ().
1698         * creating it if it does
1699         * not exist. Will not return <code>null</code>.
1700         *
1701     * <p>
1702     * <b>Definition:</b>
1703     * Direct reference to a resource that identifies the participant
1704     * </p> 
1705         */
1706        public ResourceReferenceDt getReference() {  
1707                if (myReference == null) {
1708                        myReference = new ResourceReferenceDt();
1709                }
1710                return myReference;
1711        }
1712
1713        /**
1714         * Sets the value(s) for <b>reference</b> ()
1715         *
1716     * <p>
1717     * <b>Definition:</b>
1718     * Direct reference to a resource that identifies the participant
1719     * </p> 
1720         */
1721        public Participant setReference(ResourceReferenceDt theValue) {
1722                myReference = theValue;
1723                return this;
1724        }
1725        
1726        
1727
1728  
1729        /**
1730         * Gets the value(s) for <b>userId</b> ().
1731         * creating it if it does
1732         * not exist. Will not return <code>null</code>.
1733         *
1734     * <p>
1735     * <b>Definition:</b>
1736     * Unique identifier for the user actively participating in the event
1737     * </p> 
1738         */
1739        public IdentifierDt getUserId() {  
1740                if (myUserId == null) {
1741                        myUserId = new IdentifierDt();
1742                }
1743                return myUserId;
1744        }
1745
1746        /**
1747         * Sets the value(s) for <b>userId</b> ()
1748         *
1749     * <p>
1750     * <b>Definition:</b>
1751     * Unique identifier for the user actively participating in the event
1752     * </p> 
1753         */
1754        public Participant setUserId(IdentifierDt theValue) {
1755                myUserId = theValue;
1756                return this;
1757        }
1758        
1759        
1760
1761  
1762        /**
1763         * Gets the value(s) for <b>altId</b> ().
1764         * creating it if it does
1765         * not exist. Will not return <code>null</code>.
1766         *
1767     * <p>
1768     * <b>Definition:</b>
1769     * Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available
1770     * </p> 
1771         */
1772        public StringDt getAltIdElement() {  
1773                if (myAltId == null) {
1774                        myAltId = new StringDt();
1775                }
1776                return myAltId;
1777        }
1778
1779        
1780        /**
1781         * Gets the value(s) for <b>altId</b> ().
1782         * creating it if it does
1783         * not exist. Will not return <code>null</code>.
1784         *
1785     * <p>
1786     * <b>Definition:</b>
1787     * Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available
1788     * </p> 
1789         */
1790        public String getAltId() {  
1791                return getAltIdElement().getValue();
1792        }
1793
1794        /**
1795         * Sets the value(s) for <b>altId</b> ()
1796         *
1797     * <p>
1798     * <b>Definition:</b>
1799     * Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available
1800     * </p> 
1801         */
1802        public Participant setAltId(StringDt theValue) {
1803                myAltId = theValue;
1804                return this;
1805        }
1806        
1807        
1808
1809        /**
1810         * Sets the value for <b>altId</b> ()
1811         *
1812     * <p>
1813     * <b>Definition:</b>
1814     * Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available
1815     * </p> 
1816         */
1817        public Participant setAltId( String theString) {
1818                myAltId = new StringDt(theString); 
1819                return this; 
1820        }
1821
1822 
1823        /**
1824         * Gets the value(s) for <b>name</b> ().
1825         * creating it if it does
1826         * not exist. Will not return <code>null</code>.
1827         *
1828     * <p>
1829     * <b>Definition:</b>
1830     * Human-meaningful name for the user
1831     * </p> 
1832         */
1833        public StringDt getNameElement() {  
1834                if (myName == null) {
1835                        myName = new StringDt();
1836                }
1837                return myName;
1838        }
1839
1840        
1841        /**
1842         * Gets the value(s) for <b>name</b> ().
1843         * creating it if it does
1844         * not exist. Will not return <code>null</code>.
1845         *
1846     * <p>
1847     * <b>Definition:</b>
1848     * Human-meaningful name for the user
1849     * </p> 
1850         */
1851        public String getName() {  
1852                return getNameElement().getValue();
1853        }
1854
1855        /**
1856         * Sets the value(s) for <b>name</b> ()
1857         *
1858     * <p>
1859     * <b>Definition:</b>
1860     * Human-meaningful name for the user
1861     * </p> 
1862         */
1863        public Participant setName(StringDt theValue) {
1864                myName = theValue;
1865                return this;
1866        }
1867        
1868        
1869
1870        /**
1871         * Sets the value for <b>name</b> ()
1872         *
1873     * <p>
1874     * <b>Definition:</b>
1875     * Human-meaningful name for the user
1876     * </p> 
1877         */
1878        public Participant setName( String theString) {
1879                myName = new StringDt(theString); 
1880                return this; 
1881        }
1882
1883 
1884        /**
1885         * Gets the value(s) for <b>requestor</b> ().
1886         * creating it if it does
1887         * not exist. Will not return <code>null</code>.
1888         *
1889     * <p>
1890     * <b>Definition:</b>
1891     * Indicator that the user is or is not the requestor, or initiator, for the event being audited.
1892     * </p> 
1893         */
1894        public BooleanDt getRequestorElement() {  
1895                if (myRequestor == null) {
1896                        myRequestor = new BooleanDt();
1897                }
1898                return myRequestor;
1899        }
1900
1901        
1902        /**
1903         * Gets the value(s) for <b>requestor</b> ().
1904         * creating it if it does
1905         * not exist. Will not return <code>null</code>.
1906         *
1907     * <p>
1908     * <b>Definition:</b>
1909     * Indicator that the user is or is not the requestor, or initiator, for the event being audited.
1910     * </p> 
1911         */
1912        public Boolean getRequestor() {  
1913                return getRequestorElement().getValue();
1914        }
1915
1916        /**
1917         * Sets the value(s) for <b>requestor</b> ()
1918         *
1919     * <p>
1920     * <b>Definition:</b>
1921     * Indicator that the user is or is not the requestor, or initiator, for the event being audited.
1922     * </p> 
1923         */
1924        public Participant setRequestor(BooleanDt theValue) {
1925                myRequestor = theValue;
1926                return this;
1927        }
1928        
1929        
1930
1931        /**
1932         * Sets the value for <b>requestor</b> ()
1933         *
1934     * <p>
1935     * <b>Definition:</b>
1936     * Indicator that the user is or is not the requestor, or initiator, for the event being audited.
1937     * </p> 
1938         */
1939        public Participant setRequestor( boolean theBoolean) {
1940                myRequestor = new BooleanDt(theBoolean); 
1941                return this; 
1942        }
1943
1944 
1945        /**
1946         * Gets the value(s) for <b>location</b> ().
1947         * creating it if it does
1948         * not exist. Will not return <code>null</code>.
1949         *
1950     * <p>
1951     * <b>Definition:</b>
1952     * Where the event occurred
1953     * </p> 
1954         */
1955        public ResourceReferenceDt getLocation() {  
1956                if (myLocation == null) {
1957                        myLocation = new ResourceReferenceDt();
1958                }
1959                return myLocation;
1960        }
1961
1962        /**
1963         * Sets the value(s) for <b>location</b> ()
1964         *
1965     * <p>
1966     * <b>Definition:</b>
1967     * Where the event occurred
1968     * </p> 
1969         */
1970        public Participant setLocation(ResourceReferenceDt theValue) {
1971                myLocation = theValue;
1972                return this;
1973        }
1974        
1975        
1976
1977  
1978        /**
1979         * Gets the value(s) for <b>policy</b> ().
1980         * creating it if it does
1981         * not exist. Will not return <code>null</code>.
1982         *
1983     * <p>
1984     * <b>Definition:</b>
1985     * The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.
1986     * </p> 
1987         */
1988        public java.util.List<UriDt> getPolicy() {  
1989                if (myPolicy == null) {
1990                        myPolicy = new java.util.ArrayList<UriDt>();
1991                }
1992                return myPolicy;
1993        }
1994
1995        /**
1996         * Sets the value(s) for <b>policy</b> ()
1997         *
1998     * <p>
1999     * <b>Definition:</b>
2000     * The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.
2001     * </p> 
2002         */
2003        public Participant setPolicy(java.util.List<UriDt> theValue) {
2004                myPolicy = theValue;
2005                return this;
2006        }
2007        
2008        
2009
2010        /**
2011         * Adds and returns a new value for <b>policy</b> ()
2012         *
2013     * <p>
2014     * <b>Definition:</b>
2015     * The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.
2016     * </p> 
2017         */
2018        public UriDt addPolicy() {
2019                UriDt newType = new UriDt();
2020                getPolicy().add(newType);
2021                return newType; 
2022        }
2023
2024        /**
2025         * Adds a given new value for <b>policy</b> ()
2026         *
2027         * <p>
2028         * <b>Definition:</b>
2029         * The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.
2030         * </p>
2031         * @param theValue The policy to add (must not be <code>null</code>)
2032         */
2033        public Participant addPolicy(UriDt theValue) {
2034                if (theValue == null) {
2035                        throw new NullPointerException("theValue must not be null");
2036                }
2037                getPolicy().add(theValue);
2038                return this;
2039        }
2040
2041        /**
2042         * Gets the first repetition for <b>policy</b> (),
2043         * creating it if it does not already exist.
2044         *
2045     * <p>
2046     * <b>Definition:</b>
2047     * The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.
2048     * </p> 
2049         */
2050        public UriDt getPolicyFirstRep() {
2051                if (getPolicy().isEmpty()) {
2052                        return addPolicy();
2053                }
2054                return getPolicy().get(0); 
2055        }
2056        /**
2057         * Adds a new value for <b>policy</b> ()
2058         *
2059     * <p>
2060     * <b>Definition:</b>
2061     * The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.
2062     * </p> 
2063     *
2064     * @return Returns a reference to this object, to allow for simple chaining.
2065         */
2066        public Participant addPolicy( String theUri) {
2067                if (myPolicy == null) {
2068                        myPolicy = new java.util.ArrayList<UriDt>();
2069                }
2070                myPolicy.add(new UriDt(theUri));
2071                return this; 
2072        }
2073
2074 
2075        /**
2076         * Gets the value(s) for <b>media</b> ().
2077         * creating it if it does
2078         * not exist. Will not return <code>null</code>.
2079         *
2080     * <p>
2081     * <b>Definition:</b>
2082     * Type of media involved. Used when the event is about exporting/importing onto media
2083     * </p> 
2084         */
2085        public CodingDt getMedia() {  
2086                if (myMedia == null) {
2087                        myMedia = new CodingDt();
2088                }
2089                return myMedia;
2090        }
2091
2092        /**
2093         * Sets the value(s) for <b>media</b> ()
2094         *
2095     * <p>
2096     * <b>Definition:</b>
2097     * Type of media involved. Used when the event is about exporting/importing onto media
2098     * </p> 
2099         */
2100        public Participant setMedia(CodingDt theValue) {
2101                myMedia = theValue;
2102                return this;
2103        }
2104        
2105        
2106
2107  
2108        /**
2109         * Gets the value(s) for <b>network</b> ().
2110         * creating it if it does
2111         * not exist. Will not return <code>null</code>.
2112         *
2113     * <p>
2114     * <b>Definition:</b>
2115     * Logical network location for application activity, if the activity has a network location
2116     * </p> 
2117         */
2118        public ParticipantNetwork getNetwork() {  
2119                if (myNetwork == null) {
2120                        myNetwork = new ParticipantNetwork();
2121                }
2122                return myNetwork;
2123        }
2124
2125        /**
2126         * Sets the value(s) for <b>network</b> ()
2127         *
2128     * <p>
2129     * <b>Definition:</b>
2130     * Logical network location for application activity, if the activity has a network location
2131     * </p> 
2132         */
2133        public Participant setNetwork(ParticipantNetwork theValue) {
2134                myNetwork = theValue;
2135                return this;
2136        }
2137        
2138        
2139
2140  
2141        /**
2142         * Gets the value(s) for <b>purposeOfUse</b> ().
2143         * creating it if it does
2144         * not exist. Will not return <code>null</code>.
2145         *
2146     * <p>
2147     * <b>Definition:</b>
2148     * The reason (purpose of use), specific to this participant, that was used during the event being recorded.
2149     * </p> 
2150         */
2151        public java.util.List<CodingDt> getPurposeOfUse() {  
2152                if (myPurposeOfUse == null) {
2153                        myPurposeOfUse = new java.util.ArrayList<CodingDt>();
2154                }
2155                return myPurposeOfUse;
2156        }
2157
2158        /**
2159         * Sets the value(s) for <b>purposeOfUse</b> ()
2160         *
2161     * <p>
2162     * <b>Definition:</b>
2163     * The reason (purpose of use), specific to this participant, that was used during the event being recorded.
2164     * </p> 
2165         */
2166        public Participant setPurposeOfUse(java.util.List<CodingDt> theValue) {
2167                myPurposeOfUse = theValue;
2168                return this;
2169        }
2170        
2171        
2172
2173        /**
2174         * Adds and returns a new value for <b>purposeOfUse</b> ()
2175         *
2176     * <p>
2177     * <b>Definition:</b>
2178     * The reason (purpose of use), specific to this participant, that was used during the event being recorded.
2179     * </p> 
2180         */
2181        public CodingDt addPurposeOfUse() {
2182                CodingDt newType = new CodingDt();
2183                getPurposeOfUse().add(newType);
2184                return newType; 
2185        }
2186
2187        /**
2188         * Adds a given new value for <b>purposeOfUse</b> ()
2189         *
2190         * <p>
2191         * <b>Definition:</b>
2192         * The reason (purpose of use), specific to this participant, that was used during the event being recorded.
2193         * </p>
2194         * @param theValue The purposeOfUse to add (must not be <code>null</code>)
2195         */
2196        public Participant addPurposeOfUse(CodingDt theValue) {
2197                if (theValue == null) {
2198                        throw new NullPointerException("theValue must not be null");
2199                }
2200                getPurposeOfUse().add(theValue);
2201                return this;
2202        }
2203
2204        /**
2205         * Gets the first repetition for <b>purposeOfUse</b> (),
2206         * creating it if it does not already exist.
2207         *
2208     * <p>
2209     * <b>Definition:</b>
2210     * The reason (purpose of use), specific to this participant, that was used during the event being recorded.
2211     * </p> 
2212         */
2213        public CodingDt getPurposeOfUseFirstRep() {
2214                if (getPurposeOfUse().isEmpty()) {
2215                        return addPurposeOfUse();
2216                }
2217                return getPurposeOfUse().get(0); 
2218        }
2219  
2220
2221
2222        }
2223
2224        /**
2225         * Block class for child element: <b>AuditEvent.participant.network</b> ()
2226         *
2227     * <p>
2228     * <b>Definition:</b>
2229     * Logical network location for application activity, if the activity has a network location
2230     * </p> 
2231         */
2232        @Block()        
2233        public static class ParticipantNetwork 
2234            extends  BaseIdentifiableElement        implements IResourceBlock {
2235        
2236        @Child(name="address", type=StringDt.class, order=0, min=0, max=1, summary=false, modifier=false)       
2237        @Description(
2238                shortDefinition="",
2239                formalDefinition="An identifier for the network access point of the user device for the audit event"
2240        )
2241        private StringDt myAddress;
2242        
2243        @Child(name="type", type=CodeDt.class, order=1, min=0, max=1, summary=false, modifier=false)    
2244        @Description(
2245                shortDefinition="",
2246                formalDefinition="An identifier for the type of network access point that originated the audit event"
2247        )
2248        private BoundCodeDt<AuditEventParticipantNetworkTypeEnum> myType;
2249        
2250
2251        @Override
2252        public boolean isEmpty() {
2253                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myAddress,  myType);
2254        }
2255        
2256        @Override
2257        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2258                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myAddress, myType);
2259        }
2260
2261        /**
2262         * Gets the value(s) for <b>address</b> ().
2263         * creating it if it does
2264         * not exist. Will not return <code>null</code>.
2265         *
2266     * <p>
2267     * <b>Definition:</b>
2268     * An identifier for the network access point of the user device for the audit event
2269     * </p> 
2270         */
2271        public StringDt getAddressElement() {  
2272                if (myAddress == null) {
2273                        myAddress = new StringDt();
2274                }
2275                return myAddress;
2276        }
2277
2278        
2279        /**
2280         * Gets the value(s) for <b>address</b> ().
2281         * creating it if it does
2282         * not exist. Will not return <code>null</code>.
2283         *
2284     * <p>
2285     * <b>Definition:</b>
2286     * An identifier for the network access point of the user device for the audit event
2287     * </p> 
2288         */
2289        public String getAddress() {  
2290                return getAddressElement().getValue();
2291        }
2292
2293        /**
2294         * Sets the value(s) for <b>address</b> ()
2295         *
2296     * <p>
2297     * <b>Definition:</b>
2298     * An identifier for the network access point of the user device for the audit event
2299     * </p> 
2300         */
2301        public ParticipantNetwork setAddress(StringDt theValue) {
2302                myAddress = theValue;
2303                return this;
2304        }
2305        
2306        
2307
2308        /**
2309         * Sets the value for <b>address</b> ()
2310         *
2311     * <p>
2312     * <b>Definition:</b>
2313     * An identifier for the network access point of the user device for the audit event
2314     * </p> 
2315         */
2316        public ParticipantNetwork setAddress( String theString) {
2317                myAddress = new StringDt(theString); 
2318                return this; 
2319        }
2320
2321 
2322        /**
2323         * Gets the value(s) for <b>type</b> ().
2324         * creating it if it does
2325         * not exist. Will not return <code>null</code>.
2326         *
2327     * <p>
2328     * <b>Definition:</b>
2329     * An identifier for the type of network access point that originated the audit event
2330     * </p> 
2331         */
2332        public BoundCodeDt<AuditEventParticipantNetworkTypeEnum> getTypeElement() {  
2333                if (myType == null) {
2334                        myType = new BoundCodeDt<AuditEventParticipantNetworkTypeEnum>(AuditEventParticipantNetworkTypeEnum.VALUESET_BINDER);
2335                }
2336                return myType;
2337        }
2338
2339        
2340        /**
2341         * Gets the value(s) for <b>type</b> ().
2342         * creating it if it does
2343         * not exist. Will not return <code>null</code>.
2344         *
2345     * <p>
2346     * <b>Definition:</b>
2347     * An identifier for the type of network access point that originated the audit event
2348     * </p> 
2349         */
2350        public String getType() {  
2351                return getTypeElement().getValue();
2352        }
2353
2354        /**
2355         * Sets the value(s) for <b>type</b> ()
2356         *
2357     * <p>
2358     * <b>Definition:</b>
2359     * An identifier for the type of network access point that originated the audit event
2360     * </p> 
2361         */
2362        public ParticipantNetwork setType(BoundCodeDt<AuditEventParticipantNetworkTypeEnum> theValue) {
2363                myType = theValue;
2364                return this;
2365        }
2366        
2367        
2368
2369        /**
2370         * Sets the value(s) for <b>type</b> ()
2371         *
2372     * <p>
2373     * <b>Definition:</b>
2374     * An identifier for the type of network access point that originated the audit event
2375     * </p> 
2376         */
2377        public ParticipantNetwork setType(AuditEventParticipantNetworkTypeEnum theValue) {
2378                setType(new BoundCodeDt<AuditEventParticipantNetworkTypeEnum>(AuditEventParticipantNetworkTypeEnum.VALUESET_BINDER, theValue));
2379                
2380/*
2381                getTypeElement().setValueAsEnum(theValue);
2382*/
2383                return this;
2384        }
2385
2386  
2387
2388
2389        }
2390
2391
2392
2393        /**
2394         * Block class for child element: <b>AuditEvent.source</b> ()
2395         *
2396     * <p>
2397     * <b>Definition:</b>
2398     * 
2399     * </p> 
2400         */
2401        @Block()        
2402        public static class Source 
2403            extends  BaseIdentifiableElement        implements IResourceBlock {
2404        
2405        @Child(name="site", type=StringDt.class, order=0, min=0, max=1, summary=false, modifier=false)  
2406        @Description(
2407                shortDefinition="",
2408                formalDefinition="Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group"
2409        )
2410        private StringDt mySite;
2411        
2412        @Child(name="identifier", type=IdentifierDt.class, order=1, min=1, max=1, summary=true, modifier=false) 
2413        @Description(
2414                shortDefinition="",
2415                formalDefinition="Identifier of the source where the event was detected"
2416        )
2417        private IdentifierDt myIdentifier;
2418        
2419        @Child(name="type", type=CodingDt.class, order=2, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)        
2420        @Description(
2421                shortDefinition="",
2422                formalDefinition="Code specifying the type of source where event originated"
2423        )
2424        private java.util.List<CodingDt> myType;
2425        
2426
2427        @Override
2428        public boolean isEmpty() {
2429                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  mySite,  myIdentifier,  myType);
2430        }
2431        
2432        @Override
2433        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2434                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySite, myIdentifier, myType);
2435        }
2436
2437        /**
2438         * Gets the value(s) for <b>site</b> ().
2439         * creating it if it does
2440         * not exist. Will not return <code>null</code>.
2441         *
2442     * <p>
2443     * <b>Definition:</b>
2444     * Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group
2445     * </p> 
2446         */
2447        public StringDt getSiteElement() {  
2448                if (mySite == null) {
2449                        mySite = new StringDt();
2450                }
2451                return mySite;
2452        }
2453
2454        
2455        /**
2456         * Gets the value(s) for <b>site</b> ().
2457         * creating it if it does
2458         * not exist. Will not return <code>null</code>.
2459         *
2460     * <p>
2461     * <b>Definition:</b>
2462     * Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group
2463     * </p> 
2464         */
2465        public String getSite() {  
2466                return getSiteElement().getValue();
2467        }
2468
2469        /**
2470         * Sets the value(s) for <b>site</b> ()
2471         *
2472     * <p>
2473     * <b>Definition:</b>
2474     * Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group
2475     * </p> 
2476         */
2477        public Source setSite(StringDt theValue) {
2478                mySite = theValue;
2479                return this;
2480        }
2481        
2482        
2483
2484        /**
2485         * Sets the value for <b>site</b> ()
2486         *
2487     * <p>
2488     * <b>Definition:</b>
2489     * Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group
2490     * </p> 
2491         */
2492        public Source setSite( String theString) {
2493                mySite = new StringDt(theString); 
2494                return this; 
2495        }
2496
2497 
2498        /**
2499         * Gets the value(s) for <b>identifier</b> ().
2500         * creating it if it does
2501         * not exist. Will not return <code>null</code>.
2502         *
2503     * <p>
2504     * <b>Definition:</b>
2505     * Identifier of the source where the event was detected
2506     * </p> 
2507         */
2508        public IdentifierDt getIdentifier() {  
2509                if (myIdentifier == null) {
2510                        myIdentifier = new IdentifierDt();
2511                }
2512                return myIdentifier;
2513        }
2514
2515        /**
2516         * Sets the value(s) for <b>identifier</b> ()
2517         *
2518     * <p>
2519     * <b>Definition:</b>
2520     * Identifier of the source where the event was detected
2521     * </p> 
2522         */
2523        public Source setIdentifier(IdentifierDt theValue) {
2524                myIdentifier = theValue;
2525                return this;
2526        }
2527        
2528        
2529
2530  
2531        /**
2532         * Gets the value(s) for <b>type</b> ().
2533         * creating it if it does
2534         * not exist. Will not return <code>null</code>.
2535         *
2536     * <p>
2537     * <b>Definition:</b>
2538     * Code specifying the type of source where event originated
2539     * </p> 
2540         */
2541        public java.util.List<CodingDt> getType() {  
2542                if (myType == null) {
2543                        myType = new java.util.ArrayList<CodingDt>();
2544                }
2545                return myType;
2546        }
2547
2548        /**
2549         * Sets the value(s) for <b>type</b> ()
2550         *
2551     * <p>
2552     * <b>Definition:</b>
2553     * Code specifying the type of source where event originated
2554     * </p> 
2555         */
2556        public Source setType(java.util.List<CodingDt> theValue) {
2557                myType = theValue;
2558                return this;
2559        }
2560        
2561        
2562
2563        /**
2564         * Adds and returns a new value for <b>type</b> ()
2565         *
2566     * <p>
2567     * <b>Definition:</b>
2568     * Code specifying the type of source where event originated
2569     * </p> 
2570         */
2571        public CodingDt addType() {
2572                CodingDt newType = new CodingDt();
2573                getType().add(newType);
2574                return newType; 
2575        }
2576
2577        /**
2578         * Adds a given new value for <b>type</b> ()
2579         *
2580         * <p>
2581         * <b>Definition:</b>
2582         * Code specifying the type of source where event originated
2583         * </p>
2584         * @param theValue The type to add (must not be <code>null</code>)
2585         */
2586        public Source addType(CodingDt theValue) {
2587                if (theValue == null) {
2588                        throw new NullPointerException("theValue must not be null");
2589                }
2590                getType().add(theValue);
2591                return this;
2592        }
2593
2594        /**
2595         * Gets the first repetition for <b>type</b> (),
2596         * creating it if it does not already exist.
2597         *
2598     * <p>
2599     * <b>Definition:</b>
2600     * Code specifying the type of source where event originated
2601     * </p> 
2602         */
2603        public CodingDt getTypeFirstRep() {
2604                if (getType().isEmpty()) {
2605                        return addType();
2606                }
2607                return getType().get(0); 
2608        }
2609  
2610
2611
2612        }
2613
2614
2615        /**
2616         * Block class for child element: <b>AuditEvent.object</b> ()
2617         *
2618     * <p>
2619     * <b>Definition:</b>
2620     * Specific instances of data or objects that have been accessed
2621     * </p> 
2622         */
2623        @Block()        
2624        public static class ObjectElement 
2625            extends  BaseIdentifiableElement        implements IResourceBlock {
2626        
2627        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1, summary=true, modifier=false) 
2628        @Description(
2629                shortDefinition="",
2630                formalDefinition="Identifies a specific instance of the participant object. The reference should always be version specific"
2631        )
2632        private IdentifierDt myIdentifier;
2633        
2634        @Child(name="reference", order=1, min=0, max=1, summary=true, modifier=false, type={
2635                IResource.class })
2636        @Description(
2637                shortDefinition="",
2638                formalDefinition="Identifies a specific instance of the participant object. The reference should always be version specific"
2639        )
2640        private ResourceReferenceDt myReference;
2641        
2642        @Child(name="type", type=CodingDt.class, order=2, min=0, max=1, summary=false, modifier=false)  
2643        @Description(
2644                shortDefinition="",
2645                formalDefinition="The type of the object that was involved in this audit event."
2646        )
2647        private CodingDt myType;
2648        
2649        @Child(name="role", type=CodingDt.class, order=3, min=0, max=1, summary=false, modifier=false)  
2650        @Description(
2651                shortDefinition="",
2652                formalDefinition="Code representing the functional application role of Participant Object being audited"
2653        )
2654        private CodingDt myRole;
2655        
2656        @Child(name="lifecycle", type=CodingDt.class, order=4, min=0, max=1, summary=false, modifier=false)     
2657        @Description(
2658                shortDefinition="",
2659                formalDefinition="Identifier for the data life-cycle stage for the participant object"
2660        )
2661        private CodingDt myLifecycle;
2662        
2663        @Child(name="securityLabel", type=CodingDt.class, order=5, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)       
2664        @Description(
2665                shortDefinition="",
2666                formalDefinition="Denotes security labels for the identified object."
2667        )
2668        private java.util.List<CodingDt> mySecurityLabel;
2669        
2670        @Child(name="name", type=StringDt.class, order=6, min=0, max=1, summary=true, modifier=false)   
2671        @Description(
2672                shortDefinition="",
2673                formalDefinition="An instance-specific descriptor of the Participant Object ID audited, such as a person's name"
2674        )
2675        private StringDt myName;
2676        
2677        @Child(name="description", type=StringDt.class, order=7, min=0, max=1, summary=false, modifier=false)   
2678        @Description(
2679                shortDefinition="",
2680                formalDefinition="Text that describes the object in more detail"
2681        )
2682        private StringDt myDescription;
2683        
2684        @Child(name="query", type=Base64BinaryDt.class, order=8, min=0, max=1, summary=true, modifier=false)    
2685        @Description(
2686                shortDefinition="",
2687                formalDefinition="The actual query for a query-type participant object"
2688        )
2689        private Base64BinaryDt myQuery;
2690        
2691        @Child(name="detail", order=9, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)   
2692        @Description(
2693                shortDefinition="",
2694                formalDefinition=""
2695        )
2696        private java.util.List<ObjectDetail> myDetail;
2697        
2698
2699        @Override
2700        public boolean isEmpty() {
2701                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myReference,  myType,  myRole,  myLifecycle,  mySecurityLabel,  myName,  myDescription,  myQuery,  myDetail);
2702        }
2703        
2704        @Override
2705        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2706                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myReference, myType, myRole, myLifecycle, mySecurityLabel, myName, myDescription, myQuery, myDetail);
2707        }
2708
2709        /**
2710         * Gets the value(s) for <b>identifier</b> ().
2711         * creating it if it does
2712         * not exist. Will not return <code>null</code>.
2713         *
2714     * <p>
2715     * <b>Definition:</b>
2716     * Identifies a specific instance of the participant object. The reference should always be version specific
2717     * </p> 
2718         */
2719        public IdentifierDt getIdentifier() {  
2720                if (myIdentifier == null) {
2721                        myIdentifier = new IdentifierDt();
2722                }
2723                return myIdentifier;
2724        }
2725
2726        /**
2727         * Sets the value(s) for <b>identifier</b> ()
2728         *
2729     * <p>
2730     * <b>Definition:</b>
2731     * Identifies a specific instance of the participant object. The reference should always be version specific
2732     * </p> 
2733         */
2734        public ObjectElement setIdentifier(IdentifierDt theValue) {
2735                myIdentifier = theValue;
2736                return this;
2737        }
2738        
2739        
2740
2741  
2742        /**
2743         * Gets the value(s) for <b>reference</b> ().
2744         * creating it if it does
2745         * not exist. Will not return <code>null</code>.
2746         *
2747     * <p>
2748     * <b>Definition:</b>
2749     * Identifies a specific instance of the participant object. The reference should always be version specific
2750     * </p> 
2751         */
2752        public ResourceReferenceDt getReference() {  
2753                if (myReference == null) {
2754                        myReference = new ResourceReferenceDt();
2755                }
2756                return myReference;
2757        }
2758
2759        /**
2760         * Sets the value(s) for <b>reference</b> ()
2761         *
2762     * <p>
2763     * <b>Definition:</b>
2764     * Identifies a specific instance of the participant object. The reference should always be version specific
2765     * </p> 
2766         */
2767        public ObjectElement setReference(ResourceReferenceDt theValue) {
2768                myReference = theValue;
2769                return this;
2770        }
2771        
2772        
2773
2774  
2775        /**
2776         * Gets the value(s) for <b>type</b> ().
2777         * creating it if it does
2778         * not exist. Will not return <code>null</code>.
2779         *
2780     * <p>
2781     * <b>Definition:</b>
2782     * The type of the object that was involved in this audit event.
2783     * </p> 
2784         */
2785        public CodingDt getType() {  
2786                if (myType == null) {
2787                        myType = new CodingDt();
2788                }
2789                return myType;
2790        }
2791
2792        /**
2793         * Sets the value(s) for <b>type</b> ()
2794         *
2795     * <p>
2796     * <b>Definition:</b>
2797     * The type of the object that was involved in this audit event.
2798     * </p> 
2799         */
2800        public ObjectElement setType(CodingDt theValue) {
2801                myType = theValue;
2802                return this;
2803        }
2804        
2805        
2806
2807  
2808        /**
2809         * Gets the value(s) for <b>role</b> ().
2810         * creating it if it does
2811         * not exist. Will not return <code>null</code>.
2812         *
2813     * <p>
2814     * <b>Definition:</b>
2815     * Code representing the functional application role of Participant Object being audited
2816     * </p> 
2817         */
2818        public CodingDt getRole() {  
2819                if (myRole == null) {
2820                        myRole = new CodingDt();
2821                }
2822                return myRole;
2823        }
2824
2825        /**
2826         * Sets the value(s) for <b>role</b> ()
2827         *
2828     * <p>
2829     * <b>Definition:</b>
2830     * Code representing the functional application role of Participant Object being audited
2831     * </p> 
2832         */
2833        public ObjectElement setRole(CodingDt theValue) {
2834                myRole = theValue;
2835                return this;
2836        }
2837        
2838        
2839
2840  
2841        /**
2842         * Gets the value(s) for <b>lifecycle</b> ().
2843         * creating it if it does
2844         * not exist. Will not return <code>null</code>.
2845         *
2846     * <p>
2847     * <b>Definition:</b>
2848     * Identifier for the data life-cycle stage for the participant object
2849     * </p> 
2850         */
2851        public CodingDt getLifecycle() {  
2852                if (myLifecycle == null) {
2853                        myLifecycle = new CodingDt();
2854                }
2855                return myLifecycle;
2856        }
2857
2858        /**
2859         * Sets the value(s) for <b>lifecycle</b> ()
2860         *
2861     * <p>
2862     * <b>Definition:</b>
2863     * Identifier for the data life-cycle stage for the participant object
2864     * </p> 
2865         */
2866        public ObjectElement setLifecycle(CodingDt theValue) {
2867                myLifecycle = theValue;
2868                return this;
2869        }
2870        
2871        
2872
2873  
2874        /**
2875         * Gets the value(s) for <b>securityLabel</b> ().
2876         * creating it if it does
2877         * not exist. Will not return <code>null</code>.
2878         *
2879     * <p>
2880     * <b>Definition:</b>
2881     * Denotes security labels for the identified object.
2882     * </p> 
2883         */
2884        public java.util.List<CodingDt> getSecurityLabel() {  
2885                if (mySecurityLabel == null) {
2886                        mySecurityLabel = new java.util.ArrayList<CodingDt>();
2887                }
2888                return mySecurityLabel;
2889        }
2890
2891        /**
2892         * Sets the value(s) for <b>securityLabel</b> ()
2893         *
2894     * <p>
2895     * <b>Definition:</b>
2896     * Denotes security labels for the identified object.
2897     * </p> 
2898         */
2899        public ObjectElement setSecurityLabel(java.util.List<CodingDt> theValue) {
2900                mySecurityLabel = theValue;
2901                return this;
2902        }
2903        
2904        
2905
2906        /**
2907         * Adds and returns a new value for <b>securityLabel</b> ()
2908         *
2909     * <p>
2910     * <b>Definition:</b>
2911     * Denotes security labels for the identified object.
2912     * </p> 
2913         */
2914        public CodingDt addSecurityLabel() {
2915                CodingDt newType = new CodingDt();
2916                getSecurityLabel().add(newType);
2917                return newType; 
2918        }
2919
2920        /**
2921         * Adds a given new value for <b>securityLabel</b> ()
2922         *
2923         * <p>
2924         * <b>Definition:</b>
2925         * Denotes security labels for the identified object.
2926         * </p>
2927         * @param theValue The securityLabel to add (must not be <code>null</code>)
2928         */
2929        public ObjectElement addSecurityLabel(CodingDt theValue) {
2930                if (theValue == null) {
2931                        throw new NullPointerException("theValue must not be null");
2932                }
2933                getSecurityLabel().add(theValue);
2934                return this;
2935        }
2936
2937        /**
2938         * Gets the first repetition for <b>securityLabel</b> (),
2939         * creating it if it does not already exist.
2940         *
2941     * <p>
2942     * <b>Definition:</b>
2943     * Denotes security labels for the identified object.
2944     * </p> 
2945         */
2946        public CodingDt getSecurityLabelFirstRep() {
2947                if (getSecurityLabel().isEmpty()) {
2948                        return addSecurityLabel();
2949                }
2950                return getSecurityLabel().get(0); 
2951        }
2952  
2953        /**
2954         * Gets the value(s) for <b>name</b> ().
2955         * creating it if it does
2956         * not exist. Will not return <code>null</code>.
2957         *
2958     * <p>
2959     * <b>Definition:</b>
2960     * An instance-specific descriptor of the Participant Object ID audited, such as a person's name
2961     * </p> 
2962         */
2963        public StringDt getNameElement() {  
2964                if (myName == null) {
2965                        myName = new StringDt();
2966                }
2967                return myName;
2968        }
2969
2970        
2971        /**
2972         * Gets the value(s) for <b>name</b> ().
2973         * creating it if it does
2974         * not exist. Will not return <code>null</code>.
2975         *
2976     * <p>
2977     * <b>Definition:</b>
2978     * An instance-specific descriptor of the Participant Object ID audited, such as a person's name
2979     * </p> 
2980         */
2981        public String getName() {  
2982                return getNameElement().getValue();
2983        }
2984
2985        /**
2986         * Sets the value(s) for <b>name</b> ()
2987         *
2988     * <p>
2989     * <b>Definition:</b>
2990     * An instance-specific descriptor of the Participant Object ID audited, such as a person's name
2991     * </p> 
2992         */
2993        public ObjectElement setName(StringDt theValue) {
2994                myName = theValue;
2995                return this;
2996        }
2997        
2998        
2999
3000        /**
3001         * Sets the value for <b>name</b> ()
3002         *
3003     * <p>
3004     * <b>Definition:</b>
3005     * An instance-specific descriptor of the Participant Object ID audited, such as a person's name
3006     * </p> 
3007         */
3008        public ObjectElement setName( String theString) {
3009                myName = new StringDt(theString); 
3010                return this; 
3011        }
3012
3013 
3014        /**
3015         * Gets the value(s) for <b>description</b> ().
3016         * creating it if it does
3017         * not exist. Will not return <code>null</code>.
3018         *
3019     * <p>
3020     * <b>Definition:</b>
3021     * Text that describes the object in more detail
3022     * </p> 
3023         */
3024        public StringDt getDescriptionElement() {  
3025                if (myDescription == null) {
3026                        myDescription = new StringDt();
3027                }
3028                return myDescription;
3029        }
3030
3031        
3032        /**
3033         * Gets the value(s) for <b>description</b> ().
3034         * creating it if it does
3035         * not exist. Will not return <code>null</code>.
3036         *
3037     * <p>
3038     * <b>Definition:</b>
3039     * Text that describes the object in more detail
3040     * </p> 
3041         */
3042        public String getDescription() {  
3043                return getDescriptionElement().getValue();
3044        }
3045
3046        /**
3047         * Sets the value(s) for <b>description</b> ()
3048         *
3049     * <p>
3050     * <b>Definition:</b>
3051     * Text that describes the object in more detail
3052     * </p> 
3053         */
3054        public ObjectElement setDescription(StringDt theValue) {
3055                myDescription = theValue;
3056                return this;
3057        }
3058        
3059        
3060
3061        /**
3062         * Sets the value for <b>description</b> ()
3063         *
3064     * <p>
3065     * <b>Definition:</b>
3066     * Text that describes the object in more detail
3067     * </p> 
3068         */
3069        public ObjectElement setDescription( String theString) {
3070                myDescription = new StringDt(theString); 
3071                return this; 
3072        }
3073
3074 
3075        /**
3076         * Gets the value(s) for <b>query</b> ().
3077         * creating it if it does
3078         * not exist. Will not return <code>null</code>.
3079         *
3080     * <p>
3081     * <b>Definition:</b>
3082     * The actual query for a query-type participant object
3083     * </p> 
3084         */
3085        public Base64BinaryDt getQueryElement() {  
3086                if (myQuery == null) {
3087                        myQuery = new Base64BinaryDt();
3088                }
3089                return myQuery;
3090        }
3091
3092        
3093        /**
3094         * Gets the value(s) for <b>query</b> ().
3095         * creating it if it does
3096         * not exist. Will not return <code>null</code>.
3097         *
3098     * <p>
3099     * <b>Definition:</b>
3100     * The actual query for a query-type participant object
3101     * </p> 
3102         */
3103        public byte[] getQuery() {  
3104                return getQueryElement().getValue();
3105        }
3106
3107        /**
3108         * Sets the value(s) for <b>query</b> ()
3109         *
3110     * <p>
3111     * <b>Definition:</b>
3112     * The actual query for a query-type participant object
3113     * </p> 
3114         */
3115        public ObjectElement setQuery(Base64BinaryDt theValue) {
3116                myQuery = theValue;
3117                return this;
3118        }
3119        
3120        
3121
3122        /**
3123         * Sets the value for <b>query</b> ()
3124         *
3125     * <p>
3126     * <b>Definition:</b>
3127     * The actual query for a query-type participant object
3128     * </p> 
3129         */
3130        public ObjectElement setQuery( byte[] theBytes) {
3131                myQuery = new Base64BinaryDt(theBytes); 
3132                return this; 
3133        }
3134
3135 
3136        /**
3137         * Gets the value(s) for <b>detail</b> ().
3138         * creating it if it does
3139         * not exist. Will not return <code>null</code>.
3140         *
3141     * <p>
3142     * <b>Definition:</b>
3143     * 
3144     * </p> 
3145         */
3146        public java.util.List<ObjectDetail> getDetail() {  
3147                if (myDetail == null) {
3148                        myDetail = new java.util.ArrayList<ObjectDetail>();
3149                }
3150                return myDetail;
3151        }
3152
3153        /**
3154         * Sets the value(s) for <b>detail</b> ()
3155         *
3156     * <p>
3157     * <b>Definition:</b>
3158     * 
3159     * </p> 
3160         */
3161        public ObjectElement setDetail(java.util.List<ObjectDetail> theValue) {
3162                myDetail = theValue;
3163                return this;
3164        }
3165        
3166        
3167
3168        /**
3169         * Adds and returns a new value for <b>detail</b> ()
3170         *
3171     * <p>
3172     * <b>Definition:</b>
3173     * 
3174     * </p> 
3175         */
3176        public ObjectDetail addDetail() {
3177                ObjectDetail newType = new ObjectDetail();
3178                getDetail().add(newType);
3179                return newType; 
3180        }
3181
3182        /**
3183         * Adds a given new value for <b>detail</b> ()
3184         *
3185         * <p>
3186         * <b>Definition:</b>
3187         * 
3188         * </p>
3189         * @param theValue The detail to add (must not be <code>null</code>)
3190         */
3191        public ObjectElement addDetail(ObjectDetail theValue) {
3192                if (theValue == null) {
3193                        throw new NullPointerException("theValue must not be null");
3194                }
3195                getDetail().add(theValue);
3196                return this;
3197        }
3198
3199        /**
3200         * Gets the first repetition for <b>detail</b> (),
3201         * creating it if it does not already exist.
3202         *
3203     * <p>
3204     * <b>Definition:</b>
3205     * 
3206     * </p> 
3207         */
3208        public ObjectDetail getDetailFirstRep() {
3209                if (getDetail().isEmpty()) {
3210                        return addDetail();
3211                }
3212                return getDetail().get(0); 
3213        }
3214  
3215
3216
3217        }
3218
3219        /**
3220         * Block class for child element: <b>AuditEvent.object.detail</b> ()
3221         *
3222     * <p>
3223     * <b>Definition:</b>
3224     * 
3225     * </p> 
3226         */
3227        @Block()        
3228        public static class ObjectDetail 
3229            extends  BaseIdentifiableElement        implements IResourceBlock {
3230        
3231        @Child(name="type", type=StringDt.class, order=0, min=1, max=1, summary=false, modifier=false)  
3232        @Description(
3233                shortDefinition="",
3234                formalDefinition=""
3235        )
3236        private StringDt myType;
3237        
3238        @Child(name="value", type=Base64BinaryDt.class, order=1, min=1, max=1, summary=false, modifier=false)   
3239        @Description(
3240                shortDefinition="",
3241                formalDefinition=""
3242        )
3243        private Base64BinaryDt myValue;
3244        
3245
3246        @Override
3247        public boolean isEmpty() {
3248                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myType,  myValue);
3249        }
3250        
3251        @Override
3252        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
3253                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myValue);
3254        }
3255
3256        /**
3257         * Gets the value(s) for <b>type</b> ().
3258         * creating it if it does
3259         * not exist. Will not return <code>null</code>.
3260         *
3261     * <p>
3262     * <b>Definition:</b>
3263     * 
3264     * </p> 
3265         */
3266        public StringDt getTypeElement() {  
3267                if (myType == null) {
3268                        myType = new StringDt();
3269                }
3270                return myType;
3271        }
3272
3273        
3274        /**
3275         * Gets the value(s) for <b>type</b> ().
3276         * creating it if it does
3277         * not exist. Will not return <code>null</code>.
3278         *
3279     * <p>
3280     * <b>Definition:</b>
3281     * 
3282     * </p> 
3283         */
3284        public String getType() {  
3285                return getTypeElement().getValue();
3286        }
3287
3288        /**
3289         * Sets the value(s) for <b>type</b> ()
3290         *
3291     * <p>
3292     * <b>Definition:</b>
3293     * 
3294     * </p> 
3295         */
3296        public ObjectDetail setType(StringDt theValue) {
3297                myType = theValue;
3298                return this;
3299        }
3300        
3301        
3302
3303        /**
3304         * Sets the value for <b>type</b> ()
3305         *
3306     * <p>
3307     * <b>Definition:</b>
3308     * 
3309     * </p> 
3310         */
3311        public ObjectDetail setType( String theString) {
3312                myType = new StringDt(theString); 
3313                return this; 
3314        }
3315
3316 
3317        /**
3318         * Gets the value(s) for <b>value</b> ().
3319         * creating it if it does
3320         * not exist. Will not return <code>null</code>.
3321         *
3322     * <p>
3323     * <b>Definition:</b>
3324     * 
3325     * </p> 
3326         */
3327        public Base64BinaryDt getValueElement() {  
3328                if (myValue == null) {
3329                        myValue = new Base64BinaryDt();
3330                }
3331                return myValue;
3332        }
3333
3334        
3335        /**
3336         * Gets the value(s) for <b>value</b> ().
3337         * creating it if it does
3338         * not exist. Will not return <code>null</code>.
3339         *
3340     * <p>
3341     * <b>Definition:</b>
3342     * 
3343     * </p> 
3344         */
3345        public byte[] getValue() {  
3346                return getValueElement().getValue();
3347        }
3348
3349        /**
3350         * Sets the value(s) for <b>value</b> ()
3351         *
3352     * <p>
3353     * <b>Definition:</b>
3354     * 
3355     * </p> 
3356         */
3357        public ObjectDetail setValue(Base64BinaryDt theValue) {
3358                myValue = theValue;
3359                return this;
3360        }
3361        
3362        
3363
3364        /**
3365         * Sets the value for <b>value</b> ()
3366         *
3367     * <p>
3368     * <b>Definition:</b>
3369     * 
3370     * </p> 
3371         */
3372        public ObjectDetail setValue( byte[] theBytes) {
3373                myValue = new Base64BinaryDt(theBytes); 
3374                return this; 
3375        }
3376
3377 
3378
3379
3380        }
3381
3382
3383
3384
3385
3386    @Override
3387    public String getResourceName() {
3388        return "AuditEvent";
3389    }
3390    
3391    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
3392        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
3393    }
3394
3395
3396}