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>DocumentReference</b> Resource
282 * (infrastructure.documents)
283 *
284 * <p>
285 * <b>Definition:</b>
286 * A reference to a document .
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/DocumentReference">http://hl7.org/fhir/profiles/DocumentReference</a> 
297 * </p>
298 *
299 */
300@ResourceDef(name="DocumentReference", profile="http://hl7.org/fhir/profiles/DocumentReference", id="documentreference")
301public class DocumentReference extends ca.uhn.fhir.model.dstu2.resource.BaseResource
302    implements  IResource 
303    {
304
305        /**
306         * Search parameter constant for <b>identifier</b>
307         * <p>
308         * Description: <b></b><br>
309         * Type: <b>token</b><br>
310         * Path: <b>DocumentReference.masterIdentifier | DocumentReference.identifier</b><br>
311         * </p>
312         */
313        @SearchParamDefinition(name="identifier", path="DocumentReference.masterIdentifier | DocumentReference.identifier", description="", type="token" 
314 )
315        public static final String SP_IDENTIFIER = "identifier";
316
317        /**
318         * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
319         * <p>
320         * Description: <b></b><br>
321         * Type: <b>token</b><br>
322         * Path: <b>DocumentReference.masterIdentifier | DocumentReference.identifier</b><br>
323         * </p>
324         */
325        public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
326
327        /**
328         * Search parameter constant for <b>subject</b>
329         * <p>
330         * Description: <b></b><br>
331         * Type: <b>reference</b><br>
332         * Path: <b>DocumentReference.subject</b><br>
333         * </p>
334         */
335        @SearchParamDefinition(name="subject", path="DocumentReference.subject", description="", type="reference" 
336, providesMembershipIn={
337 @Compartment(name="Patient") ,  @Compartment(name="RelatedPerson") ,  @Compartment(name="Practitioner")        }
338 )
339        public static final String SP_SUBJECT = "subject";
340
341        /**
342         * <b>Fluent Client</b> search parameter constant for <b>subject</b>
343         * <p>
344         * Description: <b></b><br>
345         * Type: <b>reference</b><br>
346         * Path: <b>DocumentReference.subject</b><br>
347         * </p>
348         */
349        public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT);
350
351        /**
352         * Search parameter constant for <b>type</b>
353         * <p>
354         * Description: <b></b><br>
355         * Type: <b>token</b><br>
356         * Path: <b>DocumentReference.type</b><br>
357         * </p>
358         */
359        @SearchParamDefinition(name="type", path="DocumentReference.type", description="", type="token" 
360 )
361        public static final String SP_TYPE = "type";
362
363        /**
364         * <b>Fluent Client</b> search parameter constant for <b>type</b>
365         * <p>
366         * Description: <b></b><br>
367         * Type: <b>token</b><br>
368         * Path: <b>DocumentReference.type</b><br>
369         * </p>
370         */
371        public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE);
372
373        /**
374         * Search parameter constant for <b>class</b>
375         * <p>
376         * Description: <b></b><br>
377         * Type: <b>token</b><br>
378         * Path: <b>DocumentReference.class</b><br>
379         * </p>
380         */
381        @SearchParamDefinition(name="class", path="DocumentReference.class", description="", type="token" 
382 )
383        public static final String SP_CLASS = "class";
384
385        /**
386         * <b>Fluent Client</b> search parameter constant for <b>class</b>
387         * <p>
388         * Description: <b></b><br>
389         * Type: <b>token</b><br>
390         * Path: <b>DocumentReference.class</b><br>
391         * </p>
392         */
393        public static final TokenClientParam CLASS = new TokenClientParam(SP_CLASS);
394
395        /**
396         * Search parameter constant for <b>author</b>
397         * <p>
398         * Description: <b></b><br>
399         * Type: <b>reference</b><br>
400         * Path: <b>DocumentReference.author</b><br>
401         * </p>
402         */
403        @SearchParamDefinition(name="author", path="DocumentReference.author", description="", type="reference" 
404, providesMembershipIn={
405 @Compartment(name="Patient") ,  @Compartment(name="Encounter") ,  @Compartment(name="RelatedPerson") ,  @Compartment(name="Practitioner")      }
406 )
407        public static final String SP_AUTHOR = "author";
408
409        /**
410         * <b>Fluent Client</b> search parameter constant for <b>author</b>
411         * <p>
412         * Description: <b></b><br>
413         * Type: <b>reference</b><br>
414         * Path: <b>DocumentReference.author</b><br>
415         * </p>
416         */
417        public static final ReferenceClientParam AUTHOR = new ReferenceClientParam(SP_AUTHOR);
418
419        /**
420         * Search parameter constant for <b>custodian</b>
421         * <p>
422         * Description: <b></b><br>
423         * Type: <b>reference</b><br>
424         * Path: <b>DocumentReference.custodian</b><br>
425         * </p>
426         */
427        @SearchParamDefinition(name="custodian", path="DocumentReference.custodian", description="", type="reference" 
428 )
429        public static final String SP_CUSTODIAN = "custodian";
430
431        /**
432         * <b>Fluent Client</b> search parameter constant for <b>custodian</b>
433         * <p>
434         * Description: <b></b><br>
435         * Type: <b>reference</b><br>
436         * Path: <b>DocumentReference.custodian</b><br>
437         * </p>
438         */
439        public static final ReferenceClientParam CUSTODIAN = new ReferenceClientParam(SP_CUSTODIAN);
440
441        /**
442         * Search parameter constant for <b>authenticator</b>
443         * <p>
444         * Description: <b></b><br>
445         * Type: <b>reference</b><br>
446         * Path: <b>DocumentReference.authenticator</b><br>
447         * </p>
448         */
449        @SearchParamDefinition(name="authenticator", path="DocumentReference.authenticator", description="", type="reference" 
450, providesMembershipIn={
451 @Compartment(name="RelatedPerson")     }
452 )
453        public static final String SP_AUTHENTICATOR = "authenticator";
454
455        /**
456         * <b>Fluent Client</b> search parameter constant for <b>authenticator</b>
457         * <p>
458         * Description: <b></b><br>
459         * Type: <b>reference</b><br>
460         * Path: <b>DocumentReference.authenticator</b><br>
461         * </p>
462         */
463        public static final ReferenceClientParam AUTHENTICATOR = new ReferenceClientParam(SP_AUTHENTICATOR);
464
465        /**
466         * Search parameter constant for <b>created</b>
467         * <p>
468         * Description: <b></b><br>
469         * Type: <b>date</b><br>
470         * Path: <b>DocumentReference.created</b><br>
471         * </p>
472         */
473        @SearchParamDefinition(name="created", path="DocumentReference.created", description="", type="date" 
474 )
475        public static final String SP_CREATED = "created";
476
477        /**
478         * <b>Fluent Client</b> search parameter constant for <b>created</b>
479         * <p>
480         * Description: <b></b><br>
481         * Type: <b>date</b><br>
482         * Path: <b>DocumentReference.created</b><br>
483         * </p>
484         */
485        public static final DateClientParam CREATED = new DateClientParam(SP_CREATED);
486
487        /**
488         * Search parameter constant for <b>indexed</b>
489         * <p>
490         * Description: <b></b><br>
491         * Type: <b>date</b><br>
492         * Path: <b>DocumentReference.indexed</b><br>
493         * </p>
494         */
495        @SearchParamDefinition(name="indexed", path="DocumentReference.indexed", description="", type="date" 
496 )
497        public static final String SP_INDEXED = "indexed";
498
499        /**
500         * <b>Fluent Client</b> search parameter constant for <b>indexed</b>
501         * <p>
502         * Description: <b></b><br>
503         * Type: <b>date</b><br>
504         * Path: <b>DocumentReference.indexed</b><br>
505         * </p>
506         */
507        public static final DateClientParam INDEXED = new DateClientParam(SP_INDEXED);
508
509        /**
510         * Search parameter constant for <b>status</b>
511         * <p>
512         * Description: <b></b><br>
513         * Type: <b>token</b><br>
514         * Path: <b>DocumentReference.status</b><br>
515         * </p>
516         */
517        @SearchParamDefinition(name="status", path="DocumentReference.status", description="", type="token" 
518 )
519        public static final String SP_STATUS = "status";
520
521        /**
522         * <b>Fluent Client</b> search parameter constant for <b>status</b>
523         * <p>
524         * Description: <b></b><br>
525         * Type: <b>token</b><br>
526         * Path: <b>DocumentReference.status</b><br>
527         * </p>
528         */
529        public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS);
530
531        /**
532         * Search parameter constant for <b>relatesto</b>
533         * <p>
534         * Description: <b></b><br>
535         * Type: <b>reference</b><br>
536         * Path: <b>DocumentReference.relatesTo.target</b><br>
537         * </p>
538         */
539        @SearchParamDefinition(name="relatesto", path="DocumentReference.relatesTo.target", description="", type="reference" 
540 )
541        public static final String SP_RELATESTO = "relatesto";
542
543        /**
544         * <b>Fluent Client</b> search parameter constant for <b>relatesto</b>
545         * <p>
546         * Description: <b></b><br>
547         * Type: <b>reference</b><br>
548         * Path: <b>DocumentReference.relatesTo.target</b><br>
549         * </p>
550         */
551        public static final ReferenceClientParam RELATESTO = new ReferenceClientParam(SP_RELATESTO);
552
553        /**
554         * Search parameter constant for <b>relation</b>
555         * <p>
556         * Description: <b></b><br>
557         * Type: <b>token</b><br>
558         * Path: <b>DocumentReference.relatesTo.code</b><br>
559         * </p>
560         */
561        @SearchParamDefinition(name="relation", path="DocumentReference.relatesTo.code", description="", type="token" 
562 )
563        public static final String SP_RELATION = "relation";
564
565        /**
566         * <b>Fluent Client</b> search parameter constant for <b>relation</b>
567         * <p>
568         * Description: <b></b><br>
569         * Type: <b>token</b><br>
570         * Path: <b>DocumentReference.relatesTo.code</b><br>
571         * </p>
572         */
573        public static final TokenClientParam RELATION = new TokenClientParam(SP_RELATION);
574
575        /**
576         * Search parameter constant for <b>description</b>
577         * <p>
578         * Description: <b></b><br>
579         * Type: <b>string</b><br>
580         * Path: <b>DocumentReference.description</b><br>
581         * </p>
582         */
583        @SearchParamDefinition(name="description", path="DocumentReference.description", description="", type="string" 
584 )
585        public static final String SP_DESCRIPTION = "description";
586
587        /**
588         * <b>Fluent Client</b> search parameter constant for <b>description</b>
589         * <p>
590         * Description: <b></b><br>
591         * Type: <b>string</b><br>
592         * Path: <b>DocumentReference.description</b><br>
593         * </p>
594         */
595        public static final StringClientParam DESCRIPTION = new StringClientParam(SP_DESCRIPTION);
596
597        /**
598         * Search parameter constant for <b>securitylabel</b>
599         * <p>
600         * Description: <b></b><br>
601         * Type: <b>token</b><br>
602         * Path: <b>DocumentReference.securityLabel</b><br>
603         * </p>
604         */
605        @SearchParamDefinition(name="securitylabel", path="DocumentReference.securityLabel", description="", type="token" 
606 )
607        public static final String SP_SECURITYLABEL = "securitylabel";
608
609        /**
610         * <b>Fluent Client</b> search parameter constant for <b>securitylabel</b>
611         * <p>
612         * Description: <b></b><br>
613         * Type: <b>token</b><br>
614         * Path: <b>DocumentReference.securityLabel</b><br>
615         * </p>
616         */
617        public static final TokenClientParam SECURITYLABEL = new TokenClientParam(SP_SECURITYLABEL);
618
619        /**
620         * Search parameter constant for <b>format</b>
621         * <p>
622         * Description: <b></b><br>
623         * Type: <b>token</b><br>
624         * Path: <b>DocumentReference.content.format</b><br>
625         * </p>
626         */
627        @SearchParamDefinition(name="format", path="DocumentReference.content.format", description="", type="token" 
628 )
629        public static final String SP_FORMAT = "format";
630
631        /**
632         * <b>Fluent Client</b> search parameter constant for <b>format</b>
633         * <p>
634         * Description: <b></b><br>
635         * Type: <b>token</b><br>
636         * Path: <b>DocumentReference.content.format</b><br>
637         * </p>
638         */
639        public static final TokenClientParam FORMAT = new TokenClientParam(SP_FORMAT);
640
641        /**
642         * Search parameter constant for <b>language</b>
643         * <p>
644         * Description: <b></b><br>
645         * Type: <b>token</b><br>
646         * Path: <b>DocumentReference.content.attachment.language</b><br>
647         * </p>
648         */
649        @SearchParamDefinition(name="language", path="DocumentReference.content.attachment.language", description="", type="token" 
650 )
651        public static final String SP_LANGUAGE = "language";
652
653        /**
654         * <b>Fluent Client</b> search parameter constant for <b>language</b>
655         * <p>
656         * Description: <b></b><br>
657         * Type: <b>token</b><br>
658         * Path: <b>DocumentReference.content.attachment.language</b><br>
659         * </p>
660         */
661        public static final TokenClientParam LANGUAGE = new TokenClientParam(SP_LANGUAGE);
662
663        /**
664         * Search parameter constant for <b>location</b>
665         * <p>
666         * Description: <b></b><br>
667         * Type: <b>uri</b><br>
668         * Path: <b>DocumentReference.content.attachment.url</b><br>
669         * </p>
670         */
671        @SearchParamDefinition(name="location", path="DocumentReference.content.attachment.url", description="", type="uri" 
672 )
673        public static final String SP_LOCATION = "location";
674
675        /**
676         * <b>Fluent Client</b> search parameter constant for <b>location</b>
677         * <p>
678         * Description: <b></b><br>
679         * Type: <b>uri</b><br>
680         * Path: <b>DocumentReference.content.attachment.url</b><br>
681         * </p>
682         */
683        public static final UriClientParam LOCATION = new UriClientParam(SP_LOCATION);
684
685        /**
686         * Search parameter constant for <b>event</b>
687         * <p>
688         * Description: <b></b><br>
689         * Type: <b>token</b><br>
690         * Path: <b>DocumentReference.context.event</b><br>
691         * </p>
692         */
693        @SearchParamDefinition(name="event", path="DocumentReference.context.event", description="", type="token" 
694 )
695        public static final String SP_EVENT = "event";
696
697        /**
698         * <b>Fluent Client</b> search parameter constant for <b>event</b>
699         * <p>
700         * Description: <b></b><br>
701         * Type: <b>token</b><br>
702         * Path: <b>DocumentReference.context.event</b><br>
703         * </p>
704         */
705        public static final TokenClientParam EVENT = new TokenClientParam(SP_EVENT);
706
707        /**
708         * Search parameter constant for <b>period</b>
709         * <p>
710         * Description: <b></b><br>
711         * Type: <b>date</b><br>
712         * Path: <b>DocumentReference.context.period</b><br>
713         * </p>
714         */
715        @SearchParamDefinition(name="period", path="DocumentReference.context.period", description="", type="date" 
716 )
717        public static final String SP_PERIOD = "period";
718
719        /**
720         * <b>Fluent Client</b> search parameter constant for <b>period</b>
721         * <p>
722         * Description: <b></b><br>
723         * Type: <b>date</b><br>
724         * Path: <b>DocumentReference.context.period</b><br>
725         * </p>
726         */
727        public static final DateClientParam PERIOD = new DateClientParam(SP_PERIOD);
728
729        /**
730         * Search parameter constant for <b>facility</b>
731         * <p>
732         * Description: <b></b><br>
733         * Type: <b>token</b><br>
734         * Path: <b>DocumentReference.context.facilityType</b><br>
735         * </p>
736         */
737        @SearchParamDefinition(name="facility", path="DocumentReference.context.facilityType", description="", type="token" 
738 )
739        public static final String SP_FACILITY = "facility";
740
741        /**
742         * <b>Fluent Client</b> search parameter constant for <b>facility</b>
743         * <p>
744         * Description: <b></b><br>
745         * Type: <b>token</b><br>
746         * Path: <b>DocumentReference.context.facilityType</b><br>
747         * </p>
748         */
749        public static final TokenClientParam FACILITY = new TokenClientParam(SP_FACILITY);
750
751        /**
752         * Search parameter constant for <b>patient</b>
753         * <p>
754         * Description: <b></b><br>
755         * Type: <b>reference</b><br>
756         * Path: <b>DocumentReference.subject</b><br>
757         * </p>
758         */
759        @SearchParamDefinition(name="patient", path="DocumentReference.subject", description="", type="reference" 
760, target={
761 ca.uhn.fhir.model.dstu2.resource.Patient.class         }
762 )
763        public static final String SP_PATIENT = "patient";
764
765        /**
766         * <b>Fluent Client</b> search parameter constant for <b>patient</b>
767         * <p>
768         * Description: <b></b><br>
769         * Type: <b>reference</b><br>
770         * Path: <b>DocumentReference.subject</b><br>
771         * </p>
772         */
773        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
774
775        /**
776         * Search parameter constant for <b>setting</b>
777         * <p>
778         * Description: <b></b><br>
779         * Type: <b>token</b><br>
780         * Path: <b>DocumentReference.context.practiceSetting</b><br>
781         * </p>
782         */
783        @SearchParamDefinition(name="setting", path="DocumentReference.context.practiceSetting", description="", type="token" 
784 )
785        public static final String SP_SETTING = "setting";
786
787        /**
788         * <b>Fluent Client</b> search parameter constant for <b>setting</b>
789         * <p>
790         * Description: <b></b><br>
791         * Type: <b>token</b><br>
792         * Path: <b>DocumentReference.context.practiceSetting</b><br>
793         * </p>
794         */
795        public static final TokenClientParam SETTING = new TokenClientParam(SP_SETTING);
796
797        /**
798         * Search parameter constant for <b>related-id</b>
799         * <p>
800         * Description: <b></b><br>
801         * Type: <b>token</b><br>
802         * Path: <b>DocumentReference.context.related.identifier</b><br>
803         * </p>
804         */
805        @SearchParamDefinition(name="related-id", path="DocumentReference.context.related.identifier", description="", type="token" 
806 )
807        public static final String SP_RELATED_ID = "related-id";
808
809        /**
810         * <b>Fluent Client</b> search parameter constant for <b>related-id</b>
811         * <p>
812         * Description: <b></b><br>
813         * Type: <b>token</b><br>
814         * Path: <b>DocumentReference.context.related.identifier</b><br>
815         * </p>
816         */
817        public static final TokenClientParam RELATED_ID = new TokenClientParam(SP_RELATED_ID);
818
819        /**
820         * Search parameter constant for <b>related-ref</b>
821         * <p>
822         * Description: <b></b><br>
823         * Type: <b>reference</b><br>
824         * Path: <b>DocumentReference.context.related.ref</b><br>
825         * </p>
826         */
827        @SearchParamDefinition(name="related-ref", path="DocumentReference.context.related.ref", description="", type="reference" 
828 )
829        public static final String SP_RELATED_REF = "related-ref";
830
831        /**
832         * <b>Fluent Client</b> search parameter constant for <b>related-ref</b>
833         * <p>
834         * Description: <b></b><br>
835         * Type: <b>reference</b><br>
836         * Path: <b>DocumentReference.context.related.ref</b><br>
837         * </p>
838         */
839        public static final ReferenceClientParam RELATED_REF = new ReferenceClientParam(SP_RELATED_REF);
840
841        /**
842         * Search parameter constant for <b>encounter</b>
843         * <p>
844         * Description: <b></b><br>
845         * Type: <b>reference</b><br>
846         * Path: <b>DocumentReference.context.encounter</b><br>
847         * </p>
848         */
849        @SearchParamDefinition(name="encounter", path="DocumentReference.context.encounter", description="", type="reference" 
850 )
851        public static final String SP_ENCOUNTER = "encounter";
852
853        /**
854         * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
855         * <p>
856         * Description: <b></b><br>
857         * Type: <b>reference</b><br>
858         * Path: <b>DocumentReference.context.encounter</b><br>
859         * </p>
860         */
861        public static final ReferenceClientParam ENCOUNTER = new ReferenceClientParam(SP_ENCOUNTER);
862
863        /**
864         * Search parameter constant for <b>relatesto-relation</b>
865         * <p>
866         * Description: <b>Combination of relation and relatesTo</b><br>
867         * Type: <b>composite</b><br>
868         * Path: <b>relatesto &amp; relation</b><br>
869         * </p>
870         */
871        @SearchParamDefinition(name="relatesto-relation", path="relatesto & relation", description="Combination of relation and relatesTo", type="composite"  , compositeOf={  "relatesto",  "relation" } 
872 )
873        public static final String SP_RELATESTO_RELATION = "relatesto-relation";
874
875        /**
876         * <b>Fluent Client</b> search parameter constant for <b>relatesto-relation</b>
877         * <p>
878         * Description: <b>Combination of relation and relatesTo</b><br>
879         * Type: <b>composite</b><br>
880         * Path: <b>relatesto &amp; relation</b><br>
881         * </p>
882         */
883        public static final CompositeClientParam<ReferenceClientParam, TokenClientParam> RELATESTO_RELATION = new CompositeClientParam<ReferenceClientParam, TokenClientParam>(SP_RELATESTO_RELATION);
884
885
886        /**
887         * Constant for fluent queries to be used to add include statements. Specifies
888         * the path value of "<b>DocumentReference:authenticator</b>".
889         */
890        public static final Include INCLUDE_AUTHENTICATOR = new Include("DocumentReference:authenticator");
891
892        /**
893         * Constant for fluent queries to be used to add include statements. Specifies
894         * the path value of "<b>DocumentReference:author</b>".
895         */
896        public static final Include INCLUDE_AUTHOR = new Include("DocumentReference:author");
897
898        /**
899         * Constant for fluent queries to be used to add include statements. Specifies
900         * the path value of "<b>DocumentReference:custodian</b>".
901         */
902        public static final Include INCLUDE_CUSTODIAN = new Include("DocumentReference:custodian");
903
904        /**
905         * Constant for fluent queries to be used to add include statements. Specifies
906         * the path value of "<b>DocumentReference:encounter</b>".
907         */
908        public static final Include INCLUDE_ENCOUNTER = new Include("DocumentReference:encounter");
909
910        /**
911         * Constant for fluent queries to be used to add include statements. Specifies
912         * the path value of "<b>DocumentReference:patient</b>".
913         */
914        public static final Include INCLUDE_PATIENT = new Include("DocumentReference:patient");
915
916        /**
917         * Constant for fluent queries to be used to add include statements. Specifies
918         * the path value of "<b>DocumentReference:related-ref</b>".
919         */
920        public static final Include INCLUDE_RELATED_REF = new Include("DocumentReference:related-ref");
921
922        /**
923         * Constant for fluent queries to be used to add include statements. Specifies
924         * the path value of "<b>DocumentReference:relatesto</b>".
925         */
926        public static final Include INCLUDE_RELATESTO = new Include("DocumentReference:relatesto");
927
928        /**
929         * Constant for fluent queries to be used to add include statements. Specifies
930         * the path value of "<b>DocumentReference:subject</b>".
931         */
932        public static final Include INCLUDE_SUBJECT = new Include("DocumentReference:subject");
933
934
935        @Child(name="masterIdentifier", type=IdentifierDt.class, order=0, min=0, max=1, summary=false, modifier=false)  
936        @Description(
937                shortDefinition="id",
938                formalDefinition="Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document"
939        )
940        private IdentifierDt myMasterIdentifier;
941        
942        @Child(name="identifier", type=IdentifierDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
943        @Description(
944                shortDefinition="id",
945                formalDefinition="Other identifiers associated with the document, including version independent identifiers"
946        )
947        private java.util.List<IdentifierDt> myIdentifier;
948        
949        @Child(name="subject", order=2, min=0, max=1, summary=false, modifier=false, type={
950                ca.uhn.fhir.model.dstu2.resource.Patient.class, 
951                ca.uhn.fhir.model.dstu2.resource.Practitioner.class, 
952                ca.uhn.fhir.model.dstu2.resource.Group.class, 
953                ca.uhn.fhir.model.dstu2.resource.Device.class
954        })
955        @Description(
956                shortDefinition="who.focus",
957                formalDefinition="Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)"
958        )
959        private ResourceReferenceDt mySubject;
960        
961        @Child(name="type", type=CodeableConceptDt.class, order=3, min=1, max=1, summary=false, modifier=false) 
962        @Description(
963                shortDefinition="class",
964                formalDefinition="Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced."
965        )
966        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/valueset-c80-doc-typecodes")
967        private CodeableConceptDt myType;
968        
969        @Child(name="class", type=CodeableConceptDt.class, order=4, min=0, max=1, summary=false, modifier=false)        
970        @Description(
971                shortDefinition="class",
972                formalDefinition="A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type"
973        )
974        private CodeableConceptDt myClassElement;
975        
976        @Child(name="author", order=5, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
977                ca.uhn.fhir.model.dstu2.resource.Practitioner.class, 
978                ca.uhn.fhir.model.dstu2.resource.Organization.class, 
979                ca.uhn.fhir.model.dstu2.resource.Device.class, 
980                ca.uhn.fhir.model.dstu2.resource.Patient.class, 
981                ca.uhn.fhir.model.dstu2.resource.RelatedPerson.class
982        })
983        @Description(
984                shortDefinition="who.author",
985                formalDefinition="Identifies who is responsible for adding the information to the document"
986        )
987        private java.util.List<ResourceReferenceDt> myAuthor;
988        
989        @Child(name="custodian", order=6, min=0, max=1, summary=false, modifier=false, type={
990                ca.uhn.fhir.model.dstu2.resource.Organization.class
991        })
992        @Description(
993                shortDefinition="",
994                formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the document"
995        )
996        private ResourceReferenceDt myCustodian;
997        
998        @Child(name="authenticator", order=7, min=0, max=1, summary=false, modifier=false, type={
999                ca.uhn.fhir.model.dstu2.resource.Practitioner.class, 
1000                ca.uhn.fhir.model.dstu2.resource.Organization.class
1001        })
1002        @Description(
1003                shortDefinition="who.witness",
1004                formalDefinition="Which person or organization authenticates that this document is valid"
1005        )
1006        private ResourceReferenceDt myAuthenticator;
1007        
1008        @Child(name="created", type=DateTimeDt.class, order=8, min=0, max=1, summary=false, modifier=false)     
1009        @Description(
1010                shortDefinition="when.done",
1011                formalDefinition="When the document was created"
1012        )
1013        private DateTimeDt myCreated;
1014        
1015        @Child(name="indexed", type=InstantDt.class, order=9, min=1, max=1, summary=false, modifier=false)      
1016        @Description(
1017                shortDefinition="when.recorded",
1018                formalDefinition="When the document reference was created"
1019        )
1020        private InstantDt myIndexed;
1021        
1022        @Child(name="status", type=CodeDt.class, order=10, min=1, max=1, summary=false, modifier=true)  
1023        @Description(
1024                shortDefinition="status",
1025                formalDefinition="The status of this document reference"
1026        )
1027        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/document-reference-status")
1028        private BoundCodeDt<DocumentReferenceStatusEnum> myStatus;
1029        
1030        @Child(name="docStatus", type=CodeableConceptDt.class, order=11, min=0, max=1, summary=false, modifier=false)   
1031        @Description(
1032                shortDefinition="status",
1033                formalDefinition="The status of the underlying document"
1034        )
1035        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/composition-status")
1036        private CodeableConceptDt myDocStatus;
1037        
1038        @Child(name="relatesTo", order=12, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=true)        
1039        @Description(
1040                shortDefinition="",
1041                formalDefinition="Relationships that this document has with other document references that already exist"
1042        )
1043        private java.util.List<RelatesTo> myRelatesTo;
1044        
1045        @Child(name="description", type=StringDt.class, order=13, min=0, max=1, summary=false, modifier=false)  
1046        @Description(
1047                shortDefinition="",
1048                formalDefinition="Human-readable description of the source document. This is sometimes known as the \"title\""
1049        )
1050        private StringDt myDescription;
1051        
1052        @Child(name="securityLabel", type=CodeableConceptDt.class, order=14, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)     
1053        @Description(
1054                shortDefinition="",
1055                formalDefinition="A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \"reference\" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to"
1056        )
1057        private java.util.List<CodeableConceptDt> mySecurityLabel;
1058        
1059        @Child(name="content", order=15, min=1, max=Child.MAX_UNLIMITED, summary=false, modifier=false) 
1060        @Description(
1061                shortDefinition="",
1062                formalDefinition="The document and format referenced. There may be multiple content element repetitions, each with a different format."
1063        )
1064        private java.util.List<Content> myContent;
1065        
1066        @Child(name="context", order=16, min=0, max=1, summary=false, modifier=false)   
1067        @Description(
1068                shortDefinition="",
1069                formalDefinition="The clinical context in which the document was prepared"
1070        )
1071        private Context myContext;
1072        
1073
1074        @Override
1075        public boolean isEmpty() {
1076                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myMasterIdentifier,  myIdentifier,  mySubject,  myType,  myClassElement,  myAuthor,  myCustodian,  myAuthenticator,  myCreated,  myIndexed,  myStatus,  myDocStatus,  myRelatesTo,  myDescription,  mySecurityLabel,  myContent,  myContext);
1077        }
1078        
1079        @Override
1080        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1081                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myMasterIdentifier, myIdentifier, mySubject, myType, myClassElement, myAuthor, myCustodian, myAuthenticator, myCreated, myIndexed, myStatus, myDocStatus, myRelatesTo, myDescription, mySecurityLabel, myContent, myContext);
1082        }
1083
1084        /**
1085         * Gets the value(s) for <b>masterIdentifier</b> (id).
1086         * creating it if it does
1087         * not exist. Will not return <code>null</code>.
1088         *
1089     * <p>
1090     * <b>Definition:</b>
1091     * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document
1092     * </p> 
1093         */
1094        public IdentifierDt getMasterIdentifier() {  
1095                if (myMasterIdentifier == null) {
1096                        myMasterIdentifier = new IdentifierDt();
1097                }
1098                return myMasterIdentifier;
1099        }
1100
1101        /**
1102         * Sets the value(s) for <b>masterIdentifier</b> (id)
1103         *
1104     * <p>
1105     * <b>Definition:</b>
1106     * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document
1107     * </p> 
1108         */
1109        public DocumentReference setMasterIdentifier(IdentifierDt theValue) {
1110                myMasterIdentifier = theValue;
1111                return this;
1112        }
1113        
1114        
1115
1116  
1117        /**
1118         * Gets the value(s) for <b>identifier</b> (id).
1119         * creating it if it does
1120         * not exist. Will not return <code>null</code>.
1121         *
1122     * <p>
1123     * <b>Definition:</b>
1124     * Other identifiers associated with the document, including version independent identifiers
1125     * </p> 
1126         */
1127        public java.util.List<IdentifierDt> getIdentifier() {  
1128                if (myIdentifier == null) {
1129                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
1130                }
1131                return myIdentifier;
1132        }
1133
1134        /**
1135         * Sets the value(s) for <b>identifier</b> (id)
1136         *
1137     * <p>
1138     * <b>Definition:</b>
1139     * Other identifiers associated with the document, including version independent identifiers
1140     * </p> 
1141         */
1142        public DocumentReference setIdentifier(java.util.List<IdentifierDt> theValue) {
1143                myIdentifier = theValue;
1144                return this;
1145        }
1146        
1147        
1148
1149        /**
1150         * Adds and returns a new value for <b>identifier</b> (id)
1151         *
1152     * <p>
1153     * <b>Definition:</b>
1154     * Other identifiers associated with the document, including version independent identifiers
1155     * </p> 
1156         */
1157        public IdentifierDt addIdentifier() {
1158                IdentifierDt newType = new IdentifierDt();
1159                getIdentifier().add(newType);
1160                return newType; 
1161        }
1162
1163        /**
1164         * Adds a given new value for <b>identifier</b> (id)
1165         *
1166         * <p>
1167         * <b>Definition:</b>
1168         * Other identifiers associated with the document, including version independent identifiers
1169         * </p>
1170         * @param theValue The identifier to add (must not be <code>null</code>)
1171         */
1172        public DocumentReference addIdentifier(IdentifierDt theValue) {
1173                if (theValue == null) {
1174                        throw new NullPointerException("theValue must not be null");
1175                }
1176                getIdentifier().add(theValue);
1177                return this;
1178        }
1179
1180        /**
1181         * Gets the first repetition for <b>identifier</b> (id),
1182         * creating it if it does not already exist.
1183         *
1184     * <p>
1185     * <b>Definition:</b>
1186     * Other identifiers associated with the document, including version independent identifiers
1187     * </p> 
1188         */
1189        public IdentifierDt getIdentifierFirstRep() {
1190                if (getIdentifier().isEmpty()) {
1191                        return addIdentifier();
1192                }
1193                return getIdentifier().get(0); 
1194        }
1195  
1196        /**
1197         * Gets the value(s) for <b>subject</b> (who.focus).
1198         * creating it if it does
1199         * not exist. Will not return <code>null</code>.
1200         *
1201     * <p>
1202     * <b>Definition:</b>
1203     * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)
1204     * </p> 
1205         */
1206        public ResourceReferenceDt getSubject() {  
1207                if (mySubject == null) {
1208                        mySubject = new ResourceReferenceDt();
1209                }
1210                return mySubject;
1211        }
1212
1213        /**
1214         * Sets the value(s) for <b>subject</b> (who.focus)
1215         *
1216     * <p>
1217     * <b>Definition:</b>
1218     * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)
1219     * </p> 
1220         */
1221        public DocumentReference setSubject(ResourceReferenceDt theValue) {
1222                mySubject = theValue;
1223                return this;
1224        }
1225        
1226        
1227
1228  
1229        /**
1230         * Gets the value(s) for <b>type</b> (class).
1231         * creating it if it does
1232         * not exist. Will not return <code>null</code>.
1233         *
1234     * <p>
1235     * <b>Definition:</b>
1236     * Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.
1237     * </p> 
1238         */
1239        public CodeableConceptDt getType() {  
1240                if (myType == null) {
1241                        myType = new CodeableConceptDt();
1242                }
1243                return myType;
1244        }
1245
1246        /**
1247         * Sets the value(s) for <b>type</b> (class)
1248         *
1249     * <p>
1250     * <b>Definition:</b>
1251     * Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.
1252     * </p> 
1253         */
1254        public DocumentReference setType(CodeableConceptDt theValue) {
1255                myType = theValue;
1256                return this;
1257        }
1258        
1259        
1260
1261  
1262        /**
1263         * Gets the value(s) for <b>class</b> (class).
1264         * creating it if it does
1265         * not exist. Will not return <code>null</code>.
1266         *
1267     * <p>
1268     * <b>Definition:</b>
1269     * A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type
1270     * </p> 
1271         */
1272        public CodeableConceptDt getClassElement() {  
1273                if (myClassElement == null) {
1274                        myClassElement = new CodeableConceptDt();
1275                }
1276                return myClassElement;
1277        }
1278
1279        /**
1280         * Sets the value(s) for <b>class</b> (class)
1281         *
1282     * <p>
1283     * <b>Definition:</b>
1284     * A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type
1285     * </p> 
1286         */
1287        public DocumentReference setClassElement(CodeableConceptDt theValue) {
1288                myClassElement = theValue;
1289                return this;
1290        }
1291        
1292        
1293
1294  
1295        /**
1296         * Gets the value(s) for <b>author</b> (who.author).
1297         * creating it if it does
1298         * not exist. Will not return <code>null</code>.
1299         *
1300     * <p>
1301     * <b>Definition:</b>
1302     * Identifies who is responsible for adding the information to the document
1303     * </p> 
1304         */
1305        public java.util.List<ResourceReferenceDt> getAuthor() {  
1306                if (myAuthor == null) {
1307                        myAuthor = new java.util.ArrayList<ResourceReferenceDt>();
1308                }
1309                return myAuthor;
1310        }
1311
1312        /**
1313         * Sets the value(s) for <b>author</b> (who.author)
1314         *
1315     * <p>
1316     * <b>Definition:</b>
1317     * Identifies who is responsible for adding the information to the document
1318     * </p> 
1319         */
1320        public DocumentReference setAuthor(java.util.List<ResourceReferenceDt> theValue) {
1321                myAuthor = theValue;
1322                return this;
1323        }
1324        
1325        
1326
1327        /**
1328         * Adds and returns a new value for <b>author</b> (who.author)
1329         *
1330     * <p>
1331     * <b>Definition:</b>
1332     * Identifies who is responsible for adding the information to the document
1333     * </p> 
1334         */
1335        public ResourceReferenceDt addAuthor() {
1336                ResourceReferenceDt newType = new ResourceReferenceDt();
1337                getAuthor().add(newType);
1338                return newType; 
1339        }
1340  
1341        /**
1342         * Gets the value(s) for <b>custodian</b> ().
1343         * creating it if it does
1344         * not exist. Will not return <code>null</code>.
1345         *
1346     * <p>
1347     * <b>Definition:</b>
1348     * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document
1349     * </p> 
1350         */
1351        public ResourceReferenceDt getCustodian() {  
1352                if (myCustodian == null) {
1353                        myCustodian = new ResourceReferenceDt();
1354                }
1355                return myCustodian;
1356        }
1357
1358        /**
1359         * Sets the value(s) for <b>custodian</b> ()
1360         *
1361     * <p>
1362     * <b>Definition:</b>
1363     * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document
1364     * </p> 
1365         */
1366        public DocumentReference setCustodian(ResourceReferenceDt theValue) {
1367                myCustodian = theValue;
1368                return this;
1369        }
1370        
1371        
1372
1373  
1374        /**
1375         * Gets the value(s) for <b>authenticator</b> (who.witness).
1376         * creating it if it does
1377         * not exist. Will not return <code>null</code>.
1378         *
1379     * <p>
1380     * <b>Definition:</b>
1381     * Which person or organization authenticates that this document is valid
1382     * </p> 
1383         */
1384        public ResourceReferenceDt getAuthenticator() {  
1385                if (myAuthenticator == null) {
1386                        myAuthenticator = new ResourceReferenceDt();
1387                }
1388                return myAuthenticator;
1389        }
1390
1391        /**
1392         * Sets the value(s) for <b>authenticator</b> (who.witness)
1393         *
1394     * <p>
1395     * <b>Definition:</b>
1396     * Which person or organization authenticates that this document is valid
1397     * </p> 
1398         */
1399        public DocumentReference setAuthenticator(ResourceReferenceDt theValue) {
1400                myAuthenticator = theValue;
1401                return this;
1402        }
1403        
1404        
1405
1406  
1407        /**
1408         * Gets the value(s) for <b>created</b> (when.done).
1409         * creating it if it does
1410         * not exist. Will not return <code>null</code>.
1411         *
1412     * <p>
1413     * <b>Definition:</b>
1414     * When the document was created
1415     * </p> 
1416         */
1417        public DateTimeDt getCreatedElement() {  
1418                if (myCreated == null) {
1419                        myCreated = new DateTimeDt();
1420                }
1421                return myCreated;
1422        }
1423
1424        
1425        /**
1426         * Gets the value(s) for <b>created</b> (when.done).
1427         * creating it if it does
1428         * not exist. This method may return <code>null</code>.
1429         *
1430     * <p>
1431     * <b>Definition:</b>
1432     * When the document was created
1433     * </p> 
1434         */
1435        public Date getCreated() {  
1436                return getCreatedElement().getValue();
1437        }
1438
1439        /**
1440         * Sets the value(s) for <b>created</b> (when.done)
1441         *
1442     * <p>
1443     * <b>Definition:</b>
1444     * When the document was created
1445     * </p> 
1446         */
1447        public DocumentReference setCreated(DateTimeDt theValue) {
1448                myCreated = theValue;
1449                return this;
1450        }
1451        
1452        
1453
1454        /**
1455         * Sets the value for <b>created</b> (when.done)
1456         *
1457     * <p>
1458     * <b>Definition:</b>
1459     * When the document was created
1460     * </p> 
1461         */
1462        public DocumentReference setCreatedWithSecondsPrecision( Date theDate) {
1463                myCreated = new DateTimeDt(theDate); 
1464                return this; 
1465        }
1466
1467        /**
1468         * Sets the value for <b>created</b> (when.done)
1469         *
1470     * <p>
1471     * <b>Definition:</b>
1472     * When the document was created
1473     * </p> 
1474         */
1475        public DocumentReference setCreated( Date theDate,  TemporalPrecisionEnum thePrecision) {
1476                myCreated = new DateTimeDt(theDate, thePrecision); 
1477                return this; 
1478        }
1479
1480 
1481        /**
1482         * Gets the value(s) for <b>indexed</b> (when.recorded).
1483         * creating it if it does
1484         * not exist. Will not return <code>null</code>.
1485         *
1486     * <p>
1487     * <b>Definition:</b>
1488     * When the document reference was created
1489     * </p> 
1490         */
1491        public InstantDt getIndexedElement() {  
1492                if (myIndexed == null) {
1493                        myIndexed = new InstantDt();
1494                }
1495                return myIndexed;
1496        }
1497
1498        
1499        /**
1500         * Gets the value(s) for <b>indexed</b> (when.recorded).
1501         * creating it if it does
1502         * not exist. This method may return <code>null</code>.
1503         *
1504     * <p>
1505     * <b>Definition:</b>
1506     * When the document reference was created
1507     * </p> 
1508         */
1509        public Date getIndexed() {  
1510                return getIndexedElement().getValue();
1511        }
1512
1513        /**
1514         * Sets the value(s) for <b>indexed</b> (when.recorded)
1515         *
1516     * <p>
1517     * <b>Definition:</b>
1518     * When the document reference was created
1519     * </p> 
1520         */
1521        public DocumentReference setIndexed(InstantDt theValue) {
1522                myIndexed = theValue;
1523                return this;
1524        }
1525        
1526        
1527
1528        /**
1529         * Sets the value for <b>indexed</b> (when.recorded)
1530         *
1531     * <p>
1532     * <b>Definition:</b>
1533     * When the document reference was created
1534     * </p> 
1535         */
1536        public DocumentReference setIndexedWithMillisPrecision( Date theDate) {
1537                myIndexed = new InstantDt(theDate); 
1538                return this; 
1539        }
1540
1541        /**
1542         * Sets the value for <b>indexed</b> (when.recorded)
1543         *
1544     * <p>
1545     * <b>Definition:</b>
1546     * When the document reference was created
1547     * </p> 
1548         */
1549        public DocumentReference setIndexed( Date theDate,  TemporalPrecisionEnum thePrecision) {
1550                myIndexed = new InstantDt(theDate, thePrecision); 
1551                return this; 
1552        }
1553
1554 
1555        /**
1556         * Gets the value(s) for <b>status</b> (status).
1557         * creating it if it does
1558         * not exist. Will not return <code>null</code>.
1559         *
1560     * <p>
1561     * <b>Definition:</b>
1562     * The status of this document reference
1563     * </p> 
1564         */
1565        public BoundCodeDt<DocumentReferenceStatusEnum> getStatusElement() {  
1566                if (myStatus == null) {
1567                        myStatus = new BoundCodeDt<DocumentReferenceStatusEnum>(DocumentReferenceStatusEnum.VALUESET_BINDER);
1568                }
1569                return myStatus;
1570        }
1571
1572        
1573        /**
1574         * Gets the value(s) for <b>status</b> (status).
1575         * creating it if it does
1576         * not exist. This method may return <code>null</code>.
1577         *
1578     * <p>
1579     * <b>Definition:</b>
1580     * The status of this document reference
1581     * </p> 
1582         */
1583        public String getStatus() {  
1584                return getStatusElement().getValue();
1585        }
1586
1587        /**
1588         * Sets the value(s) for <b>status</b> (status)
1589         *
1590     * <p>
1591     * <b>Definition:</b>
1592     * The status of this document reference
1593     * </p> 
1594         */
1595        public DocumentReference setStatus(BoundCodeDt<DocumentReferenceStatusEnum> theValue) {
1596                myStatus = theValue;
1597                return this;
1598        }
1599        
1600        
1601
1602        /**
1603         * Sets the value(s) for <b>status</b> (status)
1604         *
1605     * <p>
1606     * <b>Definition:</b>
1607     * The status of this document reference
1608     * </p> 
1609         */
1610        public DocumentReference setStatus(DocumentReferenceStatusEnum theValue) {
1611                setStatus(new BoundCodeDt<DocumentReferenceStatusEnum>(DocumentReferenceStatusEnum.VALUESET_BINDER, theValue));
1612                
1613/*
1614                getStatusElement().setValueAsEnum(theValue);
1615*/
1616                return this;
1617        }
1618
1619  
1620        /**
1621         * Gets the value(s) for <b>docStatus</b> (status).
1622         * creating it if it does
1623         * not exist. Will not return <code>null</code>.
1624         *
1625     * <p>
1626     * <b>Definition:</b>
1627     * The status of the underlying document
1628     * </p> 
1629         */
1630        public CodeableConceptDt getDocStatus() {  
1631                if (myDocStatus == null) {
1632                        myDocStatus = new CodeableConceptDt();
1633                }
1634                return myDocStatus;
1635        }
1636
1637        /**
1638         * Sets the value(s) for <b>docStatus</b> (status)
1639         *
1640     * <p>
1641     * <b>Definition:</b>
1642     * The status of the underlying document
1643     * </p> 
1644         */
1645        public DocumentReference setDocStatus(CodeableConceptDt theValue) {
1646                myDocStatus = theValue;
1647                return this;
1648        }
1649        
1650        
1651
1652  
1653        /**
1654         * Gets the value(s) for <b>relatesTo</b> ().
1655         * creating it if it does
1656         * not exist. Will not return <code>null</code>.
1657         *
1658     * <p>
1659     * <b>Definition:</b>
1660     * Relationships that this document has with other document references that already exist
1661     * </p> 
1662         */
1663        public java.util.List<RelatesTo> getRelatesTo() {  
1664                if (myRelatesTo == null) {
1665                        myRelatesTo = new java.util.ArrayList<RelatesTo>();
1666                }
1667                return myRelatesTo;
1668        }
1669
1670        /**
1671         * Sets the value(s) for <b>relatesTo</b> ()
1672         *
1673     * <p>
1674     * <b>Definition:</b>
1675     * Relationships that this document has with other document references that already exist
1676     * </p> 
1677         */
1678        public DocumentReference setRelatesTo(java.util.List<RelatesTo> theValue) {
1679                myRelatesTo = theValue;
1680                return this;
1681        }
1682        
1683        
1684
1685        /**
1686         * Adds and returns a new value for <b>relatesTo</b> ()
1687         *
1688     * <p>
1689     * <b>Definition:</b>
1690     * Relationships that this document has with other document references that already exist
1691     * </p> 
1692         */
1693        public RelatesTo addRelatesTo() {
1694                RelatesTo newType = new RelatesTo();
1695                getRelatesTo().add(newType);
1696                return newType; 
1697        }
1698
1699        /**
1700         * Adds a given new value for <b>relatesTo</b> ()
1701         *
1702         * <p>
1703         * <b>Definition:</b>
1704         * Relationships that this document has with other document references that already exist
1705         * </p>
1706         * @param theValue The relatesTo to add (must not be <code>null</code>)
1707         */
1708        public DocumentReference addRelatesTo(RelatesTo theValue) {
1709                if (theValue == null) {
1710                        throw new NullPointerException("theValue must not be null");
1711                }
1712                getRelatesTo().add(theValue);
1713                return this;
1714        }
1715
1716        /**
1717         * Gets the first repetition for <b>relatesTo</b> (),
1718         * creating it if it does not already exist.
1719         *
1720     * <p>
1721     * <b>Definition:</b>
1722     * Relationships that this document has with other document references that already exist
1723     * </p> 
1724         */
1725        public RelatesTo getRelatesToFirstRep() {
1726                if (getRelatesTo().isEmpty()) {
1727                        return addRelatesTo();
1728                }
1729                return getRelatesTo().get(0); 
1730        }
1731  
1732        /**
1733         * Gets the value(s) for <b>description</b> ().
1734         * creating it if it does
1735         * not exist. Will not return <code>null</code>.
1736         *
1737     * <p>
1738     * <b>Definition:</b>
1739     * Human-readable description of the source document. This is sometimes known as the \&quot;title\&quot;
1740     * </p> 
1741         */
1742        public StringDt getDescriptionElement() {  
1743                if (myDescription == null) {
1744                        myDescription = new StringDt();
1745                }
1746                return myDescription;
1747        }
1748
1749        
1750        /**
1751         * Gets the value(s) for <b>description</b> ().
1752         * creating it if it does
1753         * not exist. This method may return <code>null</code>.
1754         *
1755     * <p>
1756     * <b>Definition:</b>
1757     * Human-readable description of the source document. This is sometimes known as the \&quot;title\&quot;
1758     * </p> 
1759         */
1760        public String getDescription() {  
1761                return getDescriptionElement().getValue();
1762        }
1763
1764        /**
1765         * Sets the value(s) for <b>description</b> ()
1766         *
1767     * <p>
1768     * <b>Definition:</b>
1769     * Human-readable description of the source document. This is sometimes known as the \&quot;title\&quot;
1770     * </p> 
1771         */
1772        public DocumentReference setDescription(StringDt theValue) {
1773                myDescription = theValue;
1774                return this;
1775        }
1776        
1777        
1778
1779        /**
1780         * Sets the value for <b>description</b> ()
1781         *
1782     * <p>
1783     * <b>Definition:</b>
1784     * Human-readable description of the source document. This is sometimes known as the \&quot;title\&quot;
1785     * </p> 
1786         */
1787        public DocumentReference setDescription( String theString) {
1788                myDescription = new StringDt(theString); 
1789                return this; 
1790        }
1791
1792 
1793        /**
1794         * Gets the value(s) for <b>securityLabel</b> ().
1795         * creating it if it does
1796         * not exist. Will not return <code>null</code>.
1797         *
1798     * <p>
1799     * <b>Definition:</b>
1800     * A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \&quot;reference\&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to
1801     * </p> 
1802         */
1803        public java.util.List<CodeableConceptDt> getSecurityLabel() {  
1804                if (mySecurityLabel == null) {
1805                        mySecurityLabel = new java.util.ArrayList<CodeableConceptDt>();
1806                }
1807                return mySecurityLabel;
1808        }
1809
1810        /**
1811         * Sets the value(s) for <b>securityLabel</b> ()
1812         *
1813     * <p>
1814     * <b>Definition:</b>
1815     * A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \&quot;reference\&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to
1816     * </p> 
1817         */
1818        public DocumentReference setSecurityLabel(java.util.List<CodeableConceptDt> theValue) {
1819                mySecurityLabel = theValue;
1820                return this;
1821        }
1822        
1823        
1824
1825        /**
1826         * Adds and returns a new value for <b>securityLabel</b> ()
1827         *
1828     * <p>
1829     * <b>Definition:</b>
1830     * A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \&quot;reference\&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to
1831     * </p> 
1832         */
1833        public CodeableConceptDt addSecurityLabel() {
1834                CodeableConceptDt newType = new CodeableConceptDt();
1835                getSecurityLabel().add(newType);
1836                return newType; 
1837        }
1838
1839        /**
1840         * Adds a given new value for <b>securityLabel</b> ()
1841         *
1842         * <p>
1843         * <b>Definition:</b>
1844         * A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \&quot;reference\&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to
1845         * </p>
1846         * @param theValue The securityLabel to add (must not be <code>null</code>)
1847         */
1848        public DocumentReference addSecurityLabel(CodeableConceptDt theValue) {
1849                if (theValue == null) {
1850                        throw new NullPointerException("theValue must not be null");
1851                }
1852                getSecurityLabel().add(theValue);
1853                return this;
1854        }
1855
1856        /**
1857         * Gets the first repetition for <b>securityLabel</b> (),
1858         * creating it if it does not already exist.
1859         *
1860     * <p>
1861     * <b>Definition:</b>
1862     * A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \&quot;reference\&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to
1863     * </p> 
1864         */
1865        public CodeableConceptDt getSecurityLabelFirstRep() {
1866                if (getSecurityLabel().isEmpty()) {
1867                        return addSecurityLabel();
1868                }
1869                return getSecurityLabel().get(0); 
1870        }
1871  
1872        /**
1873         * Gets the value(s) for <b>content</b> ().
1874         * creating it if it does
1875         * not exist. Will not return <code>null</code>.
1876         *
1877     * <p>
1878     * <b>Definition:</b>
1879     * The document and format referenced. There may be multiple content element repetitions, each with a different format.
1880     * </p> 
1881         */
1882        public java.util.List<Content> getContent() {  
1883                if (myContent == null) {
1884                        myContent = new java.util.ArrayList<Content>();
1885                }
1886                return myContent;
1887        }
1888
1889        /**
1890         * Sets the value(s) for <b>content</b> ()
1891         *
1892     * <p>
1893     * <b>Definition:</b>
1894     * The document and format referenced. There may be multiple content element repetitions, each with a different format.
1895     * </p> 
1896         */
1897        public DocumentReference setContent(java.util.List<Content> theValue) {
1898                myContent = theValue;
1899                return this;
1900        }
1901        
1902        
1903
1904        /**
1905         * Adds and returns a new value for <b>content</b> ()
1906         *
1907     * <p>
1908     * <b>Definition:</b>
1909     * The document and format referenced. There may be multiple content element repetitions, each with a different format.
1910     * </p> 
1911         */
1912        public Content addContent() {
1913                Content newType = new Content();
1914                getContent().add(newType);
1915                return newType; 
1916        }
1917
1918        /**
1919         * Adds a given new value for <b>content</b> ()
1920         *
1921         * <p>
1922         * <b>Definition:</b>
1923         * The document and format referenced. There may be multiple content element repetitions, each with a different format.
1924         * </p>
1925         * @param theValue The content to add (must not be <code>null</code>)
1926         */
1927        public DocumentReference addContent(Content theValue) {
1928                if (theValue == null) {
1929                        throw new NullPointerException("theValue must not be null");
1930                }
1931                getContent().add(theValue);
1932                return this;
1933        }
1934
1935        /**
1936         * Gets the first repetition for <b>content</b> (),
1937         * creating it if it does not already exist.
1938         *
1939     * <p>
1940     * <b>Definition:</b>
1941     * The document and format referenced. There may be multiple content element repetitions, each with a different format.
1942     * </p> 
1943         */
1944        public Content getContentFirstRep() {
1945                if (getContent().isEmpty()) {
1946                        return addContent();
1947                }
1948                return getContent().get(0); 
1949        }
1950  
1951        /**
1952         * Gets the value(s) for <b>context</b> ().
1953         * creating it if it does
1954         * not exist. Will not return <code>null</code>.
1955         *
1956     * <p>
1957     * <b>Definition:</b>
1958     * The clinical context in which the document was prepared
1959     * </p> 
1960         */
1961        public Context getContext() {  
1962                if (myContext == null) {
1963                        myContext = new Context();
1964                }
1965                return myContext;
1966        }
1967
1968        /**
1969         * Sets the value(s) for <b>context</b> ()
1970         *
1971     * <p>
1972     * <b>Definition:</b>
1973     * The clinical context in which the document was prepared
1974     * </p> 
1975         */
1976        public DocumentReference setContext(Context theValue) {
1977                myContext = theValue;
1978                return this;
1979        }
1980        
1981        
1982
1983  
1984        /**
1985         * Block class for child element: <b>DocumentReference.relatesTo</b> ()
1986         *
1987     * <p>
1988     * <b>Definition:</b>
1989     * Relationships that this document has with other document references that already exist
1990     * </p> 
1991         */
1992        @Block()        
1993        public static class RelatesTo 
1994            extends  BaseIdentifiableElement  
1995            implements IResourceBlock {
1996        
1997        @Child(name="code", type=CodeDt.class, order=0, min=1, max=1, summary=false, modifier=false)    
1998        @Description(
1999                shortDefinition="",
2000                formalDefinition="The type of relationship that this document has with anther document"
2001        )
2002        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/document-relationship-type")
2003        private BoundCodeDt<DocumentRelationshipTypeEnum> myCode;
2004        
2005        @Child(name="target", order=1, min=1, max=1, summary=false, modifier=false, type={
2006                ca.uhn.fhir.model.dstu2.resource.DocumentReference.class
2007        })
2008        @Description(
2009                shortDefinition="",
2010                formalDefinition="The target document of this relationship"
2011        )
2012        private ResourceReferenceDt myTarget;
2013        
2014
2015        @Override
2016        public boolean isEmpty() {
2017                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myCode,  myTarget);
2018        }
2019        
2020        @Override
2021        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2022                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myTarget);
2023        }
2024
2025        /**
2026         * Gets the value(s) for <b>code</b> ().
2027         * creating it if it does
2028         * not exist. Will not return <code>null</code>.
2029         *
2030     * <p>
2031     * <b>Definition:</b>
2032     * The type of relationship that this document has with anther document
2033     * </p> 
2034         */
2035        public BoundCodeDt<DocumentRelationshipTypeEnum> getCodeElement() {  
2036                if (myCode == null) {
2037                        myCode = new BoundCodeDt<DocumentRelationshipTypeEnum>(DocumentRelationshipTypeEnum.VALUESET_BINDER);
2038                }
2039                return myCode;
2040        }
2041
2042        
2043        /**
2044         * Gets the value(s) for <b>code</b> ().
2045         * creating it if it does
2046         * not exist. This method may return <code>null</code>.
2047         *
2048     * <p>
2049     * <b>Definition:</b>
2050     * The type of relationship that this document has with anther document
2051     * </p> 
2052         */
2053        public String getCode() {  
2054                return getCodeElement().getValue();
2055        }
2056
2057        /**
2058         * Sets the value(s) for <b>code</b> ()
2059         *
2060     * <p>
2061     * <b>Definition:</b>
2062     * The type of relationship that this document has with anther document
2063     * </p> 
2064         */
2065        public RelatesTo setCode(BoundCodeDt<DocumentRelationshipTypeEnum> theValue) {
2066                myCode = theValue;
2067                return this;
2068        }
2069        
2070        
2071
2072        /**
2073         * Sets the value(s) for <b>code</b> ()
2074         *
2075     * <p>
2076     * <b>Definition:</b>
2077     * The type of relationship that this document has with anther document
2078     * </p> 
2079         */
2080        public RelatesTo setCode(DocumentRelationshipTypeEnum theValue) {
2081                setCode(new BoundCodeDt<DocumentRelationshipTypeEnum>(DocumentRelationshipTypeEnum.VALUESET_BINDER, theValue));
2082                
2083/*
2084                getCodeElement().setValueAsEnum(theValue);
2085*/
2086                return this;
2087        }
2088
2089  
2090        /**
2091         * Gets the value(s) for <b>target</b> ().
2092         * creating it if it does
2093         * not exist. Will not return <code>null</code>.
2094         *
2095     * <p>
2096     * <b>Definition:</b>
2097     * The target document of this relationship
2098     * </p> 
2099         */
2100        public ResourceReferenceDt getTarget() {  
2101                if (myTarget == null) {
2102                        myTarget = new ResourceReferenceDt();
2103                }
2104                return myTarget;
2105        }
2106
2107        /**
2108         * Sets the value(s) for <b>target</b> ()
2109         *
2110     * <p>
2111     * <b>Definition:</b>
2112     * The target document of this relationship
2113     * </p> 
2114         */
2115        public RelatesTo setTarget(ResourceReferenceDt theValue) {
2116                myTarget = theValue;
2117                return this;
2118        }
2119        
2120        
2121
2122  
2123
2124
2125        }
2126
2127
2128        /**
2129         * Block class for child element: <b>DocumentReference.content</b> ()
2130         *
2131     * <p>
2132     * <b>Definition:</b>
2133     * The document and format referenced. There may be multiple content element repetitions, each with a different format.
2134     * </p> 
2135         */
2136        @Block()        
2137        public static class Content 
2138            extends  BaseIdentifiableElement  
2139            implements IResourceBlock {
2140        
2141        @Child(name="attachment", type=AttachmentDt.class, order=0, min=1, max=1, summary=false, modifier=false)        
2142        @Description(
2143                shortDefinition="",
2144                formalDefinition="The document or url of the document along with critical metadata to prove content has integrity."
2145        )
2146        private AttachmentDt myAttachment;
2147        
2148        @Child(name="format", type=CodingDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
2149        @Description(
2150                shortDefinition="",
2151                formalDefinition="An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType"
2152        )
2153        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/valueset-formatcodes")
2154        private java.util.List<CodingDt> myFormat;
2155        
2156
2157        @Override
2158        public boolean isEmpty() {
2159                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myAttachment,  myFormat);
2160        }
2161        
2162        @Override
2163        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2164                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myAttachment, myFormat);
2165        }
2166
2167        /**
2168         * Gets the value(s) for <b>attachment</b> ().
2169         * creating it if it does
2170         * not exist. Will not return <code>null</code>.
2171         *
2172     * <p>
2173     * <b>Definition:</b>
2174     * The document or url of the document along with critical metadata to prove content has integrity.
2175     * </p> 
2176         */
2177        public AttachmentDt getAttachment() {  
2178                if (myAttachment == null) {
2179                        myAttachment = new AttachmentDt();
2180                }
2181                return myAttachment;
2182        }
2183
2184        /**
2185         * Sets the value(s) for <b>attachment</b> ()
2186         *
2187     * <p>
2188     * <b>Definition:</b>
2189     * The document or url of the document along with critical metadata to prove content has integrity.
2190     * </p> 
2191         */
2192        public Content setAttachment(AttachmentDt theValue) {
2193                myAttachment = theValue;
2194                return this;
2195        }
2196        
2197        
2198
2199  
2200        /**
2201         * Gets the value(s) for <b>format</b> ().
2202         * creating it if it does
2203         * not exist. Will not return <code>null</code>.
2204         *
2205     * <p>
2206     * <b>Definition:</b>
2207     * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType
2208     * </p> 
2209         */
2210        public java.util.List<CodingDt> getFormat() {  
2211                if (myFormat == null) {
2212                        myFormat = new java.util.ArrayList<CodingDt>();
2213                }
2214                return myFormat;
2215        }
2216
2217        /**
2218         * Sets the value(s) for <b>format</b> ()
2219         *
2220     * <p>
2221     * <b>Definition:</b>
2222     * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType
2223     * </p> 
2224         */
2225        public Content setFormat(java.util.List<CodingDt> theValue) {
2226                myFormat = theValue;
2227                return this;
2228        }
2229        
2230        
2231
2232        /**
2233         * Adds and returns a new value for <b>format</b> ()
2234         *
2235     * <p>
2236     * <b>Definition:</b>
2237     * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType
2238     * </p> 
2239         */
2240        public CodingDt addFormat() {
2241                CodingDt newType = new CodingDt();
2242                getFormat().add(newType);
2243                return newType; 
2244        }
2245
2246        /**
2247         * Adds a given new value for <b>format</b> ()
2248         *
2249         * <p>
2250         * <b>Definition:</b>
2251         * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType
2252         * </p>
2253         * @param theValue The format to add (must not be <code>null</code>)
2254         */
2255        public Content addFormat(CodingDt theValue) {
2256                if (theValue == null) {
2257                        throw new NullPointerException("theValue must not be null");
2258                }
2259                getFormat().add(theValue);
2260                return this;
2261        }
2262
2263        /**
2264         * Gets the first repetition for <b>format</b> (),
2265         * creating it if it does not already exist.
2266         *
2267     * <p>
2268     * <b>Definition:</b>
2269     * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType
2270     * </p> 
2271         */
2272        public CodingDt getFormatFirstRep() {
2273                if (getFormat().isEmpty()) {
2274                        return addFormat();
2275                }
2276                return getFormat().get(0); 
2277        }
2278  
2279
2280
2281        }
2282
2283
2284        /**
2285         * Block class for child element: <b>DocumentReference.context</b> ()
2286         *
2287     * <p>
2288     * <b>Definition:</b>
2289     * The clinical context in which the document was prepared
2290     * </p> 
2291         */
2292        @Block()        
2293        public static class Context 
2294            extends  BaseIdentifiableElement  
2295            implements IResourceBlock {
2296        
2297        @Child(name="encounter", order=0, min=0, max=1, summary=false, modifier=false, type={
2298                ca.uhn.fhir.model.dstu2.resource.Encounter.class
2299        })
2300        @Description(
2301                shortDefinition="context",
2302                formalDefinition="Describes the clinical encounter or type of care that the document content is associated with"
2303        )
2304        private ResourceReferenceDt myEncounter;
2305        
2306        @Child(name="event", type=CodeableConceptDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
2307        @Description(
2308                shortDefinition="",
2309                formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act"
2310        )
2311        private java.util.List<CodeableConceptDt> myEvent;
2312        
2313        @Child(name="period", type=PeriodDt.class, order=2, min=0, max=1, summary=false, modifier=false)        
2314        @Description(
2315                shortDefinition="",
2316                formalDefinition="The time period over which the service that is described by the document was provided"
2317        )
2318        private PeriodDt myPeriod;
2319        
2320        @Child(name="facilityType", type=CodeableConceptDt.class, order=3, min=0, max=1, summary=false, modifier=false) 
2321        @Description(
2322                shortDefinition="",
2323                formalDefinition="The kind of facility where the patient was seen"
2324        )
2325        private CodeableConceptDt myFacilityType;
2326        
2327        @Child(name="practiceSetting", type=CodeableConceptDt.class, order=4, min=0, max=1, summary=false, modifier=false)      
2328        @Description(
2329                shortDefinition="",
2330                formalDefinition="This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty"
2331        )
2332        private CodeableConceptDt myPracticeSetting;
2333        
2334        @Child(name="sourcePatientInfo", order=5, min=0, max=1, summary=false, modifier=false, type={
2335                ca.uhn.fhir.model.dstu2.resource.Patient.class
2336        })
2337        @Description(
2338                shortDefinition="",
2339                formalDefinition="The Patient Information as known when the document was published. May be a reference to a version specific, or contained"
2340        )
2341        private ResourceReferenceDt mySourcePatientInfo;
2342        
2343        @Child(name="related", order=6, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)  
2344        @Description(
2345                shortDefinition="",
2346                formalDefinition="Related identifiers or resources associated with the DocumentReference."
2347        )
2348        private java.util.List<ContextRelated> myRelated;
2349        
2350
2351        @Override
2352        public boolean isEmpty() {
2353                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myEncounter,  myEvent,  myPeriod,  myFacilityType,  myPracticeSetting,  mySourcePatientInfo,  myRelated);
2354        }
2355        
2356        @Override
2357        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2358                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myEncounter, myEvent, myPeriod, myFacilityType, myPracticeSetting, mySourcePatientInfo, myRelated);
2359        }
2360
2361        /**
2362         * Gets the value(s) for <b>encounter</b> (context).
2363         * creating it if it does
2364         * not exist. Will not return <code>null</code>.
2365         *
2366     * <p>
2367     * <b>Definition:</b>
2368     * Describes the clinical encounter or type of care that the document content is associated with
2369     * </p> 
2370         */
2371        public ResourceReferenceDt getEncounter() {  
2372                if (myEncounter == null) {
2373                        myEncounter = new ResourceReferenceDt();
2374                }
2375                return myEncounter;
2376        }
2377
2378        /**
2379         * Sets the value(s) for <b>encounter</b> (context)
2380         *
2381     * <p>
2382     * <b>Definition:</b>
2383     * Describes the clinical encounter or type of care that the document content is associated with
2384     * </p> 
2385         */
2386        public Context setEncounter(ResourceReferenceDt theValue) {
2387                myEncounter = theValue;
2388                return this;
2389        }
2390        
2391        
2392
2393  
2394        /**
2395         * Gets the value(s) for <b>event</b> ().
2396         * creating it if it does
2397         * not exist. Will not return <code>null</code>.
2398         *
2399     * <p>
2400     * <b>Definition:</b>
2401     * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \&quot;History and Physical Report\&quot; in which the procedure being documented is necessarily a \&quot;History and Physical\&quot; act
2402     * </p> 
2403         */
2404        public java.util.List<CodeableConceptDt> getEvent() {  
2405                if (myEvent == null) {
2406                        myEvent = new java.util.ArrayList<CodeableConceptDt>();
2407                }
2408                return myEvent;
2409        }
2410
2411        /**
2412         * Sets the value(s) for <b>event</b> ()
2413         *
2414     * <p>
2415     * <b>Definition:</b>
2416     * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \&quot;History and Physical Report\&quot; in which the procedure being documented is necessarily a \&quot;History and Physical\&quot; act
2417     * </p> 
2418         */
2419        public Context setEvent(java.util.List<CodeableConceptDt> theValue) {
2420                myEvent = theValue;
2421                return this;
2422        }
2423        
2424        
2425
2426        /**
2427         * Adds and returns a new value for <b>event</b> ()
2428         *
2429     * <p>
2430     * <b>Definition:</b>
2431     * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \&quot;History and Physical Report\&quot; in which the procedure being documented is necessarily a \&quot;History and Physical\&quot; act
2432     * </p> 
2433         */
2434        public CodeableConceptDt addEvent() {
2435                CodeableConceptDt newType = new CodeableConceptDt();
2436                getEvent().add(newType);
2437                return newType; 
2438        }
2439
2440        /**
2441         * Adds a given new value for <b>event</b> ()
2442         *
2443         * <p>
2444         * <b>Definition:</b>
2445         * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \&quot;History and Physical Report\&quot; in which the procedure being documented is necessarily a \&quot;History and Physical\&quot; act
2446         * </p>
2447         * @param theValue The event to add (must not be <code>null</code>)
2448         */
2449        public Context addEvent(CodeableConceptDt theValue) {
2450                if (theValue == null) {
2451                        throw new NullPointerException("theValue must not be null");
2452                }
2453                getEvent().add(theValue);
2454                return this;
2455        }
2456
2457        /**
2458         * Gets the first repetition for <b>event</b> (),
2459         * creating it if it does not already exist.
2460         *
2461     * <p>
2462     * <b>Definition:</b>
2463     * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \&quot;History and Physical Report\&quot; in which the procedure being documented is necessarily a \&quot;History and Physical\&quot; act
2464     * </p> 
2465         */
2466        public CodeableConceptDt getEventFirstRep() {
2467                if (getEvent().isEmpty()) {
2468                        return addEvent();
2469                }
2470                return getEvent().get(0); 
2471        }
2472  
2473        /**
2474         * Gets the value(s) for <b>period</b> ().
2475         * creating it if it does
2476         * not exist. Will not return <code>null</code>.
2477         *
2478     * <p>
2479     * <b>Definition:</b>
2480     * The time period over which the service that is described by the document was provided
2481     * </p> 
2482         */
2483        public PeriodDt getPeriod() {  
2484                if (myPeriod == null) {
2485                        myPeriod = new PeriodDt();
2486                }
2487                return myPeriod;
2488        }
2489
2490        /**
2491         * Sets the value(s) for <b>period</b> ()
2492         *
2493     * <p>
2494     * <b>Definition:</b>
2495     * The time period over which the service that is described by the document was provided
2496     * </p> 
2497         */
2498        public Context setPeriod(PeriodDt theValue) {
2499                myPeriod = theValue;
2500                return this;
2501        }
2502        
2503        
2504
2505  
2506        /**
2507         * Gets the value(s) for <b>facilityType</b> ().
2508         * creating it if it does
2509         * not exist. Will not return <code>null</code>.
2510         *
2511     * <p>
2512     * <b>Definition:</b>
2513     * The kind of facility where the patient was seen
2514     * </p> 
2515         */
2516        public CodeableConceptDt getFacilityType() {  
2517                if (myFacilityType == null) {
2518                        myFacilityType = new CodeableConceptDt();
2519                }
2520                return myFacilityType;
2521        }
2522
2523        /**
2524         * Sets the value(s) for <b>facilityType</b> ()
2525         *
2526     * <p>
2527     * <b>Definition:</b>
2528     * The kind of facility where the patient was seen
2529     * </p> 
2530         */
2531        public Context setFacilityType(CodeableConceptDt theValue) {
2532                myFacilityType = theValue;
2533                return this;
2534        }
2535        
2536        
2537
2538  
2539        /**
2540         * Gets the value(s) for <b>practiceSetting</b> ().
2541         * creating it if it does
2542         * not exist. Will not return <code>null</code>.
2543         *
2544     * <p>
2545     * <b>Definition:</b>
2546     * This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty
2547     * </p> 
2548         */
2549        public CodeableConceptDt getPracticeSetting() {  
2550                if (myPracticeSetting == null) {
2551                        myPracticeSetting = new CodeableConceptDt();
2552                }
2553                return myPracticeSetting;
2554        }
2555
2556        /**
2557         * Sets the value(s) for <b>practiceSetting</b> ()
2558         *
2559     * <p>
2560     * <b>Definition:</b>
2561     * This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty
2562     * </p> 
2563         */
2564        public Context setPracticeSetting(CodeableConceptDt theValue) {
2565                myPracticeSetting = theValue;
2566                return this;
2567        }
2568        
2569        
2570
2571  
2572        /**
2573         * Gets the value(s) for <b>sourcePatientInfo</b> ().
2574         * creating it if it does
2575         * not exist. Will not return <code>null</code>.
2576         *
2577     * <p>
2578     * <b>Definition:</b>
2579     * The Patient Information as known when the document was published. May be a reference to a version specific, or contained
2580     * </p> 
2581         */
2582        public ResourceReferenceDt getSourcePatientInfo() {  
2583                if (mySourcePatientInfo == null) {
2584                        mySourcePatientInfo = new ResourceReferenceDt();
2585                }
2586                return mySourcePatientInfo;
2587        }
2588
2589        /**
2590         * Sets the value(s) for <b>sourcePatientInfo</b> ()
2591         *
2592     * <p>
2593     * <b>Definition:</b>
2594     * The Patient Information as known when the document was published. May be a reference to a version specific, or contained
2595     * </p> 
2596         */
2597        public Context setSourcePatientInfo(ResourceReferenceDt theValue) {
2598                mySourcePatientInfo = theValue;
2599                return this;
2600        }
2601        
2602        
2603
2604  
2605        /**
2606         * Gets the value(s) for <b>related</b> ().
2607         * creating it if it does
2608         * not exist. Will not return <code>null</code>.
2609         *
2610     * <p>
2611     * <b>Definition:</b>
2612     * Related identifiers or resources associated with the DocumentReference.
2613     * </p> 
2614         */
2615        public java.util.List<ContextRelated> getRelated() {  
2616                if (myRelated == null) {
2617                        myRelated = new java.util.ArrayList<ContextRelated>();
2618                }
2619                return myRelated;
2620        }
2621
2622        /**
2623         * Sets the value(s) for <b>related</b> ()
2624         *
2625     * <p>
2626     * <b>Definition:</b>
2627     * Related identifiers or resources associated with the DocumentReference.
2628     * </p> 
2629         */
2630        public Context setRelated(java.util.List<ContextRelated> theValue) {
2631                myRelated = theValue;
2632                return this;
2633        }
2634        
2635        
2636
2637        /**
2638         * Adds and returns a new value for <b>related</b> ()
2639         *
2640     * <p>
2641     * <b>Definition:</b>
2642     * Related identifiers or resources associated with the DocumentReference.
2643     * </p> 
2644         */
2645        public ContextRelated addRelated() {
2646                ContextRelated newType = new ContextRelated();
2647                getRelated().add(newType);
2648                return newType; 
2649        }
2650
2651        /**
2652         * Adds a given new value for <b>related</b> ()
2653         *
2654         * <p>
2655         * <b>Definition:</b>
2656         * Related identifiers or resources associated with the DocumentReference.
2657         * </p>
2658         * @param theValue The related to add (must not be <code>null</code>)
2659         */
2660        public Context addRelated(ContextRelated theValue) {
2661                if (theValue == null) {
2662                        throw new NullPointerException("theValue must not be null");
2663                }
2664                getRelated().add(theValue);
2665                return this;
2666        }
2667
2668        /**
2669         * Gets the first repetition for <b>related</b> (),
2670         * creating it if it does not already exist.
2671         *
2672     * <p>
2673     * <b>Definition:</b>
2674     * Related identifiers or resources associated with the DocumentReference.
2675     * </p> 
2676         */
2677        public ContextRelated getRelatedFirstRep() {
2678                if (getRelated().isEmpty()) {
2679                        return addRelated();
2680                }
2681                return getRelated().get(0); 
2682        }
2683  
2684
2685
2686        }
2687
2688        /**
2689         * Block class for child element: <b>DocumentReference.context.related</b> ()
2690         *
2691     * <p>
2692     * <b>Definition:</b>
2693     * Related identifiers or resources associated with the DocumentReference.
2694     * </p> 
2695         */
2696        @Block()        
2697        public static class ContextRelated 
2698            extends  BaseIdentifiableElement  
2699            implements IResourceBlock {
2700        
2701        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1, summary=false, modifier=false)        
2702        @Description(
2703                shortDefinition="",
2704                formalDefinition="Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing."
2705        )
2706        private IdentifierDt myIdentifier;
2707        
2708        @Child(name="ref", order=1, min=0, max=1, summary=false, modifier=false, type={
2709                IResource.class
2710        })
2711        @Description(
2712                shortDefinition="",
2713                formalDefinition="Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing."
2714        )
2715        private ResourceReferenceDt myRef;
2716        
2717
2718        @Override
2719        public boolean isEmpty() {
2720                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myRef);
2721        }
2722        
2723        @Override
2724        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2725                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myRef);
2726        }
2727
2728        /**
2729         * Gets the value(s) for <b>identifier</b> ().
2730         * creating it if it does
2731         * not exist. Will not return <code>null</code>.
2732         *
2733     * <p>
2734     * <b>Definition:</b>
2735     * Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.
2736     * </p> 
2737         */
2738        public IdentifierDt getIdentifier() {  
2739                if (myIdentifier == null) {
2740                        myIdentifier = new IdentifierDt();
2741                }
2742                return myIdentifier;
2743        }
2744
2745        /**
2746         * Sets the value(s) for <b>identifier</b> ()
2747         *
2748     * <p>
2749     * <b>Definition:</b>
2750     * Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.
2751     * </p> 
2752         */
2753        public ContextRelated setIdentifier(IdentifierDt theValue) {
2754                myIdentifier = theValue;
2755                return this;
2756        }
2757        
2758        
2759
2760  
2761        /**
2762         * Gets the value(s) for <b>ref</b> ().
2763         * creating it if it does
2764         * not exist. Will not return <code>null</code>.
2765         *
2766     * <p>
2767     * <b>Definition:</b>
2768     * Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.
2769     * </p> 
2770         */
2771        public ResourceReferenceDt getRef() {  
2772                if (myRef == null) {
2773                        myRef = new ResourceReferenceDt();
2774                }
2775                return myRef;
2776        }
2777
2778        /**
2779         * Sets the value(s) for <b>ref</b> ()
2780         *
2781     * <p>
2782     * <b>Definition:</b>
2783     * Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.
2784     * </p> 
2785         */
2786        public ContextRelated setRef(ResourceReferenceDt theValue) {
2787                myRef = theValue;
2788                return this;
2789        }
2790        
2791        
2792
2793  
2794
2795
2796        }
2797
2798
2799
2800
2801
2802    @Override
2803    public String getResourceName() {
2804        return "DocumentReference";
2805    }
2806    
2807    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
2808        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
2809    }
2810
2811
2812}