Release 5

This page is part of the FHIR Specification (v5.0.0: R5 - STU). This is the current published version in it's permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3 R2

2.4 Resource Bundle - Content

FHIR Infrastructure icon Work GroupMaturity Level: N Normative (from v4.0.0)Security Category: Not Classified Compartments: No defined 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:

  • Returning a set of resources that meet some criteria as part of a server operation (see RESTful Search)
  • Returning a set of versions of resources as part of the history operation on a server (see History)
  • Sending a set of resources as part of a message exchange (see Messaging)
  • Grouping a self-contained set of resources to act as an exchangeable and persistable collection with clinical integrity - e.g. a clinical document (see Documents)
  • Creating/updating/deleting a set of resources on a server as a single operation (including doing so as a single atomic transaction) (see Transactions)
  • Sending an event notification related to an active Subscription (see Subscriptions)
  • Storing a collection of resources

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:

  • Contained resources are "in" the container resource - they can only ever be interpreted and/or changed in the context of the container
  • A bundle is a collection of resources that can have an independent existence - for example, they might also be accessed directly using the RESTful API

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

  • The List resource – Enumerates a flat collection of resources and provides features for managing the collection. While a particular List instance may represent a "snapshot", from a business process perspective the notion of "List" is dynamic – items are added and removed over time. The list resource references other resources. Lists may be curated and have specific business meaning.
  • The Group resource – Defines a group of specific people, animals, devices, etc. by enumerating them, or by describing qualities that group members have. The group resource refers to other resources, possibly implicitly. Groups are intended to be acted upon or observed as a whole; e.g. performing therapy on a group, calculating risk for a group, etc. This resource will commonly be used for public health (e.g. describing an at-risk population), clinical trials (e.g. defining a test subject pool) and similar purposes.
  • The Composition resource – Defines a set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. The composition resource provides the basic structure of a FHIR document. The full content of the document is expressed using a Bundle. Compositions will often reference Lists as the focus of particular sections.

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

No references for this Resource.

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. Bundle NResourceContains 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 date
+ 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 history
+ 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 issues for documents has not been validated because the content will not be rendered in the document.
+ Rule: Self link is required for searchsets.
+ Rule: For collections of type document, message, searchset or collection, all entries must contain resources, and not have request or response elements
+ Rule: For collections of type history, all entries must contain request or response elements, and resources if the method is POST, PUT or PATCH
+ Rule: For collections of type transaction or batch, all entries must contain request elements, and resources if the method is POST, PUT or PATCH
+ Rule: For collections of type transaction-response or batch-response, all entries must contain response elements

Elements defined in Ancestors: id, meta, implicitRules, language
... identifier ΣC0..1IdentifierPersistent identifier for the bundle
... type ΣC1..1codedocument | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notification
Binding: Bundle Type (Required)
... timestamp ΣC0..1instantWhen the bundle was assembled
... link ΣC0..*BackboneElementLinks related to this Bundle

.... relation ΣC1..1codeSee http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1
Binding: Link Relation Types (Required)
.... url ΣC1..1uriReference details for the link
... entry ΣC0..*BackboneElementEntry in the bundle - will have a resource or information
+ Rule: must be a resource unless there's a request or response
+ 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
.... link Σ0..*see linkLinks related to this entry

.... fullUrl ΣC0..1uriURI for resource (e.g. the absolute URL server address, URI for UUID/OID, etc.)
.... resource ΣC0..1ResourceA resource in the bundle
.... search ΣC0..1BackboneElementSearch related information
..... mode Σ0..1codematch | include - why this is in the result set
Binding: Search Entry Mode (Required)
..... score Σ0..1decimalSearch ranking (between 0 and 1)
.... request ΣC0..1BackboneElementAdditional execution information (transaction/batch/history)
..... method ΣC1..1codeGET | HEAD | POST | PUT | DELETE | PATCH
Binding: H T T P Verb (Required)
..... url Σ1..1uriURL for HTTP equivalent of this entry
..... ifNoneMatch Σ0..1stringFor managing cache validation
..... ifModifiedSince Σ0..1instantFor managing cache currency
..... ifMatch Σ0..1stringFor managing update contention
..... ifNoneExist Σ0..1stringFor conditional creates
.... response ΣC0..1BackboneElementResults of execution (transaction/batch/history)
..... status Σ1..1stringStatus response code (text optional)
..... location Σ0..1uriThe location (if the operation returns a location)
..... etag Σ0..1stringThe Etag for the resource (if relevant)
..... lastModified Σ0..1instantServer's date time modified
..... outcome Σ0..1ResourceOperationOutcome with hints and warnings (for batch/transaction)
... signature ΣTU0..1SignatureDigital Signature
... issues ΣCTU0..1ResourceIssues with the Bundle

