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.valueset.AnimalSpeciesEnum;
042import ca.uhn.fhir.model.dstu2.composite.AnnotationDt;
043import ca.uhn.fhir.model.dstu2.valueset.AnswerFormatEnum;
044import ca.uhn.fhir.model.dstu2.resource.Appointment;
045import ca.uhn.fhir.model.dstu2.valueset.AppointmentStatusEnum;
046import ca.uhn.fhir.model.dstu2.valueset.AssertionDirectionTypeEnum;
047import ca.uhn.fhir.model.dstu2.valueset.AssertionOperatorTypeEnum;
048import ca.uhn.fhir.model.dstu2.valueset.AssertionResponseTypesEnum;
049import ca.uhn.fhir.model.dstu2.composite.AttachmentDt;
050import ca.uhn.fhir.model.dstu2.valueset.AuditEventActionEnum;
051import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectLifecycleEnum;
052import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectRoleEnum;
053import ca.uhn.fhir.model.dstu2.valueset.AuditEventObjectTypeEnum;
054import ca.uhn.fhir.model.dstu2.valueset.AuditEventOutcomeEnum;
055import ca.uhn.fhir.model.dstu2.valueset.AuditEventParticipantNetworkTypeEnum;
056import ca.uhn.fhir.model.dstu2.valueset.AuditEventSourceTypeEnum;
057import ca.uhn.fhir.model.dstu2.valueset.BindingStrengthEnum;
058import ca.uhn.fhir.model.dstu2.resource.BodySite;
059import ca.uhn.fhir.model.dstu2.valueset.BundleTypeEnum;
060import ca.uhn.fhir.model.dstu2.resource.CarePlan;
061import ca.uhn.fhir.model.dstu2.valueset.CarePlanActivityCategoryEnum;
062import ca.uhn.fhir.model.dstu2.valueset.CarePlanActivityStatusEnum;
063import ca.uhn.fhir.model.dstu2.valueset.CarePlanRelationshipEnum;
064import ca.uhn.fhir.model.dstu2.valueset.CarePlanStatusEnum;
065import ca.uhn.fhir.model.dstu2.resource.Claim;
066import ca.uhn.fhir.model.dstu2.resource.ClaimResponse;
067import ca.uhn.fhir.model.dstu2.valueset.ClaimTypeEnum;
068import ca.uhn.fhir.model.dstu2.resource.ClinicalImpression;
069import ca.uhn.fhir.model.dstu2.valueset.ClinicalImpressionStatusEnum;
070import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt;
071import ca.uhn.fhir.model.dstu2.composite.CodingDt;
072import ca.uhn.fhir.model.dstu2.resource.CommunicationRequest;
073import ca.uhn.fhir.model.dstu2.valueset.CommunicationRequestStatusEnum;
074import ca.uhn.fhir.model.dstu2.valueset.CommunicationStatusEnum;
075import ca.uhn.fhir.model.dstu2.resource.Composition;
076import ca.uhn.fhir.model.dstu2.valueset.CompositionAttestationModeEnum;
077import ca.uhn.fhir.model.dstu2.valueset.CompositionStatusEnum;
078import ca.uhn.fhir.model.dstu2.valueset.ConceptMapEquivalenceEnum;
079import ca.uhn.fhir.model.dstu2.resource.Condition;
080import ca.uhn.fhir.model.dstu2.valueset.ConditionCategoryCodesEnum;
081import ca.uhn.fhir.model.dstu2.valueset.ConditionClinicalStatusCodesEnum;
082import ca.uhn.fhir.model.dstu2.valueset.ConditionVerificationStatusEnum;
083import ca.uhn.fhir.model.dstu2.valueset.ConditionalDeleteStatusEnum;
084import ca.uhn.fhir.model.dstu2.valueset.ConditionsCodesEnum;
085import ca.uhn.fhir.model.dstu2.resource.Conformance;
086import ca.uhn.fhir.model.dstu2.valueset.ConformanceEventModeEnum;
087import ca.uhn.fhir.model.dstu2.valueset.ConformanceResourceStatusEnum;
088import ca.uhn.fhir.model.dstu2.valueset.ConformanceStatementKindEnum;
089import ca.uhn.fhir.model.dstu2.composite.ContactPointDt;
090import ca.uhn.fhir.model.dstu2.valueset.ContentTypeEnum;
091import ca.uhn.fhir.model.dstu2.resource.Contract;
092import ca.uhn.fhir.model.dstu2.valueset.ContractActionCodesEnum;
093import ca.uhn.fhir.model.dstu2.valueset.ContractActorRoleCodesEnum;
094import ca.uhn.fhir.model.dstu2.valueset.ContractSubtypeCodesEnum;
095import ca.uhn.fhir.model.dstu2.valueset.ContractTermTypeCodesEnum;
096import ca.uhn.fhir.model.dstu2.valueset.ContractTypeCodesEnum;
097import ca.uhn.fhir.model.dstu2.resource.Coverage;
098import ca.uhn.fhir.model.dstu2.valueset.DataElementStringencyEnum;
099import ca.uhn.fhir.model.dstu2.valueset.DaysOfWeekEnum;
100import ca.uhn.fhir.model.dstu2.valueset.DetectedIssueSeverityEnum;
101import ca.uhn.fhir.model.dstu2.resource.Device;
102import ca.uhn.fhir.model.dstu2.resource.DeviceComponent;
103import ca.uhn.fhir.model.dstu2.resource.DeviceMetric;
104import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCalibrationStateEnum;
105import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCalibrationTypeEnum;
106import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricCategoryEnum;
107import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricColorEnum;
108import ca.uhn.fhir.model.dstu2.valueset.DeviceMetricOperationalStatusEnum;
109import ca.uhn.fhir.model.dstu2.valueset.DeviceStatusEnum;
110import ca.uhn.fhir.model.dstu2.resource.DeviceUseRequest;
111import ca.uhn.fhir.model.dstu2.valueset.DeviceUseRequestPriorityEnum;
112import ca.uhn.fhir.model.dstu2.valueset.DeviceUseRequestStatusEnum;
113import ca.uhn.fhir.model.dstu2.resource.DiagnosticOrder;
114import ca.uhn.fhir.model.dstu2.valueset.DiagnosticOrderPriorityEnum;
115import ca.uhn.fhir.model.dstu2.valueset.DiagnosticOrderStatusEnum;
116import ca.uhn.fhir.model.dstu2.resource.DiagnosticReport;
117import ca.uhn.fhir.model.dstu2.valueset.DiagnosticReportStatusEnum;
118import ca.uhn.fhir.model.dstu2.valueset.DigitalMediaTypeEnum;
119import ca.uhn.fhir.model.dstu2.valueset.DocumentModeEnum;
120import ca.uhn.fhir.model.dstu2.resource.DocumentReference;
121import ca.uhn.fhir.model.dstu2.valueset.DocumentReferenceStatusEnum;
122import ca.uhn.fhir.model.dstu2.valueset.DocumentRelationshipTypeEnum;
123import ca.uhn.fhir.model.dstu2.composite.ElementDefinitionDt;
124import ca.uhn.fhir.model.dstu2.resource.EligibilityRequest;
125import ca.uhn.fhir.model.dstu2.resource.Encounter;
126import ca.uhn.fhir.model.dstu2.valueset.EncounterClassEnum;
127import ca.uhn.fhir.model.dstu2.valueset.EncounterLocationStatusEnum;
128import ca.uhn.fhir.model.dstu2.valueset.EncounterStateEnum;
129import ca.uhn.fhir.model.dstu2.valueset.EncounterTypeEnum;
130import ca.uhn.fhir.model.dstu2.resource.EnrollmentRequest;
131import ca.uhn.fhir.model.dstu2.valueset.EnteralFormulaTypeCodesEnum;
132import ca.uhn.fhir.model.dstu2.resource.EpisodeOfCare;
133import ca.uhn.fhir.model.dstu2.valueset.EpisodeOfCareStatusEnum;
134import ca.uhn.fhir.model.dstu2.valueset.ExceptionCodesEnum;
135import ca.uhn.fhir.model.dstu2.valueset.ExtensionContextEnum;
136import ca.uhn.fhir.model.dstu2.valueset.FamilyHistoryStatusEnum;
137import ca.uhn.fhir.model.dstu2.resource.FamilyMemberHistory;
138import ca.uhn.fhir.model.dstu2.valueset.FilterOperatorEnum;
139import ca.uhn.fhir.model.dstu2.valueset.FlagCategoryCodesEnum;
140import ca.uhn.fhir.model.dstu2.valueset.FlagStatusEnum;
141import ca.uhn.fhir.model.dstu2.valueset.FluidConsistencyTypeCodesEnum;
142import ca.uhn.fhir.model.dstu2.resource.Goal;
143import ca.uhn.fhir.model.dstu2.valueset.GoalCategoryEnum;
144import ca.uhn.fhir.model.dstu2.valueset.GoalPriorityEnum;
145import ca.uhn.fhir.model.dstu2.valueset.GoalStartEventEnum;
146import ca.uhn.fhir.model.dstu2.valueset.GoalStatusEnum;
147import ca.uhn.fhir.model.dstu2.valueset.GoalStatusReasonEnum;
148import ca.uhn.fhir.model.dstu2.resource.Group;
149import ca.uhn.fhir.model.dstu2.valueset.GroupTypeEnum;
150import ca.uhn.fhir.model.dstu2.valueset.GuideDependencyTypeEnum;
151import ca.uhn.fhir.model.dstu2.valueset.GuidePageKindEnum;
152import ca.uhn.fhir.model.dstu2.valueset.GuideResourcePurposeEnum;
153import ca.uhn.fhir.model.dstu2.valueset.HTTPVerbEnum;
154import ca.uhn.fhir.model.dstu2.resource.HealthcareService;
155import ca.uhn.fhir.model.dstu2.composite.HumanNameDt;
156import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
157import ca.uhn.fhir.model.dstu2.valueset.IdentifierTypeCodesEnum;
158import ca.uhn.fhir.model.dstu2.valueset.IdentityAssuranceLevelEnum;
159import ca.uhn.fhir.model.dstu2.resource.ImagingObjectSelection;
160import ca.uhn.fhir.model.dstu2.resource.ImagingStudy;
161import ca.uhn.fhir.model.dstu2.resource.Immunization;
162import ca.uhn.fhir.model.dstu2.valueset.ImmunizationReasonCodesEnum;
163import ca.uhn.fhir.model.dstu2.valueset.ImmunizationRecommendationDateCriterionCodesEnum;
164import ca.uhn.fhir.model.dstu2.valueset.ImmunizationRecommendationStatusCodesEnum;
165import ca.uhn.fhir.model.dstu2.valueset.ImmunizationRouteCodesEnum;
166import ca.uhn.fhir.model.dstu2.valueset.InstanceAvailabilityEnum;
167import ca.uhn.fhir.model.dstu2.valueset.InterventionCodesEnum;
168import ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum;
169import ca.uhn.fhir.model.dstu2.valueset.IssueTypeEnum;
170import ca.uhn.fhir.model.dstu2.valueset.KOStitleEnum;
171import ca.uhn.fhir.model.dstu2.valueset.LateralityEnum;
172import ca.uhn.fhir.model.dstu2.valueset.LinkTypeEnum;
173import ca.uhn.fhir.model.dstu2.valueset.ListModeEnum;
174import ca.uhn.fhir.model.dstu2.valueset.ListOrderCodesEnum;
175import ca.uhn.fhir.model.dstu2.valueset.ListStatusEnum;
176import ca.uhn.fhir.model.dstu2.resource.Location;
177import ca.uhn.fhir.model.dstu2.valueset.LocationModeEnum;
178import ca.uhn.fhir.model.dstu2.valueset.LocationStatusEnum;
179import ca.uhn.fhir.model.dstu2.valueset.LocationTypeEnum;
180import ca.uhn.fhir.model.dstu2.valueset.MaritalStatusCodesEnum;
181import ca.uhn.fhir.model.dstu2.valueset.MeasmntPrincipleEnum;
182import ca.uhn.fhir.model.dstu2.resource.Media;
183import ca.uhn.fhir.model.dstu2.resource.Medication;
184import ca.uhn.fhir.model.dstu2.valueset.MedicationAdministrationStatusEnum;
185import ca.uhn.fhir.model.dstu2.valueset.MedicationDispenseStatusEnum;
186import ca.uhn.fhir.model.dstu2.resource.MedicationOrder;
187import ca.uhn.fhir.model.dstu2.valueset.MedicationOrderStatusEnum;
188import ca.uhn.fhir.model.dstu2.resource.MedicationStatement;
189import ca.uhn.fhir.model.dstu2.valueset.MedicationStatementStatusEnum;
190import ca.uhn.fhir.model.dstu2.valueset.MessageEventEnum;
191import ca.uhn.fhir.model.dstu2.valueset.MessageSignificanceCategoryEnum;
192import ca.uhn.fhir.model.dstu2.valueset.MessageTransportEnum;
193import ca.uhn.fhir.model.dstu2.resource.NamingSystem;
194import ca.uhn.fhir.model.dstu2.valueset.NamingSystemIdentifierTypeEnum;
195import ca.uhn.fhir.model.dstu2.valueset.NamingSystemTypeEnum;
196import ca.uhn.fhir.model.dstu2.valueset.NoteTypeEnum;
197import ca.uhn.fhir.model.dstu2.valueset.NutrientModifierCodesEnum;
198import ca.uhn.fhir.model.dstu2.resource.NutritionOrder;
199import ca.uhn.fhir.model.dstu2.valueset.NutritionOrderStatusEnum;
200import ca.uhn.fhir.model.dstu2.resource.Observation;
201import ca.uhn.fhir.model.dstu2.valueset.ObservationCategoryCodesEnum;
202import ca.uhn.fhir.model.dstu2.valueset.ObservationRelationshipTypeEnum;
203import ca.uhn.fhir.model.dstu2.valueset.ObservationStatusEnum;
204import ca.uhn.fhir.model.dstu2.resource.OperationDefinition;
205import ca.uhn.fhir.model.dstu2.valueset.OperationKindEnum;
206import ca.uhn.fhir.model.dstu2.resource.OperationOutcome;
207import ca.uhn.fhir.model.dstu2.valueset.OperationParameterUseEnum;
208import ca.uhn.fhir.model.dstu2.resource.Order;
209import ca.uhn.fhir.model.dstu2.valueset.OrderStatusEnum;
210import ca.uhn.fhir.model.dstu2.resource.Organization;
211import ca.uhn.fhir.model.dstu2.valueset.OrganizationTypeEnum;
212import ca.uhn.fhir.model.dstu2.valueset.ParticipantRequiredEnum;
213import ca.uhn.fhir.model.dstu2.valueset.ParticipantStatusEnum;
214import ca.uhn.fhir.model.dstu2.valueset.ParticipantTypeEnum;
215import ca.uhn.fhir.model.dstu2.valueset.ParticipationStatusEnum;
216import ca.uhn.fhir.model.dstu2.resource.Patient;
217import ca.uhn.fhir.model.dstu2.valueset.PayeeTypeCodesEnum;
218import ca.uhn.fhir.model.dstu2.valueset.PaymentStatusCodesEnum;
219import ca.uhn.fhir.model.dstu2.valueset.PaymentTypeCodesEnum;
220import ca.uhn.fhir.model.dstu2.composite.PeriodDt;
221import ca.uhn.fhir.model.dstu2.resource.Person;
222import ca.uhn.fhir.model.dstu2.resource.Practitioner;
223import ca.uhn.fhir.model.dstu2.valueset.PractitionerRoleEnum;
224import ca.uhn.fhir.model.dstu2.valueset.PractitionerSpecialtyEnum;
225import ca.uhn.fhir.model.dstu2.valueset.PriorityCodesEnum;
226import ca.uhn.fhir.model.dstu2.resource.Procedure;
227import ca.uhn.fhir.model.dstu2.resource.ProcedureRequest;
228import ca.uhn.fhir.model.dstu2.valueset.ProcedureRequestPriorityEnum;
229import ca.uhn.fhir.model.dstu2.valueset.ProcedureRequestStatusEnum;
230import ca.uhn.fhir.model.dstu2.valueset.ProcedureStatusEnum;
231import ca.uhn.fhir.model.dstu2.resource.ProcessRequest;
232import ca.uhn.fhir.model.dstu2.valueset.ProvenanceEntityRoleEnum;
233import ca.uhn.fhir.model.dstu2.composite.QuantityDt;
234import ca.uhn.fhir.model.dstu2.resource.Questionnaire;
235import ca.uhn.fhir.model.dstu2.resource.QuestionnaireResponse;
236import ca.uhn.fhir.model.dstu2.valueset.QuestionnaireResponseStatusEnum;
237import ca.uhn.fhir.model.dstu2.valueset.QuestionnaireStatusEnum;
238import ca.uhn.fhir.model.dstu2.composite.RangeDt;
239import ca.uhn.fhir.model.dstu2.composite.RatioDt;
240import ca.uhn.fhir.model.dstu2.valueset.ReferralMethodEnum;
241import ca.uhn.fhir.model.dstu2.resource.ReferralRequest;
242import ca.uhn.fhir.model.dstu2.valueset.ReferralStatusEnum;
243import ca.uhn.fhir.model.dstu2.resource.RelatedPerson;
244import ca.uhn.fhir.model.dstu2.valueset.RemittanceOutcomeEnum;
245import ca.uhn.fhir.model.dstu2.valueset.ResourceTypeEnum;
246import ca.uhn.fhir.model.dstu2.valueset.ResourceVersionPolicyEnum;
247import ca.uhn.fhir.model.dstu2.valueset.ResponseTypeEnum;
248import ca.uhn.fhir.model.dstu2.valueset.RestfulConformanceModeEnum;
249import ca.uhn.fhir.model.dstu2.valueset.RestfulSecurityServiceEnum;
250import ca.uhn.fhir.model.dstu2.resource.RiskAssessment;
251import ca.uhn.fhir.model.dstu2.valueset.RulesetCodesEnum;
252import ca.uhn.fhir.model.dstu2.composite.SampledDataDt;
253import ca.uhn.fhir.model.dstu2.resource.Schedule;
254import ca.uhn.fhir.model.dstu2.valueset.SearchEntryModeEnum;
255import ca.uhn.fhir.model.dstu2.valueset.SearchModifierCodeEnum;
256import ca.uhn.fhir.model.dstu2.valueset.SearchParamTypeEnum;
257import ca.uhn.fhir.model.dstu2.valueset.ServiceProvisionConditionsEnum;
258import ca.uhn.fhir.model.dstu2.composite.SignatureDt;
259import ca.uhn.fhir.model.dstu2.resource.Slot;
260import ca.uhn.fhir.model.dstu2.valueset.SlotStatusEnum;
261import ca.uhn.fhir.model.dstu2.resource.Specimen;
262import ca.uhn.fhir.model.dstu2.valueset.SpecimenCollectionMethodEnum;
263import ca.uhn.fhir.model.dstu2.valueset.SpecimenStatusEnum;
264import ca.uhn.fhir.model.dstu2.resource.StructureDefinition;
265import ca.uhn.fhir.model.dstu2.valueset.StructureDefinitionKindEnum;
266import ca.uhn.fhir.model.dstu2.valueset.SubscriptionChannelTypeEnum;
267import ca.uhn.fhir.model.dstu2.valueset.SubscriptionStatusEnum;
268import ca.uhn.fhir.model.dstu2.valueset.SubscriptionTagEnum;
269import ca.uhn.fhir.model.dstu2.resource.Substance;
270import ca.uhn.fhir.model.dstu2.valueset.SubstanceCategoryCodesEnum;
271import ca.uhn.fhir.model.dstu2.valueset.SupplementTypeCodesEnum;
272import ca.uhn.fhir.model.dstu2.valueset.SupplyDeliveryStatusEnum;
273import ca.uhn.fhir.model.dstu2.resource.SupplyRequest;
274import ca.uhn.fhir.model.dstu2.valueset.SupplyRequestReasonEnum;
275import ca.uhn.fhir.model.dstu2.valueset.SupplyRequestStatusEnum;
276import ca.uhn.fhir.model.dstu2.valueset.SurfaceCodesEnum;
277import ca.uhn.fhir.model.dstu2.valueset.SystemRestfulInteractionEnum;
278import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
279import ca.uhn.fhir.model.dstu2.valueset.TextureModifiedFoodTypeCodesEnum;
280import ca.uhn.fhir.model.dstu2.valueset.TextureModifierCodesEnum;
281import ca.uhn.fhir.model.dstu2.composite.TimingDt;
282import ca.uhn.fhir.model.dstu2.valueset.TransactionModeEnum;
283import ca.uhn.fhir.model.dstu2.valueset.TypeRestfulInteractionEnum;
284import ca.uhn.fhir.model.dstu2.valueset.UDICodesEnum;
285import ca.uhn.fhir.model.dstu2.valueset.UnknownContentCodeEnum;
286import ca.uhn.fhir.model.dstu2.valueset.UseEnum;
287import ca.uhn.fhir.model.dstu2.resource.ValueSet;
288import ca.uhn.fhir.model.dstu2.valueset.VisionBaseEnum;
289import ca.uhn.fhir.model.dstu2.valueset.VisionEyesEnum;
290import ca.uhn.fhir.model.dstu2.resource.VisionPrescription;
291import ca.uhn.fhir.model.dstu2.valueset.XPathUsageTypeEnum;
292import ca.uhn.fhir.model.api.IResource;
293import ca.uhn.fhir.model.dstu2.composite.AgeDt;
294import ca.uhn.fhir.model.dstu2.composite.BoundCodeableConceptDt;
295import ca.uhn.fhir.model.dstu2.composite.DurationDt;
296import ca.uhn.fhir.model.dstu2.composite.MoneyDt;
297import ca.uhn.fhir.model.dstu2.composite.NarrativeDt;
298import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt;
299import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt;
300import ca.uhn.fhir.model.primitive.Base64BinaryDt;
301import ca.uhn.fhir.model.primitive.BooleanDt;
302import ca.uhn.fhir.model.primitive.BoundCodeDt;
303import ca.uhn.fhir.model.primitive.CodeDt;
304import ca.uhn.fhir.model.primitive.DateDt;
305import ca.uhn.fhir.model.primitive.DateTimeDt;
306import ca.uhn.fhir.model.primitive.DecimalDt;
307import ca.uhn.fhir.model.primitive.IdDt;
308import ca.uhn.fhir.model.primitive.InstantDt;
309import ca.uhn.fhir.model.primitive.IntegerDt;
310import ca.uhn.fhir.model.primitive.OidDt;
311import ca.uhn.fhir.model.primitive.PositiveIntDt;
312import ca.uhn.fhir.model.primitive.StringDt;
313import ca.uhn.fhir.model.primitive.TimeDt;
314import ca.uhn.fhir.model.primitive.UnsignedIntDt;
315import ca.uhn.fhir.model.primitive.UriDt;
316
317
318/**
319 * HAPI/FHIR <b>Procedure</b> Resource
320 * (clinical.general)
321 *
322 * <p>
323 * <b>Definition:</b>
324 * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy.
325 * </p> 
326 *
327 * <p>
328 * <b>Requirements:</b>
329 * 
330 * </p> 
331 *
332 * <p>
333 * <b>Profile Definition:</b>
334 * <a href="http://hl7.org/fhir/profiles/Procedure">http://hl7.org/fhir/profiles/Procedure</a> 
335 * </p>
336 *
337 */
338@ResourceDef(name="Procedure", profile="http://hl7.org/fhir/profiles/Procedure", id="procedure")
339public class Procedure extends ca.uhn.fhir.model.dstu2.resource.BaseResource
340    implements  IResource     {
341
342        /**
343         * Search parameter constant for <b>code</b>
344         * <p>
345         * Description: <b>A code to identify a  procedure</b><br>
346         * Type: <b>token</b><br>
347         * Path: <b>Procedure.code</b><br>
348         * </p>
349         */
350        @SearchParamDefinition(name="code", path="Procedure.code", description="A code to identify a  procedure", type="token"  )
351        public static final String SP_CODE = "code";
352
353        /**
354         * <b>Fluent Client</b> search parameter constant for <b>code</b>
355         * <p>
356         * Description: <b>A code to identify a  procedure</b><br>
357         * Type: <b>token</b><br>
358         * Path: <b>Procedure.code</b><br>
359         * </p>
360         */
361        public static final TokenClientParam CODE = new TokenClientParam(SP_CODE);
362
363        /**
364         * Search parameter constant for <b>identifier</b>
365         * <p>
366         * Description: <b>A unique identifier for a procedure</b><br>
367         * Type: <b>token</b><br>
368         * Path: <b>Procedure.identifier</b><br>
369         * </p>
370         */
371        @SearchParamDefinition(name="identifier", path="Procedure.identifier", description="A unique identifier for a procedure", type="token"  )
372        public static final String SP_IDENTIFIER = "identifier";
373
374        /**
375         * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
376         * <p>
377         * Description: <b>A unique identifier for a procedure</b><br>
378         * Type: <b>token</b><br>
379         * Path: <b>Procedure.identifier</b><br>
380         * </p>
381         */
382        public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER);
383
384        /**
385         * Search parameter constant for <b>date</b>
386         * <p>
387         * Description: <b></b><br>
388         * Type: <b>date</b><br>
389         * Path: <b>Procedure.performed[x]</b><br>
390         * </p>
391         */
392        @SearchParamDefinition(name="date", path="Procedure.performed[x]", description="", type="date"  )
393        public static final String SP_DATE = "date";
394
395        /**
396         * <b>Fluent Client</b> search parameter constant for <b>date</b>
397         * <p>
398         * Description: <b></b><br>
399         * Type: <b>date</b><br>
400         * Path: <b>Procedure.performed[x]</b><br>
401         * </p>
402         */
403        public static final DateClientParam DATE = new DateClientParam(SP_DATE);
404
405        /**
406         * Search parameter constant for <b>performer</b>
407         * <p>
408         * Description: <b></b><br>
409         * Type: <b>reference</b><br>
410         * Path: <b>Procedure.performer.actor</b><br>
411         * </p>
412         */
413        @SearchParamDefinition(name="performer", path="Procedure.performer.actor", description="", type="reference"  )
414        public static final String SP_PERFORMER = "performer";
415
416        /**
417         * <b>Fluent Client</b> search parameter constant for <b>performer</b>
418         * <p>
419         * Description: <b></b><br>
420         * Type: <b>reference</b><br>
421         * Path: <b>Procedure.performer.actor</b><br>
422         * </p>
423         */
424        public static final ReferenceClientParam PERFORMER = new ReferenceClientParam(SP_PERFORMER);
425
426        /**
427         * Search parameter constant for <b>location</b>
428         * <p>
429         * Description: <b></b><br>
430         * Type: <b>reference</b><br>
431         * Path: <b>Procedure.location</b><br>
432         * </p>
433         */
434        @SearchParamDefinition(name="location", path="Procedure.location", description="", type="reference"  )
435        public static final String SP_LOCATION = "location";
436
437        /**
438         * <b>Fluent Client</b> search parameter constant for <b>location</b>
439         * <p>
440         * Description: <b></b><br>
441         * Type: <b>reference</b><br>
442         * Path: <b>Procedure.location</b><br>
443         * </p>
444         */
445        public static final ReferenceClientParam LOCATION = new ReferenceClientParam(SP_LOCATION);
446
447        /**
448         * Search parameter constant for <b>encounter</b>
449         * <p>
450         * Description: <b></b><br>
451         * Type: <b>reference</b><br>
452         * Path: <b>Procedure.encounter</b><br>
453         * </p>
454         */
455        @SearchParamDefinition(name="encounter", path="Procedure.encounter", description="", type="reference"  )
456        public static final String SP_ENCOUNTER = "encounter";
457
458        /**
459         * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
460         * <p>
461         * Description: <b></b><br>
462         * Type: <b>reference</b><br>
463         * Path: <b>Procedure.encounter</b><br>
464         * </p>
465         */
466        public static final ReferenceClientParam ENCOUNTER = new ReferenceClientParam(SP_ENCOUNTER);
467
468        /**
469         * Search parameter constant for <b>subject</b>
470         * <p>
471         * Description: <b>Search by subject</b><br>
472         * Type: <b>reference</b><br>
473         * Path: <b>Procedure.subject</b><br>
474         * </p>
475         */
476        @SearchParamDefinition(name="subject", path="Procedure.subject", description="Search by subject", type="reference"  )
477        public static final String SP_SUBJECT = "subject";
478
479        /**
480         * <b>Fluent Client</b> search parameter constant for <b>subject</b>
481         * <p>
482         * Description: <b>Search by subject</b><br>
483         * Type: <b>reference</b><br>
484         * Path: <b>Procedure.subject</b><br>
485         * </p>
486         */
487        public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT);
488
489        /**
490         * Search parameter constant for <b>patient</b>
491         * <p>
492         * Description: <b>Search by subject - a patient</b><br>
493         * Type: <b>reference</b><br>
494         * Path: <b>Procedure.subject</b><br>
495         * </p>
496         */
497        @SearchParamDefinition(name="patient", path="Procedure.subject", description="Search by subject - a patient", type="reference"  )
498        public static final String SP_PATIENT = "patient";
499
500        /**
501         * <b>Fluent Client</b> search parameter constant for <b>patient</b>
502         * <p>
503         * Description: <b>Search by subject - a patient</b><br>
504         * Type: <b>reference</b><br>
505         * Path: <b>Procedure.subject</b><br>
506         * </p>
507         */
508        public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT);
509
510
511        /**
512         * Constant for fluent queries to be used to add include statements. Specifies
513         * the path value of "<b>Procedure:encounter</b>".
514         */
515        public static final Include INCLUDE_ENCOUNTER = new Include("Procedure:encounter");
516
517        /**
518         * Constant for fluent queries to be used to add include statements. Specifies
519         * the path value of "<b>Procedure:location</b>".
520         */
521        public static final Include INCLUDE_LOCATION = new Include("Procedure:location");
522
523        /**
524         * Constant for fluent queries to be used to add include statements. Specifies
525         * the path value of "<b>Procedure:patient</b>".
526         */
527        public static final Include INCLUDE_PATIENT = new Include("Procedure:patient");
528
529        /**
530         * Constant for fluent queries to be used to add include statements. Specifies
531         * the path value of "<b>Procedure:performer</b>".
532         */
533        public static final Include INCLUDE_PERFORMER = new Include("Procedure:performer");
534
535        /**
536         * Constant for fluent queries to be used to add include statements. Specifies
537         * the path value of "<b>Procedure:subject</b>".
538         */
539        public static final Include INCLUDE_SUBJECT = new Include("Procedure:subject");
540
541
542        @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)       
543        @Description(
544                shortDefinition="id",
545                formalDefinition="This records identifiers associated with this procedure that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)"
546        )
547        private java.util.List<IdentifierDt> myIdentifier;
548        
549        @Child(name="subject", order=1, min=1, max=1, summary=true, modifier=false, type={
550                ca.uhn.fhir.model.dstu2.resource.Patient.class,                 ca.uhn.fhir.model.dstu2.resource.Group.class    })
551        @Description(
552                shortDefinition="who.focus",
553                formalDefinition="The person, animal or group on which the procedure was performed"
554        )
555        private ResourceReferenceDt mySubject;
556        
557        @Child(name="status", type=CodeDt.class, order=2, min=1, max=1, summary=true, modifier=true)    
558        @Description(
559                shortDefinition="",
560                formalDefinition="A code specifying the state of the procedure. Generally this will be in-progress or completed state."
561        )
562        private BoundCodeDt<ProcedureStatusEnum> myStatus;
563        
564        @Child(name="category", type=CodeableConceptDt.class, order=3, min=0, max=1, summary=true, modifier=false)      
565        @Description(
566                shortDefinition="",
567                formalDefinition="A code that classifies the procedure for searching, sorting and display purposes (e.g. \"Surgical Procedure\")"
568        )
569        private CodeableConceptDt myCategory;
570        
571        @Child(name="code", type=CodeableConceptDt.class, order=4, min=1, max=1, summary=true, modifier=false)  
572        @Description(
573                shortDefinition="class",
574                formalDefinition="The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. \"Laparoscopic Appendectomy\")"
575        )
576        private CodeableConceptDt myCode;
577        
578        @Child(name="notPerformed", type=BooleanDt.class, order=5, min=0, max=1, summary=false, modifier=true)  
579        @Description(
580                shortDefinition="",
581                formalDefinition="Set this to true if the record is saying that the procedure was NOT performed"
582        )
583        private BooleanDt myNotPerformed;
584        
585        @Child(name="reasonNotPerformed", type=CodeableConceptDt.class, order=6, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false) 
586        @Description(
587                shortDefinition="",
588                formalDefinition="A code indicating why the procedure was not performed."
589        )
590        private java.util.List<CodeableConceptDt> myReasonNotPerformed;
591        
592        @Child(name="bodySite", type=CodeableConceptDt.class, order=7, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)    
593        @Description(
594                shortDefinition="",
595                formalDefinition="Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion"
596        )
597        private java.util.List<CodeableConceptDt> myBodySite;
598        
599        @Child(name="reason", order=8, min=0, max=1, summary=true, modifier=false, type={
600                CodeableConceptDt.class,                Condition.class })
601        @Description(
602                shortDefinition="",
603                formalDefinition="The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text"
604        )
605        private IDatatype myReason;
606        
607        @Child(name="performer", order=9, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false) 
608        @Description(
609                shortDefinition="",
610                formalDefinition="Limited to 'real' people rather than equipment"
611        )
612        private java.util.List<Performer> myPerformer;
613        
614        @Child(name="performed", order=10, min=0, max=1, summary=true, modifier=false, type={
615                DateTimeDt.class,               PeriodDt.class  })
616        @Description(
617                shortDefinition="when.done",
618                formalDefinition="The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured."
619        )
620        private IDatatype myPerformed;
621        
622        @Child(name="encounter", order=11, min=0, max=1, summary=true, modifier=false, type={
623                ca.uhn.fhir.model.dstu2.resource.Encounter.class        })
624        @Description(
625                shortDefinition="context",
626                formalDefinition="The encounter during which the procedure was performed"
627        )
628        private ResourceReferenceDt myEncounter;
629        
630        @Child(name="location", order=12, min=0, max=1, summary=true, modifier=false, type={
631                ca.uhn.fhir.model.dstu2.resource.Location.class })
632        @Description(
633                shortDefinition="where",
634                formalDefinition="The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant"
635        )
636        private ResourceReferenceDt myLocation;
637        
638        @Child(name="outcome", type=CodeableConceptDt.class, order=13, min=0, max=1, summary=true, modifier=false)      
639        @Description(
640                shortDefinition="",
641                formalDefinition="The outcome of the procedure - did it resolve reasons for the procedure being performed?"
642        )
643        private CodeableConceptDt myOutcome;
644        
645        @Child(name="report", order=14, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
646                ca.uhn.fhir.model.dstu2.resource.DiagnosticReport.class })
647        @Description(
648                shortDefinition="",
649                formalDefinition="This could be a histology result, pathology report, surgical report, etc.."
650        )
651        private java.util.List<ResourceReferenceDt> myReport;
652        
653        @Child(name="complication", type=CodeableConceptDt.class, order=15, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)      
654        @Description(
655                shortDefinition="",
656                formalDefinition="Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues"
657        )
658        private java.util.List<CodeableConceptDt> myComplication;
659        
660        @Child(name="followUp", type=CodeableConceptDt.class, order=16, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)  
661        @Description(
662                shortDefinition="",
663                formalDefinition="If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used"
664        )
665        private java.util.List<CodeableConceptDt> myFollowUp;
666        
667        @Child(name="request", order=17, min=0, max=1, summary=false, modifier=false, type={
668                ca.uhn.fhir.model.dstu2.resource.CarePlan.class,                ca.uhn.fhir.model.dstu2.resource.DiagnosticOrder.class,                 ca.uhn.fhir.model.dstu2.resource.ProcedureRequest.class,                ca.uhn.fhir.model.dstu2.resource.ReferralRequest.class  })
669        @Description(
670                shortDefinition="",
671                formalDefinition="A reference to a resource that contains details of the request for this procedure."
672        )
673        private ResourceReferenceDt myRequest;
674        
675        @Child(name="notes", type=AnnotationDt.class, order=18, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)  
676        @Description(
677                shortDefinition="",
678                formalDefinition="Any other notes about the procedure.  E.g. the operative notes"
679        )
680        private java.util.List<AnnotationDt> myNotes;
681        
682        @Child(name="focalDevice", order=19, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false)     
683        @Description(
684                shortDefinition="",
685                formalDefinition="A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure."
686        )
687        private java.util.List<FocalDevice> myFocalDevice;
688        
689        @Child(name="used", order=20, min=0, max=Child.MAX_UNLIMITED, summary=false, modifier=false, type={
690                ca.uhn.fhir.model.dstu2.resource.Device.class,          ca.uhn.fhir.model.dstu2.resource.Medication.class,              ca.uhn.fhir.model.dstu2.resource.Substance.class        })
691        @Description(
692                shortDefinition="",
693                formalDefinition="Identifies medications, devices and any other substance used as part of the procedure"
694        )
695        private java.util.List<ResourceReferenceDt> myUsed;
696        
697
698        @Override
699        public boolean isEmpty() {
700                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myIdentifier,  mySubject,  myStatus,  myCategory,  myCode,  myNotPerformed,  myReasonNotPerformed,  myBodySite,  myReason,  myPerformer,  myPerformed,  myEncounter,  myLocation,  myOutcome,  myReport,  myComplication,  myFollowUp,  myRequest,  myNotes,  myFocalDevice,  myUsed);
701        }
702        
703        @Override
704        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
705                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, mySubject, myStatus, myCategory, myCode, myNotPerformed, myReasonNotPerformed, myBodySite, myReason, myPerformer, myPerformed, myEncounter, myLocation, myOutcome, myReport, myComplication, myFollowUp, myRequest, myNotes, myFocalDevice, myUsed);
706        }
707
708        /**
709         * Gets the value(s) for <b>identifier</b> (id).
710         * creating it if it does
711         * not exist. Will not return <code>null</code>.
712         *
713     * <p>
714     * <b>Definition:</b>
715     * This records identifiers associated with this procedure that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)
716     * </p> 
717         */
718        public java.util.List<IdentifierDt> getIdentifier() {  
719                if (myIdentifier == null) {
720                        myIdentifier = new java.util.ArrayList<IdentifierDt>();
721                }
722                return myIdentifier;
723        }
724
725        /**
726         * Sets the value(s) for <b>identifier</b> (id)
727         *
728     * <p>
729     * <b>Definition:</b>
730     * This records identifiers associated with this procedure that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)
731     * </p> 
732         */
733        public Procedure setIdentifier(java.util.List<IdentifierDt> theValue) {
734                myIdentifier = theValue;
735                return this;
736        }
737        
738        
739
740        /**
741         * Adds and returns a new value for <b>identifier</b> (id)
742         *
743     * <p>
744     * <b>Definition:</b>
745     * This records identifiers associated with this procedure that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)
746     * </p> 
747         */
748        public IdentifierDt addIdentifier() {
749                IdentifierDt newType = new IdentifierDt();
750                getIdentifier().add(newType);
751                return newType; 
752        }
753
754        /**
755         * Adds a given new value for <b>identifier</b> (id)
756         *
757         * <p>
758         * <b>Definition:</b>
759         * This records identifiers associated with this procedure that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)
760         * </p>
761         * @param theValue The identifier to add (must not be <code>null</code>)
762         */
763        public Procedure addIdentifier(IdentifierDt theValue) {
764                if (theValue == null) {
765                        throw new NullPointerException("theValue must not be null");
766                }
767                getIdentifier().add(theValue);
768                return this;
769        }
770
771        /**
772         * Gets the first repetition for <b>identifier</b> (id),
773         * creating it if it does not already exist.
774         *
775     * <p>
776     * <b>Definition:</b>
777     * This records identifiers associated with this procedure that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)
778     * </p> 
779         */
780        public IdentifierDt getIdentifierFirstRep() {
781                if (getIdentifier().isEmpty()) {
782                        return addIdentifier();
783                }
784                return getIdentifier().get(0); 
785        }
786  
787        /**
788         * Gets the value(s) for <b>subject</b> (who.focus).
789         * creating it if it does
790         * not exist. Will not return <code>null</code>.
791         *
792     * <p>
793     * <b>Definition:</b>
794     * The person, animal or group on which the procedure was performed
795     * </p> 
796         */
797        public ResourceReferenceDt getSubject() {  
798                if (mySubject == null) {
799                        mySubject = new ResourceReferenceDt();
800                }
801                return mySubject;
802        }
803
804        /**
805         * Sets the value(s) for <b>subject</b> (who.focus)
806         *
807     * <p>
808     * <b>Definition:</b>
809     * The person, animal or group on which the procedure was performed
810     * </p> 
811         */
812        public Procedure setSubject(ResourceReferenceDt theValue) {
813                mySubject = theValue;
814                return this;
815        }
816        
817        
818
819  
820        /**
821         * Gets the value(s) for <b>status</b> ().
822         * creating it if it does
823         * not exist. Will not return <code>null</code>.
824         *
825     * <p>
826     * <b>Definition:</b>
827     * A code specifying the state of the procedure. Generally this will be in-progress or completed state.
828     * </p> 
829         */
830        public BoundCodeDt<ProcedureStatusEnum> getStatusElement() {  
831                if (myStatus == null) {
832                        myStatus = new BoundCodeDt<ProcedureStatusEnum>(ProcedureStatusEnum.VALUESET_BINDER);
833                }
834                return myStatus;
835        }
836
837        
838        /**
839         * Gets the value(s) for <b>status</b> ().
840         * creating it if it does
841         * not exist. Will not return <code>null</code>.
842         *
843     * <p>
844     * <b>Definition:</b>
845     * A code specifying the state of the procedure. Generally this will be in-progress or completed state.
846     * </p> 
847         */
848        public String getStatus() {  
849                return getStatusElement().getValue();
850        }
851
852        /**
853         * Sets the value(s) for <b>status</b> ()
854         *
855     * <p>
856     * <b>Definition:</b>
857     * A code specifying the state of the procedure. Generally this will be in-progress or completed state.
858     * </p> 
859         */
860        public Procedure setStatus(BoundCodeDt<ProcedureStatusEnum> theValue) {
861                myStatus = theValue;
862                return this;
863        }
864        
865        
866
867        /**
868         * Sets the value(s) for <b>status</b> ()
869         *
870     * <p>
871     * <b>Definition:</b>
872     * A code specifying the state of the procedure. Generally this will be in-progress or completed state.
873     * </p> 
874         */
875        public Procedure setStatus(ProcedureStatusEnum theValue) {
876                setStatus(new BoundCodeDt<ProcedureStatusEnum>(ProcedureStatusEnum.VALUESET_BINDER, theValue));
877                
878/*
879                getStatusElement().setValueAsEnum(theValue);
880*/
881                return this;
882        }
883
884  
885        /**
886         * Gets the value(s) for <b>category</b> ().
887         * creating it if it does
888         * not exist. Will not return <code>null</code>.
889         *
890     * <p>
891     * <b>Definition:</b>
892     * A code that classifies the procedure for searching, sorting and display purposes (e.g. \&quot;Surgical Procedure\&quot;)
893     * </p> 
894         */
895        public CodeableConceptDt getCategory() {  
896                if (myCategory == null) {
897                        myCategory = new CodeableConceptDt();
898                }
899                return myCategory;
900        }
901
902        /**
903         * Sets the value(s) for <b>category</b> ()
904         *
905     * <p>
906     * <b>Definition:</b>
907     * A code that classifies the procedure for searching, sorting and display purposes (e.g. \&quot;Surgical Procedure\&quot;)
908     * </p> 
909         */
910        public Procedure setCategory(CodeableConceptDt theValue) {
911                myCategory = theValue;
912                return this;
913        }
914        
915        
916
917  
918        /**
919         * Gets the value(s) for <b>code</b> (class).
920         * creating it if it does
921         * not exist. Will not return <code>null</code>.
922         *
923     * <p>
924     * <b>Definition:</b>
925     * The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. \&quot;Laparoscopic Appendectomy\&quot;)
926     * </p> 
927         */
928        public CodeableConceptDt getCode() {  
929                if (myCode == null) {
930                        myCode = new CodeableConceptDt();
931                }
932                return myCode;
933        }
934
935        /**
936         * Sets the value(s) for <b>code</b> (class)
937         *
938     * <p>
939     * <b>Definition:</b>
940     * The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. \&quot;Laparoscopic Appendectomy\&quot;)
941     * </p> 
942         */
943        public Procedure setCode(CodeableConceptDt theValue) {
944                myCode = theValue;
945                return this;
946        }
947        
948        
949
950  
951        /**
952         * Gets the value(s) for <b>notPerformed</b> ().
953         * creating it if it does
954         * not exist. Will not return <code>null</code>.
955         *
956     * <p>
957     * <b>Definition:</b>
958     * Set this to true if the record is saying that the procedure was NOT performed
959     * </p> 
960         */
961        public BooleanDt getNotPerformedElement() {  
962                if (myNotPerformed == null) {
963                        myNotPerformed = new BooleanDt();
964                }
965                return myNotPerformed;
966        }
967
968        
969        /**
970         * Gets the value(s) for <b>notPerformed</b> ().
971         * creating it if it does
972         * not exist. Will not return <code>null</code>.
973         *
974     * <p>
975     * <b>Definition:</b>
976     * Set this to true if the record is saying that the procedure was NOT performed
977     * </p> 
978         */
979        public Boolean getNotPerformed() {  
980                return getNotPerformedElement().getValue();
981        }
982
983        /**
984         * Sets the value(s) for <b>notPerformed</b> ()
985         *
986     * <p>
987     * <b>Definition:</b>
988     * Set this to true if the record is saying that the procedure was NOT performed
989     * </p> 
990         */
991        public Procedure setNotPerformed(BooleanDt theValue) {
992                myNotPerformed = theValue;
993                return this;
994        }
995        
996        
997
998        /**
999         * Sets the value for <b>notPerformed</b> ()
1000         *
1001     * <p>
1002     * <b>Definition:</b>
1003     * Set this to true if the record is saying that the procedure was NOT performed
1004     * </p> 
1005         */
1006        public Procedure setNotPerformed( boolean theBoolean) {
1007                myNotPerformed = new BooleanDt(theBoolean); 
1008                return this; 
1009        }
1010
1011 
1012        /**
1013         * Gets the value(s) for <b>reasonNotPerformed</b> ().
1014         * creating it if it does
1015         * not exist. Will not return <code>null</code>.
1016         *
1017     * <p>
1018     * <b>Definition:</b>
1019     * A code indicating why the procedure was not performed.
1020     * </p> 
1021         */
1022        public java.util.List<CodeableConceptDt> getReasonNotPerformed() {  
1023                if (myReasonNotPerformed == null) {
1024                        myReasonNotPerformed = new java.util.ArrayList<CodeableConceptDt>();
1025                }
1026                return myReasonNotPerformed;
1027        }
1028
1029        /**
1030         * Sets the value(s) for <b>reasonNotPerformed</b> ()
1031         *
1032     * <p>
1033     * <b>Definition:</b>
1034     * A code indicating why the procedure was not performed.
1035     * </p> 
1036         */
1037        public Procedure setReasonNotPerformed(java.util.List<CodeableConceptDt> theValue) {
1038                myReasonNotPerformed = theValue;
1039                return this;
1040        }
1041        
1042        
1043
1044        /**
1045         * Adds and returns a new value for <b>reasonNotPerformed</b> ()
1046         *
1047     * <p>
1048     * <b>Definition:</b>
1049     * A code indicating why the procedure was not performed.
1050     * </p> 
1051         */
1052        public CodeableConceptDt addReasonNotPerformed() {
1053                CodeableConceptDt newType = new CodeableConceptDt();
1054                getReasonNotPerformed().add(newType);
1055                return newType; 
1056        }
1057
1058        /**
1059         * Adds a given new value for <b>reasonNotPerformed</b> ()
1060         *
1061         * <p>
1062         * <b>Definition:</b>
1063         * A code indicating why the procedure was not performed.
1064         * </p>
1065         * @param theValue The reasonNotPerformed to add (must not be <code>null</code>)
1066         */
1067        public Procedure addReasonNotPerformed(CodeableConceptDt theValue) {
1068                if (theValue == null) {
1069                        throw new NullPointerException("theValue must not be null");
1070                }
1071                getReasonNotPerformed().add(theValue);
1072                return this;
1073        }
1074
1075        /**
1076         * Gets the first repetition for <b>reasonNotPerformed</b> (),
1077         * creating it if it does not already exist.
1078         *
1079     * <p>
1080     * <b>Definition:</b>
1081     * A code indicating why the procedure was not performed.
1082     * </p> 
1083         */
1084        public CodeableConceptDt getReasonNotPerformedFirstRep() {
1085                if (getReasonNotPerformed().isEmpty()) {
1086                        return addReasonNotPerformed();
1087                }
1088                return getReasonNotPerformed().get(0); 
1089        }
1090  
1091        /**
1092         * Gets the value(s) for <b>bodySite</b> ().
1093         * creating it if it does
1094         * not exist. Will not return <code>null</code>.
1095         *
1096     * <p>
1097     * <b>Definition:</b>
1098     * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion
1099     * </p> 
1100         */
1101        public java.util.List<CodeableConceptDt> getBodySite() {  
1102                if (myBodySite == null) {
1103                        myBodySite = new java.util.ArrayList<CodeableConceptDt>();
1104                }
1105                return myBodySite;
1106        }
1107
1108        /**
1109         * Sets the value(s) for <b>bodySite</b> ()
1110         *
1111     * <p>
1112     * <b>Definition:</b>
1113     * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion
1114     * </p> 
1115         */
1116        public Procedure setBodySite(java.util.List<CodeableConceptDt> theValue) {
1117                myBodySite = theValue;
1118                return this;
1119        }
1120        
1121        
1122
1123        /**
1124         * Adds and returns a new value for <b>bodySite</b> ()
1125         *
1126     * <p>
1127     * <b>Definition:</b>
1128     * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion
1129     * </p> 
1130         */
1131        public CodeableConceptDt addBodySite() {
1132                CodeableConceptDt newType = new CodeableConceptDt();
1133                getBodySite().add(newType);
1134                return newType; 
1135        }
1136
1137        /**
1138         * Adds a given new value for <b>bodySite</b> ()
1139         *
1140         * <p>
1141         * <b>Definition:</b>
1142         * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion
1143         * </p>
1144         * @param theValue The bodySite to add (must not be <code>null</code>)
1145         */
1146        public Procedure addBodySite(CodeableConceptDt theValue) {
1147                if (theValue == null) {
1148                        throw new NullPointerException("theValue must not be null");
1149                }
1150                getBodySite().add(theValue);
1151                return this;
1152        }
1153
1154        /**
1155         * Gets the first repetition for <b>bodySite</b> (),
1156         * creating it if it does not already exist.
1157         *
1158     * <p>
1159     * <b>Definition:</b>
1160     * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion
1161     * </p> 
1162         */
1163        public CodeableConceptDt getBodySiteFirstRep() {
1164                if (getBodySite().isEmpty()) {
1165                        return addBodySite();
1166                }
1167                return getBodySite().get(0); 
1168        }
1169  
1170        /**
1171         * Gets the value(s) for <b>reason[x]</b> ().
1172         * creating it if it does
1173         * not exist. Will not return <code>null</code>.
1174         *
1175     * <p>
1176     * <b>Definition:</b>
1177     * The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text
1178     * </p> 
1179         */
1180        public IDatatype getReason() {  
1181                return myReason;
1182        }
1183
1184        /**
1185         * Sets the value(s) for <b>reason[x]</b> ()
1186         *
1187     * <p>
1188     * <b>Definition:</b>
1189     * The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text
1190     * </p> 
1191         */
1192        public Procedure setReason(IDatatype theValue) {
1193                myReason = theValue;
1194                return this;
1195        }
1196        
1197        
1198
1199  
1200        /**
1201         * Gets the value(s) for <b>performer</b> ().
1202         * creating it if it does
1203         * not exist. Will not return <code>null</code>.
1204         *
1205     * <p>
1206     * <b>Definition:</b>
1207     * Limited to 'real' people rather than equipment
1208     * </p> 
1209         */
1210        public java.util.List<Performer> getPerformer() {  
1211                if (myPerformer == null) {
1212                        myPerformer = new java.util.ArrayList<Performer>();
1213                }
1214                return myPerformer;
1215        }
1216
1217        /**
1218         * Sets the value(s) for <b>performer</b> ()
1219         *
1220     * <p>
1221     * <b>Definition:</b>
1222     * Limited to 'real' people rather than equipment
1223     * </p> 
1224         */
1225        public Procedure setPerformer(java.util.List<Performer> theValue) {
1226                myPerformer = theValue;
1227                return this;
1228        }
1229        
1230        
1231
1232        /**
1233         * Adds and returns a new value for <b>performer</b> ()
1234         *
1235     * <p>
1236     * <b>Definition:</b>
1237     * Limited to 'real' people rather than equipment
1238     * </p> 
1239         */
1240        public Performer addPerformer() {
1241                Performer newType = new Performer();
1242                getPerformer().add(newType);
1243                return newType; 
1244        }
1245
1246        /**
1247         * Adds a given new value for <b>performer</b> ()
1248         *
1249         * <p>
1250         * <b>Definition:</b>
1251         * Limited to 'real' people rather than equipment
1252         * </p>
1253         * @param theValue The performer to add (must not be <code>null</code>)
1254         */
1255        public Procedure addPerformer(Performer theValue) {
1256                if (theValue == null) {
1257                        throw new NullPointerException("theValue must not be null");
1258                }
1259                getPerformer().add(theValue);
1260                return this;
1261        }
1262
1263        /**
1264         * Gets the first repetition for <b>performer</b> (),
1265         * creating it if it does not already exist.
1266         *
1267     * <p>
1268     * <b>Definition:</b>
1269     * Limited to 'real' people rather than equipment
1270     * </p> 
1271         */
1272        public Performer getPerformerFirstRep() {
1273                if (getPerformer().isEmpty()) {
1274                        return addPerformer();
1275                }
1276                return getPerformer().get(0); 
1277        }
1278  
1279        /**
1280         * Gets the value(s) for <b>performed[x]</b> (when.done).
1281         * creating it if it does
1282         * not exist. Will not return <code>null</code>.
1283         *
1284     * <p>
1285     * <b>Definition:</b>
1286     * The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.
1287     * </p> 
1288         */
1289        public IDatatype getPerformed() {  
1290                return myPerformed;
1291        }
1292
1293        /**
1294         * Sets the value(s) for <b>performed[x]</b> (when.done)
1295         *
1296     * <p>
1297     * <b>Definition:</b>
1298     * The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.
1299     * </p> 
1300         */
1301        public Procedure setPerformed(IDatatype theValue) {
1302                myPerformed = theValue;
1303                return this;
1304        }
1305        
1306        
1307
1308  
1309        /**
1310         * Gets the value(s) for <b>encounter</b> (context).
1311         * creating it if it does
1312         * not exist. Will not return <code>null</code>.
1313         *
1314     * <p>
1315     * <b>Definition:</b>
1316     * The encounter during which the procedure was performed
1317     * </p> 
1318         */
1319        public ResourceReferenceDt getEncounter() {  
1320                if (myEncounter == null) {
1321                        myEncounter = new ResourceReferenceDt();
1322                }
1323                return myEncounter;
1324        }
1325
1326        /**
1327         * Sets the value(s) for <b>encounter</b> (context)
1328         *
1329     * <p>
1330     * <b>Definition:</b>
1331     * The encounter during which the procedure was performed
1332     * </p> 
1333         */
1334        public Procedure setEncounter(ResourceReferenceDt theValue) {
1335                myEncounter = theValue;
1336                return this;
1337        }
1338        
1339        
1340
1341  
1342        /**
1343         * Gets the value(s) for <b>location</b> (where).
1344         * creating it if it does
1345         * not exist. Will not return <code>null</code>.
1346         *
1347     * <p>
1348     * <b>Definition:</b>
1349     * The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant
1350     * </p> 
1351         */
1352        public ResourceReferenceDt getLocation() {  
1353                if (myLocation == null) {
1354                        myLocation = new ResourceReferenceDt();
1355                }
1356                return myLocation;
1357        }
1358
1359        /**
1360         * Sets the value(s) for <b>location</b> (where)
1361         *
1362     * <p>
1363     * <b>Definition:</b>
1364     * The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant
1365     * </p> 
1366         */
1367        public Procedure setLocation(ResourceReferenceDt theValue) {
1368                myLocation = theValue;
1369                return this;
1370        }
1371        
1372        
1373
1374  
1375        /**
1376         * Gets the value(s) for <b>outcome</b> ().
1377         * creating it if it does
1378         * not exist. Will not return <code>null</code>.
1379         *
1380     * <p>
1381     * <b>Definition:</b>
1382     * The outcome of the procedure - did it resolve reasons for the procedure being performed?
1383     * </p> 
1384         */
1385        public CodeableConceptDt getOutcome() {  
1386                if (myOutcome == null) {
1387                        myOutcome = new CodeableConceptDt();
1388                }
1389                return myOutcome;
1390        }
1391
1392        /**
1393         * Sets the value(s) for <b>outcome</b> ()
1394         *
1395     * <p>
1396     * <b>Definition:</b>
1397     * The outcome of the procedure - did it resolve reasons for the procedure being performed?
1398     * </p> 
1399         */
1400        public Procedure setOutcome(CodeableConceptDt theValue) {
1401                myOutcome = theValue;
1402                return this;
1403        }
1404        
1405        
1406
1407  
1408        /**
1409         * Gets the value(s) for <b>report</b> ().
1410         * creating it if it does
1411         * not exist. Will not return <code>null</code>.
1412         *
1413     * <p>
1414     * <b>Definition:</b>
1415     * This could be a histology result, pathology report, surgical report, etc..
1416     * </p> 
1417         */
1418        public java.util.List<ResourceReferenceDt> getReport() {  
1419                if (myReport == null) {
1420                        myReport = new java.util.ArrayList<ResourceReferenceDt>();
1421                }
1422                return myReport;
1423        }
1424
1425        /**
1426         * Sets the value(s) for <b>report</b> ()
1427         *
1428     * <p>
1429     * <b>Definition:</b>
1430     * This could be a histology result, pathology report, surgical report, etc..
1431     * </p> 
1432         */
1433        public Procedure setReport(java.util.List<ResourceReferenceDt> theValue) {
1434                myReport = theValue;
1435                return this;
1436        }
1437        
1438        
1439
1440        /**
1441         * Adds and returns a new value for <b>report</b> ()
1442         *
1443     * <p>
1444     * <b>Definition:</b>
1445     * This could be a histology result, pathology report, surgical report, etc..
1446     * </p> 
1447         */
1448        public ResourceReferenceDt addReport() {
1449                ResourceReferenceDt newType = new ResourceReferenceDt();
1450                getReport().add(newType);
1451                return newType; 
1452        }
1453  
1454        /**
1455         * Gets the value(s) for <b>complication</b> ().
1456         * creating it if it does
1457         * not exist. Will not return <code>null</code>.
1458         *
1459     * <p>
1460     * <b>Definition:</b>
1461     * Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues
1462     * </p> 
1463         */
1464        public java.util.List<CodeableConceptDt> getComplication() {  
1465                if (myComplication == null) {
1466                        myComplication = new java.util.ArrayList<CodeableConceptDt>();
1467                }
1468                return myComplication;
1469        }
1470
1471        /**
1472         * Sets the value(s) for <b>complication</b> ()
1473         *
1474     * <p>
1475     * <b>Definition:</b>
1476     * Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues
1477     * </p> 
1478         */
1479        public Procedure setComplication(java.util.List<CodeableConceptDt> theValue) {
1480                myComplication = theValue;
1481                return this;
1482        }
1483        
1484        
1485
1486        /**
1487         * Adds and returns a new value for <b>complication</b> ()
1488         *
1489     * <p>
1490     * <b>Definition:</b>
1491     * Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues
1492     * </p> 
1493         */
1494        public CodeableConceptDt addComplication() {
1495                CodeableConceptDt newType = new CodeableConceptDt();
1496                getComplication().add(newType);
1497                return newType; 
1498        }
1499
1500        /**
1501         * Adds a given new value for <b>complication</b> ()
1502         *
1503         * <p>
1504         * <b>Definition:</b>
1505         * Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues
1506         * </p>
1507         * @param theValue The complication to add (must not be <code>null</code>)
1508         */
1509        public Procedure addComplication(CodeableConceptDt theValue) {
1510                if (theValue == null) {
1511                        throw new NullPointerException("theValue must not be null");
1512                }
1513                getComplication().add(theValue);
1514                return this;
1515        }
1516
1517        /**
1518         * Gets the first repetition for <b>complication</b> (),
1519         * creating it if it does not already exist.
1520         *
1521     * <p>
1522     * <b>Definition:</b>
1523     * Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues
1524     * </p> 
1525         */
1526        public CodeableConceptDt getComplicationFirstRep() {
1527                if (getComplication().isEmpty()) {
1528                        return addComplication();
1529                }
1530                return getComplication().get(0); 
1531        }
1532  
1533        /**
1534         * Gets the value(s) for <b>followUp</b> ().
1535         * creating it if it does
1536         * not exist. Will not return <code>null</code>.
1537         *
1538     * <p>
1539     * <b>Definition:</b>
1540     * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used
1541     * </p> 
1542         */
1543        public java.util.List<CodeableConceptDt> getFollowUp() {  
1544                if (myFollowUp == null) {
1545                        myFollowUp = new java.util.ArrayList<CodeableConceptDt>();
1546                }
1547                return myFollowUp;
1548        }
1549
1550        /**
1551         * Sets the value(s) for <b>followUp</b> ()
1552         *
1553     * <p>
1554     * <b>Definition:</b>
1555     * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used
1556     * </p> 
1557         */
1558        public Procedure setFollowUp(java.util.List<CodeableConceptDt> theValue) {
1559                myFollowUp = theValue;
1560                return this;
1561        }
1562        
1563        
1564
1565        /**
1566         * Adds and returns a new value for <b>followUp</b> ()
1567         *
1568     * <p>
1569     * <b>Definition:</b>
1570     * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used
1571     * </p> 
1572         */
1573        public CodeableConceptDt addFollowUp() {
1574                CodeableConceptDt newType = new CodeableConceptDt();
1575                getFollowUp().add(newType);
1576                return newType; 
1577        }
1578
1579        /**
1580         * Adds a given new value for <b>followUp</b> ()
1581         *
1582         * <p>
1583         * <b>Definition:</b>
1584         * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used
1585         * </p>
1586         * @param theValue The followUp to add (must not be <code>null</code>)
1587         */
1588        public Procedure addFollowUp(CodeableConceptDt theValue) {
1589                if (theValue == null) {
1590                        throw new NullPointerException("theValue must not be null");
1591                }
1592                getFollowUp().add(theValue);
1593                return this;
1594        }
1595
1596        /**
1597         * Gets the first repetition for <b>followUp</b> (),
1598         * creating it if it does not already exist.
1599         *
1600     * <p>
1601     * <b>Definition:</b>
1602     * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used
1603     * </p> 
1604         */
1605        public CodeableConceptDt getFollowUpFirstRep() {
1606                if (getFollowUp().isEmpty()) {
1607                        return addFollowUp();
1608                }
1609                return getFollowUp().get(0); 
1610        }
1611  
1612        /**
1613         * Gets the value(s) for <b>request</b> ().
1614         * creating it if it does
1615         * not exist. Will not return <code>null</code>.
1616         *
1617     * <p>
1618     * <b>Definition:</b>
1619     * A reference to a resource that contains details of the request for this procedure.
1620     * </p> 
1621         */
1622        public ResourceReferenceDt getRequest() {  
1623                if (myRequest == null) {
1624                        myRequest = new ResourceReferenceDt();
1625                }
1626                return myRequest;
1627        }
1628
1629        /**
1630         * Sets the value(s) for <b>request</b> ()
1631         *
1632     * <p>
1633     * <b>Definition:</b>
1634     * A reference to a resource that contains details of the request for this procedure.
1635     * </p> 
1636         */
1637        public Procedure setRequest(ResourceReferenceDt theValue) {
1638                myRequest = theValue;
1639                return this;
1640        }
1641        
1642        
1643
1644  
1645        /**
1646         * Gets the value(s) for <b>notes</b> ().
1647         * creating it if it does
1648         * not exist. Will not return <code>null</code>.
1649         *
1650     * <p>
1651     * <b>Definition:</b>
1652     * Any other notes about the procedure.  E.g. the operative notes
1653     * </p> 
1654         */
1655        public java.util.List<AnnotationDt> getNotes() {  
1656                if (myNotes == null) {
1657                        myNotes = new java.util.ArrayList<AnnotationDt>();
1658                }
1659                return myNotes;
1660        }
1661
1662        /**
1663         * Sets the value(s) for <b>notes</b> ()
1664         *
1665     * <p>
1666     * <b>Definition:</b>
1667     * Any other notes about the procedure.  E.g. the operative notes
1668     * </p> 
1669         */
1670        public Procedure setNotes(java.util.List<AnnotationDt> theValue) {
1671                myNotes = theValue;
1672                return this;
1673        }
1674        
1675        
1676
1677        /**
1678         * Adds and returns a new value for <b>notes</b> ()
1679         *
1680     * <p>
1681     * <b>Definition:</b>
1682     * Any other notes about the procedure.  E.g. the operative notes
1683     * </p> 
1684         */
1685        public AnnotationDt addNotes() {
1686                AnnotationDt newType = new AnnotationDt();
1687                getNotes().add(newType);
1688                return newType; 
1689        }
1690
1691        /**
1692         * Adds a given new value for <b>notes</b> ()
1693         *
1694         * <p>
1695         * <b>Definition:</b>
1696         * Any other notes about the procedure.  E.g. the operative notes
1697         * </p>
1698         * @param theValue The notes to add (must not be <code>null</code>)
1699         */
1700        public Procedure addNotes(AnnotationDt theValue) {
1701                if (theValue == null) {
1702                        throw new NullPointerException("theValue must not be null");
1703                }
1704                getNotes().add(theValue);
1705                return this;
1706        }
1707
1708        /**
1709         * Gets the first repetition for <b>notes</b> (),
1710         * creating it if it does not already exist.
1711         *
1712     * <p>
1713     * <b>Definition:</b>
1714     * Any other notes about the procedure.  E.g. the operative notes
1715     * </p> 
1716         */
1717        public AnnotationDt getNotesFirstRep() {
1718                if (getNotes().isEmpty()) {
1719                        return addNotes();
1720                }
1721                return getNotes().get(0); 
1722        }
1723  
1724        /**
1725         * Gets the value(s) for <b>focalDevice</b> ().
1726         * creating it if it does
1727         * not exist. Will not return <code>null</code>.
1728         *
1729     * <p>
1730     * <b>Definition:</b>
1731     * A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.
1732     * </p> 
1733         */
1734        public java.util.List<FocalDevice> getFocalDevice() {  
1735                if (myFocalDevice == null) {
1736                        myFocalDevice = new java.util.ArrayList<FocalDevice>();
1737                }
1738                return myFocalDevice;
1739        }
1740
1741        /**
1742         * Sets the value(s) for <b>focalDevice</b> ()
1743         *
1744     * <p>
1745     * <b>Definition:</b>
1746     * A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.
1747     * </p> 
1748         */
1749        public Procedure setFocalDevice(java.util.List<FocalDevice> theValue) {
1750                myFocalDevice = theValue;
1751                return this;
1752        }
1753        
1754        
1755
1756        /**
1757         * Adds and returns a new value for <b>focalDevice</b> ()
1758         *
1759     * <p>
1760     * <b>Definition:</b>
1761     * A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.
1762     * </p> 
1763         */
1764        public FocalDevice addFocalDevice() {
1765                FocalDevice newType = new FocalDevice();
1766                getFocalDevice().add(newType);
1767                return newType; 
1768        }
1769
1770        /**
1771         * Adds a given new value for <b>focalDevice</b> ()
1772         *
1773         * <p>
1774         * <b>Definition:</b>
1775         * A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.
1776         * </p>
1777         * @param theValue The focalDevice to add (must not be <code>null</code>)
1778         */
1779        public Procedure addFocalDevice(FocalDevice theValue) {
1780                if (theValue == null) {
1781                        throw new NullPointerException("theValue must not be null");
1782                }
1783                getFocalDevice().add(theValue);
1784                return this;
1785        }
1786
1787        /**
1788         * Gets the first repetition for <b>focalDevice</b> (),
1789         * creating it if it does not already exist.
1790         *
1791     * <p>
1792     * <b>Definition:</b>
1793     * A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.
1794     * </p> 
1795         */
1796        public FocalDevice getFocalDeviceFirstRep() {
1797                if (getFocalDevice().isEmpty()) {
1798                        return addFocalDevice();
1799                }
1800                return getFocalDevice().get(0); 
1801        }
1802  
1803        /**
1804         * Gets the value(s) for <b>used</b> ().
1805         * creating it if it does
1806         * not exist. Will not return <code>null</code>.
1807         *
1808     * <p>
1809     * <b>Definition:</b>
1810     * Identifies medications, devices and any other substance used as part of the procedure
1811     * </p> 
1812         */
1813        public java.util.List<ResourceReferenceDt> getUsed() {  
1814                if (myUsed == null) {
1815                        myUsed = new java.util.ArrayList<ResourceReferenceDt>();
1816                }
1817                return myUsed;
1818        }
1819
1820        /**
1821         * Sets the value(s) for <b>used</b> ()
1822         *
1823     * <p>
1824     * <b>Definition:</b>
1825     * Identifies medications, devices and any other substance used as part of the procedure
1826     * </p> 
1827         */
1828        public Procedure setUsed(java.util.List<ResourceReferenceDt> theValue) {
1829                myUsed = theValue;
1830                return this;
1831        }
1832        
1833        
1834
1835        /**
1836         * Adds and returns a new value for <b>used</b> ()
1837         *
1838     * <p>
1839     * <b>Definition:</b>
1840     * Identifies medications, devices and any other substance used as part of the procedure
1841     * </p> 
1842         */
1843        public ResourceReferenceDt addUsed() {
1844                ResourceReferenceDt newType = new ResourceReferenceDt();
1845                getUsed().add(newType);
1846                return newType; 
1847        }
1848  
1849        /**
1850         * Block class for child element: <b>Procedure.performer</b> ()
1851         *
1852     * <p>
1853     * <b>Definition:</b>
1854     * Limited to 'real' people rather than equipment
1855     * </p> 
1856         */
1857        @Block()        
1858        public static class Performer 
1859            extends  BaseIdentifiableElement        implements IResourceBlock {
1860        
1861        @Child(name="actor", order=0, min=0, max=1, summary=true, modifier=false, type={
1862                ca.uhn.fhir.model.dstu2.resource.Practitioner.class,            ca.uhn.fhir.model.dstu2.resource.Organization.class,            ca.uhn.fhir.model.dstu2.resource.Patient.class,                 ca.uhn.fhir.model.dstu2.resource.RelatedPerson.class    })
1863        @Description(
1864                shortDefinition="who.actor",
1865                formalDefinition="The practitioner who was involved in the procedure"
1866        )
1867        private ResourceReferenceDt myActor;
1868        
1869        @Child(name="role", type=CodeableConceptDt.class, order=1, min=0, max=1, summary=true, modifier=false)  
1870        @Description(
1871                shortDefinition="",
1872                formalDefinition="For example: surgeon, anaethetist, endoscopist"
1873        )
1874        private CodeableConceptDt myRole;
1875        
1876
1877        @Override
1878        public boolean isEmpty() {
1879                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myActor,  myRole);
1880        }
1881        
1882        @Override
1883        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1884                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myActor, myRole);
1885        }
1886
1887        /**
1888         * Gets the value(s) for <b>actor</b> (who.actor).
1889         * creating it if it does
1890         * not exist. Will not return <code>null</code>.
1891         *
1892     * <p>
1893     * <b>Definition:</b>
1894     * The practitioner who was involved in the procedure
1895     * </p> 
1896         */
1897        public ResourceReferenceDt getActor() {  
1898                if (myActor == null) {
1899                        myActor = new ResourceReferenceDt();
1900                }
1901                return myActor;
1902        }
1903
1904        /**
1905         * Sets the value(s) for <b>actor</b> (who.actor)
1906         *
1907     * <p>
1908     * <b>Definition:</b>
1909     * The practitioner who was involved in the procedure
1910     * </p> 
1911         */
1912        public Performer setActor(ResourceReferenceDt theValue) {
1913                myActor = theValue;
1914                return this;
1915        }
1916        
1917        
1918
1919  
1920        /**
1921         * Gets the value(s) for <b>role</b> ().
1922         * creating it if it does
1923         * not exist. Will not return <code>null</code>.
1924         *
1925     * <p>
1926     * <b>Definition:</b>
1927     * For example: surgeon, anaethetist, endoscopist
1928     * </p> 
1929         */
1930        public CodeableConceptDt getRole() {  
1931                if (myRole == null) {
1932                        myRole = new CodeableConceptDt();
1933                }
1934                return myRole;
1935        }
1936
1937        /**
1938         * Sets the value(s) for <b>role</b> ()
1939         *
1940     * <p>
1941     * <b>Definition:</b>
1942     * For example: surgeon, anaethetist, endoscopist
1943     * </p> 
1944         */
1945        public Performer setRole(CodeableConceptDt theValue) {
1946                myRole = theValue;
1947                return this;
1948        }
1949        
1950        
1951
1952  
1953
1954
1955        }
1956
1957
1958        /**
1959         * Block class for child element: <b>Procedure.focalDevice</b> ()
1960         *
1961     * <p>
1962     * <b>Definition:</b>
1963     * A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.
1964     * </p> 
1965         */
1966        @Block()        
1967        public static class FocalDevice 
1968            extends  BaseIdentifiableElement        implements IResourceBlock {
1969        
1970        @Child(name="action", type=CodeableConceptDt.class, order=0, min=0, max=1, summary=false, modifier=false)       
1971        @Description(
1972                shortDefinition="",
1973                formalDefinition="The kind of change that happened to the device during the procedure"
1974        )
1975        private CodeableConceptDt myAction;
1976        
1977        @Child(name="manipulated", order=1, min=1, max=1, summary=false, modifier=false, type={
1978                ca.uhn.fhir.model.dstu2.resource.Device.class   })
1979        @Description(
1980                shortDefinition="",
1981                formalDefinition="The device that was manipulated (changed) during the procedure"
1982        )
1983        private ResourceReferenceDt myManipulated;
1984        
1985
1986        @Override
1987        public boolean isEmpty() {
1988                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myAction,  myManipulated);
1989        }
1990        
1991        @Override
1992        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1993                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myAction, myManipulated);
1994        }
1995
1996        /**
1997         * Gets the value(s) for <b>action</b> ().
1998         * creating it if it does
1999         * not exist. Will not return <code>null</code>.
2000         *
2001     * <p>
2002     * <b>Definition:</b>
2003     * The kind of change that happened to the device during the procedure
2004     * </p> 
2005         */
2006        public CodeableConceptDt getAction() {  
2007                if (myAction == null) {
2008                        myAction = new CodeableConceptDt();
2009                }
2010                return myAction;
2011        }
2012
2013        /**
2014         * Sets the value(s) for <b>action</b> ()
2015         *
2016     * <p>
2017     * <b>Definition:</b>
2018     * The kind of change that happened to the device during the procedure
2019     * </p> 
2020         */
2021        public FocalDevice setAction(CodeableConceptDt theValue) {
2022                myAction = theValue;
2023                return this;
2024        }
2025        
2026        
2027
2028  
2029        /**
2030         * Gets the value(s) for <b>manipulated</b> ().
2031         * creating it if it does
2032         * not exist. Will not return <code>null</code>.
2033         *
2034     * <p>
2035     * <b>Definition:</b>
2036     * The device that was manipulated (changed) during the procedure
2037     * </p> 
2038         */
2039        public ResourceReferenceDt getManipulated() {  
2040                if (myManipulated == null) {
2041                        myManipulated = new ResourceReferenceDt();
2042                }
2043                return myManipulated;
2044        }
2045
2046        /**
2047         * Sets the value(s) for <b>manipulated</b> ()
2048         *
2049     * <p>
2050     * <b>Definition:</b>
2051     * The device that was manipulated (changed) during the procedure
2052     * </p> 
2053         */
2054        public FocalDevice setManipulated(ResourceReferenceDt theValue) {
2055                myManipulated = theValue;
2056                return this;
2057        }
2058        
2059        
2060
2061  
2062
2063
2064        }
2065
2066
2067
2068
2069    @Override
2070    public String getResourceName() {
2071        return "Procedure";
2072    }
2073    
2074    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
2075        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
2076    }
2077
2078
2079}