Making requests to a HAPI server (or ideally any “reasonable” server with FHIR R4) I want to POST an Observation (or something) to a Patient I don’t yet know the id of. I do know its identifier, though, and now want in one transaction to both use this identifier to find the Patient and POST an Observation with the search result as its subject. If the search failed (Patiens doesn’t exist), the whole transaction should fail.
Kind of like…
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"fullUrl": "urn:uuid:a6147ef2-343c-4024-a625-448f8315bb4b",
"request": {
"method": "POST",
"ifNoneExist": "identifier=http://example.org/patient|10"
},
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "http://example.org/patient",
"value": "10"
}
]
}
},
{
"request": {
"method": "POST"
},
"resource": {
"resourceType": "Observation",
"subject": {
"reference": "urn:uuid:a6147ef2-343c-4024-a625-448f8315bb4b"
},
"status": "final"
}
}
]
}
…but with kind-of-GET instead of POST, as this example transaction could inadvertently create a Patient and/or could fail just because the user doesn’t have POST-rights for Patients. (Though, GET returns a search result bundle and not a single resource, which wouldn’t help here.)
Is this possible or do I have to do two requests (first a GET, then the transaction)?
I don’t want to use logical references in the Observation as they don’t seem to be considered when requesting $everything of a Patient.