doco Documentation for this format icon

See the Extensions for this resource

UML Diagram (Legend)

Bundle (Resource)A persistent identifier for the bundle that won't change as a bundle is copied from server to serveridentifier : Identifier [0..1] « This element has or is affected by some invariantsC »Indicates the purpose of this bundle - how it is intended to be usedtype : code [1..1] « null (Strength=Required)BundleType! » « This element has or is affected by some invariantsC »The date/time that the bundle was assembled - i.e. when the resources were placed in the bundletimestamp : instant [0..1] « This element has or is affected by some invariantsC »If a set of search matches, this is the (potentially estimated) total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundletotal : unsignedInt [0..1] « This element has or is affected by some invariantsC »Digital Signature - base64 encoded. XML-DSig or a JWSsignature : Signature [0..1]Captures issues and warnings that relate to the construction of the Bundle and the content within itissues : Resource [0..1] « This element has or is affected by some invariantsC »LinkA name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1)relation : code [1..1] « null (Strength=Required)LinkRelationTypes! » « This element has or is affected by some invariantsC »The reference details for the linkurl : uri [1..1] « This element has or is affected by some invariantsC »EntryThe Absolute URL for the resource. Except for transactions and batches, each entry in a Bundle must have a fullUrl. The fullUrl SHALL NOT disagree with the id in the resource - i.e. if the fullUrl is not a urn:uuid, the URL shall be version-independent URL consistent with the Resource.id. The fullUrl is a version independent reference to the resource. Even when not required, fullUrl MAY be set to a urn:uuid to allow referencing entries in a transaction. The fullUrl can be an arbitrary URI and is not limited to urn:uuid, urn:oid, http, and https. The fullUrl element SHALL have a value except when: * invoking a create * invoking or responding to an operation where the body is not a single identified resource * invoking or returning the results of a search or history operationfullUrl : uri [0..1] « This element has or is affected by some invariantsC »The Resource for the entry. The purpose/meaning of the resource is determined by the Bundle.type. This is allowed to be a Parameters resource if and only if it is referenced by something else within the Bundle that provides context/meaningresource : Resource [0..1] « This element has or is affected by some invariantsC »SearchWhy this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search processmode : code [0..1] « null (Strength=Required)SearchEntryMode! »When searching, the server's search ranking score for the entryscore : decimal [0..1]RequestIn a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurredmethod : code [1..1] « null (Strength=Required)HTTPVerb! » « This element has or is affected by some invariantsC »The URL for this entry, relative to the root (the address to which the request is posted)url : uri [1..1]If the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread)ifNoneMatch : string [0..1]Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread)ifModifiedSince : instant [0..1]Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency)ifMatch : string [0..1]Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?")ifNoneExist : string [0..1]ResponseThe 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 codestatus : string [1..1]The location header created by processing this operation, populated if the operation returns a locationlocation : uri [0..1]The Etag for the resource, if the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency))etag : string [0..1]The date/time that the resource was modified on the serverlastModified : instant [0..1]An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transactionoutcome : Resource [0..1]A series of links that provide context to this bundlelink[0..*]A series of links that provide context to this entrylink[0..*]Information about the search process that lead to the creation of this entrysearch[0..1]Additional information about how this entry should be processed as part of a transaction or batch. For history, it shows how the entry was processed to create the version contained in the entryrequest[0..1]Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning historyresponse[0..1]An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only)entry[0..*]

XML Template

<Bundle xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <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>
  <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><!-- 0..1 Signature Digital Signature --></signature>
 <issues><!-- I 0..1 Resource Issues with the Bundle --></issues>
</Bundle>

JSON Template

