FHIR Chat · conditional read can't deal with 304 Not modified · dotnet

Stream: dotnet

Topic: conditional read can't deal with 304 Not modified


view this post on Zulip Theo Stolker (Jun 27 2017 at 10:34):

This is almost certianly a bug in the FHIR .NET API. I make the following call:

            string ifNoneMatch = "2017-06-26T15:12:34:477.3440";
            DateTimeOffset modified = DateTimeOffset.Parse("2017/06/26 15:12:34");

            Patient p = client.Read<Patient>("Patient/40", ifNoneMatch, modified);

The server returns a 304 Not Modified status code as documented here: https://www.hl7.org/fhir/http.html#cread:
Clients may use the If-Modified-Since, or If-None-Match HTTP header on a read request. If so, they SHALL accept either a 304 Not Modified as a valid status code on the response (which means that the content is unchanged since that date) or full content (either the content has changed, or the server does not support conditional request).

The exception thrown by the Fhirclient is: "Server returned a status code 'NotModified', which is not supported by the FhirClient".
Based on the spec, that seems wrong.

In a more general sense, it would be good that any error in the 300 and 400 ranges is always returned to the caller in a more transparant way.

view this post on Zulip Ewout Kramer (Jun 27 2017 at 13:40):

Hi Theo, I see you have reported both on the .NET API bug tracker (https://github.com/ewoutkramer/fhir-net-api/issues), thanks!


Last updated: Apr 12 2022 at 19:14 UTC