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>ReferralRequest</b> Resource
282 * (clinical.careprovision)
283 *
284 * <p>
285 * <b>Definition:</b>
286 * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization.
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/ReferralRequest">http://hl7.org/fhir/profiles/ReferralRequest</a> 
297 * </p>
298 *
299 */
300@ResourceDef(name="ReferralRequest", profile="http://hl7.org/fhir/profiles/ReferralRequest", id="referralrequest")
301public class ReferralRequest extends ca.uhn.fhir.model.dstu2.resource.BaseResource
302    implements  IResource     {
303
304        /**
305         * Search parameter constant for <b>status</b>
306         * <p>
307         * Description: <b>The status of the referral</b><br>
308         * Type: <b>token</b><br>
309         * Path: <b>ReferralRequest.status</b><br>
310         * </p>
311         */
312        @SearchParamDefinition(name="status", path="ReferralRequest.status", description="The status of the referral", type="token"  )
313        public static final String SP_STATUS = "status";
314
315        /**
316         * <b>Fluent Client</b> search parameter constant for <b>status</b>
317         * <p>
318         * Description: <b>The status of the referral</b><br>
319         * Type: <b>token</b><br>
320         * Path: <b>ReferralRequest.status</b><br>
321         * </p>
322         */
323        public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS);
324
325        /**
326         * Search parameter constant for <b>date</b>
327         * <p>
328         * Description: <b>Creation or activation date</b><br>
329         * Type: <b>date</b><br>
330         * Path: <b>ReferralRequest.date</b><br>
331         * </p>
332         */
333        @SearchParamDefinition(name="date", path="ReferralRequest.date", description="Creation or activation date", type="date"  )
334        public static final String SP_DATE = "date";
335
336        /**
337         * <b>Fluent Client</b> search parameter constant for <b>date</b>
338         * <p>
339         * Description: <b>Creation or activation date</b><br>
340         * Type: <b>date</b><br>
341         * Path: <b>ReferralRequest.date</b><br>
342         * </p>
343         */
344        public static final DateClientParam DATE = new DateClientParam(SP_DATE);
345
346        /**
347         * Search parameter constant for <b>type</b>
348         * <p>
349         * Description: <b>The type of the referral</b><br>
350         * Type: <b>token</b><br>
351         * Path: <b>ReferralRequest.type</b><br>
352         * </p>
353         */
354        @SearchParamDefinition(name="type", path="ReferralRequest.type", description="The type of the referral", type="token"  )
355        public static final String SP_TYPE = "type";
356
357        /**
358         * <b>Fluent Client</b> search parameter constant for <b>type</b>
359         * <p>
360         * Description: <b>The type of the referral</b><br>
361         * Type: <b>token</b><br>
362         * Path: <b>ReferralRequest.type</b><br>
363         * </p>
364         */
365        public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE);
366
367        /**
368         * Search parameter constant for <b>specialty</b>
369         * <p>
370         * Description: <b>The specialty that the referral is for</b><br>
371         * Type: <b>token</b><br>
372         * Path: <b>ReferralRequest.specialty</b><br>
373         * </p>
374         */
375        @SearchParamDefinition(name="specialty", path="ReferralRequest.specialty", description="The specialty that the referral is for", type="token"  )
376        public static final String SP_SPECIALTY = "specialty";
377
378        /**
379         * <b>Fluent Client</b> search parameter constant for <b>specialty</b>
380         * <p>
381         * Description: <b>The specialty that the referral is for</b><br>
382         * Type: <b>token</b><br>
383         * Path: <b>ReferralRequest.specialty</b><br>
384         * </p>
385         */
386        public static final TokenClientParam SPECIALTY = new TokenClientParam(SP_SPECIALTY);
387
388        /**
389         * Search parameter constant for <b>priority</b>
390         * <p>
391         * Description: <b>The priority assigned to the referral</b><br>
392         * Type: <b>token</b><br>
393         * Path: <b>ReferralRequest.priority</b><br>
394         * </p>
395         */
396        @SearchParamDefinition(name="priority", path="ReferralRequest.priority", description="The priority assigned to the referral", type="token"  )
397        public static final String SP_PRIORITY = "priority";
398
399        /**
400         * <b>Fluent Client</b> search parameter constant for <b>priority</b>
401         * <p>
402         * Description: <b>The priority assigned to the referral</b><br>
403         * Type: <b>token</b><br>
404         * Path: <b>ReferralRequest.priority</b><br>
405         * </p>
406         */
407        public static final TokenClientParam PRIORITY = new TokenClientParam(SP_PRIORITY);
408
409        /**
410         * Search parameter constant for <b>recipient</b>
411         * <p>
412         * Description: <b>The person that the referral was sent to</b><br>
413         * Type: <b>reference</b><br>
414         * Path: <b>ReferralRequest.recipient</b><br>
415         * </p>
416         */
417        @SearchParamDefinition(name="recipient", path="ReferralRequest.recipient", description="The person that the referral was sent to", type="reference" , providesMembershipIn={
418 @Compartment(name="Encounter")         }
419 )
420        public static final String SP_RECIPIENT = "recipient";
421
422        /**
423         * <b>Fluent Client</b> search parameter constant for <b>recipient</b>
424         * <p>
425         * Description: <b>The person that the referral was sent to</b><br>
426         * Type: <b>reference</b><br>
427         * Path: <b>ReferralRequest.recipient</b><br>
428         * </p>
429         */
430        public static final ReferenceClientParam RECIPIENT = new ReferenceClientParam(SP_RECIPIENT);
431
432        /**
433         * Search parameter constant for <b>patient</b>
434         * <p>
435         * Description: <b>Who the referral is about</b><br>
436         * Type: <b>reference</b><br>
437         * Path: <b>ReferralRequest.patient</b><br>
438         * </p>
439         */
440        @SearchParamDefinition(name="patient", path="ReferralRequest.patient", description="Who the referral is about", type="reference" , providesMembershipIn={
441 @Compartment(name="Patient")   }
442 )
443        public static final String SP_PATIENT = "patient";
444
445        /**
446         * <b>Fluent Client</b> search parameter constant for <b>patient</b>
447         * <p>
448         * Description: <b>Who the referral is about</b><br>
449         * Type: <b>reference</b><br>
450         * Path: <b>ReferralRequest.patient</b><br>
451         * </p>
452         */
453        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
454
455        /**
456         * Search parameter constant for <b>requester</b>
457         * <p>
458         * Description: <b></b><br>
459         * Type: <b>reference</b><br>
460         * Path: <b>ReferralRequest.requester</b><br>
461         * </p>
462         */
463        @SearchParamDefinition(name="requester", path="ReferralRequest.requester", description="", type="reference" , providesMembershipIn={
464 @Compartment(name="Patient") ,  @Compartment(name="Encounter")         }
465 )
466        public static final String SP_REQUESTER = "requester";
467
468        /**
469         * <b>Fluent Client</b> search parameter constant for <b>requester</b>
470         * <p>
471         * Description: <b></b><br>
472         * Type: <b>reference</b><br>
473         * Path: <b>ReferralRequest.requester</b><br>
474         * </p>
475         */
476        public static final ReferenceClientParam REQUESTER = new ReferenceClientParam(SP_REQUESTER);
477
478
479        /**
480         * Constant for fluent queries to be used to add include statements. Specifies
481         * the path value of "<b>ReferralRequest:patient</b>".
482         */
483        public static final Include INCLUDE_PATIENT = new Include("ReferralRequest:patient");
484
485        /**
486         * Constant for fluent queries to be used to add include statements. Specifies
487         * the path value of "<b>ReferralRequest:recipient</b>".
488         */
489        public static final Include INCLUDE_RECIPIENT = new Include("ReferralRequest:recipient");
490
491        /**
492         * Constant for fluent queries to be used to add include statements. Specifies
493         * the path value of "<b>ReferralRequest:requester</b>".
494         */
495        public static final Include INCLUDE_REQUESTER = new Include("ReferralRequest:requester");
496
497
498        @Child(name="status", type=CodeDt.class, order=0, min=1, max=1, summary=true, modifier=true)    
499        @Description(
500                shortDefinition="status",
501                formalDefinition="The workflow status of the referral or transfer of care request"
502        )
503        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/referralstatus")
504        private BoundCodeDt<ReferralStatusEnum> myStatus;
505        
506        @Child(name="identifier", type=IdentifierDt.class, order=1, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
507        @Description(
508                shortDefinition="id",
509                formalDefinition="Business identifier that uniquely identifies the referral/care transfer request instance"
510        )
511        private java.util.List<IdentifierDt> myIdentifier;
512        
513        @Child(name="date", type=DateTimeDt.class, order=2, min=0, max=1, summary=true, modifier=false) 
514        @Description(
515                shortDefinition="when.init",
516                formalDefinition="Date/DateTime of creation for draft requests and date of activation for active requests"
517        )
518        private DateTimeDt myDate;
519        
520        @Child(name="type", type=CodeableConceptDt.class, order=3, min=0, max=1, summary=true, modifier=false)  
521        @Description(
522                shortDefinition="class",
523                formalDefinition="An indication of the type of referral (or where applicable the type of transfer of care) request"
524        )
525        private CodeableConceptDt myType;
526        
527        @Child(name="specialty", type=CodeableConceptDt.class, order=4, min=0, max=1, summary=false, modifier=false)    
528        @Description(
529                shortDefinition="",
530                formalDefinition="Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.  For example: Cardiology Gastroenterology Diabetology"
531        )
532        private CodeableConceptDt mySpecialty;
533        
534        @Child(name="priority", type=CodeableConceptDt.class, order=5, min=0, max=1, summary=true, modifier=false)      
535        @Description(
536                shortDefinition="grade",
537                formalDefinition="An indication of the urgency of referral (or where applicable the type of transfer of care) request"
538        )
539        private CodeableConceptDt myPriority;
540        
541        @Child(name="patient", order=6, min=0, max=1, summary=true, modifier=false, type={
542                ca.uhn.fhir.model.dstu2.resource.Patient.class  })
543        @Description(
544                shortDefinition="who.focus",
545                formalDefinition="The patient who is the subject of a referral or transfer of care request"
546        )
547        private ResourceReferenceDt myPatient;
548        
549        @Child(name="requester", order=7, min=0, max=1, summary=true, modifier=false, type={
550                ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.Organization.class,            ca.uhn.fhir.model.dstu2.resource.Patient.class  })
551        @Description(
552                shortDefinition="who.author",
553                formalDefinition="The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be  Patient (a self referral)"
554        )
555        private ResourceReferenceDt myRequester;
556        
557        @Child(name="recipient", order=8, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false, type={
558                ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.Organization.class     })
559        @Description(
560                shortDefinition="who.actor",
561                formalDefinition="The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request"
562        )
563        private java.util.List<ResourceReferenceDt> myRecipient;
564        
565        @Child(name="encounter", order=9, min=0, max=1, summary=false, modifier=false, type={
566                ca.uhn.fhir.model.dstu2.resource.Encounter.class        })
567        @Description(
568                shortDefinition="context",
569                formalDefinition="The encounter at which the request for referral or transfer of care is initiated"
570        )
571        private ResourceReferenceDt myEncounter;
572        
573        @Child(name="dateSent", type=DateTimeDt.class, order=10, min=0, max=1, summary=true, modifier=false)    
574        @Description(
575                shortDefinition="when.init",
576                formalDefinition="Date/DateTime the request for referral or transfer of care is sent by the author"
577        )
578        private DateTimeDt myDateSent;
579        
580        @Child(name="reason", type=CodeableConceptDt.class, order=11, min=0, max=1, summary=true, modifier=false)       
581        @Description(
582                shortDefinition="why",
583                formalDefinition="Description of clinical condition indicating why referral/transfer of care is requested.  For example:  Pathological Anomalies, Disabled (physical or mental),  Behavioral Management"
584        )
585        private CodeableConceptDt myReason;
586        
587        @Child(name="description", type=StringDt.class, order=12, min=0, max=1, summary=false, modifier=false)  
588        @Description(
589                shortDefinition="",
590                formalDefinition="The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary"
591        )
592        private StringDt myDescription;
593        
594        @Child(name="serviceRequested", type=CodeableConceptDt.class, order=13, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)   
595        @Description(
596                shortDefinition="what",
597                formalDefinition="The service(s) that is/are requested to be provided to the patient.  For example: cardiac pacemaker insertion"
598        )
599        private java.util.List<CodeableConceptDt> myServiceRequested;
600        
601        @Child(name="supportingInformation", order=14, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false, type={
602                IResource.class })
603        @Description(
604                shortDefinition="",
605                formalDefinition="Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.  For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan"
606        )
607        private java.util.List<ResourceReferenceDt> mySupportingInformation;
608        
609        @Child(name="fulfillmentTime", type=PeriodDt.class, order=15, min=0, max=1, summary=true, modifier=false)       
610        @Description(
611                shortDefinition="when.planned",
612                formalDefinition="The period of time within which the services identified in the referral/transfer of care is specified or required to occur"
613        )
614        private PeriodDt myFulfillmentTime;
615        
616
617        @Override
618        public boolean isEmpty() {
619                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myStatus,  myIdentifier,  myDate,  myType,  mySpecialty,  myPriority,  myPatient,  myRequester,  myRecipient,  myEncounter,  myDateSent,  myReason,  myDescription,  myServiceRequested,  mySupportingInformation,  myFulfillmentTime);
620        }
621        
622        @Override
623        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
624                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myStatus, myIdentifier, myDate, myType, mySpecialty, myPriority, myPatient, myRequester, myRecipient, myEncounter, myDateSent, myReason, myDescription, myServiceRequested, mySupportingInformation, myFulfillmentTime);
625        }
626
627        /**
628         * Gets the value(s) for <b>status</b> (status).
629         * creating it if it does
630         * not exist. Will not return <code>null</code>.
631         *
632     * <p>
633     * <b>Definition:</b>
634     * The workflow status of the referral or transfer of care request
635     * </p> 
636         */
637        public BoundCodeDt<ReferralStatusEnum> getStatusElement() {  
638                if (myStatus == null) {
639                        myStatus = new BoundCodeDt<ReferralStatusEnum>(ReferralStatusEnum.VALUESET_BINDER);
640                }
641                return myStatus;
642        }
643
644        
645        /**
646         * Gets the value(s) for <b>status</b> (status).
647         * creating it if it does
648         * not exist. This method may return <code>null</code>.
649         *
650     * <p>
651     * <b>Definition:</b>
652     * The workflow status of the referral or transfer of care request
653     * </p> 
654         */
655        public String getStatus() {  
656                return getStatusElement().getValue();
657        }
658
659        /**
660         * Sets the value(s) for <b>status</b> (status)
661         *
662     * <p>
663     * <b>Definition:</b>
664     * The workflow status of the referral or transfer of care request
665     * </p> 
666         */
667        public ReferralRequest setStatus(BoundCodeDt<ReferralStatusEnum> theValue) {
668                myStatus = theValue;
669                return this;
670        }
671        
672        
673
674        /**
675         * Sets the value(s) for <b>status</b> (status)
676         *
677     * <p>
678     * <b>Definition:</b>
679     * The workflow status of the referral or transfer of care request
680     * </p> 
681         */
682        public ReferralRequest setStatus(ReferralStatusEnum theValue) {
683                setStatus(new BoundCodeDt<ReferralStatusEnum>(ReferralStatusEnum.VALUESET_BINDER, theValue));
684                
685/*
686                getStatusElement().setValueAsEnum(theValue);
687*/
688                return this;
689        }
690
691  
692        /**
693         * Gets the value(s) for <b>identifier</b> (id).
694         * creating it if it does
695         * not exist. Will not return <code>null</code>.
696         *
697     * <p>
698     * <b>Definition:</b>
699     * Business identifier that uniquely identifies the referral/care transfer request instance
700     * </p> 
701         */
702        public java.util.List<IdentifierDt> getIdentifier() {  
703                if (myIdentifier == null) {
704                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
705                }
706                return myIdentifier;
707        }
708
709        /**
710         * Sets the value(s) for <b>identifier</b> (id)
711         *
712     * <p>
713     * <b>Definition:</b>
714     * Business identifier that uniquely identifies the referral/care transfer request instance
715     * </p> 
716         */
717        public ReferralRequest setIdentifier(java.util.List<IdentifierDt> theValue) {
718                myIdentifier = theValue;
719                return this;
720        }
721        
722        
723
724        /**
725         * Adds and returns a new value for <b>identifier</b> (id)
726         *
727     * <p>
728     * <b>Definition:</b>
729     * Business identifier that uniquely identifies the referral/care transfer request instance
730     * </p> 
731         */
732        public IdentifierDt addIdentifier() {
733                IdentifierDt newType = new IdentifierDt();
734                getIdentifier().add(newType);
735                return newType; 
736        }
737
738        /**
739         * Adds a given new value for <b>identifier</b> (id)
740         *
741         * <p>
742         * <b>Definition:</b>
743         * Business identifier that uniquely identifies the referral/care transfer request instance
744         * </p>
745         * @param theValue The identifier to add (must not be <code>null</code>)
746         */
747        public ReferralRequest addIdentifier(IdentifierDt theValue) {
748                if (theValue == null) {
749                        throw new NullPointerException("theValue must not be null");
750                }
751                getIdentifier().add(theValue);
752                return this;
753        }
754
755        /**
756         * Gets the first repetition for <b>identifier</b> (id),
757         * creating it if it does not already exist.
758         *
759     * <p>
760     * <b>Definition:</b>
761     * Business identifier that uniquely identifies the referral/care transfer request instance
762     * </p> 
763         */
764        public IdentifierDt getIdentifierFirstRep() {
765                if (getIdentifier().isEmpty()) {
766                        return addIdentifier();
767                }
768                return getIdentifier().get(0); 
769        }
770  
771        /**
772         * Gets the value(s) for <b>date</b> (when.init).
773         * creating it if it does
774         * not exist. Will not return <code>null</code>.
775         *
776     * <p>
777     * <b>Definition:</b>
778     * Date/DateTime of creation for draft requests and date of activation for active requests
779     * </p> 
780         */
781        public DateTimeDt getDateElement() {  
782                if (myDate == null) {
783                        myDate = new DateTimeDt();
784                }
785                return myDate;
786        }
787
788        
789        /**
790         * Gets the value(s) for <b>date</b> (when.init).
791         * creating it if it does
792         * not exist. This method may return <code>null</code>.
793         *
794     * <p>
795     * <b>Definition:</b>
796     * Date/DateTime of creation for draft requests and date of activation for active requests
797     * </p> 
798         */
799        public Date getDate() {  
800                return getDateElement().getValue();
801        }
802
803        /**
804         * Sets the value(s) for <b>date</b> (when.init)
805         *
806     * <p>
807     * <b>Definition:</b>
808     * Date/DateTime of creation for draft requests and date of activation for active requests
809     * </p> 
810         */
811        public ReferralRequest setDate(DateTimeDt theValue) {
812                myDate = theValue;
813                return this;
814        }
815        
816        
817
818        /**
819         * Sets the value for <b>date</b> (when.init)
820         *
821     * <p>
822     * <b>Definition:</b>
823     * Date/DateTime of creation for draft requests and date of activation for active requests
824     * </p> 
825         */
826        public ReferralRequest setDateWithSecondsPrecision( Date theDate) {
827                myDate = new DateTimeDt(theDate); 
828                return this; 
829        }
830
831        /**
832         * Sets the value for <b>date</b> (when.init)
833         *
834     * <p>
835     * <b>Definition:</b>
836     * Date/DateTime of creation for draft requests and date of activation for active requests
837     * </p> 
838         */
839        public ReferralRequest setDate( Date theDate,  TemporalPrecisionEnum thePrecision) {
840                myDate = new DateTimeDt(theDate, thePrecision); 
841                return this; 
842        }
843
844 
845        /**
846         * Gets the value(s) for <b>type</b> (class).
847         * creating it if it does
848         * not exist. Will not return <code>null</code>.
849         *
850     * <p>
851     * <b>Definition:</b>
852     * An indication of the type of referral (or where applicable the type of transfer of care) request
853     * </p> 
854         */
855        public CodeableConceptDt getType() {  
856                if (myType == null) {
857                        myType = new CodeableConceptDt();
858                }
859                return myType;
860        }
861
862        /**
863         * Sets the value(s) for <b>type</b> (class)
864         *
865     * <p>
866     * <b>Definition:</b>
867     * An indication of the type of referral (or where applicable the type of transfer of care) request
868     * </p> 
869         */
870        public ReferralRequest setType(CodeableConceptDt theValue) {
871                myType = theValue;
872                return this;
873        }
874        
875        
876
877  
878        /**
879         * Gets the value(s) for <b>specialty</b> ().
880         * creating it if it does
881         * not exist. Will not return <code>null</code>.
882         *
883     * <p>
884     * <b>Definition:</b>
885     * Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.  For example: Cardiology Gastroenterology Diabetology
886     * </p> 
887         */
888        public CodeableConceptDt getSpecialty() {  
889                if (mySpecialty == null) {
890                        mySpecialty = new CodeableConceptDt();
891                }
892                return mySpecialty;
893        }
894
895        /**
896         * Sets the value(s) for <b>specialty</b> ()
897         *
898     * <p>
899     * <b>Definition:</b>
900     * Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.  For example: Cardiology Gastroenterology Diabetology
901     * </p> 
902         */
903        public ReferralRequest setSpecialty(CodeableConceptDt theValue) {
904                mySpecialty = theValue;
905                return this;
906        }
907        
908        
909
910  
911        /**
912         * Gets the value(s) for <b>priority</b> (grade).
913         * creating it if it does
914         * not exist. Will not return <code>null</code>.
915         *
916     * <p>
917     * <b>Definition:</b>
918     * An indication of the urgency of referral (or where applicable the type of transfer of care) request
919     * </p> 
920         */
921        public CodeableConceptDt getPriority() {  
922                if (myPriority == null) {
923                        myPriority = new CodeableConceptDt();
924                }
925                return myPriority;
926        }
927
928        /**
929         * Sets the value(s) for <b>priority</b> (grade)
930         *
931     * <p>
932     * <b>Definition:</b>
933     * An indication of the urgency of referral (or where applicable the type of transfer of care) request
934     * </p> 
935         */
936        public ReferralRequest setPriority(CodeableConceptDt theValue) {
937                myPriority = theValue;
938                return this;
939        }
940        
941        
942
943  
944        /**
945         * Gets the value(s) for <b>patient</b> (who.focus).
946         * creating it if it does
947         * not exist. Will not return <code>null</code>.
948         *
949     * <p>
950     * <b>Definition:</b>
951     * The patient who is the subject of a referral or transfer of care request
952     * </p> 
953         */
954        public ResourceReferenceDt getPatient() {  
955                if (myPatient == null) {
956                        myPatient = new ResourceReferenceDt();
957                }
958                return myPatient;
959        }
960
961        /**
962         * Sets the value(s) for <b>patient</b> (who.focus)
963         *
964     * <p>
965     * <b>Definition:</b>
966     * The patient who is the subject of a referral or transfer of care request
967     * </p> 
968         */
969        public ReferralRequest setPatient(ResourceReferenceDt theValue) {
970                myPatient = theValue;
971                return this;
972        }
973        
974        
975
976  
977        /**
978         * Gets the value(s) for <b>requester</b> (who.author).
979         * creating it if it does
980         * not exist. Will not return <code>null</code>.
981         *
982     * <p>
983     * <b>Definition:</b>
984     * The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be  Patient (a self referral)
985     * </p> 
986         */
987        public ResourceReferenceDt getRequester() {  
988                if (myRequester == null) {
989                        myRequester = new ResourceReferenceDt();
990                }
991                return myRequester;
992        }
993
994        /**
995         * Sets the value(s) for <b>requester</b> (who.author)
996         *
997     * <p>
998     * <b>Definition:</b>
999     * The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be  Patient (a self referral)
1000     * </p> 
1001         */
1002        public ReferralRequest setRequester(ResourceReferenceDt theValue) {
1003                myRequester = theValue;
1004                return this;
1005        }
1006        
1007        
1008
1009  
1010        /**
1011         * Gets the value(s) for <b>recipient</b> (who.actor).
1012         * creating it if it does
1013         * not exist. Will not return <code>null</code>.
1014         *
1015     * <p>
1016     * <b>Definition:</b>
1017     * The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request
1018     * </p> 
1019         */
1020        public java.util.List<ResourceReferenceDt> getRecipient() {  
1021                if (myRecipient == null) {
1022                        myRecipient = new java.util.ArrayList<ResourceReferenceDt>();
1023                }
1024                return myRecipient;
1025        }
1026
1027        /**
1028         * Sets the value(s) for <b>recipient</b> (who.actor)
1029         *
1030     * <p>
1031     * <b>Definition:</b>
1032     * The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request
1033     * </p> 
1034         */
1035        public ReferralRequest setRecipient(java.util.List<ResourceReferenceDt> theValue) {
1036                myRecipient = theValue;
1037                return this;
1038        }
1039        
1040        
1041
1042        /**
1043         * Adds and returns a new value for <b>recipient</b> (who.actor)
1044         *
1045     * <p>
1046     * <b>Definition:</b>
1047     * The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request
1048     * </p> 
1049         */
1050        public ResourceReferenceDt addRecipient() {
1051                ResourceReferenceDt newType = new ResourceReferenceDt();
1052                getRecipient().add(newType);
1053                return newType; 
1054        }
1055  
1056        /**
1057         * Gets the value(s) for <b>encounter</b> (context).
1058         * creating it if it does
1059         * not exist. Will not return <code>null</code>.
1060         *
1061     * <p>
1062     * <b>Definition:</b>
1063     * The encounter at which the request for referral or transfer of care is initiated
1064     * </p> 
1065         */
1066        public ResourceReferenceDt getEncounter() {  
1067                if (myEncounter == null) {
1068                        myEncounter = new ResourceReferenceDt();
1069                }
1070                return myEncounter;
1071        }
1072
1073        /**
1074         * Sets the value(s) for <b>encounter</b> (context)
1075         *
1076     * <p>
1077     * <b>Definition:</b>
1078     * The encounter at which the request for referral or transfer of care is initiated
1079     * </p> 
1080         */
1081        public ReferralRequest setEncounter(ResourceReferenceDt theValue) {
1082                myEncounter = theValue;
1083                return this;
1084        }
1085        
1086        
1087
1088  
1089        /**
1090         * Gets the value(s) for <b>dateSent</b> (when.init).
1091         * creating it if it does
1092         * not exist. Will not return <code>null</code>.
1093         *
1094     * <p>
1095     * <b>Definition:</b>
1096     * Date/DateTime the request for referral or transfer of care is sent by the author
1097     * </p> 
1098         */
1099        public DateTimeDt getDateSentElement() {  
1100                if (myDateSent == null) {
1101                        myDateSent = new DateTimeDt();
1102                }
1103                return myDateSent;
1104        }
1105
1106        
1107        /**
1108         * Gets the value(s) for <b>dateSent</b> (when.init).
1109         * creating it if it does
1110         * not exist. This method may return <code>null</code>.
1111         *
1112     * <p>
1113     * <b>Definition:</b>
1114     * Date/DateTime the request for referral or transfer of care is sent by the author
1115     * </p> 
1116         */
1117        public Date getDateSent() {  
1118                return getDateSentElement().getValue();
1119        }
1120
1121        /**
1122         * Sets the value(s) for <b>dateSent</b> (when.init)
1123         *
1124     * <p>
1125     * <b>Definition:</b>
1126     * Date/DateTime the request for referral or transfer of care is sent by the author
1127     * </p> 
1128         */
1129        public ReferralRequest setDateSent(DateTimeDt theValue) {
1130                myDateSent = theValue;
1131                return this;
1132        }
1133        
1134        
1135
1136        /**
1137         * Sets the value for <b>dateSent</b> (when.init)
1138         *
1139     * <p>
1140     * <b>Definition:</b>
1141     * Date/DateTime the request for referral or transfer of care is sent by the author
1142     * </p> 
1143         */
1144        public ReferralRequest setDateSentWithSecondsPrecision( Date theDate) {
1145                myDateSent = new DateTimeDt(theDate); 
1146                return this; 
1147        }
1148
1149        /**
1150         * Sets the value for <b>dateSent</b> (when.init)
1151         *
1152     * <p>
1153     * <b>Definition:</b>
1154     * Date/DateTime the request for referral or transfer of care is sent by the author
1155     * </p> 
1156         */
1157        public ReferralRequest setDateSent( Date theDate,  TemporalPrecisionEnum thePrecision) {
1158                myDateSent = new DateTimeDt(theDate, thePrecision); 
1159                return this; 
1160        }
1161
1162 
1163        /**
1164         * Gets the value(s) for <b>reason</b> (why).
1165         * creating it if it does
1166         * not exist. Will not return <code>null</code>.
1167         *
1168     * <p>
1169     * <b>Definition:</b>
1170     * Description of clinical condition indicating why referral/transfer of care is requested.  For example:  Pathological Anomalies, Disabled (physical or mental),  Behavioral Management
1171     * </p> 
1172         */
1173        public CodeableConceptDt getReason() {  
1174                if (myReason == null) {
1175                        myReason = new CodeableConceptDt();
1176                }
1177                return myReason;
1178        }
1179
1180        /**
1181         * Sets the value(s) for <b>reason</b> (why)
1182         *
1183     * <p>
1184     * <b>Definition:</b>
1185     * Description of clinical condition indicating why referral/transfer of care is requested.  For example:  Pathological Anomalies, Disabled (physical or mental),  Behavioral Management
1186     * </p> 
1187         */
1188        public ReferralRequest setReason(CodeableConceptDt theValue) {
1189                myReason = theValue;
1190                return this;
1191        }
1192        
1193        
1194
1195  
1196        /**
1197         * Gets the value(s) for <b>description</b> ().
1198         * creating it if it does
1199         * not exist. Will not return <code>null</code>.
1200         *
1201     * <p>
1202     * <b>Definition:</b>
1203     * The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary
1204     * </p> 
1205         */
1206        public StringDt getDescriptionElement() {  
1207                if (myDescription == null) {
1208                        myDescription = new StringDt();
1209                }
1210                return myDescription;
1211        }
1212
1213        
1214        /**
1215         * Gets the value(s) for <b>description</b> ().
1216         * creating it if it does
1217         * not exist. This method may return <code>null</code>.
1218         *
1219     * <p>
1220     * <b>Definition:</b>
1221     * The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary
1222     * </p> 
1223         */
1224        public String getDescription() {  
1225                return getDescriptionElement().getValue();
1226        }
1227
1228        /**
1229         * Sets the value(s) for <b>description</b> ()
1230         *
1231     * <p>
1232     * <b>Definition:</b>
1233     * The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary
1234     * </p> 
1235         */
1236        public ReferralRequest setDescription(StringDt theValue) {
1237                myDescription = theValue;
1238                return this;
1239        }
1240        
1241        
1242
1243        /**
1244         * Sets the value for <b>description</b> ()
1245         *
1246     * <p>
1247     * <b>Definition:</b>
1248     * The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary
1249     * </p> 
1250         */
1251        public ReferralRequest setDescription( String theString) {
1252                myDescription = new StringDt(theString); 
1253                return this; 
1254        }
1255
1256 
1257        /**
1258         * Gets the value(s) for <b>serviceRequested</b> (what).
1259         * creating it if it does
1260         * not exist. Will not return <code>null</code>.
1261         *
1262     * <p>
1263     * <b>Definition:</b>
1264     * The service(s) that is/are requested to be provided to the patient.  For example: cardiac pacemaker insertion
1265     * </p> 
1266         */
1267        public java.util.List<CodeableConceptDt> getServiceRequested() {  
1268                if (myServiceRequested == null) {
1269                        myServiceRequested = new java.util.ArrayList<CodeableConceptDt>();
1270                }
1271                return myServiceRequested;
1272        }
1273
1274        /**
1275         * Sets the value(s) for <b>serviceRequested</b> (what)
1276         *
1277     * <p>
1278     * <b>Definition:</b>
1279     * The service(s) that is/are requested to be provided to the patient.  For example: cardiac pacemaker insertion
1280     * </p> 
1281         */
1282        public ReferralRequest setServiceRequested(java.util.List<CodeableConceptDt> theValue) {
1283                myServiceRequested = theValue;
1284                return this;
1285        }
1286        
1287        
1288
1289        /**
1290         * Adds and returns a new value for <b>serviceRequested</b> (what)
1291         *
1292     * <p>
1293     * <b>Definition:</b>
1294     * The service(s) that is/are requested to be provided to the patient.  For example: cardiac pacemaker insertion
1295     * </p> 
1296         */
1297        public CodeableConceptDt addServiceRequested() {
1298                CodeableConceptDt newType = new CodeableConceptDt();
1299                getServiceRequested().add(newType);
1300                return newType; 
1301        }
1302
1303        /**
1304         * Adds a given new value for <b>serviceRequested</b> (what)
1305         *
1306         * <p>
1307         * <b>Definition:</b>
1308         * The service(s) that is/are requested to be provided to the patient.  For example: cardiac pacemaker insertion
1309         * </p>
1310         * @param theValue The serviceRequested to add (must not be <code>null</code>)
1311         */
1312        public ReferralRequest addServiceRequested(CodeableConceptDt theValue) {
1313                if (theValue == null) {
1314                        throw new NullPointerException("theValue must not be null");
1315                }
1316                getServiceRequested().add(theValue);
1317                return this;
1318        }
1319
1320        /**
1321         * Gets the first repetition for <b>serviceRequested</b> (what),
1322         * creating it if it does not already exist.
1323         *
1324     * <p>
1325     * <b>Definition:</b>
1326     * The service(s) that is/are requested to be provided to the patient.  For example: cardiac pacemaker insertion
1327     * </p> 
1328         */
1329        public CodeableConceptDt getServiceRequestedFirstRep() {
1330                if (getServiceRequested().isEmpty()) {
1331                        return addServiceRequested();
1332                }
1333                return getServiceRequested().get(0); 
1334        }
1335  
1336        /**
1337         * Gets the value(s) for <b>supportingInformation</b> ().
1338         * creating it if it does
1339         * not exist. Will not return <code>null</code>.
1340         *
1341     * <p>
1342     * <b>Definition:</b>
1343     * Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.  For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan
1344     * </p> 
1345         */
1346        public java.util.List<ResourceReferenceDt> getSupportingInformation() {  
1347                if (mySupportingInformation == null) {
1348                        mySupportingInformation = new java.util.ArrayList<ResourceReferenceDt>();
1349                }
1350                return mySupportingInformation;
1351        }
1352
1353        /**
1354         * Sets the value(s) for <b>supportingInformation</b> ()
1355         *
1356     * <p>
1357     * <b>Definition:</b>
1358     * Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.  For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan
1359     * </p> 
1360         */
1361        public ReferralRequest setSupportingInformation(java.util.List<ResourceReferenceDt> theValue) {
1362                mySupportingInformation = theValue;
1363                return this;
1364        }
1365        
1366        
1367
1368        /**
1369         * Adds and returns a new value for <b>supportingInformation</b> ()
1370         *
1371     * <p>
1372     * <b>Definition:</b>
1373     * Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.  For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan
1374     * </p> 
1375         */
1376        public ResourceReferenceDt addSupportingInformation() {
1377                ResourceReferenceDt newType = new ResourceReferenceDt();
1378                getSupportingInformation().add(newType);
1379                return newType; 
1380        }
1381  
1382        /**
1383         * Gets the value(s) for <b>fulfillmentTime</b> (when.planned).
1384         * creating it if it does
1385         * not exist. Will not return <code>null</code>.
1386         *
1387     * <p>
1388     * <b>Definition:</b>
1389     * The period of time within which the services identified in the referral/transfer of care is specified or required to occur
1390     * </p> 
1391         */
1392        public PeriodDt getFulfillmentTime() {  
1393                if (myFulfillmentTime == null) {
1394                        myFulfillmentTime = new PeriodDt();
1395                }
1396                return myFulfillmentTime;
1397        }
1398
1399        /**
1400         * Sets the value(s) for <b>fulfillmentTime</b> (when.planned)
1401         *
1402     * <p>
1403     * <b>Definition:</b>
1404     * The period of time within which the services identified in the referral/transfer of care is specified or required to occur
1405     * </p> 
1406         */
1407        public ReferralRequest setFulfillmentTime(PeriodDt theValue) {
1408                myFulfillmentTime = theValue;
1409                return this;
1410        }
1411        
1412        
1413
1414  
1415
1416
1417    @Override
1418    public String getResourceName() {
1419        return "ReferralRequest";
1420    }
1421    
1422    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
1423        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
1424    }
1425
1426
1427}