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>Medication</b> Resource
282 * (clinical.medication)
283 *
284 * <p>
285 * <b>Definition:</b>
286 * This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication.
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/Medication">http://hl7.org/fhir/profiles/Medication</a> 
297 * </p>
298 *
299 */
300@ResourceDef(name="Medication", profile="http://hl7.org/fhir/profiles/Medication", id="medication")
301public class Medication extends ca.uhn.fhir.model.dstu2.resource.BaseResource
302    implements  IResource     {
303
304        /**
305         * Search parameter constant for <b>code</b>
306         * <p>
307         * Description: <b></b><br>
308         * Type: <b>token</b><br>
309         * Path: <b>Medication.code</b><br>
310         * </p>
311         */
312        @SearchParamDefinition(name="code", path="Medication.code", description="", type="token"  )
313        public static final String SP_CODE = "code";
314
315        /**
316         * <b>Fluent Client</b> search parameter constant for <b>code</b>
317         * <p>
318         * Description: <b></b><br>
319         * Type: <b>token</b><br>
320         * Path: <b>Medication.code</b><br>
321         * </p>
322         */
323        public static final TokenClientParam CODE = new TokenClientParam(SP_CODE);
324
325        /**
326         * Search parameter constant for <b>manufacturer</b>
327         * <p>
328         * Description: <b></b><br>
329         * Type: <b>reference</b><br>
330         * Path: <b>Medication.manufacturer</b><br>
331         * </p>
332         */
333        @SearchParamDefinition(name="manufacturer", path="Medication.manufacturer", description="", type="reference"  )
334        public static final String SP_MANUFACTURER = "manufacturer";
335
336        /**
337         * <b>Fluent Client</b> search parameter constant for <b>manufacturer</b>
338         * <p>
339         * Description: <b></b><br>
340         * Type: <b>reference</b><br>
341         * Path: <b>Medication.manufacturer</b><br>
342         * </p>
343         */
344        public static final ReferenceClientParam MANUFACTURER = new ReferenceClientParam(SP_MANUFACTURER);
345
346        /**
347         * Search parameter constant for <b>form</b>
348         * <p>
349         * Description: <b></b><br>
350         * Type: <b>token</b><br>
351         * Path: <b>Medication.product.form</b><br>
352         * </p>
353         */
354        @SearchParamDefinition(name="form", path="Medication.product.form", description="", type="token"  )
355        public static final String SP_FORM = "form";
356
357        /**
358         * <b>Fluent Client</b> search parameter constant for <b>form</b>
359         * <p>
360         * Description: <b></b><br>
361         * Type: <b>token</b><br>
362         * Path: <b>Medication.product.form</b><br>
363         * </p>
364         */
365        public static final TokenClientParam FORM = new TokenClientParam(SP_FORM);
366
367        /**
368         * Search parameter constant for <b>ingredient</b>
369         * <p>
370         * Description: <b></b><br>
371         * Type: <b>reference</b><br>
372         * Path: <b>Medication.product.ingredient.item</b><br>
373         * </p>
374         */
375        @SearchParamDefinition(name="ingredient", path="Medication.product.ingredient.item", description="", type="reference"  )
376        public static final String SP_INGREDIENT = "ingredient";
377
378        /**
379         * <b>Fluent Client</b> search parameter constant for <b>ingredient</b>
380         * <p>
381         * Description: <b></b><br>
382         * Type: <b>reference</b><br>
383         * Path: <b>Medication.product.ingredient.item</b><br>
384         * </p>
385         */
386        public static final ReferenceClientParam INGREDIENT = new ReferenceClientParam(SP_INGREDIENT);
387
388        /**
389         * Search parameter constant for <b>container</b>
390         * <p>
391         * Description: <b></b><br>
392         * Type: <b>token</b><br>
393         * Path: <b>Medication.package.container</b><br>
394         * </p>
395         */
396        @SearchParamDefinition(name="container", path="Medication.package.container", description="", type="token"  )
397        public static final String SP_CONTAINER = "container";
398
399        /**
400         * <b>Fluent Client</b> search parameter constant for <b>container</b>
401         * <p>
402         * Description: <b></b><br>
403         * Type: <b>token</b><br>
404         * Path: <b>Medication.package.container</b><br>
405         * </p>
406         */
407        public static final TokenClientParam CONTAINER = new TokenClientParam(SP_CONTAINER);
408
409        /**
410         * Search parameter constant for <b>content</b>
411         * <p>
412         * Description: <b></b><br>
413         * Type: <b>reference</b><br>
414         * Path: <b>Medication.package.content.item</b><br>
415         * </p>
416         */
417        @SearchParamDefinition(name="content", path="Medication.package.content.item", description="", type="reference"  )
418        public static final String SP_CONTENT = "content";
419
420        /**
421         * <b>Fluent Client</b> search parameter constant for <b>content</b>
422         * <p>
423         * Description: <b></b><br>
424         * Type: <b>reference</b><br>
425         * Path: <b>Medication.package.content.item</b><br>
426         * </p>
427         */
428        public static final ReferenceClientParam CONTENT = new ReferenceClientParam(SP_CONTENT);
429
430
431        /**
432         * Constant for fluent queries to be used to add include statements. Specifies
433         * the path value of "<b>Medication:content</b>".
434         */
435        public static final Include INCLUDE_CONTENT = new Include("Medication:content");
436
437        /**
438         * Constant for fluent queries to be used to add include statements. Specifies
439         * the path value of "<b>Medication:ingredient</b>".
440         */
441        public static final Include INCLUDE_INGREDIENT = new Include("Medication:ingredient");
442
443        /**
444         * Constant for fluent queries to be used to add include statements. Specifies
445         * the path value of "<b>Medication:manufacturer</b>".
446         */
447        public static final Include INCLUDE_MANUFACTURER = new Include("Medication:manufacturer");
448
449
450        @Child(name="code", type=CodeableConceptDt.class, order=0, min=0, max=1, summary=true, modifier=false)  
451        @Description(
452                shortDefinition="class",
453                formalDefinition="A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems."
454        )
455        private CodeableConceptDt myCode;
456        
457        @Child(name="isBrand", type=BooleanDt.class, order=1, min=0, max=1, summary=true, modifier=false)       
458        @Description(
459                shortDefinition="class",
460                formalDefinition="Set to true if the item is attributable to a specific manufacturer."
461        )
462        private BooleanDt myIsBrand;
463        
464        @Child(name="manufacturer", order=2, min=0, max=1, summary=true, modifier=false, type={
465                ca.uhn.fhir.model.dstu2.resource.Organization.class     })
466        @Description(
467                shortDefinition="who.actor",
468                formalDefinition="Describes the details of the manufacturer"
469        )
470        private ResourceReferenceDt myManufacturer;
471        
472        @Child(name="product", order=3, min=0, max=1, summary=false, modifier=false)    
473        @Description(
474                shortDefinition="",
475                formalDefinition="Information that only applies to products (not packages)"
476        )
477        private Product myProduct;
478        
479        @Child(name="package", order=4, min=0, max=1, summary=false, modifier=false)    
480        @Description(
481                shortDefinition="",
482                formalDefinition="Information that only applies to packages (not products)"
483        )
484        private Package myPackage;
485        
486
487        @Override
488        public boolean isEmpty() {
489                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myCode,  myIsBrand,  myManufacturer,  myProduct,  myPackage);
490        }
491        
492        @Override
493        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
494                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myIsBrand, myManufacturer, myProduct, myPackage);
495        }
496
497        /**
498         * Gets the value(s) for <b>code</b> (class).
499         * creating it if it does
500         * not exist. Will not return <code>null</code>.
501         *
502     * <p>
503     * <b>Definition:</b>
504     * A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.
505     * </p> 
506         */
507        public CodeableConceptDt getCode() {  
508                if (myCode == null) {
509                        myCode = new CodeableConceptDt();
510                }
511                return myCode;
512        }
513
514        /**
515         * Sets the value(s) for <b>code</b> (class)
516         *
517     * <p>
518     * <b>Definition:</b>
519     * A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.
520     * </p> 
521         */
522        public Medication setCode(CodeableConceptDt theValue) {
523                myCode = theValue;
524                return this;
525        }
526        
527        
528
529  
530        /**
531         * Gets the value(s) for <b>isBrand</b> (class).
532         * creating it if it does
533         * not exist. Will not return <code>null</code>.
534         *
535     * <p>
536     * <b>Definition:</b>
537     * Set to true if the item is attributable to a specific manufacturer.
538     * </p> 
539         */
540        public BooleanDt getIsBrandElement() {  
541                if (myIsBrand == null) {
542                        myIsBrand = new BooleanDt();
543                }
544                return myIsBrand;
545        }
546
547        
548        /**
549         * Gets the value(s) for <b>isBrand</b> (class).
550         * creating it if it does
551         * not exist. This method may return <code>null</code>.
552         *
553     * <p>
554     * <b>Definition:</b>
555     * Set to true if the item is attributable to a specific manufacturer.
556     * </p> 
557         */
558        public Boolean getIsBrand() {  
559                return getIsBrandElement().getValue();
560        }
561
562        /**
563         * Sets the value(s) for <b>isBrand</b> (class)
564         *
565     * <p>
566     * <b>Definition:</b>
567     * Set to true if the item is attributable to a specific manufacturer.
568     * </p> 
569         */
570        public Medication setIsBrand(BooleanDt theValue) {
571                myIsBrand = theValue;
572                return this;
573        }
574        
575        
576
577        /**
578         * Sets the value for <b>isBrand</b> (class)
579         *
580     * <p>
581     * <b>Definition:</b>
582     * Set to true if the item is attributable to a specific manufacturer.
583     * </p> 
584         */
585        public Medication setIsBrand( boolean theBoolean) {
586                myIsBrand = new BooleanDt(theBoolean); 
587                return this; 
588        }
589
590 
591        /**
592         * Gets the value(s) for <b>manufacturer</b> (who.actor).
593         * creating it if it does
594         * not exist. Will not return <code>null</code>.
595         *
596     * <p>
597     * <b>Definition:</b>
598     * Describes the details of the manufacturer
599     * </p> 
600         */
601        public ResourceReferenceDt getManufacturer() {  
602                if (myManufacturer == null) {
603                        myManufacturer = new ResourceReferenceDt();
604                }
605                return myManufacturer;
606        }
607
608        /**
609         * Sets the value(s) for <b>manufacturer</b> (who.actor)
610         *
611     * <p>
612     * <b>Definition:</b>
613     * Describes the details of the manufacturer
614     * </p> 
615         */
616        public Medication setManufacturer(ResourceReferenceDt theValue) {
617                myManufacturer = theValue;
618                return this;
619        }
620        
621        
622
623  
624        /**
625         * Gets the value(s) for <b>product</b> ().
626         * creating it if it does
627         * not exist. Will not return <code>null</code>.
628         *
629     * <p>
630     * <b>Definition:</b>
631     * Information that only applies to products (not packages)
632     * </p> 
633         */
634        public Product getProduct() {  
635                if (myProduct == null) {
636                        myProduct = new Product();
637                }
638                return myProduct;
639        }
640
641        /**
642         * Sets the value(s) for <b>product</b> ()
643         *
644     * <p>
645     * <b>Definition:</b>
646     * Information that only applies to products (not packages)
647     * </p> 
648         */
649        public Medication setProduct(Product theValue) {
650                myProduct = theValue;
651                return this;
652        }
653        
654        
655
656  
657        /**
658         * Gets the value(s) for <b>package</b> ().
659         * creating it if it does
660         * not exist. Will not return <code>null</code>.
661         *
662     * <p>
663     * <b>Definition:</b>
664     * Information that only applies to packages (not products)
665     * </p> 
666         */
667        public Package getPackage() {  
668                if (myPackage == null) {
669                        myPackage = new Package();
670                }
671                return myPackage;
672        }
673
674        /**
675         * Sets the value(s) for <b>package</b> ()
676         *
677     * <p>
678     * <b>Definition:</b>
679     * Information that only applies to packages (not products)
680     * </p> 
681         */
682        public Medication setPackage(Package theValue) {
683                myPackage = theValue;
684                return this;
685        }
686        
687        
688
689  
690        /**
691         * Block class for child element: <b>Medication.product</b> ()
692         *
693     * <p>
694     * <b>Definition:</b>
695     * Information that only applies to products (not packages)
696     * </p> 
697         */
698        @Block()        
699        public static class Product 
700            extends  BaseIdentifiableElement        implements IResourceBlock {
701        
702        @Child(name="form", type=CodeableConceptDt.class, order=0, min=0, max=1, summary=false, modifier=false) 
703        @Description(
704                shortDefinition="",
705                formalDefinition="Describes the form of the item.  Powder; tablets; carton"
706        )
707        private CodeableConceptDt myForm;
708        
709        @Child(name="ingredient", order=1, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)       
710        @Description(
711                shortDefinition="",
712                formalDefinition="Identifies a particular constituent of interest in the product"
713        )
714        private java.util.List<ProductIngredient> myIngredient;
715        
716        @Child(name="batch", order=2, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)    
717        @Description(
718                shortDefinition="",
719                formalDefinition="Information about a group of medication produced or packaged from one production run."
720        )
721        private java.util.List<ProductBatch> myBatch;
722        
723
724        @Override
725        public boolean isEmpty() {
726                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myForm,  myIngredient,  myBatch);
727        }
728        
729        @Override
730        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
731                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myForm, myIngredient, myBatch);
732        }
733
734        /**
735         * Gets the value(s) for <b>form</b> ().
736         * creating it if it does
737         * not exist. Will not return <code>null</code>.
738         *
739     * <p>
740     * <b>Definition:</b>
741     * Describes the form of the item.  Powder; tablets; carton
742     * </p> 
743         */
744        public CodeableConceptDt getForm() {  
745                if (myForm == null) {
746                        myForm = new CodeableConceptDt();
747                }
748                return myForm;
749        }
750
751        /**
752         * Sets the value(s) for <b>form</b> ()
753         *
754     * <p>
755     * <b>Definition:</b>
756     * Describes the form of the item.  Powder; tablets; carton
757     * </p> 
758         */
759        public Product setForm(CodeableConceptDt theValue) {
760                myForm = theValue;
761                return this;
762        }
763        
764        
765
766  
767        /**
768         * Gets the value(s) for <b>ingredient</b> ().
769         * creating it if it does
770         * not exist. Will not return <code>null</code>.
771         *
772     * <p>
773     * <b>Definition:</b>
774     * Identifies a particular constituent of interest in the product
775     * </p> 
776         */
777        public java.util.List<ProductIngredient> getIngredient() {  
778                if (myIngredient == null) {
779                        myIngredient = new java.util.ArrayList<ProductIngredient>();
780                }
781                return myIngredient;
782        }
783
784        /**
785         * Sets the value(s) for <b>ingredient</b> ()
786         *
787     * <p>
788     * <b>Definition:</b>
789     * Identifies a particular constituent of interest in the product
790     * </p> 
791         */
792        public Product setIngredient(java.util.List<ProductIngredient> theValue) {
793                myIngredient = theValue;
794                return this;
795        }
796        
797        
798
799        /**
800         * Adds and returns a new value for <b>ingredient</b> ()
801         *
802     * <p>
803     * <b>Definition:</b>
804     * Identifies a particular constituent of interest in the product
805     * </p> 
806         */
807        public ProductIngredient addIngredient() {
808                ProductIngredient newType = new ProductIngredient();
809                getIngredient().add(newType);
810                return newType; 
811        }
812
813        /**
814         * Adds a given new value for <b>ingredient</b> ()
815         *
816         * <p>
817         * <b>Definition:</b>
818         * Identifies a particular constituent of interest in the product
819         * </p>
820         * @param theValue The ingredient to add (must not be <code>null</code>)
821         */
822        public Product addIngredient(ProductIngredient theValue) {
823                if (theValue == null) {
824                        throw new NullPointerException("theValue must not be null");
825                }
826                getIngredient().add(theValue);
827                return this;
828        }
829
830        /**
831         * Gets the first repetition for <b>ingredient</b> (),
832         * creating it if it does not already exist.
833         *
834     * <p>
835     * <b>Definition:</b>
836     * Identifies a particular constituent of interest in the product
837     * </p> 
838         */
839        public ProductIngredient getIngredientFirstRep() {
840                if (getIngredient().isEmpty()) {
841                        return addIngredient();
842                }
843                return getIngredient().get(0); 
844        }
845  
846        /**
847         * Gets the value(s) for <b>batch</b> ().
848         * creating it if it does
849         * not exist. Will not return <code>null</code>.
850         *
851     * <p>
852     * <b>Definition:</b>
853     * Information about a group of medication produced or packaged from one production run.
854     * </p> 
855         */
856        public java.util.List<ProductBatch> getBatch() {  
857                if (myBatch == null) {
858                        myBatch = new java.util.ArrayList<ProductBatch>();
859                }
860                return myBatch;
861        }
862
863        /**
864         * Sets the value(s) for <b>batch</b> ()
865         *
866     * <p>
867     * <b>Definition:</b>
868     * Information about a group of medication produced or packaged from one production run.
869     * </p> 
870         */
871        public Product setBatch(java.util.List<ProductBatch> theValue) {
872                myBatch = theValue;
873                return this;
874        }
875        
876        
877
878        /**
879         * Adds and returns a new value for <b>batch</b> ()
880         *
881     * <p>
882     * <b>Definition:</b>
883     * Information about a group of medication produced or packaged from one production run.
884     * </p> 
885         */
886        public ProductBatch addBatch() {
887                ProductBatch newType = new ProductBatch();
888                getBatch().add(newType);
889                return newType; 
890        }
891
892        /**
893         * Adds a given new value for <b>batch</b> ()
894         *
895         * <p>
896         * <b>Definition:</b>
897         * Information about a group of medication produced or packaged from one production run.
898         * </p>
899         * @param theValue The batch to add (must not be <code>null</code>)
900         */
901        public Product addBatch(ProductBatch theValue) {
902                if (theValue == null) {
903                        throw new NullPointerException("theValue must not be null");
904                }
905                getBatch().add(theValue);
906                return this;
907        }
908
909        /**
910         * Gets the first repetition for <b>batch</b> (),
911         * creating it if it does not already exist.
912         *
913     * <p>
914     * <b>Definition:</b>
915     * Information about a group of medication produced or packaged from one production run.
916     * </p> 
917         */
918        public ProductBatch getBatchFirstRep() {
919                if (getBatch().isEmpty()) {
920                        return addBatch();
921                }
922                return getBatch().get(0); 
923        }
924  
925
926
927        }
928
929        /**
930         * Block class for child element: <b>Medication.product.ingredient</b> ()
931         *
932     * <p>
933     * <b>Definition:</b>
934     * Identifies a particular constituent of interest in the product
935     * </p> 
936         */
937        @Block()        
938        public static class ProductIngredient 
939            extends  BaseIdentifiableElement        implements IResourceBlock {
940        
941        @Child(name="item", order=0, min=1, max=1, summary=false, modifier=false, type={
942                ca.uhn.fhir.model.dstu2.resource.Substance.class,               ca.uhn.fhir.model.dstu2.resource.Medication.class       })
943        @Description(
944                shortDefinition="",
945                formalDefinition="The actual ingredient - either a substance (simple ingredient) or another medication"
946        )
947        private ResourceReferenceDt myItem;
948        
949        @Child(name="amount", type=RatioDt.class, order=1, min=0, max=1, summary=false, modifier=false) 
950        @Description(
951                shortDefinition="",
952                formalDefinition="Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet"
953        )
954        private RatioDt myAmount;
955        
956
957        @Override
958        public boolean isEmpty() {
959                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myItem,  myAmount);
960        }
961        
962        @Override
963        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
964                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myItem, myAmount);
965        }
966
967        /**
968         * Gets the value(s) for <b>item</b> ().
969         * creating it if it does
970         * not exist. Will not return <code>null</code>.
971         *
972     * <p>
973     * <b>Definition:</b>
974     * The actual ingredient - either a substance (simple ingredient) or another medication
975     * </p> 
976         */
977        public ResourceReferenceDt getItem() {  
978                if (myItem == null) {
979                        myItem = new ResourceReferenceDt();
980                }
981                return myItem;
982        }
983
984        /**
985         * Sets the value(s) for <b>item</b> ()
986         *
987     * <p>
988     * <b>Definition:</b>
989     * The actual ingredient - either a substance (simple ingredient) or another medication
990     * </p> 
991         */
992        public ProductIngredient setItem(ResourceReferenceDt theValue) {
993                myItem = theValue;
994                return this;
995        }
996        
997        
998
999  
1000        /**
1001         * Gets the value(s) for <b>amount</b> ().
1002         * creating it if it does
1003         * not exist. Will not return <code>null</code>.
1004         *
1005     * <p>
1006     * <b>Definition:</b>
1007     * Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet
1008     * </p> 
1009         */
1010        public RatioDt getAmount() {  
1011                if (myAmount == null) {
1012                        myAmount = new RatioDt();
1013                }
1014                return myAmount;
1015        }
1016
1017        /**
1018         * Sets the value(s) for <b>amount</b> ()
1019         *
1020     * <p>
1021     * <b>Definition:</b>
1022     * Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet
1023     * </p> 
1024         */
1025        public ProductIngredient setAmount(RatioDt theValue) {
1026                myAmount = theValue;
1027                return this;
1028        }
1029        
1030        
1031
1032  
1033
1034
1035        }
1036
1037
1038        /**
1039         * Block class for child element: <b>Medication.product.batch</b> ()
1040         *
1041     * <p>
1042     * <b>Definition:</b>
1043     * Information about a group of medication produced or packaged from one production run.
1044     * </p> 
1045         */
1046        @Block()        
1047        public static class ProductBatch 
1048            extends  BaseIdentifiableElement        implements IResourceBlock {
1049        
1050        @Child(name="lotNumber", type=StringDt.class, order=0, min=0, max=1, summary=false, modifier=false)     
1051        @Description(
1052                shortDefinition="",
1053                formalDefinition="The assigned lot number of a batch of the specified product."
1054        )
1055        private StringDt myLotNumber;
1056        
1057        @Child(name="expirationDate", type=DateTimeDt.class, order=1, min=0, max=1, summary=false, modifier=false)      
1058        @Description(
1059                shortDefinition="",
1060                formalDefinition="When this specific batch of product will expire."
1061        )
1062        private DateTimeDt myExpirationDate;
1063        
1064
1065        @Override
1066        public boolean isEmpty() {
1067                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myLotNumber,  myExpirationDate);
1068        }
1069        
1070        @Override
1071        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1072                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myLotNumber, myExpirationDate);
1073        }
1074
1075        /**
1076         * Gets the value(s) for <b>lotNumber</b> ().
1077         * creating it if it does
1078         * not exist. Will not return <code>null</code>.
1079         *
1080     * <p>
1081     * <b>Definition:</b>
1082     * The assigned lot number of a batch of the specified product.
1083     * </p> 
1084         */
1085        public StringDt getLotNumberElement() {  
1086                if (myLotNumber == null) {
1087                        myLotNumber = new StringDt();
1088                }
1089                return myLotNumber;
1090        }
1091
1092        
1093        /**
1094         * Gets the value(s) for <b>lotNumber</b> ().
1095         * creating it if it does
1096         * not exist. This method may return <code>null</code>.
1097         *
1098     * <p>
1099     * <b>Definition:</b>
1100     * The assigned lot number of a batch of the specified product.
1101     * </p> 
1102         */
1103        public String getLotNumber() {  
1104                return getLotNumberElement().getValue();
1105        }
1106
1107        /**
1108         * Sets the value(s) for <b>lotNumber</b> ()
1109         *
1110     * <p>
1111     * <b>Definition:</b>
1112     * The assigned lot number of a batch of the specified product.
1113     * </p> 
1114         */
1115        public ProductBatch setLotNumber(StringDt theValue) {
1116                myLotNumber = theValue;
1117                return this;
1118        }
1119        
1120        
1121
1122        /**
1123         * Sets the value for <b>lotNumber</b> ()
1124         *
1125     * <p>
1126     * <b>Definition:</b>
1127     * The assigned lot number of a batch of the specified product.
1128     * </p> 
1129         */
1130        public ProductBatch setLotNumber( String theString) {
1131                myLotNumber = new StringDt(theString); 
1132                return this; 
1133        }
1134
1135 
1136        /**
1137         * Gets the value(s) for <b>expirationDate</b> ().
1138         * creating it if it does
1139         * not exist. Will not return <code>null</code>.
1140         *
1141     * <p>
1142     * <b>Definition:</b>
1143     * When this specific batch of product will expire.
1144     * </p> 
1145         */
1146        public DateTimeDt getExpirationDateElement() {  
1147                if (myExpirationDate == null) {
1148                        myExpirationDate = new DateTimeDt();
1149                }
1150                return myExpirationDate;
1151        }
1152
1153        
1154        /**
1155         * Gets the value(s) for <b>expirationDate</b> ().
1156         * creating it if it does
1157         * not exist. This method may return <code>null</code>.
1158         *
1159     * <p>
1160     * <b>Definition:</b>
1161     * When this specific batch of product will expire.
1162     * </p> 
1163         */
1164        public Date getExpirationDate() {  
1165                return getExpirationDateElement().getValue();
1166        }
1167
1168        /**
1169         * Sets the value(s) for <b>expirationDate</b> ()
1170         *
1171     * <p>
1172     * <b>Definition:</b>
1173     * When this specific batch of product will expire.
1174     * </p> 
1175         */
1176        public ProductBatch setExpirationDate(DateTimeDt theValue) {
1177                myExpirationDate = theValue;
1178                return this;
1179        }
1180        
1181        
1182
1183        /**
1184         * Sets the value for <b>expirationDate</b> ()
1185         *
1186     * <p>
1187     * <b>Definition:</b>
1188     * When this specific batch of product will expire.
1189     * </p> 
1190         */
1191        public ProductBatch setExpirationDateWithSecondsPrecision( Date theDate) {
1192                myExpirationDate = new DateTimeDt(theDate); 
1193                return this; 
1194        }
1195
1196        /**
1197         * Sets the value for <b>expirationDate</b> ()
1198         *
1199     * <p>
1200     * <b>Definition:</b>
1201     * When this specific batch of product will expire.
1202     * </p> 
1203         */
1204        public ProductBatch setExpirationDate( Date theDate,  TemporalPrecisionEnum thePrecision) {
1205                myExpirationDate = new DateTimeDt(theDate, thePrecision); 
1206                return this; 
1207        }
1208
1209 
1210
1211
1212        }
1213
1214
1215
1216        /**
1217         * Block class for child element: <b>Medication.package</b> ()
1218         *
1219     * <p>
1220     * <b>Definition:</b>
1221     * Information that only applies to packages (not products)
1222     * </p> 
1223         */
1224        @Block()        
1225        public static class Package 
1226            extends  BaseIdentifiableElement        implements IResourceBlock {
1227        
1228        @Child(name="container", type=CodeableConceptDt.class, order=0, min=0, max=1, summary=false, modifier=false)    
1229        @Description(
1230                shortDefinition="",
1231                formalDefinition="The kind of container that this package comes as"
1232        )
1233        private CodeableConceptDt myContainer;
1234        
1235        @Child(name="content", order=1, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)  
1236        @Description(
1237                shortDefinition="",
1238                formalDefinition="A set of components that go to make up the described item."
1239        )
1240        private java.util.List<PackageContent> myContent;
1241        
1242
1243        @Override
1244        public boolean isEmpty() {
1245                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myContainer,  myContent);
1246        }
1247        
1248        @Override
1249        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1250                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myContainer, myContent);
1251        }
1252
1253        /**
1254         * Gets the value(s) for <b>container</b> ().
1255         * creating it if it does
1256         * not exist. Will not return <code>null</code>.
1257         *
1258     * <p>
1259     * <b>Definition:</b>
1260     * The kind of container that this package comes as
1261     * </p> 
1262         */
1263        public CodeableConceptDt getContainer() {  
1264                if (myContainer == null) {
1265                        myContainer = new CodeableConceptDt();
1266                }
1267                return myContainer;
1268        }
1269
1270        /**
1271         * Sets the value(s) for <b>container</b> ()
1272         *
1273     * <p>
1274     * <b>Definition:</b>
1275     * The kind of container that this package comes as
1276     * </p> 
1277         */
1278        public Package setContainer(CodeableConceptDt theValue) {
1279                myContainer = theValue;
1280                return this;
1281        }
1282        
1283        
1284
1285  
1286        /**
1287         * Gets the value(s) for <b>content</b> ().
1288         * creating it if it does
1289         * not exist. Will not return <code>null</code>.
1290         *
1291     * <p>
1292     * <b>Definition:</b>
1293     * A set of components that go to make up the described item.
1294     * </p> 
1295         */
1296        public java.util.List<PackageContent> getContent() {  
1297                if (myContent == null) {
1298                        myContent = new java.util.ArrayList<PackageContent>();
1299                }
1300                return myContent;
1301        }
1302
1303        /**
1304         * Sets the value(s) for <b>content</b> ()
1305         *
1306     * <p>
1307     * <b>Definition:</b>
1308     * A set of components that go to make up the described item.
1309     * </p> 
1310         */
1311        public Package setContent(java.util.List<PackageContent> theValue) {
1312                myContent = theValue;
1313                return this;
1314        }
1315        
1316        
1317
1318        /**
1319         * Adds and returns a new value for <b>content</b> ()
1320         *
1321     * <p>
1322     * <b>Definition:</b>
1323     * A set of components that go to make up the described item.
1324     * </p> 
1325         */
1326        public PackageContent addContent() {
1327                PackageContent newType = new PackageContent();
1328                getContent().add(newType);
1329                return newType; 
1330        }
1331
1332        /**
1333         * Adds a given new value for <b>content</b> ()
1334         *
1335         * <p>
1336         * <b>Definition:</b>
1337         * A set of components that go to make up the described item.
1338         * </p>
1339         * @param theValue The content to add (must not be <code>null</code>)
1340         */
1341        public Package addContent(PackageContent theValue) {
1342                if (theValue == null) {
1343                        throw new NullPointerException("theValue must not be null");
1344                }
1345                getContent().add(theValue);
1346                return this;
1347        }
1348
1349        /**
1350         * Gets the first repetition for <b>content</b> (),
1351         * creating it if it does not already exist.
1352         *
1353     * <p>
1354     * <b>Definition:</b>
1355     * A set of components that go to make up the described item.
1356     * </p> 
1357         */
1358        public PackageContent getContentFirstRep() {
1359                if (getContent().isEmpty()) {
1360                        return addContent();
1361                }
1362                return getContent().get(0); 
1363        }
1364  
1365
1366
1367        }
1368
1369        /**
1370         * Block class for child element: <b>Medication.package.content</b> ()
1371         *
1372     * <p>
1373     * <b>Definition:</b>
1374     * A set of components that go to make up the described item.
1375     * </p> 
1376         */
1377        @Block()        
1378        public static class PackageContent 
1379            extends  BaseIdentifiableElement        implements IResourceBlock {
1380        
1381        @Child(name="item", order=0, min=1, max=1, summary=false, modifier=false, type={
1382                ca.uhn.fhir.model.dstu2.resource.Medication.class       })
1383        @Description(
1384                shortDefinition="",
1385                formalDefinition="Identifies one of the items in the package"
1386        )
1387        private ResourceReferenceDt myItem;
1388        
1389        @Child(name="amount", type=SimpleQuantityDt.class, order=1, min=0, max=1, summary=false, modifier=false)        
1390        @Description(
1391                shortDefinition="",
1392                formalDefinition="The amount of the product that is in the package"
1393        )
1394        private SimpleQuantityDt myAmount;
1395        
1396
1397        @Override
1398        public boolean isEmpty() {
1399                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myItem,  myAmount);
1400        }
1401        
1402        @Override
1403        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1404                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myItem, myAmount);
1405        }
1406
1407        /**
1408         * Gets the value(s) for <b>item</b> ().
1409         * creating it if it does
1410         * not exist. Will not return <code>null</code>.
1411         *
1412     * <p>
1413     * <b>Definition:</b>
1414     * Identifies one of the items in the package
1415     * </p> 
1416         */
1417        public ResourceReferenceDt getItem() {  
1418                if (myItem == null) {
1419                        myItem = new ResourceReferenceDt();
1420                }
1421                return myItem;
1422        }
1423
1424        /**
1425         * Sets the value(s) for <b>item</b> ()
1426         *
1427     * <p>
1428     * <b>Definition:</b>
1429     * Identifies one of the items in the package
1430     * </p> 
1431         */
1432        public PackageContent setItem(ResourceReferenceDt theValue) {
1433                myItem = theValue;
1434                return this;
1435        }
1436        
1437        
1438
1439  
1440        /**
1441         * Gets the value(s) for <b>amount</b> ().
1442         * creating it if it does
1443         * not exist. Will not return <code>null</code>.
1444         *
1445     * <p>
1446     * <b>Definition:</b>
1447     * The amount of the product that is in the package
1448     * </p> 
1449         */
1450        public SimpleQuantityDt getAmount() {  
1451                if (myAmount == null) {
1452                        myAmount = new SimpleQuantityDt();
1453                }
1454                return myAmount;
1455        }
1456
1457        /**
1458         * Sets the value(s) for <b>amount</b> ()
1459         *
1460     * <p>
1461     * <b>Definition:</b>
1462     * The amount of the product that is in the package
1463     * </p> 
1464         */
1465        public PackageContent setAmount(SimpleQuantityDt theValue) {
1466                myAmount = theValue;
1467                return this;
1468        }
1469        
1470        
1471
1472  
1473
1474
1475        }
1476
1477
1478
1479
1480
1481    @Override
1482    public String getResourceName() {
1483        return "Medication";
1484    }
1485    
1486    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
1487        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
1488    }
1489
1490
1491}