FHIR Chat · Logical reference search · hapi

Stream: hapi

Topic: Logical reference search


view this post on Zulip Reto Wettstein (Apr 22 2020 at 07:38):

Hi everyone,

I am trying to execute a logical reference search on the Device resource for the field Device.patient. This is the request:

GET [base]/Device?patient:identifier=http://test.com/NamingSystem/patient-identifier|123456

Search results are always 0. Is there an error in my search and is HAPI supporting search for logical references?

view this post on Zulip James Agnew (Apr 22 2020 at 11:48):

This style of search is not yet supported in HAPI FHIR - Hopefully coming soon.

view this post on Zulip Patrick Werner (Apr 22 2020 at 11:52):

enabling this would also mean 'include' would work with logical references, right?

view this post on Zulip James Agnew (Apr 22 2020 at 12:40):

I wouldn't expect that to be the case by default- That would involve adding a resolve step that looked for other resources with the same identifier, either at write time or at search time, both of which would add nontrivial overhead. It could be made to work though...

Technically you can kind of do this already by using HAPI's nonstandard "embedded lookup criteria". I.e. you can write your device with:

{
   "subject": { "reference": "Patient?identifier=http://foo|bar" }
}

..and HAPI will resolve that before writing the resource, but this is not FHIR standard behaviour and is disabled by default.

view this post on Zulip Patrick Werner (Apr 22 2020 at 12:45):

Technically you can kind of do this already by using HAPI's nonstandard "embedded lookup criteria".

nice!

view this post on Zulip René Spronk (Apr 26 2020 at 09:24):

Wouldn't that be simple parameter chaining, GET [base]/Device?patient.identifier=http://test.com/NamingSystem/patient-identifier|123456 (note the "."-character instead of the : before identifier). This style of searching (generally speaking) is supported by HAPI.

view this post on Zulip Simone Heckmann (May 05 2020 at 13:43):

Patrick Werner said:

enabling this would also mean 'include' would work with logical references, right?

Spec says:

Chaining is not supported when using the :identifier modifier, nor are chaining, includes or reverse includes supported for reference elements that do not have a reference element.

http://hl7.org/fhir/search.html#reference

But I was really just here to say that I'd love to see the :identifier-modifier implemented in HAPI :smile:

view this post on Zulip Patrick Werner (May 05 2020 at 14:06):

ah right the spec :sad:

view this post on Zulip James Agnew (May 07 2020 at 22:15):

Would I be right in guessing that :identifier has some use in a German profile? I feel like there are a lot of Germans asking me about this lately... :)


Last updated: Apr 12 2022 at 19:14 UTC