Stream: implementers
Topic: Search by datetime
Lakshmi Bhamidipati (Mar 11 2021 at 18:32):
Hello,
If I search on FHIR element that is a datetime type and the timezone is note present in the search param value, should I assume that value's timezone is the local timezone of the FHIR server?
From the FHIR Spec -
"Where possible, the system should correct for time zones when performing queries. Dates do not have time zones, and time zones should not be considered. Where both search parameters and resource element date times do not have time zones, the servers local time zone should be assumed."
(Assuming my FHIR server is in EST/EDT )
Say the search param = ge 2010, then should I assume that search >= 2010-01-01T00:00:00-04:00 ?
OR
search >= 2010-01-01T00:00
Also if search param is = gt 2010, then is it equivalent to search > 2010-12-31T23:59:59-04:00?
OR
search > 2010-12-31T23:59:59 and so on...
I guess the same applies to search
param = ge 2010-06-30, is it equivalent to >= 2010-06-30T23:59:59-05:00
Thank you.
Lloyd McKenzie (Mar 11 2021 at 18:50):
The guidance that we have is here: https://build.fhir.org/search.html#date
Note the 'dragon' comment at the bottom...
In short, global assumptions are difficult to make. You have to look at the data and the search and decide what's most reasonable/safest to do based on context.
Lakshmi Bhamidipati (Mar 11 2021 at 18:52):
Thank you @Lloyd McKenzie - I was wondering if there is a common rule that most FHIR server implementations follow.
Last updated: Apr 12 2022 at 19:14 UTC