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>Bundle</b> Resource
282 * ()
283 *
284 * <p>
285 * <b>Definition:</b>
286 * A container for a collection of resources.
287 * </p> 
288 *
289 * <p>
290 * <b>Requirements:</b>
291 * 
292 * </p> 
293 *
294 * <p>
295 * <b>Profile Definition:</b>
296 * <a href="http://hl7.org/fhir/profiles/Bundle">http://hl7.org/fhir/profiles/Bundle</a> 
297 * </p>
298 *
299 */
300@ResourceDef(name="Bundle", profile="http://hl7.org/fhir/profiles/Bundle", id="bundle")
301public class Bundle extends ca.uhn.fhir.model.dstu2.resource.BaseResource
302    implements  IResource 
303    , org.hl7.fhir.instance.model.api.IBaseBundle
304    {
305
306        /**
307         * Search parameter constant for <b>type</b>
308         * <p>
309         * Description: <b></b><br>
310         * Type: <b>token</b><br>
311         * Path: <b>Bundle.type</b><br>
312         * </p>
313         */
314        @SearchParamDefinition(name="type", path="Bundle.type", description="", type="token" 
315 )
316        public static final String SP_TYPE = "type";
317
318        /**
319         * <b>Fluent Client</b> search parameter constant for <b>type</b>
320         * <p>
321         * Description: <b></b><br>
322         * Type: <b>token</b><br>
323         * Path: <b>Bundle.type</b><br>
324         * </p>
325         */
326        public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE);
327
328        /**
329         * Search parameter constant for <b>message</b>
330         * <p>
331         * Description: <b>The first resource in the bundle, if the bundle type is \&quot;message\&quot; - this is a message header, and this parameter provides access to search its contents</b><br>
332         * Type: <b>reference</b><br>
333         * Path: <b>Bundle.entry.resource(0)</b><br>
334         * </p>
335         */
336        @SearchParamDefinition(name="message", path="Bundle.entry.resource(0)", description="The first resource in the bundle, if the bundle type is \"message\" - this is a message header, and this parameter provides access to search its contents", type="reference" 
337, target={
338 ca.uhn.fhir.model.dstu2.resource.MessageHeader.class   }
339 )
340        public static final String SP_MESSAGE = "message";
341
342        /**
343         * <b>Fluent Client</b> search parameter constant for <b>message</b>
344         * <p>
345         * Description: <b>The first resource in the bundle, if the bundle type is \&quot;message\&quot; - this is a message header, and this parameter provides access to search its contents</b><br>
346         * Type: <b>reference</b><br>
347         * Path: <b>Bundle.entry.resource(0)</b><br>
348         * </p>
349         */
350        public static final ReferenceClientParam MESSAGE = new ReferenceClientParam(SP_MESSAGE);
351
352        /**
353         * Search parameter constant for <b>composition</b>
354         * <p>
355         * Description: <b>The first resource in the bundle, if the bundle type is \&quot;document\&quot; - this is a composition, and this parameter provides access to searches its contents</b><br>
356         * Type: <b>reference</b><br>
357         * Path: <b>Bundle.entry.resource(0)</b><br>
358         * </p>
359         */
360        @SearchParamDefinition(name="composition", path="Bundle.entry.resource(0)", description="The first resource in the bundle, if the bundle type is \"document\" - this is a composition, and this parameter provides access to searches its contents", type="reference" 
361, target={
362 ca.uhn.fhir.model.dstu2.resource.Composition.class     }
363 )
364        public static final String SP_COMPOSITION = "composition";
365
366        /**
367         * <b>Fluent Client</b> search parameter constant for <b>composition</b>
368         * <p>
369         * Description: <b>The first resource in the bundle, if the bundle type is \&quot;document\&quot; - this is a composition, and this parameter provides access to searches its contents</b><br>
370         * Type: <b>reference</b><br>
371         * Path: <b>Bundle.entry.resource(0)</b><br>
372         * </p>
373         */
374        public static final ReferenceClientParam COMPOSITION = new ReferenceClientParam(SP_COMPOSITION);
375
376
377        /**
378         * Constant for fluent queries to be used to add include statements. Specifies
379         * the path value of "<b>Bundle:composition</b>".
380         */
381        public static final Include INCLUDE_COMPOSITION = new Include("Bundle:composition");
382
383        /**
384         * Constant for fluent queries to be used to add include statements. Specifies
385         * the path value of "<b>Bundle:message</b>".
386         */
387        public static final Include INCLUDE_MESSAGE = new Include("Bundle:message");
388
389
390        @Child(name="type", type=CodeDt.class, order=0, min=1, max=1, summary=true, modifier=false)     
391        @Description(
392                shortDefinition="",
393                formalDefinition="Indicates the purpose of this bundle- how it was intended to be used"
394        )
395        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/bundle-type")
396        private BoundCodeDt<BundleTypeEnum> myType;
397        
398        @Child(name="total", type=UnsignedIntDt.class, order=1, min=0, max=1, summary=true, modifier=false)     
399        @Description(
400                shortDefinition="",
401                formalDefinition="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)"
402        )
403        private UnsignedIntDt myTotal;
404        
405        @Child(name="link", order=2, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)      
406        @Description(
407                shortDefinition="",
408                formalDefinition="A series of links that provide context to this bundle"
409        )
410        private java.util.List<Link> myLink;
411        
412        @Child(name="entry", order=3, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)     
413        @Description(
414                shortDefinition="",
415                formalDefinition="An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)"
416        )
417        private java.util.List<Entry> myEntry;
418        
419        @Child(name="signature", type=SignatureDt.class, order=4, min=0, max=1, summary=true, modifier=false)   
420        @Description(
421                shortDefinition="",
422                formalDefinition="Digital Signature - base64 encoded. XML DigSIg or a JWT"
423        )
424        private SignatureDt mySignature;
425        
426
427        @Override
428        public boolean isEmpty() {
429                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myType,  myTotal,  myLink,  myEntry,  mySignature);
430        }
431        
432        @Override
433        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
434                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myTotal, myLink, myEntry, mySignature);
435        }
436
437        /**
438         * Gets the value(s) for <b>type</b> ().
439         * creating it if it does
440         * not exist. Will not return <code>null</code>.
441         *
442     * <p>
443     * <b>Definition:</b>
444     * Indicates the purpose of this bundle- how it was intended to be used
445     * </p> 
446         */
447        public BoundCodeDt<BundleTypeEnum> getTypeElement() {  
448                if (myType == null) {
449                        myType = new BoundCodeDt<BundleTypeEnum>(BundleTypeEnum.VALUESET_BINDER);
450                }
451                return myType;
452        }
453
454        
455        /**
456         * Gets the value(s) for <b>type</b> ().
457         * creating it if it does
458         * not exist. This method may return <code>null</code>.
459         *
460     * <p>
461     * <b>Definition:</b>
462     * Indicates the purpose of this bundle- how it was intended to be used
463     * </p> 
464         */
465        public String getType() {  
466                return getTypeElement().getValue();
467        }
468
469        /**
470         * Sets the value(s) for <b>type</b> ()
471         *
472     * <p>
473     * <b>Definition:</b>
474     * Indicates the purpose of this bundle- how it was intended to be used
475     * </p> 
476         */
477        public Bundle setType(BoundCodeDt<BundleTypeEnum> theValue) {
478                myType = theValue;
479                return this;
480        }
481        
482        
483
484        /**
485         * Sets the value(s) for <b>type</b> ()
486         *
487     * <p>
488     * <b>Definition:</b>
489     * Indicates the purpose of this bundle- how it was intended to be used
490     * </p> 
491         */
492        public Bundle setType(BundleTypeEnum theValue) {
493                setType(new BoundCodeDt<BundleTypeEnum>(BundleTypeEnum.VALUESET_BINDER, theValue));
494                
495/*
496                getTypeElement().setValueAsEnum(theValue);
497*/
498                return this;
499        }
500
501  
502        /**
503         * Gets the value(s) for <b>total</b> ().
504         * creating it if it does
505         * not exist. Will not return <code>null</code>.
506         *
507     * <p>
508     * <b>Definition:</b>
509     * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)
510     * </p> 
511         */
512        public UnsignedIntDt getTotalElement() {  
513                if (myTotal == null) {
514                        myTotal = new UnsignedIntDt();
515                }
516                return myTotal;
517        }
518
519        
520        /**
521         * Gets the value(s) for <b>total</b> ().
522         * creating it if it does
523         * not exist. This method may return <code>null</code>.
524         *
525     * <p>
526     * <b>Definition:</b>
527     * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)
528     * </p> 
529         */
530        public Integer getTotal() {  
531                return getTotalElement().getValue();
532        }
533
534        /**
535         * Sets the value(s) for <b>total</b> ()
536         *
537     * <p>
538     * <b>Definition:</b>
539     * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)
540     * </p> 
541         */
542        public Bundle setTotal(UnsignedIntDt theValue) {
543                myTotal = theValue;
544                return this;
545        }
546        
547        
548
549        /**
550         * Sets the value for <b>total</b> ()
551         *
552     * <p>
553     * <b>Definition:</b>
554     * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)
555     * </p> 
556         */
557        public Bundle setTotal( int theInteger) {
558                myTotal = new UnsignedIntDt(theInteger); 
559                return this; 
560        }
561
562 
563        /**
564         * Gets the value(s) for <b>link</b> ().
565         * creating it if it does
566         * not exist. Will not return <code>null</code>.
567         *
568     * <p>
569     * <b>Definition:</b>
570     * A series of links that provide context to this bundle
571     * </p> 
572         */
573        public java.util.List<Link> getLink() {  
574                if (myLink == null) {
575                        myLink = new java.util.ArrayList<Link>();
576                }
577                return myLink;
578        }
579
580        /**
581         * Sets the value(s) for <b>link</b> ()
582         *
583     * <p>
584     * <b>Definition:</b>
585     * A series of links that provide context to this bundle
586     * </p> 
587         */
588        public Bundle setLink(java.util.List<Link> theValue) {
589                myLink = theValue;
590                return this;
591        }
592        
593        
594
595        /**
596         * Adds and returns a new value for <b>link</b> ()
597         *
598     * <p>
599     * <b>Definition:</b>
600     * A series of links that provide context to this bundle
601     * </p> 
602         */
603        public Link addLink() {
604                Link newType = new Link();
605                getLink().add(newType);
606                return newType; 
607        }
608
609        /**
610         * Adds a given new value for <b>link</b> ()
611         *
612         * <p>
613         * <b>Definition:</b>
614         * A series of links that provide context to this bundle
615         * </p>
616         * @param theValue The link to add (must not be <code>null</code>)
617         */
618        public Bundle addLink(Link theValue) {
619                if (theValue == null) {
620                        throw new NullPointerException("theValue must not be null");
621                }
622                getLink().add(theValue);
623                return this;
624        }
625
626        /**
627         * Gets the first repetition for <b>link</b> (),
628         * creating it if it does not already exist.
629         *
630     * <p>
631     * <b>Definition:</b>
632     * A series of links that provide context to this bundle
633     * </p> 
634         */
635        public Link getLinkFirstRep() {
636                if (getLink().isEmpty()) {
637                        return addLink();
638                }
639                return getLink().get(0); 
640        }
641  
642        /**
643         * Gets the value(s) for <b>entry</b> ().
644         * creating it if it does
645         * not exist. Will not return <code>null</code>.
646         *
647     * <p>
648     * <b>Definition:</b>
649     * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)
650     * </p> 
651         */
652        public java.util.List<Entry> getEntry() {  
653                if (myEntry == null) {
654                        myEntry = new java.util.ArrayList<Entry>();
655                }
656                return myEntry;
657        }
658
659        /**
660         * Sets the value(s) for <b>entry</b> ()
661         *
662     * <p>
663     * <b>Definition:</b>
664     * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)
665     * </p> 
666         */
667        public Bundle setEntry(java.util.List<Entry> theValue) {
668                myEntry = theValue;
669                return this;
670        }
671        
672        
673
674        /**
675         * Adds and returns a new value for <b>entry</b> ()
676         *
677     * <p>
678     * <b>Definition:</b>
679     * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)
680     * </p> 
681         */
682        public Entry addEntry() {
683                Entry newType = new Entry();
684                getEntry().add(newType);
685                return newType; 
686        }
687
688        /**
689         * Adds a given new value for <b>entry</b> ()
690         *
691         * <p>
692         * <b>Definition:</b>
693         * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)
694         * </p>
695         * @param theValue The entry to add (must not be <code>null</code>)
696         */
697        public Bundle addEntry(Entry theValue) {
698                if (theValue == null) {
699                        throw new NullPointerException("theValue must not be null");
700                }
701                getEntry().add(theValue);
702                return this;
703        }
704
705        /**
706         * Gets the first repetition for <b>entry</b> (),
707         * creating it if it does not already exist.
708         *
709     * <p>
710     * <b>Definition:</b>
711     * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)
712     * </p> 
713         */
714        public Entry getEntryFirstRep() {
715                if (getEntry().isEmpty()) {
716                        return addEntry();
717                }
718                return getEntry().get(0); 
719        }
720  
721        /**
722         * Gets the value(s) for <b>signature</b> ().
723         * creating it if it does
724         * not exist. Will not return <code>null</code>.
725         *
726     * <p>
727     * <b>Definition:</b>
728     * Digital Signature - base64 encoded. XML DigSIg or a JWT
729     * </p> 
730         */
731        public SignatureDt getSignature() {  
732                if (mySignature == null) {
733                        mySignature = new SignatureDt();
734                }
735                return mySignature;
736        }
737
738        /**
739         * Sets the value(s) for <b>signature</b> ()
740         *
741     * <p>
742     * <b>Definition:</b>
743     * Digital Signature - base64 encoded. XML DigSIg or a JWT
744     * </p> 
745         */
746        public Bundle setSignature(SignatureDt theValue) {
747                mySignature = theValue;
748                return this;
749        }
750        
751        
752
753  
754        /**
755         * Block class for child element: <b>Bundle.link</b> ()
756         *
757     * <p>
758     * <b>Definition:</b>
759     * A series of links that provide context to this bundle
760     * </p> 
761         */
762        @Block()        
763        public static class Link 
764            extends  BaseIdentifiableElement  
765            implements IResourceBlock {
766        
767        @Child(name="relation", type=StringDt.class, order=0, min=1, max=1, summary=true, modifier=false)       
768        @Description(
769                shortDefinition="",
770                formalDefinition="A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]"
771        )
772        private StringDt myRelation;
773        
774        @Child(name="url", type=UriDt.class, order=1, min=1, max=1, summary=true, modifier=false)       
775        @Description(
776                shortDefinition="",
777                formalDefinition="The reference details for the link"
778        )
779        private UriDt myUrl;
780        
781
782        @Override
783        public boolean isEmpty() {
784                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myRelation,  myUrl);
785        }
786        
787        @Override
788        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
789                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRelation, myUrl);
790        }
791
792        /**
793         * Gets the value(s) for <b>relation</b> ().
794         * creating it if it does
795         * not exist. Will not return <code>null</code>.
796         *
797     * <p>
798     * <b>Definition:</b>
799     * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]
800     * </p> 
801         */
802        public StringDt getRelationElement() {  
803                if (myRelation == null) {
804                        myRelation = new StringDt();
805                }
806                return myRelation;
807        }
808
809        
810        /**
811         * Gets the value(s) for <b>relation</b> ().
812         * creating it if it does
813         * not exist. This method may return <code>null</code>.
814         *
815     * <p>
816     * <b>Definition:</b>
817     * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]
818     * </p> 
819         */
820        public String getRelation() {  
821                return getRelationElement().getValue();
822        }
823
824        /**
825         * Sets the value(s) for <b>relation</b> ()
826         *
827     * <p>
828     * <b>Definition:</b>
829     * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]
830     * </p> 
831         */
832        public Link setRelation(StringDt theValue) {
833                myRelation = theValue;
834                return this;
835        }
836        
837        
838
839        /**
840         * Sets the value for <b>relation</b> ()
841         *
842     * <p>
843     * <b>Definition:</b>
844     * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]
845     * </p> 
846         */
847        public Link setRelation( String theString) {
848                myRelation = new StringDt(theString); 
849                return this; 
850        }
851
852 
853        /**
854         * Gets the value(s) for <b>url</b> ().
855         * creating it if it does
856         * not exist. Will not return <code>null</code>.
857         *
858     * <p>
859     * <b>Definition:</b>
860     * The reference details for the link
861     * </p> 
862         */
863        public UriDt getUrlElement() {  
864                if (myUrl == null) {
865                        myUrl = new UriDt();
866                }
867                return myUrl;
868        }
869
870        
871        /**
872         * Gets the value(s) for <b>url</b> ().
873         * creating it if it does
874         * not exist. This method may return <code>null</code>.
875         *
876     * <p>
877     * <b>Definition:</b>
878     * The reference details for the link
879     * </p> 
880         */
881        public String getUrl() {  
882                return getUrlElement().getValue();
883        }
884
885        /**
886         * Sets the value(s) for <b>url</b> ()
887         *
888     * <p>
889     * <b>Definition:</b>
890     * The reference details for the link
891     * </p> 
892         */
893        public Link setUrl(UriDt theValue) {
894                myUrl = theValue;
895                return this;
896        }
897        
898        
899
900        /**
901         * Sets the value for <b>url</b> ()
902         *
903     * <p>
904     * <b>Definition:</b>
905     * The reference details for the link
906     * </p> 
907         */
908        public Link setUrl( String theUri) {
909                myUrl = new UriDt(theUri); 
910                return this; 
911        }
912
913 
914
915
916        }
917
918
919        /**
920         * Block class for child element: <b>Bundle.entry</b> ()
921         *
922     * <p>
923     * <b>Definition:</b>
924     * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)
925     * </p> 
926         */
927        @Block()        
928        public static class Entry 
929            extends  BaseIdentifiableElement  
930            implements IResourceBlock {
931        
932        @Child(name="link", type=Link.class, order=0, min=0, max=Child.MAX_UNLIMITED, summary=true, modifier=false)     
933        @Description(
934                shortDefinition="",
935                formalDefinition="A series of links that provide context to this entry"
936        )
937        private java.util.List<Link> myLink;
938        
939        @Child(name="fullUrl", type=UriDt.class, order=1, min=0, max=1, summary=true, modifier=false)   
940        @Description(
941                shortDefinition="",
942                formalDefinition="The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource"
943        )
944        private UriDt myFullUrl;
945        
946        @Child(name="resource", type=IResource.class, order=2, min=0, max=1, summary=true, modifier=false)      
947        @Description(
948                shortDefinition="",
949                formalDefinition="The Resources for the entry"
950        )
951        private IResource myResource;
952        
953        @Child(name="search", order=3, min=0, max=1, summary=true, modifier=false)      
954        @Description(
955                shortDefinition="",
956                formalDefinition="Information about the search process that lead to the creation of this entry"
957        )
958        private EntrySearch mySearch;
959        
960        @Child(name="request", order=4, min=0, max=1, summary=true, modifier=false)     
961        @Description(
962                shortDefinition="",
963                formalDefinition="Additional information about how this entry should be processed as part of a transaction"
964        )
965        private EntryRequest myRequest;
966        
967        @Child(name="response", order=5, min=0, max=1, summary=true, modifier=false)    
968        @Description(
969                shortDefinition="",
970                formalDefinition="Additional information about how this entry should be processed as part of a transaction"
971        )
972        private EntryResponse myResponse;
973        
974
975        @Override
976        public boolean isEmpty() {
977                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myLink,  myFullUrl,  myResource,  mySearch,  myRequest,  myResponse);
978        }
979        
980        @Override
981        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
982                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myLink, myFullUrl, myResource, mySearch, myRequest, myResponse);
983        }
984
985        /**
986         * Gets the value(s) for <b>link</b> ().
987         * creating it if it does
988         * not exist. Will not return <code>null</code>.
989         *
990     * <p>
991     * <b>Definition:</b>
992     * A series of links that provide context to this entry
993     * </p> 
994         */
995        public java.util.List<Link> getLink() {  
996                if (myLink == null) {
997                        myLink = new java.util.ArrayList<Link>();
998                }
999                return myLink;
1000        }
1001
1002        /**
1003         * Sets the value(s) for <b>link</b> ()
1004         *
1005     * <p>
1006     * <b>Definition:</b>
1007     * A series of links that provide context to this entry
1008     * </p> 
1009         */
1010        public Entry setLink(java.util.List<Link> theValue) {
1011                myLink = theValue;
1012                return this;
1013        }
1014        
1015        
1016
1017        /**
1018         * Adds and returns a new value for <b>link</b> ()
1019         *
1020     * <p>
1021     * <b>Definition:</b>
1022     * A series of links that provide context to this entry
1023     * </p> 
1024         */
1025        public Link addLink() {
1026                Link newType = new Link();
1027                getLink().add(newType);
1028                return newType; 
1029        }
1030
1031        /**
1032         * Adds a given new value for <b>link</b> ()
1033         *
1034         * <p>
1035         * <b>Definition:</b>
1036         * A series of links that provide context to this entry
1037         * </p>
1038         * @param theValue The link to add (must not be <code>null</code>)
1039         */
1040        public Entry addLink(Link theValue) {
1041                if (theValue == null) {
1042                        throw new NullPointerException("theValue must not be null");
1043                }
1044                getLink().add(theValue);
1045                return this;
1046        }
1047
1048        /**
1049         * Gets the first repetition for <b>link</b> (),
1050         * creating it if it does not already exist.
1051         *
1052     * <p>
1053     * <b>Definition:</b>
1054     * A series of links that provide context to this entry
1055     * </p> 
1056         */
1057        public Link getLinkFirstRep() {
1058                if (getLink().isEmpty()) {
1059                        return addLink();
1060                }
1061                return getLink().get(0); 
1062        }
1063  
1064        /**
1065         * Gets the value(s) for <b>fullUrl</b> ().
1066         * creating it if it does
1067         * not exist. Will not return <code>null</code>.
1068         *
1069     * <p>
1070     * <b>Definition:</b>
1071     * The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource
1072     * </p> 
1073         */
1074        public UriDt getFullUrlElement() {  
1075                if (myFullUrl == null) {
1076                        myFullUrl = new UriDt();
1077                }
1078                return myFullUrl;
1079        }
1080
1081        
1082        /**
1083         * Gets the value(s) for <b>fullUrl</b> ().
1084         * creating it if it does
1085         * not exist. This method may return <code>null</code>.
1086         *
1087     * <p>
1088     * <b>Definition:</b>
1089     * The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource
1090     * </p> 
1091         */
1092        public String getFullUrl() {  
1093                return getFullUrlElement().getValue();
1094        }
1095
1096        /**
1097         * Sets the value(s) for <b>fullUrl</b> ()
1098         *
1099     * <p>
1100     * <b>Definition:</b>
1101     * The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource
1102     * </p> 
1103         */
1104        public Entry setFullUrl(UriDt theValue) {
1105                myFullUrl = theValue;
1106                return this;
1107        }
1108        
1109        
1110
1111        /**
1112         * Sets the value for <b>fullUrl</b> ()
1113         *
1114     * <p>
1115     * <b>Definition:</b>
1116     * The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource
1117     * </p> 
1118         */
1119        public Entry setFullUrl( String theUri) {
1120                myFullUrl = new UriDt(theUri); 
1121                return this; 
1122        }
1123
1124 
1125        /**
1126         * Gets the value(s) for <b>resource</b> ().
1127         *
1128     * <p>
1129     * <b>Definition:</b>
1130     * The Resources for the entry
1131     * </p> 
1132         */
1133        public IResource getResource() {  
1134                return myResource;
1135        }
1136
1137
1138        /**
1139         * Sets the value(s) for <b>resource</b> ()
1140         *
1141     * <p>
1142     * <b>Definition:</b>
1143     * The Resources for the entry
1144     * </p> 
1145         */
1146        public Entry setResource(IResource theValue) {
1147                myResource = theValue;
1148                return this;
1149        }
1150        
1151        
1152
1153  
1154        /**
1155         * Gets the value(s) for <b>search</b> ().
1156         * creating it if it does
1157         * not exist. Will not return <code>null</code>.
1158         *
1159     * <p>
1160     * <b>Definition:</b>
1161     * Information about the search process that lead to the creation of this entry
1162     * </p> 
1163         */
1164        public EntrySearch getSearch() {  
1165                if (mySearch == null) {
1166                        mySearch = new EntrySearch();
1167                }
1168                return mySearch;
1169        }
1170
1171        /**
1172         * Sets the value(s) for <b>search</b> ()
1173         *
1174     * <p>
1175     * <b>Definition:</b>
1176     * Information about the search process that lead to the creation of this entry
1177     * </p> 
1178         */
1179        public Entry setSearch(EntrySearch theValue) {
1180                mySearch = theValue;
1181                return this;
1182        }
1183        
1184        
1185
1186  
1187        /**
1188         * Gets the value(s) for <b>request</b> ().
1189         * creating it if it does
1190         * not exist. Will not return <code>null</code>.
1191         *
1192     * <p>
1193     * <b>Definition:</b>
1194     * Additional information about how this entry should be processed as part of a transaction
1195     * </p> 
1196         */
1197        public EntryRequest getRequest() {  
1198                if (myRequest == null) {
1199                        myRequest = new EntryRequest();
1200                }
1201                return myRequest;
1202        }
1203
1204        /**
1205         * Sets the value(s) for <b>request</b> ()
1206         *
1207     * <p>
1208     * <b>Definition:</b>
1209     * Additional information about how this entry should be processed as part of a transaction
1210     * </p> 
1211         */
1212        public Entry setRequest(EntryRequest theValue) {
1213                myRequest = theValue;
1214                return this;
1215        }
1216        
1217        
1218
1219  
1220        /**
1221         * Gets the value(s) for <b>response</b> ().
1222         * creating it if it does
1223         * not exist. Will not return <code>null</code>.
1224         *
1225     * <p>
1226     * <b>Definition:</b>
1227     * Additional information about how this entry should be processed as part of a transaction
1228     * </p> 
1229         */
1230        public EntryResponse getResponse() {  
1231                if (myResponse == null) {
1232                        myResponse = new EntryResponse();
1233                }
1234                return myResponse;
1235        }
1236
1237        /**
1238         * Sets the value(s) for <b>response</b> ()
1239         *
1240     * <p>
1241     * <b>Definition:</b>
1242     * Additional information about how this entry should be processed as part of a transaction
1243     * </p> 
1244         */
1245        public Entry setResponse(EntryResponse theValue) {
1246                myResponse = theValue;
1247                return this;
1248        }
1249        
1250        
1251
1252  
1253
1254
1255        }
1256
1257        /**
1258         * Block class for child element: <b>Bundle.entry.search</b> ()
1259         *
1260     * <p>
1261     * <b>Definition:</b>
1262     * Information about the search process that lead to the creation of this entry
1263     * </p> 
1264         */
1265        @Block()        
1266        public static class EntrySearch 
1267            extends  BaseIdentifiableElement  
1268            implements IResourceBlock {
1269        
1270        @Child(name="mode", type=CodeDt.class, order=0, min=0, max=1, summary=true, modifier=false)     
1271        @Description(
1272                shortDefinition="",
1273                formalDefinition="Why this entry is in the result set - whether it's included as a match or because of an _include requirement"
1274        )
1275        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/search-entry-mode")
1276        private BoundCodeDt<SearchEntryModeEnum> myMode;
1277        
1278        @Child(name="score", type=DecimalDt.class, order=1, min=0, max=1, summary=true, modifier=false) 
1279        @Description(
1280                shortDefinition="",
1281                formalDefinition="When searching, the server's search ranking score for the entry"
1282        )
1283        private DecimalDt myScore;
1284        
1285
1286        @Override
1287        public boolean isEmpty() {
1288                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myMode,  myScore);
1289        }
1290        
1291        @Override
1292        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1293                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myMode, myScore);
1294        }
1295
1296        /**
1297         * Gets the value(s) for <b>mode</b> ().
1298         * creating it if it does
1299         * not exist. Will not return <code>null</code>.
1300         *
1301     * <p>
1302     * <b>Definition:</b>
1303     * Why this entry is in the result set - whether it's included as a match or because of an _include requirement
1304     * </p> 
1305         */
1306        public BoundCodeDt<SearchEntryModeEnum> getModeElement() {  
1307                if (myMode == null) {
1308                        myMode = new BoundCodeDt<SearchEntryModeEnum>(SearchEntryModeEnum.VALUESET_BINDER);
1309                }
1310                return myMode;
1311        }
1312
1313        
1314        /**
1315         * Gets the value(s) for <b>mode</b> ().
1316         * creating it if it does
1317         * not exist. This method may return <code>null</code>.
1318         *
1319     * <p>
1320     * <b>Definition:</b>
1321     * Why this entry is in the result set - whether it's included as a match or because of an _include requirement
1322     * </p> 
1323         */
1324        public String getMode() {  
1325                return getModeElement().getValue();
1326        }
1327
1328        /**
1329         * Sets the value(s) for <b>mode</b> ()
1330         *
1331     * <p>
1332     * <b>Definition:</b>
1333     * Why this entry is in the result set - whether it's included as a match or because of an _include requirement
1334     * </p> 
1335         */
1336        public EntrySearch setMode(BoundCodeDt<SearchEntryModeEnum> theValue) {
1337                myMode = theValue;
1338                return this;
1339        }
1340        
1341        
1342
1343        /**
1344         * Sets the value(s) for <b>mode</b> ()
1345         *
1346     * <p>
1347     * <b>Definition:</b>
1348     * Why this entry is in the result set - whether it's included as a match or because of an _include requirement
1349     * </p> 
1350         */
1351        public EntrySearch setMode(SearchEntryModeEnum theValue) {
1352                setMode(new BoundCodeDt<SearchEntryModeEnum>(SearchEntryModeEnum.VALUESET_BINDER, theValue));
1353                
1354/*
1355                getModeElement().setValueAsEnum(theValue);
1356*/
1357                return this;
1358        }
1359
1360  
1361        /**
1362         * Gets the value(s) for <b>score</b> ().
1363         * creating it if it does
1364         * not exist. Will not return <code>null</code>.
1365         *
1366     * <p>
1367     * <b>Definition:</b>
1368     * When searching, the server's search ranking score for the entry
1369     * </p> 
1370         */
1371        public DecimalDt getScoreElement() {  
1372                if (myScore == null) {
1373                        myScore = new DecimalDt();
1374                }
1375                return myScore;
1376        }
1377
1378        
1379        /**
1380         * Gets the value(s) for <b>score</b> ().
1381         * creating it if it does
1382         * not exist. This method may return <code>null</code>.
1383         *
1384     * <p>
1385     * <b>Definition:</b>
1386     * When searching, the server's search ranking score for the entry
1387     * </p> 
1388         */
1389        public BigDecimal getScore() {  
1390                return getScoreElement().getValue();
1391        }
1392
1393        /**
1394         * Sets the value(s) for <b>score</b> ()
1395         *
1396     * <p>
1397     * <b>Definition:</b>
1398     * When searching, the server's search ranking score for the entry
1399     * </p> 
1400         */
1401        public EntrySearch setScore(DecimalDt theValue) {
1402                myScore = theValue;
1403                return this;
1404        }
1405        
1406        
1407
1408        /**
1409         * Sets the value for <b>score</b> ()
1410         *
1411     * <p>
1412     * <b>Definition:</b>
1413     * When searching, the server's search ranking score for the entry
1414     * </p> 
1415         */
1416        public EntrySearch setScore( double theValue) {
1417                myScore = new DecimalDt(theValue); 
1418                return this; 
1419        }
1420
1421        /**
1422         * Sets the value for <b>score</b> ()
1423         *
1424     * <p>
1425     * <b>Definition:</b>
1426     * When searching, the server's search ranking score for the entry
1427     * </p> 
1428         */
1429        public EntrySearch setScore( long theValue) {
1430                myScore = new DecimalDt(theValue); 
1431                return this; 
1432        }
1433
1434        /**
1435         * Sets the value for <b>score</b> ()
1436         *
1437     * <p>
1438     * <b>Definition:</b>
1439     * When searching, the server's search ranking score for the entry
1440     * </p> 
1441         */
1442        public EntrySearch setScore( java.math.BigDecimal theValue) {
1443                myScore = new DecimalDt(theValue); 
1444                return this; 
1445        }
1446
1447 
1448
1449
1450        }
1451
1452
1453        /**
1454         * Block class for child element: <b>Bundle.entry.request</b> ()
1455         *
1456     * <p>
1457     * <b>Definition:</b>
1458     * Additional information about how this entry should be processed as part of a transaction
1459     * </p> 
1460         */
1461        @Block()        
1462        public static class EntryRequest 
1463            extends  BaseIdentifiableElement  
1464            implements IResourceBlock {
1465        
1466        @Child(name="method", type=CodeDt.class, order=0, min=1, max=1, summary=true, modifier=false)   
1467        @Description(
1468                shortDefinition="",
1469                formalDefinition="The HTTP verb for this entry in either a update history, or a transaction/ transaction response"
1470        )
1471        @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/http-verb")
1472        private BoundCodeDt<HTTPVerbEnum> myMethod;
1473        
1474        @Child(name="url", type=UriDt.class, order=1, min=1, max=1, summary=true, modifier=false)       
1475        @Description(
1476                shortDefinition="",
1477                formalDefinition="The URL for this entry, relative to the root (the address to which the request is posted)"
1478        )
1479        private UriDt myUrl;
1480        
1481        @Child(name="ifNoneMatch", type=StringDt.class, order=2, min=0, max=1, summary=true, modifier=false)    
1482        @Description(
1483                shortDefinition="",
1484                formalDefinition="If the ETag values match, return a 304 Not modified status. See the API documentation for [\"Conditional Read\"](http.html#cread)"
1485        )
1486        private StringDt myIfNoneMatch;
1487        
1488        @Child(name="ifModifiedSince", type=InstantDt.class, order=3, min=0, max=1, summary=true, modifier=false)       
1489        @Description(
1490                shortDefinition="",
1491                formalDefinition="Only perform the operation if the last updated date matches. See the API documentation for [\"Conditional Read\"](http.html#cread)"
1492        )
1493        private InstantDt myIfModifiedSince;
1494        
1495        @Child(name="ifMatch", type=StringDt.class, order=4, min=0, max=1, summary=true, modifier=false)        
1496        @Description(
1497                shortDefinition="",
1498                formalDefinition="Only perform the operation if the Etag value matches. For more information, see the API section [\"Managing Resource Contention\"](http.html#concurrency)"
1499        )
1500        private StringDt myIfMatch;
1501        
1502        @Child(name="ifNoneExist", type=StringDt.class, order=5, min=0, max=1, summary=true, modifier=false)    
1503        @Description(
1504                shortDefinition="",
1505                formalDefinition="Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [\"Conditional Create\"](http.html#ccreate). This is just the query portion of the URL - what follows the \"?\" (not including the \"?\")"
1506        )
1507        private StringDt myIfNoneExist;
1508        
1509
1510        @Override
1511        public boolean isEmpty() {
1512                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myMethod,  myUrl,  myIfNoneMatch,  myIfModifiedSince,  myIfMatch,  myIfNoneExist);
1513        }
1514        
1515        @Override
1516        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1517                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myMethod, myUrl, myIfNoneMatch, myIfModifiedSince, myIfMatch, myIfNoneExist);
1518        }
1519
1520        /**
1521         * Gets the value(s) for <b>method</b> ().
1522         * creating it if it does
1523         * not exist. Will not return <code>null</code>.
1524         *
1525     * <p>
1526     * <b>Definition:</b>
1527     * The HTTP verb for this entry in either a update history, or a transaction/ transaction response
1528     * </p> 
1529         */
1530        public BoundCodeDt<HTTPVerbEnum> getMethodElement() {  
1531                if (myMethod == null) {
1532                        myMethod = new BoundCodeDt<HTTPVerbEnum>(HTTPVerbEnum.VALUESET_BINDER);
1533                }
1534                return myMethod;
1535        }
1536
1537        
1538        /**
1539         * Gets the value(s) for <b>method</b> ().
1540         * creating it if it does
1541         * not exist. This method may return <code>null</code>.
1542         *
1543     * <p>
1544     * <b>Definition:</b>
1545     * The HTTP verb for this entry in either a update history, or a transaction/ transaction response
1546     * </p> 
1547         */
1548        public String getMethod() {  
1549                return getMethodElement().getValue();
1550        }
1551
1552        /**
1553         * Sets the value(s) for <b>method</b> ()
1554         *
1555     * <p>
1556     * <b>Definition:</b>
1557     * The HTTP verb for this entry in either a update history, or a transaction/ transaction response
1558     * </p> 
1559         */
1560        public EntryRequest setMethod(BoundCodeDt<HTTPVerbEnum> theValue) {
1561                myMethod = theValue;
1562                return this;
1563        }
1564        
1565        
1566
1567        /**
1568         * Sets the value(s) for <b>method</b> ()
1569         *
1570     * <p>
1571     * <b>Definition:</b>
1572     * The HTTP verb for this entry in either a update history, or a transaction/ transaction response
1573     * </p> 
1574         */
1575        public EntryRequest setMethod(HTTPVerbEnum theValue) {
1576                setMethod(new BoundCodeDt<HTTPVerbEnum>(HTTPVerbEnum.VALUESET_BINDER, theValue));
1577                
1578/*
1579                getMethodElement().setValueAsEnum(theValue);
1580*/
1581                return this;
1582        }
1583
1584  
1585        /**
1586         * Gets the value(s) for <b>url</b> ().
1587         * creating it if it does
1588         * not exist. Will not return <code>null</code>.
1589         *
1590     * <p>
1591     * <b>Definition:</b>
1592     * The URL for this entry, relative to the root (the address to which the request is posted)
1593     * </p> 
1594         */
1595        public UriDt getUrlElement() {  
1596                if (myUrl == null) {
1597                        myUrl = new UriDt();
1598                }
1599                return myUrl;
1600        }
1601
1602        
1603        /**
1604         * Gets the value(s) for <b>url</b> ().
1605         * creating it if it does
1606         * not exist. This method may return <code>null</code>.
1607         *
1608     * <p>
1609     * <b>Definition:</b>
1610     * The URL for this entry, relative to the root (the address to which the request is posted)
1611     * </p> 
1612         */
1613        public String getUrl() {  
1614                return getUrlElement().getValue();
1615        }
1616
1617        /**
1618         * Sets the value(s) for <b>url</b> ()
1619         *
1620     * <p>
1621     * <b>Definition:</b>
1622     * The URL for this entry, relative to the root (the address to which the request is posted)
1623     * </p> 
1624         */
1625        public EntryRequest setUrl(UriDt theValue) {
1626                myUrl = theValue;
1627                return this;
1628        }
1629        
1630        
1631
1632        /**
1633         * Sets the value for <b>url</b> ()
1634         *
1635     * <p>
1636     * <b>Definition:</b>
1637     * The URL for this entry, relative to the root (the address to which the request is posted)
1638     * </p> 
1639         */
1640        public EntryRequest setUrl( String theUri) {
1641                myUrl = new UriDt(theUri); 
1642                return this; 
1643        }
1644
1645 
1646        /**
1647         * Gets the value(s) for <b>ifNoneMatch</b> ().
1648         * creating it if it does
1649         * not exist. Will not return <code>null</code>.
1650         *
1651     * <p>
1652     * <b>Definition:</b>
1653     * If the ETag values match, return a 304 Not modified status. See the API documentation for [\&quot;Conditional Read\&quot;](http.html#cread)
1654     * </p> 
1655         */
1656        public StringDt getIfNoneMatchElement() {  
1657                if (myIfNoneMatch == null) {
1658                        myIfNoneMatch = new StringDt();
1659                }
1660                return myIfNoneMatch;
1661        }
1662
1663        
1664        /**
1665         * Gets the value(s) for <b>ifNoneMatch</b> ().
1666         * creating it if it does
1667         * not exist. This method may return <code>null</code>.
1668         *
1669     * <p>
1670     * <b>Definition:</b>
1671     * If the ETag values match, return a 304 Not modified status. See the API documentation for [\&quot;Conditional Read\&quot;](http.html#cread)
1672     * </p> 
1673         */
1674        public String getIfNoneMatch() {  
1675                return getIfNoneMatchElement().getValue();
1676        }
1677
1678        /**
1679         * Sets the value(s) for <b>ifNoneMatch</b> ()
1680         *
1681     * <p>
1682     * <b>Definition:</b>
1683     * If the ETag values match, return a 304 Not modified status. See the API documentation for [\&quot;Conditional Read\&quot;](http.html#cread)
1684     * </p> 
1685         */
1686        public EntryRequest setIfNoneMatch(StringDt theValue) {
1687                myIfNoneMatch = theValue;
1688                return this;
1689        }
1690        
1691        
1692
1693        /**
1694         * Sets the value for <b>ifNoneMatch</b> ()
1695         *
1696     * <p>
1697     * <b>Definition:</b>
1698     * If the ETag values match, return a 304 Not modified status. See the API documentation for [\&quot;Conditional Read\&quot;](http.html#cread)
1699     * </p> 
1700         */
1701        public EntryRequest setIfNoneMatch( String theString) {
1702                myIfNoneMatch = new StringDt(theString); 
1703                return this; 
1704        }
1705
1706 
1707        /**
1708         * Gets the value(s) for <b>ifModifiedSince</b> ().
1709         * creating it if it does
1710         * not exist. Will not return <code>null</code>.
1711         *
1712     * <p>
1713     * <b>Definition:</b>
1714     * Only perform the operation if the last updated date matches. See the API documentation for [\&quot;Conditional Read\&quot;](http.html#cread)
1715     * </p> 
1716         */
1717        public InstantDt getIfModifiedSinceElement() {  
1718                if (myIfModifiedSince == null) {
1719                        myIfModifiedSince = new InstantDt();
1720                }
1721                return myIfModifiedSince;
1722        }
1723
1724        
1725        /**
1726         * Gets the value(s) for <b>ifModifiedSince</b> ().
1727         * creating it if it does
1728         * not exist. This method may return <code>null</code>.
1729         *
1730     * <p>
1731     * <b>Definition:</b>
1732     * Only perform the operation if the last updated date matches. See the API documentation for [\&quot;Conditional Read\&quot;](http.html#cread)
1733     * </p> 
1734         */
1735        public Date getIfModifiedSince() {  
1736                return getIfModifiedSinceElement().getValue();
1737        }
1738
1739        /**
1740         * Sets the value(s) for <b>ifModifiedSince</b> ()
1741         *
1742     * <p>
1743     * <b>Definition:</b>
1744     * Only perform the operation if the last updated date matches. See the API documentation for [\&quot;Conditional Read\&quot;](http.html#cread)
1745     * </p> 
1746         */
1747        public EntryRequest setIfModifiedSince(InstantDt theValue) {
1748                myIfModifiedSince = theValue;
1749                return this;
1750        }
1751        
1752        
1753
1754        /**
1755         * Sets the value for <b>ifModifiedSince</b> ()
1756         *
1757     * <p>
1758     * <b>Definition:</b>
1759     * Only perform the operation if the last updated date matches. See the API documentation for [\&quot;Conditional Read\&quot;](http.html#cread)
1760     * </p> 
1761         */
1762        public EntryRequest setIfModifiedSince( Date theDate,  TemporalPrecisionEnum thePrecision) {
1763                myIfModifiedSince = new InstantDt(theDate, thePrecision); 
1764                return this; 
1765        }
1766
1767        /**
1768         * Sets the value for <b>ifModifiedSince</b> ()
1769         *
1770     * <p>
1771     * <b>Definition:</b>
1772     * Only perform the operation if the last updated date matches. See the API documentation for [\&quot;Conditional Read\&quot;](http.html#cread)
1773     * </p> 
1774         */
1775        public EntryRequest setIfModifiedSinceWithMillisPrecision( Date theDate) {
1776                myIfModifiedSince = new InstantDt(theDate); 
1777                return this; 
1778        }
1779
1780 
1781        /**
1782         * Gets the value(s) for <b>ifMatch</b> ().
1783         * creating it if it does
1784         * not exist. Will not return <code>null</code>.
1785         *
1786     * <p>
1787     * <b>Definition:</b>
1788     * Only perform the operation if the Etag value matches. For more information, see the API section [\&quot;Managing Resource Contention\&quot;](http.html#concurrency)
1789     * </p> 
1790         */
1791        public StringDt getIfMatchElement() {  
1792                if (myIfMatch == null) {
1793                        myIfMatch = new StringDt();
1794                }
1795                return myIfMatch;
1796        }
1797
1798        
1799        /**
1800         * Gets the value(s) for <b>ifMatch</b> ().
1801         * creating it if it does
1802         * not exist. This method may return <code>null</code>.
1803         *
1804     * <p>
1805     * <b>Definition:</b>
1806     * Only perform the operation if the Etag value matches. For more information, see the API section [\&quot;Managing Resource Contention\&quot;](http.html#concurrency)
1807     * </p> 
1808         */
1809        public String getIfMatch() {  
1810                return getIfMatchElement().getValue();
1811        }
1812
1813        /**
1814         * Sets the value(s) for <b>ifMatch</b> ()
1815         *
1816     * <p>
1817     * <b>Definition:</b>
1818     * Only perform the operation if the Etag value matches. For more information, see the API section [\&quot;Managing Resource Contention\&quot;](http.html#concurrency)
1819     * </p> 
1820         */
1821        public EntryRequest setIfMatch(StringDt theValue) {
1822                myIfMatch = theValue;
1823                return this;
1824        }
1825        
1826        
1827
1828        /**
1829         * Sets the value for <b>ifMatch</b> ()
1830         *
1831     * <p>
1832     * <b>Definition:</b>
1833     * Only perform the operation if the Etag value matches. For more information, see the API section [\&quot;Managing Resource Contention\&quot;](http.html#concurrency)
1834     * </p> 
1835         */
1836        public EntryRequest setIfMatch( String theString) {
1837                myIfMatch = new StringDt(theString); 
1838                return this; 
1839        }
1840
1841 
1842        /**
1843         * Gets the value(s) for <b>ifNoneExist</b> ().
1844         * creating it if it does
1845         * not exist. Will not return <code>null</code>.
1846         *
1847     * <p>
1848     * <b>Definition:</b>
1849     * Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [\&quot;Conditional Create\&quot;](http.html#ccreate). This is just the query portion of the URL - what follows the \&quot;?\&quot; (not including the \&quot;?\&quot;)
1850     * </p> 
1851         */
1852        public StringDt getIfNoneExistElement() {  
1853                if (myIfNoneExist == null) {
1854                        myIfNoneExist = new StringDt();
1855                }
1856                return myIfNoneExist;
1857        }
1858
1859        
1860        /**
1861         * Gets the value(s) for <b>ifNoneExist</b> ().
1862         * creating it if it does
1863         * not exist. This method may return <code>null</code>.
1864         *
1865     * <p>
1866     * <b>Definition:</b>
1867     * Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [\&quot;Conditional Create\&quot;](http.html#ccreate). This is just the query portion of the URL - what follows the \&quot;?\&quot; (not including the \&quot;?\&quot;)
1868     * </p> 
1869         */
1870        public String getIfNoneExist() {  
1871                return getIfNoneExistElement().getValue();
1872        }
1873
1874        /**
1875         * Sets the value(s) for <b>ifNoneExist</b> ()
1876         *
1877     * <p>
1878     * <b>Definition:</b>
1879     * Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [\&quot;Conditional Create\&quot;](http.html#ccreate). This is just the query portion of the URL - what follows the \&quot;?\&quot; (not including the \&quot;?\&quot;)
1880     * </p> 
1881         */
1882        public EntryRequest setIfNoneExist(StringDt theValue) {
1883                myIfNoneExist = theValue;
1884                return this;
1885        }
1886        
1887        
1888
1889        /**
1890         * Sets the value for <b>ifNoneExist</b> ()
1891         *
1892     * <p>
1893     * <b>Definition:</b>
1894     * Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [\&quot;Conditional Create\&quot;](http.html#ccreate). This is just the query portion of the URL - what follows the \&quot;?\&quot; (not including the \&quot;?\&quot;)
1895     * </p> 
1896         */
1897        public EntryRequest setIfNoneExist( String theString) {
1898                myIfNoneExist = new StringDt(theString); 
1899                return this; 
1900        }
1901
1902 
1903
1904
1905        }
1906
1907
1908        /**
1909         * Block class for child element: <b>Bundle.entry.response</b> ()
1910         *
1911     * <p>
1912     * <b>Definition:</b>
1913     * Additional information about how this entry should be processed as part of a transaction
1914     * </p> 
1915         */
1916        @Block()        
1917        public static class EntryResponse 
1918            extends  BaseIdentifiableElement  
1919            implements IResourceBlock {
1920        
1921        @Child(name="status", type=StringDt.class, order=0, min=1, max=1, summary=true, modifier=false) 
1922        @Description(
1923                shortDefinition="",
1924                formalDefinition="The status code returned by processing this entry"
1925        )
1926        private StringDt myStatus;
1927        
1928        @Child(name="location", type=UriDt.class, order=1, min=0, max=1, summary=true, modifier=false)  
1929        @Description(
1930                shortDefinition="",
1931                formalDefinition="The location header created by processing this operation"
1932        )
1933        private UriDt myLocation;
1934        
1935        @Child(name="etag", type=StringDt.class, order=2, min=0, max=1, summary=true, modifier=false)   
1936        @Description(
1937                shortDefinition="",
1938                formalDefinition="The etag for the resource, it the operation for the entry produced a versioned resource"
1939        )
1940        private StringDt myEtag;
1941        
1942        @Child(name="lastModified", type=InstantDt.class, order=3, min=0, max=1, summary=true, modifier=false)  
1943        @Description(
1944                shortDefinition="",
1945                formalDefinition="The date/time that the resource was modified on the server"
1946        )
1947        private InstantDt myLastModified;
1948        
1949
1950        @Override
1951        public boolean isEmpty() {
1952                return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(  myStatus,  myLocation,  myEtag,  myLastModified);
1953        }
1954        
1955        @Override
1956        public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
1957                return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myStatus, myLocation, myEtag, myLastModified);
1958        }
1959
1960        /**
1961         * Gets the value(s) for <b>status</b> ().
1962         * creating it if it does
1963         * not exist. Will not return <code>null</code>.
1964         *
1965     * <p>
1966     * <b>Definition:</b>
1967     * The status code returned by processing this entry
1968     * </p> 
1969         */
1970        public StringDt getStatusElement() {  
1971                if (myStatus == null) {
1972                        myStatus = new StringDt();
1973                }
1974                return myStatus;
1975        }
1976
1977        
1978        /**
1979         * Gets the value(s) for <b>status</b> ().
1980         * creating it if it does
1981         * not exist. This method may return <code>null</code>.
1982         *
1983     * <p>
1984     * <b>Definition:</b>
1985     * The status code returned by processing this entry
1986     * </p> 
1987         */
1988        public String getStatus() {  
1989                return getStatusElement().getValue();
1990        }
1991
1992        /**
1993         * Sets the value(s) for <b>status</b> ()
1994         *
1995     * <p>
1996     * <b>Definition:</b>
1997     * The status code returned by processing this entry
1998     * </p> 
1999         */
2000        public EntryResponse setStatus(StringDt theValue) {
2001                myStatus = theValue;
2002                return this;
2003        }
2004        
2005        
2006
2007        /**
2008         * Sets the value for <b>status</b> ()
2009         *
2010     * <p>
2011     * <b>Definition:</b>
2012     * The status code returned by processing this entry
2013     * </p> 
2014         */
2015        public EntryResponse setStatus( String theString) {
2016                myStatus = new StringDt(theString); 
2017                return this; 
2018        }
2019
2020 
2021        /**
2022         * Gets the value(s) for <b>location</b> ().
2023         * creating it if it does
2024         * not exist. Will not return <code>null</code>.
2025         *
2026     * <p>
2027     * <b>Definition:</b>
2028     * The location header created by processing this operation
2029     * </p> 
2030         */
2031        public UriDt getLocationElement() {  
2032                if (myLocation == null) {
2033                        myLocation = new UriDt();
2034                }
2035                return myLocation;
2036        }
2037
2038        
2039        /**
2040         * Gets the value(s) for <b>location</b> ().
2041         * creating it if it does
2042         * not exist. This method may return <code>null</code>.
2043         *
2044     * <p>
2045     * <b>Definition:</b>
2046     * The location header created by processing this operation
2047     * </p> 
2048         */
2049        public String getLocation() {  
2050                return getLocationElement().getValue();
2051        }
2052
2053        /**
2054         * Sets the value(s) for <b>location</b> ()
2055         *
2056     * <p>
2057     * <b>Definition:</b>
2058     * The location header created by processing this operation
2059     * </p> 
2060         */
2061        public EntryResponse setLocation(UriDt theValue) {
2062                myLocation = theValue;
2063                return this;
2064        }
2065        
2066        
2067
2068        /**
2069         * Sets the value for <b>location</b> ()
2070         *
2071     * <p>
2072     * <b>Definition:</b>
2073     * The location header created by processing this operation
2074     * </p> 
2075         */
2076        public EntryResponse setLocation( String theUri) {
2077                myLocation = new UriDt(theUri); 
2078                return this; 
2079        }
2080
2081 
2082        /**
2083         * Gets the value(s) for <b>etag</b> ().
2084         * creating it if it does
2085         * not exist. Will not return <code>null</code>.
2086         *
2087     * <p>
2088     * <b>Definition:</b>
2089     * The etag for the resource, it the operation for the entry produced a versioned resource
2090     * </p> 
2091         */
2092        public StringDt getEtagElement() {  
2093                if (myEtag == null) {
2094                        myEtag = new StringDt();
2095                }
2096                return myEtag;
2097        }
2098
2099        
2100        /**
2101         * Gets the value(s) for <b>etag</b> ().
2102         * creating it if it does
2103         * not exist. This method may return <code>null</code>.
2104         *
2105     * <p>
2106     * <b>Definition:</b>
2107     * The etag for the resource, it the operation for the entry produced a versioned resource
2108     * </p> 
2109         */
2110        public String getEtag() {  
2111                return getEtagElement().getValue();
2112        }
2113
2114        /**
2115         * Sets the value(s) for <b>etag</b> ()
2116         *
2117     * <p>
2118     * <b>Definition:</b>
2119     * The etag for the resource, it the operation for the entry produced a versioned resource
2120     * </p> 
2121         */
2122        public EntryResponse setEtag(StringDt theValue) {
2123                myEtag = theValue;
2124                return this;
2125        }
2126        
2127        
2128
2129        /**
2130         * Sets the value for <b>etag</b> ()
2131         *
2132     * <p>
2133     * <b>Definition:</b>
2134     * The etag for the resource, it the operation for the entry produced a versioned resource
2135     * </p> 
2136         */
2137        public EntryResponse setEtag( String theString) {
2138                myEtag = new StringDt(theString); 
2139                return this; 
2140        }
2141
2142 
2143        /**
2144         * Gets the value(s) for <b>lastModified</b> ().
2145         * creating it if it does
2146         * not exist. Will not return <code>null</code>.
2147         *
2148     * <p>
2149     * <b>Definition:</b>
2150     * The date/time that the resource was modified on the server
2151     * </p> 
2152         */
2153        public InstantDt getLastModifiedElement() {  
2154                if (myLastModified == null) {
2155                        myLastModified = new InstantDt();
2156                }
2157                return myLastModified;
2158        }
2159
2160        
2161        /**
2162         * Gets the value(s) for <b>lastModified</b> ().
2163         * creating it if it does
2164         * not exist. This method may return <code>null</code>.
2165         *
2166     * <p>
2167     * <b>Definition:</b>
2168     * The date/time that the resource was modified on the server
2169     * </p> 
2170         */
2171        public Date getLastModified() {  
2172                return getLastModifiedElement().getValue();
2173        }
2174
2175        /**
2176         * Sets the value(s) for <b>lastModified</b> ()
2177         *
2178     * <p>
2179     * <b>Definition:</b>
2180     * The date/time that the resource was modified on the server
2181     * </p> 
2182         */
2183        public EntryResponse setLastModified(InstantDt theValue) {
2184                myLastModified = theValue;
2185                return this;
2186        }
2187        
2188        
2189
2190        /**
2191         * Sets the value for <b>lastModified</b> ()
2192         *
2193     * <p>
2194     * <b>Definition:</b>
2195     * The date/time that the resource was modified on the server
2196     * </p> 
2197         */
2198        public EntryResponse setLastModified( Date theDate,  TemporalPrecisionEnum thePrecision) {
2199                myLastModified = new InstantDt(theDate, thePrecision); 
2200                return this; 
2201        }
2202
2203        /**
2204         * Sets the value for <b>lastModified</b> ()
2205         *
2206     * <p>
2207     * <b>Definition:</b>
2208     * The date/time that the resource was modified on the server
2209     * </p> 
2210         */
2211        public EntryResponse setLastModifiedWithMillisPrecision( Date theDate) {
2212                myLastModified = new InstantDt(theDate); 
2213                return this; 
2214        }
2215
2216 
2217
2218
2219        }
2220
2221
2222
2223
2224
2225    @Override
2226    public String getResourceName() {
2227        return "Bundle";
2228    }
2229    
2230    public ca.uhn.fhir.context.FhirVersionEnum getStructureFhirVersionEnum() {
2231        return ca.uhn.fhir.context.FhirVersionEnum.DSTU2;
2232    }
2233
2234        /**
2235         * Returns the {@link #getLink() link} which matches a given {@link Link#getRelation() relation}. 
2236         * If no link is found which matches the given relation, returns <code>null</code>. If more than one
2237         * link is found which matches the given relation, returns the first matching Link.
2238         * 
2239         * @param theRelation
2240         *            The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}.
2241         * @return Returns a matching Link, or <code>null</code>
2242         * @see IBaseBundle#LINK_NEXT
2243         * @see IBaseBundle#LINK_PREV
2244         * @see IBaseBundle#LINK_SELF
2245         */
2246        public Link getLink(String theRelation) {
2247                org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty");
2248                for (Link next : getLink()) {
2249                        if (theRelation.equals(next.getRelation())) {
2250                                return next;
2251                        }
2252                }
2253                return null;
2254        }
2255
2256        /**
2257         * Returns the {@link #getLink() link} which matches a given {@link Link#getRelation() relation}. 
2258         * If no link is found which matches the given relation, creates a new Link with the
2259         * given relation and adds it to this Bundle. If more than one
2260         * link is found which matches the given relation, returns the first matching Link.
2261         * 
2262         * @param theRelation
2263         *            The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}.
2264         * @return Returns a matching Link, or <code>null</code>
2265         * @see IBaseBundle#LINK_NEXT
2266         * @see IBaseBundle#LINK_PREV
2267         * @see IBaseBundle#LINK_SELF
2268         */
2269        public Link getLinkOrCreate(String theRelation) {
2270                org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty");
2271                for (Link next : getLink()) {
2272                        if (theRelation.equals(next.getRelation())) {
2273                                return next;
2274                        }
2275                }
2276                Link retVal = new Link();
2277                retVal.setRelation(theRelation);
2278                getLink().add(retVal);
2279                return retVal;
2280        }
2281
2282}