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