Stream: implementers
Topic: How should a FHIR server report version?
John Silva (Nov 08 2019 at 16:11):
Sorry if this is an FAQ ...
How is a FHIR Server supposed to report the version of FHIR it supports, e.g. should an STU3 server return STU3 through some API (and maybe also the specific dot level)? [Not the compatibilityStatement -- that seems way too expensive to simply report which version)
Lloyd McKenzie (Nov 08 2019 at 17:23):
http://build.fhir.org/capabilitystatement-operation-versions.html
John Silva (Nov 08 2019 at 18:31):
@Lloyd McKenzie - thanks. This seems to return dotted version numbers; is there a means to return the "logical release", e.g. DSTU2 vs STU3 vs R4 vs R5, etc.?
Jose Costa Teixeira (Nov 08 2019 at 19:53):
http://build.fhir.org/valueset-FHIR-version.html
Jose Costa Teixeira (Nov 08 2019 at 19:54):
this is a formal valueset not sure if this helps...
Grahame Grieve (Nov 08 2019 at 19:57):
DSTU2 = 1.0
STU3 = 3.0
R4 = 4.0
R5 = 4.1 right now, but that will change next month
John Silva (Nov 08 2019 at 22:32):
OK, that's what we need. I don't expect (at this point) our FHIR server to need to differentiate dot-level version changes. So, which FHIR REST API would/should return this or is the only mechanism the capabilitystatement-operation-versions that Lloyd mentioned? What do servers link Vonk and others do or is is not specified so it's 'proprietary' ?
Alexander Kiel (Nov 09 2019 at 07:05):
@John Silva You can use [base]/metadata?_elements=fhirVersion
which returns a subsetted resource and is quite fast on HAPI and Vonk.
John Silva (Nov 09 2019 at 13:00):
@Alexander Kiel thanks. I tried that on Grahame's test server and it returns the complete list of resources, not what I need, I'm looking simply for the 'major' or logical FHIR server versions, e.g. 'STU3' vs 'R4' vs 'R5'. I suppose I could send the dotted version number and additionally add the 'logical' version but I'm looking to find an 'official way' of doing this.
http://test.fhir.org/r4/metadata?_elements=fhirVersion
Alexander Kiel (Nov 09 2019 at 13:04):
@John Silva With the right Accept header Grahame's test server also returns "only" the version:
$ curl -H 'Accept:application/fhir+json' -s http://test.fhir.org/r4/metadata?_elements=fhirVersion | jq . { "resourceType": "CapabilityStatement", "id": "FhirServer", "status": "active", "date": "2019-11-09T13:03:14.391Z", "kind": "instance", "fhirVersion": "4.0.1", "format": [ "application/fhir+xml", "application/fhir+json" ] }
John Silva (Nov 09 2019 at 13:13):
Hmm, I just noticed that Grahame's test server actually returns exactly what I was asking for:
http://test.fhir.org/r4/$versions
{
"resourceType" : "Parameters",
"parameter" : [
{
"name" : "version",
"valueString" : "r4"
}
]
}
So, is that FHIR standards compliant? If so, that's what I need (to implement).
Alexander Kiel (Nov 09 2019 at 13:17):
As I read it here the $version operation is only needed if a server implements multiple versions. So I would not depend on it.
John Silva (Nov 09 2019 at 13:49):
@Alexander Kiel - in our case we are implementing the FHIR server and need to support multiple versions, so we could support this $versions API for our needs. I'm just trying to make sure that the valueString="r4" is a FHIR compliant way of representing versions; everywhere else it seems to talk about dotted version numbers.
(and the $versions interface also has a default property which isn't shown in test server)
Alexander Kiel (Nov 09 2019 at 13:52):
Yes it talks about dotted versions. I would just ask Grahame what he thinks about this.
Grahame Grieve (Nov 09 2019 at 20:16):
that's a bug in my server.I just fixed it in the source
John Silva (Nov 09 2019 at 21:19):
Oh, I was hoping that was a legal return value for version!
Christiaan Knaap (Mar 17 2020 at 12:30):
@John Silva If it is still relevant: we implemented $version in Vonk 3.3.
John Silva (Mar 17 2020 at 12:45):
Thanks @Christiaan Knaap . That's good to know. It's been a while since I asked this question. Was there any consensus on how the FHIR spec says that FHIR servers should report versions?
Grahame Grieve (Mar 17 2020 at 18:45):
server header in http
Last updated: Apr 12 2022 at 19:14 UTC