Stream: hapi
Topic: Conditional FHIR Patch
Dexter (Mar 17 2021 at 13:52):
Does FHIRPatch or JSON Patch in a Bundle support conditional patch, like create, using If-None-Exist
as a standalone request and as a part of a transaction (ifNoneMatch
)?
Dexter (Mar 18 2021 at 06:45):
What I'm trying to do is, patch a Group
resource to add few practitioners, but only if these practitioners aren't already members of an existing group. I've tried this, and it doesn't work
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"resource": {
"resourceType": "Binary",
"contentType": "application/json-patch+json",
"data": "base64(patch doc below)"
},
"request": {
"method": "PATCH",
"url": "Group/48",
"ifNoneExist": "member=3,1,26"
}
}
]
}
Patch doc
[
{
"op": "add",
"path": "/member",
"value": []
},
{
"op": "add",
"path": "/member/-",
"value": {
"entity": {
"reference": "Practitioner/1",
"type": "Practitioner"
},
"inactive": false
}
},
// and so on
]
Dexter (Mar 18 2021 at 06:58):
I don't think it does, what are my options?
Eric Prud'hommeaux (Mar 18 2021 at 07:00):
This seems to call for the same additional expressivity as https://chat.fhir.org/#narrow/stream/179167-hapi/topic/PATCH.20a.20List
Eric Prud'hommeaux (Mar 18 2021 at 07:02):
i.e. both want the ability to apply a patch (do delete in that case, don't add in your case) depending on the results of a match against the existing contents
Last updated: Apr 12 2022 at 19:14 UTC