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 Group | Maturity Level: 5 | Normative | Compartments: Not linked to any defined compartments |
Normative Candidate Note: This page is candidate normative content for R4 in the Infrastructure Package. Once normative, it will lose it's Maturity Level, and breaking changes will no longer be made.
A container for a collection of resources.
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:
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:
This resource is referenced by measurereport
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
Bundle | ΣIN | Resource | Contains a collection of resources + FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId + A document must have an identifier with a system and a value + entry.request only for some types of bundles + entry.response only for some types of bundles + total only when a search or history + entry.search only when a search Elements defined in Ancestors: id, meta, implicitRules, language | |
identifier | Σ | 0..1 | Identifier | Persistent identifier for the bundle |
type | Σ | 1..1 | code | document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection BundleType (Required) |
timestamp | Σ | 0..1 | instant | When the bundle was assembled |
total | ΣI | 0..1 | unsignedInt | If search, the total number of matches |
link | Σ | 0..* | BackboneElement | Links related to this Bundle |
relation | Σ | 1..1 | string | See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 |
url | Σ | 1..1 | uri | Reference details for the link |
entry | ΣI | 0..* | BackboneElement | Entry in the bundle - will have a resource, or information + fullUrl cannot be a version specific reference + must be a resource unless there's a request or response |
link | Σ | 0..* | see link | Links related to this entry |
fullUrl | Σ | 0..1 | uri | Absolute URL for resource (server address, or UUID/OID) |
resource | Σ | 0..1 | Resource | A resource in the bundle |
search | ΣI | 0..1 | BackboneElement | Search related information |
mode | Σ | 0..1 | code | match | include | outcome - why this is in the result set SearchEntryMode (Required) |
score | Σ | 0..1 | decimal | Search ranking (between 0 and 1) |
request | ΣI | 0..1 | BackboneElement | Transaction Related Information |
method | Σ | 1..1 | code | GET | HEAD | POST | PUT | DELETE | PATCH HTTPVerb (Required) |
url | Σ | 1..1 | uri | URL for HTTP equivalent of this entry |
ifNoneMatch | Σ | 0..1 | string | For managing cache currency |
ifModifiedSince | Σ | 0..1 | instant | For managing update contention |
ifMatch | Σ | 0..1 | string | For managing update contention |
ifNoneExist | Σ | 0..1 | string | For conditional creates |
response | ΣI | 0..1 | BackboneElement | Transaction Related Information |
status | Σ | 1..1 | string | Status response code (text optional) |
location | Σ | 0..1 | uri | The location, if the operation returns a location |
etag | Σ | 0..1 | string | The Etag for the resource (if relevant) |
lastModified | Σ | 0..1 | instant | Server's date time modified |
outcome | Σ | 0..1 | Resource | OperationOutcome with hints and warnings (for batch/transaction) |
signature | ΣTU | 0..1 | Signature | Digital Signature |
Documentation for this format |
UML Diagram (Legend)
XML Template
<Bundle xmlns="http://hl7.org/fhir"> <!-- from Resource: id, meta, implicitRules, and language --> <identifier><!-- 0..1 Identifier Persistent identifier for the bundle --></identifier> <type value="[code]"/><!-- 1..1 document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection --> <timestamp value="[instant]"/><!-- 0..1 When the bundle was assembled --> <total value="[unsignedInt]"/><!-- 0..1 If search, the total number of matches --> <link> <!-- 0..* Links related to this Bundle --> <relation value="[string]"/><!-- 1..1 See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 --> <url value="[uri]"/><!-- 1..1 Reference details for the link --> </link> <entry> <!-- 0..* Entry in the bundle - will have a resource, or information --> <link><!-- 0..* Content as for Bundle.link Links related to this entry --></link> <fullUrl value="[uri]"/><!-- 0..1 Absolute URL for resource (server address, or UUID/OID) --> <resource><!-- 0..1 Resource A resource in the bundle --></resource> <search> <!-- 0..1 Search related information --> <mode value="[code]"/><!-- 0..1 match | include | outcome - why this is in the result set --> <score value="[decimal]"/><!-- 0..1 Search ranking (between 0 and 1) --> </search> <request> <!-- 0..1 Transaction Related Information --> <method value="[code]"/><!-- 1..1 GET | HEAD | POST | PUT | DELETE | PATCH --> <url value="[uri]"/><!-- 1..1 URL for HTTP equivalent of this entry --> <ifNoneMatch value="[string]"/><!-- 0..1 For managing cache currency --> <ifModifiedSince value="[instant]"/><!-- 0..1 For managing update contention --> <ifMatch value="[string]"/><!-- 0..1 For managing update contention --> <ifNoneExist value="[string]"/><!-- 0..1 For conditional creates --> </request> <response> <!-- 0..1 Transaction Related Information --> <status value="[string]"/><!-- 1..1 Status response code (text optional) --> <location value="[uri]"/><!-- 0..1 The location, if the operation returns a location --> <etag value="[string]"/><!-- 0..1 The Etag for the resource (if relevant) --> <lastModified value="[instant]"/><!-- 0..1 Server's date time modified --> <outcome><!-- 0..1 Resource OperationOutcome with hints and warnings (for batch/transaction) --></outcome> </response> </entry> <signature><!-- 0..1 Signature Digital Signature --></signature> </Bundle>
JSON Template
{ "resourceType" : "Bundle", // from Resource: id, meta, implicitRules, and language "identifier" : { Identifier }, // Persistent identifier for the bundle "type" : "<code>", // R! document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection "timestamp" : "<instant>", // When the bundle was assembled "total" : "<unsignedInt>", // C? If search, the total number of matches "link" : [{ // Links related to this Bundle "relation" : "<string>", // R! See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 "url" : "<uri>" // R! Reference details for the link }], "entry" : [{ // Entry in the bundle - will have a resource, or information "link" : [{ Content as for Bundle.link }], // Links related to this entry "fullUrl" : "<uri>", // Absolute URL for resource (server address, or UUID/OID) "resource" : { Resource }, // A resource in the bundle "search" : { // C? Search related information "mode" : "<code>", // match | include | outcome - why this is in the result set "score" : <decimal> // Search ranking (between 0 and 1) }, "request" : { // C? Transaction Related Information "method" : "<code>", // R! GET | HEAD | POST | PUT | DELETE | PATCH "url" : "<uri>", // R! URL for HTTP equivalent of this entry "ifNoneMatch" : "<string>", // For managing cache currency "ifModifiedSince" : "<instant>", // For managing update contention "ifMatch" : "<string>", // For managing update contention "ifNoneExist" : "<string>" // For conditional creates }, "response" : { // C? Transaction Related Information "status" : "<string>", // R! Status response code (text optional) "location" : "<uri>", // The location, if the operation returns a location "etag" : "<string>", // The Etag for the resource (if relevant) "lastModified" : "<instant>", // Server's date time modified "outcome" : { Resource } // OperationOutcome with hints and warnings (for batch/transaction) } }], "signature" : { Signature } // Digital Signature }
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> . [ a fhir:Bundle; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Resource: .id, .meta, .implicitRules, and .language fhir:Bundle.identifier [ Identifier ]; # 0..1 Persistent identifier for the bundle fhir:Bundle.type [ code ]; # 1..1 document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection fhir:Bundle.timestamp [ instant ]; # 0..1 When the bundle was assembled fhir:Bundle.total [ unsignedInt ]; # 0..1 If search, the total number of matches fhir:Bundle.link [ # 0..* Links related to this Bundle fhir:Bundle.link.relation [ string ]; # 1..1 See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 fhir:Bundle.link.url [ uri ]; # 1..1 Reference details for the link ], ...; fhir:Bundle.entry [ # 0..* Entry in the bundle - will have a resource, or information fhir:Bundle.entry.link [ See Bundle.link ], ... ; # 0..* Links related to this entry fhir:Bundle.entry.fullUrl [ uri ]; # 0..1 Absolute URL for resource (server address, or UUID/OID) fhir:Bundle.entry.resource [ Resource ]; # 0..1 A resource in the bundle fhir:Bundle.entry.search [ # 0..1 Search related information fhir:Bundle.entry.search.mode [ code ]; # 0..1 match | include | outcome - why this is in the result set fhir:Bundle.entry.search.score [ decimal ]; # 0..1 Search ranking (between 0 and 1) ]; fhir:Bundle.entry.request [ # 0..1 Transaction Related Information fhir:Bundle.entry.request.method [ code ]; # 1..1 GET | HEAD | POST | PUT | DELETE | PATCH fhir:Bundle.entry.request.url [ uri ]; # 1..1 URL for HTTP equivalent of this entry fhir:Bundle.entry.request.ifNoneMatch [ string ]; # 0..1 For managing cache currency fhir:Bundle.entry.request.ifModifiedSince [ instant ]; # 0..1 For managing update contention fhir:Bundle.entry.request.ifMatch [ string ]; # 0..1 For managing update contention fhir:Bundle.entry.request.ifNoneExist [ string ]; # 0..1 For conditional creates ]; fhir:Bundle.entry.response [ # 0..1 Transaction Related Information fhir:Bundle.entry.response.status [ string ]; # 1..1 Status response code (text optional) fhir:Bundle.entry.response.location [ uri ]; # 0..1 The location, if the operation returns a location fhir:Bundle.entry.response.etag [ string ]; # 0..1 The Etag for the resource (if relevant) fhir:Bundle.entry.response.lastModified [ instant ]; # 0..1 Server's date time modified fhir:Bundle.entry.response.outcome [ Resource ]; # 0..1 OperationOutcome with hints and warnings (for batch/transaction) ]; ], ...; fhir:Bundle.signature [ Signature ]; # 0..1 Digital Signature ]
Changes since R3
Bundle | |
Bundle.timestamp |
|
See the Full Difference for further information
This analysis is available as XML or JSON.
See R2 <--> R3 Conversion Maps (status = 23 tests of which 1 fail to execute. 11 fail round-trip testing and 11 r3 resources are invalid (3836 errors).). Note: these have note yet been updated to be R3 to R4
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
Bundle | ΣIN | Resource | Contains a collection of resources + FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId + A document must have an identifier with a system and a value + entry.request only for some types of bundles + entry.response only for some types of bundles + total only when a search or history + entry.search only when a search Elements defined in Ancestors: id, meta, implicitRules, language | |
identifier | Σ | 0..1 | Identifier | Persistent identifier for the bundle |
type | Σ | 1..1 | code | document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection BundleType (Required) |
timestamp | Σ | 0..1 | instant | When the bundle was assembled |
total | ΣI | 0..1 | unsignedInt | If search, the total number of matches |
link | Σ | 0..* | BackboneElement | Links related to this Bundle |
relation | Σ | 1..1 | string | See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 |
url | Σ | 1..1 | uri | Reference details for the link |
entry | ΣI | 0..* | BackboneElement | Entry in the bundle - will have a resource, or information + fullUrl cannot be a version specific reference + must be a resource unless there's a request or response |
link | Σ | 0..* | see link | Links related to this entry |
fullUrl | Σ | 0..1 | uri | Absolute URL for resource (server address, or UUID/OID) |
resource | Σ | 0..1 | Resource | A resource in the bundle |
search | ΣI | 0..1 | BackboneElement | Search related information |
mode | Σ | 0..1 | code | match | include | outcome - why this is in the result set SearchEntryMode (Required) |
score | Σ | 0..1 | decimal | Search ranking (between 0 and 1) |
request | ΣI | 0..1 | BackboneElement | Transaction Related Information |
method | Σ | 1..1 | code | GET | HEAD | POST | PUT | DELETE | PATCH HTTPVerb (Required) |
url | Σ | 1..1 | uri | URL for HTTP equivalent of this entry |
ifNoneMatch | Σ | 0..1 | string | For managing cache currency |
ifModifiedSince | Σ | 0..1 | instant | For managing update contention |
ifMatch | Σ | 0..1 | string | For managing update contention |
ifNoneExist | Σ | 0..1 | string | For conditional creates |
response | ΣI | 0..1 | BackboneElement | Transaction Related Information |
status | Σ | 1..1 | string | Status response code (text optional) |
location | Σ | 0..1 | uri | The location, if the operation returns a location |
etag | Σ | 0..1 | string | The Etag for the resource (if relevant) |
lastModified | Σ | 0..1 | instant | Server's date time modified |
outcome | Σ | 0..1 | Resource | OperationOutcome with hints and warnings (for batch/transaction) |
signature | ΣTU | 0..1 | Signature | Digital Signature |
Documentation for this format |
XML Template
<Bundle xmlns="http://hl7.org/fhir"> <!-- from Resource: id, meta, implicitRules, and language --> <identifier><!-- 0..1 Identifier Persistent identifier for the bundle --></identifier> <type value="[code]"/><!-- 1..1 document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection --> <timestamp value="[instant]"/><!-- 0..1 When the bundle was assembled --> <total value="[unsignedInt]"/><!-- 0..1 If search, the total number of matches --> <link> <!-- 0..* Links related to this Bundle --> <relation value="[string]"/><!-- 1..1 See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 --> <url value="[uri]"/><!-- 1..1 Reference details for the link --> </link> <entry> <!-- 0..* Entry in the bundle - will have a resource, or information --> <link><!-- 0..* Content as for Bundle.link Links related to this entry --></link> <fullUrl value="[uri]"/><!-- 0..1 Absolute URL for resource (server address, or UUID/OID) --> <resource><!-- 0..1 Resource A resource in the bundle --></resource> <search> <!-- 0..1 Search related information --> <mode value="[code]"/><!-- 0..1 match | include | outcome - why this is in the result set --> <score value="[decimal]"/><!-- 0..1 Search ranking (between 0 and 1) --> </search> <request> <!-- 0..1 Transaction Related Information --> <method value="[code]"/><!-- 1..1 GET | HEAD | POST | PUT | DELETE | PATCH --> <url value="[uri]"/><!-- 1..1 URL for HTTP equivalent of this entry --> <ifNoneMatch value="[string]"/><!-- 0..1 For managing cache currency --> <ifModifiedSince value="[instant]"/><!-- 0..1 For managing update contention --> <ifMatch value="[string]"/><!-- 0..1 For managing update contention --> <ifNoneExist value="[string]"/><!-- 0..1 For conditional creates --> </request> <response> <!-- 0..1 Transaction Related Information --> <status value="[string]"/><!-- 1..1 Status response code (text optional) --> <location value="[uri]"/><!-- 0..1 The location, if the operation returns a location --> <etag value="[string]"/><!-- 0..1 The Etag for the resource (if relevant) --> <lastModified value="[instant]"/><!-- 0..1 Server's date time modified --> <outcome><!-- 0..1 Resource OperationOutcome with hints and warnings (for batch/transaction) --></outcome> </response> </entry> <signature><!-- 0..1 Signature Digital Signature --></signature> </Bundle>
JSON Template
{ "resourceType" : "Bundle", // from Resource: id, meta, implicitRules, and language "identifier" : { Identifier }, // Persistent identifier for the bundle "type" : "<code>", // R! document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection "timestamp" : "<instant>", // When the bundle was assembled "total" : "<unsignedInt>", // C? If search, the total number of matches "link" : [{ // Links related to this Bundle "relation" : "<string>", // R! See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 "url" : "<uri>" // R! Reference details for the link }], "entry" : [{ // Entry in the bundle - will have a resource, or information "link" : [{ Content as for Bundle.link }], // Links related to this entry "fullUrl" : "<uri>", // Absolute URL for resource (server address, or UUID/OID) "resource" : { Resource }, // A resource in the bundle "search" : { // C? Search related information "mode" : "<code>", // match | include | outcome - why this is in the result set "score" : <decimal> // Search ranking (between 0 and 1) }, "request" : { // C? Transaction Related Information "method" : "<code>", // R! GET | HEAD | POST | PUT | DELETE | PATCH "url" : "<uri>", // R! URL for HTTP equivalent of this entry "ifNoneMatch" : "<string>", // For managing cache currency "ifModifiedSince" : "<instant>", // For managing update contention "ifMatch" : "<string>", // For managing update contention "ifNoneExist" : "<string>" // For conditional creates }, "response" : { // C? Transaction Related Information "status" : "<string>", // R! Status response code (text optional) "location" : "<uri>", // The location, if the operation returns a location "etag" : "<string>", // The Etag for the resource (if relevant) "lastModified" : "<instant>", // Server's date time modified "outcome" : { Resource } // OperationOutcome with hints and warnings (for batch/transaction) } }], "signature" : { Signature } // Digital Signature }
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> . [ a fhir:Bundle; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Resource: .id, .meta, .implicitRules, and .language fhir:Bundle.identifier [ Identifier ]; # 0..1 Persistent identifier for the bundle fhir:Bundle.type [ code ]; # 1..1 document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection fhir:Bundle.timestamp [ instant ]; # 0..1 When the bundle was assembled fhir:Bundle.total [ unsignedInt ]; # 0..1 If search, the total number of matches fhir:Bundle.link [ # 0..* Links related to this Bundle fhir:Bundle.link.relation [ string ]; # 1..1 See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 fhir:Bundle.link.url [ uri ]; # 1..1 Reference details for the link ], ...; fhir:Bundle.entry [ # 0..* Entry in the bundle - will have a resource, or information fhir:Bundle.entry.link [ See Bundle.link ], ... ; # 0..* Links related to this entry fhir:Bundle.entry.fullUrl [ uri ]; # 0..1 Absolute URL for resource (server address, or UUID/OID) fhir:Bundle.entry.resource [ Resource ]; # 0..1 A resource in the bundle fhir:Bundle.entry.search [ # 0..1 Search related information fhir:Bundle.entry.search.mode [ code ]; # 0..1 match | include | outcome - why this is in the result set fhir:Bundle.entry.search.score [ decimal ]; # 0..1 Search ranking (between 0 and 1) ]; fhir:Bundle.entry.request [ # 0..1 Transaction Related Information fhir:Bundle.entry.request.method [ code ]; # 1..1 GET | HEAD | POST | PUT | DELETE | PATCH fhir:Bundle.entry.request.url [ uri ]; # 1..1 URL for HTTP equivalent of this entry fhir:Bundle.entry.request.ifNoneMatch [ string ]; # 0..1 For managing cache currency fhir:Bundle.entry.request.ifModifiedSince [ instant ]; # 0..1 For managing update contention fhir:Bundle.entry.request.ifMatch [ string ]; # 0..1 For managing update contention fhir:Bundle.entry.request.ifNoneExist [ string ]; # 0..1 For conditional creates ]; fhir:Bundle.entry.response [ # 0..1 Transaction Related Information fhir:Bundle.entry.response.status [ string ]; # 1..1 Status response code (text optional) fhir:Bundle.entry.response.location [ uri ]; # 0..1 The location, if the operation returns a location fhir:Bundle.entry.response.etag [ string ]; # 0..1 The Etag for the resource (if relevant) fhir:Bundle.entry.response.lastModified [ instant ]; # 0..1 Server's date time modified fhir:Bundle.entry.response.outcome [ Resource ]; # 0..1 OperationOutcome with hints and warnings (for batch/transaction) ]; ], ...; fhir:Bundle.signature [ Signature ]; # 0..1 Digital Signature ]
Changes since DSTU2
Bundle | |
Bundle.timestamp |
|
See the Full Difference for further information
This analysis is available as XML or JSON.
See R2 <--> R3 Conversion Maps (status = 23 tests of which 1 fail to execute. 11 fail round-trip testing and 11 r3 resources are invalid (3836 errors).). Note: these have note yet been updated to be R3 to R4
Alternate definitions: Master Definition XML + JSON, XML Schema/Schematron + JSON Schema, ShEx (for Turtle) + see the extensions & the dependency analysis
Path | Definition | Type | Reference |
---|---|---|---|
Bundle.type | Indicates the purpose of a bundle - how it was intended to be used. | Required | BundleType |
Bundle.entry.search.mode | Why an entry is in the result set - whether it's included as a match or because of an _include requirement. | Required | SearchEntryMode |
Bundle.entry.request.method | HTTP verbs (in the HTTP command line). | Required | HTTPVerb |
link
, entry
, and search
/request
/response
can all have extensions. See Patient and Location for examples on searchThe 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.
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.
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.
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:
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. 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, and that may be returned by following the "next" link.
A transaction (type = "transaction") or batch (type = "batch") consists of a series of 0 or more entries. Each entry element SHALL contain either a request element, or a resource element (or both). See Transactions for further information. Each entry in a transaction 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.
If there is no request
element, then there SHALL be a resource and the server must
infer whether this is a create or an update from the resource identity supplied.
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.
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.
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 SHALL 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).
In some Bundles, a given resource can only appear once:
Type | Rules |
document | no duplicates |
message | no duplicates (generally not, unless noted explicitly in the event definition e.g. for messaging deltas?) |
transaction | no duplicates allowed |
transaction-response | no duplicates allowed |
batch | no duplicates allowed |
batch-response | no duplicates allowed |
history | yes, duplicates are allowed |
searchset | no duplicates allowed |
collection | yes, duplicates are allowed, though generally would not be a good idea |
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.
How to resolve a reference in a Bundle:
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.
Here is an example Bundle the demonstrates these rules:
<Bundle xmlns="http://hl7.org/fhir"> <type value="collection"/> <!-- A patient that already has an id on a server --> <entry> <fullUrl value="http://example.org/fhir/Patient/23"/> <resource> <Patient> <id value="23"/> </Patient> </resource> </entry> <!-- A patient that doesn't have a persistent home - but it does have a UUID assigned for this bundle "locally identified" --> <entry> <fullUrl value="urn:uuid:04121321-4af5-424c-a0e1-ed3aab1c349d"/> <resource> <Patient> </Patient> </resource> </entry> <!-- a relative resource reference --> <entry> <fullUrl value="http://example.org/fhir/Observation/123"/> <resource> <Observation> <id value="123"/> <subject> <!-- this is reference to the first resource above --> <reference value="Patient/23"/> </subject> </Observation> </resource> </entry> <!-- an absolute reference --> <entry> <fullUrl value="http://example.org/fhir/Observation/124"/> <resource> <Observation> <id value="124"/> <subject> <!-- this is reference to the first resource above --> <reference value="http://example.org/fhir/Patient/23"/> </subject> </Observation> </resource> </entry> <!-- reference to a locally identified resource --> <entry> <fullUrl value="http://example.org/fhir/Observation/12"/> <resource> <Observation> <id value="12"/> <subject> <!-- reference to the second patient above --> <reference value="urn:uuid:04121321-4af5-424c-a0e1-ed3aab1c349d"/> </subject> </Observation> </resource> </entry> <!-- reference that doesn't resolve in this bundle --> <entry> <fullUrl value="http://example.org/fhir/Observation/14"/> <resource> <Observation> <id value="14"/> <subject> <!-- reference to a patient not found in this bundle --> <reference value="http://example.org/fhir-2/Patient/1"/> </subject> </Observation> </resource> </entry> </Bundle>
Search parameters for this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.
Name | Type | Description | Expression | In Common |
composition | reference | 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 | Bundle.entry[0].resource (Composition) | |
identifier | token | Persistent identifier for the bundle | Bundle.identifier | |
message | reference | 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 | Bundle.entry[0].resource (MessageHeader) | |
timestamp | date | When the bundle was assembled | Bundle.timestamp | |
type | token | document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | Bundle.type |