Batch/Transaction
Do multiple operations in one call
Introduction
Transaction interaction allows performing several interactions using one http request. There are two types of transaction interaction (type is specified by field type
): batch and transaction. The first one just executes requests one by one, the second one does the same, but roll backs all changes if any request fails.
The body of such request contains one resource of type Bundle, which contains field entry with an array of interactions, for example: \
Each element of the entry array contains a resource field (body of the request) and a request field (request line in terms of the HTTP request).
Processing rules and Conditional refs
Transaction interaction is processed in the order provided in a bundle, each interaction is executed one by one. It differs from the FHIR transaction processing rules.
For type: batch
references to resources inside a bundle won't be resolved.
For type: transaction
before processing interactions, all references in a resource will attempt to resolve. In this example ProcedureRequest will refer to a newly created patient:
You can provide a full Url with value like "urn:<uuid-here>"
and reference to the resource created by such interaction using ref: {uri: "urn:<uuid-here>"}
. Those references are temporary and will be translated to valid Aidbox references when interaction entry is processed by a server.
You SHALL NOT refer resource, which is created later using conditional operations!
Multiple resources with the same id
If you have multiple entries with the same resource id, aidbox will execute them one by one and thus you are able to create a resource with a history in within a single transaction:
Last updated