Resource type: bundle

Description

A container for a collection of resources.

Elements

PathShortDefinitionComments
Contains a collection of resourcesA container for a collection of resources.
identifierPersistent identifier for the bundleA persistent identifier for the bundle that won't change as a bundle is copied from server to server.Persistent identity generally only matters for batches of type Document, Message, and Collection. It would not normally be populated for search and history results and servers ignore Bundle.identifier when processing batches and transactions. For Documents the .identifier SHALL be populated such that the .identifier is globally unique.
typedocument | message | transaction | transaction-response | batch | batch-response | history | searchset | collectionIndicates the purpose of this bundle - how it is intended to be used.It's possible to use a bundle for other purposes (e.g. a document can be accepted as a transaction). This is primarily defined so that there can be specific rules for some of the bundle types.
timestampWhen the bundle was assembledThe date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.For many bundles, the timestamp is equal to .meta.lastUpdated, because they are not stored (e.g. search results). When a bundle is placed in a persistent store, .meta.lastUpdated will be usually be changed by the server. When the bundle is a message, a middleware agent altering the message (even if not stored) SHOULD update .meta.lastUpdated. .timestamp is used to track the original time of the Bundle, and SHOULD be populated. Usage: * document : the date the document was created. Note: the composition may predate the document, or be associated with multiple documents. The date of the composition - the authoring time - may be earlier than the document assembly time * message : the date that the content of the message was assembled. This date is not changed by middleware engines unless they add additional data that changes the meaning of the time of the message * history : the date that the history was assembled. This time would be used as the _since time to ask for subsequent updates * searchset : the time that the search set was assembled. Note that different pages MAY have different timestamps but need not. Having different timestamps does not imply that subsequent pages will represent or include changes made since the initial query * transaction | transaction-response | batch | batch-response | collection : no particular assigned meaning The timestamp value should be greater than the lastUpdated and other timestamps in the resources in the bundle, and it should be equal or earlier than the .meta.lastUpdated on the Bundle itself.
totalIf search, the total number of matchesIf a set of search matches, this is the total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.Only used if the bundle is a search result set. The total does not include resources such as OperationOutcome and included resources, only the total number of matching resources.
linkLinks related to this BundleA series of links that provide context to this bundle.Both Bundle.link and Bundle.entry.link are defined to support providing additional context when Bundles are used (e.g. [HATEOAS](http://en.wikipedia.org/wiki/HATEOAS)). Bundle.entry.link corresponds to links found in the HTTP header if the resource in the entry was [read](http.html#read) directly. This specification defines some specific uses of Bundle.link for [searching](search.html#conformance) and [paging](http.html#paging), but no specific uses for Bundle.entry.link, and no defined function in a transaction - the meaning is implementation specific.
link.idUnique id for inter-element referencingUnique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
link.extensionAdditional content defined by implementationsMay be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
link.modifierExtensionExtensions that cannot be ignored even if unrecognizedMay be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
link.relationSee http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).
link.urlReference details for the linkThe reference details for the link.
entryEntry in the bundle - will have a resource or informationAn entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).
entry.idUnique id for inter-element referencingUnique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
entry.extensionAdditional content defined by implementationsMay be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
entry.modifierExtensionExtensions that cannot be ignored even if unrecognizedMay be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
entry.linkLinks related to this entryA series of links that provide context to this entry.
entry.fullUrlURI for resource (Absolute URL server address or URI for UUID/OID)The Absolute URL for the resource. The fullUrl SHALL NOT disagree with the id in the resource - i.e. if the fullUrl is not a urn:uuid, the URL shall be version-independent URL consistent with the Resource.id. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: * fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) * Results from operations might involve resources that are not identified.fullUrl might not be [unique in the context of a resource](bundle.html#bundle-unique). Note that since [FHIR resources do not need to be served through the FHIR API](references.html), the fullURL might be a URN or an absolute URL that does not end with the logical id of the resource (Resource.id). However, but if the fullUrl does look like a RESTful server URL (e.g. meets the [regex](references.html#regex), then the 'id' portion of the fullUrl SHALL end with the Resource.id. Note that the fullUrl is not the same as the canonical URL - it's an absolute url for an endpoint serving the resource (these will happen to have the same value on the canonical server for the resource with the canonical URL).
entry.resourceA resource in the bundleThe Resource for the entry. The purpose/meaning of the resource is determined by the Bundle.type.
entry.searchSearch related informationInformation about the search process that lead to the creation of this entry.
entry.search.idUnique id for inter-element referencingUnique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
entry.search.extensionAdditional content defined by implementationsMay be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
entry.search.modifierExtensionExtensions that cannot be ignored even if unrecognizedMay be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
entry.search.modematch | include | outcome - why this is in the result setWhy this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process.There is only one mode. In some corner cases, a resource may be included because it is both a match and an include. In these circumstances, 'match' takes precedence.
entry.search.scoreSearch ranking (between 0 and 1)When searching, the server's search ranking score for the entry.Servers are not required to return a ranking score. 1 is most relevant, and 0 is least relevant. Often, search results are sorted by score, but the client may specify a different sort order. See [Patient Match](patient-operation-match.html) for the EMPI search which relates to this element.
entry.requestAdditional execution information (transaction/batch/history)Additional information about how this entry should be processed as part of a transaction or batch. For history, it shows how the entry was processed to create the version contained in the entry.
entry.request.idUnique id for inter-element referencingUnique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
entry.request.extensionAdditional content defined by implementationsMay be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
entry.request.modifierExtensionExtensions that cannot be ignored even if unrecognizedMay be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
entry.request.methodGET | HEAD | POST | PUT | DELETE | PATCHIn a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurred.
entry.request.urlURL for HTTP equivalent of this entryThe URL for this entry, relative to the root (the address to which the request is posted).E.g. for a Patient Create, the method would be "POST" and the URL would be "Patient". For a Patient Update, the method would be PUT and the URL would be "Patient/[id]".
entry.request.ifNoneMatchFor managing cache currencyIf the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread).
entry.request.ifModifiedSinceFor managing cache currencyOnly perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).
entry.request.ifMatchFor managing update contentionOnly perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).
entry.request.ifNoneExistFor conditional createsInstruct 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 "?").
entry.responseResults of execution (transaction/batch/history)Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning history.
entry.response.idUnique id for inter-element referencingUnique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
entry.response.extensionAdditional content defined by implementationsMay be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
entry.response.modifierExtensionExtensions that cannot be ignored even if unrecognizedMay be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
entry.response.statusStatus response code (text optional)The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.
entry.response.locationThe location (if the operation returns a location)The location header created by processing this operation, populated if the operation returns a location.
entry.response.etagThe Etag for the resource (if relevant)The Etag for the resource, if the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).Etags match the Resource.meta.versionId. The ETag has to match the version id in the header if a resource is included.
entry.response.lastModifiedServer's date time modifiedThe date/time that the resource was modified on the server.This has to match the same time in the meta header (meta.lastUpdated) if a resource is included.
entry.response.outcomeOperationOutcome with hints and warnings (for batch/transaction)An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.For a POST/PUT operation, this is the equivalent outcome that would be returned for prefer = operationoutcome - except that the resource is always returned whether or not the outcome is returned. This outcome is not used for error responses in batch/transaction, only for hints and warnings. In a batch operation, the error will be in Bundle.entry.response, and for transaction, there will be a single OperationOutcome instead of a bundle in the case of an error.
signatureDigital SignatureDigital Signature - base64 encoded. XML-DSig or a JWT.The signature could be created by the "author" of the bundle or by the originating device. Requirements around inclusion of a signature, verification of signatures and treatment of signed/non-signed bundles is implementation-environment specific.


