FHIR Chat · Search Encounters by Period · implementers

Stream: implementers

Topic: Search Encounters by Period


view this post on Zulip Amy Li (Sep 15 2021 at 20:08):

Hi, we would like to implement a date Period search on Encounters for a list of encounters that are either admitted or discharged within the date range. After reading the specification on date filters and prefixes, we want to minimize the complexity of using prefixes.

Can someone please confirm if a system is allowed to
a. omit all date search prefixes. This means just the dates are used as such
[baseURL]/Encounter?date=2021-01-01&date=2021-12-31
The search is expected to include any encounters that are admitted or discharged on or after 2021-01-01 and before or on 2021-12-31.

b. implement a subset of prefixes. We would pick and choose to implement a few prefixes that make sense with our data.

Thanks,

Amy

view this post on Zulip Michele Mottini (Sep 15 2021 at 20:25):

[baseURL]/Encounter?date=2021-01-01 matches encounter with admit and discharge both on that day - and so [baseURL]/Encounter?date=2021-01-01&date=2021-12-31 won't match anything (see http://hl7.org/fhir/search.html#prefix ' the range of the search value fully contains the range of the target value')

view this post on Zulip Michele Mottini (Sep 15 2021 at 20:28):

What you want is [baseURL]/Encounter?date=ge2021-01-01&date=le2021-12-31 - that matches encounters that are admitted or discharged on or after 2021-01-01 and before or on 2021-12-31.

view this post on Zulip Michele Mottini (Sep 15 2021 at 20:29):

(but double-check that with the spec I linked - date searches on periods are confusing)

view this post on Zulip Daniel Venton (Sep 15 2021 at 21:04):

Using HAPI this won't work [baseURL]/Encounter?date=2021-01-01&date=2021-12-31, the default comparator with not specified is eq. Meaning that what you said was translated as [baseURL]/Encounter?date=eq2021-01-01&date=eq2021-12-31

If you did like Michele showed, [baseURL]/Encounter?date=ge2021-01-01&date=le2021-12-31 I would think that if either period.start OR period.end was in the range the Encounter would be returned.

view this post on Zulip Lloyd McKenzie (Sep 16 2021 at 17:49):

@Daniel Venton Multiple search parameter repetitions are treated as AND.

view this post on Zulip Daniel Venton (Sep 16 2021 at 18:57):

Then you are saying that since it's a date range applied to a range that:
period.start has to be > lower bound AND period.start has to be < upper bound
AND [NOT Allowed to be OR in this position?]
period.start has to be > lower bound AND period.start has to be < upper bound.

view this post on Zulip Daniel Venton (Sep 16 2021 at 19:00):

Following that pattern. All date attributes that the search parameter applies to must be within range. In CARIN a service-date param applies to 2 ranges service date and billing date.
All 4 dates must fall within the date range specified.
If any one of those dates are missing, then the resource is not a match.

view this post on Zulip Michele Mottini (Sep 16 2021 at 19:25):

date=ge2021-01-01 is 'the range above the search value intersects (i.e. overlaps) with the range of the target value, or the range of the search value fully contains the range of the target value' = the encounter end must be on or after 2021-01-01
date=le2021-12-31 is 'the range below the search value intersects (i.e. overlaps) with the range of the target value or the range of the search value fully contains the range of the target value' = the encounter start must on or before 2021-12-31
both conditions = the encounter end must be on or after 2021-01-01 AND the encounter start must on or before 2021-12-31
that is matched if encounter end OR encounter start are within the range

view this post on Zulip Lloyd McKenzie (Sep 16 2021 at 19:52):

Date comparisons are always handled as range overlap/intersection tests. So Encounter?date isn't about start vs. end it's about the range represented by the whole period of time - based on the precision stated.

view this post on Zulip Michele Mottini (Sep 16 2021 at 20:15):

'range overlap/intersection tests' translate into condition on the start / end of the relevant periods, that is what I did above

view this post on Zulip guninder (Feb 03 2022 at 11:07):

Hello !
We are implementing CARIN's profiles for and are creating c4bb EOB resources based on this-
http://hl7.org/fhir/us/carin-bb/STU1/StructureDefinition-C4BB-ExplanationOfBenefit-Pharmacy.html
Basically, we are through with it but the only thing we are failing for the is the value-set mentioned in the profile for ExplanationOfBenefit.supportingInfo:dawcode.code which is
Link - http://hl7.org/fhir/us/carin-bb/STU1/ValueSet-NCPDPDispensedAsWrittenOrProductSelectionCode.html

As per this URL (https://build.fhir.org/ig/HL7/carin-bb/ValueSet-NCPDPDispensedAsWrittenOrProductSelectionCode.html) FHIR doesn’t give detail on the value-set required and we don’t have licensed NCPDP codes to support this.

Although we had tried passing the DAW standard code values 0-9 from this https://ushik.ahrq.gov/ViewItemDetails?system=mdr&itemKey=60578000

But still not getting through.

So, seeking help /advice on how to get through it. Any alternative value-set and code can be used here. Any help or pointers on this is appreciated.
Thank you!

view this post on Zulip Lloyd McKenzie (Feb 03 2022 at 15:48):

You might want to ask on #CARIN IG for Blue Button®


Last updated: Apr 12 2022 at 19:14 UTC