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>Substance</b> Resource
282 * (administrative.entity)
283 *
284 * <p>
285 * <b>Definition:</b>
286 * A homogeneous material with a definite composition.
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/Substance">http://hl7.org/fhir/profiles/Substance</a> 
297 * </p>
298 *
299 */
300@ResourceDef(name="Substance", profile="http://hl7.org/fhir/profiles/Substance", id="substance")
301public class Substance extends ca.uhn.fhir.model.dstu2.resource.BaseResource
302    implements  IResource     {
303
304        /**
305         * Search parameter constant for <b>code</b>
306         * <p>
307         * Description: <b>The code of the substance</b><br>
308         * Type: <b>token</b><br>
309         * Path: <b>Substance.code</b><br>
310         * </p>
311         */
312        @SearchParamDefinition(name="code", path="Substance.code", description="The code of the substance", type="token"  )
313        public static final String SP_CODE = "code";
314
315        /**
316         * <b>Fluent Client</b> search parameter constant for <b>code</b>
317         * <p>
318         * Description: <b>The code of the substance</b><br>
319         * Type: <b>token</b><br>
320         * Path: <b>Substance.code</b><br>
321         * </p>
322         */
323        public static final TokenClientParam CODE = new TokenClientParam(SP_CODE);
324
325        /**
326         * Search parameter constant for <b>category</b>
327         * <p>
328         * Description: <b>The category of the substance</b><br>
329         * Type: <b>token</b><br>
330         * Path: <b>Substance.category</b><br>
331         * </p>
332         */
333        @SearchParamDefinition(name="category", path="Substance.category", description="The category of the substance", type="token"  )
334        public static final String SP_CATEGORY = "category";
335
336        /**
337         * <b>Fluent Client</b> search parameter constant for <b>category</b>
338         * <p>
339         * Description: <b>The category of the substance</b><br>
340         * Type: <b>token</b><br>
341         * Path: <b>Substance.category</b><br>
342         * </p>
343         */
344        public static final TokenClientParam CATEGORY = new TokenClientParam(SP_CATEGORY);
345
346        /**
347         * Search parameter constant for <b>container-identifier</b>
348         * <p>
349         * Description: <b>Identifier of the package/container</b><br>
350         * Type: <b>token</b><br>
351         * Path: <b>Substance.instance.identifier</b><br>
352         * </p>
353         */
354        @SearchParamDefinition(name="container-identifier", path="Substance.instance.identifier", description="Identifier of the package/container", type="token"  )
355        public static final String SP_CONTAINER_IDENTIFIER = "container-identifier";
356
357        /**
358         * <b>Fluent Client</b> search parameter constant for <b>container-identifier</b>
359         * <p>
360         * Description: <b>Identifier of the package/container</b><br>
361         * Type: <b>token</b><br>
362         * Path: <b>Substance.instance.identifier</b><br>
363         * </p>
364         */
365        public static final TokenClientParam CONTAINER_IDENTIFIER = new TokenClientParam(SP_CONTAINER_IDENTIFIER);
366
367        /**
368         * Search parameter constant for <b>expiry</b>
369         * <p>
370         * Description: <b>Expiry date of package or container of substance</b><br>
371         * Type: <b>date</b><br>
372         * Path: <b>Substance.instance.expiry</b><br>
373         * </p>
374         */
375        @SearchParamDefinition(name="expiry", path="Substance.instance.expiry", description="Expiry date of package or container of substance", type="date"  )
376        public static final String SP_EXPIRY = "expiry";
377
378        /**
379         * <b>Fluent Client</b> search parameter constant for <b>expiry</b>
380         * <p>
381         * Description: <b>Expiry date of package or container of substance</b><br>
382         * Type: <b>date</b><br>
383         * Path: <b>Substance.instance.expiry</b><br>
384         * </p>
385         */
386        public static final DateClientParam EXPIRY = new DateClientParam(SP_EXPIRY);
387
388        /**
389         * Search parameter constant for <b>quantity</b>
390         * <p>
391         * Description: <b>Amount of substance in the package</b><br>
392         * Type: <b>quantity</b><br>
393         * Path: <b>Substance.instance.quantity</b><br>
394         * </p>
395         */
396        @SearchParamDefinition(name="quantity", path="Substance.instance.quantity", description="Amount of substance in the package", type="quantity"  )
397        public static final String SP_QUANTITY = "quantity";
398
399        /**
400         * <b>Fluent Client</b> search parameter constant for <b>quantity</b>
401         * <p>
402         * Description: <b>Amount of substance in the package</b><br>
403         * Type: <b>quantity</b><br>
404         * Path: <b>Substance.instance.quantity</b><br>
405         * </p>
406         */
407        public static final QuantityClientParam QUANTITY = new QuantityClientParam(SP_QUANTITY);
408
409        /**
410         * Search parameter constant for <b>substance</b>
411         * <p>
412         * Description: <b>A component of the substance</b><br>
413         * Type: <b>reference</b><br>
414         * Path: <b>Substance.ingredient.substance</b><br>
415         * </p>
416         */
417        @SearchParamDefinition(name="substance", path="Substance.ingredient.substance", description="A component of the substance", type="reference"  )
418        public static final String SP_SUBSTANCE = "substance";
419
420        /**
421         * <b>Fluent Client</b> search parameter constant for <b>substance</b>
422         * <p>
423         * Description: <b>A component of the substance</b><br>
424         * Type: <b>reference</b><br>
425         * Path: <b>Substance.ingredient.substance</b><br>
426         * </p>
427         */
428        public static final ReferenceClientParam SUBSTANCE = new ReferenceClientParam(SP_SUBSTANCE);
429
430        /**
431         * Search parameter constant for <b>identifier</b>
432         * <p>
433         * Description: <b>Unique identifier for the substance</b><br>
434         * Type: <b>token</b><br>
435         * Path: <b>Substance.identifier</b><br>
436         * </p>
437         */
438        @SearchParamDefinition(name="identifier", path="Substance.identifier", description="Unique identifier for the substance", type="token"  )
439        public static final String SP_IDENTIFIER = "identifier";
440
441        /**
442         * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
443         * <p>
444         * Description: <b>Unique identifier for the substance</b><br>
445         * Type: <b>token</b><br>
446         * Path: <b>Substance.identifier</b><br>
447         * </p>
448         */
449        public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
450
451
452        /**
453         * Constant for fluent queries to be used to add include statements. Specifies
454         * the path value of "<b>Substance:substance</b>".
455         */
456        public static final Include INCLUDE_SUBSTANCE = new Include("Substance:substance");
457
458
459        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)       
460        @Description(
461                shortDefinition="",
462                formalDefinition="Unique identifier for the substance"
463        )
464        private java.util.List<IdentifierDt> myIdentifier;
465        
466        @Child(name="category", type=CodeableConceptDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)    
467        @Description(
468                shortDefinition="class",
469                formalDefinition="A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes."
470        )
471        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/valueset-substance-category")
472        private java.util.List<BoundCodeableConceptDt<SubstanceCategoryCodesEnum>> myCategory;
473        
474        @Child(name="code", type=CodeableConceptDt.class, order=2, min=1, max=1, summary=true, modifier=false)  
475        @Description(
476                shortDefinition="what",
477                formalDefinition="A code (or set of codes) that identify this substance"
478        )
479        private CodeableConceptDt myCode;
480        
481        @Child(name="description", type=StringDt.class, order=3, min=0, max=1, summary=true, modifier=false)    
482        @Description(
483                shortDefinition="",
484                formalDefinition="A description of the substance - its appearance, handling requirements, and other usage notes"
485        )
486        private StringDt myDescription;
487        
488        @Child(name="instance", order=4, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)  
489        @Description(
490                shortDefinition="class",
491                formalDefinition="Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance"
492        )
493        private java.util.List<Instance> myInstance;
494        
495        @Child(name="ingredient", order=5, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)        
496        @Description(
497                shortDefinition="",
498                formalDefinition="A substance can be composed of other substances"
499        )
500        private java.util.List<Ingredient> myIngredient;
501        
502
503        @Override
504        public boolean isEmpty() {
505                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myCategory,  myCode,  myDescription,  myInstance,  myIngredient);
506        }
507        
508        @Override
509        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
510                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myCategory, myCode, myDescription, myInstance, myIngredient);
511        }
512
513        /**
514         * Gets the value(s) for <b>identifier</b> ().
515         * creating it if it does
516         * not exist. Will not return <code>null</code>.
517         *
518     * <p>
519     * <b>Definition:</b>
520     * Unique identifier for the substance
521     * </p> 
522         */
523        public java.util.List<IdentifierDt> getIdentifier() {  
524                if (myIdentifier == null) {
525                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
526                }
527                return myIdentifier;
528        }
529
530        /**
531         * Sets the value(s) for <b>identifier</b> ()
532         *
533     * <p>
534     * <b>Definition:</b>
535     * Unique identifier for the substance
536     * </p> 
537         */
538        public Substance setIdentifier(java.util.List<IdentifierDt> theValue) {
539                myIdentifier = theValue;
540                return this;
541        }
542        
543        
544
545        /**
546         * Adds and returns a new value for <b>identifier</b> ()
547         *
548     * <p>
549     * <b>Definition:</b>
550     * Unique identifier for the substance
551     * </p> 
552         */
553        public IdentifierDt addIdentifier() {
554                IdentifierDt newType = new IdentifierDt();
555                getIdentifier().add(newType);
556                return newType; 
557        }
558
559        /**
560         * Adds a given new value for <b>identifier</b> ()
561         *
562         * <p>
563         * <b>Definition:</b>
564         * Unique identifier for the substance
565         * </p>
566         * @param theValue The identifier to add (must not be <code>null</code>)
567         */
568        public Substance addIdentifier(IdentifierDt theValue) {
569                if (theValue == null) {
570                        throw new NullPointerException("theValue must not be null");
571                }
572                getIdentifier().add(theValue);
573                return this;
574        }
575
576        /**
577         * Gets the first repetition for <b>identifier</b> (),
578         * creating it if it does not already exist.
579         *
580     * <p>
581     * <b>Definition:</b>
582     * Unique identifier for the substance
583     * </p> 
584         */
585        public IdentifierDt getIdentifierFirstRep() {
586                if (getIdentifier().isEmpty()) {
587                        return addIdentifier();
588                }
589                return getIdentifier().get(0); 
590        }
591  
592        /**
593         * Gets the value(s) for <b>category</b> (class).
594         * creating it if it does
595         * not exist. Will not return <code>null</code>.
596         *
597     * <p>
598     * <b>Definition:</b>
599     * A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.
600     * </p> 
601         */
602        public java.util.List<BoundCodeableConceptDt<SubstanceCategoryCodesEnum>> getCategory() {  
603                if (myCategory == null) {
604                        myCategory = new java.util.ArrayList<BoundCodeableConceptDt<SubstanceCategoryCodesEnum>>();
605                }
606                return myCategory;
607        }
608
609        /**
610         * Sets the value(s) for <b>category</b> (class)
611         *
612     * <p>
613     * <b>Definition:</b>
614     * A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.
615     * </p> 
616         */
617        public Substance setCategory(java.util.List<BoundCodeableConceptDt<SubstanceCategoryCodesEnum>> theValue) {
618                myCategory = theValue;
619                return this;
620        }
621        
622        
623
624        /**
625         * Add a value for <b>category</b> (class) using an enumerated type. This
626         * is intended as a convenience method for situations where the FHIR defined ValueSets are mandatory
627         * or contain the desirable codes. If you wish to use codes other than those which are built-in, 
628         * you may also use the {@link #addCategory()} method.
629         *
630     * <p>
631     * <b>Definition:</b>
632     * A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.
633     * </p> 
634         */
635        public BoundCodeableConceptDt<SubstanceCategoryCodesEnum> addCategory(SubstanceCategoryCodesEnum theValue) {
636                BoundCodeableConceptDt<SubstanceCategoryCodesEnum> retVal = new BoundCodeableConceptDt<SubstanceCategoryCodesEnum>(SubstanceCategoryCodesEnum.VALUESET_BINDER, theValue);
637                getCategory().add(retVal);
638                return retVal;
639        }
640
641        /**
642         * Gets the first repetition for <b>category</b> (class),
643         * creating it if it does not already exist.
644         *
645     * <p>
646     * <b>Definition:</b>
647     * A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.
648     * </p> 
649         */
650        public BoundCodeableConceptDt<SubstanceCategoryCodesEnum> getCategoryFirstRep() {
651                if (getCategory().size() == 0) {
652                        addCategory();
653                }
654                return getCategory().get(0);
655        }
656
657        /**
658         * Add a value for <b>category</b> (class)
659         *
660     * <p>
661     * <b>Definition:</b>
662     * A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.
663     * </p> 
664         */
665        public BoundCodeableConceptDt<SubstanceCategoryCodesEnum> addCategory() {
666                BoundCodeableConceptDt<SubstanceCategoryCodesEnum> retVal = new BoundCodeableConceptDt<SubstanceCategoryCodesEnum>(SubstanceCategoryCodesEnum.VALUESET_BINDER);
667                getCategory().add(retVal);
668                return retVal;
669        }
670
671        /**
672         * Sets the value(s), and clears any existing value(s) for <b>category</b> (class)
673         *
674     * <p>
675     * <b>Definition:</b>
676     * A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.
677     * </p> 
678         */
679        public Substance setCategory(SubstanceCategoryCodesEnum theValue) {
680                getCategory().clear();
681                addCategory(theValue);
682                return this;
683        }
684
685  
686        /**
687         * Gets the value(s) for <b>code</b> (what).
688         * creating it if it does
689         * not exist. Will not return <code>null</code>.
690         *
691     * <p>
692     * <b>Definition:</b>
693     * A code (or set of codes) that identify this substance
694     * </p> 
695         */
696        public CodeableConceptDt getCode() {  
697                if (myCode == null) {
698                        myCode = new CodeableConceptDt();
699                }
700                return myCode;
701        }
702
703        /**
704         * Sets the value(s) for <b>code</b> (what)
705         *
706     * <p>
707     * <b>Definition:</b>
708     * A code (or set of codes) that identify this substance
709     * </p> 
710         */
711        public Substance setCode(CodeableConceptDt theValue) {
712                myCode = theValue;
713                return this;
714        }
715        
716        
717
718  
719        /**
720         * Gets the value(s) for <b>description</b> ().
721         * creating it if it does
722         * not exist. Will not return <code>null</code>.
723         *
724     * <p>
725     * <b>Definition:</b>
726     * A description of the substance - its appearance, handling requirements, and other usage notes
727     * </p> 
728         */
729        public StringDt getDescriptionElement() {  
730                if (myDescription == null) {
731                        myDescription = new StringDt();
732                }
733                return myDescription;
734        }
735
736        
737        /**
738         * Gets the value(s) for <b>description</b> ().
739         * creating it if it does
740         * not exist. This method may return <code>null</code>.
741         *
742     * <p>
743     * <b>Definition:</b>
744     * A description of the substance - its appearance, handling requirements, and other usage notes
745     * </p> 
746         */
747        public String getDescription() {  
748                return getDescriptionElement().getValue();
749        }
750
751        /**
752         * Sets the value(s) for <b>description</b> ()
753         *
754     * <p>
755     * <b>Definition:</b>
756     * A description of the substance - its appearance, handling requirements, and other usage notes
757     * </p> 
758         */
759        public Substance setDescription(StringDt theValue) {
760                myDescription = theValue;
761                return this;
762        }
763        
764        
765
766        /**
767         * Sets the value for <b>description</b> ()
768         *
769     * <p>
770     * <b>Definition:</b>
771     * A description of the substance - its appearance, handling requirements, and other usage notes
772     * </p> 
773         */
774        public Substance setDescription( String theString) {
775                myDescription = new StringDt(theString); 
776                return this; 
777        }
778
779 
780        /**
781         * Gets the value(s) for <b>instance</b> (class).
782         * creating it if it does
783         * not exist. Will not return <code>null</code>.
784         *
785     * <p>
786     * <b>Definition:</b>
787     * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance
788     * </p> 
789         */
790        public java.util.List<Instance> getInstance() {  
791                if (myInstance == null) {
792                        myInstance = new java.util.ArrayList<Instance>();
793                }
794                return myInstance;
795        }
796
797        /**
798         * Sets the value(s) for <b>instance</b> (class)
799         *
800     * <p>
801     * <b>Definition:</b>
802     * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance
803     * </p> 
804         */
805        public Substance setInstance(java.util.List<Instance> theValue) {
806                myInstance = theValue;
807                return this;
808        }
809        
810        
811
812        /**
813         * Adds and returns a new value for <b>instance</b> (class)
814         *
815     * <p>
816     * <b>Definition:</b>
817     * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance
818     * </p> 
819         */
820        public Instance addInstance() {
821                Instance newType = new Instance();
822                getInstance().add(newType);
823                return newType; 
824        }
825
826        /**
827         * Adds a given new value for <b>instance</b> (class)
828         *
829         * <p>
830         * <b>Definition:</b>
831         * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance
832         * </p>
833         * @param theValue The instance to add (must not be <code>null</code>)
834         */
835        public Substance addInstance(Instance theValue) {
836                if (theValue == null) {
837                        throw new NullPointerException("theValue must not be null");
838                }
839                getInstance().add(theValue);
840                return this;
841        }
842
843        /**
844         * Gets the first repetition for <b>instance</b> (class),
845         * creating it if it does not already exist.
846         *
847     * <p>
848     * <b>Definition:</b>
849     * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance
850     * </p> 
851         */
852        public Instance getInstanceFirstRep() {
853                if (getInstance().isEmpty()) {
854                        return addInstance();
855                }
856                return getInstance().get(0); 
857        }
858  
859        /**
860         * Gets the value(s) for <b>ingredient</b> ().
861         * creating it if it does
862         * not exist. Will not return <code>null</code>.
863         *
864     * <p>
865     * <b>Definition:</b>
866     * A substance can be composed of other substances
867     * </p> 
868         */
869        public java.util.List<Ingredient> getIngredient() {  
870                if (myIngredient == null) {
871                        myIngredient = new java.util.ArrayList<Ingredient>();
872                }
873                return myIngredient;
874        }
875
876        /**
877         * Sets the value(s) for <b>ingredient</b> ()
878         *
879     * <p>
880     * <b>Definition:</b>
881     * A substance can be composed of other substances
882     * </p> 
883         */
884        public Substance setIngredient(java.util.List<Ingredient> theValue) {
885                myIngredient = theValue;
886                return this;
887        }
888        
889        
890
891        /**
892         * Adds and returns a new value for <b>ingredient</b> ()
893         *
894     * <p>
895     * <b>Definition:</b>
896     * A substance can be composed of other substances
897     * </p> 
898         */
899        public Ingredient addIngredient() {
900                Ingredient newType = new Ingredient();
901                getIngredient().add(newType);
902                return newType; 
903        }
904
905        /**
906         * Adds a given new value for <b>ingredient</b> ()
907         *
908         * <p>
909         * <b>Definition:</b>
910         * A substance can be composed of other substances
911         * </p>
912         * @param theValue The ingredient to add (must not be <code>null</code>)
913         */
914        public Substance addIngredient(Ingredient theValue) {
915                if (theValue == null) {
916                        throw new NullPointerException("theValue must not be null");
917                }
918                getIngredient().add(theValue);
919                return this;
920        }
921
922        /**
923         * Gets the first repetition for <b>ingredient</b> (),
924         * creating it if it does not already exist.
925         *
926     * <p>
927     * <b>Definition:</b>
928     * A substance can be composed of other substances
929     * </p> 
930         */
931        public Ingredient getIngredientFirstRep() {
932                if (getIngredient().isEmpty()) {
933                        return addIngredient();
934                }
935                return getIngredient().get(0); 
936        }
937  
938        /**
939         * Block class for child element: <b>Substance.instance</b> (class)
940         *
941     * <p>
942     * <b>Definition:</b>
943     * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance
944     * </p> 
945         */
946        @Block()        
947        public static class Instance 
948            extends  BaseIdentifiableElement        implements IResourceBlock {
949        
950        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1, summary=true, modifier=false) 
951        @Description(
952                shortDefinition="",
953                formalDefinition="Identifier associated with the package/container (usually a label affixed directly)"
954        )
955        private IdentifierDt myIdentifier;
956        
957        @Child(name="expiry", type=DateTimeDt.class, order=1, min=0, max=1, summary=true, modifier=false)       
958        @Description(
959                shortDefinition="",
960                formalDefinition="When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry."
961        )
962        private DateTimeDt myExpiry;
963        
964        @Child(name="quantity", type=SimpleQuantityDt.class, order=2, min=0, max=1, summary=true, modifier=false)       
965        @Description(
966                shortDefinition="",
967                formalDefinition="The amount of the substance"
968        )
969        private SimpleQuantityDt myQuantity;
970        
971
972        @Override
973        public boolean isEmpty() {
974                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myExpiry,  myQuantity);
975        }
976        
977        @Override
978        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
979                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myExpiry, myQuantity);
980        }
981
982        /**
983         * Gets the value(s) for <b>identifier</b> ().
984         * creating it if it does
985         * not exist. Will not return <code>null</code>.
986         *
987     * <p>
988     * <b>Definition:</b>
989     * Identifier associated with the package/container (usually a label affixed directly)
990     * </p> 
991         */
992        public IdentifierDt getIdentifier() {  
993                if (myIdentifier == null) {
994                        myIdentifier = new IdentifierDt();
995                }
996                return myIdentifier;
997        }
998
999        /**
1000         * Sets the value(s) for <b>identifier</b> ()
1001         *
1002     * <p>
1003     * <b>Definition:</b>
1004     * Identifier associated with the package/container (usually a label affixed directly)
1005     * </p> 
1006         */
1007        public Instance setIdentifier(IdentifierDt theValue) {
1008                myIdentifier = theValue;
1009                return this;
1010        }
1011        
1012        
1013
1014  
1015        /**
1016         * Gets the value(s) for <b>expiry</b> ().
1017         * creating it if it does
1018         * not exist. Will not return <code>null</code>.
1019         *
1020     * <p>
1021     * <b>Definition:</b>
1022     * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.
1023     * </p> 
1024         */
1025        public DateTimeDt getExpiryElement() {  
1026                if (myExpiry == null) {
1027                        myExpiry = new DateTimeDt();
1028                }
1029                return myExpiry;
1030        }
1031
1032        
1033        /**
1034         * Gets the value(s) for <b>expiry</b> ().
1035         * creating it if it does
1036         * not exist. This method may return <code>null</code>.
1037         *
1038     * <p>
1039     * <b>Definition:</b>
1040     * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.
1041     * </p> 
1042         */
1043        public Date getExpiry() {  
1044                return getExpiryElement().getValue();
1045        }
1046
1047        /**
1048         * Sets the value(s) for <b>expiry</b> ()
1049         *
1050     * <p>
1051     * <b>Definition:</b>
1052     * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.
1053     * </p> 
1054         */
1055        public Instance setExpiry(DateTimeDt theValue) {
1056                myExpiry = theValue;
1057                return this;
1058        }
1059        
1060        
1061
1062        /**
1063         * Sets the value for <b>expiry</b> ()
1064         *
1065     * <p>
1066     * <b>Definition:</b>
1067     * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.
1068     * </p> 
1069         */
1070        public Instance setExpiry( Date theDate,  TemporalPrecisionEnum thePrecision) {
1071                myExpiry = new DateTimeDt(theDate, thePrecision); 
1072                return this; 
1073        }
1074
1075        /**
1076         * Sets the value for <b>expiry</b> ()
1077         *
1078     * <p>
1079     * <b>Definition:</b>
1080     * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.
1081     * </p> 
1082         */
1083        public Instance setExpiryWithSecondsPrecision( Date theDate) {
1084                myExpiry = new DateTimeDt(theDate); 
1085                return this; 
1086        }
1087
1088 
1089        /**
1090         * Gets the value(s) for <b>quantity</b> ().
1091         * creating it if it does
1092         * not exist. Will not return <code>null</code>.
1093         *
1094     * <p>
1095     * <b>Definition:</b>
1096     * The amount of the substance
1097     * </p> 
1098         */
1099        public SimpleQuantityDt getQuantity() {  
1100                if (myQuantity == null) {
1101                        myQuantity = new SimpleQuantityDt();
1102                }
1103                return myQuantity;
1104        }
1105
1106        /**
1107         * Sets the value(s) for <b>quantity</b> ()
1108         *
1109     * <p>
1110     * <b>Definition:</b>
1111     * The amount of the substance
1112     * </p> 
1113         */
1114        public Instance setQuantity(SimpleQuantityDt theValue) {
1115                myQuantity = theValue;
1116                return this;
1117        }
1118        
1119        
1120
1121  
1122
1123
1124        }
1125
1126
1127        /**
1128         * Block class for child element: <b>Substance.ingredient</b> ()
1129         *
1130     * <p>
1131     * <b>Definition:</b>
1132     * A substance can be composed of other substances
1133     * </p> 
1134         */
1135        @Block()        
1136        public static class Ingredient 
1137            extends  BaseIdentifiableElement        implements IResourceBlock {
1138        
1139        @Child(name="quantity", type=RatioDt.class, order=0, min=0, max=1, summary=true, modifier=false)        
1140        @Description(
1141                shortDefinition="",
1142                formalDefinition="The amount of the ingredient in the substance - a concentration ratio"
1143        )
1144        private RatioDt myQuantity;
1145        
1146        @Child(name="substance", order=1, min=1, max=1, summary=true, modifier=false, type={
1147                ca.uhn.fhir.model.dstu2.resource.Substance.class        })
1148        @Description(
1149                shortDefinition="",
1150                formalDefinition="Another substance that is a component of this substance"
1151        )
1152        private ResourceReferenceDt mySubstance;
1153        
1154
1155        @Override
1156        public boolean isEmpty() {
1157                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myQuantity,  mySubstance);
1158        }
1159        
1160        @Override
1161        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1162                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myQuantity, mySubstance);
1163        }
1164
1165        /**
1166         * Gets the value(s) for <b>quantity</b> ().
1167         * creating it if it does
1168         * not exist. Will not return <code>null</code>.
1169         *
1170     * <p>
1171     * <b>Definition:</b>
1172     * The amount of the ingredient in the substance - a concentration ratio
1173     * </p> 
1174         */
1175        public RatioDt getQuantity() {  
1176                if (myQuantity == null) {
1177                        myQuantity = new RatioDt();
1178                }
1179                return myQuantity;
1180        }
1181
1182        /**
1183         * Sets the value(s) for <b>quantity</b> ()
1184         *
1185     * <p>
1186     * <b>Definition:</b>
1187     * The amount of the ingredient in the substance - a concentration ratio
1188     * </p> 
1189         */
1190        public Ingredient setQuantity(RatioDt theValue) {
1191                myQuantity = theValue;
1192                return this;
1193        }
1194        
1195        
1196
1197  
1198        /**
1199         * Gets the value(s) for <b>substance</b> ().
1200         * creating it if it does
1201         * not exist. Will not return <code>null</code>.
1202         *
1203     * <p>
1204     * <b>Definition:</b>
1205     * Another substance that is a component of this substance
1206     * </p> 
1207         */
1208        public ResourceReferenceDt getSubstance() {  
1209                if (mySubstance == null) {
1210                        mySubstance = new ResourceReferenceDt();
1211                }
1212                return mySubstance;
1213        }
1214
1215        /**
1216         * Sets the value(s) for <b>substance</b> ()
1217         *
1218     * <p>
1219     * <b>Definition:</b>
1220     * Another substance that is a component of this substance
1221     * </p> 
1222         */
1223        public Ingredient setSubstance(ResourceReferenceDt theValue) {
1224                mySubstance = theValue;
1225                return this;
1226        }
1227        
1228        
1229
1230  
1231
1232
1233        }
1234
1235
1236
1237
1238    @Override
1239    public String getResourceName() {
1240        return "Substance";
1241    }
1242    
1243    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
1244        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
1245    }
1246
1247
1248}