LinuxForHealth / FHIR

The LinuxForHealth FHIR® Server and related projects

Home Page:https://linuxforhealth.github.io/FHIR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FHIR Server replaces id with a generated one in the request body

renom opened this issue · comments

Describe the bug
It's impossible to create a resource with a specific id. The server still generates an id and replaces the provided one with it.

Environment
Arch Linux & Docker & FHIR Server 5.1.0

To Reproduce
Create a resource (POST request) with the "id" field value specified in the body.

Expected behavior
The server should allow creating resources with an id provided by the client.

This is working as designed. The only way to create a resource with a user-specified id is to use HTTP PUT.

From https://www.hl7.org/fhir/http.html#create

The resource does not need to have an id element (this is one of the few cases where a resource exists without an id element). If an id is provided, the server SHALL ignore it.

Hi @lmsurpre, thanks for the answer. I was a bit confused with a different fhir server implementation, now we're transferring to LinuxForHealth FHIR Server and in a few cases our old server doesn't follow the specification as it turned out.