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>CommunicationRequest</b> Resource
282 * ()
283 *
284 * <p>
285 * <b>Definition:</b>
286 * A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.
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/CommunicationRequest">http://hl7.org/fhir/profiles/CommunicationRequest</a> 
297 * </p>
298 *
299 */
300@ResourceDef(name="CommunicationRequest", profile="http://hl7.org/fhir/profiles/CommunicationRequest", id="communicationrequest")
301public class CommunicationRequest extends ca.uhn.fhir.model.dstu2.resource.BaseResource
302    implements  IResource     {
303
304        /**
305         * Search parameter constant for <b>identifier</b>
306         * <p>
307         * Description: <b></b><br>
308         * Type: <b>token</b><br>
309         * Path: <b>CommunicationRequest.identifier</b><br>
310         * </p>
311         */
312        @SearchParamDefinition(name="identifier", path="CommunicationRequest.identifier", description="", type="token"  )
313        public static final String SP_IDENTIFIER = "identifier";
314
315        /**
316         * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
317         * <p>
318         * Description: <b></b><br>
319         * Type: <b>token</b><br>
320         * Path: <b>CommunicationRequest.identifier</b><br>
321         * </p>
322         */
323        public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
324
325        /**
326         * Search parameter constant for <b>category</b>
327         * <p>
328         * Description: <b></b><br>
329         * Type: <b>token</b><br>
330         * Path: <b>CommunicationRequest.category</b><br>
331         * </p>
332         */
333        @SearchParamDefinition(name="category", path="CommunicationRequest.category", description="", type="token"  )
334        public static final String SP_CATEGORY = "category";
335
336        /**
337         * <b>Fluent Client</b> search parameter constant for <b>category</b>
338         * <p>
339         * Description: <b></b><br>
340         * Type: <b>token</b><br>
341         * Path: <b>CommunicationRequest.category</b><br>
342         * </p>
343         */
344        public static final TokenClientParam CATEGORY = new TokenClientParam(SP_CATEGORY);
345
346        /**
347         * Search parameter constant for <b>sender</b>
348         * <p>
349         * Description: <b></b><br>
350         * Type: <b>reference</b><br>
351         * Path: <b>CommunicationRequest.sender</b><br>
352         * </p>
353         */
354        @SearchParamDefinition(name="sender", path="CommunicationRequest.sender", description="", type="reference" , providesMembershipIn={
355 @Compartment(name="Patient") ,  @Compartment(name="RelatedPerson") ,  @Compartment(name="Practitioner") ,  @Compartment(name="Device")         }
356 )
357        public static final String SP_SENDER = "sender";
358
359        /**
360         * <b>Fluent Client</b> search parameter constant for <b>sender</b>
361         * <p>
362         * Description: <b></b><br>
363         * Type: <b>reference</b><br>
364         * Path: <b>CommunicationRequest.sender</b><br>
365         * </p>
366         */
367        public static final ReferenceClientParam SENDER = new ReferenceClientParam(SP_SENDER);
368
369        /**
370         * Search parameter constant for <b>recipient</b>
371         * <p>
372         * Description: <b></b><br>
373         * Type: <b>reference</b><br>
374         * Path: <b>CommunicationRequest.recipient</b><br>
375         * </p>
376         */
377        @SearchParamDefinition(name="recipient", path="CommunicationRequest.recipient", description="", type="reference" , providesMembershipIn={
378 @Compartment(name="Patient") ,  @Compartment(name="RelatedPerson") ,  @Compartment(name="Practitioner") ,  @Compartment(name="Device")         }
379 )
380        public static final String SP_RECIPIENT = "recipient";
381
382        /**
383         * <b>Fluent Client</b> search parameter constant for <b>recipient</b>
384         * <p>
385         * Description: <b></b><br>
386         * Type: <b>reference</b><br>
387         * Path: <b>CommunicationRequest.recipient</b><br>
388         * </p>
389         */
390        public static final ReferenceClientParam RECIPIENT = new ReferenceClientParam(SP_RECIPIENT);
391
392        /**
393         * Search parameter constant for <b>medium</b>
394         * <p>
395         * Description: <b></b><br>
396         * Type: <b>token</b><br>
397         * Path: <b>CommunicationRequest.medium</b><br>
398         * </p>
399         */
400        @SearchParamDefinition(name="medium", path="CommunicationRequest.medium", description="", type="token"  )
401        public static final String SP_MEDIUM = "medium";
402
403        /**
404         * <b>Fluent Client</b> search parameter constant for <b>medium</b>
405         * <p>
406         * Description: <b></b><br>
407         * Type: <b>token</b><br>
408         * Path: <b>CommunicationRequest.medium</b><br>
409         * </p>
410         */
411        public static final TokenClientParam MEDIUM = new TokenClientParam(SP_MEDIUM);
412
413        /**
414         * Search parameter constant for <b>requester</b>
415         * <p>
416         * Description: <b></b><br>
417         * Type: <b>reference</b><br>
418         * Path: <b>CommunicationRequest.requester</b><br>
419         * </p>
420         */
421        @SearchParamDefinition(name="requester", path="CommunicationRequest.requester", description="", type="reference" , providesMembershipIn={
422 @Compartment(name="Patient") ,  @Compartment(name="RelatedPerson") ,  @Compartment(name="Practitioner")        }
423 )
424        public static final String SP_REQUESTER = "requester";
425
426        /**
427         * <b>Fluent Client</b> search parameter constant for <b>requester</b>
428         * <p>
429         * Description: <b></b><br>
430         * Type: <b>reference</b><br>
431         * Path: <b>CommunicationRequest.requester</b><br>
432         * </p>
433         */
434        public static final ReferenceClientParam REQUESTER = new ReferenceClientParam(SP_REQUESTER);
435
436        /**
437         * Search parameter constant for <b>status</b>
438         * <p>
439         * Description: <b></b><br>
440         * Type: <b>token</b><br>
441         * Path: <b>CommunicationRequest.status</b><br>
442         * </p>
443         */
444        @SearchParamDefinition(name="status", path="CommunicationRequest.status", description="", type="token"  )
445        public static final String SP_STATUS = "status";
446
447        /**
448         * <b>Fluent Client</b> search parameter constant for <b>status</b>
449         * <p>
450         * Description: <b></b><br>
451         * Type: <b>token</b><br>
452         * Path: <b>CommunicationRequest.status</b><br>
453         * </p>
454         */
455        public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS);
456
457        /**
458         * Search parameter constant for <b>encounter</b>
459         * <p>
460         * Description: <b></b><br>
461         * Type: <b>reference</b><br>
462         * Path: <b>CommunicationRequest.encounter</b><br>
463         * </p>
464         */
465        @SearchParamDefinition(name="encounter", path="CommunicationRequest.encounter", description="", type="reference" , providesMembershipIn={
466 @Compartment(name="Encounter")         }
467 )
468        public static final String SP_ENCOUNTER = "encounter";
469
470        /**
471         * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
472         * <p>
473         * Description: <b></b><br>
474         * Type: <b>reference</b><br>
475         * Path: <b>CommunicationRequest.encounter</b><br>
476         * </p>
477         */
478        public static final ReferenceClientParam ENCOUNTER = new ReferenceClientParam(SP_ENCOUNTER);
479
480        /**
481         * Search parameter constant for <b>time</b>
482         * <p>
483         * Description: <b></b><br>
484         * Type: <b>date</b><br>
485         * Path: <b>CommunicationRequest.scheduledDateTime</b><br>
486         * </p>
487         */
488        @SearchParamDefinition(name="time", path="CommunicationRequest.scheduledDateTime", description="", type="date"  )
489        public static final String SP_TIME = "time";
490
491        /**
492         * <b>Fluent Client</b> search parameter constant for <b>time</b>
493         * <p>
494         * Description: <b></b><br>
495         * Type: <b>date</b><br>
496         * Path: <b>CommunicationRequest.scheduledDateTime</b><br>
497         * </p>
498         */
499        public static final DateClientParam TIME = new DateClientParam(SP_TIME);
500
501        /**
502         * Search parameter constant for <b>requested</b>
503         * <p>
504         * Description: <b></b><br>
505         * Type: <b>date</b><br>
506         * Path: <b>CommunicationRequest.requestedOn</b><br>
507         * </p>
508         */
509        @SearchParamDefinition(name="requested", path="CommunicationRequest.requestedOn", description="", type="date"  )
510        public static final String SP_REQUESTED = "requested";
511
512        /**
513         * <b>Fluent Client</b> search parameter constant for <b>requested</b>
514         * <p>
515         * Description: <b></b><br>
516         * Type: <b>date</b><br>
517         * Path: <b>CommunicationRequest.requestedOn</b><br>
518         * </p>
519         */
520        public static final DateClientParam REQUESTED = new DateClientParam(SP_REQUESTED);
521
522        /**
523         * Search parameter constant for <b>subject</b>
524         * <p>
525         * Description: <b></b><br>
526         * Type: <b>reference</b><br>
527         * Path: <b>CommunicationRequest.subject</b><br>
528         * </p>
529         */
530        @SearchParamDefinition(name="subject", path="CommunicationRequest.subject", description="", type="reference" , providesMembershipIn={
531 @Compartment(name="Patient")   }
532 )
533        public static final String SP_SUBJECT = "subject";
534
535        /**
536         * <b>Fluent Client</b> search parameter constant for <b>subject</b>
537         * <p>
538         * Description: <b></b><br>
539         * Type: <b>reference</b><br>
540         * Path: <b>CommunicationRequest.subject</b><br>
541         * </p>
542         */
543        public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT);
544
545        /**
546         * Search parameter constant for <b>priority</b>
547         * <p>
548         * Description: <b></b><br>
549         * Type: <b>token</b><br>
550         * Path: <b>CommunicationRequest.priority</b><br>
551         * </p>
552         */
553        @SearchParamDefinition(name="priority", path="CommunicationRequest.priority", description="", type="token"  )
554        public static final String SP_PRIORITY = "priority";
555
556        /**
557         * <b>Fluent Client</b> search parameter constant for <b>priority</b>
558         * <p>
559         * Description: <b></b><br>
560         * Type: <b>token</b><br>
561         * Path: <b>CommunicationRequest.priority</b><br>
562         * </p>
563         */
564        public static final TokenClientParam PRIORITY = new TokenClientParam(SP_PRIORITY);
565
566        /**
567         * Search parameter constant for <b>patient</b>
568         * <p>
569         * Description: <b></b><br>
570         * Type: <b>reference</b><br>
571         * Path: <b>CommunicationRequest.subject</b><br>
572         * </p>
573         */
574        @SearchParamDefinition(name="patient", path="CommunicationRequest.subject", description="", type="reference"  )
575        public static final String SP_PATIENT = "patient";
576
577        /**
578         * <b>Fluent Client</b> search parameter constant for <b>patient</b>
579         * <p>
580         * Description: <b></b><br>
581         * Type: <b>reference</b><br>
582         * Path: <b>CommunicationRequest.subject</b><br>
583         * </p>
584         */
585        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
586
587
588        /**
589         * Constant for fluent queries to be used to add include statements. Specifies
590         * the path value of "<b>CommunicationRequest:encounter</b>".
591         */
592        public static final Include INCLUDE_ENCOUNTER = new Include("CommunicationRequest:encounter");
593
594        /**
595         * Constant for fluent queries to be used to add include statements. Specifies
596         * the path value of "<b>CommunicationRequest:patient</b>".
597         */
598        public static final Include INCLUDE_PATIENT = new Include("CommunicationRequest:patient");
599
600        /**
601         * Constant for fluent queries to be used to add include statements. Specifies
602         * the path value of "<b>CommunicationRequest:recipient</b>".
603         */
604        public static final Include INCLUDE_RECIPIENT = new Include("CommunicationRequest:recipient");
605
606        /**
607         * Constant for fluent queries to be used to add include statements. Specifies
608         * the path value of "<b>CommunicationRequest:requester</b>".
609         */
610        public static final Include INCLUDE_REQUESTER = new Include("CommunicationRequest:requester");
611
612        /**
613         * Constant for fluent queries to be used to add include statements. Specifies
614         * the path value of "<b>CommunicationRequest:sender</b>".
615         */
616        public static final Include INCLUDE_SENDER = new Include("CommunicationRequest:sender");
617
618        /**
619         * Constant for fluent queries to be used to add include statements. Specifies
620         * the path value of "<b>CommunicationRequest:subject</b>".
621         */
622        public static final Include INCLUDE_SUBJECT = new Include("CommunicationRequest:subject");
623
624
625        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
626        @Description(
627                shortDefinition="",
628                formalDefinition="A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system."
629        )
630        private java.util.List<IdentifierDt> myIdentifier;
631        
632        @Child(name="category", type=CodeableConceptDt.class, order=1, min=0, max=1, summary=false, modifier=false)     
633        @Description(
634                shortDefinition="",
635                formalDefinition="The type of message to be sent such as alert, notification, reminder, instruction, etc."
636        )
637        private CodeableConceptDt myCategory;
638        
639        @Child(name="sender", order=2, min=0, max=1, summary=false, modifier=false, type={
640                ca.uhn.fhir.model.dstu2.resource.Device.class,          ca.uhn.fhir.model.dstu2.resource.Organization.class,            ca.uhn.fhir.model.dstu2.resource.Patient.class,                 ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.RelatedPerson.class    })
641        @Description(
642                shortDefinition="",
643                formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication"
644        )
645        private ResourceReferenceDt mySender;
646        
647        @Child(name="recipient", order=3, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
648                ca.uhn.fhir.model.dstu2.resource.Device.class,          ca.uhn.fhir.model.dstu2.resource.Organization.class,            ca.uhn.fhir.model.dstu2.resource.Patient.class,                 ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.RelatedPerson.class    })
649        @Description(
650                shortDefinition="",
651                formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication"
652        )
653        private java.util.List<ResourceReferenceDt> myRecipient;
654        
655        @Child(name="payload", order=4, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)  
656        @Description(
657                shortDefinition="",
658                formalDefinition="Text, attachment(s), or resource(s) to be communicated to the recipient"
659        )
660        private java.util.List<Payload> myPayload;
661        
662        @Child(name="medium", type=CodeableConceptDt.class, order=5, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)     
663        @Description(
664                shortDefinition="",
665                formalDefinition="A channel that was used for this communication (e.g. email, fax)."
666        )
667        private java.util.List<CodeableConceptDt> myMedium;
668        
669        @Child(name="requester", order=6, min=0, max=1, summary=false, modifier=false, type={
670                ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.Patient.class,                 ca.uhn.fhir.model.dstu2.resource.RelatedPerson.class    })
671        @Description(
672                shortDefinition="",
673                formalDefinition="The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application."
674        )
675        private ResourceReferenceDt myRequester;
676        
677        @Child(name="status", type=CodeDt.class, order=7, min=0, max=1, summary=false, modifier=true)   
678        @Description(
679                shortDefinition="",
680                formalDefinition="The status of the proposal or order."
681        )
682        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/communication-request-status")
683        private BoundCodeDt<CommunicationRequestStatusEnum> myStatus;
684        
685        @Child(name="encounter", order=8, min=0, max=1, summary=false, modifier=false, type={
686                ca.uhn.fhir.model.dstu2.resource.Encounter.class        })
687        @Description(
688                shortDefinition="",
689                formalDefinition="The encounter within which the communication request was created."
690        )
691        private ResourceReferenceDt myEncounter;
692        
693        @Child(name="scheduled", order=9, min=0, max=1, summary=false, modifier=false, type={
694                DateTimeDt.class,               PeriodDt.class  })
695        @Description(
696                shortDefinition="",
697                formalDefinition="The time when this communication is to occur."
698        )
699        private IDatatype myScheduled;
700        
701        @Child(name="reason", type=CodeableConceptDt.class, order=10, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)    
702        @Description(
703                shortDefinition="",
704                formalDefinition="The reason or justification for the communication request."
705        )
706        private java.util.List<CodeableConceptDt> myReason;
707        
708        @Child(name="requestedOn", type=DateTimeDt.class, order=11, min=0, max=1, summary=false, modifier=false)        
709        @Description(
710                shortDefinition="",
711                formalDefinition="The time when the request was made."
712        )
713        private DateTimeDt myRequestedOn;
714        
715        @Child(name="subject", order=12, min=0, max=1, summary=false, modifier=false, type={
716                ca.uhn.fhir.model.dstu2.resource.Patient.class  })
717        @Description(
718                shortDefinition="",
719                formalDefinition="The patient who is the focus of this communication request."
720        )
721        private ResourceReferenceDt mySubject;
722        
723        @Child(name="priority", type=CodeableConceptDt.class, order=13, min=0, max=1, summary=false, modifier=false)    
724        @Description(
725                shortDefinition="",
726                formalDefinition="Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine."
727        )
728        private CodeableConceptDt myPriority;
729        
730
731        @Override
732        public boolean isEmpty() {
733                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myCategory,  mySender,  myRecipient,  myPayload,  myMedium,  myRequester,  myStatus,  myEncounter,  myScheduled,  myReason,  myRequestedOn,  mySubject,  myPriority);
734        }
735        
736        @Override
737        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
738                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myCategory, mySender, myRecipient, myPayload, myMedium, myRequester, myStatus, myEncounter, myScheduled, myReason, myRequestedOn, mySubject, myPriority);
739        }
740
741        /**
742         * Gets the value(s) for <b>identifier</b> ().
743         * creating it if it does
744         * not exist. Will not return <code>null</code>.
745         *
746     * <p>
747     * <b>Definition:</b>
748     * A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system.
749     * </p> 
750         */
751        public java.util.List<IdentifierDt> getIdentifier() {  
752                if (myIdentifier == null) {
753                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
754                }
755                return myIdentifier;
756        }
757
758        /**
759         * Sets the value(s) for <b>identifier</b> ()
760         *
761     * <p>
762     * <b>Definition:</b>
763     * A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system.
764     * </p> 
765         */
766        public CommunicationRequest setIdentifier(java.util.List<IdentifierDt> theValue) {
767                myIdentifier = theValue;
768                return this;
769        }
770        
771        
772
773        /**
774         * Adds and returns a new value for <b>identifier</b> ()
775         *
776     * <p>
777     * <b>Definition:</b>
778     * A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system.
779     * </p> 
780         */
781        public IdentifierDt addIdentifier() {
782                IdentifierDt newType = new IdentifierDt();
783                getIdentifier().add(newType);
784                return newType; 
785        }
786
787        /**
788         * Adds a given new value for <b>identifier</b> ()
789         *
790         * <p>
791         * <b>Definition:</b>
792         * A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system.
793         * </p>
794         * @param theValue The identifier to add (must not be <code>null</code>)
795         */
796        public CommunicationRequest addIdentifier(IdentifierDt theValue) {
797                if (theValue == null) {
798                        throw new NullPointerException("theValue must not be null");
799                }
800                getIdentifier().add(theValue);
801                return this;
802        }
803
804        /**
805         * Gets the first repetition for <b>identifier</b> (),
806         * creating it if it does not already exist.
807         *
808     * <p>
809     * <b>Definition:</b>
810     * A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system.
811     * </p> 
812         */
813        public IdentifierDt getIdentifierFirstRep() {
814                if (getIdentifier().isEmpty()) {
815                        return addIdentifier();
816                }
817                return getIdentifier().get(0); 
818        }
819  
820        /**
821         * Gets the value(s) for <b>category</b> ().
822         * creating it if it does
823         * not exist. Will not return <code>null</code>.
824         *
825     * <p>
826     * <b>Definition:</b>
827     * The type of message to be sent such as alert, notification, reminder, instruction, etc.
828     * </p> 
829         */
830        public CodeableConceptDt getCategory() {  
831                if (myCategory == null) {
832                        myCategory = new CodeableConceptDt();
833                }
834                return myCategory;
835        }
836
837        /**
838         * Sets the value(s) for <b>category</b> ()
839         *
840     * <p>
841     * <b>Definition:</b>
842     * The type of message to be sent such as alert, notification, reminder, instruction, etc.
843     * </p> 
844         */
845        public CommunicationRequest setCategory(CodeableConceptDt theValue) {
846                myCategory = theValue;
847                return this;
848        }
849        
850        
851
852  
853        /**
854         * Gets the value(s) for <b>sender</b> ().
855         * creating it if it does
856         * not exist. Will not return <code>null</code>.
857         *
858     * <p>
859     * <b>Definition:</b>
860     * The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication
861     * </p> 
862         */
863        public ResourceReferenceDt getSender() {  
864                if (mySender == null) {
865                        mySender = new ResourceReferenceDt();
866                }
867                return mySender;
868        }
869
870        /**
871         * Sets the value(s) for <b>sender</b> ()
872         *
873     * <p>
874     * <b>Definition:</b>
875     * The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication
876     * </p> 
877         */
878        public CommunicationRequest setSender(ResourceReferenceDt theValue) {
879                mySender = theValue;
880                return this;
881        }
882        
883        
884
885  
886        /**
887         * Gets the value(s) for <b>recipient</b> ().
888         * creating it if it does
889         * not exist. Will not return <code>null</code>.
890         *
891     * <p>
892     * <b>Definition:</b>
893     * The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication
894     * </p> 
895         */
896        public java.util.List<ResourceReferenceDt> getRecipient() {  
897                if (myRecipient == null) {
898                        myRecipient = new java.util.ArrayList<ResourceReferenceDt>();
899                }
900                return myRecipient;
901        }
902
903        /**
904         * Sets the value(s) for <b>recipient</b> ()
905         *
906     * <p>
907     * <b>Definition:</b>
908     * The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication
909     * </p> 
910         */
911        public CommunicationRequest setRecipient(java.util.List<ResourceReferenceDt> theValue) {
912                myRecipient = theValue;
913                return this;
914        }
915        
916        
917
918        /**
919         * Adds and returns a new value for <b>recipient</b> ()
920         *
921     * <p>
922     * <b>Definition:</b>
923     * The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication
924     * </p> 
925         */
926        public ResourceReferenceDt addRecipient() {
927                ResourceReferenceDt newType = new ResourceReferenceDt();
928                getRecipient().add(newType);
929                return newType; 
930        }
931  
932        /**
933         * Gets the value(s) for <b>payload</b> ().
934         * creating it if it does
935         * not exist. Will not return <code>null</code>.
936         *
937     * <p>
938     * <b>Definition:</b>
939     * Text, attachment(s), or resource(s) to be communicated to the recipient
940     * </p> 
941         */
942        public java.util.List<Payload> getPayload() {  
943                if (myPayload == null) {
944                        myPayload = new java.util.ArrayList<Payload>();
945                }
946                return myPayload;
947        }
948
949        /**
950         * Sets the value(s) for <b>payload</b> ()
951         *
952     * <p>
953     * <b>Definition:</b>
954     * Text, attachment(s), or resource(s) to be communicated to the recipient
955     * </p> 
956         */
957        public CommunicationRequest setPayload(java.util.List<Payload> theValue) {
958                myPayload = theValue;
959                return this;
960        }
961        
962        
963
964        /**
965         * Adds and returns a new value for <b>payload</b> ()
966         *
967     * <p>
968     * <b>Definition:</b>
969     * Text, attachment(s), or resource(s) to be communicated to the recipient
970     * </p> 
971         */
972        public Payload addPayload() {
973                Payload newType = new Payload();
974                getPayload().add(newType);
975                return newType; 
976        }
977
978        /**
979         * Adds a given new value for <b>payload</b> ()
980         *
981         * <p>
982         * <b>Definition:</b>
983         * Text, attachment(s), or resource(s) to be communicated to the recipient
984         * </p>
985         * @param theValue The payload to add (must not be <code>null</code>)
986         */
987        public CommunicationRequest addPayload(Payload theValue) {
988                if (theValue == null) {
989                        throw new NullPointerException("theValue must not be null");
990                }
991                getPayload().add(theValue);
992                return this;
993        }
994
995        /**
996         * Gets the first repetition for <b>payload</b> (),
997         * creating it if it does not already exist.
998         *
999     * <p>
1000     * <b>Definition:</b>
1001     * Text, attachment(s), or resource(s) to be communicated to the recipient
1002     * </p> 
1003         */
1004        public Payload getPayloadFirstRep() {
1005                if (getPayload().isEmpty()) {
1006                        return addPayload();
1007                }
1008                return getPayload().get(0); 
1009        }
1010  
1011        /**
1012         * Gets the value(s) for <b>medium</b> ().
1013         * creating it if it does
1014         * not exist. Will not return <code>null</code>.
1015         *
1016     * <p>
1017     * <b>Definition:</b>
1018     * A channel that was used for this communication (e.g. email, fax).
1019     * </p> 
1020         */
1021        public java.util.List<CodeableConceptDt> getMedium() {  
1022                if (myMedium == null) {
1023                        myMedium = new java.util.ArrayList<CodeableConceptDt>();
1024                }
1025                return myMedium;
1026        }
1027
1028        /**
1029         * Sets the value(s) for <b>medium</b> ()
1030         *
1031     * <p>
1032     * <b>Definition:</b>
1033     * A channel that was used for this communication (e.g. email, fax).
1034     * </p> 
1035         */
1036        public CommunicationRequest setMedium(java.util.List<CodeableConceptDt> theValue) {
1037                myMedium = theValue;
1038                return this;
1039        }
1040        
1041        
1042
1043        /**
1044         * Adds and returns a new value for <b>medium</b> ()
1045         *
1046     * <p>
1047     * <b>Definition:</b>
1048     * A channel that was used for this communication (e.g. email, fax).
1049     * </p> 
1050         */
1051        public CodeableConceptDt addMedium() {
1052                CodeableConceptDt newType = new CodeableConceptDt();
1053                getMedium().add(newType);
1054                return newType; 
1055        }
1056
1057        /**
1058         * Adds a given new value for <b>medium</b> ()
1059         *
1060         * <p>
1061         * <b>Definition:</b>
1062         * A channel that was used for this communication (e.g. email, fax).
1063         * </p>
1064         * @param theValue The medium to add (must not be <code>null</code>)
1065         */
1066        public CommunicationRequest addMedium(CodeableConceptDt theValue) {
1067                if (theValue == null) {
1068                        throw new NullPointerException("theValue must not be null");
1069                }
1070                getMedium().add(theValue);
1071                return this;
1072        }
1073
1074        /**
1075         * Gets the first repetition for <b>medium</b> (),
1076         * creating it if it does not already exist.
1077         *
1078     * <p>
1079     * <b>Definition:</b>
1080     * A channel that was used for this communication (e.g. email, fax).
1081     * </p> 
1082         */
1083        public CodeableConceptDt getMediumFirstRep() {
1084                if (getMedium().isEmpty()) {
1085                        return addMedium();
1086                }
1087                return getMedium().get(0); 
1088        }
1089  
1090        /**
1091         * Gets the value(s) for <b>requester</b> ().
1092         * creating it if it does
1093         * not exist. Will not return <code>null</code>.
1094         *
1095     * <p>
1096     * <b>Definition:</b>
1097     * The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.
1098     * </p> 
1099         */
1100        public ResourceReferenceDt getRequester() {  
1101                if (myRequester == null) {
1102                        myRequester = new ResourceReferenceDt();
1103                }
1104                return myRequester;
1105        }
1106
1107        /**
1108         * Sets the value(s) for <b>requester</b> ()
1109         *
1110     * <p>
1111     * <b>Definition:</b>
1112     * The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.
1113     * </p> 
1114         */
1115        public CommunicationRequest setRequester(ResourceReferenceDt theValue) {
1116                myRequester = theValue;
1117                return this;
1118        }
1119        
1120        
1121
1122  
1123        /**
1124         * Gets the value(s) for <b>status</b> ().
1125         * creating it if it does
1126         * not exist. Will not return <code>null</code>.
1127         *
1128     * <p>
1129     * <b>Definition:</b>
1130     * The status of the proposal or order.
1131     * </p> 
1132         */
1133        public BoundCodeDt<CommunicationRequestStatusEnum> getStatusElement() {  
1134                if (myStatus == null) {
1135                        myStatus = new BoundCodeDt<CommunicationRequestStatusEnum>(CommunicationRequestStatusEnum.VALUESET_BINDER);
1136                }
1137                return myStatus;
1138        }
1139
1140        
1141        /**
1142         * Gets the value(s) for <b>status</b> ().
1143         * creating it if it does
1144         * not exist. This method may return <code>null</code>.
1145         *
1146     * <p>
1147     * <b>Definition:</b>
1148     * The status of the proposal or order.
1149     * </p> 
1150         */
1151        public String getStatus() {  
1152                return getStatusElement().getValue();
1153        }
1154
1155        /**
1156         * Sets the value(s) for <b>status</b> ()
1157         *
1158     * <p>
1159     * <b>Definition:</b>
1160     * The status of the proposal or order.
1161     * </p> 
1162         */
1163        public CommunicationRequest setStatus(BoundCodeDt<CommunicationRequestStatusEnum> theValue) {
1164                myStatus = theValue;
1165                return this;
1166        }
1167        
1168        
1169
1170        /**
1171         * Sets the value(s) for <b>status</b> ()
1172         *
1173     * <p>
1174     * <b>Definition:</b>
1175     * The status of the proposal or order.
1176     * </p> 
1177         */
1178        public CommunicationRequest setStatus(CommunicationRequestStatusEnum theValue) {
1179                setStatus(new BoundCodeDt<CommunicationRequestStatusEnum>(CommunicationRequestStatusEnum.VALUESET_BINDER, theValue));
1180                
1181/*
1182                getStatusElement().setValueAsEnum(theValue);
1183*/
1184                return this;
1185        }
1186
1187  
1188        /**
1189         * Gets the value(s) for <b>encounter</b> ().
1190         * creating it if it does
1191         * not exist. Will not return <code>null</code>.
1192         *
1193     * <p>
1194     * <b>Definition:</b>
1195     * The encounter within which the communication request was created.
1196     * </p> 
1197         */
1198        public ResourceReferenceDt getEncounter() {  
1199                if (myEncounter == null) {
1200                        myEncounter = new ResourceReferenceDt();
1201                }
1202                return myEncounter;
1203        }
1204
1205        /**
1206         * Sets the value(s) for <b>encounter</b> ()
1207         *
1208     * <p>
1209     * <b>Definition:</b>
1210     * The encounter within which the communication request was created.
1211     * </p> 
1212         */
1213        public CommunicationRequest setEncounter(ResourceReferenceDt theValue) {
1214                myEncounter = theValue;
1215                return this;
1216        }
1217        
1218        
1219
1220  
1221        /**
1222         * Gets the value(s) for <b>scheduled[x]</b> ().
1223         * creating it if it does
1224         * not exist. Will not return <code>null</code>.
1225         *
1226     * <p>
1227     * <b>Definition:</b>
1228     * The time when this communication is to occur.
1229     * </p> 
1230         */
1231        public IDatatype getScheduled() {  
1232                return myScheduled;
1233        }
1234
1235        /**
1236         * Sets the value(s) for <b>scheduled[x]</b> ()
1237         *
1238     * <p>
1239     * <b>Definition:</b>
1240     * The time when this communication is to occur.
1241     * </p> 
1242         */
1243        public CommunicationRequest setScheduled(IDatatype theValue) {
1244                myScheduled = theValue;
1245                return this;
1246        }
1247        
1248        
1249
1250  
1251        /**
1252         * Gets the value(s) for <b>reason</b> ().
1253         * creating it if it does
1254         * not exist. Will not return <code>null</code>.
1255         *
1256     * <p>
1257     * <b>Definition:</b>
1258     * The reason or justification for the communication request.
1259     * </p> 
1260         */
1261        public java.util.List<CodeableConceptDt> getReason() {  
1262                if (myReason == null) {
1263                        myReason = new java.util.ArrayList<CodeableConceptDt>();
1264                }
1265                return myReason;
1266        }
1267
1268        /**
1269         * Sets the value(s) for <b>reason</b> ()
1270         *
1271     * <p>
1272     * <b>Definition:</b>
1273     * The reason or justification for the communication request.
1274     * </p> 
1275         */
1276        public CommunicationRequest setReason(java.util.List<CodeableConceptDt> theValue) {
1277                myReason = theValue;
1278                return this;
1279        }
1280        
1281        
1282
1283        /**
1284         * Adds and returns a new value for <b>reason</b> ()
1285         *
1286     * <p>
1287     * <b>Definition:</b>
1288     * The reason or justification for the communication request.
1289     * </p> 
1290         */
1291        public CodeableConceptDt addReason() {
1292                CodeableConceptDt newType = new CodeableConceptDt();
1293                getReason().add(newType);
1294                return newType; 
1295        }
1296
1297        /**
1298         * Adds a given new value for <b>reason</b> ()
1299         *
1300         * <p>
1301         * <b>Definition:</b>
1302         * The reason or justification for the communication request.
1303         * </p>
1304         * @param theValue The reason to add (must not be <code>null</code>)
1305         */
1306        public CommunicationRequest addReason(CodeableConceptDt theValue) {
1307                if (theValue == null) {
1308                        throw new NullPointerException("theValue must not be null");
1309                }
1310                getReason().add(theValue);
1311                return this;
1312        }
1313
1314        /**
1315         * Gets the first repetition for <b>reason</b> (),
1316         * creating it if it does not already exist.
1317         *
1318     * <p>
1319     * <b>Definition:</b>
1320     * The reason or justification for the communication request.
1321     * </p> 
1322         */
1323        public CodeableConceptDt getReasonFirstRep() {
1324                if (getReason().isEmpty()) {
1325                        return addReason();
1326                }
1327                return getReason().get(0); 
1328        }
1329  
1330        /**
1331         * Gets the value(s) for <b>requestedOn</b> ().
1332         * creating it if it does
1333         * not exist. Will not return <code>null</code>.
1334         *
1335     * <p>
1336     * <b>Definition:</b>
1337     * The time when the request was made.
1338     * </p> 
1339         */
1340        public DateTimeDt getRequestedOnElement() {  
1341                if (myRequestedOn == null) {
1342                        myRequestedOn = new DateTimeDt();
1343                }
1344                return myRequestedOn;
1345        }
1346
1347        
1348        /**
1349         * Gets the value(s) for <b>requestedOn</b> ().
1350         * creating it if it does
1351         * not exist. This method may return <code>null</code>.
1352         *
1353     * <p>
1354     * <b>Definition:</b>
1355     * The time when the request was made.
1356     * </p> 
1357         */
1358        public Date getRequestedOn() {  
1359                return getRequestedOnElement().getValue();
1360        }
1361
1362        /**
1363         * Sets the value(s) for <b>requestedOn</b> ()
1364         *
1365     * <p>
1366     * <b>Definition:</b>
1367     * The time when the request was made.
1368     * </p> 
1369         */
1370        public CommunicationRequest setRequestedOn(DateTimeDt theValue) {
1371                myRequestedOn = theValue;
1372                return this;
1373        }
1374        
1375        
1376
1377        /**
1378         * Sets the value for <b>requestedOn</b> ()
1379         *
1380     * <p>
1381     * <b>Definition:</b>
1382     * The time when the request was made.
1383     * </p> 
1384         */
1385        public CommunicationRequest setRequestedOn( Date theDate,  TemporalPrecisionEnum thePrecision) {
1386                myRequestedOn = new DateTimeDt(theDate, thePrecision); 
1387                return this; 
1388        }
1389
1390        /**
1391         * Sets the value for <b>requestedOn</b> ()
1392         *
1393     * <p>
1394     * <b>Definition:</b>
1395     * The time when the request was made.
1396     * </p> 
1397         */
1398        public CommunicationRequest setRequestedOnWithSecondsPrecision( Date theDate) {
1399                myRequestedOn = new DateTimeDt(theDate); 
1400                return this; 
1401        }
1402
1403 
1404        /**
1405         * Gets the value(s) for <b>subject</b> ().
1406         * creating it if it does
1407         * not exist. Will not return <code>null</code>.
1408         *
1409     * <p>
1410     * <b>Definition:</b>
1411     * The patient who is the focus of this communication request.
1412     * </p> 
1413         */
1414        public ResourceReferenceDt getSubject() {  
1415                if (mySubject == null) {
1416                        mySubject = new ResourceReferenceDt();
1417                }
1418                return mySubject;
1419        }
1420
1421        /**
1422         * Sets the value(s) for <b>subject</b> ()
1423         *
1424     * <p>
1425     * <b>Definition:</b>
1426     * The patient who is the focus of this communication request.
1427     * </p> 
1428         */
1429        public CommunicationRequest setSubject(ResourceReferenceDt theValue) {
1430                mySubject = theValue;
1431                return this;
1432        }
1433        
1434        
1435
1436  
1437        /**
1438         * Gets the value(s) for <b>priority</b> ().
1439         * creating it if it does
1440         * not exist. Will not return <code>null</code>.
1441         *
1442     * <p>
1443     * <b>Definition:</b>
1444     * Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.
1445     * </p> 
1446         */
1447        public CodeableConceptDt getPriority() {  
1448                if (myPriority == null) {
1449                        myPriority = new CodeableConceptDt();
1450                }
1451                return myPriority;
1452        }
1453
1454        /**
1455         * Sets the value(s) for <b>priority</b> ()
1456         *
1457     * <p>
1458     * <b>Definition:</b>
1459     * Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.
1460     * </p> 
1461         */
1462        public CommunicationRequest setPriority(CodeableConceptDt theValue) {
1463                myPriority = theValue;
1464                return this;
1465        }
1466        
1467        
1468
1469  
1470        /**
1471         * Block class for child element: <b>CommunicationRequest.payload</b> ()
1472         *
1473     * <p>
1474     * <b>Definition:</b>
1475     * Text, attachment(s), or resource(s) to be communicated to the recipient
1476     * </p> 
1477         */
1478        @Block()        
1479        public static class Payload 
1480            extends  BaseIdentifiableElement        implements IResourceBlock {
1481        
1482        @Child(name="content", order=0, min=1, max=1, summary=false, modifier=false, type={
1483                StringDt.class,                 AttachmentDt.class,             IResource.class })
1484        @Description(
1485                shortDefinition="",
1486                formalDefinition="The communicated content (or for multi-part communications, one portion of the communication)"
1487        )
1488        private IDatatype myContent;
1489        
1490
1491        @Override
1492        public boolean isEmpty() {
1493                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myContent);
1494        }
1495        
1496        @Override
1497        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1498                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myContent);
1499        }
1500
1501        /**
1502         * Gets the value(s) for <b>content[x]</b> ().
1503         * creating it if it does
1504         * not exist. Will not return <code>null</code>.
1505         *
1506     * <p>
1507     * <b>Definition:</b>
1508     * The communicated content (or for multi-part communications, one portion of the communication)
1509     * </p> 
1510         */
1511        public IDatatype getContent() {  
1512                return myContent;
1513        }
1514
1515        /**
1516         * Sets the value(s) for <b>content[x]</b> ()
1517         *
1518     * <p>
1519     * <b>Definition:</b>
1520     * The communicated content (or for multi-part communications, one portion of the communication)
1521     * </p> 
1522         */
1523        public Payload setContent(IDatatype theValue) {
1524                myContent = theValue;
1525                return this;
1526        }
1527        
1528        
1529
1530  
1531
1532
1533        }
1534
1535
1536
1537
1538    @Override
1539    public String getResourceName() {
1540        return "CommunicationRequest";
1541    }
1542    
1543    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
1544        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
1545    }
1546
1547
1548}