Developers work with FHIR bundles all the time, often without realizing.
SDKs hide them from us.
Some bundles are created on-the-fly. Others are saved to the FHIR server just like regular resources. You need to know the difference.
Here are 5 temporary bundle types.
transaction
A collection of connected resources sent to the FHIR server. Similar to a database transaction, it’s all or nothing — either all resources in the bundle are created or updated successfully, or the transaction fails.
searchset
A bundle of resources returned by the server in response to a search query. Every time we query the FHIR server we get a searchset bundle back. If there are no results it’s an empty bundle. If there are a lot of results, we can expect pagination links in the bundle.
history
A history bundle is returned in response to a query that calls the _history endpoint. As with searchset, the bundle can contain 0 or many resources, all different versions of the same requested resource.
batch
A set of unconnected FHIR queries. Batch bundles can contain GET requests as well as POST and PUT requests, and are a useful way to ‘batch’ requests to the FHIR server.
message
Traditional messaging using FHIR bundles. The client sends a message bundle where the first resource type is MessageHeader. The server sends a message bundle back either synchronously or asynchronously.
More about messaging using FHIR bundles.
Here are 2 bundle types that are saved to the FHIR server.
collection
A bundle that contains a set of FHIR resources. There’s little guidance on when to use a collection bundle — the use case is very much left to the user. Use with care!
document
FHIR Documents are saved as a Bundle resource of type document. The first resource must be a Composition resource. Subsequent resources in the bundle make up the rest of the Document.
More about the Bundle resource.
---