Stream: implementers
Topic: JSON Patch
Ramesh jarabana (Jul 07 2020 at 06:09):
Does FHIR bundle will support JSon Patch in Bundle transaction ?
[
{
"op": "replace",
"path": "/status",
"value": "in-progress"
}
]
Lloyd McKenzie (Jul 07 2020 at 14:06):
I believe the answer to that is 'no' - if you're using Bundle, you must use a FHIRPath Patch Parameters resource. However, it would be good for us to make that explicit. Can you submit a change request @Ramesh jarabana? (Just click on the 'propose a change' link at the bottom of any page in the spec.)
Ivan Dubrov (Jul 07 2020 at 17:29):
Alternatively, FHIR could propose a packaging format for JSON patch that will fit into Bundle (as the restriction that you cannot use JSON patch in a transaction looks arbitrary to me, and FHIR patch could be harder to implement).
In our implementation, we also expose JSON patch as an extended operation that takes the whole patch as a string, which makes it possible to pass it via Bundle with little changes (alternative solution would be to map the whole JSON patch to parameters, but that would require clients to do transformation from JSON patch into Parameters).
Lloyd McKenzie (Jul 07 2020 at 18:18):
I think FHIRPath is our proposed packaging format. I don't understand why we'd create another one that's JSON-specific.
Ivan Dubrov (Jul 07 2020 at 19:17):
Mostly because JSON Patch is an industry standard (https://tools.ietf.org/html/rfc6902).
Since FHIR specification already supports JSON Patch (here: https://www.hl7.org/fhir/http.html#patch) and supporting it inside transaction (bundle) is a minor change, from an implementation side (assuming your implementation already supports JSON Patch), it looks logical to me to also specify how JSON Patch could be used inside a bundle. Also, arguably, FHIR Path-based patch is a bit harder to implement as it needs to know FHIR semantics, so JSON Patch might be an alternative for simpler, JSON-only, implementations.
Lloyd McKenzie (Jul 07 2020 at 19:46):
It's not a minor change - you can't include JSON in a Bundle unless that JSON is defined by a resource
Lloyd McKenzie (Jul 07 2020 at 19:47):
Also every Bundle must be translatable from JSON to XML to RDF and back
Ivan Dubrov (Jul 07 2020 at 21:24):
I'm not proposing to include JSON Patch as JSON; as I suggested above, it could be either a stringified JSON (which, arguably, not a best way to pass JSON, but on the other hand, something that is easy to do on both sides) or it could be mechanically mapped to Parameters
resource (more work on the client, though, which sort of begs the question why not FHIR Path at this point).
Grahame Grieve (Jul 07 2020 at 22:16):
we could use the Binary resource to actually contain it
Last updated: Apr 12 2022 at 19:14 UTC