FHIR Chat · Conditional delete 0 matches case · implementers

Stream: implementers

Topic: Conditional delete 0 matches case


view this post on Zulip Andrew Tropin (Oct 22 2018 at 14:53):

https://www.hl7.org/fhir/http.html#2.21.0.13.1

No matches or One Match: The server performs an ordinary delete on the matching resource

What does it mean to do ordinary delete for No matches? As I understand, ordinary delete can be done only by resource id. No matches - no id.

view this post on Zulip Andrew Tropin (Oct 22 2018 at 15:50):

Checked reference fhir server implementation.

Conditional delete:
1. Search returns 0 resources (no such resource) | server respond with 404
2. Search returns 0 resources (resource was deleted) | server respond with 404
3. Search returns 1 resource (resource exists) | server respond with 204

Delete:
1. invalid id (no such resource) | server respond with 404
2. valid id (resource was deleted) | server respond with 204
3. valid id (resource exists) | server respond with 204

I think that delete MUST return 404 to be consistent with conditional delete.

I didn't find any recommendations about status code for case #2 for delete operation in http rfc.
Also 204 for second case makes it indistinguishable from third case.

The only thing I found is idempotence property:

Methods can also have the property of "idempotence" in that (aside
from error or expiration issues) the side-effects of N > 0 identical
requests is the same as for a single request. The methods GET, HEAD,
PUT and DELETE share this property.
It tells, that side-effect (deletion of resource performed ones),
but doesn't tell anything about response code, as I understand it can vary.

And last point: how server can respond with 204 on consequent delete if it doesn't support versioning of resources and performs actual delete?

Why such decision was made (responde with 204 on consequent delete)? @Grahame Grieve @Lloyd McKenzie
I need clarification for deeper understanding to make our implementation of fhir server better.

view this post on Zulip Grahame Grieve (Oct 22 2018 at 19:01):

well, I guess our intent is that if there's no resources that match the id, then delete is assumed to true, like if there's a single match. so should return a 200/202/204. can you make a gForge to clarify that - it's not clear


Last updated: Apr 12 2022 at 19:14 UTC