Have you looked into the batch/transaction interaction?
The batch
and transaction
interactions submit a set of actions to perform on a server in a single HTTP request/response. The actions may be performed independently as a "batch", or as a single atomic "transaction" where the entire set of changes succeed or fail as a single entity.
A batch
or transaction
interaction is performed by an HTTP POST
command as shown:
POST [base] {?_format=[mime-type]}
Here is an example of a POST
request for meds and allergies:
{
"resourceType": "Bundle",
"id": "bundle-request-medsallergies",
"type": "batch",
"entry": [
{
"request": {
"method": "GET",
"url": "/Patient/example"
}
},
{
"request": {
"method": "GET",
"url": "/MedicationStatement?patient=example&_list=$current-medications"
}
},
{
"request": {
"method": "GET",
"url": "/AllergyIntolerance?patient=example&_list=$current-allergies"
}
},
{
"request": {
"method": "GET",
"url": "/Condition?patient=example&_list=$current-problems"
}
},
{
"request": {
"method": "GET",
"url": "/MedicationStatement?patient=example¬given:not=true"
}
}
]
}