Open evbaron opened 3 years ago
I believe conditional update is implemented as according to https://www.hl7.org/fhir/http.html#cond-update (and I think it should work from a bundle).
In your sample request, you have:
"request": {
"method": "PUT",
"url":"Patient/a441",
"ifNoneMatch": "_id=a441"
},
But ifNoneMatch is not defined for updates. If you intend to use the spec-defined conditional update support, try something like this instead:
"request": {
"method": "PUT",
"url":"Patient?_id=a441"
},
With that said, we do have a separate issue, #2050 which proposes to add special ifNoneMatch support for updates and I agree it would be good to extend that support to include PUTs within bundles. If the above suggestion works for you, then maybe just add a comment there and we can close this one?
I wonder if we could/should add a warning to the output when a user sets one of these Bundle.entry.request fields (ifNoneMatch
, ifModifiedSince
, ifMatch
, or ifNoneExist
) on a request method that doesn't support that...
Probably using the table from https://www.hl7.org/fhir/http.html#summary (except for the special case that we want to support in #2050).
I wonder if we could/should add a warning to the output when a user sets one of these Bundle.entry.request fields (ifNoneMatch, ifModifiedSince, ifMatch, or ifNoneExist) on a request method that doesn't support that...
team decision: lets cover this scenario (setting these values for requests where they aren't supported) in the documentation (Conformance.md) and then close this one. we should point to https://www.hl7.org/fhir/http.html#summary
Issue #2050 implements If-None-Match support for PUT within bundles. If the resource exists, the response will be 304 Not Modified.
Although Conformance.md documents how we handle If-None-Match, it would be useful to add a summary table to provide a clear description of what is/isn't supported and the behavior of the various ifXX fields.
https://linuxforhealth.github.io/FHIR/Conformance/#http-headers does link to https://hl7.org/fhir/R4B/http.html#summary which lists various headers. Its somewhat typical for us to document our deviations from the specification without repeating all of the information in the spec.
@punktilious In my opinion this is good enough for this one. Unless you're planning to add some additional documentation here I think we can close it out. Let me know.
Is your feature request related to a problem? Please describe. It seems like "POST" "IfNoneExist" is supported, but the conditional PUT is not working. We tried "ifNoneExist" and "ifNoneMatch" and it is being ignored.
Request to Implement conditional PUT.
Describe the solution you'd like Simple example:
Expected: result to be returned (similar to POST with IfNoneExist) 200- OK (where resource was not updated because it is already exist) 201 -resource created
Currently resource is always being updated and version incremented.
Describe alternatives you've considered We have considered POST with IfNoneExist (which would do the same thing) BUT it will overwrite resource.id and we need to preserve resource.id from the original.
Acceptance Criteria One of the acceptance criteria would be to make sure that even for conditional updates, the local url resolution is still working. It doesn't seem like it is working on the POST/IfNoneExist.
GIVEN [a precondition] AND [another precondition] WHEN [test step] AND [test step] THEN [verification step] AND [verification step]
Additional context Add any other context or screenshots about the feature request here.