FHIR Chat · Query a Reference (when using the Identifier option) · implementers

Stream: implementers

Topic: Query a Reference (when using the Identifier option)


view this post on Zulip Dave Barnet (Apr 21 2021 at 09:48):

We are seeing (for practical reasons) that we can't always reference resources - maybe the resources are not available, or on disperate servers that may not always be accessible. In these cases we use the "identifier" option of the Reference data type. For example, we can end up with resource instances like this
<PractitionerRole xmlns="http://hl7.org/fhir">
<practitioner>
<identifier>
<system value="https://fhir.nhs.uk/Id/user-id"/>
<value value="1234567890"/>
<identifier>
</practitioner>
etc....
</PractitionerRole>

The issue we are having is how to query these resources. For example, to get all the PractitionerRole records for practitioner 1234567890. The query parameter PractitionerRole.practitioner is geared towards having a resource references, rather than an identifer. Would the following query string be acceptable (it fails on all the FHIR servers I've tried it on!)
[FHIRServer]/PractitionerRole?practitioner.identifier=https://fhir.nhs.uk/Id/user-id|1234567890
Note that in this example the FHIR server does not contain the Practitioner resource, so I can't chanin through to a Practitioner resource.

view this post on Zulip Rik Smithies (Apr 21 2021 at 10:21):

hi Dave

Are these FHIR resources that are not accessible, or non-FHIR resources? Either way, a FHIR server is not going to be able to reach them.

You can use reference.identifier to point to things that are not FHIR, but in that case a FHIR server would not be able to query for them, unless it had some special knowledge of how to resolve that identifier type, or how to cope with them not being accessible somehow (e.g. a cache).

There has been discussion on here of searching within the FHIR server space by identifier (and I am not sure how possible that is currently), but that won't help you I don't think.

view this post on Zulip Kevin Mayfield (Apr 21 2021 at 10:36):

The FHIR resources are available but we don't specify which one to use. So for a NHSNumber of 9876543210 (display name = MR J SMITH, reference.identifier of 9876543210) - you could resolve by going to the national PDS server, local PAS or regional MPI. Corollary is you don't need to resolve the reference to get the NHS number (or patient name).

Same would apply to other national identifiers such as GMC, GMP, ODS, etc codes for Practitioner and Organization. It is up to the client to decide where they go to resolve the identifier.
Using GMC, GMP, ODS etc also matches existing HL7v2 and NHS Data Dictionary behaviour in the NHS

view this post on Zulip Rik Smithies (Apr 21 2021 at 10:51):

So that is FHIR data but not FHIR REST data - because the server is not specified.

It cannot be searched by FHIR RESTful search, without some special case server logic.

Either an extension to the search code (but that may break existing functionality for identifiers) or by adding a custom operation perhaps.

view this post on Zulip Kevin Mayfield (Apr 21 2021 at 11:10):

I think from the point of view of a developer its consistent across API's.

So for our main directory server, this is correct and would work (it has Practitioner, Organization and PractitionerRole - it's a FHIR Server)
[FHIRServer]/PractitionerRole?practitioner.identifier=https://fhir.nhs.uk/Id/user-id|1234567890

Other servers which are more like (FHIR) micro services. (it wont have a Practitioner resource locally but understands the query)
Having the same search parameters is easier for the developer and the way the API responds is very similar.

view this post on Zulip Rik Smithies (Apr 21 2021 at 12:57):

Yes it is nice if that query can work, but it needs to do some NHS specific magic to resolve where those identifiers live. If they are on the same server maybe some servers can do it out of the box (there was discussion on here before e.g. https://chat.fhir.org/#narrow/stream/179166-implementers/topic/How.20search.20on.20Reference.2Eidentifier.20in.20STU3), but otherwise not.

view this post on Zulip Dave Barnet (Apr 21 2021 at 14:51):

On the Vonk r3 server (https://server.fire.ly/r3/) I POSTed
<PractitionerRole xmlns=http://hl7.org/fhir>
<practitioner>
<identifier>
<system value=https://fhir.nhs.uk/Id/user-id/>
<value value="QWERTY"/>
</identifier>
</practitioner>
<code>
<coding>
<system value=https://fhir.hl7.org.uk/CodeSystem/UKCore-SDSJobRoleName />
<code value="R0260" />
<display value="General Medical Practitioner" />
</coding>
</code>
</PractitionerRole>

and then did a GET
https://server.fire.ly/r3/PractitionerRole?practitioner:identifier=https://fhir.nhs.uk/Id/user-id|QWERTY
(note :identifier)
and the resource was returned. I repeated the same on a HAPI server & nothing was returned. Given the discussion that Rik has pointed to, I think theintension is that
GET [base]/PractitionerRole?practitioner:identifier=[system]|[value]
is the intended way to retrieve resources where the Reference uses an identifier.

view this post on Zulip Kevin Mayfield (Apr 21 2021 at 15:01):

@Rik Smithies yep its a hot topic at the moment.

view this post on Zulip Lloyd McKenzie (Apr 21 2021 at 16:38):

practitioner:identifier is the way to search on Reference.identifier.


Last updated: Apr 12 2022 at 19:14 UTC