This
page
is
part
of
the
FHIR
Specification
(v3.3.0:
R4
v6.0.0-ballot2:
Release
6
Ballot
2).
(2nd
Draft)
(see
Ballot
Notes
).
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
:
|
Normative (from v4.0.0) | Security Category : Not Classified |
Compartments
:
|
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:
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
resource
list
is
referenced
by
measurereport
not
exhaustive;
other
resources
also
provide
grouping
functionality.
No references for this Resource.
Structure
| Name | Flags | Card. | Type |
Description
&
Constraints
|
|---|---|---|---|---|
|
|
Resource |
Contains
a
collection
of
resources
+ Rule: total only when a search or history + Rule: entry.search only when a search + Rule: FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId (except in history bundles) + Rule: A document must have an identifier with a system and a value + + Rule: A document must have a Composition as the first resource + Rule: A message must have a MessageHeader as the first resource + Rule: A subscription-notification must have a SubscriptionStatus as the first resource + Rule: entry.request.method PATCH not allowed for + Rule: Bundle resources where type is not transaction, transaction-response, batch, or batch-response or when the request is a POST SHALL have Bundle.entry.fullUrl populated + Rule: Issue.severity for all issues within the OperationOutcome must be either 'information' or 'warning'. + Rule: Use and meaning of + + Rule: For collections of + + + Rule: For collections of type transaction-response or batch-response, all entries must contain response elements Elements defined in Ancestors: id , meta , implicitRules , language |
|
|
Σ C | 0..1 | Identifier |
Persistent
identifier
for
the
bundle
|
|
Σ C | 1..1 | code |
document
|
message
|
transaction
|
transaction-response
|
batch
|
batch-response
|
history
|
searchset
|
collection
|
subscription-notification
|
|
Σ C | 0..1 | instant |
When
the
bundle
was
assembled
|
|
Σ
|
0..1 | unsignedInt |
If
search,
the
total
number
of
matches
|
|
Σ C | 0..* | BackboneElement |
Links
related
to
this
Bundle
|
|
Σ C | 1..1 |
|
See
http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1
Binding: Link Relation Types ( Required ) |
|
Σ C | 1..1 | uri |
Reference
details
for
the
link
|
|
Σ
|
0..* | BackboneElement |
Entry
in
the
bundle
-
will
have
a
+ Rule: fullUrl cannot be a version specific reference This repeating element order: For bundles of type 'document' and 'message', the first resource is special (must be Composition or MessageHeader respectively). For all bundles, the meaning of the order of entries depends on the bundle type |
|
Σ | 0..* | see link |
Links
related
to
this
entry
|
|
Σ C | 0..1 | uri |
|
|
Σ C | 0..1 | Resource |
A
resource
in
the
bundle
|
|
Σ
|
0..1 | BackboneElement |
Search
related
information
|
|
Σ | 0..1 | code |
match
|
include
|
|
Σ | 0..1 | decimal |
Search
ranking
(between
0
and
1)
|
|
Σ
|
0..1 | BackboneElement |
Additional
execution
information
(transaction/batch/history)
|
|
Σ C | 1..1 | code |
GET
|
HEAD
|
POST
|
PUT
|
DELETE
|
PATCH
|
|
Σ | 1..1 | uri |
URL
for
HTTP
equivalent
of
this
entry
|
|
Σ | 0..1 | string |
For
managing
cache
|
|
Σ | 0..1 | instant |
For
managing
|
|
Σ | 0..1 | string |
For
managing
update
contention
|
|
Σ | 0..1 | string |
For
conditional
creates
|
|
Σ
|
0..1 | BackboneElement |
|
|
Σ | 1..1 | string |
Status
response
code
(text
optional)
|
|
Σ | 0..1 | uri |
The
|
|
Σ | 0..1 | string |
The
Etag
for
the
resource
(if
relevant)
|
|
Σ | 0..1 | instant |
Server's
date
time
modified
|
|
Σ | 0..1 | Resource |
OperationOutcome
with
hints
and
warnings
(for
batch/transaction)
|
|
Σ
|
0..1 | Signature |
Digital
Signature
|
| Σ C TU | 0..1 | Resource |
Issues
with
the
Bundle
|
Documentation
for
this
format
|
||||
See the Extensions for this resource
UML Diagram ( Legend )
XML Template
<Bundle xmlns="http://hl7.org/fhir"><!-- from Resource: id, meta, implicitRules, and language -->
<</identifier> < < < < < <<identifier><!-- I 0..1 Identifier Persistent identifier for the bundle --></identifier> <type value="[code]"/><!-- I 1..1 document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notification --> <timestamp value="[instant]"/><!-- I 0..1 When the bundle was assembled --> <total value="[unsignedInt]"/><!-- I 0..1 If search, the total number of matches --> <link> <!-- I 0..* Links related to this Bundle --> <relation value="[code]"/><!-- I 1..1 See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 --> <url value="[uri]"/><!-- I 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><<a href="bundle-definitions.html#Bundle.entry.fullUrl" title="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." class="dict"> <</resource> < <<fullUrl value="[uri]"/><!-- I 0..1 URI for resource (e.g. the absolute URL server address, URI for UUID/OID, etc.) --> <resource><!-- I 0..1 Resource A resource in the bundle --></resource> <search> <!-- I 0..1 Search related information --> <mode value="[code]"/><!-- 0..1 match | include - why this is in the result set --> <score value="[decimal]"/><!-- 0..1 Search ranking (between 0 and 1) --> </search>< <<request> <!-- I 0..1 Additional execution information (transaction/batch/history) --> <method value="[code]"/><!-- I 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 validation --> <ifModifiedSince value="[instant]"/><!-- 0..1 For managing cache currency --> <ifMatch value="[string]"/><!-- 0..1 For managing update contention --> <ifNoneExist value="[string]"/><!-- 0..1 For conditional creates --> </request><<response> <!-- I 0..1 Results of execution (transaction/batch/history) --> <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><signature><!-- 0..1 Signature Digital Signature --></signature> <issues><!-- I 0..1 Resource Issues with the Bundle --></issues> </Bundle>
JSON Template
{
"resourceType" : "Bundle",
// from Resource: id, meta, implicitRules, and language
"
"
"
"
"
"
"
"identifier" : { Identifier }, // I Persistent identifier for the bundle
"type" : "<code>", // I R! document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notification
"timestamp" : "<instant>", // I When the bundle was assembled
"total" : "<unsignedInt>", // I If search, the total number of matches
"link" : [{ // I Links related to this Bundle
"relation" : "<code>", // I R! See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1
"url" : "<uri>" // I 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
"<a href="bundle-definitions.html#Bundle.entry.fullUrl" title="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." class="dict">fullUrl
"
"
"
"fullUrl" : "<uri>", // I URI for resource (e.g. the absolute URL server address, URI for UUID/OID, etc.)
"resource" : { Resource }, // I A resource in the bundle
"search" : { // I Search related information
"mode" : "<code>", // match | include - why this is in the result set
"score" : <decimal> // Search ranking (between 0 and 1)
},
"
"
"request" : { // I Additional execution information (transaction/batch/history)
"method" : "<code>", // I R! GET | HEAD | POST | PUT | DELETE | PATCH
"url" : "<uri>", // R! URL for HTTP equivalent of this entry
"
"
"ifNoneMatch" : "<string>", // For managing cache validation
"ifModifiedSince" : "<instant>", // For managing cache currency
"ifMatch" : "<string>", // For managing update contention
"ifNoneExist" : "<string>" // For conditional creates
},
"
"response" : { // I Results of execution (transaction/batch/history)
"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
"issues" : { Resource } // I Issues with the Bundle
}
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: fhir: fhir: fhir: fhir: fhir: fhir: ], ...; fhir: fhir: fhir:<a href="bundle-definitions.html#Bundle.entry.fullUrl" title="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." class="dict">Bundle.entry.fullUrl fhir: fhir: fhir: fhir: ]; fhir: fhir: fhir: fhir: fhir: fhir: fhir: ]; fhir: fhir: fhir: fhir: fhir: fhir: ]; ], ...; fhir:fhir:identifier [ Identifier ] ; # 0..1 I Persistent identifier for the bundle fhir:type [ code ] ; # 1..1 I document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notification fhir:timestamp [ instant ] ; # 0..1 I When the bundle was assembled fhir:total [ unsignedInt ] ; # 0..1 I If search, the total number of matches fhir:link ( [ # 0..* I Links related to this Bundle fhir:relation [ code ] ; # 1..1 I See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 fhir:url [ uri ] ; # 1..1 I Reference details for the link ] ... ) ; fhir:entry ( [ # 0..* Entry in the bundle - will have a resource or information fhir:link ( [ See Bundle.link ] ... ) ; # 0..* Links related to this entry fhir:fullUrl [ uri ] ; # 0..1 I URI for resource (e.g. the absolute URL server address, URI for UUID/OID, etc.) fhir:resource [ Resource ] ; # 0..1 I A resource in the bundle fhir:search [ # 0..1 I Search related information fhir:mode [ code ] ; # 0..1 match | include - why this is in the result set fhir:score [ decimal ] ; # 0..1 Search ranking (between 0 and 1) ] ; fhir:request [ # 0..1 I Additional execution information (transaction/batch/history) fhir:method [ code ] ; # 1..1 I GET | HEAD | POST | PUT | DELETE | PATCH fhir:url [ uri ] ; # 1..1 URL for HTTP equivalent of this entry fhir:ifNoneMatch [ string ] ; # 0..1 For managing cache validation fhir:ifModifiedSince [ instant ] ; # 0..1 For managing cache currency fhir:ifMatch [ string ] ; # 0..1 For managing update contention fhir:ifNoneExist [ string ] ; # 0..1 For conditional creates ] ; fhir:response [ # 0..1 I Results of execution (transaction/batch/history) fhir:status [ string ] ; # 1..1 Status response code (text optional) fhir:location [ uri ] ; # 0..1 The location (if the operation returns a location) fhir:etag [ string ] ; # 0..1 The Etag for the resource (if relevant) fhir:lastModified [ instant ] ; # 0..1 Server's date time modified fhir:outcome [ Resource ] ; # 0..1 OperationOutcome with hints and warnings (for batch/transaction) ] ; ] ... ) ; fhir:signature [ Signature ] ; # 0..1 Digital Signature fhir:issues [ Resource ] ; # 0..1 I Issues with the Bundle ]
Changes
since
R3
from
both
R4
and
R4B
| Bundle | |
| Bundle.type |
|
| Bundle.link.relation |
|
|
|
|
See the Full Difference for further information
This
analysis
is
available
for
R4
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
for
R4B
as
XML
or
JSON
.
Structure
| Name | Flags | Card. | Type |
Description
&
Constraints
|
|---|---|---|---|---|
|
|
Resource |
Contains
a
collection
of
resources
+ Rule: total only when a search or history + Rule: entry.search only when a search + Rule: FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId (except in history bundles) + Rule: A document must have an identifier with a system and a value + + Rule: A document must have a Composition as the first resource + Rule: A message must have a MessageHeader as the first resource + Rule: A subscription-notification must have a SubscriptionStatus as the first resource + Rule: entry.request.method PATCH not allowed for + Rule: Bundle resources where type is not transaction, transaction-response, batch, or batch-response or when the request is a POST SHALL have Bundle.entry.fullUrl populated + Rule: Issue.severity for all issues within the OperationOutcome must be either 'information' or 'warning'. + Rule: Use and meaning of + + Rule: For collections of + + + Rule: For collections of type transaction-response or batch-response, all entries must contain response elements Elements defined in Ancestors: id , meta , implicitRules , language |
|
|
Σ C | 0..1 | Identifier |
Persistent
identifier
for
the
bundle
|
|
Σ C | 1..1 | code |
document
|
message
|
transaction
|
transaction-response
|
batch
|
batch-response
|
history
|
searchset
|
collection
|
subscription-notification
|
|
Σ C | 0..1 | instant |
When
the
bundle
was
assembled
|
|
Σ
|
0..1 | unsignedInt |
If
search,
the
total
number
of
matches
|
|
Σ C | 0..* | BackboneElement |
Links
related
to
this
Bundle
|
|
Σ C | 1..1 |
|
See
http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1
Binding: Link Relation Types ( Required ) |
|
Σ C | 1..1 | uri |
Reference
details
for
the
link
|
|
Σ
|
0..* | BackboneElement |
Entry
in
the
bundle
-
will
have
a
+ Rule: fullUrl cannot be a version specific reference This repeating element order: For bundles of type 'document' and 'message', the first resource is special (must be Composition or MessageHeader respectively). For all bundles, the meaning of the order of entries depends on the bundle type |
|
Σ | 0..* | see link |
Links
related
to
this
entry
|
|
Σ C | 0..1 | uri |
|
|
Σ C | 0..1 | Resource |
A
resource
in
the
bundle
|
|
Σ
|
0..1 | BackboneElement |
Search
related
information
|
|
Σ | 0..1 | code |
match
|
include
|
|
Σ | 0..1 | decimal |
Search
ranking
(between
0
and
1)
|
|
Σ
|
0..1 | BackboneElement |
Additional
execution
information
(transaction/batch/history)
|
|
Σ C | 1..1 | code |
GET
|
HEAD
|
POST
|
PUT
|
DELETE
|
PATCH
|
|
Σ | 1..1 | uri |
URL
for
HTTP
equivalent
of
this
entry
|
|
Σ | 0..1 | string |
For
managing
cache
|
|
Σ | 0..1 | instant |
For
managing
|
|
Σ | 0..1 | string |
For
managing
update
contention
|
|
Σ | 0..1 | string |
For
conditional
creates
|
|
Σ
|
0..1 | BackboneElement |
|
|
Σ | 1..1 | string |
Status
response
code
(text
optional)
|
|
Σ | 0..1 | uri |
The
|
|
Σ | 0..1 | string |
The
Etag
for
the
resource
(if
relevant)
|
|
Σ | 0..1 | instant |
Server's
date
time
modified
|
|
Σ | 0..1 | Resource |
OperationOutcome
with
hints
and
warnings
(for
batch/transaction)
|
|
Σ
|
0..1 | Signature |
Digital
Signature
|
| Σ C TU | 0..1 | Resource |
Issues
with
the
Bundle
|
Documentation
for
this
format
|
||||
See the Extensions for this resource
XML Template
<Bundle xmlns="http://hl7.org/fhir"><!-- from Resource: id, meta, implicitRules, and language -->
<</identifier> < < < < < <<identifier><!-- I 0..1 Identifier Persistent identifier for the bundle --></identifier> <type value="[code]"/><!-- I 1..1 document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notification --> <timestamp value="[instant]"/><!-- I 0..1 When the bundle was assembled --> <total value="[unsignedInt]"/><!-- I 0..1 If search, the total number of matches --> <link> <!-- I 0..* Links related to this Bundle --> <relation value="[code]"/><!-- I 1..1 See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 --> <url value="[uri]"/><!-- I 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><<a href="bundle-definitions.html#Bundle.entry.fullUrl" title="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." class="dict"> <</resource> < <<fullUrl value="[uri]"/><!-- I 0..1 URI for resource (e.g. the absolute URL server address, URI for UUID/OID, etc.) --> <resource><!-- I 0..1 Resource A resource in the bundle --></resource> <search> <!-- I 0..1 Search related information --> <mode value="[code]"/><!-- 0..1 match | include - why this is in the result set --> <score value="[decimal]"/><!-- 0..1 Search ranking (between 0 and 1) --> </search>< <<request> <!-- I 0..1 Additional execution information (transaction/batch/history) --> <method value="[code]"/><!-- I 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 validation --> <ifModifiedSince value="[instant]"/><!-- 0..1 For managing cache currency --> <ifMatch value="[string]"/><!-- 0..1 For managing update contention --> <ifNoneExist value="[string]"/><!-- 0..1 For conditional creates --> </request><<response> <!-- I 0..1 Results of execution (transaction/batch/history) --> <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><signature><!-- 0..1 Signature Digital Signature --></signature> <issues><!-- I 0..1 Resource Issues with the Bundle --></issues> </Bundle>
JSON Template
{
"resourceType" : "Bundle",
// from Resource: id, meta, implicitRules, and language
"
"
"
"
"
"
"
"identifier" : { Identifier }, // I Persistent identifier for the bundle
"type" : "<code>", // I R! document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notification
"timestamp" : "<instant>", // I When the bundle was assembled
"total" : "<unsignedInt>", // I If search, the total number of matches
"link" : [{ // I Links related to this Bundle
"relation" : "<code>", // I R! See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1
"url" : "<uri>" // I 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
"<a href="bundle-definitions.html#Bundle.entry.fullUrl" title="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." class="dict">fullUrl
"
"
"
"fullUrl" : "<uri>", // I URI for resource (e.g. the absolute URL server address, URI for UUID/OID, etc.)
"resource" : { Resource }, // I A resource in the bundle
"search" : { // I Search related information
"mode" : "<code>", // match | include - why this is in the result set
"score" : <decimal> // Search ranking (between 0 and 1)
},
"
"
"request" : { // I Additional execution information (transaction/batch/history)
"method" : "<code>", // I R! GET | HEAD | POST | PUT | DELETE | PATCH
"url" : "<uri>", // R! URL for HTTP equivalent of this entry
"
"
"ifNoneMatch" : "<string>", // For managing cache validation
"ifModifiedSince" : "<instant>", // For managing cache currency
"ifMatch" : "<string>", // For managing update contention
"ifNoneExist" : "<string>" // For conditional creates
},
"
"response" : { // I Results of execution (transaction/batch/history)
"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
"issues" : { Resource } // I Issues with the Bundle
}
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: fhir: fhir: fhir: fhir: fhir: fhir: ], ...; fhir: fhir: fhir:<a href="bundle-definitions.html#Bundle.entry.fullUrl" title="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." class="dict">Bundle.entry.fullUrl fhir: fhir: fhir: fhir: ]; fhir: fhir: fhir: fhir: fhir: fhir: fhir: ]; fhir: fhir: fhir: fhir: fhir: fhir: ]; ], ...; fhir:fhir:identifier [ Identifier ] ; # 0..1 I Persistent identifier for the bundle fhir:type [ code ] ; # 1..1 I document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notification fhir:timestamp [ instant ] ; # 0..1 I When the bundle was assembled fhir:total [ unsignedInt ] ; # 0..1 I If search, the total number of matches fhir:link ( [ # 0..* I Links related to this Bundle fhir:relation [ code ] ; # 1..1 I See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 fhir:url [ uri ] ; # 1..1 I Reference details for the link ] ... ) ; fhir:entry ( [ # 0..* Entry in the bundle - will have a resource or information fhir:link ( [ See Bundle.link ] ... ) ; # 0..* Links related to this entry fhir:fullUrl [ uri ] ; # 0..1 I URI for resource (e.g. the absolute URL server address, URI for UUID/OID, etc.) fhir:resource [ Resource ] ; # 0..1 I A resource in the bundle fhir:search [ # 0..1 I Search related information fhir:mode [ code ] ; # 0..1 match | include - why this is in the result set fhir:score [ decimal ] ; # 0..1 Search ranking (between 0 and 1) ] ; fhir:request [ # 0..1 I Additional execution information (transaction/batch/history) fhir:method [ code ] ; # 1..1 I GET | HEAD | POST | PUT | DELETE | PATCH fhir:url [ uri ] ; # 1..1 URL for HTTP equivalent of this entry fhir:ifNoneMatch [ string ] ; # 0..1 For managing cache validation fhir:ifModifiedSince [ instant ] ; # 0..1 For managing cache currency fhir:ifMatch [ string ] ; # 0..1 For managing update contention fhir:ifNoneExist [ string ] ; # 0..1 For conditional creates ] ; fhir:response [ # 0..1 I Results of execution (transaction/batch/history) fhir:status [ string ] ; # 1..1 Status response code (text optional) fhir:location [ uri ] ; # 0..1 The location (if the operation returns a location) fhir:etag [ string ] ; # 0..1 The Etag for the resource (if relevant) fhir:lastModified [ instant ] ; # 0..1 Server's date time modified fhir:outcome [ Resource ] ; # 0..1 OperationOutcome with hints and warnings (for batch/transaction) ] ; ] ... ) ; fhir:signature [ Signature ] ; # 0..1 Digital Signature fhir:issues [ Resource ] ; # 0..1 I Issues with the Bundle ]
Changes
since
DSTU2
from
both
R4
and
R4B
| Bundle | |
| Bundle.type |
|
| Bundle.link.relation |
|
|
|
|
See the Full Difference for further information
This
analysis
is
available
for
R4
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
for
R4B
as
XML
or
JSON
.
Alternate
Additional
definitions:
Master
Definition
XML
+
JSON
,
XML
Schema
/
Schematron
+
JSON
Schema
,
ShEx
(for
Turtle
)
+
see
,
the
extensions
spreadsheet
version
&
the
dependency
analysis
| Path |
|
Type |
|
|---|---|---|---|
| Bundle.type | BundleType | Required |
Indicates
the
purpose
of
a
bundle
-
how
it
|
| Bundle.link.relation | LinkRelationTypes | Required |
Link Relation Types defined at https://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1 |
| Bundle.entry.search.mode | SearchEntryMode | Required |
Why
an
entry
is
in
the
result
set
-
whether
it's
included
as
a
match
or
because
of
an
_include
|
| Bundle.entry.request.method | HTTPVerb | Required |
HTTP
verbs
(in
the
HTTP
command
line).
|
| UniqueKey | Level | Location | Description | Expression |
bdl-1
| Rule | (base) |
total
only
when
a
search
or
history
|
|
bdl-2
| Rule | (base) |
entry.search
only
when
a
search
|
|
bdl-5
|
Rule | Bundle.entry |
must
be
a
resource
unless
there's
a
request
or
response
|
|
bdl-7
| Rule | (base) |
FullUrl
must
be
unique
in
a
bundle,
or
else
entries
with
the
same
fullUrl
must
have
different
meta.versionId
|
|
bdl-8
| Rule | Bundle.entry |
fullUrl
cannot
be
a
version
specific
reference
|
|
bdl-9
| Rule | (base) |
A
document
must
have
an
identifier
with
a
system
and
a
value
|
|
bdl-10
| Rule | (base) | A document must have a date | type = 'document' implies (timestamp.hasValue()) |
bdl-11
| Rule | (base) | A document must have a Composition as the first resource | type = 'document' implies entry.first().resource.is(Composition) |
bdl-12
| Rule | (base) | A message must have a MessageHeader as the first resource | type = 'message' implies entry.first().resource.is(MessageHeader) |
bdl-13
| Rule | (base) | A subscription-notification must have a SubscriptionStatus as the first resource | type = 'subscription-notification' implies entry.first().resource.is(SubscriptionStatus) |
bdl-14
| Rule | (base) | entry.request.method PATCH not allowed for history | type = 'history' implies entry.request.method != 'PATCH' |
bdl-15
| Rule | (base) | Bundle resources where type is not transaction, transaction-response, batch, or batch-response or when the request is a POST SHALL have Bundle.entry.fullUrl populated | type='transaction' or type='transaction-response' or type='batch' or type='batch-response' or entry.all(fullUrl.exists() or request.method='POST') |
bdl-16
| Rule | (base) | Issue.severity for all issues within the OperationOutcome must be either 'information' or 'warning'. | issues.exists() implies (issues.issue.severity = 'information' or issues.issue.severity = 'warning') |
bdl-17
| Rule | (base) | Use and meaning of issues for documents has not been validated because the content will not be rendered in the document. | type = 'document' implies issues.empty() |
bdl-18
| Rule | (base) | Self link is required for searchsets. | type = 'searchset' implies link.where(relation = 'self' and url.exists()).exists() |
bdl-3a
| Rule | (base) | For collections of type document, message, searchset or collection, all entries must contain resources, and not have request or response elements | type in ('document' | 'message' | 'searchset' | 'collection') implies entry.all(resource.exists() and request.empty() and response.empty()) |
bdl-3b
| Rule | (base) | For collections of type history, all entries must contain request or response elements, and resources if the method is POST, PUT or PATCH | type = 'history' implies entry.all(request.exists() and response.exists() and ((request.method in ('POST' | 'PATCH' | 'PUT')) = resource.exists())) |
bdl-3c
| Rule | (base) | For collections of type transaction or batch, all entries must contain request elements, and resources if the method is POST, PUT or PATCH | type in ('transaction' | 'batch') implies entry.all(request.method.exists() and ((request.method in ('POST' | 'PATCH' | 'PUT')) = resource.exists())) |
bdl-3d
| Rule | (base) | For collections of type transaction-response or batch-response, all entries must contain response elements | type in ('transaction-response' | 'batch-response') implies entry.all(response.exists()) |
link
,
entry
,
and
search
/
request
/
response
can
all
have
extensions.
See
Patient
and
Location
for
examples
on
search
).
Bundle.entry.link
corresponds
to
links
found
in
the
HTTP
header
if
the
resource
in
the
entry
was
read
directly.
This
specification
defines
some
specific
uses
of
Bundle.link
for
searching
and
paging
,
but
no
specific
uses
for
Bundle.entry.link,
and
no
defined
function
in
a
transaction
-
meaning
is
implementation
specific
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.
A
document
Bundle
(type
=
"document")
consists
of
a
series
of
entries,
the
first
of
which
is
a
Composition
.
Each
entry
element
SHALL
contain
contains
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
contains
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
contains
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 . This total MAY be an estimate. Full iteration of the search set or using _total=accurate are the only mechanisms to reliably determine an exact count against an arbitrary system.
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,
made
and,
if
the
method
is
a
POST
POST,
PATCH,
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,
and
including
those
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
contains
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'
'PUT',
'PATCH'
or
'POST',
then
the
entry
SHALL
contain
contains
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.
See
Transactions
for
further
information.
A
transaction
response
(type
=
"transaction-response")
or
batch
response
(type="batch-response")
consists
of
a
series
of
0
or
more
entries,
entries:
1
for
each
entry
in
the
transaction
or
batch
it
is
in
response
to.
Each
entry
element
SHALL
contain
contains
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
contains
a
resource.
Normative Candidate Note: This BundleType is not normative - it is still undergoing Trial Use while more experience is gathered.
A subscription notification (type = "subscription-notification") consists of a series of 1 or more entries, the first of which is a SubscriptionStatus . There may be additional contents, as specified by the subscription responsible for generating the notification. See Subscription for further information.
Except
for
transactions
and
batches,
each
entry
in
a
Bundle
must
SHALL
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
SHALL
be
used
in
fullUrl
(urn:uuid:...).
For
transactions
and
batches,
entries
SHALL
not
have
MAY
omit
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
when
entry.request.method
=
POST
so
that
relationships
between
resources
can
be
represented
(see
Transactions
).
In
some
Bundles,
a
A
given
version
of
a
resource
can
SHALL
only
appear
once:
Type
Rules
document
no
duplicates
message
no
duplicates
(generally
not,
unless
noted
explicitly
once
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
each
Bundle.
There
MAY,
however,
be
multiple
versions
of
a
single
resource
present
in
a
single
bundle.
This
would
not
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
good
idea
resource
that
appears
multiple
times
is
potentially
ambiguous,
though
processors
may
have
additional
information
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.
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.
URL
externally.
Note that reference.value in entry resources can use any URI scheme (in addition to using relative values like "Patient/123").
How to resolve a reference in a Bundle:
Resolving urns. If the reference.value is a URN (always absolute) (e.g. "urn:uuid:9d1714da-b7e6-455b-bfd2-69ce0ff5fb12")
Resolving
absolute
references.
If
the
reference.value
is
not
an
absolute
reference,
convert
it
URL
(e.g.,
"https://fhir.example.org/base/Patient/123",
"https://fhir.example.org/base/Patient/123/_history/a"):
Resolving
relative
references
against
a
RESTful
base.
If
the
fullUrl
reference.value
is
of
the
resource
that
contains
form
"[type]/[id]"
(e.g.,
"Patient/123"):
Resolving
conditional
references.
If
the
reference
occurs
in
a
transaction
Bundle
and
the
reference.value
is
version
specific
(either
relative
or
absolute),
then
remove
a
conditional
reference
(e.g.
"http://example.org/base/Patient?identifier=1234"):
Resolving other references. If the rules above do not apply, the resolution fails (and ends) here. The reference has no defined meaning within this specification.
Note
that
the
rules
for
resolving
references
in
contained
resources
are
the
same
as
those
for
resolving
resources
references
in
the
resource
that
contains
the
contained
resource.
I.e.
the
fullUrl
of
the
containing
resource
is
used
when
determining
the
base
for
relative
references,
etc.
Here
Several
portions
of
this
algorithm
are
dependent
on
on
the
presence
of
Bundle.entry.fullUrl.
In
instances
where
references
might
be
resolved
within
a
Bundle
but
entries
do
not
have
fullURLs,
resolution
expectations
are
undefined.
For
this
reason,
Bundles
where
cross-Bundle
references
are
present
SHOULD
always
populate
Bundle.entry.fullUrl.
If multiple matches are found (except where explicitly handled in the above algorithm), 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
the
that
demonstrates
these
rules:
rules.
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 /[base]/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.
All elements in Bundle are marked as summary because Bundle resources need to be fully populated when doing a search, and most use cases for retrieving summaries of documents or other types of bundles are not well suited by the standard isSummary mechanism and are better handles by operations or other mechanisms.
Note to Implementers: If an element marked as 'summary' is itself a nested resource (i.e. type is Resource), then the expectation is that the conveyed resource will also be expressed in its summary form. The typical place this applies is Bundle.entry.resource. This statement is left as STU because there is not yet significant implementer experience on its ramifications.
The Bundle resource includes a signature element (digital signature) which can be used for standards based integrity verification and non-repudiation purposes. The Signature datatype provides details on use of the signature element. The Signature.type coded value of "Source" should be used when the signature is for simply proving that the resource content is the same as it was when the resource was updated or created.
Search parameters for this resource. See also the full list of search parameters for this resource , and check the Extensions registry for search parameters on extensions related to 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
|
Bundle.entry[0].resource
|
|
| 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
|
|
| timestamp | date | When the bundle was assembled | Bundle.timestamp | |
| type | token | document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notification | Bundle.type |