FHIR Chat · Date searches on missing dates · implementers

Stream: implementers

Topic: Date searches on missing dates


view this post on Zulip Lloyd McKenzie (Mar 25 2022 at 14:16):

In looking at the date search rules, it's not terribly clear how they work when the target element is missing entirely. For example, what's the result of a search on "le1980" for a patient whose birthdate element is completely missing? Do all of the comparison types match? not-match? (Related to http://community.fhir.org/t/search-dates-by-range-in-medicnalproductauthorization/3570, which is triggering issues because there are specific searches for start and end, rather than doing the 'normal' thing and just having a search that works against the range.

view this post on Zulip Daniel Venton (Mar 25 2022 at 15:02):

In my server if the resource does not have a date with which to compare on then the item is excluded. A null value cannot be asserted as being > or < than anything.
Let's say you do the opposite.
Search > 1980 ..... resource null is included
Search < 1980 ..... resource null is included
Search = 1980 ..... resource null is included
This seems wrong to me. Whenever there is a criteria then a resource with a null value is excluded.
It also happens to be what the :missing modifier would be used for. (now applying a :missing to a date value is a different thing.)

view this post on Zulip Gino Canessa (Mar 25 2022 at 15:38):

Lloyd: file a ticket? =)

I think the intention is that null values do not match against parameters with values (unless specifically designed by the Search Parameter). If you want to search for resources that do not have a value, the :missing modifier can be used. Assuming that :missing=true and :missing=false are complements, value searches against those elements should not return those records.

If we wanted to get really fancy, we could propose modifiers for R5 like :includenull/:excludenull in addition to clarifying the default behavior.

view this post on Zulip Gino Canessa (Mar 25 2022 at 15:40):

Additional note: this should be clarified in the context of the ne prefix specifically.
(e.g., trying to work through the differences between ?date=ne20220325&date:missing=false and ?date=ne20220325. ?date=ne20220325&date:missing=true can be reduced to ?date:missing=true.)

view this post on Zulip Lloyd McKenzie (Mar 25 2022 at 22:10):

FHIR#36646


Last updated: Apr 12 2022 at 19:14 UTC