Stream: implementers
Topic: Date searches: contained or overlap
Michele Mottini (Aug 09 2019 at 20:51):
So search by date should use overlap or contains? eg date=2019-03 matches only encounters that happened entirely within march 2019, or any encounter that was even partially in March 2019?
I cannot really understand which is supposed to be from http://hl7.org/fhir/search.html#date
Our server used to use overlap, but a while ago (November 2017) we switched to contained - based on some information / discussions that happened here I think, but that I cannot find
Lloyd McKenzie (Aug 10 2019 at 01:42):
I'm astounded to find that the specification doesn't seem to make clear that it's an "intersection" match, not a "contains" match. @Grahame Grieve ?
Grahame Grieve (Aug 10 2019 at 01:49):
I thought it was very clear
Lloyd McKenzie (Aug 10 2019 at 02:18):
I can't see wording that says it...
Michele Mottini (Aug 12 2019 at 14:27):
Added https://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=23558
Michele Mottini (Aug 12 2019 at 14:29):
..and you do positively confirm that should be overlap?
Grahame Grieve (Aug 14 2019 at 08:51):
I think it's overlap, yes
Michele Mottini (Aug 14 2019 at 12:39):
Actually - it is documented at http://hl7.org/fhir/search.html#prefix - and it is contains for eq, overlap for ge, gt, le, lt
John Moehrke (Aug 14 2019 at 14:20):
Those prefix work for when the element is a date or dateTime.. but not well for when the element is a period. This CR and one I entered (GF#19909) , are about searching against a period.
John Moehrke (Aug 14 2019 at 14:27):
It is partially clear for inclusive searches (give me observatinos within range of x to y). Not clear how start/end of period is used here, but more clear that the intent is to favor false-positives... What is not clear at all is when one is asking for things before x, or after y; mostly I want everything NOT during the period x to y. Usecase that happens in XDS is that there is a known period of time that is very noisy but known to not be relevant. So I want things that happened before that period, and things after. (or there is consent policy restricting that period from x to y).
Grahame Grieve (Aug 15 2019 at 02:45):
might need some more qualifiers for some of these cases. Sounds like a face to face discussion in Atlanta during the connectathon to me
Michele Mottini (Aug 15 2019 at 13:31):
Sure
Don't understand what's the difference between dates and periods: dates are periods as well (of 1 day or 1 month or 1 year) and the spec say they should be treated as such
Alexander Kiel (Feb 12 2020 at 19:20):
@Michele Mottini Are there any news here? How can I find the gForge issues in JIRA? Thanks.
Alexander Kiel (Feb 12 2020 at 20:19):
As I see it the ap prefix covers the overlap case were the eq prefix covers the contains case.
Lloyd McKenzie (Feb 12 2020 at 20:35):
If you know the gForge id for an issue, you can find the Jira equivalent using http://jira.hl7.org/browse/FHIR-[id] where [id] is your gForge id. E.g. http://jira.hl7.org/browse/FHIR-19909
Lloyd McKenzie (Feb 12 2020 at 20:36):
If you don't know the gForge id, Jira has significant search capabilities. There's some documentation here: https://confluence.hl7.org/display/HL7/Specification+Feedback#SpecificationFeedback-Searchingandmonitoringissues
Michele Mottini (Feb 12 2020 at 20:37):
No news per se. We implemented eq as contains and gt, lt, ge, le as overlap. We do not support ap. We handle dates as periods of 1 day
Alexander Kiel (Feb 13 2020 at 11:22):
@Michele Mottini Is in your case gt the same as ge for dates? I ask because for dates the range above the value is defined the same as the lower bound for dates. In the example it's 2015-08-12T05:23:45.000000000000000 for 2015-08-12T05:23:45 where 2015-08-12T05:23:45.000000000000000 would also the lower bound. For decimals however the lower bound of 2.0 is 1.95, so it's different from the point where range above the value starts (2.00000000000000000000) and so ge matches more values as gt.
Michele Mottini (Feb 13 2020 at 20:25):
No, ge and gt are different (we actually had to fix that - automatic testing with the Inferno tool was failing)
Michele Mottini (Feb 13 2020 at 20:32):
ge => the end of the period is greater or equal to the start of the search period (or the period is open ended)
Michele Mottini (Feb 13 2020 at 20:32):
gt => the end of the period is greater to the start of the search period (or the period is open ended)
Last updated: Apr 12 2022 at 19:14 UTC