FHIR Chat · Searching on Patient.active when it is missing · implementers

Stream: implementers

Topic: Searching on Patient.active when it is missing


view this post on Zulip Paul Lynch (Jan 29 2021 at 14:37):

Should a query on Patient?active=true return Patient records on which the "active" field is not present? The definition of Patient.active says, "This resource is generally assumed to be active if no value is provided for the active element", but the search parameter "active" does specify its behavior in this case.

view this post on Zulip René Spronk (Jan 29 2021 at 16:38):

It may be better to search for 'ne false' ?

view this post on Zulip Lloyd McKenzie (Jan 29 2021 at 21:58):

The "meaning if missing" isn't the same as a default value. We specifically removed the notion of defaults due to the challenges in some environments of returning data in a search as though the default had been asserted. So I would not count on active=true returning instances where active:missing=true. (I don't know that we prohibit this though?)

view this post on Zulip Paul Lynch (Jan 29 2021 at 22:27):

René Spronk said:

It may be better to search for 'ne false' ?

ne does not seem to be defined for boolean types. active:not=true is accepted, but also returns 0 hits. I think what it means is that this looks for Patients which have an "active" field that is not set to true, so it still misses the ones without "active".

view this post on Zulip Paul Lynch (Jan 29 2021 at 22:30):

Lloyd McKenzie said:

The "meaning if missing" isn't the same as a default value. We specifically removed the notion of defaults due to the challenges in some environments of returning data in a search as though the default had been asserted. So I would not count on active=true returning instances where active:missing=true. (I don't know that we prohibit this though?)

active:missing is disabled in HAPI FHIR by default. It is an expensive operation to support, I've been told. What this means then is that if I want a list of only the active patients, I need to just keep paging through batches of Patients, discarding the inactive ones. It could be quite inefficient, if there are lots of inactive ones.

view this post on Zulip Lloyd McKenzie (Jan 30 2021 at 14:42):

@James Agnew


Last updated: Apr 12 2022 at 19:14 UTC