FHIR Chat · boolean logic in search criteria · implementers

Stream: implementers

Topic: boolean logic in search criteria


view this post on Zulip Tom de Jong (Nov 20 2018 at 13:44):

I have a situation where I'm managing a Consent registry, in which patients can grant access to their data by healthcare providers. I won't get into the details of the use case, but I need to query the registry to find the consents pertaining to a certain patient that are relevant for a specific care provider. Since concent can either be given to a whole class of care providers (e.g. all pharmacies) or to a specific care provider (e.g. just my own GP), I need to be able to specify something like the following as search criteria (in quasi FHIR syntax): Consent?patient=X AND (class=A OR class=B OR provider=Y).

I've read at http://hl7.org/fhir/search.html how the "&" operator is used to apply a logical AND and how the "," separator is used to apply a logical OR, but it seems & can only be used if the subcriteria apply to the same search parameter and , can only be used to separate a list of values for the same search parameter. The example I see in the text is "Patient?language=FR,NL&language=EN" for patient speaks English and at least one of French or Dutch. In my example, I'm dealing with three different search parameters that need to be combined in a logical expression. Any advice is welcome.

view this post on Zulip Ewout Kramer (Nov 20 2018 at 13:49):

Hi Tom, there's no way to group operations - this is outside the scope of what you can do on the URL. _filter (https://www.hl7.org/fhir/search_filter.html) would probably help you here, though it's not widely implemented.


Last updated: Apr 12 2022 at 19:14 UTC