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