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