FHIR Release 3 (STU)

This page is part of the FHIR Specification (v3.0.2: STU 3). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3 R2

FHIR Infrastructure Work GroupMaturity Level: 5 Trial UseCompartments: Not linked to any defined compartments

Detailed Descriptions for the elements in the Bundle resource.

Bundle
Definition

A container for a collection of resources.

Control1..1
Summarytrue
InvariantsDefined on this element
bdl-1: total only when a search or history (expression : total.empty() or (type = 'searchset') or (type = 'history'), xpath: not(f:total) or (f:type/@value = 'searchset') or (f:type/@value = 'history'))
bdl-2: entry.search only when a search (expression : entry.search.empty() or (type = 'searchset'), xpath: not(f:entry/f:search) or (f:type/@value = 'searchset'))
bdl-3: entry.request only for some types of bundles (expression : entry.request.empty() or type = 'batch' or type = 'transaction' or type = 'history', xpath: not(f:entry/f:request) or (f:type/@value = 'batch') or (f:type/@value = 'transaction') or (f:type/@value = 'history'))
bdl-4: entry.response only for some types of bundles (expression : entry.response.empty() or type = 'batch-response' or type = 'transaction-response', xpath: not(f:entry/f:response) or (f:type/@value = 'batch-response') or (f:type/@value = 'transaction-response'))
bdl-7: FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId (expression : entry.where(fullUrl).select(fullUrl&resource.meta.versionId).isDistinct(), xpath: count(for $entry in f:entry[f:resource] return $entry[count(parent::f:Bundle/f:entry[f:fullUrl/@value=$entry/f:fullUrl/@value and ((not(f:resource/*/f:meta/f:versionId/@value) and not($entry/f:resource/*/f:meta/f:versionId/@value)) or f:resource/*/f:meta/f:versionId/@value=$entry/f:resource/*/f:meta/f:versionId/@value)])!=1])=0)
bdl-9: A document must have an identifier with a system and a value (expression : type = 'document' implies (identifier.system.exists() and identifier.value.exists()), xpath: not(f:type/@value = 'document') or exists(f:identifier/f:system) or exists(f:identifier/f:value))
Bundle.identifier
Definition

A persistent identifier for the batch that won't change as a batch is copied from server to server.

NoteThis is a business identifer, not a resource identifier (see discussion)
Control0..1
TypeIdentifier
Summarytrue
Comments

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.

Bundle.type
Definition

Indicates the purpose of this bundle - how it was intended to be used.

Control1..1
Terminology BindingBundleType (Required)
Typecode
Summarytrue
Comments

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.

Bundle.total
Definition

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).

Control0..1
TypeunsignedInt
Summarytrue
Comments

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.

InvariantsAffect this element
bdl-1: total only when a search or history (expression : total.empty() or (type = 'searchset') or (type = 'history'), xpath: not(f:total) or (f:type/@value = 'searchset') or (f:type/@value = 'history'))
Bundle.link
Definition

A series of links that provide context to this bundle.

Control0..*
Summarytrue
Bundle.link.relation
Definition

A name which details the functional use for this link - see http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 .

Control1..1
Typestring
Summarytrue
Bundle.link.url
Definition

The reference details for the link.

Control1..1
Typeuri
Summarytrue
Bundle.entry
Definition

An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).

Control0..*
Summarytrue
InvariantsDefined on this element
bdl-5: must be a resource unless there's a request or response (expression : resource.exists() or request.exists() or response.exists(), xpath: exists(f:resource) or exists(f:request) or exists(f:response))
bdl-8: fullUrl cannot be a version specific reference (expression : fullUrl.contains('/_history/').not(), xpath: not(exists(f:fullUrl[contains(string(@value), '/_history/')])))
Bundle.entry.link
Definition

A series of links that provide context to this entry.

Control0..*
TypeSee Bundle.link
Summarytrue
Bundle.entry.fullUrl
Definition

The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. 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.

Control0..1
Typeuri
Summarytrue
Comments

