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