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>MessageHeader</b> Resource
320 * (infrastructure.exchange)
321 *
322 * <p>
323 * <b>Definition:</b>
324 * The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.
325 * </p> 
326 *
327 * <p>
328 * <b>Requirements:</b>
329 * Many implementations are not prepared to use REST and need a messaging based infrastructure
330 * </p> 
331 *
332 * <p>
333 * <b>Profile Definition:</b>
334 * <a href="http://hl7.org/fhir/profiles/MessageHeader">http://hl7.org/fhir/profiles/MessageHeader</a> 
335 * </p>
336 *
337 */
338@ResourceDef(name="MessageHeader", profile="http://hl7.org/fhir/profiles/MessageHeader", id="messageheader")
339public class MessageHeader extends ca.uhn.fhir.model.dstu2.resource.BaseResource
340    implements  IResource     {
341
342        /**
343         * Search parameter constant for <b>timestamp</b>
344         * <p>
345         * Description: <b></b><br>
346         * Type: <b>date</b><br>
347         * Path: <b>MessageHeader.timestamp</b><br>
348         * </p>
349         */
350        @SearchParamDefinition(name="timestamp", path="MessageHeader.timestamp", description="", type="date"  )
351        public static final String SP_TIMESTAMP = "timestamp";
352
353        /**
354         * <b>Fluent Client</b> search parameter constant for <b>timestamp</b>
355         * <p>
356         * Description: <b></b><br>
357         * Type: <b>date</b><br>
358         * Path: <b>MessageHeader.timestamp</b><br>
359         * </p>
360         */
361        public static final DateClientParam TIMESTAMP = new DateClientParam(SP_TIMESTAMP);
362
363        /**
364         * Search parameter constant for <b>event</b>
365         * <p>
366         * Description: <b></b><br>
367         * Type: <b>token</b><br>
368         * Path: <b>MessageHeader.event</b><br>
369         * </p>
370         */
371        @SearchParamDefinition(name="event", path="MessageHeader.event", description="", type="token"  )
372        public static final String SP_EVENT = "event";
373
374        /**
375         * <b>Fluent Client</b> search parameter constant for <b>event</b>
376         * <p>
377         * Description: <b></b><br>
378         * Type: <b>token</b><br>
379         * Path: <b>MessageHeader.event</b><br>
380         * </p>
381         */
382        public static final TokenClientParam EVENT = new TokenClientParam(SP_EVENT);
383
384        /**
385         * Search parameter constant for <b>response-id</b>
386         * <p>
387         * Description: <b></b><br>
388         * Type: <b>token</b><br>
389         * Path: <b>MessageHeader.response.identifier</b><br>
390         * </p>
391         */
392        @SearchParamDefinition(name="response-id", path="MessageHeader.response.identifier", description="", type="token"  )
393        public static final String SP_RESPONSE_ID = "response-id";
394
395        /**
396         * <b>Fluent Client</b> search parameter constant for <b>response-id</b>
397         * <p>
398         * Description: <b></b><br>
399         * Type: <b>token</b><br>
400         * Path: <b>MessageHeader.response.identifier</b><br>
401         * </p>
402         */
403        public static final TokenClientParam RESPONSE_ID = new TokenClientParam(SP_RESPONSE_ID);
404
405        /**
406         * Search parameter constant for <b>code</b>
407         * <p>
408         * Description: <b></b><br>
409         * Type: <b>token</b><br>
410         * Path: <b>MessageHeader.response.code</b><br>
411         * </p>
412         */
413        @SearchParamDefinition(name="code", path="MessageHeader.response.code", description="", type="token"  )
414        public static final String SP_CODE = "code";
415
416        /**
417         * <b>Fluent Client</b> search parameter constant for <b>code</b>
418         * <p>
419         * Description: <b></b><br>
420         * Type: <b>token</b><br>
421         * Path: <b>MessageHeader.response.code</b><br>
422         * </p>
423         */
424        public static final TokenClientParam CODE = new TokenClientParam(SP_CODE);
425
426        /**
427         * Search parameter constant for <b>source</b>
428         * <p>
429         * Description: <b></b><br>
430         * Type: <b>string</b><br>
431         * Path: <b>MessageHeader.source.name</b><br>
432         * </p>
433         */
434        @SearchParamDefinition(name="source", path="MessageHeader.source.name", description="", type="string"  )
435        public static final String SP_SOURCE = "source";
436
437        /**
438         * <b>Fluent Client</b> search parameter constant for <b>source</b>
439         * <p>
440         * Description: <b></b><br>
441         * Type: <b>string</b><br>
442         * Path: <b>MessageHeader.source.name</b><br>
443         * </p>
444         */
445        public static final StringClientParam SOURCE = new StringClientParam(SP_SOURCE);
446
447        /**
448         * Search parameter constant for <b>source-uri</b>
449         * <p>
450         * Description: <b></b><br>
451         * Type: <b>uri</b><br>
452         * Path: <b>MessageHeader.source.endpoint</b><br>
453         * </p>
454         */
455        @SearchParamDefinition(name="source-uri", path="MessageHeader.source.endpoint", description="", type="uri"  )
456        public static final String SP_SOURCE_URI = "source-uri";
457
458        /**
459         * <b>Fluent Client</b> search parameter constant for <b>source-uri</b>
460         * <p>
461         * Description: <b></b><br>
462         * Type: <b>uri</b><br>
463         * Path: <b>MessageHeader.source.endpoint</b><br>
464         * </p>
465         */
466        public static final UriClientParam SOURCE_URI = new UriClientParam(SP_SOURCE_URI);
467
468        /**
469         * Search parameter constant for <b>destination</b>
470         * <p>
471         * Description: <b></b><br>
472         * Type: <b>string</b><br>
473         * Path: <b>MessageHeader.destination.name</b><br>
474         * </p>
475         */
476        @SearchParamDefinition(name="destination", path="MessageHeader.destination.name", description="", type="string"  )
477        public static final String SP_DESTINATION = "destination";
478
479        /**
480         * <b>Fluent Client</b> search parameter constant for <b>destination</b>
481         * <p>
482         * Description: <b></b><br>
483         * Type: <b>string</b><br>
484         * Path: <b>MessageHeader.destination.name</b><br>
485         * </p>
486         */
487        public static final StringClientParam DESTINATION = new StringClientParam(SP_DESTINATION);
488
489        /**
490         * Search parameter constant for <b>destination-uri</b>
491         * <p>
492         * Description: <b></b><br>
493         * Type: <b>uri</b><br>
494         * Path: <b>MessageHeader.destination.endpoint</b><br>
495         * </p>
496         */
497        @SearchParamDefinition(name="destination-uri", path="MessageHeader.destination.endpoint", description="", type="uri"  )
498        public static final String SP_DESTINATION_URI = "destination-uri";
499
500        /**
501         * <b>Fluent Client</b> search parameter constant for <b>destination-uri</b>
502         * <p>
503         * Description: <b></b><br>
504         * Type: <b>uri</b><br>
505         * Path: <b>MessageHeader.destination.endpoint</b><br>
506         * </p>
507         */
508        public static final UriClientParam DESTINATION_URI = new UriClientParam(SP_DESTINATION_URI);
509
510        /**
511         * Search parameter constant for <b>data</b>
512         * <p>
513         * Description: <b></b><br>
514         * Type: <b>reference</b><br>
515         * Path: <b>MessageHeader.data</b><br>
516         * </p>
517         */
518        @SearchParamDefinition(name="data", path="MessageHeader.data", description="", type="reference"  )
519        public static final String SP_DATA = "data";
520
521        /**
522         * <b>Fluent Client</b> search parameter constant for <b>data</b>
523         * <p>
524         * Description: <b></b><br>
525         * Type: <b>reference</b><br>
526         * Path: <b>MessageHeader.data</b><br>
527         * </p>
528         */
529        public static final ReferenceClientParam DATA = new ReferenceClientParam(SP_DATA);
530
531        /**
532         * Search parameter constant for <b>receiver</b>
533         * <p>
534         * Description: <b></b><br>
535         * Type: <b>reference</b><br>
536         * Path: <b>MessageHeader.receiver</b><br>
537         * </p>
538         */
539        @SearchParamDefinition(name="receiver", path="MessageHeader.receiver", description="", type="reference"  )
540        public static final String SP_RECEIVER = "receiver";
541
542        /**
543         * <b>Fluent Client</b> search parameter constant for <b>receiver</b>
544         * <p>
545         * Description: <b></b><br>
546         * Type: <b>reference</b><br>
547         * Path: <b>MessageHeader.receiver</b><br>
548         * </p>
549         */
550        public static final ReferenceClientParam RECEIVER = new ReferenceClientParam(SP_RECEIVER);
551
552        /**
553         * Search parameter constant for <b>author</b>
554         * <p>
555         * Description: <b></b><br>
556         * Type: <b>reference</b><br>
557         * Path: <b>MessageHeader.author</b><br>
558         * </p>
559         */
560        @SearchParamDefinition(name="author", path="MessageHeader.author", description="", type="reference"  )
561        public static final String SP_AUTHOR = "author";
562
563        /**
564         * <b>Fluent Client</b> search parameter constant for <b>author</b>
565         * <p>
566         * Description: <b></b><br>
567         * Type: <b>reference</b><br>
568         * Path: <b>MessageHeader.author</b><br>
569         * </p>
570         */
571        public static final ReferenceClientParam AUTHOR = new ReferenceClientParam(SP_AUTHOR);
572
573        /**
574         * Search parameter constant for <b>responsible</b>
575         * <p>
576         * Description: <b></b><br>
577         * Type: <b>reference</b><br>
578         * Path: <b>MessageHeader.responsible</b><br>
579         * </p>
580         */
581        @SearchParamDefinition(name="responsible", path="MessageHeader.responsible", description="", type="reference"  )
582        public static final String SP_RESPONSIBLE = "responsible";
583
584        /**
585         * <b>Fluent Client</b> search parameter constant for <b>responsible</b>
586         * <p>
587         * Description: <b></b><br>
588         * Type: <b>reference</b><br>
589         * Path: <b>MessageHeader.responsible</b><br>
590         * </p>
591         */
592        public static final ReferenceClientParam RESPONSIBLE = new ReferenceClientParam(SP_RESPONSIBLE);
593
594        /**
595         * Search parameter constant for <b>enterer</b>
596         * <p>
597         * Description: <b></b><br>
598         * Type: <b>reference</b><br>
599         * Path: <b>MessageHeader.enterer</b><br>
600         * </p>
601         */
602        @SearchParamDefinition(name="enterer", path="MessageHeader.enterer", description="", type="reference"  )
603        public static final String SP_ENTERER = "enterer";
604
605        /**
606         * <b>Fluent Client</b> search parameter constant for <b>enterer</b>
607         * <p>
608         * Description: <b></b><br>
609         * Type: <b>reference</b><br>
610         * Path: <b>MessageHeader.enterer</b><br>
611         * </p>
612         */
613        public static final ReferenceClientParam ENTERER = new ReferenceClientParam(SP_ENTERER);
614
615        /**
616         * Search parameter constant for <b>target</b>
617         * <p>
618         * Description: <b></b><br>
619         * Type: <b>reference</b><br>
620         * Path: <b>MessageHeader.destination.target</b><br>
621         * </p>
622         */
623        @SearchParamDefinition(name="target", path="MessageHeader.destination.target", description="", type="reference"  )
624        public static final String SP_TARGET = "target";
625
626        /**
627         * <b>Fluent Client</b> search parameter constant for <b>target</b>
628         * <p>
629         * Description: <b></b><br>
630         * Type: <b>reference</b><br>
631         * Path: <b>MessageHeader.destination.target</b><br>
632         * </p>
633         */
634        public static final ReferenceClientParam TARGET = new ReferenceClientParam(SP_TARGET);
635
636
637        /**
638         * Constant for fluent queries to be used to add include statements. Specifies
639         * the path value of "<b>MessageHeader:author</b>".
640         */
641        public static final Include INCLUDE_AUTHOR = new Include("MessageHeader:author");
642
643        /**
644         * Constant for fluent queries to be used to add include statements. Specifies
645         * the path value of "<b>MessageHeader:data</b>".
646         */
647        public static final Include INCLUDE_DATA = new Include("MessageHeader:data");
648
649        /**
650         * Constant for fluent queries to be used to add include statements. Specifies
651         * the path value of "<b>MessageHeader:enterer</b>".
652         */
653        public static final Include INCLUDE_ENTERER = new Include("MessageHeader:enterer");
654
655        /**
656         * Constant for fluent queries to be used to add include statements. Specifies
657         * the path value of "<b>MessageHeader:receiver</b>".
658         */
659        public static final Include INCLUDE_RECEIVER = new Include("MessageHeader:receiver");
660
661        /**
662         * Constant for fluent queries to be used to add include statements. Specifies
663         * the path value of "<b>MessageHeader:responsible</b>".
664         */
665        public static final Include INCLUDE_RESPONSIBLE = new Include("MessageHeader:responsible");
666
667        /**
668         * Constant for fluent queries to be used to add include statements. Specifies
669         * the path value of "<b>MessageHeader:target</b>".
670         */
671        public static final Include INCLUDE_TARGET = new Include("MessageHeader:target");
672
673
674        @Child(name="timestamp", type=InstantDt.class, order=0, min=1, max=1, summary=false, modifier=false)    
675        @Description(
676                shortDefinition="when.init",
677                formalDefinition="The time that the message was sent"
678        )
679        private InstantDt myTimestamp;
680        
681        @Child(name="event", type=CodingDt.class, order=1, min=1, max=1, summary=false, modifier=true)  
682        @Description(
683                shortDefinition="what",
684                formalDefinition="Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value \"http://hl7.org/fhir/message-events\""
685        )
686        private CodingDt myEvent;
687        
688        @Child(name="response", order=2, min=0, max=1, summary=false, modifier=true)    
689        @Description(
690                shortDefinition="",
691                formalDefinition="Information about the message that this message is a response to.  Only present if this message is a response."
692        )
693        private Response myResponse;
694        
695        @Child(name="source", order=3, min=1, max=1, summary=false, modifier=false)     
696        @Description(
697                shortDefinition="who.actor",
698                formalDefinition="The source application from which this message originated"
699        )
700        private Source mySource;
701        
702        @Child(name="destination", order=4, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
703        @Description(
704                shortDefinition="who.focus",
705                formalDefinition="The destination application which the message is intended for"
706        )
707        private java.util.List<Destination> myDestination;
708        
709        @Child(name="enterer", order=5, min=0, max=1, summary=false, modifier=false, type={
710                ca.uhn.fhir.model.dstu2.resource.Practitioner.class     })
711        @Description(
712                shortDefinition="who.author",
713                formalDefinition="The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions"
714        )
715        private ResourceReferenceDt myEnterer;
716        
717        @Child(name="author", order=6, min=0, max=1, summary=false, modifier=false, type={
718                ca.uhn.fhir.model.dstu2.resource.Practitioner.class     })
719        @Description(
720                shortDefinition="who.author",
721                formalDefinition="The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions"
722        )
723        private ResourceReferenceDt myAuthor;
724        
725        @Child(name="receiver", order=7, min=0, max=1, summary=false, modifier=false, type={
726                ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.Organization.class     })
727        @Description(
728                shortDefinition="who.focus",
729                formalDefinition="Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient."
730        )
731        private ResourceReferenceDt myReceiver;
732        
733        @Child(name="responsible", order=8, min=0, max=1, summary=false, modifier=false, type={
734                ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.Organization.class     })
735        @Description(
736                shortDefinition="who.witness",
737                formalDefinition="The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party"
738        )
739        private ResourceReferenceDt myResponsible;
740        
741        @Child(name="reason", type=CodeableConceptDt.class, order=9, min=0, max=1, summary=false, modifier=false)       
742        @Description(
743                shortDefinition="why",
744                formalDefinition="Coded indication of the cause for the event - indicates  a reason for the occurrence of the event that is a focus of this message"
745        )
746        private CodeableConceptDt myReason;
747        
748        @Child(name="data", order=10, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
749                IResource.class })
750        @Description(
751                shortDefinition="",
752                formalDefinition="The actual data of the message - a reference to the root/focus class of the event."
753        )
754        private java.util.List<ResourceReferenceDt> myData;
755        
756
757        @Override
758        public boolean isEmpty() {
759                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myTimestamp,  myEvent,  myResponse,  mySource,  myDestination,  myEnterer,  myAuthor,  myReceiver,  myResponsible,  myReason,  myData);
760        }
761        
762        @Override
763        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
764                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myTimestamp, myEvent, myResponse, mySource, myDestination, myEnterer, myAuthor, myReceiver, myResponsible, myReason, myData);
765        }
766
767        /**
768         * Gets the value(s) for <b>timestamp</b> (when.init).
769         * creating it if it does
770         * not exist. Will not return <code>null</code>.
771         *
772     * <p>
773     * <b>Definition:</b>
774     * The time that the message was sent
775     * </p> 
776         */
777        public InstantDt getTimestampElement() {  
778                if (myTimestamp == null) {
779                        myTimestamp = new InstantDt();
780                }
781                return myTimestamp;
782        }
783
784        
785        /**
786         * Gets the value(s) for <b>timestamp</b> (when.init).
787         * creating it if it does
788         * not exist. Will not return <code>null</code>.
789         *
790     * <p>
791     * <b>Definition:</b>
792     * The time that the message was sent
793     * </p> 
794         */
795        public Date getTimestamp() {  
796                return getTimestampElement().getValue();
797        }
798
799        /**
800         * Sets the value(s) for <b>timestamp</b> (when.init)
801         *
802     * <p>
803     * <b>Definition:</b>
804     * The time that the message was sent
805     * </p> 
806         */
807        public MessageHeader setTimestamp(InstantDt theValue) {
808                myTimestamp = theValue;
809                return this;
810        }
811        
812        
813
814        /**
815         * Sets the value for <b>timestamp</b> (when.init)
816         *
817     * <p>
818     * <b>Definition:</b>
819     * The time that the message was sent
820     * </p> 
821         */
822        public MessageHeader setTimestampWithMillisPrecision( Date theDate) {
823                myTimestamp = new InstantDt(theDate); 
824                return this; 
825        }
826
827        /**
828         * Sets the value for <b>timestamp</b> (when.init)
829         *
830     * <p>
831     * <b>Definition:</b>
832     * The time that the message was sent
833     * </p> 
834         */
835        public MessageHeader setTimestamp( Date theDate,  TemporalPrecisionEnum thePrecision) {
836                myTimestamp = new InstantDt(theDate, thePrecision); 
837                return this; 
838        }
839
840 
841        /**
842         * Gets the value(s) for <b>event</b> (what).
843         * creating it if it does
844         * not exist. Will not return <code>null</code>.
845         *
846     * <p>
847     * <b>Definition:</b>
848     * Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value \&quot;http://hl7.org/fhir/message-events\&quot;
849     * </p> 
850         */
851        public CodingDt getEvent() {  
852                if (myEvent == null) {
853                        myEvent = new CodingDt();
854                }
855                return myEvent;
856        }
857
858        /**
859         * Sets the value(s) for <b>event</b> (what)
860         *
861     * <p>
862     * <b>Definition:</b>
863     * Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value \&quot;http://hl7.org/fhir/message-events\&quot;
864     * </p> 
865         */
866        public MessageHeader setEvent(CodingDt theValue) {
867                myEvent = theValue;
868                return this;
869        }
870        
871        
872
873  
874        /**
875         * Gets the value(s) for <b>response</b> ().
876         * creating it if it does
877         * not exist. Will not return <code>null</code>.
878         *
879     * <p>
880     * <b>Definition:</b>
881     * Information about the message that this message is a response to.  Only present if this message is a response.
882     * </p> 
883         */
884        public Response getResponse() {  
885                if (myResponse == null) {
886                        myResponse = new Response();
887                }
888                return myResponse;
889        }
890
891        /**
892         * Sets the value(s) for <b>response</b> ()
893         *
894     * <p>
895     * <b>Definition:</b>
896     * Information about the message that this message is a response to.  Only present if this message is a response.
897     * </p> 
898         */
899        public MessageHeader setResponse(Response theValue) {
900                myResponse = theValue;
901                return this;
902        }
903        
904        
905
906  
907        /**
908         * Gets the value(s) for <b>source</b> (who.actor).
909         * creating it if it does
910         * not exist. Will not return <code>null</code>.
911         *
912     * <p>
913     * <b>Definition:</b>
914     * The source application from which this message originated
915     * </p> 
916         */
917        public Source getSource() {  
918                if (mySource == null) {
919                        mySource = new Source();
920                }
921                return mySource;
922        }
923
924        /**
925         * Sets the value(s) for <b>source</b> (who.actor)
926         *
927     * <p>
928     * <b>Definition:</b>
929     * The source application from which this message originated
930     * </p> 
931         */
932        public MessageHeader setSource(Source theValue) {
933                mySource = theValue;
934                return this;
935        }
936        
937        
938
939  
940        /**
941         * Gets the value(s) for <b>destination</b> (who.focus).
942         * creating it if it does
943         * not exist. Will not return <code>null</code>.
944         *
945     * <p>
946     * <b>Definition:</b>
947     * The destination application which the message is intended for
948     * </p> 
949         */
950        public java.util.List<Destination> getDestination() {  
951                if (myDestination == null) {
952                        myDestination = new java.util.ArrayList<Destination>();
953                }
954                return myDestination;
955        }
956
957        /**
958         * Sets the value(s) for <b>destination</b> (who.focus)
959         *
960     * <p>
961     * <b>Definition:</b>
962     * The destination application which the message is intended for
963     * </p> 
964         */
965        public MessageHeader setDestination(java.util.List<Destination> theValue) {
966                myDestination = theValue;
967                return this;
968        }
969        
970        
971
972        /**
973         * Adds and returns a new value for <b>destination</b> (who.focus)
974         *
975     * <p>
976     * <b>Definition:</b>
977     * The destination application which the message is intended for
978     * </p> 
979         */
980        public Destination addDestination() {
981                Destination newType = new Destination();
982                getDestination().add(newType);
983                return newType; 
984        }
985
986        /**
987         * Adds a given new value for <b>destination</b> (who.focus)
988         *
989         * <p>
990         * <b>Definition:</b>
991         * The destination application which the message is intended for
992         * </p>
993         * @param theValue The destination to add (must not be <code>null</code>)
994         */
995        public MessageHeader addDestination(Destination theValue) {
996                if (theValue == null) {
997                        throw new NullPointerException("theValue must not be null");
998                }
999                getDestination().add(theValue);
1000                return this;
1001        }
1002
1003        /**
1004         * Gets the first repetition for <b>destination</b> (who.focus),
1005         * creating it if it does not already exist.
1006         *
1007     * <p>
1008     * <b>Definition:</b>
1009     * The destination application which the message is intended for
1010     * </p> 
1011         */
1012        public Destination getDestinationFirstRep() {
1013                if (getDestination().isEmpty()) {
1014                        return addDestination();
1015                }
1016                return getDestination().get(0); 
1017        }
1018  
1019        /**
1020         * Gets the value(s) for <b>enterer</b> (who.author).
1021         * creating it if it does
1022         * not exist. Will not return <code>null</code>.
1023         *
1024     * <p>
1025     * <b>Definition:</b>
1026     * The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions
1027     * </p> 
1028         */
1029        public ResourceReferenceDt getEnterer() {  
1030                if (myEnterer == null) {
1031                        myEnterer = new ResourceReferenceDt();
1032                }
1033                return myEnterer;
1034        }
1035
1036        /**
1037         * Sets the value(s) for <b>enterer</b> (who.author)
1038         *
1039     * <p>
1040     * <b>Definition:</b>
1041     * The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions
1042     * </p> 
1043         */
1044        public MessageHeader setEnterer(ResourceReferenceDt theValue) {
1045                myEnterer = theValue;
1046                return this;
1047        }
1048        
1049        
1050
1051  
1052        /**
1053         * Gets the value(s) for <b>author</b> (who.author).
1054         * creating it if it does
1055         * not exist. Will not return <code>null</code>.
1056         *
1057     * <p>
1058     * <b>Definition:</b>
1059     * The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions
1060     * </p> 
1061         */
1062        public ResourceReferenceDt getAuthor() {  
1063                if (myAuthor == null) {
1064                        myAuthor = new ResourceReferenceDt();
1065                }
1066                return myAuthor;
1067        }
1068
1069        /**
1070         * Sets the value(s) for <b>author</b> (who.author)
1071         *
1072     * <p>
1073     * <b>Definition:</b>
1074     * The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions
1075     * </p> 
1076         */
1077        public MessageHeader setAuthor(ResourceReferenceDt theValue) {
1078                myAuthor = theValue;
1079                return this;
1080        }
1081        
1082        
1083
1084  
1085        /**
1086         * Gets the value(s) for <b>receiver</b> (who.focus).
1087         * creating it if it does
1088         * not exist. Will not return <code>null</code>.
1089         *
1090     * <p>
1091     * <b>Definition:</b>
1092     * Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.
1093     * </p> 
1094         */
1095        public ResourceReferenceDt getReceiver() {  
1096                if (myReceiver == null) {
1097                        myReceiver = new ResourceReferenceDt();
1098                }
1099                return myReceiver;
1100        }
1101
1102        /**
1103         * Sets the value(s) for <b>receiver</b> (who.focus)
1104         *
1105     * <p>
1106     * <b>Definition:</b>
1107     * Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.
1108     * </p> 
1109         */
1110        public MessageHeader setReceiver(ResourceReferenceDt theValue) {
1111                myReceiver = theValue;
1112                return this;
1113        }
1114        
1115        
1116
1117  
1118        /**
1119         * Gets the value(s) for <b>responsible</b> (who.witness).
1120         * creating it if it does
1121         * not exist. Will not return <code>null</code>.
1122         *
1123     * <p>
1124     * <b>Definition:</b>
1125     * The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party
1126     * </p> 
1127         */
1128        public ResourceReferenceDt getResponsible() {  
1129                if (myResponsible == null) {
1130                        myResponsible = new ResourceReferenceDt();
1131                }
1132                return myResponsible;
1133        }
1134
1135        /**
1136         * Sets the value(s) for <b>responsible</b> (who.witness)
1137         *
1138     * <p>
1139     * <b>Definition:</b>
1140     * The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party
1141     * </p> 
1142         */
1143        public MessageHeader setResponsible(ResourceReferenceDt theValue) {
1144                myResponsible = theValue;
1145                return this;
1146        }
1147        
1148        
1149
1150  
1151        /**
1152         * Gets the value(s) for <b>reason</b> (why).
1153         * creating it if it does
1154         * not exist. Will not return <code>null</code>.
1155         *
1156     * <p>
1157     * <b>Definition:</b>
1158     * Coded indication of the cause for the event - indicates  a reason for the occurrence of the event that is a focus of this message
1159     * </p> 
1160         */
1161        public CodeableConceptDt getReason() {  
1162                if (myReason == null) {
1163                        myReason = new CodeableConceptDt();
1164                }
1165                return myReason;
1166        }
1167
1168        /**
1169         * Sets the value(s) for <b>reason</b> (why)
1170         *
1171     * <p>
1172     * <b>Definition:</b>
1173     * Coded indication of the cause for the event - indicates  a reason for the occurrence of the event that is a focus of this message
1174     * </p> 
1175         */
1176        public MessageHeader setReason(CodeableConceptDt theValue) {
1177                myReason = theValue;
1178                return this;
1179        }
1180        
1181        
1182
1183  
1184        /**
1185         * Gets the value(s) for <b>data</b> ().
1186         * creating it if it does
1187         * not exist. Will not return <code>null</code>.
1188         *
1189     * <p>
1190     * <b>Definition:</b>
1191     * The actual data of the message - a reference to the root/focus class of the event.
1192     * </p> 
1193         */
1194        public java.util.List<ResourceReferenceDt> getData() {  
1195                if (myData == null) {
1196                        myData = new java.util.ArrayList<ResourceReferenceDt>();
1197                }
1198                return myData;
1199        }
1200
1201        /**
1202         * Sets the value(s) for <b>data</b> ()
1203         *
1204     * <p>
1205     * <b>Definition:</b>
1206     * The actual data of the message - a reference to the root/focus class of the event.
1207     * </p> 
1208         */
1209        public MessageHeader setData(java.util.List<ResourceReferenceDt> theValue) {
1210                myData = theValue;
1211                return this;
1212        }
1213        
1214        
1215
1216        /**
1217         * Adds and returns a new value for <b>data</b> ()
1218         *
1219     * <p>
1220     * <b>Definition:</b>
1221     * The actual data of the message - a reference to the root/focus class of the event.
1222     * </p> 
1223         */
1224        public ResourceReferenceDt addData() {
1225                ResourceReferenceDt newType = new ResourceReferenceDt();
1226                getData().add(newType);
1227                return newType; 
1228        }
1229  
1230        /**
1231         * Block class for child element: <b>MessageHeader.response</b> ()
1232         *
1233     * <p>
1234     * <b>Definition:</b>
1235     * Information about the message that this message is a response to.  Only present if this message is a response.
1236     * </p> 
1237         */
1238        @Block()        
1239        public static class Response 
1240            extends  BaseIdentifiableElement        implements IResourceBlock {
1241        
1242        @Child(name="identifier", type=IdDt.class, order=0, min=1, max=1, summary=false, modifier=false)        
1243        @Description(
1244                shortDefinition="",
1245                formalDefinition="The id of the message that this message is a response to"
1246        )
1247        private IdDt myIdentifier;
1248        
1249        @Child(name="code", type=CodeDt.class, order=1, min=1, max=1, summary=false, modifier=true)     
1250        @Description(
1251                shortDefinition="",
1252                formalDefinition="Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not"
1253        )
1254        private BoundCodeDt<ResponseTypeEnum> myCode;
1255        
1256        @Child(name="details", order=2, min=0, max=1, summary=false, modifier=false, type={
1257                ca.uhn.fhir.model.dstu2.resource.OperationOutcome.class })
1258        @Description(
1259                shortDefinition="",
1260                formalDefinition="Full details of any issues found in the message"
1261        )
1262        private ResourceReferenceDt myDetails;
1263        
1264
1265        @Override
1266        public boolean isEmpty() {
1267                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myCode,  myDetails);
1268        }
1269        
1270        @Override
1271        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1272                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myCode, myDetails);
1273        }
1274
1275        /**
1276         * Gets the value(s) for <b>identifier</b> ().
1277         * creating it if it does
1278         * not exist. Will not return <code>null</code>.
1279         *
1280     * <p>
1281     * <b>Definition:</b>
1282     * The id of the message that this message is a response to
1283     * </p> 
1284         */
1285        public IdDt getIdentifierElement() {  
1286                if (myIdentifier == null) {
1287                        myIdentifier = new IdDt();
1288                }
1289                return myIdentifier;
1290        }
1291
1292        
1293        /**
1294         * Gets the value(s) for <b>identifier</b> ().
1295         * creating it if it does
1296         * not exist. Will not return <code>null</code>.
1297         *
1298     * <p>
1299     * <b>Definition:</b>
1300     * The id of the message that this message is a response to
1301     * </p> 
1302         */
1303        public String getIdentifier() {  
1304                return getIdentifierElement().getValue();
1305        }
1306
1307        /**
1308         * Sets the value(s) for <b>identifier</b> ()
1309         *
1310     * <p>
1311     * <b>Definition:</b>
1312     * The id of the message that this message is a response to
1313     * </p> 
1314         */
1315        public Response setIdentifier(IdDt theValue) {
1316                myIdentifier = theValue;
1317                return this;
1318        }
1319        
1320        
1321
1322        /**
1323         * Sets the value for <b>identifier</b> ()
1324         *
1325     * <p>
1326     * <b>Definition:</b>
1327     * The id of the message that this message is a response to
1328     * </p> 
1329         */
1330        public Response setIdentifier( String theId) {
1331                myIdentifier = new IdDt(theId); 
1332                return this; 
1333        }
1334
1335 
1336        /**
1337         * Gets the value(s) for <b>code</b> ().
1338         * creating it if it does
1339         * not exist. Will not return <code>null</code>.
1340         *
1341     * <p>
1342     * <b>Definition:</b>
1343     * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not
1344     * </p> 
1345         */
1346        public BoundCodeDt<ResponseTypeEnum> getCodeElement() {  
1347                if (myCode == null) {
1348                        myCode = new BoundCodeDt<ResponseTypeEnum>(ResponseTypeEnum.VALUESET_BINDER);
1349                }
1350                return myCode;
1351        }
1352
1353        
1354        /**
1355         * Gets the value(s) for <b>code</b> ().
1356         * creating it if it does
1357         * not exist. Will not return <code>null</code>.
1358         *
1359     * <p>
1360     * <b>Definition:</b>
1361     * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not
1362     * </p> 
1363         */
1364        public String getCode() {  
1365                return getCodeElement().getValue();
1366        }
1367
1368        /**
1369         * Sets the value(s) for <b>code</b> ()
1370         *
1371     * <p>
1372     * <b>Definition:</b>
1373     * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not
1374     * </p> 
1375         */
1376        public Response setCode(BoundCodeDt<ResponseTypeEnum> theValue) {
1377                myCode = theValue;
1378                return this;
1379        }
1380        
1381        
1382
1383        /**
1384         * Sets the value(s) for <b>code</b> ()
1385         *
1386     * <p>
1387     * <b>Definition:</b>
1388     * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not
1389     * </p> 
1390         */
1391        public Response setCode(ResponseTypeEnum theValue) {
1392                setCode(new BoundCodeDt<ResponseTypeEnum>(ResponseTypeEnum.VALUESET_BINDER, theValue));
1393                
1394/*
1395                getCodeElement().setValueAsEnum(theValue);
1396*/
1397                return this;
1398        }
1399
1400  
1401        /**
1402         * Gets the value(s) for <b>details</b> ().
1403         * creating it if it does
1404         * not exist. Will not return <code>null</code>.
1405         *
1406     * <p>
1407     * <b>Definition:</b>
1408     * Full details of any issues found in the message
1409     * </p> 
1410         */
1411        public ResourceReferenceDt getDetails() {  
1412                if (myDetails == null) {
1413                        myDetails = new ResourceReferenceDt();
1414                }
1415                return myDetails;
1416        }
1417
1418        /**
1419         * Sets the value(s) for <b>details</b> ()
1420         *
1421     * <p>
1422     * <b>Definition:</b>
1423     * Full details of any issues found in the message
1424     * </p> 
1425         */
1426        public Response setDetails(ResourceReferenceDt theValue) {
1427                myDetails = theValue;
1428                return this;
1429        }
1430        
1431        
1432
1433  
1434
1435
1436        }
1437
1438
1439        /**
1440         * Block class for child element: <b>MessageHeader.source</b> (who.actor)
1441         *
1442     * <p>
1443     * <b>Definition:</b>
1444     * The source application from which this message originated
1445     * </p> 
1446         */
1447        @Block()        
1448        public static class Source 
1449            extends  BaseIdentifiableElement        implements IResourceBlock {
1450        
1451        @Child(name="name", type=StringDt.class, order=0, min=0, max=1, summary=false, modifier=false)  
1452        @Description(
1453                shortDefinition="",
1454                formalDefinition="Human-readable name for the source system"
1455        )
1456        private StringDt myName;
1457        
1458        @Child(name="software", type=StringDt.class, order=1, min=0, max=1, summary=false, modifier=false)      
1459        @Description(
1460                shortDefinition="",
1461                formalDefinition="May include configuration or other information useful in debugging."
1462        )
1463        private StringDt mySoftware;
1464        
1465        @Child(name="version", type=StringDt.class, order=2, min=0, max=1, summary=false, modifier=false)       
1466        @Description(
1467                shortDefinition="",
1468                formalDefinition="Can convey versions of multiple systems in situations where a message passes through multiple hands."
1469        )
1470        private StringDt myVersion;
1471        
1472        @Child(name="contact", type=ContactPointDt.class, order=3, min=0, max=1, summary=false, modifier=false) 
1473        @Description(
1474                shortDefinition="",
1475                formalDefinition="An e-mail, phone, website or other contact point to use to resolve issues with message communications."
1476        )
1477        private ContactPointDt myContact;
1478        
1479        @Child(name="endpoint", type=UriDt.class, order=4, min=1, max=1, summary=false, modifier=false) 
1480        @Description(
1481                shortDefinition="",
1482                formalDefinition="Identifies the routing target to send acknowledgements to."
1483        )
1484        private UriDt myEndpoint;
1485        
1486
1487        @Override
1488        public boolean isEmpty() {
1489                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myName,  mySoftware,  myVersion,  myContact,  myEndpoint);
1490        }
1491        
1492        @Override
1493        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1494                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, mySoftware, myVersion, myContact, myEndpoint);
1495        }
1496
1497        /**
1498         * Gets the value(s) for <b>name</b> ().
1499         * creating it if it does
1500         * not exist. Will not return <code>null</code>.
1501         *
1502     * <p>
1503     * <b>Definition:</b>
1504     * Human-readable name for the source system
1505     * </p> 
1506         */
1507        public StringDt getNameElement() {  
1508                if (myName == null) {
1509                        myName = new StringDt();
1510                }
1511                return myName;
1512        }
1513
1514        
1515        /**
1516         * Gets the value(s) for <b>name</b> ().
1517         * creating it if it does
1518         * not exist. Will not return <code>null</code>.
1519         *
1520     * <p>
1521     * <b>Definition:</b>
1522     * Human-readable name for the source system
1523     * </p> 
1524         */
1525        public String getName() {  
1526                return getNameElement().getValue();
1527        }
1528
1529        /**
1530         * Sets the value(s) for <b>name</b> ()
1531         *
1532     * <p>
1533     * <b>Definition:</b>
1534     * Human-readable name for the source system
1535     * </p> 
1536         */
1537        public Source setName(StringDt theValue) {
1538                myName = theValue;
1539                return this;
1540        }
1541        
1542        
1543
1544        /**
1545         * Sets the value for <b>name</b> ()
1546         *
1547     * <p>
1548     * <b>Definition:</b>
1549     * Human-readable name for the source system
1550     * </p> 
1551         */
1552        public Source setName( String theString) {
1553                myName = new StringDt(theString); 
1554                return this; 
1555        }
1556
1557 
1558        /**
1559         * Gets the value(s) for <b>software</b> ().
1560         * creating it if it does
1561         * not exist. Will not return <code>null</code>.
1562         *
1563     * <p>
1564     * <b>Definition:</b>
1565     * May include configuration or other information useful in debugging.
1566     * </p> 
1567         */
1568        public StringDt getSoftwareElement() {  
1569                if (mySoftware == null) {
1570                        mySoftware = new StringDt();
1571                }
1572                return mySoftware;
1573        }
1574
1575        
1576        /**
1577         * Gets the value(s) for <b>software</b> ().
1578         * creating it if it does
1579         * not exist. Will not return <code>null</code>.
1580         *
1581     * <p>
1582     * <b>Definition:</b>
1583     * May include configuration or other information useful in debugging.
1584     * </p> 
1585         */
1586        public String getSoftware() {  
1587                return getSoftwareElement().getValue();
1588        }
1589
1590        /**
1591         * Sets the value(s) for <b>software</b> ()
1592         *
1593     * <p>
1594     * <b>Definition:</b>
1595     * May include configuration or other information useful in debugging.
1596     * </p> 
1597         */
1598        public Source setSoftware(StringDt theValue) {
1599                mySoftware = theValue;
1600                return this;
1601        }
1602        
1603        
1604
1605        /**
1606         * Sets the value for <b>software</b> ()
1607         *
1608     * <p>
1609     * <b>Definition:</b>
1610     * May include configuration or other information useful in debugging.
1611     * </p> 
1612         */
1613        public Source setSoftware( String theString) {
1614                mySoftware = new StringDt(theString); 
1615                return this; 
1616        }
1617
1618 
1619        /**
1620         * Gets the value(s) for <b>version</b> ().
1621         * creating it if it does
1622         * not exist. Will not return <code>null</code>.
1623         *
1624     * <p>
1625     * <b>Definition:</b>
1626     * Can convey versions of multiple systems in situations where a message passes through multiple hands.
1627     * </p> 
1628         */
1629        public StringDt getVersionElement() {  
1630                if (myVersion == null) {
1631                        myVersion = new StringDt();
1632                }
1633                return myVersion;
1634        }
1635
1636        
1637        /**
1638         * Gets the value(s) for <b>version</b> ().
1639         * creating it if it does
1640         * not exist. Will not return <code>null</code>.
1641         *
1642     * <p>
1643     * <b>Definition:</b>
1644     * Can convey versions of multiple systems in situations where a message passes through multiple hands.
1645     * </p> 
1646         */
1647        public String getVersion() {  
1648                return getVersionElement().getValue();
1649        }
1650
1651        /**
1652         * Sets the value(s) for <b>version</b> ()
1653         *
1654     * <p>
1655     * <b>Definition:</b>
1656     * Can convey versions of multiple systems in situations where a message passes through multiple hands.
1657     * </p> 
1658         */
1659        public Source setVersion(StringDt theValue) {
1660                myVersion = theValue;
1661                return this;
1662        }
1663        
1664        
1665
1666        /**
1667         * Sets the value for <b>version</b> ()
1668         *
1669     * <p>
1670     * <b>Definition:</b>
1671     * Can convey versions of multiple systems in situations where a message passes through multiple hands.
1672     * </p> 
1673         */
1674        public Source setVersion( String theString) {
1675                myVersion = new StringDt(theString); 
1676                return this; 
1677        }
1678
1679 
1680        /**
1681         * Gets the value(s) for <b>contact</b> ().
1682         * creating it if it does
1683         * not exist. Will not return <code>null</code>.
1684         *
1685     * <p>
1686     * <b>Definition:</b>
1687     * An e-mail, phone, website or other contact point to use to resolve issues with message communications.
1688     * </p> 
1689         */
1690        public ContactPointDt getContact() {  
1691                if (myContact == null) {
1692                        myContact = new ContactPointDt();
1693                }
1694                return myContact;
1695        }
1696
1697        /**
1698         * Sets the value(s) for <b>contact</b> ()
1699         *
1700     * <p>
1701     * <b>Definition:</b>
1702     * An e-mail, phone, website or other contact point to use to resolve issues with message communications.
1703     * </p> 
1704         */
1705        public Source setContact(ContactPointDt theValue) {
1706                myContact = theValue;
1707                return this;
1708        }
1709        
1710        
1711
1712  
1713        /**
1714         * Gets the value(s) for <b>endpoint</b> ().
1715         * creating it if it does
1716         * not exist. Will not return <code>null</code>.
1717         *
1718     * <p>
1719     * <b>Definition:</b>
1720     * Identifies the routing target to send acknowledgements to.
1721     * </p> 
1722         */
1723        public UriDt getEndpointElement() {  
1724                if (myEndpoint == null) {
1725                        myEndpoint = new UriDt();
1726                }
1727                return myEndpoint;
1728        }
1729
1730        
1731        /**
1732         * Gets the value(s) for <b>endpoint</b> ().
1733         * creating it if it does
1734         * not exist. Will not return <code>null</code>.
1735         *
1736     * <p>
1737     * <b>Definition:</b>
1738     * Identifies the routing target to send acknowledgements to.
1739     * </p> 
1740         */
1741        public String getEndpoint() {  
1742                return getEndpointElement().getValue();
1743        }
1744
1745        /**
1746         * Sets the value(s) for <b>endpoint</b> ()
1747         *
1748     * <p>
1749     * <b>Definition:</b>
1750     * Identifies the routing target to send acknowledgements to.
1751     * </p> 
1752         */
1753        public Source setEndpoint(UriDt theValue) {
1754                myEndpoint = theValue;
1755                return this;
1756        }
1757        
1758        
1759
1760        /**
1761         * Sets the value for <b>endpoint</b> ()
1762         *
1763     * <p>
1764     * <b>Definition:</b>
1765     * Identifies the routing target to send acknowledgements to.
1766     * </p> 
1767         */
1768        public Source setEndpoint( String theUri) {
1769                myEndpoint = new UriDt(theUri); 
1770                return this; 
1771        }
1772
1773 
1774
1775
1776        }
1777
1778
1779        /**
1780         * Block class for child element: <b>MessageHeader.destination</b> (who.focus)
1781         *
1782     * <p>
1783     * <b>Definition:</b>
1784     * The destination application which the message is intended for
1785     * </p> 
1786         */
1787        @Block()        
1788        public static class Destination 
1789            extends  BaseIdentifiableElement        implements IResourceBlock {
1790        
1791        @Child(name="name", type=StringDt.class, order=0, min=0, max=1, summary=false, modifier=false)  
1792        @Description(
1793                shortDefinition="",
1794                formalDefinition="Human-readable name for the target system"
1795        )
1796        private StringDt myName;
1797        
1798        @Child(name="target", order=1, min=0, max=1, summary=false, modifier=false, type={
1799                ca.uhn.fhir.model.dstu2.resource.Device.class   })
1800        @Description(
1801                shortDefinition="",
1802                formalDefinition="Identifies the target end system in situations where the initial message transmission is to an intermediary system."
1803        )
1804        private ResourceReferenceDt myTarget;
1805        
1806        @Child(name="endpoint", type=UriDt.class, order=2, min=1, max=1, summary=false, modifier=false) 
1807        @Description(
1808                shortDefinition="",
1809                formalDefinition="Indicates where the message should be routed to."
1810        )
1811        private UriDt myEndpoint;
1812        
1813
1814        @Override
1815        public boolean isEmpty() {
1816                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myName,  myTarget,  myEndpoint);
1817        }
1818        
1819        @Override
1820        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1821                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myTarget, myEndpoint);
1822        }
1823
1824        /**
1825         * Gets the value(s) for <b>name</b> ().
1826         * creating it if it does
1827         * not exist. Will not return <code>null</code>.
1828         *
1829     * <p>
1830     * <b>Definition:</b>
1831     * Human-readable name for the target system
1832     * </p> 
1833         */
1834        public StringDt getNameElement() {  
1835                if (myName == null) {
1836                        myName = new StringDt();
1837                }
1838                return myName;
1839        }
1840
1841        
1842        /**
1843         * Gets the value(s) for <b>name</b> ().
1844         * creating it if it does
1845         * not exist. Will not return <code>null</code>.
1846         *
1847     * <p>
1848     * <b>Definition:</b>
1849     * Human-readable name for the target system
1850     * </p> 
1851         */
1852        public String getName() {  
1853                return getNameElement().getValue();
1854        }
1855
1856        /**
1857         * Sets the value(s) for <b>name</b> ()
1858         *
1859     * <p>
1860     * <b>Definition:</b>
1861     * Human-readable name for the target system
1862     * </p> 
1863         */
1864        public Destination setName(StringDt theValue) {
1865                myName = theValue;
1866                return this;
1867        }
1868        
1869        
1870
1871        /**
1872         * Sets the value for <b>name</b> ()
1873         *
1874     * <p>
1875     * <b>Definition:</b>
1876     * Human-readable name for the target system
1877     * </p> 
1878         */
1879        public Destination setName( String theString) {
1880                myName = new StringDt(theString); 
1881                return this; 
1882        }
1883
1884 
1885        /**
1886         * Gets the value(s) for <b>target</b> ().
1887         * creating it if it does
1888         * not exist. Will not return <code>null</code>.
1889         *
1890     * <p>
1891     * <b>Definition:</b>
1892     * Identifies the target end system in situations where the initial message transmission is to an intermediary system.
1893     * </p> 
1894         */
1895        public ResourceReferenceDt getTarget() {  
1896                if (myTarget == null) {
1897                        myTarget = new ResourceReferenceDt();
1898                }
1899                return myTarget;
1900        }
1901
1902        /**
1903         * Sets the value(s) for <b>target</b> ()
1904         *
1905     * <p>
1906     * <b>Definition:</b>
1907     * Identifies the target end system in situations where the initial message transmission is to an intermediary system.
1908     * </p> 
1909         */
1910        public Destination setTarget(ResourceReferenceDt theValue) {
1911                myTarget = theValue;
1912                return this;
1913        }
1914        
1915        
1916
1917  
1918        /**
1919         * Gets the value(s) for <b>endpoint</b> ().
1920         * creating it if it does
1921         * not exist. Will not return <code>null</code>.
1922         *
1923     * <p>
1924     * <b>Definition:</b>
1925     * Indicates where the message should be routed to.
1926     * </p> 
1927         */
1928        public UriDt getEndpointElement() {  
1929                if (myEndpoint == null) {
1930                        myEndpoint = new UriDt();
1931                }
1932                return myEndpoint;
1933        }
1934
1935        
1936        /**
1937         * Gets the value(s) for <b>endpoint</b> ().
1938         * creating it if it does
1939         * not exist. Will not return <code>null</code>.
1940         *
1941     * <p>
1942     * <b>Definition:</b>
1943     * Indicates where the message should be routed to.
1944     * </p> 
1945         */
1946        public String getEndpoint() {  
1947                return getEndpointElement().getValue();
1948        }
1949
1950        /**
1951         * Sets the value(s) for <b>endpoint</b> ()
1952         *
1953     * <p>
1954     * <b>Definition:</b>
1955     * Indicates where the message should be routed to.
1956     * </p> 
1957         */
1958        public Destination setEndpoint(UriDt theValue) {
1959                myEndpoint = theValue;
1960                return this;
1961        }
1962        
1963        
1964
1965        /**
1966         * Sets the value for <b>endpoint</b> ()
1967         *
1968     * <p>
1969     * <b>Definition:</b>
1970     * Indicates where the message should be routed to.
1971     * </p> 
1972         */
1973        public Destination setEndpoint( String theUri) {
1974                myEndpoint = new UriDt(theUri); 
1975                return this; 
1976        }
1977
1978 
1979
1980
1981        }
1982
1983
1984
1985
1986    @Override
1987    public String getResourceName() {
1988        return "MessageHeader";
1989    }
1990    
1991    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
1992        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
1993    }
1994
1995
1996}