fullUrl may not be unique in the context of a resource. Note that since FHIR resources do not need to be served through the FHIR API, the absolute URL may not end with the logical id of the resource (Resource.id), but if the fullUrl does look like a RESTful server URL (e.g. meets the regex, then it SHALL end with the Resource.id.

Bundle.entry.resource
Definition

The Resources for the entry.

Control0..1
TypeResource
Summarytrue
Bundle.entry.search
Definition

Information about the search process that lead to the creation of this entry.

Control0..1
Summarytrue
InvariantsAffect this element
bdl-2: entry.search only when a search (expression : entry.search.empty() or (type = 'searchset'), xpath: not(f:entry/f:search) or (f:type/@value = 'searchset'))
Bundle.entry.search.mode
Definition

Why this entry is in the result set - whether it's included as a match or because of an _include requirement.

Control0..1
Terminology BindingSearchEntryMode (Required)
Typecode
Summarytrue
Comments

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.

Bundle.entry.search.score
Definition

When searching, the server's search ranking score for the entry.

Control0..1
Typedecimal
Summarytrue
Comments

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.

Bundle.entry.request
Definition

Additional information about how this entry should be processed as part of a transaction.

Control0..1
Summarytrue
InvariantsAffect this element
bdl-3: entry.request only for some types of bundles (expression : entry.request.empty() or type = 'batch' or type = 'transaction' or type = 'history', xpath: not(f:entry/f:request) or (f:type/@value = 'batch') or (f:type/@value = 'transaction') or (f:type/@value = 'history'))
Bundle.entry.request.method
Definition

The HTTP verb for this entry in either a change history, or a transaction/ transaction response.

Control1..1
Terminology BindingHTTPVerb (Required)
Typecode
Summarytrue
Bundle.entry.request.url
Definition

The URL for this entry, relative to the root (the address to which the request is posted).

Control1..1
Typeuri
Summarytrue
Comments

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]".

Bundle.entry.request.ifNoneMatch
Definition

If the ETag values match, return a 304 Not Modified status. See the API documentation for "Conditional Read".

Control0..1
Typestring
Summarytrue
Bundle.entry.request.ifModifiedSince
Definition

Only perform the operation if the last updated date matches. See the API documentation for "Conditional Read".

Control0..1
Typeinstant
Summarytrue
Bundle.entry.request.ifMatch
Definition

Only perform the operation if the Etag value matches. For more information, see the API section "Managing Resource Contention".

Control0..1
Typestring
Summarytrue
Bundle.entry.request.ifNoneExist
Definition

Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for "Conditional Create". This is just the query portion of the URL - what follows the "?" (not including the "?").

Control0..1
Typestring
Summarytrue
Bundle.entry.response
Definition

Additional information about how this entry should be processed as part of a transaction.

Control0..1
Summarytrue
InvariantsAffect this element
bdl-4: entry.response only for some types of bundles (expression : entry.response.empty() or type = 'batch-response' or type = 'transaction-response', xpath: not(f:entry/f:response) or (f:type/@value = 'batch-response') or (f:type/@value = 'transaction-response'))
Bundle.entry.response.status
Definition

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.

Control1..1
Typestring
Summarytrue
Bundle.entry.response.location
Definition

The location header created by processing this operation.

Control0..1
Typeuri
Summarytrue
Bundle.entry.response.etag
Definition

The etag for the resource, it the operation for the entry produced a versioned resource (see Resource Metadata and Versioning and Managing Resource Contention).

Control0..1
Typestring
Summarytrue
Comments

Etags match the Resource.meta.versionId. The ETag has to match the version id in the header if a resource is included.

Bundle.entry.response.lastModified
Definition

The date/time that the resource was modified on the server.

Control0..1
Typeinstant
Summarytrue
Comments

This has to match the same time in the meta header if a resource is included.

Bundle.entry.response.outcome
Definition

An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.

Control0..1
TypeResource
Summarytrue
Comments

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.

Bundle.signature
Definition

Digital Signature - base64 encoded. XML-DSIg or a JWT.

Control0..1
TypeSignature
Requirements

This element allows capturing signatures on documents. It also allows signatures on messages, transactions or even query responses. It may support content-authentication, non-repudiation or other business cases. This is primarily relevant where the bundle may travel through multiple hops or via other mechanisms where HTTPS non-repudiation is insufficient.

Summarytrue
Comments

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.