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.composite.AnnotationDt;
042import ca.uhn.fhir.model.dstu2.valueset.AnswerFormatEnum;
043import ca.uhn.fhir.model.dstu2.resource.Appointment;
044import ca.uhn.fhir.model.dstu2.valueset.AppointmentStatusEnum;
045import ca.uhn.fhir.model.dstu2.valueset.AssertionDirectionTypeEnum;
046import ca.uhn.fhir.model.dstu2.valueset.AssertionOperatorTypeEnum;
047import ca.uhn.fhir.model.dstu2.valueset.AssertionResponseTypesEnum;
048import ca.uhn.fhir.model.dstu2.composite.AttachmentDt;
049import ca.uhn.fhir.model.dstu2.valueset.AuditEventActionEnum;
050import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectLifecycleEnum;
051import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectRoleEnum;
052import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectTypeEnum;
053import ca.uhn.fhir.model.dstu2.valueset.AuditEventOutcomeEnum;
054import ca.uhn.fhir.model.dstu2.valueset.AuditEventParticipantNetworkTypeEnum;
055import ca.uhn.fhir.model.dstu2.valueset.AuditEventSourceTypeEnum;
056import ca.uhn.fhir.model.dstu2.valueset.BindingStrengthEnum;
057import ca.uhn.fhir.model.dstu2.resource.BodySite;
058import ca.uhn.fhir.model.dstu2.valueset.BundleTypeEnum;
059import ca.uhn.fhir.model.dstu2.resource.CarePlan;
060import ca.uhn.fhir.model.dstu2.valueset.CarePlanActivityStatusEnum;
061import ca.uhn.fhir.model.dstu2.valueset.CarePlanRelationshipEnum;
062import ca.uhn.fhir.model.dstu2.valueset.CarePlanStatusEnum;
063import ca.uhn.fhir.model.dstu2.resource.Claim;
064import ca.uhn.fhir.model.dstu2.resource.ClaimResponse;
065import ca.uhn.fhir.model.dstu2.valueset.ClaimTypeEnum;
066import ca.uhn.fhir.model.dstu2.resource.ClinicalImpression;
067import ca.uhn.fhir.model.dstu2.valueset.ClinicalImpressionStatusEnum;
068import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt;
069import ca.uhn.fhir.model.dstu2.composite.CodingDt;
070import ca.uhn.fhir.model.dstu2.resource.CommunicationRequest;
071import ca.uhn.fhir.model.dstu2.valueset.CommunicationRequestStatusEnum;
072import ca.uhn.fhir.model.dstu2.valueset.CommunicationStatusEnum;
073import ca.uhn.fhir.model.dstu2.resource.Composition;
074import ca.uhn.fhir.model.dstu2.valueset.CompositionAttestationModeEnum;
075import ca.uhn.fhir.model.dstu2.valueset.CompositionStatusEnum;
076import ca.uhn.fhir.model.dstu2.valueset.ConceptMapEquivalenceEnum;
077import ca.uhn.fhir.model.dstu2.resource.Condition;
078import ca.uhn.fhir.model.dstu2.valueset.ConditionCategoryCodesEnum;
079import ca.uhn.fhir.model.dstu2.valueset.ConditionClinicalStatusCodesEnum;
080import ca.uhn.fhir.model.dstu2.valueset.ConditionVerificationStatusEnum;
081import ca.uhn.fhir.model.dstu2.valueset.ConditionalDeleteStatusEnum;
082import ca.uhn.fhir.model.dstu2.resource.Conformance;
083import ca.uhn.fhir.model.dstu2.valueset.ConformanceEventModeEnum;
084import ca.uhn.fhir.model.dstu2.valueset.ConformanceResourceStatusEnum;
085import ca.uhn.fhir.model.dstu2.valueset.ConformanceStatementKindEnum;
086import ca.uhn.fhir.model.dstu2.composite.ContactPointDt;
087import ca.uhn.fhir.model.dstu2.valueset.ContentTypeEnum;
088import ca.uhn.fhir.model.dstu2.resource.Contract;
089import ca.uhn.fhir.model.dstu2.resource.Coverage;
090import ca.uhn.fhir.model.dstu2.valueset.DataElementStringencyEnum;
091import ca.uhn.fhir.model.dstu2.valueset.DaysOfWeekEnum;
092import ca.uhn.fhir.model.dstu2.valueset.DetectedIssueSeverityEnum;
093import ca.uhn.fhir.model.dstu2.resource.Device;
094import ca.uhn.fhir.model.dstu2.resource.DeviceComponent;
095import ca.uhn.fhir.model.dstu2.resource.DeviceMetric;
096import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCalibrationStateEnum;
097import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCalibrationTypeEnum;
098import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCategoryEnum;
099import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricColorEnum;
100import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricOperationalStatusEnum;
101import ca.uhn.fhir.model.dstu2.valueset.DeviceStatusEnum;
102import ca.uhn.fhir.model.dstu2.resource.DeviceUseRequest;
103import ca.uhn.fhir.model.dstu2.valueset.DeviceUseRequestPriorityEnum;
104import ca.uhn.fhir.model.dstu2.valueset.DeviceUseRequestStatusEnum;
105import ca.uhn.fhir.model.dstu2.resource.DiagnosticOrder;
106import ca.uhn.fhir.model.dstu2.valueset.DiagnosticOrderPriorityEnum;
107import ca.uhn.fhir.model.dstu2.valueset.DiagnosticOrderStatusEnum;
108import ca.uhn.fhir.model.dstu2.resource.DiagnosticReport;
109import ca.uhn.fhir.model.dstu2.valueset.DiagnosticReportStatusEnum;
110import ca.uhn.fhir.model.dstu2.valueset.DigitalMediaTypeEnum;
111import ca.uhn.fhir.model.dstu2.valueset.DocumentModeEnum;
112import ca.uhn.fhir.model.dstu2.resource.DocumentReference;
113import ca.uhn.fhir.model.dstu2.valueset.DocumentReferenceStatusEnum;
114import ca.uhn.fhir.model.dstu2.valueset.DocumentRelationshipTypeEnum;
115import ca.uhn.fhir.model.dstu2.composite.ElementDefinitionDt;
116import ca.uhn.fhir.model.dstu2.resource.EligibilityRequest;
117import ca.uhn.fhir.model.dstu2.resource.Encounter;
118import ca.uhn.fhir.model.dstu2.valueset.EncounterClassEnum;
119import ca.uhn.fhir.model.dstu2.valueset.EncounterLocationStatusEnum;
120import ca.uhn.fhir.model.dstu2.valueset.EncounterStateEnum;
121import ca.uhn.fhir.model.dstu2.resource.EnrollmentRequest;
122import ca.uhn.fhir.model.dstu2.resource.EpisodeOfCare;
123import ca.uhn.fhir.model.dstu2.valueset.EpisodeOfCareStatusEnum;
124import ca.uhn.fhir.model.dstu2.valueset.ExtensionContextEnum;
125import ca.uhn.fhir.model.dstu2.valueset.FamilyHistoryStatusEnum;
126import ca.uhn.fhir.model.dstu2.resource.FamilyMemberHistory;
127import ca.uhn.fhir.model.dstu2.valueset.FilterOperatorEnum;
128import ca.uhn.fhir.model.dstu2.valueset.FlagStatusEnum;
129import ca.uhn.fhir.model.dstu2.resource.Goal;
130import ca.uhn.fhir.model.dstu2.valueset.GoalPriorityEnum;
131import ca.uhn.fhir.model.dstu2.valueset.GoalStatusEnum;
132import ca.uhn.fhir.model.dstu2.resource.Group;
133import ca.uhn.fhir.model.dstu2.valueset.GroupTypeEnum;
134import ca.uhn.fhir.model.dstu2.valueset.GuideDependencyTypeEnum;
135import ca.uhn.fhir.model.dstu2.valueset.GuidePageKindEnum;
136import ca.uhn.fhir.model.dstu2.valueset.GuideResourcePurposeEnum;
137import ca.uhn.fhir.model.dstu2.valueset.HTTPVerbEnum;
138import ca.uhn.fhir.model.dstu2.resource.HealthcareService;
139import ca.uhn.fhir.model.dstu2.composite.HumanNameDt;
140import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
141import ca.uhn.fhir.model.dstu2.valueset.IdentifierTypeCodesEnum;
142import ca.uhn.fhir.model.dstu2.valueset.IdentityAssuranceLevelEnum;
143import ca.uhn.fhir.model.dstu2.resource.ImagingObjectSelection;
144import ca.uhn.fhir.model.dstu2.resource.ImagingStudy;
145import ca.uhn.fhir.model.dstu2.resource.Immunization;
146import ca.uhn.fhir.model.dstu2.valueset.InstanceAvailabilityEnum;
147import ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum;
148import ca.uhn.fhir.model.dstu2.valueset.IssueTypeEnum;
149import ca.uhn.fhir.model.dstu2.valueset.KOStitleEnum;
150import ca.uhn.fhir.model.dstu2.valueset.LinkTypeEnum;
151import ca.uhn.fhir.model.dstu2.valueset.ListModeEnum;
152import ca.uhn.fhir.model.dstu2.valueset.ListOrderCodesEnum;
153import ca.uhn.fhir.model.dstu2.valueset.ListStatusEnum;
154import ca.uhn.fhir.model.dstu2.resource.Location;
155import ca.uhn.fhir.model.dstu2.valueset.LocationModeEnum;
156import ca.uhn.fhir.model.dstu2.valueset.LocationStatusEnum;
157import ca.uhn.fhir.model.dstu2.valueset.LocationTypeEnum;
158import ca.uhn.fhir.model.dstu2.valueset.MaritalStatusCodesEnum;
159import ca.uhn.fhir.model.dstu2.valueset.MeasmntPrincipleEnum;
160import ca.uhn.fhir.model.dstu2.resource.Media;
161import ca.uhn.fhir.model.dstu2.resource.Medication;
162import ca.uhn.fhir.model.dstu2.valueset.MedicationAdministrationStatusEnum;
163import ca.uhn.fhir.model.dstu2.valueset.MedicationDispenseStatusEnum;
164import ca.uhn.fhir.model.dstu2.resource.MedicationOrder;
165import ca.uhn.fhir.model.dstu2.valueset.MedicationOrderStatusEnum;
166import ca.uhn.fhir.model.dstu2.resource.MedicationStatement;
167import ca.uhn.fhir.model.dstu2.valueset.MedicationStatementStatusEnum;
168import ca.uhn.fhir.model.dstu2.valueset.MessageEventEnum;
169import ca.uhn.fhir.model.dstu2.valueset.MessageSignificanceCategoryEnum;
170import ca.uhn.fhir.model.dstu2.valueset.MessageTransportEnum;
171import ca.uhn.fhir.model.dstu2.resource.NamingSystem;
172import ca.uhn.fhir.model.dstu2.valueset.NamingSystemIdentifierTypeEnum;
173import ca.uhn.fhir.model.dstu2.valueset.NamingSystemTypeEnum;
174import ca.uhn.fhir.model.dstu2.valueset.NoteTypeEnum;
175import ca.uhn.fhir.model.dstu2.resource.NutritionOrder;
176import ca.uhn.fhir.model.dstu2.valueset.NutritionOrderStatusEnum;
177import ca.uhn.fhir.model.dstu2.resource.Observation;
178import ca.uhn.fhir.model.dstu2.valueset.ObservationRelationshipTypeEnum;
179import ca.uhn.fhir.model.dstu2.valueset.ObservationStatusEnum;
180import ca.uhn.fhir.model.dstu2.resource.OperationDefinition;
181import ca.uhn.fhir.model.dstu2.valueset.OperationKindEnum;
182import ca.uhn.fhir.model.dstu2.resource.OperationOutcome;
183import ca.uhn.fhir.model.dstu2.valueset.OperationParameterUseEnum;
184import ca.uhn.fhir.model.dstu2.resource.Order;
185import ca.uhn.fhir.model.dstu2.valueset.OrderStatusEnum;
186import ca.uhn.fhir.model.dstu2.resource.Organization;
187import ca.uhn.fhir.model.dstu2.valueset.ParticipantRequiredEnum;
188import ca.uhn.fhir.model.dstu2.valueset.ParticipantStatusEnum;
189import ca.uhn.fhir.model.dstu2.valueset.ParticipantTypeEnum;
190import ca.uhn.fhir.model.dstu2.valueset.ParticipationStatusEnum;
191import ca.uhn.fhir.model.dstu2.resource.Patient;
192import ca.uhn.fhir.model.dstu2.valueset.PayeeTypeCodesEnum;
193import ca.uhn.fhir.model.dstu2.composite.PeriodDt;
194import ca.uhn.fhir.model.dstu2.resource.Person;
195import ca.uhn.fhir.model.dstu2.resource.Practitioner;
196import ca.uhn.fhir.model.dstu2.resource.Procedure;
197import ca.uhn.fhir.model.dstu2.resource.ProcedureRequest;
198import ca.uhn.fhir.model.dstu2.valueset.ProcedureRequestPriorityEnum;
199import ca.uhn.fhir.model.dstu2.valueset.ProcedureRequestStatusEnum;
200import ca.uhn.fhir.model.dstu2.valueset.ProcedureStatusEnum;
201import ca.uhn.fhir.model.dstu2.resource.ProcessRequest;
202import ca.uhn.fhir.model.dstu2.valueset.ProvenanceEntityRoleEnum;
203import ca.uhn.fhir.model.dstu2.composite.QuantityDt;
204import ca.uhn.fhir.model.dstu2.resource.Questionnaire;
205import ca.uhn.fhir.model.dstu2.resource.QuestionnaireResponse;
206import ca.uhn.fhir.model.dstu2.valueset.QuestionnaireResponseStatusEnum;
207import ca.uhn.fhir.model.dstu2.valueset.QuestionnaireStatusEnum;
208import ca.uhn.fhir.model.dstu2.composite.RangeDt;
209import ca.uhn.fhir.model.dstu2.composite.RatioDt;
210import ca.uhn.fhir.model.dstu2.valueset.ReferralMethodEnum;
211import ca.uhn.fhir.model.dstu2.resource.ReferralRequest;
212import ca.uhn.fhir.model.dstu2.valueset.ReferralStatusEnum;
213import ca.uhn.fhir.model.dstu2.resource.RelatedPerson;
214import ca.uhn.fhir.model.dstu2.valueset.RemittanceOutcomeEnum;
215import ca.uhn.fhir.model.dstu2.valueset.ResourceTypeEnum;
216import ca.uhn.fhir.model.dstu2.valueset.ResourceVersionPolicyEnum;
217import ca.uhn.fhir.model.dstu2.valueset.ResponseTypeEnum;
218import ca.uhn.fhir.model.dstu2.valueset.RestfulConformanceModeEnum;
219import ca.uhn.fhir.model.dstu2.valueset.RestfulSecurityServiceEnum;
220import ca.uhn.fhir.model.dstu2.resource.RiskAssessment;
221import ca.uhn.fhir.model.dstu2.valueset.RulesetCodesEnum;
222import ca.uhn.fhir.model.dstu2.composite.SampledDataDt;
223import ca.uhn.fhir.model.dstu2.resource.Schedule;
224import ca.uhn.fhir.model.dstu2.valueset.SearchEntryModeEnum;
225import ca.uhn.fhir.model.dstu2.valueset.SearchModifierCodeEnum;
226import ca.uhn.fhir.model.dstu2.valueset.SearchParamTypeEnum;
227import ca.uhn.fhir.model.dstu2.valueset.ServiceProvisionConditionsEnum;
228import ca.uhn.fhir.model.dstu2.composite.SignatureDt;
229import ca.uhn.fhir.model.dstu2.resource.Slot;
230import ca.uhn.fhir.model.dstu2.valueset.SlotStatusEnum;
231import ca.uhn.fhir.model.dstu2.resource.Specimen;
232import ca.uhn.fhir.model.dstu2.valueset.SpecimenStatusEnum;
233import ca.uhn.fhir.model.dstu2.resource.StructureDefinition;
234import ca.uhn.fhir.model.dstu2.valueset.StructureDefinitionKindEnum;
235import ca.uhn.fhir.model.dstu2.valueset.SubscriptionChannelTypeEnum;
236import ca.uhn.fhir.model.dstu2.valueset.SubscriptionStatusEnum;
237import ca.uhn.fhir.model.dstu2.resource.Substance;
238import ca.uhn.fhir.model.dstu2.valueset.SubstanceCategoryCodesEnum;
239import ca.uhn.fhir.model.dstu2.valueset.SupplyDeliveryStatusEnum;
240import ca.uhn.fhir.model.dstu2.resource.SupplyRequest;
241import ca.uhn.fhir.model.dstu2.valueset.SupplyRequestStatusEnum;
242import ca.uhn.fhir.model.dstu2.valueset.SystemRestfulInteractionEnum;
243import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
244import ca.uhn.fhir.model.dstu2.composite.TimingDt;
245import ca.uhn.fhir.model.dstu2.valueset.TransactionModeEnum;
246import ca.uhn.fhir.model.dstu2.valueset.TypeRestfulInteractionEnum;
247import ca.uhn.fhir.model.dstu2.valueset.UnknownContentCodeEnum;
248import ca.uhn.fhir.model.dstu2.valueset.UseEnum;
249import ca.uhn.fhir.model.dstu2.resource.ValueSet;
250import ca.uhn.fhir.model.dstu2.valueset.VisionBaseEnum;
251import ca.uhn.fhir.model.dstu2.valueset.VisionEyesEnum;
252import ca.uhn.fhir.model.dstu2.resource.VisionPrescription;
253import ca.uhn.fhir.model.dstu2.valueset.XPathUsageTypeEnum;
254import ca.uhn.fhir.model.api.IResource;
255import ca.uhn.fhir.model.dstu2.composite.AgeDt;
256import ca.uhn.fhir.model.dstu2.composite.BoundCodeableConceptDt;
257import ca.uhn.fhir.model.dstu2.composite.DurationDt;
258import ca.uhn.fhir.model.dstu2.composite.MoneyDt;
259import ca.uhn.fhir.model.dstu2.composite.NarrativeDt;
260import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt;
261import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt;
262import ca.uhn.fhir.model.primitive.Base64BinaryDt;
263import ca.uhn.fhir.model.primitive.BooleanDt;
264import ca.uhn.fhir.model.primitive.BoundCodeDt;
265import ca.uhn.fhir.model.primitive.CodeDt;
266import ca.uhn.fhir.model.primitive.DateDt;
267import ca.uhn.fhir.model.primitive.DateTimeDt;
268import ca.uhn.fhir.model.primitive.DecimalDt;
269import ca.uhn.fhir.model.primitive.IdDt;
270import ca.uhn.fhir.model.primitive.InstantDt;
271import ca.uhn.fhir.model.primitive.IntegerDt;
272import ca.uhn.fhir.model.primitive.OidDt;
273import ca.uhn.fhir.model.primitive.PositiveIntDt;
274import ca.uhn.fhir.model.primitive.StringDt;
275import ca.uhn.fhir.model.primitive.TimeDt;
276import ca.uhn.fhir.model.primitive.UnsignedIntDt;
277import ca.uhn.fhir.model.primitive.UriDt;
278
279
280/**
281 * HAPI/FHIR <b>DiagnosticOrder</b> Resource
282 * (clinical.diagnostics)
283 *
284 * <p>
285 * <b>Definition:</b>
286 * A record of a request for a diagnostic investigation service to be performed.
287 * </p> 
288 *
289 * <p>
290 * <b>Requirements:</b>
291 * 
292 * </p> 
293 *
294 * <p>
295 * <b>Profile Definition:</b>
296 * <a href="http://hl7.org/fhir/profiles/DiagnosticOrder">http://hl7.org/fhir/profiles/DiagnosticOrder</a> 
297 * </p>
298 *
299 */
300@ResourceDef(name="DiagnosticOrder", profile="http://hl7.org/fhir/profiles/DiagnosticOrder", id="diagnosticorder")
301public class DiagnosticOrder extends ca.uhn.fhir.model.dstu2.resource.BaseResource
302    implements  IResource 
303    {
304
305        /**
306         * Search parameter constant for <b>actor</b>
307         * <p>
308         * Description: <b></b><br>
309         * Type: <b>reference</b><br>
310         * Path: <b>DiagnosticOrder.event.actor | DiagnosticOrder.item.event.actor</b><br>
311         * </p>
312         */
313        @SearchParamDefinition(name="actor", path="DiagnosticOrder.event.actor | DiagnosticOrder.item.event.actor", description="", type="reference" 
314, providesMembershipIn={
315 @Compartment(name="RelatedPerson") ,  @Compartment(name="Practitioner")        }
316 )
317        public static final String SP_ACTOR = "actor";
318
319        /**
320         * <b>Fluent Client</b> search parameter constant for <b>actor</b>
321         * <p>
322         * Description: <b></b><br>
323         * Type: <b>reference</b><br>
324         * Path: <b>DiagnosticOrder.event.actor | DiagnosticOrder.item.event.actor</b><br>
325         * </p>
326         */
327        public static final ReferenceClientParam ACTOR = new ReferenceClientParam(SP_ACTOR);
328
329        /**
330         * Search parameter constant for <b>bodysite</b>
331         * <p>
332         * Description: <b></b><br>
333         * Type: <b>token</b><br>
334         * Path: <b>DiagnosticOrder.item.bodySite</b><br>
335         * </p>
336         */
337        @SearchParamDefinition(name="bodysite", path="DiagnosticOrder.item.bodySite", description="", type="token" 
338 )
339        public static final String SP_BODYSITE = "bodysite";
340
341        /**
342         * <b>Fluent Client</b> search parameter constant for <b>bodysite</b>
343         * <p>
344         * Description: <b></b><br>
345         * Type: <b>token</b><br>
346         * Path: <b>DiagnosticOrder.item.bodySite</b><br>
347         * </p>
348         */
349        public static final TokenClientParam BODYSITE = new TokenClientParam(SP_BODYSITE);
350
351        /**
352         * Search parameter constant for <b>code</b>
353         * <p>
354         * Description: <b></b><br>
355         * Type: <b>token</b><br>
356         * Path: <b>DiagnosticOrder.item.code</b><br>
357         * </p>
358         */
359        @SearchParamDefinition(name="code", path="DiagnosticOrder.item.code", description="", type="token" 
360 )
361        public static final String SP_CODE = "code";
362
363        /**
364         * <b>Fluent Client</b> search parameter constant for <b>code</b>
365         * <p>
366         * Description: <b></b><br>
367         * Type: <b>token</b><br>
368         * Path: <b>DiagnosticOrder.item.code</b><br>
369         * </p>
370         */
371        public static final TokenClientParam CODE = new TokenClientParam(SP_CODE);
372
373        /**
374         * Search parameter constant for <b>event-date</b>
375         * <p>
376         * Description: <b></b><br>
377         * Type: <b>date</b><br>
378         * Path: <b>DiagnosticOrder.event.dateTime</b><br>
379         * </p>
380         */
381        @SearchParamDefinition(name="event-date", path="DiagnosticOrder.event.dateTime", description="", type="date" 
382 )
383        public static final String SP_EVENT_DATE = "event-date";
384
385        /**
386         * <b>Fluent Client</b> search parameter constant for <b>event-date</b>
387         * <p>
388         * Description: <b></b><br>
389         * Type: <b>date</b><br>
390         * Path: <b>DiagnosticOrder.event.dateTime</b><br>
391         * </p>
392         */
393        public static final DateClientParam EVENT_DATE = new DateClientParam(SP_EVENT_DATE);
394
395        /**
396         * Search parameter constant for <b>encounter</b>
397         * <p>
398         * Description: <b></b><br>
399         * Type: <b>reference</b><br>
400         * Path: <b>DiagnosticOrder.encounter</b><br>
401         * </p>
402         */
403        @SearchParamDefinition(name="encounter", path="DiagnosticOrder.encounter", description="", type="reference" 
404, providesMembershipIn={
405 @Compartment(name="Encounter")         }
406 )
407        public static final String SP_ENCOUNTER = "encounter";
408
409        /**
410         * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
411         * <p>
412         * Description: <b></b><br>
413         * Type: <b>reference</b><br>
414         * Path: <b>DiagnosticOrder.encounter</b><br>
415         * </p>
416         */
417        public static final ReferenceClientParam ENCOUNTER = new ReferenceClientParam(SP_ENCOUNTER);
418
419        /**
420         * Search parameter constant for <b>identifier</b>
421         * <p>
422         * Description: <b></b><br>
423         * Type: <b>token</b><br>
424         * Path: <b>DiagnosticOrder.identifier</b><br>
425         * </p>
426         */
427        @SearchParamDefinition(name="identifier", path="DiagnosticOrder.identifier", description="", type="token" 
428 )
429        public static final String SP_IDENTIFIER = "identifier";
430
431        /**
432         * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
433         * <p>
434         * Description: <b></b><br>
435         * Type: <b>token</b><br>
436         * Path: <b>DiagnosticOrder.identifier</b><br>
437         * </p>
438         */
439        public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
440
441        /**
442         * Search parameter constant for <b>item-date</b>
443         * <p>
444         * Description: <b></b><br>
445         * Type: <b>date</b><br>
446         * Path: <b>DiagnosticOrder.item.event.dateTime</b><br>
447         * </p>
448         */
449        @SearchParamDefinition(name="item-date", path="DiagnosticOrder.item.event.dateTime", description="", type="date" 
450 )
451        public static final String SP_ITEM_DATE = "item-date";
452
453        /**
454         * <b>Fluent Client</b> search parameter constant for <b>item-date</b>
455         * <p>
456         * Description: <b></b><br>
457         * Type: <b>date</b><br>
458         * Path: <b>DiagnosticOrder.item.event.dateTime</b><br>
459         * </p>
460         */
461        public static final DateClientParam ITEM_DATE = new DateClientParam(SP_ITEM_DATE);
462
463        /**
464         * Search parameter constant for <b>item-past-status</b>
465         * <p>
466         * Description: <b></b><br>
467         * Type: <b>token</b><br>
468         * Path: <b>DiagnosticOrder.item.event.status</b><br>
469         * </p>
470         */
471        @SearchParamDefinition(name="item-past-status", path="DiagnosticOrder.item.event.status", description="", type="token" 
472 )
473        public static final String SP_ITEM_PAST_STATUS = "item-past-status";
474
475        /**
476         * <b>Fluent Client</b> search parameter constant for <b>item-past-status</b>
477         * <p>
478         * Description: <b></b><br>
479         * Type: <b>token</b><br>
480         * Path: <b>DiagnosticOrder.item.event.status</b><br>
481         * </p>
482         */
483        public static final TokenClientParam ITEM_PAST_STATUS = new TokenClientParam(SP_ITEM_PAST_STATUS);
484
485        /**
486         * Search parameter constant for <b>item-status</b>
487         * <p>
488         * Description: <b></b><br>
489         * Type: <b>token</b><br>
490         * Path: <b>DiagnosticOrder.item.status</b><br>
491         * </p>
492         */
493        @SearchParamDefinition(name="item-status", path="DiagnosticOrder.item.status", description="", type="token" 
494 )
495        public static final String SP_ITEM_STATUS = "item-status";
496
497        /**
498         * <b>Fluent Client</b> search parameter constant for <b>item-status</b>
499         * <p>
500         * Description: <b></b><br>
501         * Type: <b>token</b><br>
502         * Path: <b>DiagnosticOrder.item.status</b><br>
503         * </p>
504         */
505        public static final TokenClientParam ITEM_STATUS = new TokenClientParam(SP_ITEM_STATUS);
506
507        /**
508         * Search parameter constant for <b>orderer</b>
509         * <p>
510         * Description: <b></b><br>
511         * Type: <b>reference</b><br>
512         * Path: <b>DiagnosticOrder.orderer</b><br>
513         * </p>
514         */
515        @SearchParamDefinition(name="orderer", path="DiagnosticOrder.orderer", description="", type="reference" 
516, providesMembershipIn={
517 @Compartment(name="RelatedPerson")     }
518 )
519        public static final String SP_ORDERER = "orderer";
520
521        /**
522         * <b>Fluent Client</b> search parameter constant for <b>orderer</b>
523         * <p>
524         * Description: <b></b><br>
525         * Type: <b>reference</b><br>
526         * Path: <b>DiagnosticOrder.orderer</b><br>
527         * </p>
528         */
529        public static final ReferenceClientParam ORDERER = new ReferenceClientParam(SP_ORDERER);
530
531        /**
532         * Search parameter constant for <b>event-status</b>
533         * <p>
534         * Description: <b></b><br>
535         * Type: <b>token</b><br>
536         * Path: <b>DiagnosticOrder.event.status</b><br>
537         * </p>
538         */
539        @SearchParamDefinition(name="event-status", path="DiagnosticOrder.event.status", description="", type="token" 
540 )
541        public static final String SP_EVENT_STATUS = "event-status";
542
543        /**
544         * <b>Fluent Client</b> search parameter constant for <b>event-status</b>
545         * <p>
546         * Description: <b></b><br>
547         * Type: <b>token</b><br>
548         * Path: <b>DiagnosticOrder.event.status</b><br>
549         * </p>
550         */
551        public static final TokenClientParam EVENT_STATUS = new TokenClientParam(SP_EVENT_STATUS);
552
553        /**
554         * Search parameter constant for <b>specimen</b>
555         * <p>
556         * Description: <b></b><br>
557         * Type: <b>reference</b><br>
558         * Path: <b>DiagnosticOrder.specimen | DiagnosticOrder.item.specimen</b><br>
559         * </p>
560         */
561        @SearchParamDefinition(name="specimen", path="DiagnosticOrder.specimen | DiagnosticOrder.item.specimen", description="", type="reference" 
562 )
563        public static final String SP_SPECIMEN = "specimen";
564
565        /**
566         * <b>Fluent Client</b> search parameter constant for <b>specimen</b>
567         * <p>
568         * Description: <b></b><br>
569         * Type: <b>reference</b><br>
570         * Path: <b>DiagnosticOrder.specimen | DiagnosticOrder.item.specimen</b><br>
571         * </p>
572         */
573        public static final ReferenceClientParam SPECIMEN = new ReferenceClientParam(SP_SPECIMEN);
574
575        /**
576         * Search parameter constant for <b>status</b>
577         * <p>
578         * Description: <b></b><br>
579         * Type: <b>token</b><br>
580         * Path: <b>DiagnosticOrder.status</b><br>
581         * </p>
582         */
583        @SearchParamDefinition(name="status", path="DiagnosticOrder.status", description="", type="token" 
584 )
585        public static final String SP_STATUS = "status";
586
587        /**
588         * <b>Fluent Client</b> search parameter constant for <b>status</b>
589         * <p>
590         * Description: <b></b><br>
591         * Type: <b>token</b><br>
592         * Path: <b>DiagnosticOrder.status</b><br>
593         * </p>
594         */
595        public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS);
596
597        /**
598         * Search parameter constant for <b>subject</b>
599         * <p>
600         * Description: <b></b><br>
601         * Type: <b>reference</b><br>
602         * Path: <b>DiagnosticOrder.subject</b><br>
603         * </p>
604         */
605        @SearchParamDefinition(name="subject", path="DiagnosticOrder.subject", description="", type="reference" 
606, providesMembershipIn={
607 @Compartment(name="Patient") ,  @Compartment(name="Practitioner")      }
608 )
609        public static final String SP_SUBJECT = "subject";
610
611        /**
612         * <b>Fluent Client</b> search parameter constant for <b>subject</b>
613         * <p>
614         * Description: <b></b><br>
615         * Type: <b>reference</b><br>
616         * Path: <b>DiagnosticOrder.subject</b><br>
617         * </p>
618         */
619        public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT);
620
621        /**
622         * Search parameter constant for <b>patient</b>
623         * <p>
624         * Description: <b></b><br>
625         * Type: <b>reference</b><br>
626         * Path: <b>DiagnosticOrder.subject</b><br>
627         * </p>
628         */
629        @SearchParamDefinition(name="patient", path="DiagnosticOrder.subject", description="", type="reference" 
630, target={
631 ca.uhn.fhir.model.dstu2.resource.Patient.class         }
632 )
633        public static final String SP_PATIENT = "patient";
634
635        /**
636         * <b>Fluent Client</b> search parameter constant for <b>patient</b>
637         * <p>
638         * Description: <b></b><br>
639         * Type: <b>reference</b><br>
640         * Path: <b>DiagnosticOrder.subject</b><br>
641         * </p>
642         */
643        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
644
645        /**
646         * Search parameter constant for <b>item-past-status-item-date</b>
647         * <p>
648         * Description: <b>A combination of item-past-status and item-date</b><br>
649         * Type: <b>composite</b><br>
650         * Path: <b>item-past-status &amp; item-date</b><br>
651         * </p>
652         */
653        @SearchParamDefinition(name="item-past-status-item-date", path="item-past-status & item-date", description="A combination of item-past-status and item-date", type="composite"  , compositeOf={  "item-past-status",  "item-date" } 
654 )
655        public static final String SP_ITEM_PAST_STATUS_ITEM_DATE = "item-past-status-item-date";
656
657        /**
658         * <b>Fluent Client</b> search parameter constant for <b>item-past-status-item-date</b>
659         * <p>
660         * Description: <b>A combination of item-past-status and item-date</b><br>
661         * Type: <b>composite</b><br>
662         * Path: <b>item-past-status &amp; item-date</b><br>
663         * </p>
664         */
665        public static final CompositeClientParam<TokenClientParam, DateClientParam> ITEM_PAST_STATUS_ITEM_DATE = new CompositeClientParam<TokenClientParam, DateClientParam>(SP_ITEM_PAST_STATUS_ITEM_DATE);
666
667        /**
668         * Search parameter constant for <b>event-status-event-date</b>
669         * <p>
670         * Description: <b>A combination of past-status and date</b><br>
671         * Type: <b>composite</b><br>
672         * Path: <b>event-status &amp; event-date</b><br>
673         * </p>
674         */
675        @SearchParamDefinition(name="event-status-event-date", path="event-status & event-date", description="A combination of past-status and date", type="composite"  , compositeOf={  "event-status",  "event-date" } 
676 )
677        public static final String SP_EVENT_STATUS_EVENT_DATE = "event-status-event-date";
678
679        /**
680         * <b>Fluent Client</b> search parameter constant for <b>event-status-event-date</b>
681         * <p>
682         * Description: <b>A combination of past-status and date</b><br>
683         * Type: <b>composite</b><br>
684         * Path: <b>event-status &amp; event-date</b><br>
685         * </p>
686         */
687        public static final CompositeClientParam<TokenClientParam, DateClientParam> EVENT_STATUS_EVENT_DATE = new CompositeClientParam<TokenClientParam, DateClientParam>(SP_EVENT_STATUS_EVENT_DATE);
688
689
690        /**
691         * Constant for fluent queries to be used to add include statements. Specifies
692         * the path value of "<b>DiagnosticOrder:actor</b>".
693         */
694        public static final Include INCLUDE_ACTOR = new Include("DiagnosticOrder:actor");
695
696        /**
697         * Constant for fluent queries to be used to add include statements. Specifies
698         * the path value of "<b>DiagnosticOrder:encounter</b>".
699         */
700        public static final Include INCLUDE_ENCOUNTER = new Include("DiagnosticOrder:encounter");
701
702        /**
703         * Constant for fluent queries to be used to add include statements. Specifies
704         * the path value of "<b>DiagnosticOrder:orderer</b>".
705         */
706        public static final Include INCLUDE_ORDERER = new Include("DiagnosticOrder:orderer");
707
708        /**
709         * Constant for fluent queries to be used to add include statements. Specifies
710         * the path value of "<b>DiagnosticOrder:patient</b>".
711         */
712        public static final Include INCLUDE_PATIENT = new Include("DiagnosticOrder:patient");
713
714        /**
715         * Constant for fluent queries to be used to add include statements. Specifies
716         * the path value of "<b>DiagnosticOrder:specimen</b>".
717         */
718        public static final Include INCLUDE_SPECIMEN = new Include("DiagnosticOrder:specimen");
719
720        /**
721         * Constant for fluent queries to be used to add include statements. Specifies
722         * the path value of "<b>DiagnosticOrder:subject</b>".
723         */
724        public static final Include INCLUDE_SUBJECT = new Include("DiagnosticOrder:subject");
725
726
727        @Child(name="subject", order=0, min=1, max=1, summary=true, modifier=false, type={
728                ca.uhn.fhir.model.dstu2.resource.Patient.class, 
729                ca.uhn.fhir.model.dstu2.resource.Group.class, 
730                ca.uhn.fhir.model.dstu2.resource.Location.class, 
731                ca.uhn.fhir.model.dstu2.resource.Device.class
732        })
733        @Description(
734                shortDefinition="who.focus",
735                formalDefinition="Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans)"
736        )
737        private ResourceReferenceDt mySubject;
738        
739        @Child(name="orderer", order=1, min=0, max=1, summary=true, modifier=false, type={
740                ca.uhn.fhir.model.dstu2.resource.Practitioner.class
741        })
742        @Description(
743                shortDefinition="who.actor",
744                formalDefinition="The practitioner that holds legal responsibility for ordering the investigation"
745        )
746        private ResourceReferenceDt myOrderer;
747        
748        @Child(name="identifier", type=IdentifierDt.class, order=2, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)       
749        @Description(
750                shortDefinition="id",
751                formalDefinition="Identifiers assigned to this order instance by the orderer and/or  the receiver and/or order fulfiller."
752        )
753        private java.util.List<IdentifierDt> myIdentifier;
754        
755        @Child(name="encounter", order=3, min=0, max=1, summary=true, modifier=false, type={
756                ca.uhn.fhir.model.dstu2.resource.Encounter.class
757        })
758        @Description(
759                shortDefinition="context",
760                formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made"
761        )
762        private ResourceReferenceDt myEncounter;
763        
764        @Child(name="reason", type=CodeableConceptDt.class, order=4, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)     
765        @Description(
766                shortDefinition="",
767                formalDefinition="An explanation or justification for why this diagnostic investigation is being requested.   This is often for billing purposes.  May relate to the resources referred to in supportingInformation."
768        )
769        private java.util.List<CodeableConceptDt> myReason;
770        
771        @Child(name="supportingInformation", order=5, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
772                ca.uhn.fhir.model.dstu2.resource.Observation.class, 
773                ca.uhn.fhir.model.dstu2.resource.Condition.class, 
774                ca.uhn.fhir.model.dstu2.resource.DocumentReference.class
775        })
776        @Description(
777                shortDefinition="",
778                formalDefinition="Additional clinical information about the patient or specimen that may influence test interpretations.  This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order."
779        )
780        private java.util.List<ResourceReferenceDt> mySupportingInformation;
781        
782        @Child(name="specimen", order=6, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
783                ca.uhn.fhir.model.dstu2.resource.Specimen.class
784        })
785        @Description(
786                shortDefinition="",
787                formalDefinition="One or more specimens that the diagnostic investigation is about"
788        )
789        private java.util.List<ResourceReferenceDt> mySpecimen;
790        
791        @Child(name="status", type=CodeDt.class, order=7, min=0, max=1, summary=true, modifier=true)    
792        @Description(
793                shortDefinition="status",
794                formalDefinition="The status of the order"
795        )
796        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/diagnostic-order-status")
797        private BoundCodeDt<DiagnosticOrderStatusEnum> myStatus;
798        
799        @Child(name="priority", type=CodeDt.class, order=8, min=0, max=1, summary=true, modifier=false) 
800        @Description(
801                shortDefinition="grade",
802                formalDefinition="The clinical priority associated with this order"
803        )
804        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/diagnostic-order-priority")
805        private BoundCodeDt<DiagnosticOrderPriorityEnum> myPriority;
806        
807        @Child(name="event", order=9, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)    
808        @Description(
809                shortDefinition="",
810                formalDefinition="A summary of the events of interest that have occurred as the request is processed; e.g. when the order was made, various processing steps (specimens received), when it was completed"
811        )
812        private java.util.List<Event> myEvent;
813        
814        @Child(name="item", order=10, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)    
815        @Description(
816                shortDefinition="",
817                formalDefinition="The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested"
818        )
819        private java.util.List<Item> myItem;
820        
821        @Child(name="note", type=AnnotationDt.class, order=11, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)   
822        @Description(
823                shortDefinition="",
824                formalDefinition="Any other notes associated with this patient, specimen or order (e.g. \"patient hates needles\")"
825        )
826        private java.util.List<AnnotationDt> myNote;
827        
828
829        @Override
830        public boolean isEmpty() {
831                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  mySubject,  myOrderer,  myIdentifier,  myEncounter,  myReason,  mySupportingInformation,  mySpecimen,  myStatus,  myPriority,  myEvent,  myItem,  myNote);
832        }
833        
834        @Override
835        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
836                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySubject, myOrderer, myIdentifier, myEncounter, myReason, mySupportingInformation, mySpecimen, myStatus, myPriority, myEvent, myItem, myNote);
837        }
838
839        /**
840         * Gets the value(s) for <b>subject</b> (who.focus).
841         * creating it if it does
842         * not exist. Will not return <code>null</code>.
843         *
844     * <p>
845     * <b>Definition:</b>
846     * Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans)
847     * </p> 
848         */
849        public ResourceReferenceDt getSubject() {  
850                if (mySubject == null) {
851                        mySubject = new ResourceReferenceDt();
852                }
853                return mySubject;
854        }
855
856        /**
857         * Sets the value(s) for <b>subject</b> (who.focus)
858         *
859     * <p>
860     * <b>Definition:</b>
861     * Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans)
862     * </p> 
863         */
864        public DiagnosticOrder setSubject(ResourceReferenceDt theValue) {
865                mySubject = theValue;
866                return this;
867        }
868        
869        
870
871  
872        /**
873         * Gets the value(s) for <b>orderer</b> (who.actor).
874         * creating it if it does
875         * not exist. Will not return <code>null</code>.
876         *
877     * <p>
878     * <b>Definition:</b>
879     * The practitioner that holds legal responsibility for ordering the investigation
880     * </p> 
881         */
882        public ResourceReferenceDt getOrderer() {  
883                if (myOrderer == null) {
884                        myOrderer = new ResourceReferenceDt();
885                }
886                return myOrderer;
887        }
888
889        /**
890         * Sets the value(s) for <b>orderer</b> (who.actor)
891         *
892     * <p>
893     * <b>Definition:</b>
894     * The practitioner that holds legal responsibility for ordering the investigation
895     * </p> 
896         */
897        public DiagnosticOrder setOrderer(ResourceReferenceDt theValue) {
898                myOrderer = theValue;
899                return this;
900        }
901        
902        
903
904  
905        /**
906         * Gets the value(s) for <b>identifier</b> (id).
907         * creating it if it does
908         * not exist. Will not return <code>null</code>.
909         *
910     * <p>
911     * <b>Definition:</b>
912     * Identifiers assigned to this order instance by the orderer and/or  the receiver and/or order fulfiller.
913     * </p> 
914         */
915        public java.util.List<IdentifierDt> getIdentifier() {  
916                if (myIdentifier == null) {
917                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
918                }
919                return myIdentifier;
920        }
921
922        /**
923         * Sets the value(s) for <b>identifier</b> (id)
924         *
925     * <p>
926     * <b>Definition:</b>
927     * Identifiers assigned to this order instance by the orderer and/or  the receiver and/or order fulfiller.
928     * </p> 
929         */
930        public DiagnosticOrder setIdentifier(java.util.List<IdentifierDt> theValue) {
931                myIdentifier = theValue;
932                return this;
933        }
934        
935        
936
937        /**
938         * Adds and returns a new value for <b>identifier</b> (id)
939         *
940     * <p>
941     * <b>Definition:</b>
942     * Identifiers assigned to this order instance by the orderer and/or  the receiver and/or order fulfiller.
943     * </p> 
944         */
945        public IdentifierDt addIdentifier() {
946                IdentifierDt newType = new IdentifierDt();
947                getIdentifier().add(newType);
948                return newType; 
949        }
950
951        /**
952         * Adds a given new value for <b>identifier</b> (id)
953         *
954         * <p>
955         * <b>Definition:</b>
956         * Identifiers assigned to this order instance by the orderer and/or  the receiver and/or order fulfiller.
957         * </p>
958         * @param theValue The identifier to add (must not be <code>null</code>)
959         */
960        public DiagnosticOrder addIdentifier(IdentifierDt theValue) {
961                if (theValue == null) {
962                        throw new NullPointerException("theValue must not be null");
963                }
964                getIdentifier().add(theValue);
965                return this;
966        }
967
968        /**
969         * Gets the first repetition for <b>identifier</b> (id),
970         * creating it if it does not already exist.
971         *
972     * <p>
973     * <b>Definition:</b>
974     * Identifiers assigned to this order instance by the orderer and/or  the receiver and/or order fulfiller.
975     * </p> 
976         */
977        public IdentifierDt getIdentifierFirstRep() {
978                if (getIdentifier().isEmpty()) {
979                        return addIdentifier();
980                }
981                return getIdentifier().get(0); 
982        }
983  
984        /**
985         * Gets the value(s) for <b>encounter</b> (context).
986         * creating it if it does
987         * not exist. Will not return <code>null</code>.
988         *
989     * <p>
990     * <b>Definition:</b>
991     * An encounter that provides additional information about the healthcare context in which this request is made
992     * </p> 
993         */
994        public ResourceReferenceDt getEncounter() {  
995                if (myEncounter == null) {
996                        myEncounter = new ResourceReferenceDt();
997                }
998                return myEncounter;
999        }
1000
1001        /**
1002         * Sets the value(s) for <b>encounter</b> (context)
1003         *
1004     * <p>
1005     * <b>Definition:</b>
1006     * An encounter that provides additional information about the healthcare context in which this request is made
1007     * </p> 
1008         */
1009        public DiagnosticOrder setEncounter(ResourceReferenceDt theValue) {
1010                myEncounter = theValue;
1011                return this;
1012        }
1013        
1014        
1015
1016  
1017        /**
1018         * Gets the value(s) for <b>reason</b> ().
1019         * creating it if it does
1020         * not exist. Will not return <code>null</code>.
1021         *
1022     * <p>
1023     * <b>Definition:</b>
1024     * An explanation or justification for why this diagnostic investigation is being requested.   This is often for billing purposes.  May relate to the resources referred to in supportingInformation.
1025     * </p> 
1026         */
1027        public java.util.List<CodeableConceptDt> getReason() {  
1028                if (myReason == null) {
1029                        myReason = new java.util.ArrayList<CodeableConceptDt>();
1030                }
1031                return myReason;
1032        }
1033
1034        /**
1035         * Sets the value(s) for <b>reason</b> ()
1036         *
1037     * <p>
1038     * <b>Definition:</b>
1039     * An explanation or justification for why this diagnostic investigation is being requested.   This is often for billing purposes.  May relate to the resources referred to in supportingInformation.
1040     * </p> 
1041         */
1042        public DiagnosticOrder setReason(java.util.List<CodeableConceptDt> theValue) {
1043                myReason = theValue;
1044                return this;
1045        }
1046        
1047        
1048
1049        /**
1050         * Adds and returns a new value for <b>reason</b> ()
1051         *
1052     * <p>
1053     * <b>Definition:</b>
1054     * An explanation or justification for why this diagnostic investigation is being requested.   This is often for billing purposes.  May relate to the resources referred to in supportingInformation.
1055     * </p> 
1056         */
1057        public CodeableConceptDt addReason() {
1058                CodeableConceptDt newType = new CodeableConceptDt();
1059                getReason().add(newType);
1060                return newType; 
1061        }
1062
1063        /**
1064         * Adds a given new value for <b>reason</b> ()
1065         *
1066         * <p>
1067         * <b>Definition:</b>
1068         * An explanation or justification for why this diagnostic investigation is being requested.   This is often for billing purposes.  May relate to the resources referred to in supportingInformation.
1069         * </p>
1070         * @param theValue The reason to add (must not be <code>null</code>)
1071         */
1072        public DiagnosticOrder addReason(CodeableConceptDt theValue) {
1073                if (theValue == null) {
1074                        throw new NullPointerException("theValue must not be null");
1075                }
1076                getReason().add(theValue);
1077                return this;
1078        }
1079
1080        /**
1081         * Gets the first repetition for <b>reason</b> (),
1082         * creating it if it does not already exist.
1083         *
1084     * <p>
1085     * <b>Definition:</b>
1086     * An explanation or justification for why this diagnostic investigation is being requested.   This is often for billing purposes.  May relate to the resources referred to in supportingInformation.
1087     * </p> 
1088         */
1089        public CodeableConceptDt getReasonFirstRep() {
1090                if (getReason().isEmpty()) {
1091                        return addReason();
1092                }
1093                return getReason().get(0); 
1094        }
1095  
1096        /**
1097         * Gets the value(s) for <b>supportingInformation</b> ().
1098         * creating it if it does
1099         * not exist. Will not return <code>null</code>.
1100         *
1101     * <p>
1102     * <b>Definition:</b>
1103     * Additional clinical information about the patient or specimen that may influence test interpretations.  This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.
1104     * </p> 
1105         */
1106        public java.util.List<ResourceReferenceDt> getSupportingInformation() {  
1107                if (mySupportingInformation == null) {
1108                        mySupportingInformation = new java.util.ArrayList<ResourceReferenceDt>();
1109                }
1110                return mySupportingInformation;
1111        }
1112
1113        /**
1114         * Sets the value(s) for <b>supportingInformation</b> ()
1115         *
1116     * <p>
1117     * <b>Definition:</b>
1118     * Additional clinical information about the patient or specimen that may influence test interpretations.  This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.
1119     * </p> 
1120         */
1121        public DiagnosticOrder setSupportingInformation(java.util.List<ResourceReferenceDt> theValue) {
1122                mySupportingInformation = theValue;
1123                return this;
1124        }
1125        
1126        
1127
1128        /**
1129         * Adds and returns a new value for <b>supportingInformation</b> ()
1130         *
1131     * <p>
1132     * <b>Definition:</b>
1133     * Additional clinical information about the patient or specimen that may influence test interpretations.  This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.
1134     * </p> 
1135         */
1136        public ResourceReferenceDt addSupportingInformation() {
1137                ResourceReferenceDt newType = new ResourceReferenceDt();
1138                getSupportingInformation().add(newType);
1139                return newType; 
1140        }
1141  
1142        /**
1143         * Gets the value(s) for <b>specimen</b> ().
1144         * creating it if it does
1145         * not exist. Will not return <code>null</code>.
1146         *
1147     * <p>
1148     * <b>Definition:</b>
1149     * One or more specimens that the diagnostic investigation is about
1150     * </p> 
1151         */
1152        public java.util.List<ResourceReferenceDt> getSpecimen() {  
1153                if (mySpecimen == null) {
1154                        mySpecimen = new java.util.ArrayList<ResourceReferenceDt>();
1155                }
1156                return mySpecimen;
1157        }
1158
1159        /**
1160         * Sets the value(s) for <b>specimen</b> ()
1161         *
1162     * <p>
1163     * <b>Definition:</b>
1164     * One or more specimens that the diagnostic investigation is about
1165     * </p> 
1166         */
1167        public DiagnosticOrder setSpecimen(java.util.List<ResourceReferenceDt> theValue) {
1168                mySpecimen = theValue;
1169                return this;
1170        }
1171        
1172        
1173
1174        /**
1175         * Adds and returns a new value for <b>specimen</b> ()
1176         *
1177     * <p>
1178     * <b>Definition:</b>
1179     * One or more specimens that the diagnostic investigation is about
1180     * </p> 
1181         */
1182        public ResourceReferenceDt addSpecimen() {
1183                ResourceReferenceDt newType = new ResourceReferenceDt();
1184                getSpecimen().add(newType);
1185                return newType; 
1186        }
1187  
1188        /**
1189         * Gets the value(s) for <b>status</b> (status).
1190         * creating it if it does
1191         * not exist. Will not return <code>null</code>.
1192         *
1193     * <p>
1194     * <b>Definition:</b>
1195     * The status of the order
1196     * </p> 
1197         */
1198        public BoundCodeDt<DiagnosticOrderStatusEnum> getStatusElement() {  
1199                if (myStatus == null) {
1200                        myStatus = new BoundCodeDt<DiagnosticOrderStatusEnum>(DiagnosticOrderStatusEnum.VALUESET_BINDER);
1201                }
1202                return myStatus;
1203        }
1204
1205        
1206        /**
1207         * Gets the value(s) for <b>status</b> (status).
1208         * creating it if it does
1209         * not exist. This method may return <code>null</code>.
1210         *
1211     * <p>
1212     * <b>Definition:</b>
1213     * The status of the order
1214     * </p> 
1215         */
1216        public String getStatus() {  
1217                return getStatusElement().getValue();
1218        }
1219
1220        /**
1221         * Sets the value(s) for <b>status</b> (status)
1222         *
1223     * <p>
1224     * <b>Definition:</b>
1225     * The status of the order
1226     * </p> 
1227         */
1228        public DiagnosticOrder setStatus(BoundCodeDt<DiagnosticOrderStatusEnum> theValue) {
1229                myStatus = theValue;
1230                return this;
1231        }
1232        
1233        
1234
1235        /**
1236         * Sets the value(s) for <b>status</b> (status)
1237         *
1238     * <p>
1239     * <b>Definition:</b>
1240     * The status of the order
1241     * </p> 
1242         */
1243        public DiagnosticOrder setStatus(DiagnosticOrderStatusEnum theValue) {
1244                setStatus(new BoundCodeDt<DiagnosticOrderStatusEnum>(DiagnosticOrderStatusEnum.VALUESET_BINDER, theValue));
1245                
1246/*
1247                getStatusElement().setValueAsEnum(theValue);
1248*/
1249                return this;
1250        }
1251
1252  
1253        /**
1254         * Gets the value(s) for <b>priority</b> (grade).
1255         * creating it if it does
1256         * not exist. Will not return <code>null</code>.
1257         *
1258     * <p>
1259     * <b>Definition:</b>
1260     * The clinical priority associated with this order
1261     * </p> 
1262         */
1263        public BoundCodeDt<DiagnosticOrderPriorityEnum> getPriorityElement() {  
1264                if (myPriority == null) {
1265                        myPriority = new BoundCodeDt<DiagnosticOrderPriorityEnum>(DiagnosticOrderPriorityEnum.VALUESET_BINDER);
1266                }
1267                return myPriority;
1268        }
1269
1270        
1271        /**
1272         * Gets the value(s) for <b>priority</b> (grade).
1273         * creating it if it does
1274         * not exist. This method may return <code>null</code>.
1275         *
1276     * <p>
1277     * <b>Definition:</b>
1278     * The clinical priority associated with this order
1279     * </p> 
1280         */
1281        public String getPriority() {  
1282                return getPriorityElement().getValue();
1283        }
1284
1285        /**
1286         * Sets the value(s) for <b>priority</b> (grade)
1287         *
1288     * <p>
1289     * <b>Definition:</b>
1290     * The clinical priority associated with this order
1291     * </p> 
1292         */
1293        public DiagnosticOrder setPriority(BoundCodeDt<DiagnosticOrderPriorityEnum> theValue) {
1294                myPriority = theValue;
1295                return this;
1296        }
1297        
1298        
1299
1300        /**
1301         * Sets the value(s) for <b>priority</b> (grade)
1302         *
1303     * <p>
1304     * <b>Definition:</b>
1305     * The clinical priority associated with this order
1306     * </p> 
1307         */
1308        public DiagnosticOrder setPriority(DiagnosticOrderPriorityEnum theValue) {
1309                setPriority(new BoundCodeDt<DiagnosticOrderPriorityEnum>(DiagnosticOrderPriorityEnum.VALUESET_BINDER, theValue));
1310                
1311/*
1312                getPriorityElement().setValueAsEnum(theValue);
1313*/
1314                return this;
1315        }
1316
1317  
1318        /**
1319         * Gets the value(s) for <b>event</b> ().
1320         * creating it if it does
1321         * not exist. Will not return <code>null</code>.
1322         *
1323     * <p>
1324     * <b>Definition:</b>
1325     * A summary of the events of interest that have occurred as the request is processed; e.g. when the order was made, various processing steps (specimens received), when it was completed
1326     * </p> 
1327         */
1328        public java.util.List<Event> getEvent() {  
1329                if (myEvent == null) {
1330                        myEvent = new java.util.ArrayList<Event>();
1331                }
1332                return myEvent;
1333        }
1334
1335        /**
1336         * Sets the value(s) for <b>event</b> ()
1337         *
1338     * <p>
1339     * <b>Definition:</b>
1340     * A summary of the events of interest that have occurred as the request is processed; e.g. when the order was made, various processing steps (specimens received), when it was completed
1341     * </p> 
1342         */
1343        public DiagnosticOrder setEvent(java.util.List<Event> theValue) {
1344                myEvent = theValue;
1345                return this;
1346        }
1347        
1348        
1349
1350        /**
1351         * Adds and returns a new value for <b>event</b> ()
1352         *
1353     * <p>
1354     * <b>Definition:</b>
1355     * A summary of the events of interest that have occurred as the request is processed; e.g. when the order was made, various processing steps (specimens received), when it was completed
1356     * </p> 
1357         */
1358        public Event addEvent() {
1359                Event newType = new Event();
1360                getEvent().add(newType);
1361                return newType; 
1362        }
1363
1364        /**
1365         * Adds a given new value for <b>event</b> ()
1366         *
1367         * <p>
1368         * <b>Definition:</b>
1369         * A summary of the events of interest that have occurred as the request is processed; e.g. when the order was made, various processing steps (specimens received), when it was completed
1370         * </p>
1371         * @param theValue The event to add (must not be <code>null</code>)
1372         */
1373        public DiagnosticOrder addEvent(Event theValue) {
1374                if (theValue == null) {
1375                        throw new NullPointerException("theValue must not be null");
1376                }
1377                getEvent().add(theValue);
1378                return this;
1379        }
1380
1381        /**
1382         * Gets the first repetition for <b>event</b> (),
1383         * creating it if it does not already exist.
1384         *
1385     * <p>
1386     * <b>Definition:</b>
1387     * A summary of the events of interest that have occurred as the request is processed; e.g. when the order was made, various processing steps (specimens received), when it was completed
1388     * </p> 
1389         */
1390        public Event getEventFirstRep() {
1391                if (getEvent().isEmpty()) {
1392                        return addEvent();
1393                }
1394                return getEvent().get(0); 
1395        }
1396  
1397        /**
1398         * Gets the value(s) for <b>item</b> ().
1399         * creating it if it does
1400         * not exist. Will not return <code>null</code>.
1401         *
1402     * <p>
1403     * <b>Definition:</b>
1404     * The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested
1405     * </p> 
1406         */
1407        public java.util.List<Item> getItem() {  
1408                if (myItem == null) {
1409                        myItem = new java.util.ArrayList<Item>();
1410                }
1411                return myItem;
1412        }
1413
1414        /**
1415         * Sets the value(s) for <b>item</b> ()
1416         *
1417     * <p>
1418     * <b>Definition:</b>
1419     * The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested
1420     * </p> 
1421         */
1422        public DiagnosticOrder setItem(java.util.List<Item> theValue) {
1423                myItem = theValue;
1424                return this;
1425        }
1426        
1427        
1428
1429        /**
1430         * Adds and returns a new value for <b>item</b> ()
1431         *
1432     * <p>
1433     * <b>Definition:</b>
1434     * The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested
1435     * </p> 
1436         */
1437        public Item addItem() {
1438                Item newType = new Item();
1439                getItem().add(newType);
1440                return newType; 
1441        }
1442
1443        /**
1444         * Adds a given new value for <b>item</b> ()
1445         *
1446         * <p>
1447         * <b>Definition:</b>
1448         * The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested
1449         * </p>
1450         * @param theValue The item to add (must not be <code>null</code>)
1451         */
1452        public DiagnosticOrder addItem(Item theValue) {
1453                if (theValue == null) {
1454                        throw new NullPointerException("theValue must not be null");
1455                }
1456                getItem().add(theValue);
1457                return this;
1458        }
1459
1460        /**
1461         * Gets the first repetition for <b>item</b> (),
1462         * creating it if it does not already exist.
1463         *
1464     * <p>
1465     * <b>Definition:</b>
1466     * The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested
1467     * </p> 
1468         */
1469        public Item getItemFirstRep() {
1470                if (getItem().isEmpty()) {
1471                        return addItem();
1472                }
1473                return getItem().get(0); 
1474        }
1475  
1476        /**
1477         * Gets the value(s) for <b>note</b> ().
1478         * creating it if it does
1479         * not exist. Will not return <code>null</code>.
1480         *
1481     * <p>
1482     * <b>Definition:</b>
1483     * Any other notes associated with this patient, specimen or order (e.g. \&quot;patient hates needles\&quot;)
1484     * </p> 
1485         */
1486        public java.util.List<AnnotationDt> getNote() {  
1487                if (myNote == null) {
1488                        myNote = new java.util.ArrayList<AnnotationDt>();
1489                }
1490                return myNote;
1491        }
1492
1493        /**
1494         * Sets the value(s) for <b>note</b> ()
1495         *
1496     * <p>
1497     * <b>Definition:</b>
1498     * Any other notes associated with this patient, specimen or order (e.g. \&quot;patient hates needles\&quot;)
1499     * </p> 
1500         */
1501        public DiagnosticOrder setNote(java.util.List<AnnotationDt> theValue) {
1502                myNote = theValue;
1503                return this;
1504        }
1505        
1506        
1507
1508        /**
1509         * Adds and returns a new value for <b>note</b> ()
1510         *
1511     * <p>
1512     * <b>Definition:</b>
1513     * Any other notes associated with this patient, specimen or order (e.g. \&quot;patient hates needles\&quot;)
1514     * </p> 
1515         */
1516        public AnnotationDt addNote() {
1517                AnnotationDt newType = new AnnotationDt();
1518                getNote().add(newType);
1519                return newType; 
1520        }
1521
1522        /**
1523         * Adds a given new value for <b>note</b> ()
1524         *
1525         * <p>
1526         * <b>Definition:</b>
1527         * Any other notes associated with this patient, specimen or order (e.g. \&quot;patient hates needles\&quot;)
1528         * </p>
1529         * @param theValue The note to add (must not be <code>null</code>)
1530         */
1531        public DiagnosticOrder addNote(AnnotationDt theValue) {
1532                if (theValue == null) {
1533                        throw new NullPointerException("theValue must not be null");
1534                }
1535                getNote().add(theValue);
1536                return this;
1537        }
1538
1539        /**
1540         * Gets the first repetition for <b>note</b> (),
1541         * creating it if it does not already exist.
1542         *
1543     * <p>
1544     * <b>Definition:</b>
1545     * Any other notes associated with this patient, specimen or order (e.g. \&quot;patient hates needles\&quot;)
1546     * </p> 
1547         */
1548        public AnnotationDt getNoteFirstRep() {
1549                if (getNote().isEmpty()) {
1550                        return addNote();
1551                }
1552                return getNote().get(0); 
1553        }
1554  
1555        /**
1556         * Block class for child element: <b>DiagnosticOrder.event</b> ()
1557         *
1558     * <p>
1559     * <b>Definition:</b>
1560     * A summary of the events of interest that have occurred as the request is processed; e.g. when the order was made, various processing steps (specimens received), when it was completed
1561     * </p> 
1562         */
1563        @Block()        
1564        public static class Event 
1565            extends  BaseIdentifiableElement  
1566            implements IResourceBlock {
1567        
1568        @Child(name="status", type=CodeDt.class, order=0, min=1, max=1, summary=true, modifier=false)   
1569        @Description(
1570                shortDefinition="",
1571                formalDefinition="The status for the event"
1572        )
1573        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/diagnostic-order-status")
1574        private BoundCodeDt<DiagnosticOrderStatusEnum> myStatus;
1575        
1576        @Child(name="description", type=CodeableConceptDt.class, order=1, min=0, max=1, summary=true, modifier=false)   
1577        @Description(
1578                shortDefinition="",
1579                formalDefinition="Additional information about the event that occurred - e.g. if the status remained unchanged"
1580        )
1581        private CodeableConceptDt myDescription;
1582        
1583        @Child(name="dateTime", type=DateTimeDt.class, order=2, min=1, max=1, summary=true, modifier=false)     
1584        @Description(
1585                shortDefinition="",
1586                formalDefinition="The date/time at which the event occurred"
1587        )
1588        private DateTimeDt myDateTime;
1589        
1590        @Child(name="actor", order=3, min=0, max=1, summary=false, modifier=false, type={
1591                ca.uhn.fhir.model.dstu2.resource.Practitioner.class, 
1592                ca.uhn.fhir.model.dstu2.resource.Device.class
1593        })
1594        @Description(
1595                shortDefinition="",
1596                formalDefinition="The person responsible for performing or recording the action"
1597        )
1598        private ResourceReferenceDt myActor;
1599        
1600
1601        @Override
1602        public boolean isEmpty() {
1603                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myStatus,  myDescription,  myDateTime,  myActor);
1604        }
1605        
1606        @Override
1607        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1608                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myStatus, myDescription, myDateTime, myActor);
1609        }
1610
1611        /**
1612         * Gets the value(s) for <b>status</b> ().
1613         * creating it if it does
1614         * not exist. Will not return <code>null</code>.
1615         *
1616     * <p>
1617     * <b>Definition:</b>
1618     * The status for the event
1619     * </p> 
1620         */
1621        public BoundCodeDt<DiagnosticOrderStatusEnum> getStatusElement() {  
1622                if (myStatus == null) {
1623                        myStatus = new BoundCodeDt<DiagnosticOrderStatusEnum>(DiagnosticOrderStatusEnum.VALUESET_BINDER);
1624                }
1625                return myStatus;
1626        }
1627
1628        
1629        /**
1630         * Gets the value(s) for <b>status</b> ().
1631         * creating it if it does
1632         * not exist. This method may return <code>null</code>.
1633         *
1634     * <p>
1635     * <b>Definition:</b>
1636     * The status for the event
1637     * </p> 
1638         */
1639        public String getStatus() {  
1640                return getStatusElement().getValue();
1641        }
1642
1643        /**
1644         * Sets the value(s) for <b>status</b> ()
1645         *
1646     * <p>
1647     * <b>Definition:</b>
1648     * The status for the event
1649     * </p> 
1650         */
1651        public Event setStatus(BoundCodeDt<DiagnosticOrderStatusEnum> theValue) {
1652                myStatus = theValue;
1653                return this;
1654        }
1655        
1656        
1657
1658        /**
1659         * Sets the value(s) for <b>status</b> ()
1660         *
1661     * <p>
1662     * <b>Definition:</b>
1663     * The status for the event
1664     * </p> 
1665         */
1666        public Event setStatus(DiagnosticOrderStatusEnum theValue) {
1667                setStatus(new BoundCodeDt<DiagnosticOrderStatusEnum>(DiagnosticOrderStatusEnum.VALUESET_BINDER, theValue));
1668                
1669/*
1670                getStatusElement().setValueAsEnum(theValue);
1671*/
1672                return this;
1673        }
1674
1675  
1676        /**
1677         * Gets the value(s) for <b>description</b> ().
1678         * creating it if it does
1679         * not exist. Will not return <code>null</code>.
1680         *
1681     * <p>
1682     * <b>Definition:</b>
1683     * Additional information about the event that occurred - e.g. if the status remained unchanged
1684     * </p> 
1685         */
1686        public CodeableConceptDt getDescription() {  
1687                if (myDescription == null) {
1688                        myDescription = new CodeableConceptDt();
1689                }
1690                return myDescription;
1691        }
1692
1693        /**
1694         * Sets the value(s) for <b>description</b> ()
1695         *
1696     * <p>
1697     * <b>Definition:</b>
1698     * Additional information about the event that occurred - e.g. if the status remained unchanged
1699     * </p> 
1700         */
1701        public Event setDescription(CodeableConceptDt theValue) {
1702                myDescription = theValue;
1703                return this;
1704        }
1705        
1706        
1707
1708  
1709        /**
1710         * Gets the value(s) for <b>dateTime</b> ().
1711         * creating it if it does
1712         * not exist. Will not return <code>null</code>.
1713         *
1714     * <p>
1715     * <b>Definition:</b>
1716     * The date/time at which the event occurred
1717     * </p> 
1718         */
1719        public DateTimeDt getDateTimeElement() {  
1720                if (myDateTime == null) {
1721                        myDateTime = new DateTimeDt();
1722                }
1723                return myDateTime;
1724        }
1725
1726        
1727        /**
1728         * Gets the value(s) for <b>dateTime</b> ().
1729         * creating it if it does
1730         * not exist. This method may return <code>null</code>.
1731         *
1732     * <p>
1733     * <b>Definition:</b>
1734     * The date/time at which the event occurred
1735     * </p> 
1736         */
1737        public Date getDateTime() {  
1738                return getDateTimeElement().getValue();
1739        }
1740
1741        /**
1742         * Sets the value(s) for <b>dateTime</b> ()
1743         *
1744     * <p>
1745     * <b>Definition:</b>
1746     * The date/time at which the event occurred
1747     * </p> 
1748         */
1749        public Event setDateTime(DateTimeDt theValue) {
1750                myDateTime = theValue;
1751                return this;
1752        }
1753        
1754        
1755
1756        /**
1757         * Sets the value for <b>dateTime</b> ()
1758         *
1759     * <p>
1760     * <b>Definition:</b>
1761     * The date/time at which the event occurred
1762     * </p> 
1763         */
1764        public Event setDateTime( Date theDate,  TemporalPrecisionEnum thePrecision) {
1765                myDateTime = new DateTimeDt(theDate, thePrecision); 
1766                return this; 
1767        }
1768
1769        /**
1770         * Sets the value for <b>dateTime</b> ()
1771         *
1772     * <p>
1773     * <b>Definition:</b>
1774     * The date/time at which the event occurred
1775     * </p> 
1776         */
1777        public Event setDateTimeWithSecondsPrecision( Date theDate) {
1778                myDateTime = new DateTimeDt(theDate); 
1779                return this; 
1780        }
1781
1782 
1783        /**
1784         * Gets the value(s) for <b>actor</b> ().
1785         * creating it if it does
1786         * not exist. Will not return <code>null</code>.
1787         *
1788     * <p>
1789     * <b>Definition:</b>
1790     * The person responsible for performing or recording the action
1791     * </p> 
1792         */
1793        public ResourceReferenceDt getActor() {  
1794                if (myActor == null) {
1795                        myActor = new ResourceReferenceDt();
1796                }
1797                return myActor;
1798        }
1799
1800        /**
1801         * Sets the value(s) for <b>actor</b> ()
1802         *
1803     * <p>
1804     * <b>Definition:</b>
1805     * The person responsible for performing or recording the action
1806     * </p> 
1807         */
1808        public Event setActor(ResourceReferenceDt theValue) {
1809                myActor = theValue;
1810                return this;
1811        }
1812        
1813        
1814
1815  
1816
1817
1818        }
1819
1820
1821        /**
1822         * Block class for child element: <b>DiagnosticOrder.item</b> ()
1823         *
1824     * <p>
1825     * <b>Definition:</b>
1826     * The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested
1827     * </p> 
1828         */
1829        @Block()        
1830        public static class Item 
1831            extends  BaseIdentifiableElement  
1832            implements IResourceBlock {
1833        
1834        @Child(name="code", type=CodeableConceptDt.class, order=0, min=1, max=1, summary=true, modifier=false)  
1835        @Description(
1836                shortDefinition="",
1837                formalDefinition="A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested"
1838        )
1839        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/valueset-diagnostic-requests")
1840        private CodeableConceptDt myCode;
1841        
1842        @Child(name="specimen", order=1, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
1843                ca.uhn.fhir.model.dstu2.resource.Specimen.class
1844        })
1845        @Description(
1846                shortDefinition="",
1847                formalDefinition="If the item is related to a specific specimen"
1848        )
1849        private java.util.List<ResourceReferenceDt> mySpecimen;
1850        
1851        @Child(name="bodySite", type=CodeableConceptDt.class, order=2, min=0, max=1, summary=false, modifier=false)     
1852        @Description(
1853                shortDefinition="",
1854                formalDefinition="Anatomical location where the request test should be performed.  This is the target site."
1855        )
1856        private CodeableConceptDt myBodySite;
1857        
1858        @Child(name="status", type=CodeDt.class, order=3, min=0, max=1, summary=true, modifier=false)   
1859        @Description(
1860                shortDefinition="",
1861                formalDefinition="The status of this individual item within the order"
1862        )
1863        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/diagnostic-order-status")
1864        private BoundCodeDt<DiagnosticOrderStatusEnum> myStatus;
1865        
1866        @Child(name="event", type=Event.class, order=4, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)   
1867        @Description(
1868                shortDefinition="",
1869                formalDefinition="A summary of the events of interest that have occurred as this item of the request is processed"
1870        )
1871        private java.util.List<Event> myEvent;
1872        
1873
1874        @Override
1875        public boolean isEmpty() {
1876                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myCode,  mySpecimen,  myBodySite,  myStatus,  myEvent);
1877        }
1878        
1879        @Override
1880        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1881                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, mySpecimen, myBodySite, myStatus, myEvent);
1882        }
1883
1884        /**
1885         * Gets the value(s) for <b>code</b> ().
1886         * creating it if it does
1887         * not exist. Will not return <code>null</code>.
1888         *
1889     * <p>
1890     * <b>Definition:</b>
1891     * A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested
1892     * </p> 
1893         */
1894        public CodeableConceptDt getCode() {  
1895                if (myCode == null) {
1896                        myCode = new CodeableConceptDt();
1897                }
1898                return myCode;
1899        }
1900
1901        /**
1902         * Sets the value(s) for <b>code</b> ()
1903         *
1904     * <p>
1905     * <b>Definition:</b>
1906     * A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested
1907     * </p> 
1908         */
1909        public Item setCode(CodeableConceptDt theValue) {
1910                myCode = theValue;
1911                return this;
1912        }
1913        
1914        
1915
1916  
1917        /**
1918         * Gets the value(s) for <b>specimen</b> ().
1919         * creating it if it does
1920         * not exist. Will not return <code>null</code>.
1921         *
1922     * <p>
1923     * <b>Definition:</b>
1924     * If the item is related to a specific specimen
1925     * </p> 
1926         */
1927        public java.util.List<ResourceReferenceDt> getSpecimen() {  
1928                if (mySpecimen == null) {
1929                        mySpecimen = new java.util.ArrayList<ResourceReferenceDt>();
1930                }
1931                return mySpecimen;
1932        }
1933
1934        /**
1935         * Sets the value(s) for <b>specimen</b> ()
1936         *
1937     * <p>
1938     * <b>Definition:</b>
1939     * If the item is related to a specific specimen
1940     * </p> 
1941         */
1942        public Item setSpecimen(java.util.List<ResourceReferenceDt> theValue) {
1943                mySpecimen = theValue;
1944                return this;
1945        }
1946        
1947        
1948
1949        /**
1950         * Adds and returns a new value for <b>specimen</b> ()
1951         *
1952     * <p>
1953     * <b>Definition:</b>
1954     * If the item is related to a specific specimen
1955     * </p> 
1956         */
1957        public ResourceReferenceDt addSpecimen() {
1958                ResourceReferenceDt newType = new ResourceReferenceDt();
1959                getSpecimen().add(newType);
1960                return newType; 
1961        }
1962  
1963        /**
1964         * Gets the value(s) for <b>bodySite</b> ().
1965         * creating it if it does
1966         * not exist. Will not return <code>null</code>.
1967         *
1968     * <p>
1969     * <b>Definition:</b>
1970     * Anatomical location where the request test should be performed.  This is the target site.
1971     * </p> 
1972         */
1973        public CodeableConceptDt getBodySite() {  
1974                if (myBodySite == null) {
1975                        myBodySite = new CodeableConceptDt();
1976                }
1977                return myBodySite;
1978        }
1979
1980        /**
1981         * Sets the value(s) for <b>bodySite</b> ()
1982         *
1983     * <p>
1984     * <b>Definition:</b>
1985     * Anatomical location where the request test should be performed.  This is the target site.
1986     * </p> 
1987         */
1988        public Item setBodySite(CodeableConceptDt theValue) {
1989                myBodySite = theValue;
1990                return this;
1991        }
1992        
1993        
1994
1995  
1996        /**
1997         * Gets the value(s) for <b>status</b> ().
1998         * creating it if it does
1999         * not exist. Will not return <code>null</code>.
2000         *
2001     * <p>
2002     * <b>Definition:</b>
2003     * The status of this individual item within the order
2004     * </p> 
2005         */
2006        public BoundCodeDt<DiagnosticOrderStatusEnum> getStatusElement() {  
2007                if (myStatus == null) {
2008                        myStatus = new BoundCodeDt<DiagnosticOrderStatusEnum>(DiagnosticOrderStatusEnum.VALUESET_BINDER);
2009                }
2010                return myStatus;
2011        }
2012
2013        
2014        /**
2015         * Gets the value(s) for <b>status</b> ().
2016         * creating it if it does
2017         * not exist. This method may return <code>null</code>.
2018         *
2019     * <p>
2020     * <b>Definition:</b>
2021     * The status of this individual item within the order
2022     * </p> 
2023         */
2024        public String getStatus() {  
2025                return getStatusElement().getValue();
2026        }
2027
2028        /**
2029         * Sets the value(s) for <b>status</b> ()
2030         *
2031     * <p>
2032     * <b>Definition:</b>
2033     * The status of this individual item within the order
2034     * </p> 
2035         */
2036        public Item setStatus(BoundCodeDt<DiagnosticOrderStatusEnum> theValue) {
2037                myStatus = theValue;
2038                return this;
2039        }
2040        
2041        
2042
2043        /**
2044         * Sets the value(s) for <b>status</b> ()
2045         *
2046     * <p>
2047     * <b>Definition:</b>
2048     * The status of this individual item within the order
2049     * </p> 
2050         */
2051        public Item setStatus(DiagnosticOrderStatusEnum theValue) {
2052                setStatus(new BoundCodeDt<DiagnosticOrderStatusEnum>(DiagnosticOrderStatusEnum.VALUESET_BINDER, theValue));
2053                
2054/*
2055                getStatusElement().setValueAsEnum(theValue);
2056*/
2057                return this;
2058        }
2059
2060  
2061        /**
2062         * Gets the value(s) for <b>event</b> ().
2063         * creating it if it does
2064         * not exist. Will not return <code>null</code>.
2065         *
2066     * <p>
2067     * <b>Definition:</b>
2068     * A summary of the events of interest that have occurred as this item of the request is processed
2069     * </p> 
2070         */
2071        public java.util.List<Event> getEvent() {  
2072                if (myEvent == null) {
2073                        myEvent = new java.util.ArrayList<Event>();
2074                }
2075                return myEvent;
2076        }
2077
2078        /**
2079         * Sets the value(s) for <b>event</b> ()
2080         *
2081     * <p>
2082     * <b>Definition:</b>
2083     * A summary of the events of interest that have occurred as this item of the request is processed
2084     * </p> 
2085         */
2086        public Item setEvent(java.util.List<Event> theValue) {
2087                myEvent = theValue;
2088                return this;
2089        }
2090        
2091        
2092
2093        /**
2094         * Adds and returns a new value for <b>event</b> ()
2095         *
2096     * <p>
2097     * <b>Definition:</b>
2098     * A summary of the events of interest that have occurred as this item of the request is processed
2099     * </p> 
2100         */
2101        public Event addEvent() {
2102                Event newType = new Event();
2103                getEvent().add(newType);
2104                return newType; 
2105        }
2106
2107        /**
2108         * Adds a given new value for <b>event</b> ()
2109         *
2110         * <p>
2111         * <b>Definition:</b>
2112         * A summary of the events of interest that have occurred as this item of the request is processed
2113         * </p>
2114         * @param theValue The event to add (must not be <code>null</code>)
2115         */
2116        public Item addEvent(Event theValue) {
2117                if (theValue == null) {
2118                        throw new NullPointerException("theValue must not be null");
2119                }
2120                getEvent().add(theValue);
2121                return this;
2122        }
2123
2124        /**
2125         * Gets the first repetition for <b>event</b> (),
2126         * creating it if it does not already exist.
2127         *
2128     * <p>
2129     * <b>Definition:</b>
2130     * A summary of the events of interest that have occurred as this item of the request is processed
2131     * </p> 
2132         */
2133        public Event getEventFirstRep() {
2134                if (getEvent().isEmpty()) {
2135                        return addEvent();
2136                }
2137                return getEvent().get(0); 
2138        }
2139  
2140
2141
2142        }
2143
2144
2145
2146
2147    @Override
2148    public String getResourceName() {
2149        return "DiagnosticOrder";
2150    }
2151    
2152    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
2153        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
2154    }
2155
2156
2157}