{doco
  "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
    "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/> .doco


[ a fhir:Bundle;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root

  # from Resource: .id, .meta, .implicitRules, and .language
  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 from both R4 and R4B

Bundle
Bundle.type
  • Add code subscription-notification
Bundle.link.relation
  • Type changed from string to code
  • Add Binding `http://hl7.org/fhir/ValueSet/iana-link-relations|5.0.0` (required)
Bundle.issues
  • Added Element

See the Full Difference for further information

This analysis is available for R4 as XML or JSON and for R4B as XML or JSON.

See R4 <--> R5 Conversion Maps (status = See Conversions Summary.)

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. Bundle NResourceContains 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 date
+ 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 history
+ 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 issues for documents has not been validated because the content will not be rendered in the document.
+ Rule: Self link is required for searchsets.
+ Rule: For collections of type document, message, searchset or collection, all entries must contain resources, and not have request or response elements
+ Rule: For collections of type history, all entries must contain request or response elements, and resources if the method is POST, PUT or PATCH
+ Rule: For collections of type transaction or batch, all entries must contain request elements, and resources if the method is POST, PUT or PATCH
+ Rule: For collections of type transaction-response or batch-response, all entries must contain response elements

Elements defined in Ancestors: id, meta, implicitRules, language
... identifier ΣC0..1IdentifierPersistent identifier for the bundle
... type ΣC1..1codedocument | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notification
Binding: Bundle Type (Required)
... timestamp ΣC0..1instantWhen the bundle was assembled
... link ΣC0..*BackboneElementLinks related to this Bundle

.... relation ΣC1..1codeSee http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1
Binding: Link Relation Types (Required)
.... url ΣC1..1uriReference details for the link
... entry ΣC0..*BackboneElementEntry in the bundle - will have a resource or information
+ Rule: must be a resource unless there's a request or response
+ 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
.... link Σ0..*see linkLinks related to this entry

.... fullUrl ΣC0..1uriURI for resource (e.g. the absolute URL server address, URI for UUID/OID, etc.)
.... resource ΣC0..1ResourceA resource in the bundle
.... search ΣC0..1BackboneElementSearch related information
..... mode Σ0..1codematch | include - why this is in the result set
Binding: Search Entry Mode (Required)
..... score Σ0..1decimalSearch ranking (between 0 and 1)
.... request ΣC0..1BackboneElementAdditional execution information (transaction/batch/history)
..... method ΣC1..1codeGET | HEAD | POST | PUT | DELETE | PATCH
Binding: H T T P Verb (Required)
..... url Σ1..1uriURL for HTTP equivalent of this entry
..... ifNoneMatch Σ0..1stringFor managing cache validation
..... ifModifiedSince Σ0..1instantFor managing cache currency
..... ifMatch Σ0..1stringFor managing update contention
..... ifNoneExist Σ0..1stringFor conditional creates
.... response ΣC0..1BackboneElementResults of execution (transaction/batch/history)
..... status Σ1..1stringStatus response code (text optional)
..... location Σ0..1uriThe location (if the operation returns a location)
..... etag Σ0..1stringThe Etag for the resource (if relevant)
..... lastModified Σ0..1instantServer's date time modified
..... outcome Σ0..1ResourceOperationOutcome with hints and warnings (for batch/transaction)
... signature ΣTU0..1SignatureDigital Signature
... issues ΣCTU0..1ResourceIssues with the Bundle

doco Documentation for this format icon

See the Extensions for this resource

UML Diagram (Legend)

Bundle (Resource)A persistent identifier for the bundle that won't change as a bundle is copied from server to serveridentifier : Identifier [0..1] « This element has or is affected by some invariantsC »Indicates the purpose of this bundle - how it is intended to be usedtype : code [1..1] « null (Strength=Required)BundleType! » « This element has or is affected by some invariantsC »The date/time that the bundle was assembled - i.e. when the resources were placed in the bundletimestamp : instant [0..1] « This element has or is affected by some invariantsC »If a set of search matches, this is the (potentially estimated) total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundletotal : unsignedInt [0..1] « This element has or is affected by some invariantsC »Digital Signature - base64 encoded. XML-DSig or a JWSsignature : Signature [0..1]Captures issues and warnings that relate to the construction of the Bundle and the content within itissues : Resource [0..1] « This element has or is affected by some invariantsC »LinkA name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1)relation : code [1..1] « null (Strength=Required)LinkRelationTypes! » « This element has or is affected by some invariantsC »The reference details for the linkurl : uri [1..1] « This element has or is affected by some invariantsC »EntryThe Absolute URL for the resource. Except for transactions and batches, each entry in a Bundle must have a fullUrl. The fullUrl SHALL NOT disagree with the id in the resource - i.e. if the fullUrl is not a urn:uuid, the URL shall be version-independent URL consistent with the Resource.id. The fullUrl is a version independent reference to the resource. Even when not required, fullUrl MAY be set to a urn:uuid to allow referencing entries in a transaction. The fullUrl can be an arbitrary URI and is not limited to urn:uuid, urn:oid, http, and https. The fullUrl element SHALL have a value except when: * invoking a create * invoking or responding to an operation where the body is not a single identified resource * invoking or returning the results of a search or history operationfullUrl : uri [0..1] « This element has or is affected by some invariantsC »The Resource for the entry. The purpose/meaning of the resource is determined by the Bundle.type. This is allowed to be a Parameters resource if and only if it is referenced by something else within the Bundle that provides context/meaningresource : Resource [0..1] « This element has or is affected by some invariantsC »SearchWhy this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search processmode : code [0..1] « null (Strength=Required)SearchEntryMode! »When searching, the server's search ranking score for the entryscore : decimal [0..1]RequestIn a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurredmethod : code [1..1] « null (Strength=Required)HTTPVerb! » « This element has or is affected by some invariantsC »The URL for this entry, relative to the root (the address to which the request is posted)url : uri [1..1]If the ETag values match, return a 304 Not Modified status. See the API documentation for ["Conditional Read"](http.html#cread)ifNoneMatch : string [0..1]Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread)ifModifiedSince : instant [0..1]Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency)ifMatch : string [0..1]Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?")ifNoneExist : string [0..1]ResponseThe 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 codestatus : string [1..1]The location header created by processing this operation, populated if the operation returns a locationlocation : uri [0..1]The Etag for the resource, if the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency))etag : string [0..1]The date/time that the resource was modified on the serverlastModified : instant [0..1]An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transactionoutcome : Resource [0..1]A series of links that provide context to this bundlelink[0..*]A series of links that provide context to this entrylink[0..*]Information about the search process that lead to the creation of this entrysearch[0..1]Additional information about how this entry should be processed as part of a transaction or batch. For history, it shows how the entry was processed to create the version contained in the entryrequest[0..1]Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning historyresponse[0..1]An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only)entry[0..*]

XML Template

<Bundle xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <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>
  <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><!-- 0..1 Signature Digital Signature --></signature>
 <issues><!-- I 0..1 Resource Issues with the Bundle --></issues>
</Bundle>

JSON Template

{doco
  "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
    "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/> .doco


[ a fhir:Bundle;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root

  # from Resource: .id, .meta, .implicitRules, and .language
  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 from both R4 and R4B

Bundle
Bundle.type
  • Add code subscription-notification
Bundle.link.relation
  • Type changed from string to code
  • Add Binding `http://hl7.org/fhir/ValueSet/iana-link-relations|5.0.0` (required)
Bundle.issues
  • Added Element

See the Full Difference for further information

This analysis is available for R4 as XML or JSON and for R4B as XML or JSON.

See R4 <--> R5 Conversion Maps (status = See Conversions Summary.)

 

Additional definitions: Master Definition XML + JSON, XML Schema/Schematron + JSON Schema, ShEx (for Turtle) , the spreadsheet version & the dependency analysis

PathValueSetTypeDocumentation
Bundle.type BundleType Required

Indicates the purpose of a bundle - how it is intended to be used.

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 requirement, or to convey information or warning information about the search process.

Bundle.entry.request.method HTTPVerb Required

HTTP verbs (in the HTTP command line). See HTTP rfc icon for details.

UniqueKeyLevelLocationDescriptionExpression
img bdl-1Rule (base)total only when a search or historytotal.empty() or (type = 'searchset') or (type = 'history')
img bdl-2Rule (base)entry.search only when a search(type = 'searchset') or entry.search.empty()
img bdl-5Rule Bundle.entrymust be a resource unless there's a request or responseresource.exists() or request.exists() or response.exists()
img bdl-7Rule (base)FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId (except in history bundles)(type = 'history') or entry.where(fullUrl.exists()).select(fullUrl&iif(resource.meta.versionId.exists(), resource.meta.versionId, '')).isDistinct()
img bdl-8Rule Bundle.entryfullUrl cannot be a version specific referencefullUrl.exists() implies fullUrl.contains('/_history/').not()
img bdl-9Rule (base)A document must have an identifier with a system and a valuetype = 'document' implies (identifier.system.exists() and identifier.value.exists())
img bdl-10Rule (base)A document must have a datetype = 'document' implies (timestamp.hasValue())
img bdl-11Rule (base)A document must have a Composition as the first resourcetype = 'document' implies entry.first().resource.is(Composition)
img bdl-12Rule (base)A message must have a MessageHeader as the first resourcetype = 'message' implies entry.first().resource.is(MessageHeader)
img bdl-13Rule (base)A subscription-notification must have a SubscriptionStatus as the first resourcetype = 'subscription-notification' implies entry.first().resource.is(SubscriptionStatus)
img bdl-14Rule (base)entry.request.method PATCH not allowed for historytype = 'history' implies entry.request.method != 'PATCH'
img bdl-15Rule (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 populatedtype='transaction' or type='transaction-response' or type='batch' or type='batch-response' or entry.all(fullUrl.exists() or request.method='POST')
img bdl-16Rule (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')
img bdl-17Rule (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()
img bdl-18Rule (base)Self link is required for searchsets.type = 'searchset' implies link.where(relation = 'self' and url.exists()).exists()
img bdl-3aRule (base)For collections of type document, message, searchset or collection, all entries must contain resources, and not have request or response elementstype in ('document' | 'message' | 'searchset' | 'collection') implies entry.all(resource.exists() and request.empty() and response.empty())
img bdl-3bRule (base)For collections of type history, all entries must contain request or response elements, and resources if the method is POST, PUT or PATCHtype = 'history' implies entry.all(request.exists() and response.exists() and ((request.method in ('POST' | 'PATCH' | 'PUT')) = resource.exists()))
img bdl-3cRule (base)For collections of type transaction or batch, all entries must contain request elements, and resources if the method is POST, PUT or PATCHtype in ('transaction' | 'batch') implies entry.all(request.method.exists() and ((request.method in ('POST' | 'PATCH' | 'PUT')) = resource.exists()))
img bdl-3dRule (base)For collections of type transaction-response or batch-response, all entries must contain response elementstype in ('transaction-response' | 'batch-response') implies entry.all(response.exists())

  • Conceptually, a bundle is a list of resources with some context (named links, and status on the entries)
  • Since a Bundle is itself a Resource it has the same common metadata as all resources, including profile assertions, tags, and security labels. Note that the values in Bundle.meta.security will generally be influenced by the meta.security values of the entries within the Bundle; see http://hl7.org/fhir/security.html
  • Although there are no extensions on the Bundle itself, link, entry, and search/request/response can all have extensions. See Patient and Location for examples on search
  • Both Bundle.link and Bundle.entry.link are defined to support providing additional context when Bundles are used (e.g. HATEOAS icon). 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
  • Bundles have both .id and .identifier - see Resource Identities for further information

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 contains a resource. See Documents for further information.

Example

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

Example Request and Response

A set of search results (type = "searchset") consists of a series of 0 or more entries. Each entry element 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:

  • search.mode: An indication of whether the resource is in the search set because it matched the search criteria or whether it is included because another resource refers to it (e.g. by the _include parameter)
  • search.score: The server's search ranking score for the entry. Servers are not required to return a ranking score, but if they do, 1 is most relevant, and 0 is least relevant. Note: often, search results are sorted by score, but the client may specify a different sort order (see Search Relevance)

Example

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, 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, 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 contains a request element has the details of an HTTP operation that informs the system processing the transaction what to do with the entry. If the entry method is a 'PUT', 'PATCH' or 'POST', then the entry contains a resource that becomes the body of the HTTP operation. See Transactions for further information.

Example

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 contains a response element which indicates the outcome of the HTTP operation that the server performed for the entry.

Example

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 contains a resource.

Example

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.

Examples

Except for transactions and batches, each entry in a Bundle 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 SHALL be used in fullUrl (urn:uuid:...).

For transactions and batches, entries 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 when entry.request.method = POST so that relationships between resources can be represented (see Transactions).

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

Note that the meaning of an unversioned reference to a resource that appears multiple times is potentially ambiguous, though processors may have additional 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 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")

  • Look for an entry with a fullUrl that matches the reference.value
  • If one is found, the resolution succeeds (and ends) here
  • Otherwise, the resolution fails (and ends) here. The reference has no defined meaning within this specification.

Resolving absolute references. If the reference.value is an absolute URL (e.g., "https://fhir.example.org/base/Patient/123", "https://fhir.example.org/base/Patient/123/_history/a"):

  • If the reference.value is versionless (i.e. it has no "/_history/" path segment - e.g. "https://fhir.example.org/base/Patient/123"):
    • Look for an entry with a fullUrl that matches the reference.value
    • If one is found, the resolution succeeds (and ends) here
    • If more than one is found, the server MAY look for the most recent version (based on meta.lastUpdated). If it is able to find exactly one most recent this way, the resolution succeeds (and ends) here
  • If the reference.value includes a "_history" path segment (e.g. "https://fhir.example.org/base/Patient/123/_history/a"), split the value into two parts: a versionless reference (e.g. "https://fhir.example.org/base/Patient/123" and a version id (e.g. "a")
    • Look for an entry with a fullUrl that matches the versionless reference and a resource.meta.versionId that matches the reference's version id.
    • If a single record is found, the resolution succeeds (and ends) here.
    • If multiple records are found, it is an error.
  • Optionally, attempt to resolve the URI if possible (e.g. by issuing a FHIR [read] on an https URL if not version-specific or a [vread] it the URL is version-specific).
    • If found, the resolution succeeds (and ends) here.
    • Otherwise, the resolution fails (and ends) here. The reference has no defined meaning within this specification.

Resolving relative references against a RESTful base. If the reference.value is of the form "[type]/[id]" (e.g., "Patient/123"):

  • If the Bundle entry containing the reference has a fullUrl matching the RESTful URL regex (e.g., "https://fhir.example.org/Observation/456"):
    • Extract the [root] from the Bundle entry's fullUrl and append the relative reference to it (e.g., "https://fhir.example.org/" + "Patient/123" --> "https://fhir.example.org/Patient/123")
    • Follow the steps for Resolving absolute references above
  • If the Bundle entry containing the reference does not have a fullUrl that matches the [RESTful URL regex] and the Bundle is a batch or transaction and the entry.request.method is POST, PUT or PATCH
    • take the base URL of the server that is the target of the batch/transaction and append the relative reference to it (e.g., transaction is being posted to "https://fhir.somewhere.org", then the expanded reference would be "https://fhir.somewhere.org/Patient/123"
    • Follow the steps for Resolving absolute references above

Resolving conditional references. If the reference occurs in a transaction Bundle and the reference.value is a conditional reference (e.g. "http://example.org/base/Patient?identifier=1234"):

  • Perform the [search] specified in the conditional reference on the server.
    • If the search succeeds with a single resource, the resolution succeeds (and ends) here.
    • If the search succeeds with multiple matching resources, resolution fails (and ends) here. An error SHOULD be raised.
  • Otherwise the resolution fails (and ends) here.

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

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 that demonstrates these 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.

NameTypeDescriptionExpressionIn Common
compositionreferenceThe first resource in the bundle, if the bundle type is "document" - this is a composition, and this parameter provides access to search its contentsBundle.entry[0].resource as Composition
identifiertokenPersistent identifier for the bundleBundle.identifier
messagereferenceThe first resource in the bundle, if the bundle type is "message" - this is a message header, and this parameter provides access to search its contentsBundle.entry[0].resource as MessageHeader
timestampdateWhen the bundle was assembledBundle.timestamp
typetokendocument | message | transaction | transaction-response | batch | batch-response | history | searchset | collection | subscription-notificationBundle.type