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>Specimen</b> Resource
320 * (clinical.diagnostics)
321 *
322 * <p>
323 * <b>Definition:</b>
324 * A sample to be used for analysis.
325 * </p> 
326 *
327 * <p>
328 * <b>Requirements:</b>
329 * 
330 * </p> 
331 *
332 * <p>
333 * <b>Profile Definition:</b>
334 * <a href="http://hl7.org/fhir/profiles/Specimen">http://hl7.org/fhir/profiles/Specimen</a> 
335 * </p>
336 *
337 */
338@ResourceDef(name="Specimen", profile="http://hl7.org/fhir/profiles/Specimen", id="specimen")
339public class Specimen extends ca.uhn.fhir.model.dstu2.resource.BaseResource
340    implements  IResource     {
341
342        /**
343         * Search parameter constant for <b>subject</b>
344         * <p>
345         * Description: <b>The subject of the specimen</b><br>
346         * Type: <b>reference</b><br>
347         * Path: <b>Specimen.subject</b><br>
348         * </p>
349         */
350        @SearchParamDefinition(name="subject", path="Specimen.subject", description="The subject of the specimen", type="reference"  )
351        public static final String SP_SUBJECT = "subject";
352
353        /**
354         * <b>Fluent Client</b> search parameter constant for <b>subject</b>
355         * <p>
356         * Description: <b>The subject of the specimen</b><br>
357         * Type: <b>reference</b><br>
358         * Path: <b>Specimen.subject</b><br>
359         * </p>
360         */
361        public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT);
362
363        /**
364         * Search parameter constant for <b>patient</b>
365         * <p>
366         * Description: <b>The patient the specimen comes from</b><br>
367         * Type: <b>reference</b><br>
368         * Path: <b>Specimen.subject</b><br>
369         * </p>
370         */
371        @SearchParamDefinition(name="patient", path="Specimen.subject", description="The patient the specimen comes from", type="reference"  )
372        public static final String SP_PATIENT = "patient";
373
374        /**
375         * <b>Fluent Client</b> search parameter constant for <b>patient</b>
376         * <p>
377         * Description: <b>The patient the specimen comes from</b><br>
378         * Type: <b>reference</b><br>
379         * Path: <b>Specimen.subject</b><br>
380         * </p>
381         */
382        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
383
384        /**
385         * Search parameter constant for <b>identifier</b>
386         * <p>
387         * Description: <b>The unique identifier associated with the specimen</b><br>
388         * Type: <b>token</b><br>
389         * Path: <b>Specimen.identifier</b><br>
390         * </p>
391         */
392        @SearchParamDefinition(name="identifier", path="Specimen.identifier", description="The unique identifier associated with the specimen", type="token"  )
393        public static final String SP_IDENTIFIER = "identifier";
394
395        /**
396         * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
397         * <p>
398         * Description: <b>The unique identifier associated with the specimen</b><br>
399         * Type: <b>token</b><br>
400         * Path: <b>Specimen.identifier</b><br>
401         * </p>
402         */
403        public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
404
405        /**
406         * Search parameter constant for <b>type</b>
407         * <p>
408         * Description: <b>The specimen type</b><br>
409         * Type: <b>token</b><br>
410         * Path: <b>Specimen.type</b><br>
411         * </p>
412         */
413        @SearchParamDefinition(name="type", path="Specimen.type", description="The specimen type", type="token"  )
414        public static final String SP_TYPE = "type";
415
416        /**
417         * <b>Fluent Client</b> search parameter constant for <b>type</b>
418         * <p>
419         * Description: <b>The specimen type</b><br>
420         * Type: <b>token</b><br>
421         * Path: <b>Specimen.type</b><br>
422         * </p>
423         */
424        public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE);
425
426        /**
427         * Search parameter constant for <b>parent</b>
428         * <p>
429         * Description: <b>The parent of the specimen</b><br>
430         * Type: <b>reference</b><br>
431         * Path: <b>Specimen.parent</b><br>
432         * </p>
433         */
434        @SearchParamDefinition(name="parent", path="Specimen.parent", description="The parent of the specimen", type="reference"  )
435        public static final String SP_PARENT = "parent";
436
437        /**
438         * <b>Fluent Client</b> search parameter constant for <b>parent</b>
439         * <p>
440         * Description: <b>The parent of the specimen</b><br>
441         * Type: <b>reference</b><br>
442         * Path: <b>Specimen.parent</b><br>
443         * </p>
444         */
445        public static final ReferenceClientParam PARENT = new ReferenceClientParam(SP_PARENT);
446
447        /**
448         * Search parameter constant for <b>accession</b>
449         * <p>
450         * Description: <b>The accession number associated with the specimen</b><br>
451         * Type: <b>token</b><br>
452         * Path: <b>Specimen.accessionIdentifier</b><br>
453         * </p>
454         */
455        @SearchParamDefinition(name="accession", path="Specimen.accessionIdentifier", description="The accession number associated with the specimen", type="token"  )
456        public static final String SP_ACCESSION = "accession";
457
458        /**
459         * <b>Fluent Client</b> search parameter constant for <b>accession</b>
460         * <p>
461         * Description: <b>The accession number associated with the specimen</b><br>
462         * Type: <b>token</b><br>
463         * Path: <b>Specimen.accessionIdentifier</b><br>
464         * </p>
465         */
466        public static final TokenClientParam ACCESSION = new TokenClientParam(SP_ACCESSION);
467
468        /**
469         * Search parameter constant for <b>collected</b>
470         * <p>
471         * Description: <b>The date the specimen was collected</b><br>
472         * Type: <b>date</b><br>
473         * Path: <b>Specimen.collection.collected[x]</b><br>
474         * </p>
475         */
476        @SearchParamDefinition(name="collected", path="Specimen.collection.collected[x]", description="The date the specimen was collected", type="date"  )
477        public static final String SP_COLLECTED = "collected";
478
479        /**
480         * <b>Fluent Client</b> search parameter constant for <b>collected</b>
481         * <p>
482         * Description: <b>The date the specimen was collected</b><br>
483         * Type: <b>date</b><br>
484         * Path: <b>Specimen.collection.collected[x]</b><br>
485         * </p>
486         */
487        public static final DateClientParam COLLECTED = new DateClientParam(SP_COLLECTED);
488
489        /**
490         * Search parameter constant for <b>collector</b>
491         * <p>
492         * Description: <b>Who collected the specimen</b><br>
493         * Type: <b>reference</b><br>
494         * Path: <b>Specimen.collection.collector</b><br>
495         * </p>
496         */
497        @SearchParamDefinition(name="collector", path="Specimen.collection.collector", description="Who collected the specimen", type="reference"  )
498        public static final String SP_COLLECTOR = "collector";
499
500        /**
501         * <b>Fluent Client</b> search parameter constant for <b>collector</b>
502         * <p>
503         * Description: <b>Who collected the specimen</b><br>
504         * Type: <b>reference</b><br>
505         * Path: <b>Specimen.collection.collector</b><br>
506         * </p>
507         */
508        public static final ReferenceClientParam COLLECTOR = new ReferenceClientParam(SP_COLLECTOR);
509
510        /**
511         * Search parameter constant for <b>bodysite</b>
512         * <p>
513         * Description: <b>The code for the body site from where the specimen originated</b><br>
514         * Type: <b>token</b><br>
515         * Path: <b>Specimen.collection.bodySite</b><br>
516         * </p>
517         */
518        @SearchParamDefinition(name="bodysite", path="Specimen.collection.bodySite", description="The code for the body site from where the specimen originated", type="token"  )
519        public static final String SP_BODYSITE = "bodysite";
520
521        /**
522         * <b>Fluent Client</b> search parameter constant for <b>bodysite</b>
523         * <p>
524         * Description: <b>The code for the body site from where the specimen originated</b><br>
525         * Type: <b>token</b><br>
526         * Path: <b>Specimen.collection.bodySite</b><br>
527         * </p>
528         */
529        public static final TokenClientParam BODYSITE = new TokenClientParam(SP_BODYSITE);
530
531        /**
532         * Search parameter constant for <b>container-id</b>
533         * <p>
534         * Description: <b>The unique identifier associated with the specimen container</b><br>
535         * Type: <b>token</b><br>
536         * Path: <b>Specimen.container.identifier</b><br>
537         * </p>
538         */
539        @SearchParamDefinition(name="container-id", path="Specimen.container.identifier", description="The unique identifier associated with the specimen container", type="token"  )
540        public static final String SP_CONTAINER_ID = "container-id";
541
542        /**
543         * <b>Fluent Client</b> search parameter constant for <b>container-id</b>
544         * <p>
545         * Description: <b>The unique identifier associated with the specimen container</b><br>
546         * Type: <b>token</b><br>
547         * Path: <b>Specimen.container.identifier</b><br>
548         * </p>
549         */
550        public static final TokenClientParam CONTAINER_ID = new TokenClientParam(SP_CONTAINER_ID);
551
552        /**
553         * Search parameter constant for <b>container</b>
554         * <p>
555         * Description: <b>The kind of specimen container</b><br>
556         * Type: <b>token</b><br>
557         * Path: <b>Specimen.container.type</b><br>
558         * </p>
559         */
560        @SearchParamDefinition(name="container", path="Specimen.container.type", description="The kind of specimen container", type="token"  )
561        public static final String SP_CONTAINER = "container";
562
563        /**
564         * <b>Fluent Client</b> search parameter constant for <b>container</b>
565         * <p>
566         * Description: <b>The kind of specimen container</b><br>
567         * Type: <b>token</b><br>
568         * Path: <b>Specimen.container.type</b><br>
569         * </p>
570         */
571        public static final TokenClientParam CONTAINER = new TokenClientParam(SP_CONTAINER);
572
573
574        /**
575         * Constant for fluent queries to be used to add include statements. Specifies
576         * the path value of "<b>Specimen:collector</b>".
577         */
578        public static final Include INCLUDE_COLLECTOR = new Include("Specimen:collector");
579
580        /**
581         * Constant for fluent queries to be used to add include statements. Specifies
582         * the path value of "<b>Specimen:parent</b>".
583         */
584        public static final Include INCLUDE_PARENT = new Include("Specimen:parent");
585
586        /**
587         * Constant for fluent queries to be used to add include statements. Specifies
588         * the path value of "<b>Specimen:patient</b>".
589         */
590        public static final Include INCLUDE_PATIENT = new Include("Specimen:patient");
591
592        /**
593         * Constant for fluent queries to be used to add include statements. Specifies
594         * the path value of "<b>Specimen:subject</b>".
595         */
596        public static final Include INCLUDE_SUBJECT = new Include("Specimen:subject");
597
598
599        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)       
600        @Description(
601                shortDefinition="id",
602                formalDefinition="Id for specimen"
603        )
604        private java.util.List<IdentifierDt> myIdentifier;
605        
606        @Child(name="status", type=CodeDt.class, order=1, min=0, max=1, summary=true, modifier=true)    
607        @Description(
608                shortDefinition="status",
609                formalDefinition="The availability of the specimen"
610        )
611        private BoundCodeDt<SpecimenStatusEnum> myStatus;
612        
613        @Child(name="type", type=CodeableConceptDt.class, order=2, min=0, max=1, summary=true, modifier=false)  
614        @Description(
615                shortDefinition="class",
616                formalDefinition="The kind of material that forms the specimen"
617        )
618        private CodeableConceptDt myType;
619        
620        @Child(name="parent", order=3, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
621                ca.uhn.fhir.model.dstu2.resource.Specimen.class })
622        @Description(
623                shortDefinition="",
624                formalDefinition="Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen."
625        )
626        private java.util.List<ResourceReferenceDt> myParent;
627        
628        @Child(name="subject", order=4, min=1, max=1, summary=true, modifier=false, type={
629                ca.uhn.fhir.model.dstu2.resource.Patient.class,                 ca.uhn.fhir.model.dstu2.resource.Group.class,           ca.uhn.fhir.model.dstu2.resource.Device.class,          ca.uhn.fhir.model.dstu2.resource.Substance.class        })
630        @Description(
631                shortDefinition="who.focus",
632                formalDefinition=""
633        )
634        private ResourceReferenceDt mySubject;
635        
636        @Child(name="accessionIdentifier", type=IdentifierDt.class, order=5, min=0, max=1, summary=true, modifier=false)        
637        @Description(
638                shortDefinition="id",
639                formalDefinition="The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures."
640        )
641        private IdentifierDt myAccessionIdentifier;
642        
643        @Child(name="receivedTime", type=DateTimeDt.class, order=6, min=0, max=1, summary=true, modifier=false) 
644        @Description(
645                shortDefinition="when.done",
646                formalDefinition="Time when specimen was received for processing or testing"
647        )
648        private DateTimeDt myReceivedTime;
649        
650        @Child(name="collection", order=7, min=0, max=1, summary=false, modifier=false) 
651        @Description(
652                shortDefinition="",
653                formalDefinition="Details concerning the specimen collection"
654        )
655        private Collection myCollection;
656        
657        @Child(name="treatment", order=8, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)        
658        @Description(
659                shortDefinition="",
660                formalDefinition="Details concerning treatment and processing steps for the specimen"
661        )
662        private java.util.List<Treatment> myTreatment;
663        
664        @Child(name="container", order=9, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)        
665        @Description(
666                shortDefinition="",
667                formalDefinition="The container holding the specimen.  The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here."
668        )
669        private java.util.List<Container> myContainer;
670        
671
672        @Override
673        public boolean isEmpty() {
674                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myStatus,  myType,  myParent,  mySubject,  myAccessionIdentifier,  myReceivedTime,  myCollection,  myTreatment,  myContainer);
675        }
676        
677        @Override
678        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
679                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myStatus, myType, myParent, mySubject, myAccessionIdentifier, myReceivedTime, myCollection, myTreatment, myContainer);
680        }
681
682        /**
683         * Gets the value(s) for <b>identifier</b> (id).
684         * creating it if it does
685         * not exist. Will not return <code>null</code>.
686         *
687     * <p>
688     * <b>Definition:</b>
689     * Id for specimen
690     * </p> 
691         */
692        public java.util.List<IdentifierDt> getIdentifier() {  
693                if (myIdentifier == null) {
694                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
695                }
696                return myIdentifier;
697        }
698
699        /**
700         * Sets the value(s) for <b>identifier</b> (id)
701         *
702     * <p>
703     * <b>Definition:</b>
704     * Id for specimen
705     * </p> 
706         */
707        public Specimen setIdentifier(java.util.List<IdentifierDt> theValue) {
708                myIdentifier = theValue;
709                return this;
710        }
711        
712        
713
714        /**
715         * Adds and returns a new value for <b>identifier</b> (id)
716         *
717     * <p>
718     * <b>Definition:</b>
719     * Id for specimen
720     * </p> 
721         */
722        public IdentifierDt addIdentifier() {
723                IdentifierDt newType = new IdentifierDt();
724                getIdentifier().add(newType);
725                return newType; 
726        }
727
728        /**
729         * Adds a given new value for <b>identifier</b> (id)
730         *
731         * <p>
732         * <b>Definition:</b>
733         * Id for specimen
734         * </p>
735         * @param theValue The identifier to add (must not be <code>null</code>)
736         */
737        public Specimen addIdentifier(IdentifierDt theValue) {
738                if (theValue == null) {
739                        throw new NullPointerException("theValue must not be null");
740                }
741                getIdentifier().add(theValue);
742                return this;
743        }
744
745        /**
746         * Gets the first repetition for <b>identifier</b> (id),
747         * creating it if it does not already exist.
748         *
749     * <p>
750     * <b>Definition:</b>
751     * Id for specimen
752     * </p> 
753         */
754        public IdentifierDt getIdentifierFirstRep() {
755                if (getIdentifier().isEmpty()) {
756                        return addIdentifier();
757                }
758                return getIdentifier().get(0); 
759        }
760  
761        /**
762         * Gets the value(s) for <b>status</b> (status).
763         * creating it if it does
764         * not exist. Will not return <code>null</code>.
765         *
766     * <p>
767     * <b>Definition:</b>
768     * The availability of the specimen
769     * </p> 
770         */
771        public BoundCodeDt<SpecimenStatusEnum> getStatusElement() {  
772                if (myStatus == null) {
773                        myStatus = new BoundCodeDt<SpecimenStatusEnum>(SpecimenStatusEnum.VALUESET_BINDER);
774                }
775                return myStatus;
776        }
777
778        
779        /**
780         * Gets the value(s) for <b>status</b> (status).
781         * creating it if it does
782         * not exist. Will not return <code>null</code>.
783         *
784     * <p>
785     * <b>Definition:</b>
786     * The availability of the specimen
787     * </p> 
788         */
789        public String getStatus() {  
790                return getStatusElement().getValue();
791        }
792
793        /**
794         * Sets the value(s) for <b>status</b> (status)
795         *
796     * <p>
797     * <b>Definition:</b>
798     * The availability of the specimen
799     * </p> 
800         */
801        public Specimen setStatus(BoundCodeDt<SpecimenStatusEnum> theValue) {
802                myStatus = theValue;
803                return this;
804        }
805        
806        
807
808        /**
809         * Sets the value(s) for <b>status</b> (status)
810         *
811     * <p>
812     * <b>Definition:</b>
813     * The availability of the specimen
814     * </p> 
815         */
816        public Specimen setStatus(SpecimenStatusEnum theValue) {
817                setStatus(new BoundCodeDt<SpecimenStatusEnum>(SpecimenStatusEnum.VALUESET_BINDER, theValue));
818                
819/*
820                getStatusElement().setValueAsEnum(theValue);
821*/
822                return this;
823        }
824
825  
826        /**
827         * Gets the value(s) for <b>type</b> (class).
828         * creating it if it does
829         * not exist. Will not return <code>null</code>.
830         *
831     * <p>
832     * <b>Definition:</b>
833     * The kind of material that forms the specimen
834     * </p> 
835         */
836        public CodeableConceptDt getType() {  
837                if (myType == null) {
838                        myType = new CodeableConceptDt();
839                }
840                return myType;
841        }
842
843        /**
844         * Sets the value(s) for <b>type</b> (class)
845         *
846     * <p>
847     * <b>Definition:</b>
848     * The kind of material that forms the specimen
849     * </p> 
850         */
851        public Specimen setType(CodeableConceptDt theValue) {
852                myType = theValue;
853                return this;
854        }
855        
856        
857
858  
859        /**
860         * Gets the value(s) for <b>parent</b> ().
861         * creating it if it does
862         * not exist. Will not return <code>null</code>.
863         *
864     * <p>
865     * <b>Definition:</b>
866     * Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.
867     * </p> 
868         */
869        public java.util.List<ResourceReferenceDt> getParent() {  
870                if (myParent == null) {
871                        myParent = new java.util.ArrayList<ResourceReferenceDt>();
872                }
873                return myParent;
874        }
875
876        /**
877         * Sets the value(s) for <b>parent</b> ()
878         *
879     * <p>
880     * <b>Definition:</b>
881     * Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.
882     * </p> 
883         */
884        public Specimen setParent(java.util.List<ResourceReferenceDt> theValue) {
885                myParent = theValue;
886                return this;
887        }
888        
889        
890
891        /**
892         * Adds and returns a new value for <b>parent</b> ()
893         *
894     * <p>
895     * <b>Definition:</b>
896     * Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.
897     * </p> 
898         */
899        public ResourceReferenceDt addParent() {
900                ResourceReferenceDt newType = new ResourceReferenceDt();
901                getParent().add(newType);
902                return newType; 
903        }
904  
905        /**
906         * Gets the value(s) for <b>subject</b> (who.focus).
907         * creating it if it does
908         * not exist. Will not return <code>null</code>.
909         *
910     * <p>
911     * <b>Definition:</b>
912     * 
913     * </p> 
914         */
915        public ResourceReferenceDt getSubject() {  
916                if (mySubject == null) {
917                        mySubject = new ResourceReferenceDt();
918                }
919                return mySubject;
920        }
921
922        /**
923         * Sets the value(s) for <b>subject</b> (who.focus)
924         *
925     * <p>
926     * <b>Definition:</b>
927     * 
928     * </p> 
929         */
930        public Specimen setSubject(ResourceReferenceDt theValue) {
931                mySubject = theValue;
932                return this;
933        }
934        
935        
936
937  
938        /**
939         * Gets the value(s) for <b>accessionIdentifier</b> (id).
940         * creating it if it does
941         * not exist. Will not return <code>null</code>.
942         *
943     * <p>
944     * <b>Definition:</b>
945     * The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.
946     * </p> 
947         */
948        public IdentifierDt getAccessionIdentifier() {  
949                if (myAccessionIdentifier == null) {
950                        myAccessionIdentifier = new IdentifierDt();
951                }
952                return myAccessionIdentifier;
953        }
954
955        /**
956         * Sets the value(s) for <b>accessionIdentifier</b> (id)
957         *
958     * <p>
959     * <b>Definition:</b>
960     * The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.
961     * </p> 
962         */
963        public Specimen setAccessionIdentifier(IdentifierDt theValue) {
964                myAccessionIdentifier = theValue;
965                return this;
966        }
967        
968        
969
970  
971        /**
972         * Gets the value(s) for <b>receivedTime</b> (when.done).
973         * creating it if it does
974         * not exist. Will not return <code>null</code>.
975         *
976     * <p>
977     * <b>Definition:</b>
978     * Time when specimen was received for processing or testing
979     * </p> 
980         */
981        public DateTimeDt getReceivedTimeElement() {  
982                if (myReceivedTime == null) {
983                        myReceivedTime = new DateTimeDt();
984                }
985                return myReceivedTime;
986        }
987
988        
989        /**
990         * Gets the value(s) for <b>receivedTime</b> (when.done).
991         * creating it if it does
992         * not exist. Will not return <code>null</code>.
993         *
994     * <p>
995     * <b>Definition:</b>
996     * Time when specimen was received for processing or testing
997     * </p> 
998         */
999        public Date getReceivedTime() {  
1000                return getReceivedTimeElement().getValue();
1001        }
1002
1003        /**
1004         * Sets the value(s) for <b>receivedTime</b> (when.done)
1005         *
1006     * <p>
1007     * <b>Definition:</b>
1008     * Time when specimen was received for processing or testing
1009     * </p> 
1010         */
1011        public Specimen setReceivedTime(DateTimeDt theValue) {
1012                myReceivedTime = theValue;
1013                return this;
1014        }
1015        
1016        
1017
1018        /**
1019         * Sets the value for <b>receivedTime</b> (when.done)
1020         *
1021     * <p>
1022     * <b>Definition:</b>
1023     * Time when specimen was received for processing or testing
1024     * </p> 
1025         */
1026        public Specimen setReceivedTime( Date theDate,  TemporalPrecisionEnum thePrecision) {
1027                myReceivedTime = new DateTimeDt(theDate, thePrecision); 
1028                return this; 
1029        }
1030
1031        /**
1032         * Sets the value for <b>receivedTime</b> (when.done)
1033         *
1034     * <p>
1035     * <b>Definition:</b>
1036     * Time when specimen was received for processing or testing
1037     * </p> 
1038         */
1039        public Specimen setReceivedTimeWithSecondsPrecision( Date theDate) {
1040                myReceivedTime = new DateTimeDt(theDate); 
1041                return this; 
1042        }
1043
1044 
1045        /**
1046         * Gets the value(s) for <b>collection</b> ().
1047         * creating it if it does
1048         * not exist. Will not return <code>null</code>.
1049         *
1050     * <p>
1051     * <b>Definition:</b>
1052     * Details concerning the specimen collection
1053     * </p> 
1054         */
1055        public Collection getCollection() {  
1056                if (myCollection == null) {
1057                        myCollection = new Collection();
1058                }
1059                return myCollection;
1060        }
1061
1062        /**
1063         * Sets the value(s) for <b>collection</b> ()
1064         *
1065     * <p>
1066     * <b>Definition:</b>
1067     * Details concerning the specimen collection
1068     * </p> 
1069         */
1070        public Specimen setCollection(Collection theValue) {
1071                myCollection = theValue;
1072                return this;
1073        }
1074        
1075        
1076
1077  
1078        /**
1079         * Gets the value(s) for <b>treatment</b> ().
1080         * creating it if it does
1081         * not exist. Will not return <code>null</code>.
1082         *
1083     * <p>
1084     * <b>Definition:</b>
1085     * Details concerning treatment and processing steps for the specimen
1086     * </p> 
1087         */
1088        public java.util.List<Treatment> getTreatment() {  
1089                if (myTreatment == null) {
1090                        myTreatment = new java.util.ArrayList<Treatment>();
1091                }
1092                return myTreatment;
1093        }
1094
1095        /**
1096         * Sets the value(s) for <b>treatment</b> ()
1097         *
1098     * <p>
1099     * <b>Definition:</b>
1100     * Details concerning treatment and processing steps for the specimen
1101     * </p> 
1102         */
1103        public Specimen setTreatment(java.util.List<Treatment> theValue) {
1104                myTreatment = theValue;
1105                return this;
1106        }
1107        
1108        
1109
1110        /**
1111         * Adds and returns a new value for <b>treatment</b> ()
1112         *
1113     * <p>
1114     * <b>Definition:</b>
1115     * Details concerning treatment and processing steps for the specimen
1116     * </p> 
1117         */
1118        public Treatment addTreatment() {
1119                Treatment newType = new Treatment();
1120                getTreatment().add(newType);
1121                return newType; 
1122        }
1123
1124        /**
1125         * Adds a given new value for <b>treatment</b> ()
1126         *
1127         * <p>
1128         * <b>Definition:</b>
1129         * Details concerning treatment and processing steps for the specimen
1130         * </p>
1131         * @param theValue The treatment to add (must not be <code>null</code>)
1132         */
1133        public Specimen addTreatment(Treatment theValue) {
1134                if (theValue == null) {
1135                        throw new NullPointerException("theValue must not be null");
1136                }
1137                getTreatment().add(theValue);
1138                return this;
1139        }
1140
1141        /**
1142         * Gets the first repetition for <b>treatment</b> (),
1143         * creating it if it does not already exist.
1144         *
1145     * <p>
1146     * <b>Definition:</b>
1147     * Details concerning treatment and processing steps for the specimen
1148     * </p> 
1149         */
1150        public Treatment getTreatmentFirstRep() {
1151                if (getTreatment().isEmpty()) {
1152                        return addTreatment();
1153                }
1154                return getTreatment().get(0); 
1155        }
1156  
1157        /**
1158         * Gets the value(s) for <b>container</b> ().
1159         * creating it if it does
1160         * not exist. Will not return <code>null</code>.
1161         *
1162     * <p>
1163     * <b>Definition:</b>
1164     * The container holding the specimen.  The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.
1165     * </p> 
1166         */
1167        public java.util.List<Container> getContainer() {  
1168                if (myContainer == null) {
1169                        myContainer = new java.util.ArrayList<Container>();
1170                }
1171                return myContainer;
1172        }
1173
1174        /**
1175         * Sets the value(s) for <b>container</b> ()
1176         *
1177     * <p>
1178     * <b>Definition:</b>
1179     * The container holding the specimen.  The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.
1180     * </p> 
1181         */
1182        public Specimen setContainer(java.util.List<Container> theValue) {
1183                myContainer = theValue;
1184                return this;
1185        }
1186        
1187        
1188
1189        /**
1190         * Adds and returns a new value for <b>container</b> ()
1191         *
1192     * <p>
1193     * <b>Definition:</b>
1194     * The container holding the specimen.  The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.
1195     * </p> 
1196         */
1197        public Container addContainer() {
1198                Container newType = new Container();
1199                getContainer().add(newType);
1200                return newType; 
1201        }
1202
1203        /**
1204         * Adds a given new value for <b>container</b> ()
1205         *
1206         * <p>
1207         * <b>Definition:</b>
1208         * The container holding the specimen.  The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.
1209         * </p>
1210         * @param theValue The container to add (must not be <code>null</code>)
1211         */
1212        public Specimen addContainer(Container theValue) {
1213                if (theValue == null) {
1214                        throw new NullPointerException("theValue must not be null");
1215                }
1216                getContainer().add(theValue);
1217                return this;
1218        }
1219
1220        /**
1221         * Gets the first repetition for <b>container</b> (),
1222         * creating it if it does not already exist.
1223         *
1224     * <p>
1225     * <b>Definition:</b>
1226     * The container holding the specimen.  The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.
1227     * </p> 
1228         */
1229        public Container getContainerFirstRep() {
1230                if (getContainer().isEmpty()) {
1231                        return addContainer();
1232                }
1233                return getContainer().get(0); 
1234        }
1235  
1236        /**
1237         * Block class for child element: <b>Specimen.collection</b> ()
1238         *
1239     * <p>
1240     * <b>Definition:</b>
1241     * Details concerning the specimen collection
1242     * </p> 
1243         */
1244        @Block()        
1245        public static class Collection 
1246            extends  BaseIdentifiableElement        implements IResourceBlock {
1247        
1248        @Child(name="collector", order=0, min=0, max=1, summary=true, modifier=false, type={
1249                ca.uhn.fhir.model.dstu2.resource.Practitioner.class     })
1250        @Description(
1251                shortDefinition="",
1252                formalDefinition="Person who collected the specimen"
1253        )
1254        private ResourceReferenceDt myCollector;
1255        
1256        @Child(name="comment", type=StringDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)     
1257        @Description(
1258                shortDefinition="",
1259                formalDefinition="To communicate any details or issues encountered during the specimen collection procedure."
1260        )
1261        private java.util.List<StringDt> myComment;
1262        
1263        @Child(name="collected", order=2, min=0, max=1, summary=true, modifier=false, type={
1264                DateTimeDt.class,               PeriodDt.class  })
1265        @Description(
1266                shortDefinition="when.init",
1267                formalDefinition="Time when specimen was collected from subject - the physiologically relevant time"
1268        )
1269        private IDatatype myCollected;
1270        
1271        @Child(name="quantity", type=SimpleQuantityDt.class, order=3, min=0, max=1, summary=false, modifier=false)      
1272        @Description(
1273                shortDefinition="",
1274                formalDefinition="The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample."
1275        )
1276        private SimpleQuantityDt myQuantity;
1277        
1278        @Child(name="method", type=CodeableConceptDt.class, order=4, min=0, max=1, summary=false, modifier=false)       
1279        @Description(
1280                shortDefinition="",
1281                formalDefinition="A coded value specifying the technique that is used to perform the procedure"
1282        )
1283        private BoundCodeableConceptDt<SpecimenCollectionMethodEnum> myMethod;
1284        
1285        @Child(name="bodySite", type=CodeableConceptDt.class, order=5, min=0, max=1, summary=false, modifier=false)     
1286        @Description(
1287                shortDefinition="",
1288                formalDefinition="Anatomical location from which the specimen was collected (if subject is a patient). This is the target site.  This element is not used for environmental specimens."
1289        )
1290        private CodeableConceptDt myBodySite;
1291        
1292
1293        @Override
1294        public boolean isEmpty() {
1295                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myCollector,  myComment,  myCollected,  myQuantity,  myMethod,  myBodySite);
1296        }
1297        
1298        @Override
1299        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1300                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCollector, myComment, myCollected, myQuantity, myMethod, myBodySite);
1301        }
1302
1303        /**
1304         * Gets the value(s) for <b>collector</b> ().
1305         * creating it if it does
1306         * not exist. Will not return <code>null</code>.
1307         *
1308     * <p>
1309     * <b>Definition:</b>
1310     * Person who collected the specimen
1311     * </p> 
1312         */
1313        public ResourceReferenceDt getCollector() {  
1314                if (myCollector == null) {
1315                        myCollector = new ResourceReferenceDt();
1316                }
1317                return myCollector;
1318        }
1319
1320        /**
1321         * Sets the value(s) for <b>collector</b> ()
1322         *
1323     * <p>
1324     * <b>Definition:</b>
1325     * Person who collected the specimen
1326     * </p> 
1327         */
1328        public Collection setCollector(ResourceReferenceDt theValue) {
1329                myCollector = theValue;
1330                return this;
1331        }
1332        
1333        
1334
1335  
1336        /**
1337         * Gets the value(s) for <b>comment</b> ().
1338         * creating it if it does
1339         * not exist. Will not return <code>null</code>.
1340         *
1341     * <p>
1342     * <b>Definition:</b>
1343     * To communicate any details or issues encountered during the specimen collection procedure.
1344     * </p> 
1345         */
1346        public java.util.List<StringDt> getComment() {  
1347                if (myComment == null) {
1348                        myComment = new java.util.ArrayList<StringDt>();
1349                }
1350                return myComment;
1351        }
1352
1353        /**
1354         * Sets the value(s) for <b>comment</b> ()
1355         *
1356     * <p>
1357     * <b>Definition:</b>
1358     * To communicate any details or issues encountered during the specimen collection procedure.
1359     * </p> 
1360         */
1361        public Collection setComment(java.util.List<StringDt> theValue) {
1362                myComment = theValue;
1363                return this;
1364        }
1365        
1366        
1367
1368        /**
1369         * Adds and returns a new value for <b>comment</b> ()
1370         *
1371     * <p>
1372     * <b>Definition:</b>
1373     * To communicate any details or issues encountered during the specimen collection procedure.
1374     * </p> 
1375         */
1376        public StringDt addComment() {
1377                StringDt newType = new StringDt();
1378                getComment().add(newType);
1379                return newType; 
1380        }
1381
1382        /**
1383         * Adds a given new value for <b>comment</b> ()
1384         *
1385         * <p>
1386         * <b>Definition:</b>
1387         * To communicate any details or issues encountered during the specimen collection procedure.
1388         * </p>
1389         * @param theValue The comment to add (must not be <code>null</code>)
1390         */
1391        public Collection addComment(StringDt theValue) {
1392                if (theValue == null) {
1393                        throw new NullPointerException("theValue must not be null");
1394                }
1395                getComment().add(theValue);
1396                return this;
1397        }
1398
1399        /**
1400         * Gets the first repetition for <b>comment</b> (),
1401         * creating it if it does not already exist.
1402         *
1403     * <p>
1404     * <b>Definition:</b>
1405     * To communicate any details or issues encountered during the specimen collection procedure.
1406     * </p> 
1407         */
1408        public StringDt getCommentFirstRep() {
1409                if (getComment().isEmpty()) {
1410                        return addComment();
1411                }
1412                return getComment().get(0); 
1413        }
1414        /**
1415         * Adds a new value for <b>comment</b> ()
1416         *
1417     * <p>
1418     * <b>Definition:</b>
1419     * To communicate any details or issues encountered during the specimen collection procedure.
1420     * </p> 
1421     *
1422     * @return Returns a reference to this object, to allow for simple chaining.
1423         */
1424        public Collection addComment( String theString) {
1425                if (myComment == null) {
1426                        myComment = new java.util.ArrayList<StringDt>();
1427                }
1428                myComment.add(new StringDt(theString));
1429                return this; 
1430        }
1431
1432 
1433        /**
1434         * Gets the value(s) for <b>collected[x]</b> (when.init).
1435         * creating it if it does
1436         * not exist. Will not return <code>null</code>.
1437         *
1438     * <p>
1439     * <b>Definition:</b>
1440     * Time when specimen was collected from subject - the physiologically relevant time
1441     * </p> 
1442         */
1443        public IDatatype getCollected() {  
1444                return myCollected;
1445        }
1446
1447        /**
1448         * Sets the value(s) for <b>collected[x]</b> (when.init)
1449         *
1450     * <p>
1451     * <b>Definition:</b>
1452     * Time when specimen was collected from subject - the physiologically relevant time
1453     * </p> 
1454         */
1455        public Collection setCollected(IDatatype theValue) {
1456                myCollected = theValue;
1457                return this;
1458        }
1459        
1460        
1461
1462  
1463        /**
1464         * Gets the value(s) for <b>quantity</b> ().
1465         * creating it if it does
1466         * not exist. Will not return <code>null</code>.
1467         *
1468     * <p>
1469     * <b>Definition:</b>
1470     * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.
1471     * </p> 
1472         */
1473        public SimpleQuantityDt getQuantity() {  
1474                if (myQuantity == null) {
1475                        myQuantity = new SimpleQuantityDt();
1476                }
1477                return myQuantity;
1478        }
1479
1480        /**
1481         * Sets the value(s) for <b>quantity</b> ()
1482         *
1483     * <p>
1484     * <b>Definition:</b>
1485     * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.
1486     * </p> 
1487         */
1488        public Collection setQuantity(SimpleQuantityDt theValue) {
1489                myQuantity = theValue;
1490                return this;
1491        }
1492        
1493        
1494
1495  
1496        /**
1497         * Gets the value(s) for <b>method</b> ().
1498         * creating it if it does
1499         * not exist. Will not return <code>null</code>.
1500         *
1501     * <p>
1502     * <b>Definition:</b>
1503     * A coded value specifying the technique that is used to perform the procedure
1504     * </p> 
1505         */
1506        public BoundCodeableConceptDt<SpecimenCollectionMethodEnum> getMethod() {  
1507                if (myMethod == null) {
1508                        myMethod = new BoundCodeableConceptDt<SpecimenCollectionMethodEnum>(SpecimenCollectionMethodEnum.VALUESET_BINDER);
1509                }
1510                return myMethod;
1511        }
1512
1513        /**
1514         * Sets the value(s) for <b>method</b> ()
1515         *
1516     * <p>
1517     * <b>Definition:</b>
1518     * A coded value specifying the technique that is used to perform the procedure
1519     * </p> 
1520         */
1521        public Collection setMethod(BoundCodeableConceptDt<SpecimenCollectionMethodEnum> theValue) {
1522                myMethod = theValue;
1523                return this;
1524        }
1525        
1526        
1527
1528        /**
1529         * Sets the value(s) for <b>method</b> ()
1530         *
1531     * <p>
1532     * <b>Definition:</b>
1533     * A coded value specifying the technique that is used to perform the procedure
1534     * </p> 
1535         */
1536        public Collection setMethod(SpecimenCollectionMethodEnum theValue) {
1537                setMethod(new BoundCodeableConceptDt<SpecimenCollectionMethodEnum>(SpecimenCollectionMethodEnum.VALUESET_BINDER, theValue));
1538                
1539/*
1540                getMethod().setValueAsEnum(theValue);
1541*/
1542                return this;
1543        }
1544
1545  
1546        /**
1547         * Gets the value(s) for <b>bodySite</b> ().
1548         * creating it if it does
1549         * not exist. Will not return <code>null</code>.
1550         *
1551     * <p>
1552     * <b>Definition:</b>
1553     * Anatomical location from which the specimen was collected (if subject is a patient). This is the target site.  This element is not used for environmental specimens.
1554     * </p> 
1555         */
1556        public CodeableConceptDt getBodySite() {  
1557                if (myBodySite == null) {
1558                        myBodySite = new CodeableConceptDt();
1559                }
1560                return myBodySite;
1561        }
1562
1563        /**
1564         * Sets the value(s) for <b>bodySite</b> ()
1565         *
1566     * <p>
1567     * <b>Definition:</b>
1568     * Anatomical location from which the specimen was collected (if subject is a patient). This is the target site.  This element is not used for environmental specimens.
1569     * </p> 
1570         */
1571        public Collection setBodySite(CodeableConceptDt theValue) {
1572                myBodySite = theValue;
1573                return this;
1574        }
1575        
1576        
1577
1578  
1579
1580
1581        }
1582
1583
1584        /**
1585         * Block class for child element: <b>Specimen.treatment</b> ()
1586         *
1587     * <p>
1588     * <b>Definition:</b>
1589     * Details concerning treatment and processing steps for the specimen
1590     * </p> 
1591         */
1592        @Block()        
1593        public static class Treatment 
1594            extends  BaseIdentifiableElement        implements IResourceBlock {
1595        
1596        @Child(name="description", type=StringDt.class, order=0, min=0, max=1, summary=false, modifier=false)   
1597        @Description(
1598                shortDefinition="",
1599                formalDefinition=""
1600        )
1601        private StringDt myDescription;
1602        
1603        @Child(name="procedure", type=CodeableConceptDt.class, order=1, min=0, max=1, summary=false, modifier=false)    
1604        @Description(
1605                shortDefinition="",
1606                formalDefinition="A coded value specifying the procedure used to process the specimen"
1607        )
1608        private CodeableConceptDt myProcedure;
1609        
1610        @Child(name="additive", order=2, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
1611                ca.uhn.fhir.model.dstu2.resource.Substance.class        })
1612        @Description(
1613                shortDefinition="",
1614                formalDefinition=""
1615        )
1616        private java.util.List<ResourceReferenceDt> myAdditive;
1617        
1618
1619        @Override
1620        public boolean isEmpty() {
1621                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myDescription,  myProcedure,  myAdditive);
1622        }
1623        
1624        @Override
1625        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1626                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDescription, myProcedure, myAdditive);
1627        }
1628
1629        /**
1630         * Gets the value(s) for <b>description</b> ().
1631         * creating it if it does
1632         * not exist. Will not return <code>null</code>.
1633         *
1634     * <p>
1635     * <b>Definition:</b>
1636     * 
1637     * </p> 
1638         */
1639        public StringDt getDescriptionElement() {  
1640                if (myDescription == null) {
1641                        myDescription = new StringDt();
1642                }
1643                return myDescription;
1644        }
1645
1646        
1647        /**
1648         * Gets the value(s) for <b>description</b> ().
1649         * creating it if it does
1650         * not exist. Will not return <code>null</code>.
1651         *
1652     * <p>
1653     * <b>Definition:</b>
1654     * 
1655     * </p> 
1656         */
1657        public String getDescription() {  
1658                return getDescriptionElement().getValue();
1659        }
1660
1661        /**
1662         * Sets the value(s) for <b>description</b> ()
1663         *
1664     * <p>
1665     * <b>Definition:</b>
1666     * 
1667     * </p> 
1668         */
1669        public Treatment setDescription(StringDt theValue) {
1670                myDescription = theValue;
1671                return this;
1672        }
1673        
1674        
1675
1676        /**
1677         * Sets the value for <b>description</b> ()
1678         *
1679     * <p>
1680     * <b>Definition:</b>
1681     * 
1682     * </p> 
1683         */
1684        public Treatment setDescription( String theString) {
1685                myDescription = new StringDt(theString); 
1686                return this; 
1687        }
1688
1689 
1690        /**
1691         * Gets the value(s) for <b>procedure</b> ().
1692         * creating it if it does
1693         * not exist. Will not return <code>null</code>.
1694         *
1695     * <p>
1696     * <b>Definition:</b>
1697     * A coded value specifying the procedure used to process the specimen
1698     * </p> 
1699         */
1700        public CodeableConceptDt getProcedure() {  
1701                if (myProcedure == null) {
1702                        myProcedure = new CodeableConceptDt();
1703                }
1704                return myProcedure;
1705        }
1706
1707        /**
1708         * Sets the value(s) for <b>procedure</b> ()
1709         *
1710     * <p>
1711     * <b>Definition:</b>
1712     * A coded value specifying the procedure used to process the specimen
1713     * </p> 
1714         */
1715        public Treatment setProcedure(CodeableConceptDt theValue) {
1716                myProcedure = theValue;
1717                return this;
1718        }
1719        
1720        
1721
1722  
1723        /**
1724         * Gets the value(s) for <b>additive</b> ().
1725         * creating it if it does
1726         * not exist. Will not return <code>null</code>.
1727         *
1728     * <p>
1729     * <b>Definition:</b>
1730     * 
1731     * </p> 
1732         */
1733        public java.util.List<ResourceReferenceDt> getAdditive() {  
1734                if (myAdditive == null) {
1735                        myAdditive = new java.util.ArrayList<ResourceReferenceDt>();
1736                }
1737                return myAdditive;
1738        }
1739
1740        /**
1741         * Sets the value(s) for <b>additive</b> ()
1742         *
1743     * <p>
1744     * <b>Definition:</b>
1745     * 
1746     * </p> 
1747         */
1748        public Treatment setAdditive(java.util.List<ResourceReferenceDt> theValue) {
1749                myAdditive = theValue;
1750                return this;
1751        }
1752        
1753        
1754
1755        /**
1756         * Adds and returns a new value for <b>additive</b> ()
1757         *
1758     * <p>
1759     * <b>Definition:</b>
1760     * 
1761     * </p> 
1762         */
1763        public ResourceReferenceDt addAdditive() {
1764                ResourceReferenceDt newType = new ResourceReferenceDt();
1765                getAdditive().add(newType);
1766                return newType; 
1767        }
1768  
1769
1770
1771        }
1772
1773
1774        /**
1775         * Block class for child element: <b>Specimen.container</b> ()
1776         *
1777     * <p>
1778     * <b>Definition:</b>
1779     * The container holding the specimen.  The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.
1780     * </p> 
1781         */
1782        @Block()        
1783        public static class Container 
1784            extends  BaseIdentifiableElement        implements IResourceBlock {
1785        
1786        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)       
1787        @Description(
1788                shortDefinition="",
1789                formalDefinition="Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances."
1790        )
1791        private java.util.List<IdentifierDt> myIdentifier;
1792        
1793        @Child(name="description", type=StringDt.class, order=1, min=0, max=1, summary=false, modifier=false)   
1794        @Description(
1795                shortDefinition="",
1796                formalDefinition=""
1797        )
1798        private StringDt myDescription;
1799        
1800        @Child(name="type", type=CodeableConceptDt.class, order=2, min=0, max=1, summary=false, modifier=false) 
1801        @Description(
1802                shortDefinition="",
1803                formalDefinition="The type of container associated with the specimen (e.g. slide, aliquot, etc.)"
1804        )
1805        private CodeableConceptDt myType;
1806        
1807        @Child(name="capacity", type=SimpleQuantityDt.class, order=3, min=0, max=1, summary=false, modifier=false)      
1808        @Description(
1809                shortDefinition="",
1810                formalDefinition="The capacity (volume or other measure) the container may contain."
1811        )
1812        private SimpleQuantityDt myCapacity;
1813        
1814        @Child(name="specimenQuantity", type=SimpleQuantityDt.class, order=4, min=0, max=1, summary=false, modifier=false)      
1815        @Description(
1816                shortDefinition="",
1817                formalDefinition="The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type."
1818        )
1819        private SimpleQuantityDt mySpecimenQuantity;
1820        
1821        @Child(name="additive", order=5, min=0, max=1, summary=false, modifier=false, type={
1822                CodeableConceptDt.class,                Substance.class })
1823        @Description(
1824                shortDefinition="",
1825                formalDefinition="Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA"
1826        )
1827        private IDatatype myAdditive;
1828        
1829
1830        @Override
1831        public boolean isEmpty() {
1832                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myDescription,  myType,  myCapacity,  mySpecimenQuantity,  myAdditive);
1833        }
1834        
1835        @Override
1836        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1837                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myDescription, myType, myCapacity, mySpecimenQuantity, myAdditive);
1838        }
1839
1840        /**
1841         * Gets the value(s) for <b>identifier</b> ().
1842         * creating it if it does
1843         * not exist. Will not return <code>null</code>.
1844         *
1845     * <p>
1846     * <b>Definition:</b>
1847     * Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.
1848     * </p> 
1849         */
1850        public java.util.List<IdentifierDt> getIdentifier() {  
1851                if (myIdentifier == null) {
1852                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
1853                }
1854                return myIdentifier;
1855        }
1856
1857        /**
1858         * Sets the value(s) for <b>identifier</b> ()
1859         *
1860     * <p>
1861     * <b>Definition:</b>
1862     * Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.
1863     * </p> 
1864         */
1865        public Container setIdentifier(java.util.List<IdentifierDt> theValue) {
1866                myIdentifier = theValue;
1867                return this;
1868        }
1869        
1870        
1871
1872        /**
1873         * Adds and returns a new value for <b>identifier</b> ()
1874         *
1875     * <p>
1876     * <b>Definition:</b>
1877     * Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.
1878     * </p> 
1879         */
1880        public IdentifierDt addIdentifier() {
1881                IdentifierDt newType = new IdentifierDt();
1882                getIdentifier().add(newType);
1883                return newType; 
1884        }
1885
1886        /**
1887         * Adds a given new value for <b>identifier</b> ()
1888         *
1889         * <p>
1890         * <b>Definition:</b>
1891         * Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.
1892         * </p>
1893         * @param theValue The identifier to add (must not be <code>null</code>)
1894         */
1895        public Container addIdentifier(IdentifierDt theValue) {
1896                if (theValue == null) {
1897                        throw new NullPointerException("theValue must not be null");
1898                }
1899                getIdentifier().add(theValue);
1900                return this;
1901        }
1902
1903        /**
1904         * Gets the first repetition for <b>identifier</b> (),
1905         * creating it if it does not already exist.
1906         *
1907     * <p>
1908     * <b>Definition:</b>
1909     * Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.
1910     * </p> 
1911         */
1912        public IdentifierDt getIdentifierFirstRep() {
1913                if (getIdentifier().isEmpty()) {
1914                        return addIdentifier();
1915                }
1916                return getIdentifier().get(0); 
1917        }
1918  
1919        /**
1920         * Gets the value(s) for <b>description</b> ().
1921         * creating it if it does
1922         * not exist. Will not return <code>null</code>.
1923         *
1924     * <p>
1925     * <b>Definition:</b>
1926     * 
1927     * </p> 
1928         */
1929        public StringDt getDescriptionElement() {  
1930                if (myDescription == null) {
1931                        myDescription = new StringDt();
1932                }
1933                return myDescription;
1934        }
1935
1936        
1937        /**
1938         * Gets the value(s) for <b>description</b> ().
1939         * creating it if it does
1940         * not exist. Will not return <code>null</code>.
1941         *
1942     * <p>
1943     * <b>Definition:</b>
1944     * 
1945     * </p> 
1946         */
1947        public String getDescription() {  
1948                return getDescriptionElement().getValue();
1949        }
1950
1951        /**
1952         * Sets the value(s) for <b>description</b> ()
1953         *
1954     * <p>
1955     * <b>Definition:</b>
1956     * 
1957     * </p> 
1958         */
1959        public Container setDescription(StringDt theValue) {
1960                myDescription = theValue;
1961                return this;
1962        }
1963        
1964        
1965
1966        /**
1967         * Sets the value for <b>description</b> ()
1968         *
1969     * <p>
1970     * <b>Definition:</b>
1971     * 
1972     * </p> 
1973         */
1974        public Container setDescription( String theString) {
1975                myDescription = new StringDt(theString); 
1976                return this; 
1977        }
1978
1979 
1980        /**
1981         * Gets the value(s) for <b>type</b> ().
1982         * creating it if it does
1983         * not exist. Will not return <code>null</code>.
1984         *
1985     * <p>
1986     * <b>Definition:</b>
1987     * The type of container associated with the specimen (e.g. slide, aliquot, etc.)
1988     * </p> 
1989         */
1990        public CodeableConceptDt getType() {  
1991                if (myType == null) {
1992                        myType = new CodeableConceptDt();
1993                }
1994                return myType;
1995        }
1996
1997        /**
1998         * Sets the value(s) for <b>type</b> ()
1999         *
2000     * <p>
2001     * <b>Definition:</b>
2002     * The type of container associated with the specimen (e.g. slide, aliquot, etc.)
2003     * </p> 
2004         */
2005        public Container setType(CodeableConceptDt theValue) {
2006                myType = theValue;
2007                return this;
2008        }
2009        
2010        
2011
2012  
2013        /**
2014         * Gets the value(s) for <b>capacity</b> ().
2015         * creating it if it does
2016         * not exist. Will not return <code>null</code>.
2017         *
2018     * <p>
2019     * <b>Definition:</b>
2020     * The capacity (volume or other measure) the container may contain.
2021     * </p> 
2022         */
2023        public SimpleQuantityDt getCapacity() {  
2024                if (myCapacity == null) {
2025                        myCapacity = new SimpleQuantityDt();
2026                }
2027                return myCapacity;
2028        }
2029
2030        /**
2031         * Sets the value(s) for <b>capacity</b> ()
2032         *
2033     * <p>
2034     * <b>Definition:</b>
2035     * The capacity (volume or other measure) the container may contain.
2036     * </p> 
2037         */
2038        public Container setCapacity(SimpleQuantityDt theValue) {
2039                myCapacity = theValue;
2040                return this;
2041        }
2042        
2043        
2044
2045  
2046        /**
2047         * Gets the value(s) for <b>specimenQuantity</b> ().
2048         * creating it if it does
2049         * not exist. Will not return <code>null</code>.
2050         *
2051     * <p>
2052     * <b>Definition:</b>
2053     * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.
2054     * </p> 
2055         */
2056        public SimpleQuantityDt getSpecimenQuantity() {  
2057                if (mySpecimenQuantity == null) {
2058                        mySpecimenQuantity = new SimpleQuantityDt();
2059                }
2060                return mySpecimenQuantity;
2061        }
2062
2063        /**
2064         * Sets the value(s) for <b>specimenQuantity</b> ()
2065         *
2066     * <p>
2067     * <b>Definition:</b>
2068     * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.
2069     * </p> 
2070         */
2071        public Container setSpecimenQuantity(SimpleQuantityDt theValue) {
2072                mySpecimenQuantity = theValue;
2073                return this;
2074        }
2075        
2076        
2077
2078  
2079        /**
2080         * Gets the value(s) for <b>additive[x]</b> ().
2081         * creating it if it does
2082         * not exist. Will not return <code>null</code>.
2083         *
2084     * <p>
2085     * <b>Definition:</b>
2086     * Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA
2087     * </p> 
2088         */
2089        public IDatatype getAdditive() {  
2090                return myAdditive;
2091        }
2092
2093        /**
2094         * Sets the value(s) for <b>additive[x]</b> ()
2095         *
2096     * <p>
2097     * <b>Definition:</b>
2098     * Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA
2099     * </p> 
2100         */
2101        public Container setAdditive(IDatatype theValue) {
2102                myAdditive = theValue;
2103                return this;
2104        }
2105        
2106        
2107
2108  
2109
2110
2111        }
2112
2113
2114
2115
2116    @Override
2117    public String getResourceName() {
2118        return "Specimen";
2119    }
2120    
2121    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
2122        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
2123    }
2124
2125
2126}