Scope and Usage

One common operation performed with resources is to gather a collection of resources into a single instance with containing context. In FHIR this is referred to as "bundling" the resources together. These resource bundles are useful for a variety of different reasons, including:

Boundaries and Relationships

There are two ways to collect resources together for transport and persistence purposes - contained resources, and bundles. There is an important difference between the two:

In addition to these two technical mechanisms, there are three administrative and infrastructure resources which also support grouping of content. These resources do not contain resources directly, but instead use [Reference] to point to the grouped resources:

These three resources represent meaningful groupings of the resources they refer to (e.g. a discharge medication List, a Group of participants for a clinical trial, a set of resources that form a signed document), while a Bundle is merely is a container for resources used for transfer and storage. This list is not exhaustive; other resources also provde grouping functionality.

Notes about Bundle

Using Bundles

The content and rules for using a Bundle depend on the type of the bundle. Note that all bundle types use resource identity resolution as described below.

Document

A document Bundle (type = "document") consists of a series of entries, the first of which is a Composition. Each entry element SHALL contain a resource. See Documents for further information.

Example

Message

A message Bundle (type = "message") consists of a series of entries, the first of which is a MessageHeader. Each entry element SHALL contain a resource. See Messaging for further information.

Example Request and Response

Search Results

A set of search results (type = "searchset") consists of a series of 0 or more entries. Each entry element SHALL contain a resource. See Search for further information.

In addition, Bundle.total may be used to return the total number of resources that match the search, and that may be returned by following the "next" link.

