Stream: implementers
Topic: Location header on conditional create
Valentinas Janeiko (Apr 23 2021 at 10:41):
Hello everyone,
I was looking for a way to do GET or CREATE operation with FHIR. I was thinking of getting Ids of resources that I created in a batch of conditional creates. I wanted to use Location header (property in entry.response
), but it seems this is only returned if resource has been created. If there was an existing resource, only 200 OK is returned (as specified in the spec). So, I was wondering, is there any reason Location
, ETag
, LastModified
are not returned in the case resource already exists?
And also, it would make sense if Conditional Create would interact with Prefer header (https://www.hl7.org/fhir/http.html#ops) even if resource was not created. My thinking is, server had to perform the search to resolve the condition already, so there is little overhead in returning the headers/resource back to the client.
What are your thoughts on extending the spec in this way? Instead of the current: "One Match: The server ignores the post and returns 200 OK", do something among the lines of: "One Match: The server returns the result of the search on the condition"?
Michele Mottini (Apr 23 2021 at 12:52):
If I read the specs right all that stuff is now normative and cannot be changed any more
Lloyd McKenzie (Apr 23 2021 at 13:36):
Conditional create isn't normative. So we could indeed set an expectation for the Location header to come back with the 200 ok response. Can you submit a change request @Valentinas Janeiko? We could probably get this done in R5 - and you could pre-adopt it in R4.
Valentinas Janeiko (Apr 23 2021 at 14:15):
@Lloyd McKenzie How do I submit the change request? Is it just a PR in some repo?
Lloyd McKenzie (Apr 23 2021 at 14:21):
At the bottom of every page in the spec there's a "propose a change" link. You'll have to register (free) and there's a manual process where someone checks to make sure you look like a real human being. After that, submit proposed changes to your heart's content. You could accompany your change request with a PR, but this sort of thing would probably involve some debate around language, so a PR probably wouldn't be super helpful. (And we don't expect most commenters to have any clue how to do a PR or interpret our source.)
Valentinas Janeiko (Apr 23 2021 at 19:25):
I've submitted a change request: https://jira.hl7.org/browse/FHIR-31965
Paul Church (Apr 26 2021 at 14:40):
We already return Location in the Google implementation. It seemed useful.
Brendan Kowitz (Apr 26 2021 at 17:06):
This is a good suggestion, since the work is already done to do the lookup
Last updated: Apr 12 2022 at 19:14 UTC