001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017package ca.uhn.fhir.model.dstu2.resource;
018
019import java.math.BigDecimal;
020import java.net.URI;
021import java.util.*;
022import ca.uhn.fhir.model.api.*;
023import ca.uhn.fhir.model.api.annotation.*;
024import ca.uhn.fhir.rest.gclient.*;
025
026import ca.uhn.fhir.model.dstu2.valueset.AccountStatusEnum;
027import ca.uhn.fhir.model.dstu2.valueset.ActionListEnum;
028import ca.uhn.fhir.model.dstu2.composite.AddressDt;
029import ca.uhn.fhir.model.dstu2.valueset.AdjudicationCodesEnum;
030import ca.uhn.fhir.model.dstu2.valueset.AdjudicationErrorCodesEnum;
031import ca.uhn.fhir.model.dstu2.valueset.AdjustmentReasonCodesEnum;
032import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum;
033import ca.uhn.fhir.model.dstu2.valueset.AdmitSourceEnum;
034import ca.uhn.fhir.model.dstu2.resource.AllergyIntolerance;
035import ca.uhn.fhir.model.dstu2.valueset.AllergyIntoleranceCategoryEnum;
036import ca.uhn.fhir.model.dstu2.valueset.AllergyIntoleranceCertaintyEnum;
037import ca.uhn.fhir.model.dstu2.valueset.AllergyIntoleranceCriticalityEnum;
038import ca.uhn.fhir.model.dstu2.valueset.AllergyIntoleranceSeverityEnum;
039import ca.uhn.fhir.model.dstu2.valueset.AllergyIntoleranceStatusEnum;
040import ca.uhn.fhir.model.dstu2.valueset.AllergyIntoleranceTypeEnum;
041import ca.uhn.fhir.model.dstu2.valueset.AnimalSpeciesEnum;
042import ca.uhn.fhir.model.dstu2.composite.AnnotationDt;
043import ca.uhn.fhir.model.dstu2.valueset.AnswerFormatEnum;
044import ca.uhn.fhir.model.dstu2.resource.Appointment;
045import ca.uhn.fhir.model.dstu2.valueset.AppointmentStatusEnum;
046import ca.uhn.fhir.model.dstu2.valueset.AssertionDirectionTypeEnum;
047import ca.uhn.fhir.model.dstu2.valueset.AssertionOperatorTypeEnum;
048import ca.uhn.fhir.model.dstu2.valueset.AssertionResponseTypesEnum;
049import ca.uhn.fhir.model.dstu2.composite.AttachmentDt;
050import ca.uhn.fhir.model.dstu2.valueset.AuditEventActionEnum;
051import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectLifecycleEnum;
052import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectRoleEnum;
053import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectTypeEnum;
054import ca.uhn.fhir.model.dstu2.valueset.AuditEventOutcomeEnum;
055import ca.uhn.fhir.model.dstu2.valueset.AuditEventParticipantNetworkTypeEnum;
056import ca.uhn.fhir.model.dstu2.valueset.AuditEventSourceTypeEnum;
057import ca.uhn.fhir.model.dstu2.valueset.BindingStrengthEnum;
058import ca.uhn.fhir.model.dstu2.resource.BodySite;
059import ca.uhn.fhir.model.dstu2.valueset.BundleTypeEnum;
060import ca.uhn.fhir.model.dstu2.resource.CarePlan;
061import ca.uhn.fhir.model.dstu2.valueset.CarePlanActivityCategoryEnum;
062import ca.uhn.fhir.model.dstu2.valueset.CarePlanActivityStatusEnum;
063import ca.uhn.fhir.model.dstu2.valueset.CarePlanRelationshipEnum;
064import ca.uhn.fhir.model.dstu2.valueset.CarePlanStatusEnum;
065import ca.uhn.fhir.model.dstu2.resource.Claim;
066import ca.uhn.fhir.model.dstu2.resource.ClaimResponse;
067import ca.uhn.fhir.model.dstu2.valueset.ClaimTypeEnum;
068import ca.uhn.fhir.model.dstu2.resource.ClinicalImpression;
069import ca.uhn.fhir.model.dstu2.valueset.ClinicalImpressionStatusEnum;
070import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt;
071import ca.uhn.fhir.model.dstu2.composite.CodingDt;
072import ca.uhn.fhir.model.dstu2.resource.CommunicationRequest;
073import ca.uhn.fhir.model.dstu2.valueset.CommunicationRequestStatusEnum;
074import ca.uhn.fhir.model.dstu2.valueset.CommunicationStatusEnum;
075import ca.uhn.fhir.model.dstu2.resource.Composition;
076import ca.uhn.fhir.model.dstu2.valueset.CompositionAttestationModeEnum;
077import ca.uhn.fhir.model.dstu2.valueset.CompositionStatusEnum;
078import ca.uhn.fhir.model.dstu2.valueset.ConceptMapEquivalenceEnum;
079import ca.uhn.fhir.model.dstu2.resource.Condition;
080import ca.uhn.fhir.model.dstu2.valueset.ConditionCategoryCodesEnum;
081import ca.uhn.fhir.model.dstu2.valueset.ConditionClinicalStatusCodesEnum;
082import ca.uhn.fhir.model.dstu2.valueset.ConditionVerificationStatusEnum;
083import ca.uhn.fhir.model.dstu2.valueset.ConditionalDeleteStatusEnum;
084import ca.uhn.fhir.model.dstu2.valueset.ConditionsCodesEnum;
085import ca.uhn.fhir.model.dstu2.resource.Conformance;
086import ca.uhn.fhir.model.dstu2.valueset.ConformanceEventModeEnum;
087import ca.uhn.fhir.model.dstu2.valueset.ConformanceResourceStatusEnum;
088import ca.uhn.fhir.model.dstu2.valueset.ConformanceStatementKindEnum;
089import ca.uhn.fhir.model.dstu2.composite.ContactPointDt;
090import ca.uhn.fhir.model.dstu2.valueset.ContentTypeEnum;
091import ca.uhn.fhir.model.dstu2.resource.Contract;
092import ca.uhn.fhir.model.dstu2.valueset.ContractActionCodesEnum;
093import ca.uhn.fhir.model.dstu2.valueset.ContractActorRoleCodesEnum;
094import ca.uhn.fhir.model.dstu2.valueset.ContractSubtypeCodesEnum;
095import ca.uhn.fhir.model.dstu2.valueset.ContractTermTypeCodesEnum;
096import ca.uhn.fhir.model.dstu2.valueset.ContractTypeCodesEnum;
097import ca.uhn.fhir.model.dstu2.resource.Coverage;
098import ca.uhn.fhir.model.dstu2.valueset.DataElementStringencyEnum;
099import ca.uhn.fhir.model.dstu2.valueset.DaysOfWeekEnum;
100import ca.uhn.fhir.model.dstu2.valueset.DetectedIssueSeverityEnum;
101import ca.uhn.fhir.model.dstu2.resource.Device;
102import ca.uhn.fhir.model.dstu2.resource.DeviceComponent;
103import ca.uhn.fhir.model.dstu2.resource.DeviceMetric;
104import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCalibrationStateEnum;
105import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCalibrationTypeEnum;
106import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCategoryEnum;
107import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricColorEnum;
108import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricOperationalStatusEnum;
109import ca.uhn.fhir.model.dstu2.valueset.DeviceStatusEnum;
110import ca.uhn.fhir.model.dstu2.resource.DeviceUseRequest;
111import ca.uhn.fhir.model.dstu2.valueset.DeviceUseRequestPriorityEnum;
112import ca.uhn.fhir.model.dstu2.valueset.DeviceUseRequestStatusEnum;
113import ca.uhn.fhir.model.dstu2.resource.DiagnosticOrder;
114import ca.uhn.fhir.model.dstu2.valueset.DiagnosticOrderPriorityEnum;
115import ca.uhn.fhir.model.dstu2.valueset.DiagnosticOrderStatusEnum;
116import ca.uhn.fhir.model.dstu2.resource.DiagnosticReport;
117import ca.uhn.fhir.model.dstu2.valueset.DiagnosticReportStatusEnum;
118import ca.uhn.fhir.model.dstu2.valueset.DigitalMediaTypeEnum;
119import ca.uhn.fhir.model.dstu2.valueset.DocumentModeEnum;
120import ca.uhn.fhir.model.dstu2.resource.DocumentReference;
121import ca.uhn.fhir.model.dstu2.valueset.DocumentReferenceStatusEnum;
122import ca.uhn.fhir.model.dstu2.valueset.DocumentRelationshipTypeEnum;
123import ca.uhn.fhir.model.dstu2.composite.ElementDefinitionDt;
124import ca.uhn.fhir.model.dstu2.resource.EligibilityRequest;
125import ca.uhn.fhir.model.dstu2.resource.Encounter;
126import ca.uhn.fhir.model.dstu2.valueset.EncounterClassEnum;
127import ca.uhn.fhir.model.dstu2.valueset.EncounterLocationStatusEnum;
128import ca.uhn.fhir.model.dstu2.valueset.EncounterStateEnum;
129import ca.uhn.fhir.model.dstu2.valueset.EncounterTypeEnum;
130import ca.uhn.fhir.model.dstu2.resource.EnrollmentRequest;
131import ca.uhn.fhir.model.dstu2.valueset.EnteralFormulaTypeCodesEnum;
132import ca.uhn.fhir.model.dstu2.resource.EpisodeOfCare;
133import ca.uhn.fhir.model.dstu2.valueset.EpisodeOfCareStatusEnum;
134import ca.uhn.fhir.model.dstu2.valueset.ExceptionCodesEnum;
135import ca.uhn.fhir.model.dstu2.valueset.ExtensionContextEnum;
136import ca.uhn.fhir.model.dstu2.valueset.FamilyHistoryStatusEnum;
137import ca.uhn.fhir.model.dstu2.resource.FamilyMemberHistory;
138import ca.uhn.fhir.model.dstu2.valueset.FilterOperatorEnum;
139import ca.uhn.fhir.model.dstu2.valueset.FlagCategoryCodesEnum;
140import ca.uhn.fhir.model.dstu2.valueset.FlagStatusEnum;
141import ca.uhn.fhir.model.dstu2.valueset.FluidConsistencyTypeCodesEnum;
142import ca.uhn.fhir.model.dstu2.resource.Goal;
143import ca.uhn.fhir.model.dstu2.valueset.GoalCategoryEnum;
144import ca.uhn.fhir.model.dstu2.valueset.GoalPriorityEnum;
145import ca.uhn.fhir.model.dstu2.valueset.GoalStartEventEnum;
146import ca.uhn.fhir.model.dstu2.valueset.GoalStatusEnum;
147import ca.uhn.fhir.model.dstu2.valueset.GoalStatusReasonEnum;
148import ca.uhn.fhir.model.dstu2.resource.Group;
149import ca.uhn.fhir.model.dstu2.valueset.GroupTypeEnum;
150import ca.uhn.fhir.model.dstu2.valueset.GuideDependencyTypeEnum;
151import ca.uhn.fhir.model.dstu2.valueset.GuidePageKindEnum;
152import ca.uhn.fhir.model.dstu2.valueset.GuideResourcePurposeEnum;
153import ca.uhn.fhir.model.dstu2.valueset.HTTPVerbEnum;
154import ca.uhn.fhir.model.dstu2.resource.HealthcareService;
155import ca.uhn.fhir.model.dstu2.composite.HumanNameDt;
156import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
157import ca.uhn.fhir.model.dstu2.valueset.IdentifierTypeCodesEnum;
158import ca.uhn.fhir.model.dstu2.valueset.IdentityAssuranceLevelEnum;
159import ca.uhn.fhir.model.dstu2.resource.ImagingObjectSelection;
160import ca.uhn.fhir.model.dstu2.resource.ImagingStudy;
161import ca.uhn.fhir.model.dstu2.resource.Immunization;
162import ca.uhn.fhir.model.dstu2.valueset.ImmunizationReasonCodesEnum;
163import ca.uhn.fhir.model.dstu2.valueset.ImmunizationRecommendationDateCriterionCodesEnum;
164import ca.uhn.fhir.model.dstu2.valueset.ImmunizationRecommendationStatusCodesEnum;
165import ca.uhn.fhir.model.dstu2.valueset.ImmunizationRouteCodesEnum;
166import ca.uhn.fhir.model.dstu2.valueset.InstanceAvailabilityEnum;
167import ca.uhn.fhir.model.dstu2.valueset.InterventionCodesEnum;
168import ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum;
169import ca.uhn.fhir.model.dstu2.valueset.IssueTypeEnum;
170import ca.uhn.fhir.model.dstu2.valueset.KOStitleEnum;
171import ca.uhn.fhir.model.dstu2.valueset.LateralityEnum;
172import ca.uhn.fhir.model.dstu2.valueset.LinkTypeEnum;
173import ca.uhn.fhir.model.dstu2.valueset.ListModeEnum;
174import ca.uhn.fhir.model.dstu2.valueset.ListOrderCodesEnum;
175import ca.uhn.fhir.model.dstu2.valueset.ListStatusEnum;
176import ca.uhn.fhir.model.dstu2.resource.Location;
177import ca.uhn.fhir.model.dstu2.valueset.LocationModeEnum;
178import ca.uhn.fhir.model.dstu2.valueset.LocationStatusEnum;
179import ca.uhn.fhir.model.dstu2.valueset.LocationTypeEnum;
180import ca.uhn.fhir.model.dstu2.valueset.MaritalStatusCodesEnum;
181import ca.uhn.fhir.model.dstu2.valueset.MeasmntPrincipleEnum;
182import ca.uhn.fhir.model.dstu2.resource.Media;
183import ca.uhn.fhir.model.dstu2.resource.Medication;
184import ca.uhn.fhir.model.dstu2.valueset.MedicationAdministrationStatusEnum;
185import ca.uhn.fhir.model.dstu2.valueset.MedicationDispenseStatusEnum;
186import ca.uhn.fhir.model.dstu2.resource.MedicationOrder;
187import ca.uhn.fhir.model.dstu2.valueset.MedicationOrderStatusEnum;
188import ca.uhn.fhir.model.dstu2.resource.MedicationStatement;
189import ca.uhn.fhir.model.dstu2.valueset.MedicationStatementStatusEnum;
190import ca.uhn.fhir.model.dstu2.valueset.MessageEventEnum;
191import ca.uhn.fhir.model.dstu2.valueset.MessageSignificanceCategoryEnum;
192import ca.uhn.fhir.model.dstu2.valueset.MessageTransportEnum;
193import ca.uhn.fhir.model.dstu2.resource.NamingSystem;
194import ca.uhn.fhir.model.dstu2.valueset.NamingSystemIdentifierTypeEnum;
195import ca.uhn.fhir.model.dstu2.valueset.NamingSystemTypeEnum;
196import ca.uhn.fhir.model.dstu2.valueset.NoteTypeEnum;
197import ca.uhn.fhir.model.dstu2.valueset.NutrientModifierCodesEnum;
198import ca.uhn.fhir.model.dstu2.resource.NutritionOrder;
199import ca.uhn.fhir.model.dstu2.valueset.NutritionOrderStatusEnum;
200import ca.uhn.fhir.model.dstu2.resource.Observation;
201import ca.uhn.fhir.model.dstu2.valueset.ObservationCategoryCodesEnum;
202import ca.uhn.fhir.model.dstu2.valueset.ObservationRelationshipTypeEnum;
203import ca.uhn.fhir.model.dstu2.valueset.ObservationStatusEnum;
204import ca.uhn.fhir.model.dstu2.resource.OperationDefinition;
205import ca.uhn.fhir.model.dstu2.valueset.OperationKindEnum;
206import ca.uhn.fhir.model.dstu2.resource.OperationOutcome;
207import ca.uhn.fhir.model.dstu2.valueset.OperationParameterUseEnum;
208import ca.uhn.fhir.model.dstu2.resource.Order;
209import ca.uhn.fhir.model.dstu2.valueset.OrderStatusEnum;
210import ca.uhn.fhir.model.dstu2.resource.Organization;
211import ca.uhn.fhir.model.dstu2.valueset.OrganizationTypeEnum;
212import ca.uhn.fhir.model.dstu2.valueset.ParticipantRequiredEnum;
213import ca.uhn.fhir.model.dstu2.valueset.ParticipantStatusEnum;
214import ca.uhn.fhir.model.dstu2.valueset.ParticipantTypeEnum;
215import ca.uhn.fhir.model.dstu2.valueset.ParticipationStatusEnum;
216import ca.uhn.fhir.model.dstu2.resource.Patient;
217import ca.uhn.fhir.model.dstu2.valueset.PayeeTypeCodesEnum;
218import ca.uhn.fhir.model.dstu2.valueset.PaymentStatusCodesEnum;
219import ca.uhn.fhir.model.dstu2.valueset.PaymentTypeCodesEnum;
220import ca.uhn.fhir.model.dstu2.composite.PeriodDt;
221import ca.uhn.fhir.model.dstu2.resource.Person;
222import ca.uhn.fhir.model.dstu2.resource.Practitioner;
223import ca.uhn.fhir.model.dstu2.valueset.PractitionerRoleEnum;
224import ca.uhn.fhir.model.dstu2.valueset.PractitionerSpecialtyEnum;
225import ca.uhn.fhir.model.dstu2.valueset.PriorityCodesEnum;
226import ca.uhn.fhir.model.dstu2.resource.Procedure;
227import ca.uhn.fhir.model.dstu2.resource.ProcedureRequest;
228import ca.uhn.fhir.model.dstu2.valueset.ProcedureRequestPriorityEnum;
229import ca.uhn.fhir.model.dstu2.valueset.ProcedureRequestStatusEnum;
230import ca.uhn.fhir.model.dstu2.valueset.ProcedureStatusEnum;
231import ca.uhn.fhir.model.dstu2.resource.ProcessRequest;
232import ca.uhn.fhir.model.dstu2.valueset.ProvenanceEntityRoleEnum;
233import ca.uhn.fhir.model.dstu2.composite.QuantityDt;
234import ca.uhn.fhir.model.dstu2.resource.Questionnaire;
235import ca.uhn.fhir.model.dstu2.resource.QuestionnaireResponse;
236import ca.uhn.fhir.model.dstu2.valueset.QuestionnaireResponseStatusEnum;
237import ca.uhn.fhir.model.dstu2.valueset.QuestionnaireStatusEnum;
238import ca.uhn.fhir.model.dstu2.composite.RangeDt;
239import ca.uhn.fhir.model.dstu2.composite.RatioDt;
240import ca.uhn.fhir.model.dstu2.valueset.ReferralMethodEnum;
241import ca.uhn.fhir.model.dstu2.resource.ReferralRequest;
242import ca.uhn.fhir.model.dstu2.valueset.ReferralStatusEnum;
243import ca.uhn.fhir.model.dstu2.resource.RelatedPerson;
244import ca.uhn.fhir.model.dstu2.valueset.RemittanceOutcomeEnum;
245import ca.uhn.fhir.model.dstu2.valueset.ResourceTypeEnum;
246import ca.uhn.fhir.model.dstu2.valueset.ResourceVersionPolicyEnum;
247import ca.uhn.fhir.model.dstu2.valueset.ResponseTypeEnum;
248import ca.uhn.fhir.model.dstu2.valueset.RestfulConformanceModeEnum;
249import ca.uhn.fhir.model.dstu2.valueset.RestfulSecurityServiceEnum;
250import ca.uhn.fhir.model.dstu2.resource.RiskAssessment;
251import ca.uhn.fhir.model.dstu2.valueset.RulesetCodesEnum;
252import ca.uhn.fhir.model.dstu2.composite.SampledDataDt;
253import ca.uhn.fhir.model.dstu2.resource.Schedule;
254import ca.uhn.fhir.model.dstu2.valueset.SearchEntryModeEnum;
255import ca.uhn.fhir.model.dstu2.valueset.SearchModifierCodeEnum;
256import ca.uhn.fhir.model.dstu2.valueset.SearchParamTypeEnum;
257import ca.uhn.fhir.model.dstu2.valueset.ServiceProvisionConditionsEnum;
258import ca.uhn.fhir.model.dstu2.composite.SignatureDt;
259import ca.uhn.fhir.model.dstu2.resource.Slot;
260import ca.uhn.fhir.model.dstu2.valueset.SlotStatusEnum;
261import ca.uhn.fhir.model.dstu2.resource.Specimen;
262import ca.uhn.fhir.model.dstu2.valueset.SpecimenCollectionMethodEnum;
263import ca.uhn.fhir.model.dstu2.valueset.SpecimenStatusEnum;
264import ca.uhn.fhir.model.dstu2.resource.StructureDefinition;
265import ca.uhn.fhir.model.dstu2.valueset.StructureDefinitionKindEnum;
266import ca.uhn.fhir.model.dstu2.valueset.SubscriptionChannelTypeEnum;
267import ca.uhn.fhir.model.dstu2.valueset.SubscriptionStatusEnum;
268import ca.uhn.fhir.model.dstu2.valueset.SubscriptionTagEnum;
269import ca.uhn.fhir.model.dstu2.resource.Substance;
270import ca.uhn.fhir.model.dstu2.valueset.SubstanceCategoryCodesEnum;
271import ca.uhn.fhir.model.dstu2.valueset.SupplementTypeCodesEnum;
272import ca.uhn.fhir.model.dstu2.valueset.SupplyDeliveryStatusEnum;
273import ca.uhn.fhir.model.dstu2.resource.SupplyRequest;
274import ca.uhn.fhir.model.dstu2.valueset.SupplyRequestReasonEnum;
275import ca.uhn.fhir.model.dstu2.valueset.SupplyRequestStatusEnum;
276import ca.uhn.fhir.model.dstu2.valueset.SurfaceCodesEnum;
277import ca.uhn.fhir.model.dstu2.valueset.SystemRestfulInteractionEnum;
278import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
279import ca.uhn.fhir.model.dstu2.valueset.TextureModifiedFoodTypeCodesEnum;
280import ca.uhn.fhir.model.dstu2.valueset.TextureModifierCodesEnum;
281import ca.uhn.fhir.model.dstu2.composite.TimingDt;
282import ca.uhn.fhir.model.dstu2.valueset.TransactionModeEnum;
283import ca.uhn.fhir.model.dstu2.valueset.TypeRestfulInteractionEnum;
284import ca.uhn.fhir.model.dstu2.valueset.UDICodesEnum;
285import ca.uhn.fhir.model.dstu2.valueset.UnknownContentCodeEnum;
286import ca.uhn.fhir.model.dstu2.valueset.UseEnum;
287import ca.uhn.fhir.model.dstu2.resource.ValueSet;
288import ca.uhn.fhir.model.dstu2.valueset.VisionBaseEnum;
289import ca.uhn.fhir.model.dstu2.valueset.VisionEyesEnum;
290import ca.uhn.fhir.model.dstu2.resource.VisionPrescription;
291import ca.uhn.fhir.model.dstu2.valueset.XPathUsageTypeEnum;
292import ca.uhn.fhir.model.api.IResource;
293import ca.uhn.fhir.model.dstu2.composite.AgeDt;
294import ca.uhn.fhir.model.dstu2.composite.BoundCodeableConceptDt;
295import ca.uhn.fhir.model.dstu2.composite.DurationDt;
296import ca.uhn.fhir.model.dstu2.composite.MoneyDt;
297import ca.uhn.fhir.model.dstu2.composite.NarrativeDt;
298import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt;
299import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt;
300import ca.uhn.fhir.model.primitive.Base64BinaryDt;
301import ca.uhn.fhir.model.primitive.BooleanDt;
302import ca.uhn.fhir.model.primitive.BoundCodeDt;
303import ca.uhn.fhir.model.primitive.CodeDt;
304import ca.uhn.fhir.model.primitive.DateDt;
305import ca.uhn.fhir.model.primitive.DateTimeDt;
306import ca.uhn.fhir.model.primitive.DecimalDt;
307import ca.uhn.fhir.model.primitive.IdDt;
308import ca.uhn.fhir.model.primitive.InstantDt;
309import ca.uhn.fhir.model.primitive.IntegerDt;
310import ca.uhn.fhir.model.primitive.OidDt;
311import ca.uhn.fhir.model.primitive.PositiveIntDt;
312import ca.uhn.fhir.model.primitive.StringDt;
313import ca.uhn.fhir.model.primitive.TimeDt;
314import ca.uhn.fhir.model.primitive.UnsignedIntDt;
315import ca.uhn.fhir.model.primitive.UriDt;
316
317
318/**
319 * HAPI/FHIR <b>MedicationStatement</b> Resource
320 * (clinical.medication)
321 *
322 * <p>
323 * <b>Definition:</b>
324 * A record of a medication that is being consumed by a patient.   A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay.   The medication information may come from e.g. the patient's memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medication statement is often, if not always, less specific.  There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise.  As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains.  Medication administration is more formal and is not missing detailed information.
325 * </p> 
326 *
327 * <p>
328 * <b>Requirements:</b>
329 * 
330 * </p> 
331 *
332 * <p>
333 * <b>Profile Definition:</b>
334 * <a href="http://hl7.org/fhir/profiles/MedicationStatement">http://hl7.org/fhir/profiles/MedicationStatement</a> 
335 * </p>
336 *
337 */
338@ResourceDef(name="MedicationStatement", profile="http://hl7.org/fhir/profiles/MedicationStatement", id="medicationstatement")
339public class MedicationStatement extends ca.uhn.fhir.model.dstu2.resource.BaseResource
340    implements  IResource     {
341
342        /**
343         * Search parameter constant for <b>identifier</b>
344         * <p>
345         * Description: <b>Return statements with this external identifier</b><br>
346         * Type: <b>token</b><br>
347         * Path: <b>MedicationStatement.identifier</b><br>
348         * </p>
349         */
350        @SearchParamDefinition(name="identifier", path="MedicationStatement.identifier", description="Return statements with this external identifier", type="token"  )
351        public static final String SP_IDENTIFIER = "identifier";
352
353        /**
354         * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
355         * <p>
356         * Description: <b>Return statements with this external identifier</b><br>
357         * Type: <b>token</b><br>
358         * Path: <b>MedicationStatement.identifier</b><br>
359         * </p>
360         */
361        public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
362
363        /**
364         * Search parameter constant for <b>medication</b>
365         * <p>
366         * Description: <b>Return administrations of this medication reference</b><br>
367         * Type: <b>reference</b><br>
368         * Path: <b>MedicationStatement.medicationReference</b><br>
369         * </p>
370         */
371        @SearchParamDefinition(name="medication", path="MedicationStatement.medicationReference", description="Return administrations of this medication reference", type="reference"  )
372        public static final String SP_MEDICATION = "medication";
373
374        /**
375         * <b>Fluent Client</b> search parameter constant for <b>medication</b>
376         * <p>
377         * Description: <b>Return administrations of this medication reference</b><br>
378         * Type: <b>reference</b><br>
379         * Path: <b>MedicationStatement.medicationReference</b><br>
380         * </p>
381         */
382        public static final ReferenceClientParam MEDICATION = new ReferenceClientParam(SP_MEDICATION);
383
384        /**
385         * Search parameter constant for <b>code</b>
386         * <p>
387         * Description: <b>Return administrations of this medication code</b><br>
388         * Type: <b>token</b><br>
389         * Path: <b>MedicationStatement.medicationCodeableConcept</b><br>
390         * </p>
391         */
392        @SearchParamDefinition(name="code", path="MedicationStatement.medicationCodeableConcept", description="Return administrations of this medication code", type="token"  )
393        public static final String SP_CODE = "code";
394
395        /**
396         * <b>Fluent Client</b> search parameter constant for <b>code</b>
397         * <p>
398         * Description: <b>Return administrations of this medication code</b><br>
399         * Type: <b>token</b><br>
400         * Path: <b>MedicationStatement.medicationCodeableConcept</b><br>
401         * </p>
402         */
403        public static final TokenClientParam CODE = new TokenClientParam(SP_CODE);
404
405        /**
406         * Search parameter constant for <b>patient</b>
407         * <p>
408         * Description: <b>The identity of a patient to list statements  for</b><br>
409         * Type: <b>reference</b><br>
410         * Path: <b>MedicationStatement.patient</b><br>
411         * </p>
412         */
413        @SearchParamDefinition(name="patient", path="MedicationStatement.patient", description="The identity of a patient to list statements  for", type="reference"  )
414        public static final String SP_PATIENT = "patient";
415
416        /**
417         * <b>Fluent Client</b> search parameter constant for <b>patient</b>
418         * <p>
419         * Description: <b>The identity of a patient to list statements  for</b><br>
420         * Type: <b>reference</b><br>
421         * Path: <b>MedicationStatement.patient</b><br>
422         * </p>
423         */
424        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
425
426        /**
427         * Search parameter constant for <b>effectivedate</b>
428         * <p>
429         * Description: <b>Date when patient was taking (or not taking) the medication</b><br>
430         * Type: <b>date</b><br>
431         * Path: <b>MedicationStatement.effective[x]</b><br>
432         * </p>
433         */
434        @SearchParamDefinition(name="effectivedate", path="MedicationStatement.effective[x]", description="Date when patient was taking (or not taking) the medication", type="date"  )
435        public static final String SP_EFFECTIVEDATE = "effectivedate";
436
437        /**
438         * <b>Fluent Client</b> search parameter constant for <b>effectivedate</b>
439         * <p>
440         * Description: <b>Date when patient was taking (or not taking) the medication</b><br>
441         * Type: <b>date</b><br>
442         * Path: <b>MedicationStatement.effective[x]</b><br>
443         * </p>
444         */
445        public static final DateClientParam EFFECTIVEDATE = new DateClientParam(SP_EFFECTIVEDATE);
446
447        /**
448         * Search parameter constant for <b>status</b>
449         * <p>
450         * Description: <b>Return statements that match the given status</b><br>
451         * Type: <b>token</b><br>
452         * Path: <b>MedicationStatement.status</b><br>
453         * </p>
454         */
455        @SearchParamDefinition(name="status", path="MedicationStatement.status", description="Return statements that match the given status", type="token"  )
456        public static final String SP_STATUS = "status";
457
458        /**
459         * <b>Fluent Client</b> search parameter constant for <b>status</b>
460         * <p>
461         * Description: <b>Return statements that match the given status</b><br>
462         * Type: <b>token</b><br>
463         * Path: <b>MedicationStatement.status</b><br>
464         * </p>
465         */
466        public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS);
467
468        /**
469         * Search parameter constant for <b>source</b>
470         * <p>
471         * Description: <b>Who the information in the statement came from</b><br>
472         * Type: <b>reference</b><br>
473         * Path: <b>MedicationStatement.informationSource</b><br>
474         * </p>
475         */
476        @SearchParamDefinition(name="source", path="MedicationStatement.informationSource", description="Who the information in the statement came from", type="reference"  )
477        public static final String SP_SOURCE = "source";
478
479        /**
480         * <b>Fluent Client</b> search parameter constant for <b>source</b>
481         * <p>
482         * Description: <b>Who the information in the statement came from</b><br>
483         * Type: <b>reference</b><br>
484         * Path: <b>MedicationStatement.informationSource</b><br>
485         * </p>
486         */
487        public static final ReferenceClientParam SOURCE = new ReferenceClientParam(SP_SOURCE);
488
489
490        /**
491         * Constant for fluent queries to be used to add include statements. Specifies
492         * the path value of "<b>MedicationStatement:medication</b>".
493         */
494        public static final Include INCLUDE_MEDICATION = new Include("MedicationStatement:medication");
495
496        /**
497         * Constant for fluent queries to be used to add include statements. Specifies
498         * the path value of "<b>MedicationStatement:patient</b>".
499         */
500        public static final Include INCLUDE_PATIENT = new Include("MedicationStatement:patient");
501
502        /**
503         * Constant for fluent queries to be used to add include statements. Specifies
504         * the path value of "<b>MedicationStatement:source</b>".
505         */
506        public static final Include INCLUDE_SOURCE = new Include("MedicationStatement:source");
507
508
509        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
510        @Description(
511                shortDefinition="id",
512                formalDefinition="External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource.  The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event.  Particularly important if these records have to be updated."
513        )
514        private java.util.List<IdentifierDt> myIdentifier;
515        
516        @Child(name="patient", order=1, min=1, max=1, summary=false, modifier=false, type={
517                ca.uhn.fhir.model.dstu2.resource.Patient.class  })
518        @Description(
519                shortDefinition="who.focus",
520                formalDefinition="The person or animal who is/was taking the medication."
521        )
522        private ResourceReferenceDt myPatient;
523        
524        @Child(name="informationSource", order=2, min=0, max=1, summary=false, modifier=false, type={
525                ca.uhn.fhir.model.dstu2.resource.Patient.class,                 ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.RelatedPerson.class    })
526        @Description(
527                shortDefinition="who.source",
528                formalDefinition="The person who provided the information about the taking of this medication."
529        )
530        private ResourceReferenceDt myInformationSource;
531        
532        @Child(name="dateAsserted", type=DateTimeDt.class, order=3, min=0, max=1, summary=false, modifier=false)        
533        @Description(
534                shortDefinition="",
535                formalDefinition="The date when the medication statement was asserted by the information source."
536        )
537        private DateTimeDt myDateAsserted;
538        
539        @Child(name="status", type=CodeDt.class, order=4, min=1, max=1, summary=false, modifier=true)   
540        @Description(
541                shortDefinition="",
542                formalDefinition="A code representing the patient or other source's judgment about the state of the medication used that this statement is about.  Generally this will be active or completed."
543        )
544        private BoundCodeDt<MedicationStatementStatusEnum> myStatus;
545        
546        @Child(name="wasNotTaken", type=BooleanDt.class, order=5, min=0, max=1, summary=false, modifier=true)   
547        @Description(
548                shortDefinition="status",
549                formalDefinition="Set this to true if the record is saying that the medication was NOT taken."
550        )
551        private BooleanDt myWasNotTaken;
552        
553        @Child(name="reasonNotTaken", type=CodeableConceptDt.class, order=6, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)     
554        @Description(
555                shortDefinition="",
556                formalDefinition="A code indicating why the medication was not taken."
557        )
558        private java.util.List<CodeableConceptDt> myReasonNotTaken;
559        
560        @Child(name="reasonForUse", order=7, min=0, max=1, summary=false, modifier=false, type={
561                CodeableConceptDt.class,                Condition.class })
562        @Description(
563                shortDefinition="",
564                formalDefinition="A reason for why the medication is being/was taken."
565        )
566        private IDatatype myReasonForUse;
567        
568        @Child(name="effective", order=8, min=0, max=1, summary=false, modifier=false, type={
569                DateTimeDt.class,               PeriodDt.class  })
570        @Description(
571                shortDefinition="when.done",
572                formalDefinition="The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true)."
573        )
574        private IDatatype myEffective;
575        
576        @Child(name="note", type=StringDt.class, order=9, min=0, max=1, summary=false, modifier=false)  
577        @Description(
578                shortDefinition="",
579                formalDefinition="Provides extra information about the medication statement that is not conveyed by the other attributes."
580        )
581        private StringDt myNote;
582        
583        @Child(name="supportingInformation", order=10, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
584                IResource.class })
585        @Description(
586                shortDefinition="",
587                formalDefinition="Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports the MedicationStatement."
588        )
589        private java.util.List<ResourceReferenceDt> mySupportingInformation;
590        
591        @Child(name="medication", order=11, min=1, max=1, summary=false, modifier=false, type={
592                CodeableConceptDt.class,                Medication.class        })
593        @Description(
594                shortDefinition="what",
595                formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications."
596        )
597        private IDatatype myMedication;
598        
599        @Child(name="dosage", order=12, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)  
600        @Description(
601                shortDefinition="",
602                formalDefinition="Indicates how the medication is/was used by the patient"
603        )
604        private java.util.List<Dosage> myDosage;
605        
606
607        @Override
608        public boolean isEmpty() {
609                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myPatient,  myInformationSource,  myDateAsserted,  myStatus,  myWasNotTaken,  myReasonNotTaken,  myReasonForUse,  myEffective,  myNote,  mySupportingInformation,  myMedication,  myDosage);
610        }
611        
612        @Override
613        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
614                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myPatient, myInformationSource, myDateAsserted, myStatus, myWasNotTaken, myReasonNotTaken, myReasonForUse, myEffective, myNote, mySupportingInformation, myMedication, myDosage);
615        }
616
617        /**
618         * Gets the value(s) for <b>identifier</b> (id).
619         * creating it if it does
620         * not exist. Will not return <code>null</code>.
621         *
622     * <p>
623     * <b>Definition:</b>
624     * External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource.  The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event.  Particularly important if these records have to be updated.
625     * </p> 
626         */
627        public java.util.List<IdentifierDt> getIdentifier() {  
628                if (myIdentifier == null) {
629                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
630                }
631                return myIdentifier;
632        }
633
634        /**
635         * Sets the value(s) for <b>identifier</b> (id)
636         *
637     * <p>
638     * <b>Definition:</b>
639     * External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource.  The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event.  Particularly important if these records have to be updated.
640     * </p> 
641         */
642        public MedicationStatement setIdentifier(java.util.List<IdentifierDt> theValue) {
643                myIdentifier = theValue;
644                return this;
645        }
646        
647        
648
649        /**
650         * Adds and returns a new value for <b>identifier</b> (id)
651         *
652     * <p>
653     * <b>Definition:</b>
654     * External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource.  The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event.  Particularly important if these records have to be updated.
655     * </p> 
656         */
657        public IdentifierDt addIdentifier() {
658                IdentifierDt newType = new IdentifierDt();
659                getIdentifier().add(newType);
660                return newType; 
661        }
662
663        /**
664         * Adds a given new value for <b>identifier</b> (id)
665         *
666         * <p>
667         * <b>Definition:</b>
668         * External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource.  The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event.  Particularly important if these records have to be updated.
669         * </p>
670         * @param theValue The identifier to add (must not be <code>null</code>)
671         */
672        public MedicationStatement addIdentifier(IdentifierDt theValue) {
673                if (theValue == null) {
674                        throw new NullPointerException("theValue must not be null");
675                }
676                getIdentifier().add(theValue);
677                return this;
678        }
679
680        /**
681         * Gets the first repetition for <b>identifier</b> (id),
682         * creating it if it does not already exist.
683         *
684     * <p>
685     * <b>Definition:</b>
686     * External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource.  The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event.  Particularly important if these records have to be updated.
687     * </p> 
688         */
689        public IdentifierDt getIdentifierFirstRep() {
690                if (getIdentifier().isEmpty()) {
691                        return addIdentifier();
692                }
693                return getIdentifier().get(0); 
694        }
695  
696        /**
697         * Gets the value(s) for <b>patient</b> (who.focus).
698         * creating it if it does
699         * not exist. Will not return <code>null</code>.
700         *
701     * <p>
702     * <b>Definition:</b>
703     * The person or animal who is/was taking the medication.
704     * </p> 
705         */
706        public ResourceReferenceDt getPatient() {  
707                if (myPatient == null) {
708                        myPatient = new ResourceReferenceDt();
709                }
710                return myPatient;
711        }
712
713        /**
714         * Sets the value(s) for <b>patient</b> (who.focus)
715         *
716     * <p>
717     * <b>Definition:</b>
718     * The person or animal who is/was taking the medication.
719     * </p> 
720         */
721        public MedicationStatement setPatient(ResourceReferenceDt theValue) {
722                myPatient = theValue;
723                return this;
724        }
725        
726        
727
728  
729        /**
730         * Gets the value(s) for <b>informationSource</b> (who.source).
731         * creating it if it does
732         * not exist. Will not return <code>null</code>.
733         *
734     * <p>
735     * <b>Definition:</b>
736     * The person who provided the information about the taking of this medication.
737     * </p> 
738         */
739        public ResourceReferenceDt getInformationSource() {  
740                if (myInformationSource == null) {
741                        myInformationSource = new ResourceReferenceDt();
742                }
743                return myInformationSource;
744        }
745
746        /**
747         * Sets the value(s) for <b>informationSource</b> (who.source)
748         *
749     * <p>
750     * <b>Definition:</b>
751     * The person who provided the information about the taking of this medication.
752     * </p> 
753         */
754        public MedicationStatement setInformationSource(ResourceReferenceDt theValue) {
755                myInformationSource = theValue;
756                return this;
757        }
758        
759        
760
761  
762        /**
763         * Gets the value(s) for <b>dateAsserted</b> ().
764         * creating it if it does
765         * not exist. Will not return <code>null</code>.
766         *
767     * <p>
768     * <b>Definition:</b>
769     * The date when the medication statement was asserted by the information source.
770     * </p> 
771         */
772        public DateTimeDt getDateAssertedElement() {  
773                if (myDateAsserted == null) {
774                        myDateAsserted = new DateTimeDt();
775                }
776                return myDateAsserted;
777        }
778
779        
780        /**
781         * Gets the value(s) for <b>dateAsserted</b> ().
782         * creating it if it does
783         * not exist. Will not return <code>null</code>.
784         *
785     * <p>
786     * <b>Definition:</b>
787     * The date when the medication statement was asserted by the information source.
788     * </p> 
789         */
790        public Date getDateAsserted() {  
791                return getDateAssertedElement().getValue();
792        }
793
794        /**
795         * Sets the value(s) for <b>dateAsserted</b> ()
796         *
797     * <p>
798     * <b>Definition:</b>
799     * The date when the medication statement was asserted by the information source.
800     * </p> 
801         */
802        public MedicationStatement setDateAsserted(DateTimeDt theValue) {
803                myDateAsserted = theValue;
804                return this;
805        }
806        
807        
808
809        /**
810         * Sets the value for <b>dateAsserted</b> ()
811         *
812     * <p>
813     * <b>Definition:</b>
814     * The date when the medication statement was asserted by the information source.
815     * </p> 
816         */
817        public MedicationStatement setDateAsserted( Date theDate,  TemporalPrecisionEnum thePrecision) {
818                myDateAsserted = new DateTimeDt(theDate, thePrecision); 
819                return this; 
820        }
821
822        /**
823         * Sets the value for <b>dateAsserted</b> ()
824         *
825     * <p>
826     * <b>Definition:</b>
827     * The date when the medication statement was asserted by the information source.
828     * </p> 
829         */
830        public MedicationStatement setDateAssertedWithSecondsPrecision( Date theDate) {
831                myDateAsserted = new DateTimeDt(theDate); 
832                return this; 
833        }
834
835 
836        /**
837         * Gets the value(s) for <b>status</b> ().
838         * creating it if it does
839         * not exist. Will not return <code>null</code>.
840         *
841     * <p>
842     * <b>Definition:</b>
843     * A code representing the patient or other source's judgment about the state of the medication used that this statement is about.  Generally this will be active or completed.
844     * </p> 
845         */
846        public BoundCodeDt<MedicationStatementStatusEnum> getStatusElement() {  
847                if (myStatus == null) {
848                        myStatus = new BoundCodeDt<MedicationStatementStatusEnum>(MedicationStatementStatusEnum.VALUESET_BINDER);
849                }
850                return myStatus;
851        }
852
853        
854        /**
855         * Gets the value(s) for <b>status</b> ().
856         * creating it if it does
857         * not exist. Will not return <code>null</code>.
858         *
859     * <p>
860     * <b>Definition:</b>
861     * A code representing the patient or other source's judgment about the state of the medication used that this statement is about.  Generally this will be active or completed.
862     * </p> 
863         */
864        public String getStatus() {  
865                return getStatusElement().getValue();
866        }
867
868        /**
869         * Sets the value(s) for <b>status</b> ()
870         *
871     * <p>
872     * <b>Definition:</b>
873     * A code representing the patient or other source's judgment about the state of the medication used that this statement is about.  Generally this will be active or completed.
874     * </p> 
875         */
876        public MedicationStatement setStatus(BoundCodeDt<MedicationStatementStatusEnum> theValue) {
877                myStatus = theValue;
878                return this;
879        }
880        
881        
882
883        /**
884         * Sets the value(s) for <b>status</b> ()
885         *
886     * <p>
887     * <b>Definition:</b>
888     * A code representing the patient or other source's judgment about the state of the medication used that this statement is about.  Generally this will be active or completed.
889     * </p> 
890         */
891        public MedicationStatement setStatus(MedicationStatementStatusEnum theValue) {
892                setStatus(new BoundCodeDt<MedicationStatementStatusEnum>(MedicationStatementStatusEnum.VALUESET_BINDER, theValue));
893                
894/*
895                getStatusElement().setValueAsEnum(theValue);
896*/
897                return this;
898        }
899
900  
901        /**
902         * Gets the value(s) for <b>wasNotTaken</b> (status).
903         * creating it if it does
904         * not exist. Will not return <code>null</code>.
905         *
906     * <p>
907     * <b>Definition:</b>
908     * Set this to true if the record is saying that the medication was NOT taken.
909     * </p> 
910         */
911        public BooleanDt getWasNotTakenElement() {  
912                if (myWasNotTaken == null) {
913                        myWasNotTaken = new BooleanDt();
914                }
915                return myWasNotTaken;
916        }
917
918        
919        /**
920         * Gets the value(s) for <b>wasNotTaken</b> (status).
921         * creating it if it does
922         * not exist. Will not return <code>null</code>.
923         *
924     * <p>
925     * <b>Definition:</b>
926     * Set this to true if the record is saying that the medication was NOT taken.
927     * </p> 
928         */
929        public Boolean getWasNotTaken() {  
930                return getWasNotTakenElement().getValue();
931        }
932
933        /**
934         * Sets the value(s) for <b>wasNotTaken</b> (status)
935         *
936     * <p>
937     * <b>Definition:</b>
938     * Set this to true if the record is saying that the medication was NOT taken.
939     * </p> 
940         */
941        public MedicationStatement setWasNotTaken(BooleanDt theValue) {
942                myWasNotTaken = theValue;
943                return this;
944        }
945        
946        
947
948        /**
949         * Sets the value for <b>wasNotTaken</b> (status)
950         *
951     * <p>
952     * <b>Definition:</b>
953     * Set this to true if the record is saying that the medication was NOT taken.
954     * </p> 
955         */
956        public MedicationStatement setWasNotTaken( boolean theBoolean) {
957                myWasNotTaken = new BooleanDt(theBoolean); 
958                return this; 
959        }
960
961 
962        /**
963         * Gets the value(s) for <b>reasonNotTaken</b> ().
964         * creating it if it does
965         * not exist. Will not return <code>null</code>.
966         *
967     * <p>
968     * <b>Definition:</b>
969     * A code indicating why the medication was not taken.
970     * </p> 
971         */
972        public java.util.List<CodeableConceptDt> getReasonNotTaken() {  
973                if (myReasonNotTaken == null) {
974                        myReasonNotTaken = new java.util.ArrayList<CodeableConceptDt>();
975                }
976                return myReasonNotTaken;
977        }
978
979        /**
980         * Sets the value(s) for <b>reasonNotTaken</b> ()
981         *
982     * <p>
983     * <b>Definition:</b>
984     * A code indicating why the medication was not taken.
985     * </p> 
986         */
987        public MedicationStatement setReasonNotTaken(java.util.List<CodeableConceptDt> theValue) {
988                myReasonNotTaken = theValue;
989                return this;
990        }
991        
992        
993
994        /**
995         * Adds and returns a new value for <b>reasonNotTaken</b> ()
996         *
997     * <p>
998     * <b>Definition:</b>
999     * A code indicating why the medication was not taken.
1000     * </p> 
1001         */
1002        public CodeableConceptDt addReasonNotTaken() {
1003                CodeableConceptDt newType = new CodeableConceptDt();
1004                getReasonNotTaken().add(newType);
1005                return newType; 
1006        }
1007
1008        /**
1009         * Adds a given new value for <b>reasonNotTaken</b> ()
1010         *
1011         * <p>
1012         * <b>Definition:</b>
1013         * A code indicating why the medication was not taken.
1014         * </p>
1015         * @param theValue The reasonNotTaken to add (must not be <code>null</code>)
1016         */
1017        public MedicationStatement addReasonNotTaken(CodeableConceptDt theValue) {
1018                if (theValue == null) {
1019                        throw new NullPointerException("theValue must not be null");
1020                }
1021                getReasonNotTaken().add(theValue);
1022                return this;
1023        }
1024
1025        /**
1026         * Gets the first repetition for <b>reasonNotTaken</b> (),
1027         * creating it if it does not already exist.
1028         *
1029     * <p>
1030     * <b>Definition:</b>
1031     * A code indicating why the medication was not taken.
1032     * </p> 
1033         */
1034        public CodeableConceptDt getReasonNotTakenFirstRep() {
1035                if (getReasonNotTaken().isEmpty()) {
1036                        return addReasonNotTaken();
1037                }
1038                return getReasonNotTaken().get(0); 
1039        }
1040  
1041        /**
1042         * Gets the value(s) for <b>reasonForUse[x]</b> ().
1043         * creating it if it does
1044         * not exist. Will not return <code>null</code>.
1045         *
1046     * <p>
1047     * <b>Definition:</b>
1048     * A reason for why the medication is being/was taken.
1049     * </p> 
1050         */
1051        public IDatatype getReasonForUse() {  
1052                return myReasonForUse;
1053        }
1054
1055        /**
1056         * Sets the value(s) for <b>reasonForUse[x]</b> ()
1057         *
1058     * <p>
1059     * <b>Definition:</b>
1060     * A reason for why the medication is being/was taken.
1061     * </p> 
1062         */
1063        public MedicationStatement setReasonForUse(IDatatype theValue) {
1064                myReasonForUse = theValue;
1065                return this;
1066        }
1067        
1068        
1069
1070  
1071        /**
1072         * Gets the value(s) for <b>effective[x]</b> (when.done).
1073         * creating it if it does
1074         * not exist. Will not return <code>null</code>.
1075         *
1076     * <p>
1077     * <b>Definition:</b>
1078     * The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).
1079     * </p> 
1080         */
1081        public IDatatype getEffective() {  
1082                return myEffective;
1083        }
1084
1085        /**
1086         * Sets the value(s) for <b>effective[x]</b> (when.done)
1087         *
1088     * <p>
1089     * <b>Definition:</b>
1090     * The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).
1091     * </p> 
1092         */
1093        public MedicationStatement setEffective(IDatatype theValue) {
1094                myEffective = theValue;
1095                return this;
1096        }
1097        
1098        
1099
1100  
1101        /**
1102         * Gets the value(s) for <b>note</b> ().
1103         * creating it if it does
1104         * not exist. Will not return <code>null</code>.
1105         *
1106     * <p>
1107     * <b>Definition:</b>
1108     * Provides extra information about the medication statement that is not conveyed by the other attributes.
1109     * </p> 
1110         */
1111        public StringDt getNoteElement() {  
1112                if (myNote == null) {
1113                        myNote = new StringDt();
1114                }
1115                return myNote;
1116        }
1117
1118        
1119        /**
1120         * Gets the value(s) for <b>note</b> ().
1121         * creating it if it does
1122         * not exist. Will not return <code>null</code>.
1123         *
1124     * <p>
1125     * <b>Definition:</b>
1126     * Provides extra information about the medication statement that is not conveyed by the other attributes.
1127     * </p> 
1128         */
1129        public String getNote() {  
1130                return getNoteElement().getValue();
1131        }
1132
1133        /**
1134         * Sets the value(s) for <b>note</b> ()
1135         *
1136     * <p>
1137     * <b>Definition:</b>
1138     * Provides extra information about the medication statement that is not conveyed by the other attributes.
1139     * </p> 
1140         */
1141        public MedicationStatement setNote(StringDt theValue) {
1142                myNote = theValue;
1143                return this;
1144        }
1145        
1146        
1147
1148        /**
1149         * Sets the value for <b>note</b> ()
1150         *
1151     * <p>
1152     * <b>Definition:</b>
1153     * Provides extra information about the medication statement that is not conveyed by the other attributes.
1154     * </p> 
1155         */
1156        public MedicationStatement setNote( String theString) {
1157                myNote = new StringDt(theString); 
1158                return this; 
1159        }
1160
1161 
1162        /**
1163         * Gets the value(s) for <b>supportingInformation</b> ().
1164         * creating it if it does
1165         * not exist. Will not return <code>null</code>.
1166         *
1167     * <p>
1168     * <b>Definition:</b>
1169     * Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports the MedicationStatement.
1170     * </p> 
1171         */
1172        public java.util.List<ResourceReferenceDt> getSupportingInformation() {  
1173                if (mySupportingInformation == null) {
1174                        mySupportingInformation = new java.util.ArrayList<ResourceReferenceDt>();
1175                }
1176                return mySupportingInformation;
1177        }
1178
1179        /**
1180         * Sets the value(s) for <b>supportingInformation</b> ()
1181         *
1182     * <p>
1183     * <b>Definition:</b>
1184     * Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports the MedicationStatement.
1185     * </p> 
1186         */
1187        public MedicationStatement setSupportingInformation(java.util.List<ResourceReferenceDt> theValue) {
1188                mySupportingInformation = theValue;
1189                return this;
1190        }
1191        
1192        
1193
1194        /**
1195         * Adds and returns a new value for <b>supportingInformation</b> ()
1196         *
1197     * <p>
1198     * <b>Definition:</b>
1199     * Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports the MedicationStatement.
1200     * </p> 
1201         */
1202        public ResourceReferenceDt addSupportingInformation() {
1203                ResourceReferenceDt newType = new ResourceReferenceDt();
1204                getSupportingInformation().add(newType);
1205                return newType; 
1206        }
1207  
1208        /**
1209         * Gets the value(s) for <b>medication[x]</b> (what).
1210         * creating it if it does
1211         * not exist. Will not return <code>null</code>.
1212         *
1213     * <p>
1214     * <b>Definition:</b>
1215     * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.
1216     * </p> 
1217         */
1218        public IDatatype getMedication() {  
1219                return myMedication;
1220        }
1221
1222        /**
1223         * Sets the value(s) for <b>medication[x]</b> (what)
1224         *
1225     * <p>
1226     * <b>Definition:</b>
1227     * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.
1228     * </p> 
1229         */
1230        public MedicationStatement setMedication(IDatatype theValue) {
1231                myMedication = theValue;
1232                return this;
1233        }
1234        
1235        
1236
1237  
1238        /**
1239         * Gets the value(s) for <b>dosage</b> ().
1240         * creating it if it does
1241         * not exist. Will not return <code>null</code>.
1242         *
1243     * <p>
1244     * <b>Definition:</b>
1245     * Indicates how the medication is/was used by the patient
1246     * </p> 
1247         */
1248        public java.util.List<Dosage> getDosage() {  
1249                if (myDosage == null) {
1250                        myDosage = new java.util.ArrayList<Dosage>();
1251                }
1252                return myDosage;
1253        }
1254
1255        /**
1256         * Sets the value(s) for <b>dosage</b> ()
1257         *
1258     * <p>
1259     * <b>Definition:</b>
1260     * Indicates how the medication is/was used by the patient
1261     * </p> 
1262         */
1263        public MedicationStatement setDosage(java.util.List<Dosage> theValue) {
1264                myDosage = theValue;
1265                return this;
1266        }
1267        
1268        
1269
1270        /**
1271         * Adds and returns a new value for <b>dosage</b> ()
1272         *
1273     * <p>
1274     * <b>Definition:</b>
1275     * Indicates how the medication is/was used by the patient
1276     * </p> 
1277         */
1278        public Dosage addDosage() {
1279                Dosage newType = new Dosage();
1280                getDosage().add(newType);
1281                return newType; 
1282        }
1283
1284        /**
1285         * Adds a given new value for <b>dosage</b> ()
1286         *
1287         * <p>
1288         * <b>Definition:</b>
1289         * Indicates how the medication is/was used by the patient
1290         * </p>
1291         * @param theValue The dosage to add (must not be <code>null</code>)
1292         */
1293        public MedicationStatement addDosage(Dosage theValue) {
1294                if (theValue == null) {
1295                        throw new NullPointerException("theValue must not be null");
1296                }
1297                getDosage().add(theValue);
1298                return this;
1299        }
1300
1301        /**
1302         * Gets the first repetition for <b>dosage</b> (),
1303         * creating it if it does not already exist.
1304         *
1305     * <p>
1306     * <b>Definition:</b>
1307     * Indicates how the medication is/was used by the patient
1308     * </p> 
1309         */
1310        public Dosage getDosageFirstRep() {
1311                if (getDosage().isEmpty()) {
1312                        return addDosage();
1313                }
1314                return getDosage().get(0); 
1315        }
1316  
1317        /**
1318         * Block class for child element: <b>MedicationStatement.dosage</b> ()
1319         *
1320     * <p>
1321     * <b>Definition:</b>
1322     * Indicates how the medication is/was used by the patient
1323     * </p> 
1324         */
1325        @Block()        
1326        public static class Dosage 
1327            extends  BaseIdentifiableElement        implements IResourceBlock {
1328        
1329        @Child(name="text", type=StringDt.class, order=0, min=0, max=1, summary=false, modifier=false)  
1330        @Description(
1331                shortDefinition="",
1332                formalDefinition="Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans."
1333        )
1334        private StringDt myText;
1335        
1336        @Child(name="timing", type=TimingDt.class, order=1, min=0, max=1, summary=false, modifier=false)        
1337        @Description(
1338                shortDefinition="",
1339                formalDefinition="The timing schedule for giving the medication to the patient.  The Schedule data type allows many different expressions, for example.  \"Every  8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\";  \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\""
1340        )
1341        private TimingDt myTiming;
1342        
1343        @Child(name="asNeeded", order=2, min=0, max=1, summary=false, modifier=false, type={
1344                BooleanDt.class,                CodeableConceptDt.class })
1345        @Description(
1346                shortDefinition="",
1347                formalDefinition="Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).  Specifically if 'boolean' datatype is selected, then the following logic applies:  If set to True, this indicates that the medication is only taken when needed, within the specified schedule."
1348        )
1349        private IDatatype myAsNeeded;
1350        
1351        @Child(name="site", order=3, min=0, max=1, summary=false, modifier=false, type={
1352                CodeableConceptDt.class,                BodySite.class  })
1353        @Description(
1354                shortDefinition="",
1355                formalDefinition="A coded specification of or a reference to the anatomic site where the medication first enters the body"
1356        )
1357        private IDatatype mySite;
1358        
1359        @Child(name="route", type=CodeableConceptDt.class, order=4, min=0, max=1, summary=false, modifier=false)        
1360        @Description(
1361                shortDefinition="",
1362                formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject."
1363        )
1364        private CodeableConceptDt myRoute;
1365        
1366        @Child(name="method", type=CodeableConceptDt.class, order=5, min=0, max=1, summary=false, modifier=false)       
1367        @Description(
1368                shortDefinition="",
1369                formalDefinition="A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.  This attribute will most often NOT be populated.  It is most commonly used for injections.  For example, Slow Push, Deep IV."
1370        )
1371        private CodeableConceptDt myMethod;
1372        
1373        @Child(name="quantity", order=6, min=0, max=1, summary=false, modifier=false, type={
1374                SimpleQuantityDt.class,                 RangeDt.class   })
1375        @Description(
1376                shortDefinition="",
1377                formalDefinition="The amount of therapeutic or other substance given at one administration event."
1378        )
1379        private IDatatype myQuantity;
1380        
1381        @Child(name="rate", order=7, min=0, max=1, summary=false, modifier=false, type={
1382                RatioDt.class,          RangeDt.class   })
1383        @Description(
1384                shortDefinition="",
1385                formalDefinition="Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours.   Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours"
1386        )
1387        private IDatatype myRate;
1388        
1389        @Child(name="maxDosePerPeriod", type=RatioDt.class, order=8, min=0, max=1, summary=false, modifier=false)       
1390        @Description(
1391                shortDefinition="",
1392                formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time.  For example, 1000mg in 24 hours."
1393        )
1394        private RatioDt myMaxDosePerPeriod;
1395        
1396
1397        @Override
1398        public boolean isEmpty() {
1399                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myText,  myTiming,  myAsNeeded,  mySite,  myRoute,  myMethod,  myQuantity,  myRate,  myMaxDosePerPeriod);
1400        }
1401        
1402        @Override
1403        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1404                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myText, myTiming, myAsNeeded, mySite, myRoute, myMethod, myQuantity, myRate, myMaxDosePerPeriod);
1405        }
1406
1407        /**
1408         * Gets the value(s) for <b>text</b> ().
1409         * creating it if it does
1410         * not exist. Will not return <code>null</code>.
1411         *
1412     * <p>
1413     * <b>Definition:</b>
1414     * Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans.
1415     * </p> 
1416         */
1417        public StringDt getTextElement() {  
1418                if (myText == null) {
1419                        myText = new StringDt();
1420                }
1421                return myText;
1422        }
1423
1424        
1425        /**
1426         * Gets the value(s) for <b>text</b> ().
1427         * creating it if it does
1428         * not exist. Will not return <code>null</code>.
1429         *
1430     * <p>
1431     * <b>Definition:</b>
1432     * Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans.
1433     * </p> 
1434         */
1435        public String getText() {  
1436                return getTextElement().getValue();
1437        }
1438
1439        /**
1440         * Sets the value(s) for <b>text</b> ()
1441         *
1442     * <p>
1443     * <b>Definition:</b>
1444     * Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans.
1445     * </p> 
1446         */
1447        public Dosage setText(StringDt theValue) {
1448                myText = theValue;
1449                return this;
1450        }
1451        
1452        
1453
1454        /**
1455         * Sets the value for <b>text</b> ()
1456         *
1457     * <p>
1458     * <b>Definition:</b>
1459     * Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans.
1460     * </p> 
1461         */
1462        public Dosage setText( String theString) {
1463                myText = new StringDt(theString); 
1464                return this; 
1465        }
1466
1467 
1468        /**
1469         * Gets the value(s) for <b>timing</b> ().
1470         * creating it if it does
1471         * not exist. Will not return <code>null</code>.
1472         *
1473     * <p>
1474     * <b>Definition:</b>
1475     * The timing schedule for giving the medication to the patient.  The Schedule data type allows many different expressions, for example.  \&quot;Every  8 hours\&quot;; \&quot;Three times a day\&quot;; \&quot;1/2 an hour before breakfast for 10 days from 23-Dec 2011:\&quot;;  \&quot;15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\&quot;
1476     * </p> 
1477         */
1478        public TimingDt getTiming() {  
1479                if (myTiming == null) {
1480                        myTiming = new TimingDt();
1481                }
1482                return myTiming;
1483        }
1484
1485        /**
1486         * Sets the value(s) for <b>timing</b> ()
1487         *
1488     * <p>
1489     * <b>Definition:</b>
1490     * The timing schedule for giving the medication to the patient.  The Schedule data type allows many different expressions, for example.  \&quot;Every  8 hours\&quot;; \&quot;Three times a day\&quot;; \&quot;1/2 an hour before breakfast for 10 days from 23-Dec 2011:\&quot;;  \&quot;15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\&quot;
1491     * </p> 
1492         */
1493        public Dosage setTiming(TimingDt theValue) {
1494                myTiming = theValue;
1495                return this;
1496        }
1497        
1498        
1499
1500  
1501        /**
1502         * Gets the value(s) for <b>asNeeded[x]</b> ().
1503         * creating it if it does
1504         * not exist. Will not return <code>null</code>.
1505         *
1506     * <p>
1507     * <b>Definition:</b>
1508     * Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).  Specifically if 'boolean' datatype is selected, then the following logic applies:  If set to True, this indicates that the medication is only taken when needed, within the specified schedule.
1509     * </p> 
1510         */
1511        public IDatatype getAsNeeded() {  
1512                return myAsNeeded;
1513        }
1514
1515        /**
1516         * Sets the value(s) for <b>asNeeded[x]</b> ()
1517         *
1518     * <p>
1519     * <b>Definition:</b>
1520     * Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).  Specifically if 'boolean' datatype is selected, then the following logic applies:  If set to True, this indicates that the medication is only taken when needed, within the specified schedule.
1521     * </p> 
1522         */
1523        public Dosage setAsNeeded(IDatatype theValue) {
1524                myAsNeeded = theValue;
1525                return this;
1526        }
1527        
1528        
1529
1530  
1531        /**
1532         * Gets the value(s) for <b>site[x]</b> ().
1533         * creating it if it does
1534         * not exist. Will not return <code>null</code>.
1535         *
1536     * <p>
1537     * <b>Definition:</b>
1538     * A coded specification of or a reference to the anatomic site where the medication first enters the body
1539     * </p> 
1540         */
1541        public IDatatype getSite() {  
1542                return mySite;
1543        }
1544
1545        /**
1546         * Sets the value(s) for <b>site[x]</b> ()
1547         *
1548     * <p>
1549     * <b>Definition:</b>
1550     * A coded specification of or a reference to the anatomic site where the medication first enters the body
1551     * </p> 
1552         */
1553        public Dosage setSite(IDatatype theValue) {
1554                mySite = theValue;
1555                return this;
1556        }
1557        
1558        
1559
1560  
1561        /**
1562         * Gets the value(s) for <b>route</b> ().
1563         * creating it if it does
1564         * not exist. Will not return <code>null</code>.
1565         *
1566     * <p>
1567     * <b>Definition:</b>
1568     * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.
1569     * </p> 
1570         */
1571        public CodeableConceptDt getRoute() {  
1572                if (myRoute == null) {
1573                        myRoute = new CodeableConceptDt();
1574                }
1575                return myRoute;
1576        }
1577
1578        /**
1579         * Sets the value(s) for <b>route</b> ()
1580         *
1581     * <p>
1582     * <b>Definition:</b>
1583     * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.
1584     * </p> 
1585         */
1586        public Dosage setRoute(CodeableConceptDt theValue) {
1587                myRoute = theValue;
1588                return this;
1589        }
1590        
1591        
1592
1593  
1594        /**
1595         * Gets the value(s) for <b>method</b> ().
1596         * creating it if it does
1597         * not exist. Will not return <code>null</code>.
1598         *
1599     * <p>
1600     * <b>Definition:</b>
1601     * A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.  This attribute will most often NOT be populated.  It is most commonly used for injections.  For example, Slow Push, Deep IV.
1602     * </p> 
1603         */
1604        public CodeableConceptDt getMethod() {  
1605                if (myMethod == null) {
1606                        myMethod = new CodeableConceptDt();
1607                }
1608                return myMethod;
1609        }
1610
1611        /**
1612         * Sets the value(s) for <b>method</b> ()
1613         *
1614     * <p>
1615     * <b>Definition:</b>
1616     * A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.  This attribute will most often NOT be populated.  It is most commonly used for injections.  For example, Slow Push, Deep IV.
1617     * </p> 
1618         */
1619        public Dosage setMethod(CodeableConceptDt theValue) {
1620                myMethod = theValue;
1621                return this;
1622        }
1623        
1624        
1625
1626  
1627        /**
1628         * Gets the value(s) for <b>quantity[x]</b> ().
1629         * creating it if it does
1630         * not exist. Will not return <code>null</code>.
1631         *
1632     * <p>
1633     * <b>Definition:</b>
1634     * The amount of therapeutic or other substance given at one administration event.
1635     * </p> 
1636         */
1637        public IDatatype getQuantity() {  
1638                return myQuantity;
1639        }
1640
1641        /**
1642         * Sets the value(s) for <b>quantity[x]</b> ()
1643         *
1644     * <p>
1645     * <b>Definition:</b>
1646     * The amount of therapeutic or other substance given at one administration event.
1647     * </p> 
1648         */
1649        public Dosage setQuantity(IDatatype theValue) {
1650                myQuantity = theValue;
1651                return this;
1652        }
1653        
1654        
1655
1656  
1657        /**
1658         * Gets the value(s) for <b>rate[x]</b> ().
1659         * creating it if it does
1660         * not exist. Will not return <code>null</code>.
1661         *
1662     * <p>
1663     * <b>Definition:</b>
1664     * Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours.   Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours
1665     * </p> 
1666         */
1667        public IDatatype getRate() {  
1668                return myRate;
1669        }
1670
1671        /**
1672         * Sets the value(s) for <b>rate[x]</b> ()
1673         *
1674     * <p>
1675     * <b>Definition:</b>
1676     * Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours.   Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours
1677     * </p> 
1678         */
1679        public Dosage setRate(IDatatype theValue) {
1680                myRate = theValue;
1681                return this;
1682        }
1683        
1684        
1685
1686  
1687        /**
1688         * Gets the value(s) for <b>maxDosePerPeriod</b> ().
1689         * creating it if it does
1690         * not exist. Will not return <code>null</code>.
1691         *
1692     * <p>
1693     * <b>Definition:</b>
1694     * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time.  For example, 1000mg in 24 hours.
1695     * </p> 
1696         */
1697        public RatioDt getMaxDosePerPeriod() {  
1698                if (myMaxDosePerPeriod == null) {
1699                        myMaxDosePerPeriod = new RatioDt();
1700                }
1701                return myMaxDosePerPeriod;
1702        }
1703
1704        /**
1705         * Sets the value(s) for <b>maxDosePerPeriod</b> ()
1706         *
1707     * <p>
1708     * <b>Definition:</b>
1709     * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time.  For example, 1000mg in 24 hours.
1710     * </p> 
1711         */
1712        public Dosage setMaxDosePerPeriod(RatioDt theValue) {
1713                myMaxDosePerPeriod = theValue;
1714                return this;
1715        }
1716        
1717        
1718
1719  
1720
1721
1722        }
1723
1724
1725
1726
1727    @Override
1728    public String getResourceName() {
1729        return "MedicationStatement";
1730    }
1731    
1732    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
1733        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
1734    }
1735
1736
1737}