FHIR Chat · References to resources in different versions · implementers

Stream: implementers

Topic: References to resources in different versions


view this post on Zulip Dave Barnet (May 18 2021 at 14:11):

Is it OK for a resource to reference FHIR resources on servers that are of different versions? For example an R4 Observation to reference a Patient on a Patient store (server) that holds (and serves out the Patient as an STU3 resource?

view this post on Zulip Grahame Grieve (May 18 2021 at 14:12):

that's very difficult to answer. OK in what sense?

view this post on Zulip Michele Mottini (May 18 2021 at 14:13):

Most (all?) clients won't be happy about that

view this post on Zulip Dave Barnet (May 18 2021 at 14:17):

We are thinking that in a "modular environment" - a Patient store, an Organization & Location store, a Practitioner store all on different servers (and endpoints), they may offer only interfaces at certain FHIR versions as the estate as a whole evolves. A rsource created may be in later version than the store it needs to point to (hence the example of an R4 Observation pointing to the STU3 Patient endpoint).

view this post on Zulip Lloyd McKenzie (May 18 2021 at 15:46):

If you perform a search, all resources in the Bundle must be of the same version. So if you attempt an _include or _revinclude that spans version boundaries, it won't work.

view this post on Zulip John Moehrke (May 18 2021 at 16:50):

use resource.identifier

view this post on Zulip Vassil Peytchev (May 18 2021 at 17:37):

use resource.identifier

Reference.identifier?

view this post on Zulip Dave Barnet (May 19 2021 at 07:58):

Just to be clear, its not mixing versions of resources in the same bundle, its about whether a R4 resource can reference an STU3 resource (endpoint). John's solution of using reference.identifier is what we are doing at present, so (for example) if a R4 Encounter resource wants to reference a Patient, and that Patient record can only be gotten on an STU3 endpoint, then we put in a reference.identifier to the primary identifier for the patient (in out case the NHS Number). It's then up to the client to deal with the STU3 based endpoint for Patient - i.e. find the endpoint, query the CapabilityStatement, and retrieve the Patient record.

view this post on Zulip Kevin Mayfield (May 19 2021 at 08:11):

Our basic reference will look something like this

"patient": {
                    "type": "Patient",
                    "identifier": {
                        "system": "https://fhir.nhs.uk/Id/nhs-number",
                        "value": "9912003888"
                    },
                   "display": "Bilbo Baggins"
                },

view this post on Zulip Kevin Mayfield (May 19 2021 at 08:15):

Which is useful to consumers, they get the identifier and the name but if they want to resolve the reference then supplying a resource reference would be useful.

I'm not convinced saying the reference MUST be the the same version is helpful. We would be including the version in the url, so a consumer would know the FHIR version. If that version is usable then they follow the reference else they query using the identifier.

"patient": {
                   "type": "Patient",
                     "reference": "https://spine-directory-services.nhs.uk/STU3/Patient/9912003888",
                    "identifier": {
                        "system": "https://fhir.nhs.uk/Id/nhs-number",
                        "value": "9912003888"
                    },
                   "display": "Bilbo Baggins"
                },

view this post on Zulip Lloyd McKenzie (May 19 2021 at 15:53):

A reference isn't actually version-specific. It's possible to query the same resource and ask for it in different FHIR versions, just as you can ask for it in XML or JSON. So exposing the 'version' in the URL wouldn't really make sense.


Last updated: Apr 12 2022 at 19:14 UTC