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