For each entry, a search set can also contain two specific pieces of search related information:

Example

History

A change history (type = "history") consists of a series of 0 or more entries. Each entry element SHALL contain a request element that describes the change that was made and, if the method is a POST or PUT, a resource that represents the state of the resource at the conclusion of the operation. A response element SHALL also be present so that consumers can access the location header. See History for further information.

In addition, Bundle.total may be used to return the total number of resources that are included in the change history, including those that may be returned by following the "next" link.

Transaction / Batch

A transaction (type = "transaction") or batch (type = "batch") consists of a series of 0 or more entries. Each entry element SHALL contain a request element has the details of an HTTP operation that informs the system processing the transaction what to do with the entry. If the entry method is a 'PUT' or 'POST', then the entry SHALL contain a resource that becomes the body of the HTTP operation. See Transactions for further information.

Example

Transaction/Batch Response

A transaction response (type = "transaction-response") or batch response (type="batch-response") consists of a series of 0 or more entries: 1 for each entry in the transaction or batch it is in response to. Each entry element SHALL contain a response element which indicates the outcome of the HTTP operation that the server performed for the entry.

Example

Collection

A collection (type = "collection") consists of a series of 0 or more entries. No particular use with respect to the FHIR specification is associated with this Bundle. Each entry element SHALL contain a resource.

Example

Resource URL & Uniqueness rules in a bundle

Except for transactions and batches, each entry in a Bundle must have a fullUrl which is the identity of the resource in the entry. Note that this is not a versioned reference to the resource, but its identity. Where a resource is not assigned a persistent identity that can be used in the Bundle, a UUID should be used (urn:uuid:...).

For transactions and batches, entries MAY not have fullURLs when the entry.request.method = POST, and the resource has no identity. Note that even in this case, there may still be a fullURL in a transaction on a POST so that relationships between resources can be represented (see Transactions).

A given version of a resource SHALL only appear once in each Bundle. There might, however, be multiple versions of a single resource present in a single bundle. This would be expected in Bundles of type history, and also might be necessitated by closely tracking Provenance.

Note that the meaning of an unversioned reference to a resource that appears multiple times is potentially ambiguous, though processors may have additional informaton to help resolve this (e.g. change order in a history bundle).

When processing batches and transactions, it is at server discretion how to behave if multiple versions of a single resource are present.

Resolving references in Bundles

The Bundle resource is a packaging construct that has one of more entries that are other kinds of resources. Those resources themselves have references to other resources - e.g. an Observation that refers to a Patient. The referenced resources may also be found in the Bundle. For example, the system that constructed the Bundle may have included both the Observation and the Patient. The content of the references between resources doesn't change because of the bundle.

This section documents a method that resolves references correctly within a bundle. Note that this method does not define any new semantics; resolution is based on the way resource identity and resource references work.

Applications reading a Bundle should always look for a resource by its identity in the bundle first before trying to access it by its URL externally.

How to resolve a reference in a Bundle:

Note, in addition, that a reference may be by identifier, and if it is, and there is no URL, it may be resolved by scanning the ids in the bundle. Note also that transactions may contain conditional references that must be resolved by the server before processing the matches.

If the reference is version specific (either relative or absolute), then remove the version from the URL before matching fullUrl, and then match the version based on Resource.meta.versionId. Note that the rules for resolving references in contained resources are the same as those for resolving resources in the resource that contains the contained resource.

If multiple matches are found, it is ambiguous which is correct. Applications MAY return an error or take some other action as they deem appropriate.

There is an example Bundle that demonstrates these rules.

Serving Bundles using the RESTful API

The Bundle resource type has an end-point like all most other resources. This end-point serves the usual interactions. Bundles are treated as static resources on the /Bundle end-point (i.e. when a batch, transaction, or message is POSTed to /Bundle, it is stored as is, and the content is not processed as batch, transaction, or message - instead, they are processed like normal resource, with indexing / auditing etc. Performing a GET /Bundle/[location] will return the same resource.

The Bundle end point does have two special search parameters - composition and message, which allow for chained search into the first (special) entries in document and message resources.

Search Parameters

compositionThe first resource in the bundle, if the bundle type is "document" - this is a composition, and this parameter provides access to search its contentsBundle.entry[0].resource
identifierPersistent identifier for the bundleBundle.identifier
messageThe first resource in the bundle, if the bundle type is "message" - this is a message header, and this parameter provides access to search its contentsBundle.entry[0].resource
timestampWhen the bundle was assembledBundle.timestamp
typedocument | message | transaction | transaction-response | batch | batch-response | history | searchset | collectionBundle.type

Extension Definitions

These are extension definitions for this resource defined by the spec