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>Patient</b> Resource
282 * (administrative.individual)
283 *
284 * <p>
285 * <b>Definition:</b>
286 * Demographics and other administrative information about an individual or animal receiving care or other health-related services.
287 * </p> 
288 *
289 * <p>
290 * <b>Requirements:</b>
291 * Tracking patient is the center of the healthcare process
292 * </p> 
293 *
294 * <p>
295 * <b>Profile Definition:</b>
296 * <a href="http://hl7.org/fhir/profiles/Patient">http://hl7.org/fhir/profiles/Patient</a> 
297 * </p>
298 *
299 */
300@ResourceDef(name="Patient", profile="http://hl7.org/fhir/profiles/Patient", id="patient")
301public class Patient 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>A patient identifier</b><br>
308         * Type: <b>token</b><br>
309         * Path: <b>Patient.identifier</b><br>
310         * </p>
311         */
312        @SearchParamDefinition(name="identifier", path="Patient.identifier", description="A patient identifier", 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>A patient identifier</b><br>
319         * Type: <b>token</b><br>
320         * Path: <b>Patient.identifier</b><br>
321         * </p>
322         */
323        public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
324
325        /**
326         * Search parameter constant for <b>name</b>
327         * <p>
328         * Description: <b>A portion of either family or given name of the patient</b><br>
329         * Type: <b>string</b><br>
330         * Path: <b>Patient.name</b><br>
331         * </p>
332         */
333        @SearchParamDefinition(name="name", path="Patient.name", description="A portion of either family or given name of the patient", type="string"  )
334        public static final String SP_NAME = "name";
335
336        /**
337         * <b>Fluent Client</b> search parameter constant for <b>name</b>
338         * <p>
339         * Description: <b>A portion of either family or given name of the patient</b><br>
340         * Type: <b>string</b><br>
341         * Path: <b>Patient.name</b><br>
342         * </p>
343         */
344        public static final StringClientParam NAME = new StringClientParam(SP_NAME);
345
346        /**
347         * Search parameter constant for <b>family</b>
348         * <p>
349         * Description: <b>A portion of the family name of the patient</b><br>
350         * Type: <b>string</b><br>
351         * Path: <b>Patient.name.family</b><br>
352         * </p>
353         */
354        @SearchParamDefinition(name="family", path="Patient.name.family", description="A portion of the family name of the patient", type="string"  )
355        public static final String SP_FAMILY = "family";
356
357        /**
358         * <b>Fluent Client</b> search parameter constant for <b>family</b>
359         * <p>
360         * Description: <b>A portion of the family name of the patient</b><br>
361         * Type: <b>string</b><br>
362         * Path: <b>Patient.name.family</b><br>
363         * </p>
364         */
365        public static final StringClientParam FAMILY = new StringClientParam(SP_FAMILY);
366
367        /**
368         * Search parameter constant for <b>given</b>
369         * <p>
370         * Description: <b>A portion of the given name of the patient</b><br>
371         * Type: <b>string</b><br>
372         * Path: <b>Patient.name.given</b><br>
373         * </p>
374         */
375        @SearchParamDefinition(name="given", path="Patient.name.given", description="A portion of the given name of the patient", type="string"  )
376        public static final String SP_GIVEN = "given";
377
378        /**
379         * <b>Fluent Client</b> search parameter constant for <b>given</b>
380         * <p>
381         * Description: <b>A portion of the given name of the patient</b><br>
382         * Type: <b>string</b><br>
383         * Path: <b>Patient.name.given</b><br>
384         * </p>
385         */
386        public static final StringClientParam GIVEN = new StringClientParam(SP_GIVEN);
387
388        /**
389         * Search parameter constant for <b>phonetic</b>
390         * <p>
391         * Description: <b>A portion of either family or given name using some kind of phonetic matching algorithm</b><br>
392         * Type: <b>string</b><br>
393         * Path: <b>Patient.name</b><br>
394         * </p>
395         */
396        @SearchParamDefinition(name="phonetic", path="Patient.name", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string"  )
397        public static final String SP_PHONETIC = "phonetic";
398
399        /**
400         * <b>Fluent Client</b> search parameter constant for <b>phonetic</b>
401         * <p>
402         * Description: <b>A portion of either family or given name using some kind of phonetic matching algorithm</b><br>
403         * Type: <b>string</b><br>
404         * Path: <b>Patient.name</b><br>
405         * </p>
406         */
407        public static final StringClientParam PHONETIC = new StringClientParam(SP_PHONETIC);
408
409        /**
410         * Search parameter constant for <b>telecom</b>
411         * <p>
412         * Description: <b>The value in any kind of telecom details of the patient</b><br>
413         * Type: <b>token</b><br>
414         * Path: <b>Patient.telecom</b><br>
415         * </p>
416         */
417        @SearchParamDefinition(name="telecom", path="Patient.telecom", description="The value in any kind of telecom details of the patient", type="token"  )
418        public static final String SP_TELECOM = "telecom";
419
420        /**
421         * <b>Fluent Client</b> search parameter constant for <b>telecom</b>
422         * <p>
423         * Description: <b>The value in any kind of telecom details of the patient</b><br>
424         * Type: <b>token</b><br>
425         * Path: <b>Patient.telecom</b><br>
426         * </p>
427         */
428        public static final TokenClientParam TELECOM = new TokenClientParam(SP_TELECOM);
429
430        /**
431         * Search parameter constant for <b>phone</b>
432         * <p>
433         * Description: <b>A value in a phone contact</b><br>
434         * Type: <b>token</b><br>
435         * Path: <b>Patient.telecom(system=phone)</b><br>
436         * </p>
437         */
438        @SearchParamDefinition(name="phone", path="Patient.telecom(system=phone)", description="A value in a phone contact", type="token"  )
439        public static final String SP_PHONE = "phone";
440
441        /**
442         * <b>Fluent Client</b> search parameter constant for <b>phone</b>
443         * <p>
444         * Description: <b>A value in a phone contact</b><br>
445         * Type: <b>token</b><br>
446         * Path: <b>Patient.telecom(system=phone)</b><br>
447         * </p>
448         */
449        public static final TokenClientParam PHONE = new TokenClientParam(SP_PHONE);
450
451        /**
452         * Search parameter constant for <b>email</b>
453         * <p>
454         * Description: <b>A value in an email contact</b><br>
455         * Type: <b>token</b><br>
456         * Path: <b>Patient.telecom(system=email)</b><br>
457         * </p>
458         */
459        @SearchParamDefinition(name="email", path="Patient.telecom(system=email)", description="A value in an email contact", type="token"  )
460        public static final String SP_EMAIL = "email";
461
462        /**
463         * <b>Fluent Client</b> search parameter constant for <b>email</b>
464         * <p>
465         * Description: <b>A value in an email contact</b><br>
466         * Type: <b>token</b><br>
467         * Path: <b>Patient.telecom(system=email)</b><br>
468         * </p>
469         */
470        public static final TokenClientParam EMAIL = new TokenClientParam(SP_EMAIL);
471
472        /**
473         * Search parameter constant for <b>address</b>
474         * <p>
475         * Description: <b>An address in any kind of address/part of the patient</b><br>
476         * Type: <b>string</b><br>
477         * Path: <b>Patient.address</b><br>
478         * </p>
479         */
480        @SearchParamDefinition(name="address", path="Patient.address", description="An address in any kind of address/part of the patient", type="string"  )
481        public static final String SP_ADDRESS = "address";
482
483        /**
484         * <b>Fluent Client</b> search parameter constant for <b>address</b>
485         * <p>
486         * Description: <b>An address in any kind of address/part of the patient</b><br>
487         * Type: <b>string</b><br>
488         * Path: <b>Patient.address</b><br>
489         * </p>
490         */
491        public static final StringClientParam ADDRESS = new StringClientParam(SP_ADDRESS);
492
493        /**
494         * Search parameter constant for <b>address-city</b>
495         * <p>
496         * Description: <b>A city specified in an address</b><br>
497         * Type: <b>string</b><br>
498         * Path: <b>Patient.address.city</b><br>
499         * </p>
500         */
501        @SearchParamDefinition(name="address-city", path="Patient.address.city", description="A city specified in an address", type="string"  )
502        public static final String SP_ADDRESS_CITY = "address-city";
503
504        /**
505         * <b>Fluent Client</b> search parameter constant for <b>address-city</b>
506         * <p>
507         * Description: <b>A city specified in an address</b><br>
508         * Type: <b>string</b><br>
509         * Path: <b>Patient.address.city</b><br>
510         * </p>
511         */
512        public static final StringClientParam ADDRESS_CITY = new StringClientParam(SP_ADDRESS_CITY);
513
514        /**
515         * Search parameter constant for <b>address-state</b>
516         * <p>
517         * Description: <b>A state specified in an address</b><br>
518         * Type: <b>string</b><br>
519         * Path: <b>Patient.address.state</b><br>
520         * </p>
521         */
522        @SearchParamDefinition(name="address-state", path="Patient.address.state", description="A state specified in an address", type="string"  )
523        public static final String SP_ADDRESS_STATE = "address-state";
524
525        /**
526         * <b>Fluent Client</b> search parameter constant for <b>address-state</b>
527         * <p>
528         * Description: <b>A state specified in an address</b><br>
529         * Type: <b>string</b><br>
530         * Path: <b>Patient.address.state</b><br>
531         * </p>
532         */
533        public static final StringClientParam ADDRESS_STATE = new StringClientParam(SP_ADDRESS_STATE);
534
535        /**
536         * Search parameter constant for <b>address-postalcode</b>
537         * <p>
538         * Description: <b>A postalCode specified in an address</b><br>
539         * Type: <b>string</b><br>
540         * Path: <b>Patient.address.postalCode</b><br>
541         * </p>
542         */
543        @SearchParamDefinition(name="address-postalcode", path="Patient.address.postalCode", description="A postalCode specified in an address", type="string"  )
544        public static final String SP_ADDRESS_POSTALCODE = "address-postalcode";
545
546        /**
547         * <b>Fluent Client</b> search parameter constant for <b>address-postalcode</b>
548         * <p>
549         * Description: <b>A postalCode specified in an address</b><br>
550         * Type: <b>string</b><br>
551         * Path: <b>Patient.address.postalCode</b><br>
552         * </p>
553         */
554        public static final StringClientParam ADDRESS_POSTALCODE = new StringClientParam(SP_ADDRESS_POSTALCODE);
555
556        /**
557         * Search parameter constant for <b>address-country</b>
558         * <p>
559         * Description: <b>A country specified in an address</b><br>
560         * Type: <b>string</b><br>
561         * Path: <b>Patient.address.country</b><br>
562         * </p>
563         */
564        @SearchParamDefinition(name="address-country", path="Patient.address.country", description="A country specified in an address", type="string"  )
565        public static final String SP_ADDRESS_COUNTRY = "address-country";
566
567        /**
568         * <b>Fluent Client</b> search parameter constant for <b>address-country</b>
569         * <p>
570         * Description: <b>A country specified in an address</b><br>
571         * Type: <b>string</b><br>
572         * Path: <b>Patient.address.country</b><br>
573         * </p>
574         */
575        public static final StringClientParam ADDRESS_COUNTRY = new StringClientParam(SP_ADDRESS_COUNTRY);
576
577        /**
578         * Search parameter constant for <b>address-use</b>
579         * <p>
580         * Description: <b>A use code specified in an address</b><br>
581         * Type: <b>token</b><br>
582         * Path: <b>Patient.address.use</b><br>
583         * </p>
584         */
585        @SearchParamDefinition(name="address-use", path="Patient.address.use", description="A use code specified in an address", type="token"  )
586        public static final String SP_ADDRESS_USE = "address-use";
587
588        /**
589         * <b>Fluent Client</b> search parameter constant for <b>address-use</b>
590         * <p>
591         * Description: <b>A use code specified in an address</b><br>
592         * Type: <b>token</b><br>
593         * Path: <b>Patient.address.use</b><br>
594         * </p>
595         */
596        public static final TokenClientParam ADDRESS_USE = new TokenClientParam(SP_ADDRESS_USE);
597
598        /**
599         * Search parameter constant for <b>gender</b>
600         * <p>
601         * Description: <b>Gender of the patient</b><br>
602         * Type: <b>token</b><br>
603         * Path: <b>Patient.gender</b><br>
604         * </p>
605         */
606        @SearchParamDefinition(name="gender", path="Patient.gender", description="Gender of the patient", type="token"  )
607        public static final String SP_GENDER = "gender";
608
609        /**
610         * <b>Fluent Client</b> search parameter constant for <b>gender</b>
611         * <p>
612         * Description: <b>Gender of the patient</b><br>
613         * Type: <b>token</b><br>
614         * Path: <b>Patient.gender</b><br>
615         * </p>
616         */
617        public static final TokenClientParam GENDER = new TokenClientParam(SP_GENDER);
618
619        /**
620         * Search parameter constant for <b>language</b>
621         * <p>
622         * Description: <b>Language code (irrespective of use value)</b><br>
623         * Type: <b>token</b><br>
624         * Path: <b>Patient.communication.language</b><br>
625         * </p>
626         */
627        @SearchParamDefinition(name="language", path="Patient.communication.language", description="Language code (irrespective of use value)", type="token"  )
628        public static final String SP_LANGUAGE = "language";
629
630        /**
631         * <b>Fluent Client</b> search parameter constant for <b>language</b>
632         * <p>
633         * Description: <b>Language code (irrespective of use value)</b><br>
634         * Type: <b>token</b><br>
635         * Path: <b>Patient.communication.language</b><br>
636         * </p>
637         */
638        public static final TokenClientParam LANGUAGE = new TokenClientParam(SP_LANGUAGE);
639
640        /**
641         * Search parameter constant for <b>birthdate</b>
642         * <p>
643         * Description: <b>The patient's date of birth</b><br>
644         * Type: <b>date</b><br>
645         * Path: <b>Patient.birthDate</b><br>
646         * </p>
647         */
648        @SearchParamDefinition(name="birthdate", path="Patient.birthDate", description="The patient's date of birth", type="date"  )
649        public static final String SP_BIRTHDATE = "birthdate";
650
651        /**
652         * <b>Fluent Client</b> search parameter constant for <b>birthdate</b>
653         * <p>
654         * Description: <b>The patient's date of birth</b><br>
655         * Type: <b>date</b><br>
656         * Path: <b>Patient.birthDate</b><br>
657         * </p>
658         */
659        public static final DateClientParam BIRTHDATE = new DateClientParam(SP_BIRTHDATE);
660
661        /**
662         * Search parameter constant for <b>organization</b>
663         * <p>
664         * Description: <b>The organization at which this person is a patient</b><br>
665         * Type: <b>reference</b><br>
666         * Path: <b>Patient.managingOrganization</b><br>
667         * </p>
668         */
669        @SearchParamDefinition(name="organization", path="Patient.managingOrganization", description="The organization at which this person is a patient", type="reference"  )
670        public static final String SP_ORGANIZATION = "organization";
671
672        /**
673         * <b>Fluent Client</b> search parameter constant for <b>organization</b>
674         * <p>
675         * Description: <b>The organization at which this person is a patient</b><br>
676         * Type: <b>reference</b><br>
677         * Path: <b>Patient.managingOrganization</b><br>
678         * </p>
679         */
680        public static final ReferenceClientParam ORGANIZATION = new ReferenceClientParam(SP_ORGANIZATION);
681
682        /**
683         * Search parameter constant for <b>careprovider</b>
684         * <p>
685         * Description: <b>Patient's nominated care provider, could be a care manager, not the organization that manages the record</b><br>
686         * Type: <b>reference</b><br>
687         * Path: <b>Patient.careProvider</b><br>
688         * </p>
689         */
690        @SearchParamDefinition(name="careprovider", path="Patient.careProvider", description="Patient's nominated care provider, could be a care manager, not the organization that manages the record", type="reference" , providesMembershipIn={
691 @Compartment(name="Encounter")         }
692 )
693        public static final String SP_CAREPROVIDER = "careprovider";
694
695        /**
696         * <b>Fluent Client</b> search parameter constant for <b>careprovider</b>
697         * <p>
698         * Description: <b>Patient's nominated care provider, could be a care manager, not the organization that manages the record</b><br>
699         * Type: <b>reference</b><br>
700         * Path: <b>Patient.careProvider</b><br>
701         * </p>
702         */
703        public static final ReferenceClientParam CAREPROVIDER = new ReferenceClientParam(SP_CAREPROVIDER);
704
705        /**
706         * Search parameter constant for <b>active</b>
707         * <p>
708         * Description: <b>Whether the patient record is active</b><br>
709         * Type: <b>token</b><br>
710         * Path: <b>Patient.active</b><br>
711         * </p>
712         */
713        @SearchParamDefinition(name="active", path="Patient.active", description="Whether the patient record is active", type="token"  )
714        public static final String SP_ACTIVE = "active";
715
716        /**
717         * <b>Fluent Client</b> search parameter constant for <b>active</b>
718         * <p>
719         * Description: <b>Whether the patient record is active</b><br>
720         * Type: <b>token</b><br>
721         * Path: <b>Patient.active</b><br>
722         * </p>
723         */
724        public static final TokenClientParam ACTIVE = new TokenClientParam(SP_ACTIVE);
725
726        /**
727         * Search parameter constant for <b>animal-species</b>
728         * <p>
729         * Description: <b>The species for animal patients</b><br>
730         * Type: <b>token</b><br>
731         * Path: <b>Patient.animal.species</b><br>
732         * </p>
733         */
734        @SearchParamDefinition(name="animal-species", path="Patient.animal.species", description="The species for animal patients", type="token"  )
735        public static final String SP_ANIMAL_SPECIES = "animal-species";
736
737        /**
738         * <b>Fluent Client</b> search parameter constant for <b>animal-species</b>
739         * <p>
740         * Description: <b>The species for animal patients</b><br>
741         * Type: <b>token</b><br>
742         * Path: <b>Patient.animal.species</b><br>
743         * </p>
744         */
745        public static final TokenClientParam ANIMAL_SPECIES = new TokenClientParam(SP_ANIMAL_SPECIES);
746
747        /**
748         * Search parameter constant for <b>animal-breed</b>
749         * <p>
750         * Description: <b>The breed for animal patients</b><br>
751         * Type: <b>token</b><br>
752         * Path: <b>Patient.animal.breed</b><br>
753         * </p>
754         */
755        @SearchParamDefinition(name="animal-breed", path="Patient.animal.breed", description="The breed for animal patients", type="token"  )
756        public static final String SP_ANIMAL_BREED = "animal-breed";
757
758        /**
759         * <b>Fluent Client</b> search parameter constant for <b>animal-breed</b>
760         * <p>
761         * Description: <b>The breed for animal patients</b><br>
762         * Type: <b>token</b><br>
763         * Path: <b>Patient.animal.breed</b><br>
764         * </p>
765         */
766        public static final TokenClientParam ANIMAL_BREED = new TokenClientParam(SP_ANIMAL_BREED);
767
768        /**
769         * Search parameter constant for <b>link</b>
770         * <p>
771         * Description: <b>All patients linked to the given patient</b><br>
772         * Type: <b>reference</b><br>
773         * Path: <b>Patient.link.other</b><br>
774         * </p>
775         */
776        @SearchParamDefinition(name="link", path="Patient.link.other", description="All patients linked to the given patient", type="reference" , providesMembershipIn={
777 @Compartment(name="Patient")   }
778 )
779        public static final String SP_LINK = "link";
780
781        /**
782         * <b>Fluent Client</b> search parameter constant for <b>link</b>
783         * <p>
784         * Description: <b>All patients linked to the given patient</b><br>
785         * Type: <b>reference</b><br>
786         * Path: <b>Patient.link.other</b><br>
787         * </p>
788         */
789        public static final ReferenceClientParam LINK = new ReferenceClientParam(SP_LINK);
790
791        /**
792         * Search parameter constant for <b>deceased</b>
793         * <p>
794         * Description: <b>This patient has been marked as deceased, or as a death date entered</b><br>
795         * Type: <b>token</b><br>
796         * Path: <b>Patient.deceased[x]</b><br>
797         * </p>
798         */
799        @SearchParamDefinition(name="deceased", path="Patient.deceased[x]", description="This patient has been marked as deceased, or as a death date entered", type="token"  )
800        public static final String SP_DECEASED = "deceased";
801
802        /**
803         * <b>Fluent Client</b> search parameter constant for <b>deceased</b>
804         * <p>
805         * Description: <b>This patient has been marked as deceased, or as a death date entered</b><br>
806         * Type: <b>token</b><br>
807         * Path: <b>Patient.deceased[x]</b><br>
808         * </p>
809         */
810        public static final TokenClientParam DECEASED = new TokenClientParam(SP_DECEASED);
811
812        /**
813         * Search parameter constant for <b>deathdate</b>
814         * <p>
815         * Description: <b>The date of death has been provided and satisfies this search value</b><br>
816         * Type: <b>date</b><br>
817         * Path: <b>Patient.deceasedDateTime</b><br>
818         * </p>
819         */
820        @SearchParamDefinition(name="deathdate", path="Patient.deceasedDateTime", description="The date of death has been provided and satisfies this search value", type="date"  )
821        public static final String SP_DEATHDATE = "deathdate";
822
823        /**
824         * <b>Fluent Client</b> search parameter constant for <b>deathdate</b>
825         * <p>
826         * Description: <b>The date of death has been provided and satisfies this search value</b><br>
827         * Type: <b>date</b><br>
828         * Path: <b>Patient.deceasedDateTime</b><br>
829         * </p>
830         */
831        public static final DateClientParam DEATHDATE = new DateClientParam(SP_DEATHDATE);
832
833
834        /**
835         * Constant for fluent queries to be used to add include statements. Specifies
836         * the path value of "<b>Patient:careprovider</b>".
837         */
838        public static final Include INCLUDE_CAREPROVIDER = new Include("Patient:careprovider");
839
840        /**
841         * Constant for fluent queries to be used to add include statements. Specifies
842         * the path value of "<b>Patient:link</b>".
843         */
844        public static final Include INCLUDE_LINK = new Include("Patient:link");
845
846        /**
847         * Constant for fluent queries to be used to add include statements. Specifies
848         * the path value of "<b>Patient:organization</b>".
849         */
850        public static final Include INCLUDE_ORGANIZATION = new Include("Patient:organization");
851
852
853        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)       
854        @Description(
855                shortDefinition="id",
856                formalDefinition="An identifier for this patient"
857        )
858        private java.util.List<IdentifierDt> myIdentifier;
859        
860        @Child(name="active", type=BooleanDt.class, order=1, min=0, max=1, summary=true, modifier=true) 
861        @Description(
862                shortDefinition="status",
863                formalDefinition="Whether this patient record is in active use"
864        )
865        private BooleanDt myActive;
866        
867        @Child(name="name", type=HumanNameDt.class, order=2, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)      
868        @Description(
869                shortDefinition="",
870                formalDefinition="A name associated with the individual."
871        )
872        private java.util.List<HumanNameDt> myName;
873        
874        @Child(name="telecom", type=ContactPointDt.class, order=3, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)        
875        @Description(
876                shortDefinition="",
877                formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted."
878        )
879        private java.util.List<ContactPointDt> myTelecom;
880        
881        @Child(name="gender", type=CodeDt.class, order=4, min=0, max=1, summary=true, modifier=false)   
882        @Description(
883                shortDefinition="",
884                formalDefinition="Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes."
885        )
886        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/administrative-gender")
887        private BoundCodeDt<AdministrativeGenderEnum> myGender;
888        
889        @Child(name="birthDate", type=DateDt.class, order=5, min=0, max=1, summary=true, modifier=false)        
890        @Description(
891                shortDefinition="",
892                formalDefinition="The date of birth for the individual"
893        )
894        private DateDt myBirthDate;
895        
896        @Child(name="deceased", order=6, min=0, max=1, summary=true, modifier=true, type={
897                BooleanDt.class,                DateTimeDt.class        })
898        @Description(
899                shortDefinition="",
900                formalDefinition="Indicates if the individual is deceased or not"
901        )
902        private IDatatype myDeceased;
903        
904        @Child(name="address", type=AddressDt.class, order=7, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)     
905        @Description(
906                shortDefinition="",
907                formalDefinition="Addresses for the individual"
908        )
909        private java.util.List<AddressDt> myAddress;
910        
911        @Child(name="maritalStatus", type=CodeableConceptDt.class, order=8, min=0, max=1, summary=false, modifier=false)        
912        @Description(
913                shortDefinition="",
914                formalDefinition="This field contains a patient's most recent marital (civil) status."
915        )
916        private BoundCodeableConceptDt<MaritalStatusCodesEnum> myMaritalStatus;
917        
918        @Child(name="multipleBirth", order=9, min=0, max=1, summary=false, modifier=false, type={
919                BooleanDt.class,                IntegerDt.class })
920        @Description(
921                shortDefinition="",
922                formalDefinition="Indicates whether the patient is part of a multiple or indicates the actual birth order."
923        )
924        private IDatatype myMultipleBirth;
925        
926        @Child(name="photo", type=AttachmentDt.class, order=10, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)  
927        @Description(
928                shortDefinition="",
929                formalDefinition="Image of the patient"
930        )
931        private java.util.List<AttachmentDt> myPhoto;
932        
933        @Child(name="contact", order=11, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false) 
934        @Description(
935                shortDefinition="",
936                formalDefinition="A contact party (e.g. guardian, partner, friend) for the patient"
937        )
938        private java.util.List<Contact> myContact;
939        
940        @Child(name="animal", order=12, min=0, max=1, summary=true, modifier=true)      
941        @Description(
942                shortDefinition="",
943                formalDefinition="This patient is known to be an animal"
944        )
945        private Animal myAnimal;
946        
947        @Child(name="communication", order=13, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)   
948        @Description(
949                shortDefinition="",
950                formalDefinition="Languages which may be used to communicate with the patient about his or her health"
951        )
952        private java.util.List<Communication> myCommunication;
953        
954        @Child(name="careProvider", order=14, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
955                ca.uhn.fhir.model.dstu2.resource.Organization.class,            ca.uhn.fhir.model.dstu2.resource.Practitioner.class     })
956        @Description(
957                shortDefinition="",
958                formalDefinition="Patient's nominated care provider"
959        )
960        private java.util.List<ResourceReferenceDt> myCareProvider;
961        
962        @Child(name="managingOrganization", order=15, min=0, max=1, summary=true, modifier=false, type={
963                ca.uhn.fhir.model.dstu2.resource.Organization.class     })
964        @Description(
965                shortDefinition="",
966                formalDefinition="Organization that is the custodian of the patient record"
967        )
968        private ResourceReferenceDt myManagingOrganization;
969        
970        @Child(name="link", order=16, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=true)     
971        @Description(
972                shortDefinition="",
973                formalDefinition="Link to another patient resource that concerns the same actual patient"
974        )
975        private java.util.List<Link> myLink;
976        
977
978        @Override
979        public boolean isEmpty() {
980                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  myActive,  myName,  myTelecom,  myGender,  myBirthDate,  myDeceased,  myAddress,  myMaritalStatus,  myMultipleBirth,  myPhoto,  myContact,  myAnimal,  myCommunication,  myCareProvider,  myManagingOrganization,  myLink);
981        }
982        
983        @Override
984        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
985                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myActive, myName, myTelecom, myGender, myBirthDate, myDeceased, myAddress, myMaritalStatus, myMultipleBirth, myPhoto, myContact, myAnimal, myCommunication, myCareProvider, myManagingOrganization, myLink);
986        }
987
988        /**
989         * Gets the value(s) for <b>identifier</b> (id).
990         * creating it if it does
991         * not exist. Will not return <code>null</code>.
992         *
993     * <p>
994     * <b>Definition:</b>
995     * An identifier for this patient
996     * </p> 
997         */
998        public java.util.List<IdentifierDt> getIdentifier() {  
999                if (myIdentifier == null) {
1000                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
1001                }
1002                return myIdentifier;
1003        }
1004
1005        /**
1006         * Sets the value(s) for <b>identifier</b> (id)
1007         *
1008     * <p>
1009     * <b>Definition:</b>
1010     * An identifier for this patient
1011     * </p> 
1012         */
1013        public Patient setIdentifier(java.util.List<IdentifierDt> theValue) {
1014                myIdentifier = theValue;
1015                return this;
1016        }
1017        
1018        
1019
1020        /**
1021         * Adds and returns a new value for <b>identifier</b> (id)
1022         *
1023     * <p>
1024     * <b>Definition:</b>
1025     * An identifier for this patient
1026     * </p> 
1027         */
1028        public IdentifierDt addIdentifier() {
1029                IdentifierDt newType = new IdentifierDt();
1030                getIdentifier().add(newType);
1031                return newType; 
1032        }
1033
1034        /**
1035         * Adds a given new value for <b>identifier</b> (id)
1036         *
1037         * <p>
1038         * <b>Definition:</b>
1039         * An identifier for this patient
1040         * </p>
1041         * @param theValue The identifier to add (must not be <code>null</code>)
1042         */
1043        public Patient addIdentifier(IdentifierDt theValue) {
1044                if (theValue == null) {
1045                        throw new NullPointerException("theValue must not be null");
1046                }
1047                getIdentifier().add(theValue);
1048                return this;
1049        }
1050
1051        /**
1052         * Gets the first repetition for <b>identifier</b> (id),
1053         * creating it if it does not already exist.
1054         *
1055     * <p>
1056     * <b>Definition:</b>
1057     * An identifier for this patient
1058     * </p> 
1059         */
1060        public IdentifierDt getIdentifierFirstRep() {
1061                if (getIdentifier().isEmpty()) {
1062                        return addIdentifier();
1063                }
1064                return getIdentifier().get(0); 
1065        }
1066  
1067        /**
1068         * Gets the value(s) for <b>active</b> (status).
1069         * creating it if it does
1070         * not exist. Will not return <code>null</code>.
1071         *
1072     * <p>
1073     * <b>Definition:</b>
1074     * Whether this patient record is in active use
1075     * </p> 
1076         */
1077        public BooleanDt getActiveElement() {  
1078                if (myActive == null) {
1079                        myActive = new BooleanDt();
1080                }
1081                return myActive;
1082        }
1083
1084        
1085        /**
1086         * Gets the value(s) for <b>active</b> (status).
1087         * creating it if it does
1088         * not exist. This method may return <code>null</code>.
1089         *
1090     * <p>
1091     * <b>Definition:</b>
1092     * Whether this patient record is in active use
1093     * </p> 
1094         */
1095        public Boolean getActive() {  
1096                return getActiveElement().getValue();
1097        }
1098
1099        /**
1100         * Sets the value(s) for <b>active</b> (status)
1101         *
1102     * <p>
1103     * <b>Definition:</b>
1104     * Whether this patient record is in active use
1105     * </p> 
1106         */
1107        public Patient setActive(BooleanDt theValue) {
1108                myActive = theValue;
1109                return this;
1110        }
1111        
1112        
1113
1114        /**
1115         * Sets the value for <b>active</b> (status)
1116         *
1117     * <p>
1118     * <b>Definition:</b>
1119     * Whether this patient record is in active use
1120     * </p> 
1121         */
1122        public Patient setActive( boolean theBoolean) {
1123                myActive = new BooleanDt(theBoolean); 
1124                return this; 
1125        }
1126
1127 
1128        /**
1129         * Gets the value(s) for <b>name</b> ().
1130         * creating it if it does
1131         * not exist. Will not return <code>null</code>.
1132         *
1133     * <p>
1134     * <b>Definition:</b>
1135     * A name associated with the individual.
1136     * </p> 
1137         */
1138        public java.util.List<HumanNameDt> getName() {  
1139                if (myName == null) {
1140                        myName = new java.util.ArrayList<HumanNameDt>();
1141                }
1142                return myName;
1143        }
1144
1145        /**
1146         * Sets the value(s) for <b>name</b> ()
1147         *
1148     * <p>
1149     * <b>Definition:</b>
1150     * A name associated with the individual.
1151     * </p> 
1152         */
1153        public Patient setName(java.util.List<HumanNameDt> theValue) {
1154                myName = theValue;
1155                return this;
1156        }
1157        
1158        
1159
1160        /**
1161         * Adds and returns a new value for <b>name</b> ()
1162         *
1163     * <p>
1164     * <b>Definition:</b>
1165     * A name associated with the individual.
1166     * </p> 
1167         */
1168        public HumanNameDt addName() {
1169                HumanNameDt newType = new HumanNameDt();
1170                getName().add(newType);
1171                return newType; 
1172        }
1173
1174        /**
1175         * Adds a given new value for <b>name</b> ()
1176         *
1177         * <p>
1178         * <b>Definition:</b>
1179         * A name associated with the individual.
1180         * </p>
1181         * @param theValue The name to add (must not be <code>null</code>)
1182         */
1183        public Patient addName(HumanNameDt theValue) {
1184                if (theValue == null) {
1185                        throw new NullPointerException("theValue must not be null");
1186                }
1187                getName().add(theValue);
1188                return this;
1189        }
1190
1191        /**
1192         * Gets the first repetition for <b>name</b> (),
1193         * creating it if it does not already exist.
1194         *
1195     * <p>
1196     * <b>Definition:</b>
1197     * A name associated with the individual.
1198     * </p> 
1199         */
1200        public HumanNameDt getNameFirstRep() {
1201                if (getName().isEmpty()) {
1202                        return addName();
1203                }
1204                return getName().get(0); 
1205        }
1206  
1207        /**
1208         * Gets the value(s) for <b>telecom</b> ().
1209         * creating it if it does
1210         * not exist. Will not return <code>null</code>.
1211         *
1212     * <p>
1213     * <b>Definition:</b>
1214     * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.
1215     * </p> 
1216         */
1217        public java.util.List<ContactPointDt> getTelecom() {  
1218                if (myTelecom == null) {
1219                        myTelecom = new java.util.ArrayList<ContactPointDt>();
1220                }
1221                return myTelecom;
1222        }
1223
1224        /**
1225         * Sets the value(s) for <b>telecom</b> ()
1226         *
1227     * <p>
1228     * <b>Definition:</b>
1229     * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.
1230     * </p> 
1231         */
1232        public Patient setTelecom(java.util.List<ContactPointDt> theValue) {
1233                myTelecom = theValue;
1234                return this;
1235        }
1236        
1237        
1238
1239        /**
1240         * Adds and returns a new value for <b>telecom</b> ()
1241         *
1242     * <p>
1243     * <b>Definition:</b>
1244     * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.
1245     * </p> 
1246         */
1247        public ContactPointDt addTelecom() {
1248                ContactPointDt newType = new ContactPointDt();
1249                getTelecom().add(newType);
1250                return newType; 
1251        }
1252
1253        /**
1254         * Adds a given new value for <b>telecom</b> ()
1255         *
1256         * <p>
1257         * <b>Definition:</b>
1258         * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.
1259         * </p>
1260         * @param theValue The telecom to add (must not be <code>null</code>)
1261         */
1262        public Patient addTelecom(ContactPointDt theValue) {
1263                if (theValue == null) {
1264                        throw new NullPointerException("theValue must not be null");
1265                }
1266                getTelecom().add(theValue);
1267                return this;
1268        }
1269
1270        /**
1271         * Gets the first repetition for <b>telecom</b> (),
1272         * creating it if it does not already exist.
1273         *
1274     * <p>
1275     * <b>Definition:</b>
1276     * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.
1277     * </p> 
1278         */
1279        public ContactPointDt getTelecomFirstRep() {
1280                if (getTelecom().isEmpty()) {
1281                        return addTelecom();
1282                }
1283                return getTelecom().get(0); 
1284        }
1285  
1286        /**
1287         * Gets the value(s) for <b>gender</b> ().
1288         * creating it if it does
1289         * not exist. Will not return <code>null</code>.
1290         *
1291     * <p>
1292     * <b>Definition:</b>
1293     * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.
1294     * </p> 
1295         */
1296        public BoundCodeDt<AdministrativeGenderEnum> getGenderElement() {  
1297                if (myGender == null) {
1298                        myGender = new BoundCodeDt<AdministrativeGenderEnum>(AdministrativeGenderEnum.VALUESET_BINDER);
1299                }
1300                return myGender;
1301        }
1302
1303        
1304        /**
1305         * Gets the value(s) for <b>gender</b> ().
1306         * creating it if it does
1307         * not exist. This method may return <code>null</code>.
1308         *
1309     * <p>
1310     * <b>Definition:</b>
1311     * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.
1312     * </p> 
1313         */
1314        public String getGender() {  
1315                return getGenderElement().getValue();
1316        }
1317
1318        /**
1319         * Sets the value(s) for <b>gender</b> ()
1320         *
1321     * <p>
1322     * <b>Definition:</b>
1323     * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.
1324     * </p> 
1325         */
1326        public Patient setGender(BoundCodeDt<AdministrativeGenderEnum> theValue) {
1327                myGender = theValue;
1328                return this;
1329        }
1330        
1331        
1332
1333        /**
1334         * Sets the value(s) for <b>gender</b> ()
1335         *
1336     * <p>
1337     * <b>Definition:</b>
1338     * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.
1339     * </p> 
1340         */
1341        public Patient setGender(AdministrativeGenderEnum theValue) {
1342                setGender(new BoundCodeDt<AdministrativeGenderEnum>(AdministrativeGenderEnum.VALUESET_BINDER, theValue));
1343                
1344/*
1345                getGenderElement().setValueAsEnum(theValue);
1346*/
1347                return this;
1348        }
1349
1350  
1351        /**
1352         * Gets the value(s) for <b>birthDate</b> ().
1353         * creating it if it does
1354         * not exist. Will not return <code>null</code>.
1355         *
1356     * <p>
1357     * <b>Definition:</b>
1358     * The date of birth for the individual
1359     * </p> 
1360         */
1361        public DateDt getBirthDateElement() {  
1362                if (myBirthDate == null) {
1363                        myBirthDate = new DateDt();
1364                }
1365                return myBirthDate;
1366        }
1367
1368        
1369        /**
1370         * Gets the value(s) for <b>birthDate</b> ().
1371         * creating it if it does
1372         * not exist. This method may return <code>null</code>.
1373         *
1374     * <p>
1375     * <b>Definition:</b>
1376     * The date of birth for the individual
1377     * </p> 
1378         */
1379        public Date getBirthDate() {  
1380                return getBirthDateElement().getValue();
1381        }
1382
1383        /**
1384         * Sets the value(s) for <b>birthDate</b> ()
1385         *
1386     * <p>
1387     * <b>Definition:</b>
1388     * The date of birth for the individual
1389     * </p> 
1390         */
1391        public Patient setBirthDate(DateDt theValue) {
1392                myBirthDate = theValue;
1393                return this;
1394        }
1395        
1396        
1397
1398        /**
1399         * Sets the value for <b>birthDate</b> ()
1400         *
1401     * <p>
1402     * <b>Definition:</b>
1403     * The date of birth for the individual
1404     * </p> 
1405         */
1406        public Patient setBirthDateWithDayPrecision( Date theDate) {
1407                myBirthDate = new DateDt(theDate); 
1408                return this; 
1409        }
1410
1411        /**
1412         * Sets the value for <b>birthDate</b> ()
1413         *
1414     * <p>
1415     * <b>Definition:</b>
1416     * The date of birth for the individual
1417     * </p> 
1418         */
1419        public Patient setBirthDate( Date theDate,  TemporalPrecisionEnum thePrecision) {
1420                myBirthDate = new DateDt(theDate, thePrecision); 
1421                return this; 
1422        }
1423
1424 
1425        /**
1426         * Gets the value(s) for <b>deceased[x]</b> ().
1427         * creating it if it does
1428         * not exist. Will not return <code>null</code>.
1429         *
1430     * <p>
1431     * <b>Definition:</b>
1432     * Indicates if the individual is deceased or not
1433     * </p> 
1434         */
1435        public IDatatype getDeceased() {  
1436                return myDeceased;
1437        }
1438
1439        /**
1440         * Sets the value(s) for <b>deceased[x]</b> ()
1441         *
1442     * <p>
1443     * <b>Definition:</b>
1444     * Indicates if the individual is deceased or not
1445     * </p> 
1446         */
1447        public Patient setDeceased(IDatatype theValue) {
1448                myDeceased = theValue;
1449                return this;
1450        }
1451        
1452        
1453
1454  
1455        /**
1456         * Gets the value(s) for <b>address</b> ().
1457         * creating it if it does
1458         * not exist. Will not return <code>null</code>.
1459         *
1460     * <p>
1461     * <b>Definition:</b>
1462     * Addresses for the individual
1463     * </p> 
1464         */
1465        public java.util.List<AddressDt> getAddress() {  
1466                if (myAddress == null) {
1467                        myAddress = new java.util.ArrayList<AddressDt>();
1468                }
1469                return myAddress;
1470        }
1471
1472        /**
1473         * Sets the value(s) for <b>address</b> ()
1474         *
1475     * <p>
1476     * <b>Definition:</b>
1477     * Addresses for the individual
1478     * </p> 
1479         */
1480        public Patient setAddress(java.util.List<AddressDt> theValue) {
1481                myAddress = theValue;
1482                return this;
1483        }
1484        
1485        
1486
1487        /**
1488         * Adds and returns a new value for <b>address</b> ()
1489         *
1490     * <p>
1491     * <b>Definition:</b>
1492     * Addresses for the individual
1493     * </p> 
1494         */
1495        public AddressDt addAddress() {
1496                AddressDt newType = new AddressDt();
1497                getAddress().add(newType);
1498                return newType; 
1499        }
1500
1501        /**
1502         * Adds a given new value for <b>address</b> ()
1503         *
1504         * <p>
1505         * <b>Definition:</b>
1506         * Addresses for the individual
1507         * </p>
1508         * @param theValue The address to add (must not be <code>null</code>)
1509         */
1510        public Patient addAddress(AddressDt theValue) {
1511                if (theValue == null) {
1512                        throw new NullPointerException("theValue must not be null");
1513                }
1514                getAddress().add(theValue);
1515                return this;
1516        }
1517
1518        /**
1519         * Gets the first repetition for <b>address</b> (),
1520         * creating it if it does not already exist.
1521         *
1522     * <p>
1523     * <b>Definition:</b>
1524     * Addresses for the individual
1525     * </p> 
1526         */
1527        public AddressDt getAddressFirstRep() {
1528                if (getAddress().isEmpty()) {
1529                        return addAddress();
1530                }
1531                return getAddress().get(0); 
1532        }
1533  
1534        /**
1535         * Gets the value(s) for <b>maritalStatus</b> ().
1536         * creating it if it does
1537         * not exist. Will not return <code>null</code>.
1538         *
1539     * <p>
1540     * <b>Definition:</b>
1541     * This field contains a patient's most recent marital (civil) status.
1542     * </p> 
1543         */
1544        public BoundCodeableConceptDt<MaritalStatusCodesEnum> getMaritalStatus() {  
1545                if (myMaritalStatus == null) {
1546                        myMaritalStatus = new BoundCodeableConceptDt<MaritalStatusCodesEnum>(MaritalStatusCodesEnum.VALUESET_BINDER);
1547                }
1548                return myMaritalStatus;
1549        }
1550
1551        /**
1552         * Sets the value(s) for <b>maritalStatus</b> ()
1553         *
1554     * <p>
1555     * <b>Definition:</b>
1556     * This field contains a patient's most recent marital (civil) status.
1557     * </p> 
1558         */
1559        public Patient setMaritalStatus(BoundCodeableConceptDt<MaritalStatusCodesEnum> theValue) {
1560                myMaritalStatus = theValue;
1561                return this;
1562        }
1563        
1564        
1565
1566        /**
1567         * Sets the value(s) for <b>maritalStatus</b> ()
1568         *
1569     * <p>
1570     * <b>Definition:</b>
1571     * This field contains a patient's most recent marital (civil) status.
1572     * </p> 
1573         */
1574        public Patient setMaritalStatus(MaritalStatusCodesEnum theValue) {
1575                setMaritalStatus(new BoundCodeableConceptDt<MaritalStatusCodesEnum>(MaritalStatusCodesEnum.VALUESET_BINDER, theValue));
1576                
1577/*
1578                getMaritalStatus().setValueAsEnum(theValue);
1579*/
1580                return this;
1581        }
1582
1583  
1584        /**
1585         * Gets the value(s) for <b>multipleBirth[x]</b> ().
1586         * creating it if it does
1587         * not exist. Will not return <code>null</code>.
1588         *
1589     * <p>
1590     * <b>Definition:</b>
1591     * Indicates whether the patient is part of a multiple or indicates the actual birth order.
1592     * </p> 
1593         */
1594        public IDatatype getMultipleBirth() {  
1595                return myMultipleBirth;
1596        }
1597
1598        /**
1599         * Sets the value(s) for <b>multipleBirth[x]</b> ()
1600         *
1601     * <p>
1602     * <b>Definition:</b>
1603     * Indicates whether the patient is part of a multiple or indicates the actual birth order.
1604     * </p> 
1605         */
1606        public Patient setMultipleBirth(IDatatype theValue) {
1607                myMultipleBirth = theValue;
1608                return this;
1609        }
1610        
1611        
1612
1613  
1614        /**
1615         * Gets the value(s) for <b>photo</b> ().
1616         * creating it if it does
1617         * not exist. Will not return <code>null</code>.
1618         *
1619     * <p>
1620     * <b>Definition:</b>
1621     * Image of the patient
1622     * </p> 
1623         */
1624        public java.util.List<AttachmentDt> getPhoto() {  
1625                if (myPhoto == null) {
1626                        myPhoto = new java.util.ArrayList<AttachmentDt>();
1627                }
1628                return myPhoto;
1629        }
1630
1631        /**
1632         * Sets the value(s) for <b>photo</b> ()
1633         *
1634     * <p>
1635     * <b>Definition:</b>
1636     * Image of the patient
1637     * </p> 
1638         */
1639        public Patient setPhoto(java.util.List<AttachmentDt> theValue) {
1640                myPhoto = theValue;
1641                return this;
1642        }
1643        
1644        
1645
1646        /**
1647         * Adds and returns a new value for <b>photo</b> ()
1648         *
1649     * <p>
1650     * <b>Definition:</b>
1651     * Image of the patient
1652     * </p> 
1653         */
1654        public AttachmentDt addPhoto() {
1655                AttachmentDt newType = new AttachmentDt();
1656                getPhoto().add(newType);
1657                return newType; 
1658        }
1659
1660        /**
1661         * Adds a given new value for <b>photo</b> ()
1662         *
1663         * <p>
1664         * <b>Definition:</b>
1665         * Image of the patient
1666         * </p>
1667         * @param theValue The photo to add (must not be <code>null</code>)
1668         */
1669        public Patient addPhoto(AttachmentDt theValue) {
1670                if (theValue == null) {
1671                        throw new NullPointerException("theValue must not be null");
1672                }
1673                getPhoto().add(theValue);
1674                return this;
1675        }
1676
1677        /**
1678         * Gets the first repetition for <b>photo</b> (),
1679         * creating it if it does not already exist.
1680         *
1681     * <p>
1682     * <b>Definition:</b>
1683     * Image of the patient
1684     * </p> 
1685         */
1686        public AttachmentDt getPhotoFirstRep() {
1687                if (getPhoto().isEmpty()) {
1688                        return addPhoto();
1689                }
1690                return getPhoto().get(0); 
1691        }
1692  
1693        /**
1694         * Gets the value(s) for <b>contact</b> ().
1695         * creating it if it does
1696         * not exist. Will not return <code>null</code>.
1697         *
1698     * <p>
1699     * <b>Definition:</b>
1700     * A contact party (e.g. guardian, partner, friend) for the patient
1701     * </p> 
1702         */
1703        public java.util.List<Contact> getContact() {  
1704                if (myContact == null) {
1705                        myContact = new java.util.ArrayList<Contact>();
1706                }
1707                return myContact;
1708        }
1709
1710        /**
1711         * Sets the value(s) for <b>contact</b> ()
1712         *
1713     * <p>
1714     * <b>Definition:</b>
1715     * A contact party (e.g. guardian, partner, friend) for the patient
1716     * </p> 
1717         */
1718        public Patient setContact(java.util.List<Contact> theValue) {
1719                myContact = theValue;
1720                return this;
1721        }
1722        
1723        
1724
1725        /**
1726         * Adds and returns a new value for <b>contact</b> ()
1727         *
1728     * <p>
1729     * <b>Definition:</b>
1730     * A contact party (e.g. guardian, partner, friend) for the patient
1731     * </p> 
1732         */
1733        public Contact addContact() {
1734                Contact newType = new Contact();
1735                getContact().add(newType);
1736                return newType; 
1737        }
1738
1739        /**
1740         * Adds a given new value for <b>contact</b> ()
1741         *
1742         * <p>
1743         * <b>Definition:</b>
1744         * A contact party (e.g. guardian, partner, friend) for the patient
1745         * </p>
1746         * @param theValue The contact to add (must not be <code>null</code>)
1747         */
1748        public Patient addContact(Contact theValue) {
1749                if (theValue == null) {
1750                        throw new NullPointerException("theValue must not be null");
1751                }
1752                getContact().add(theValue);
1753                return this;
1754        }
1755
1756        /**
1757         * Gets the first repetition for <b>contact</b> (),
1758         * creating it if it does not already exist.
1759         *
1760     * <p>
1761     * <b>Definition:</b>
1762     * A contact party (e.g. guardian, partner, friend) for the patient
1763     * </p> 
1764         */
1765        public Contact getContactFirstRep() {
1766                if (getContact().isEmpty()) {
1767                        return addContact();
1768                }
1769                return getContact().get(0); 
1770        }
1771  
1772        /**
1773         * Gets the value(s) for <b>animal</b> ().
1774         * creating it if it does
1775         * not exist. Will not return <code>null</code>.
1776         *
1777     * <p>
1778     * <b>Definition:</b>
1779     * This patient is known to be an animal
1780     * </p> 
1781         */
1782        public Animal getAnimal() {  
1783                if (myAnimal == null) {
1784                        myAnimal = new Animal();
1785                }
1786                return myAnimal;
1787        }
1788
1789        /**
1790         * Sets the value(s) for <b>animal</b> ()
1791         *
1792     * <p>
1793     * <b>Definition:</b>
1794     * This patient is known to be an animal
1795     * </p> 
1796         */
1797        public Patient setAnimal(Animal theValue) {
1798                myAnimal = theValue;
1799                return this;
1800        }
1801        
1802        
1803
1804  
1805        /**
1806         * Gets the value(s) for <b>communication</b> ().
1807         * creating it if it does
1808         * not exist. Will not return <code>null</code>.
1809         *
1810     * <p>
1811     * <b>Definition:</b>
1812     * Languages which may be used to communicate with the patient about his or her health
1813     * </p> 
1814         */
1815        public java.util.List<Communication> getCommunication() {  
1816                if (myCommunication == null) {
1817                        myCommunication = new java.util.ArrayList<Communication>();
1818                }
1819                return myCommunication;
1820        }
1821
1822        /**
1823         * Sets the value(s) for <b>communication</b> ()
1824         *
1825     * <p>
1826     * <b>Definition:</b>
1827     * Languages which may be used to communicate with the patient about his or her health
1828     * </p> 
1829         */
1830        public Patient setCommunication(java.util.List<Communication> theValue) {
1831                myCommunication = theValue;
1832                return this;
1833        }
1834        
1835        
1836
1837        /**
1838         * Adds and returns a new value for <b>communication</b> ()
1839         *
1840     * <p>
1841     * <b>Definition:</b>
1842     * Languages which may be used to communicate with the patient about his or her health
1843     * </p> 
1844         */
1845        public Communication addCommunication() {
1846                Communication newType = new Communication();
1847                getCommunication().add(newType);
1848                return newType; 
1849        }
1850
1851        /**
1852         * Adds a given new value for <b>communication</b> ()
1853         *
1854         * <p>
1855         * <b>Definition:</b>
1856         * Languages which may be used to communicate with the patient about his or her health
1857         * </p>
1858         * @param theValue The communication to add (must not be <code>null</code>)
1859         */
1860        public Patient addCommunication(Communication theValue) {
1861                if (theValue == null) {
1862                        throw new NullPointerException("theValue must not be null");
1863                }
1864                getCommunication().add(theValue);
1865                return this;
1866        }
1867
1868        /**
1869         * Gets the first repetition for <b>communication</b> (),
1870         * creating it if it does not already exist.
1871         *
1872     * <p>
1873     * <b>Definition:</b>
1874     * Languages which may be used to communicate with the patient about his or her health
1875     * </p> 
1876         */
1877        public Communication getCommunicationFirstRep() {
1878                if (getCommunication().isEmpty()) {
1879                        return addCommunication();
1880                }
1881                return getCommunication().get(0); 
1882        }
1883  
1884        /**
1885         * Gets the value(s) for <b>careProvider</b> ().
1886         * creating it if it does
1887         * not exist. Will not return <code>null</code>.
1888         *
1889     * <p>
1890     * <b>Definition:</b>
1891     * Patient's nominated care provider
1892     * </p> 
1893         */
1894        public java.util.List<ResourceReferenceDt> getCareProvider() {  
1895                if (myCareProvider == null) {
1896                        myCareProvider = new java.util.ArrayList<ResourceReferenceDt>();
1897                }
1898                return myCareProvider;
1899        }
1900
1901        /**
1902         * Sets the value(s) for <b>careProvider</b> ()
1903         *
1904     * <p>
1905     * <b>Definition:</b>
1906     * Patient's nominated care provider
1907     * </p> 
1908         */
1909        public Patient setCareProvider(java.util.List<ResourceReferenceDt> theValue) {
1910                myCareProvider = theValue;
1911                return this;
1912        }
1913        
1914        
1915
1916        /**
1917         * Adds and returns a new value for <b>careProvider</b> ()
1918         *
1919     * <p>
1920     * <b>Definition:</b>
1921     * Patient's nominated care provider
1922     * </p> 
1923         */
1924        public ResourceReferenceDt addCareProvider() {
1925                ResourceReferenceDt newType = new ResourceReferenceDt();
1926                getCareProvider().add(newType);
1927                return newType; 
1928        }
1929  
1930        /**
1931         * Gets the value(s) for <b>managingOrganization</b> ().
1932         * creating it if it does
1933         * not exist. Will not return <code>null</code>.
1934         *
1935     * <p>
1936     * <b>Definition:</b>
1937     * Organization that is the custodian of the patient record
1938     * </p> 
1939         */
1940        public ResourceReferenceDt getManagingOrganization() {  
1941                if (myManagingOrganization == null) {
1942                        myManagingOrganization = new ResourceReferenceDt();
1943                }
1944                return myManagingOrganization;
1945        }
1946
1947        /**
1948         * Sets the value(s) for <b>managingOrganization</b> ()
1949         *
1950     * <p>
1951     * <b>Definition:</b>
1952     * Organization that is the custodian of the patient record
1953     * </p> 
1954         */
1955        public Patient setManagingOrganization(ResourceReferenceDt theValue) {
1956                myManagingOrganization = theValue;
1957                return this;
1958        }
1959        
1960        
1961
1962  
1963        /**
1964         * Gets the value(s) for <b>link</b> ().
1965         * creating it if it does
1966         * not exist. Will not return <code>null</code>.
1967         *
1968     * <p>
1969     * <b>Definition:</b>
1970     * Link to another patient resource that concerns the same actual patient
1971     * </p> 
1972         */
1973        public java.util.List<Link> getLink() {  
1974                if (myLink == null) {
1975                        myLink = new java.util.ArrayList<Link>();
1976                }
1977                return myLink;
1978        }
1979
1980        /**
1981         * Sets the value(s) for <b>link</b> ()
1982         *
1983     * <p>
1984     * <b>Definition:</b>
1985     * Link to another patient resource that concerns the same actual patient
1986     * </p> 
1987         */
1988        public Patient setLink(java.util.List<Link> theValue) {
1989                myLink = theValue;
1990                return this;
1991        }
1992        
1993        
1994
1995        /**
1996         * Adds and returns a new value for <b>link</b> ()
1997         *
1998     * <p>
1999     * <b>Definition:</b>
2000     * Link to another patient resource that concerns the same actual patient
2001     * </p> 
2002         */
2003        public Link addLink() {
2004                Link newType = new Link();
2005                getLink().add(newType);
2006                return newType; 
2007        }
2008
2009        /**
2010         * Adds a given new value for <b>link</b> ()
2011         *
2012         * <p>
2013         * <b>Definition:</b>
2014         * Link to another patient resource that concerns the same actual patient
2015         * </p>
2016         * @param theValue The link to add (must not be <code>null</code>)
2017         */
2018        public Patient addLink(Link theValue) {
2019                if (theValue == null) {
2020                        throw new NullPointerException("theValue must not be null");
2021                }
2022                getLink().add(theValue);
2023                return this;
2024        }
2025
2026        /**
2027         * Gets the first repetition for <b>link</b> (),
2028         * creating it if it does not already exist.
2029         *
2030     * <p>
2031     * <b>Definition:</b>
2032     * Link to another patient resource that concerns the same actual patient
2033     * </p> 
2034         */
2035        public Link getLinkFirstRep() {
2036                if (getLink().isEmpty()) {
2037                        return addLink();
2038                }
2039                return getLink().get(0); 
2040        }
2041  
2042        /**
2043         * Block class for child element: <b>Patient.contact</b> ()
2044         *
2045     * <p>
2046     * <b>Definition:</b>
2047     * A contact party (e.g. guardian, partner, friend) for the patient
2048     * </p> 
2049         */
2050        @Block()        
2051        public static class Contact 
2052            extends  BaseIdentifiableElement        implements IResourceBlock {
2053        
2054        @Child(name="relationship", type=CodeableConceptDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)       
2055        @Description(
2056                shortDefinition="",
2057                formalDefinition="The nature of the relationship between the patient and the contact person"
2058        )
2059        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/valueset-patient-contact-relationship")
2060        private java.util.List<CodeableConceptDt> myRelationship;
2061        
2062        @Child(name="name", type=HumanNameDt.class, order=1, min=0, max=1, summary=false, modifier=false)       
2063        @Description(
2064                shortDefinition="",
2065                formalDefinition="A name associated with the contact person"
2066        )
2067        private HumanNameDt myName;
2068        
2069        @Child(name="telecom", type=ContactPointDt.class, order=2, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)       
2070        @Description(
2071                shortDefinition="",
2072                formalDefinition="A contact detail for the person, e.g. a telephone number or an email address."
2073        )
2074        private java.util.List<ContactPointDt> myTelecom;
2075        
2076        @Child(name="address", type=AddressDt.class, order=3, min=0, max=1, summary=false, modifier=false)      
2077        @Description(
2078                shortDefinition="",
2079                formalDefinition="Address for the contact person"
2080        )
2081        private AddressDt myAddress;
2082        
2083        @Child(name="gender", type=CodeDt.class, order=4, min=0, max=1, summary=false, modifier=false)  
2084        @Description(
2085                shortDefinition="",
2086                formalDefinition="Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes."
2087        )
2088        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/administrative-gender")
2089        private BoundCodeDt<AdministrativeGenderEnum> myGender;
2090        
2091        @Child(name="organization", order=5, min=0, max=1, summary=false, modifier=false, type={
2092                ca.uhn.fhir.model.dstu2.resource.Organization.class     })
2093        @Description(
2094                shortDefinition="",
2095                formalDefinition="Organization on behalf of which the contact is acting or for which the contact is working."
2096        )
2097        private ResourceReferenceDt myOrganization;
2098        
2099        @Child(name="period", type=PeriodDt.class, order=6, min=0, max=1, summary=false, modifier=false)        
2100        @Description(
2101                shortDefinition="",
2102                formalDefinition="The period during which this contact person or organization is valid to be contacted relating to this patient"
2103        )
2104        private PeriodDt myPeriod;
2105        
2106
2107        @Override
2108        public boolean isEmpty() {
2109                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myRelationship,  myName,  myTelecom,  myAddress,  myGender,  myOrganization,  myPeriod);
2110        }
2111        
2112        @Override
2113        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2114                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRelationship, myName, myTelecom, myAddress, myGender, myOrganization, myPeriod);
2115        }
2116
2117        /**
2118         * Gets the value(s) for <b>relationship</b> ().
2119         * creating it if it does
2120         * not exist. Will not return <code>null</code>.
2121         *
2122     * <p>
2123     * <b>Definition:</b>
2124     * The nature of the relationship between the patient and the contact person
2125     * </p> 
2126         */
2127        public java.util.List<CodeableConceptDt> getRelationship() {  
2128                if (myRelationship == null) {
2129                        myRelationship = new java.util.ArrayList<CodeableConceptDt>();
2130                }
2131                return myRelationship;
2132        }
2133
2134        /**
2135         * Sets the value(s) for <b>relationship</b> ()
2136         *
2137     * <p>
2138     * <b>Definition:</b>
2139     * The nature of the relationship between the patient and the contact person
2140     * </p> 
2141         */
2142        public Contact setRelationship(java.util.List<CodeableConceptDt> theValue) {
2143                myRelationship = theValue;
2144                return this;
2145        }
2146        
2147        
2148
2149        /**
2150         * Adds and returns a new value for <b>relationship</b> ()
2151         *
2152     * <p>
2153     * <b>Definition:</b>
2154     * The nature of the relationship between the patient and the contact person
2155     * </p> 
2156         */
2157        public CodeableConceptDt addRelationship() {
2158                CodeableConceptDt newType = new CodeableConceptDt();
2159                getRelationship().add(newType);
2160                return newType; 
2161        }
2162
2163        /**
2164         * Adds a given new value for <b>relationship</b> ()
2165         *
2166         * <p>
2167         * <b>Definition:</b>
2168         * The nature of the relationship between the patient and the contact person
2169         * </p>
2170         * @param theValue The relationship to add (must not be <code>null</code>)
2171         */
2172        public Contact addRelationship(CodeableConceptDt theValue) {
2173                if (theValue == null) {
2174                        throw new NullPointerException("theValue must not be null");
2175                }
2176                getRelationship().add(theValue);
2177                return this;
2178        }
2179
2180        /**
2181         * Gets the first repetition for <b>relationship</b> (),
2182         * creating it if it does not already exist.
2183         *
2184     * <p>
2185     * <b>Definition:</b>
2186     * The nature of the relationship between the patient and the contact person
2187     * </p> 
2188         */
2189        public CodeableConceptDt getRelationshipFirstRep() {
2190                if (getRelationship().isEmpty()) {
2191                        return addRelationship();
2192                }
2193                return getRelationship().get(0); 
2194        }
2195  
2196        /**
2197         * Gets the value(s) for <b>name</b> ().
2198         * creating it if it does
2199         * not exist. Will not return <code>null</code>.
2200         *
2201     * <p>
2202     * <b>Definition:</b>
2203     * A name associated with the contact person
2204     * </p> 
2205         */
2206        public HumanNameDt getName() {  
2207                if (myName == null) {
2208                        myName = new HumanNameDt();
2209                }
2210                return myName;
2211        }
2212
2213        /**
2214         * Sets the value(s) for <b>name</b> ()
2215         *
2216     * <p>
2217     * <b>Definition:</b>
2218     * A name associated with the contact person
2219     * </p> 
2220         */
2221        public Contact setName(HumanNameDt theValue) {
2222                myName = theValue;
2223                return this;
2224        }
2225        
2226        
2227
2228  
2229        /**
2230         * Gets the value(s) for <b>telecom</b> ().
2231         * creating it if it does
2232         * not exist. Will not return <code>null</code>.
2233         *
2234     * <p>
2235     * <b>Definition:</b>
2236     * A contact detail for the person, e.g. a telephone number or an email address.
2237     * </p> 
2238         */
2239        public java.util.List<ContactPointDt> getTelecom() {  
2240                if (myTelecom == null) {
2241                        myTelecom = new java.util.ArrayList<ContactPointDt>();
2242                }
2243                return myTelecom;
2244        }
2245
2246        /**
2247         * Sets the value(s) for <b>telecom</b> ()
2248         *
2249     * <p>
2250     * <b>Definition:</b>
2251     * A contact detail for the person, e.g. a telephone number or an email address.
2252     * </p> 
2253         */
2254        public Contact setTelecom(java.util.List<ContactPointDt> theValue) {
2255                myTelecom = theValue;
2256                return this;
2257        }
2258        
2259        
2260
2261        /**
2262         * Adds and returns a new value for <b>telecom</b> ()
2263         *
2264     * <p>
2265     * <b>Definition:</b>
2266     * A contact detail for the person, e.g. a telephone number or an email address.
2267     * </p> 
2268         */
2269        public ContactPointDt addTelecom() {
2270                ContactPointDt newType = new ContactPointDt();
2271                getTelecom().add(newType);
2272                return newType; 
2273        }
2274
2275        /**
2276         * Adds a given new value for <b>telecom</b> ()
2277         *
2278         * <p>
2279         * <b>Definition:</b>
2280         * A contact detail for the person, e.g. a telephone number or an email address.
2281         * </p>
2282         * @param theValue The telecom to add (must not be <code>null</code>)
2283         */
2284        public Contact addTelecom(ContactPointDt theValue) {
2285                if (theValue == null) {
2286                        throw new NullPointerException("theValue must not be null");
2287                }
2288                getTelecom().add(theValue);
2289                return this;
2290        }
2291
2292        /**
2293         * Gets the first repetition for <b>telecom</b> (),
2294         * creating it if it does not already exist.
2295         *
2296     * <p>
2297     * <b>Definition:</b>
2298     * A contact detail for the person, e.g. a telephone number or an email address.
2299     * </p> 
2300         */
2301        public ContactPointDt getTelecomFirstRep() {
2302                if (getTelecom().isEmpty()) {
2303                        return addTelecom();
2304                }
2305                return getTelecom().get(0); 
2306        }
2307  
2308        /**
2309         * Gets the value(s) for <b>address</b> ().
2310         * creating it if it does
2311         * not exist. Will not return <code>null</code>.
2312         *
2313     * <p>
2314     * <b>Definition:</b>
2315     * Address for the contact person
2316     * </p> 
2317         */
2318        public AddressDt getAddress() {  
2319                if (myAddress == null) {
2320                        myAddress = new AddressDt();
2321                }
2322                return myAddress;
2323        }
2324
2325        /**
2326         * Sets the value(s) for <b>address</b> ()
2327         *
2328     * <p>
2329     * <b>Definition:</b>
2330     * Address for the contact person
2331     * </p> 
2332         */
2333        public Contact setAddress(AddressDt theValue) {
2334                myAddress = theValue;
2335                return this;
2336        }
2337        
2338        
2339
2340  
2341        /**
2342         * Gets the value(s) for <b>gender</b> ().
2343         * creating it if it does
2344         * not exist. Will not return <code>null</code>.
2345         *
2346     * <p>
2347     * <b>Definition:</b>
2348     * Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.
2349     * </p> 
2350         */
2351        public BoundCodeDt<AdministrativeGenderEnum> getGenderElement() {  
2352                if (myGender == null) {
2353                        myGender = new BoundCodeDt<AdministrativeGenderEnum>(AdministrativeGenderEnum.VALUESET_BINDER);
2354                }
2355                return myGender;
2356        }
2357
2358        
2359        /**
2360         * Gets the value(s) for <b>gender</b> ().
2361         * creating it if it does
2362         * not exist. This method may return <code>null</code>.
2363         *
2364     * <p>
2365     * <b>Definition:</b>
2366     * Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.
2367     * </p> 
2368         */
2369        public String getGender() {  
2370                return getGenderElement().getValue();
2371        }
2372
2373        /**
2374         * Sets the value(s) for <b>gender</b> ()
2375         *
2376     * <p>
2377     * <b>Definition:</b>
2378     * Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.
2379     * </p> 
2380         */
2381        public Contact setGender(BoundCodeDt<AdministrativeGenderEnum> theValue) {
2382                myGender = theValue;
2383                return this;
2384        }
2385        
2386        
2387
2388        /**
2389         * Sets the value(s) for <b>gender</b> ()
2390         *
2391     * <p>
2392     * <b>Definition:</b>
2393     * Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.
2394     * </p> 
2395         */
2396        public Contact setGender(AdministrativeGenderEnum theValue) {
2397                setGender(new BoundCodeDt<AdministrativeGenderEnum>(AdministrativeGenderEnum.VALUESET_BINDER, theValue));
2398                
2399/*
2400                getGenderElement().setValueAsEnum(theValue);
2401*/
2402                return this;
2403        }
2404
2405  
2406        /**
2407         * Gets the value(s) for <b>organization</b> ().
2408         * creating it if it does
2409         * not exist. Will not return <code>null</code>.
2410         *
2411     * <p>
2412     * <b>Definition:</b>
2413     * Organization on behalf of which the contact is acting or for which the contact is working.
2414     * </p> 
2415         */
2416        public ResourceReferenceDt getOrganization() {  
2417                if (myOrganization == null) {
2418                        myOrganization = new ResourceReferenceDt();
2419                }
2420                return myOrganization;
2421        }
2422
2423        /**
2424         * Sets the value(s) for <b>organization</b> ()
2425         *
2426     * <p>
2427     * <b>Definition:</b>
2428     * Organization on behalf of which the contact is acting or for which the contact is working.
2429     * </p> 
2430         */
2431        public Contact setOrganization(ResourceReferenceDt theValue) {
2432                myOrganization = theValue;
2433                return this;
2434        }
2435        
2436        
2437
2438  
2439        /**
2440         * Gets the value(s) for <b>period</b> ().
2441         * creating it if it does
2442         * not exist. Will not return <code>null</code>.
2443         *
2444     * <p>
2445     * <b>Definition:</b>
2446     * The period during which this contact person or organization is valid to be contacted relating to this patient
2447     * </p> 
2448         */
2449        public PeriodDt getPeriod() {  
2450                if (myPeriod == null) {
2451                        myPeriod = new PeriodDt();
2452                }
2453                return myPeriod;
2454        }
2455
2456        /**
2457         * Sets the value(s) for <b>period</b> ()
2458         *
2459     * <p>
2460     * <b>Definition:</b>
2461     * The period during which this contact person or organization is valid to be contacted relating to this patient
2462     * </p> 
2463         */
2464        public Contact setPeriod(PeriodDt theValue) {
2465                myPeriod = theValue;
2466                return this;
2467        }
2468        
2469        
2470
2471  
2472
2473
2474        }
2475
2476
2477        /**
2478         * Block class for child element: <b>Patient.animal</b> ()
2479         *
2480     * <p>
2481     * <b>Definition:</b>
2482     * This patient is known to be an animal
2483     * </p> 
2484         */
2485        @Block()        
2486        public static class Animal 
2487            extends  BaseIdentifiableElement        implements IResourceBlock {
2488        
2489        @Child(name="species", type=CodeableConceptDt.class, order=0, min=1, max=1, summary=true, modifier=false)       
2490        @Description(
2491                shortDefinition="",
2492                formalDefinition="Identifies the high level taxonomic categorization of the kind of animal"
2493        )
2494        private CodeableConceptDt mySpecies;
2495        
2496        @Child(name="breed", type=CodeableConceptDt.class, order=1, min=0, max=1, summary=true, modifier=false) 
2497        @Description(
2498                shortDefinition="",
2499                formalDefinition="Identifies the detailed categorization of the kind of animal."
2500        )
2501        private CodeableConceptDt myBreed;
2502        
2503        @Child(name="genderStatus", type=CodeableConceptDt.class, order=2, min=0, max=1, summary=true, modifier=false)  
2504        @Description(
2505                shortDefinition="",
2506                formalDefinition="Indicates the current state of the animal's reproductive organs"
2507        )
2508        private CodeableConceptDt myGenderStatus;
2509        
2510
2511        @Override
2512        public boolean isEmpty() {
2513                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  mySpecies,  myBreed,  myGenderStatus);
2514        }
2515        
2516        @Override
2517        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2518                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySpecies, myBreed, myGenderStatus);
2519        }
2520
2521        /**
2522         * Gets the value(s) for <b>species</b> ().
2523         * creating it if it does
2524         * not exist. Will not return <code>null</code>.
2525         *
2526     * <p>
2527     * <b>Definition:</b>
2528     * Identifies the high level taxonomic categorization of the kind of animal
2529     * </p> 
2530         */
2531        public CodeableConceptDt getSpecies() {  
2532                if (mySpecies == null) {
2533                        mySpecies = new CodeableConceptDt();
2534                }
2535                return mySpecies;
2536        }
2537
2538        /**
2539         * Sets the value(s) for <b>species</b> ()
2540         *
2541     * <p>
2542     * <b>Definition:</b>
2543     * Identifies the high level taxonomic categorization of the kind of animal
2544     * </p> 
2545         */
2546        public Animal setSpecies(CodeableConceptDt theValue) {
2547                mySpecies = theValue;
2548                return this;
2549        }
2550        
2551        
2552
2553  
2554        /**
2555         * Gets the value(s) for <b>breed</b> ().
2556         * creating it if it does
2557         * not exist. Will not return <code>null</code>.
2558         *
2559     * <p>
2560     * <b>Definition:</b>
2561     * Identifies the detailed categorization of the kind of animal.
2562     * </p> 
2563         */
2564        public CodeableConceptDt getBreed() {  
2565                if (myBreed == null) {
2566                        myBreed = new CodeableConceptDt();
2567                }
2568                return myBreed;
2569        }
2570
2571        /**
2572         * Sets the value(s) for <b>breed</b> ()
2573         *
2574     * <p>
2575     * <b>Definition:</b>
2576     * Identifies the detailed categorization of the kind of animal.
2577     * </p> 
2578         */
2579        public Animal setBreed(CodeableConceptDt theValue) {
2580                myBreed = theValue;
2581                return this;
2582        }
2583        
2584        
2585
2586  
2587        /**
2588         * Gets the value(s) for <b>genderStatus</b> ().
2589         * creating it if it does
2590         * not exist. Will not return <code>null</code>.
2591         *
2592     * <p>
2593     * <b>Definition:</b>
2594     * Indicates the current state of the animal's reproductive organs
2595     * </p> 
2596         */
2597        public CodeableConceptDt getGenderStatus() {  
2598                if (myGenderStatus == null) {
2599                        myGenderStatus = new CodeableConceptDt();
2600                }
2601                return myGenderStatus;
2602        }
2603
2604        /**
2605         * Sets the value(s) for <b>genderStatus</b> ()
2606         *
2607     * <p>
2608     * <b>Definition:</b>
2609     * Indicates the current state of the animal's reproductive organs
2610     * </p> 
2611         */
2612        public Animal setGenderStatus(CodeableConceptDt theValue) {
2613                myGenderStatus = theValue;
2614                return this;
2615        }
2616        
2617        
2618
2619  
2620
2621
2622        }
2623
2624
2625        /**
2626         * Block class for child element: <b>Patient.communication</b> ()
2627         *
2628     * <p>
2629     * <b>Definition:</b>
2630     * Languages which may be used to communicate with the patient about his or her health
2631     * </p> 
2632         */
2633        @Block()        
2634        public static class Communication 
2635            extends  BaseIdentifiableElement        implements IResourceBlock {
2636        
2637        @Child(name="language", type=CodeableConceptDt.class, order=0, min=1, max=1, summary=false, modifier=false)     
2638        @Description(
2639                shortDefinition="",
2640                formalDefinition="The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English"
2641        )
2642        private CodeableConceptDt myLanguage;
2643        
2644        @Child(name="preferred", type=BooleanDt.class, order=1, min=0, max=1, summary=false, modifier=false)    
2645        @Description(
2646                shortDefinition="",
2647                formalDefinition="Indicates whether or not the patient prefers this language (over other languages he masters up a certain level)"
2648        )
2649        private BooleanDt myPreferred;
2650        
2651
2652        @Override
2653        public boolean isEmpty() {
2654                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myLanguage,  myPreferred);
2655        }
2656        
2657        @Override
2658        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2659                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myLanguage, myPreferred);
2660        }
2661
2662        /**
2663         * Gets the value(s) for <b>language</b> ().
2664         * creating it if it does
2665         * not exist. Will not return <code>null</code>.
2666         *
2667     * <p>
2668     * <b>Definition:</b>
2669     * The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \&quot;en\&quot; for English, or \&quot;en-US\&quot; for American English versus \&quot;en-EN\&quot; for England English
2670     * </p> 
2671         */
2672        public CodeableConceptDt getLanguage() {  
2673                if (myLanguage == null) {
2674                        myLanguage = new CodeableConceptDt();
2675                }
2676                return myLanguage;
2677        }
2678
2679        /**
2680         * Sets the value(s) for <b>language</b> ()
2681         *
2682     * <p>
2683     * <b>Definition:</b>
2684     * The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \&quot;en\&quot; for English, or \&quot;en-US\&quot; for American English versus \&quot;en-EN\&quot; for England English
2685     * </p> 
2686         */
2687        public Communication setLanguage(CodeableConceptDt theValue) {
2688                myLanguage = theValue;
2689                return this;
2690        }
2691        
2692        
2693
2694  
2695        /**
2696         * Gets the value(s) for <b>preferred</b> ().
2697         * creating it if it does
2698         * not exist. Will not return <code>null</code>.
2699         *
2700     * <p>
2701     * <b>Definition:</b>
2702     * Indicates whether or not the patient prefers this language (over other languages he masters up a certain level)
2703     * </p> 
2704         */
2705        public BooleanDt getPreferredElement() {  
2706                if (myPreferred == null) {
2707                        myPreferred = new BooleanDt();
2708                }
2709                return myPreferred;
2710        }
2711
2712        
2713        /**
2714         * Gets the value(s) for <b>preferred</b> ().
2715         * creating it if it does
2716         * not exist. This method may return <code>null</code>.
2717         *
2718     * <p>
2719     * <b>Definition:</b>
2720     * Indicates whether or not the patient prefers this language (over other languages he masters up a certain level)
2721     * </p> 
2722         */
2723        public Boolean getPreferred() {  
2724                return getPreferredElement().getValue();
2725        }
2726
2727        /**
2728         * Sets the value(s) for <b>preferred</b> ()
2729         *
2730     * <p>
2731     * <b>Definition:</b>
2732     * Indicates whether or not the patient prefers this language (over other languages he masters up a certain level)
2733     * </p> 
2734         */
2735        public Communication setPreferred(BooleanDt theValue) {
2736                myPreferred = theValue;
2737                return this;
2738        }
2739        
2740        
2741
2742        /**
2743         * Sets the value for <b>preferred</b> ()
2744         *
2745     * <p>
2746     * <b>Definition:</b>
2747     * Indicates whether or not the patient prefers this language (over other languages he masters up a certain level)
2748     * </p> 
2749         */
2750        public Communication setPreferred( boolean theBoolean) {
2751                myPreferred = new BooleanDt(theBoolean); 
2752                return this; 
2753        }
2754
2755 
2756
2757
2758        }
2759
2760
2761        /**
2762         * Block class for child element: <b>Patient.link</b> ()
2763         *
2764     * <p>
2765     * <b>Definition:</b>
2766     * Link to another patient resource that concerns the same actual patient
2767     * </p> 
2768         */
2769        @Block()        
2770        public static class Link 
2771            extends  BaseIdentifiableElement        implements IResourceBlock {
2772        
2773        @Child(name="other", order=0, min=1, max=1, summary=false, modifier=true, type={
2774                ca.uhn.fhir.model.dstu2.resource.Patient.class  })
2775        @Description(
2776                shortDefinition="",
2777                formalDefinition="The other patient resource that the link refers to"
2778        )
2779        private ResourceReferenceDt myOther;
2780        
2781        @Child(name="type", type=CodeDt.class, order=1, min=1, max=1, summary=false, modifier=true)     
2782        @Description(
2783                shortDefinition="",
2784                formalDefinition="The type of link between this patient resource and another patient resource."
2785        )
2786        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/link-type")
2787        private BoundCodeDt<LinkTypeEnum> myType;
2788        
2789
2790        @Override
2791        public boolean isEmpty() {
2792                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myOther,  myType);
2793        }
2794        
2795        @Override
2796        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
2797                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myOther, myType);
2798        }
2799
2800        /**
2801         * Gets the value(s) for <b>other</b> ().
2802         * creating it if it does
2803         * not exist. Will not return <code>null</code>.
2804         *
2805     * <p>
2806     * <b>Definition:</b>
2807     * The other patient resource that the link refers to
2808     * </p> 
2809         */
2810        public ResourceReferenceDt getOther() {  
2811                if (myOther == null) {
2812                        myOther = new ResourceReferenceDt();
2813                }
2814                return myOther;
2815        }
2816
2817        /**
2818         * Sets the value(s) for <b>other</b> ()
2819         *
2820     * <p>
2821     * <b>Definition:</b>
2822     * The other patient resource that the link refers to
2823     * </p> 
2824         */
2825        public Link setOther(ResourceReferenceDt theValue) {
2826                myOther = theValue;
2827                return this;
2828        }
2829        
2830        
2831
2832  
2833        /**
2834         * Gets the value(s) for <b>type</b> ().
2835         * creating it if it does
2836         * not exist. Will not return <code>null</code>.
2837         *
2838     * <p>
2839     * <b>Definition:</b>
2840     * The type of link between this patient resource and another patient resource.
2841     * </p> 
2842         */
2843        public BoundCodeDt<LinkTypeEnum> getTypeElement() {  
2844                if (myType == null) {
2845                        myType = new BoundCodeDt<LinkTypeEnum>(LinkTypeEnum.VALUESET_BINDER);
2846                }
2847                return myType;
2848        }
2849
2850        
2851        /**
2852         * Gets the value(s) for <b>type</b> ().
2853         * creating it if it does
2854         * not exist. This method may return <code>null</code>.
2855         *
2856     * <p>
2857     * <b>Definition:</b>
2858     * The type of link between this patient resource and another patient resource.
2859     * </p> 
2860         */
2861        public String getType() {  
2862                return getTypeElement().getValue();
2863        }
2864
2865        /**
2866         * Sets the value(s) for <b>type</b> ()
2867         *
2868     * <p>
2869     * <b>Definition:</b>
2870     * The type of link between this patient resource and another patient resource.
2871     * </p> 
2872         */
2873        public Link setType(BoundCodeDt<LinkTypeEnum> theValue) {
2874                myType = theValue;
2875                return this;
2876        }
2877        
2878        
2879
2880        /**
2881         * Sets the value(s) for <b>type</b> ()
2882         *
2883     * <p>
2884     * <b>Definition:</b>
2885     * The type of link between this patient resource and another patient resource.
2886     * </p> 
2887         */
2888        public Link setType(LinkTypeEnum theValue) {
2889                setType(new BoundCodeDt<LinkTypeEnum>(LinkTypeEnum.VALUESET_BINDER, theValue));
2890                
2891/*
2892                getTypeElement().setValueAsEnum(theValue);
2893*/
2894                return this;
2895        }
2896
2897  
2898
2899
2900        }
2901
2902
2903
2904
2905    @Override
2906    public String getResourceName() {
2907        return "Patient";
2908    }
2909    
2910    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
2911        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
2912    }
2913
2914
2915}