Bundle
Please start a discussion or contact us if you have questions, feedback, or suggestions.
The Bundle resource is a resource which groups multiple resources in one. It is important to differentiate Bundle resource and operation which take or return Bundles.
Let's look at some operations working with Bundle resources.
POST /fhir,POST /
Main article: Transactions.
This operation accepts Bundle resource (with type batch or transaction); executes contained requests; then returns Bundle resource in response (with type batch-response or transaction-response).
OperationPOST /fhiraccepts and returns Bundle in FHIR format; operationPOST /accepts and returns Bundle in Aidbox format.GET /fhir/<resourceType>,GET /<resourceType>
Main article: fhir-search
This operation searches for resource of typeresourceTypeusing search parameters provided in query string, and returns Bundle resource (with typesearchset) containing all resources matching the given filters.GET /fhir/<resourceType>/<id>/_history,GET /<resourceType>/<id>/_history
Main article: history.md
This operation returns the Bundle resource (with typehistory) containing previous versions of the specified resource.- CRUD operations with Bundle resource
Main article: crud
These are the usual FHIR CRUD operations with Bundle resource. They only store/update/get/search Bundle resources without additional semantics.
These operations are rarely used.
Examples:POST /fhir/Bundle,GET /fhir/Bundle,GET /fhir/Bundle/<id>,
PUT /fhir/Bundle/<id>,POST /Bundle,GET /Bundle,GET /Bundle/<id>,PUT /Bundle
See more about the difference between FHIR and Aidbox formats (/fhir/... and /... endpoints) in the aidbox-and-fhir-formats.md page.
To turn off the Aidbox format API, set BOX_FHIR_AIDBOX_FORMAT_API_ENABLED to false. See Turn off the Aidbox format API.
POST /fhir, POST / endpoint
Aidbox supports FHIR batch and transaction interactions, as well as some additional options to this endpoint.
Same as with other endpoint, POST /fhir accepts and returns Bundle in FHIR format,
while POST / accepts and returns Bundle in Aidbox format.
POST /fhir
content-type: text/yaml
accept: text/yaml
resourceType: Bundle
type: <type>
...
Use the Prefer header to control the response size of a batch or transaction request.
Behavior of the endpoint depends on the type of a bundle resource provided in a request body.
Supported type values:
transaction
Executes provided rest requests in a transaction.
In case of an entry execution error the whole transaction is rolled back and the error is returned in the response.
Returnstransaction-responsetype bundle.batch
Executes provided rest requests, execution doesn't stop on error, all results and errors are returned in the response.
Returnsbatch-responsetype bundle.collection
Works the same way as thebatchtype, but doesPUT /<resourceType>/<id>for each resource in entry.
Returnsbatch-responsetype bundle.
Validate Bundle
To validate bundle without storing it content, use Bundle/$validate operation.
POST /fhir/Bundle/$validate
content-type: application/json
accept: application/json
{
"resourceType": "Bundle",
"type": "message",
// ...
}