FHIR Chat · fhirClient versioning · implementers

Stream: implementers

Topic: fhirClient versioning


view this post on Zulip Trond Klakken (Sep 26 2019 at 08:22):

Hi! I'm trying to post R4 fhir objects to our Vonk server, and to get vonk to identify it as R4 object, I have to add ; fhirVersion=4.0 to the accept or contentType headers (https://www.hl7.org/fhir/http.html#version-parameter).

I was hoping the R4 FhirClient for C# (https://github.com/FirelyTeam/fhir-net-api) would do this, but after inspection, it does not set the headers.
Is there any way of getting the FhirClient to post fhirVersion without this ugly hack:

FhirClient.OnBeforeRequest += (sender, args) => { args.RawRequest.Accept = args.RawRequest.Accept + "; fhirVersion=4.0"; args.RawRequest.ContentType = args.RawRequest.ContentType + "; fhirVersion=4.0"; };

Headers without hack:

{
  "content-length": "450",
  "user-agent": ".NET FhirClient for FHIR 4.0.0",
  "prefer": "return=representation",
  "accept": "application/fhir+xml; charset=utf-8",
  "content-type": "application/fhir+xml; charset=utf-8"
}

Thanks!

view this post on Zulip Michele Mottini (Sep 26 2019 at 12:35):

Seems a bug in the server? Specifying the version is optional. Or is it an end point that supports multiple versions?

view this post on Zulip Michel Rutten (Sep 26 2019 at 12:38):

Correct, Vonk R4 release supports multi-version endpoints. Requests can specify version header (default STU3). Looks like we still need to integrate this logic into the FhirClient class.

view this post on Zulip Trond Klakken (Sep 26 2019 at 12:39):

Well, this works for now, just writing it a little bit prettier then above :)

view this post on Zulip Richard Ettema (Sep 26 2019 at 21:04):

Question - does the Vonk server support configuration to set the default FHIR version to R4?

view this post on Zulip Trond Klakken (Sep 27 2019 at 10:48):

@Richard Ettema not at this time. So you have to use multiple versions: http://docs.simplifier.net/vonk/features/multiversion.html

view this post on Zulip Mirjam Baltus (Sep 27 2019 at 11:11):

In our next release we will implement version specific endpoints, so you don't need to use the fhirVersion parameter anymore.

view this post on Zulip Trond Klakken (Sep 30 2019 at 08:48):

@Mirjam Baltus nice!

view this post on Zulip Ward Weistra (Sep 30 2019 at 09:46):

@Mirjam Baltus Just out of curiosity, will both options (one endpoint for both versions with version header AND version specific endpoints) be there in next release? Since I saw some people already implementing the FHIR version header.

view this post on Zulip Mirjam Baltus (Sep 30 2019 at 11:59):

Yes, we will keep supporting the current way of running Vonk on one endpoint and using the fhirVersion parameter too. As far as I know, both will work out of the box without having to configure your preference. We are also working on a configuration option to be able to set R4 as the default.


Last updated: Apr 12 2022 at 19:14 UTC