microsoft / microsoft/fhir-server

Prefer: return=representation not respected

Open
#2,431 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement Specification Up for grabs
Dominant language
TSQL
Stars
1.4k
Forks
592
Avg merge
2d 7h
Merged PRs (30d)
41

Description

When I send a HTTP POST request to `/Patient` with a `If-None-Exist` and `Prefer: return=representation` headers then the current server implementation doesn't return me an existing patient in the response. The server only responds with a `200 OK` and an empty HTTP body, but my understanding is that I should get back the entire Patient resource as well.

I am using the official .NET FHIR client which has support for a [conditional create](https://docs.fire.ly/projects/Firely-NET-SDK/client/crud.html?highlight=Create#conditional-interactions) which is supposed to do exactly that according to the FHIR spec. It seems the microsoft fhir server doesn't implement this correctly at the moment.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the server's conditional-create handling for POST /Patient and compare the existing-resource response when Prefer: return=representation is present with the FHIR behavior described. Trace the request through the relevant endpoint handling and verify that an existing Patient is returned in the HTTP response body rather than only a 200 OK status.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.