R4 Ballot #1 (Mixed Normative/Trial use)

This page is part of the FHIR Specification (v3.3.0: R4 Ballot 2). 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 Normative Compartments: Not linked to any defined compartments

Detailed Descriptions for the elements in the Bundle resource.

Bundle
Element IdBundle
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.exists()).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
Element IdBundle.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
Element IdBundle.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.timestamp
Element IdBundle.timestamp
Definition

The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.

Control0..1
Typeinstant
Summarytrue
Comments

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, and 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 to ask for subsequent updates
  • searchset : the time that the search set was assembled. Note that different pages will have different timestamps
  • 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.

Bundle.total
Element IdBundle.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
Element IdBundle.link
Definition

A series of links that provide context to this bundle.

Control0..*
Summarytrue
Bundle.link.relation
Element IdBundle.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
Element IdBundle.link.url
Definition

The reference details for the link.

Control1..1
Typeuri
Summarytrue
Bundle.entry
Element IdBundle.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
Element IdBundle.entry.link
Definition

A series of links that provide context to this entry.

Control0..*
TypeSee Bundle.link
Summarytrue
Bundle.entry.fullUrl
Element IdBundle.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 might 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 might 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
Element IdBundle.entry.resource
Definition

The Resources for the entry.

Control0..1
TypeResource
Summarytrue
Bundle.entry.search
Element IdBundle.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
Element IdBundle.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
Element IdBundle.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
Element IdBundle.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
Element IdBundle.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
Element IdBundle.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
Element IdBundle.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
Element IdBundle.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
Element IdBundle.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
Element IdBundle.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
Element IdBundle.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
Element IdBundle.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
Element IdBundle.entry.response.location
Definition

The location header created by processing this operation.

Control0..1
Typeuri
Summarytrue
Bundle.entry.response.etag
Element IdBundle.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
Element IdBundle.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
Element IdBundle.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
Standards StatusThis element has a standards status of "Trial Use" which is different to the status of the whole resource
Element IdBundle.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.