FHIR Chat · Date/time comparison semantics with different timezones · fhirpath

Stream: fhirpath

Topic: Date/time comparison semantics with different timezones


view this post on Zulip Bryn Rhodes (Oct 03 2018 at 03:37):

We've put together a proposed disposition for this FHIRPath ballot comment: GF#18607

view this post on Zulip Bryn Rhodes (Oct 03 2018 at 03:38):

As part of that, we're surveying existing implementations on current behavior. If you have a FHIRPath implementation, can you please describe the current behavior of your engine with respect to comparing date/time values with different timezone offsets?

view this post on Zulip Bryn Rhodes (Oct 03 2018 at 03:57):

For example, what does your implementation return for the following expressions:

@2017-11-05T01:30:00.0-04:00 > @2017-11-05T01:15:00.0-05:00
@2017-11-05T01:30:00.0-04:00 < @2017-11-05T01:15:00.0-05:00
@2017-11-05T01:30:00.0-04:00 = @2017-11-05T01:15:00.0-05:00
@2017-11-05T01:30:00.0-04:00 = @2017-11-05T00:30:00.0-05:00

view this post on Zulip Grahame Grieve (Oct 03 2018 at 11:41):

Java RI:
false
true
false
false

view this post on Zulip Grahame Grieve (Oct 03 2018 at 12:05):

Pascal RI:
true
false
false
false

view this post on Zulip Grahame Grieve (Oct 03 2018 at 12:06):

I added them to the standard tests

view this post on Zulip Grahame Grieve (Oct 03 2018 at 12:20):

This is before I investigate to decide what the output should be

view this post on Zulip Chris Moesel (Oct 03 2018 at 13:04):

The JavaScript CQL execution engine (which should use the same semantics since FHIRPath is a subset of CQL) says:
false
true
false
true

These are the results you would expect if you "respect offsets" by normalizing to a single offset before performing comparisons.

view this post on Zulip Bryn Rhodes (Oct 03 2018 at 13:10):

These are the results from the Java-based CQL engine:

Test1 [1:1] false
Test2 [2:1] true
Test3 [3:1] false
Test4 [4:1] true

view this post on Zulip Ewout Kramer (Oct 03 2018 at 13:46):

The results from the .NET evaluator:

false,
true,
false,
true

view this post on Zulip Ewout Kramer (Oct 03 2018 at 13:47):

Indeed, everything is normalized to UTC before comparison.

view this post on Zulip Grahame Grieve (Oct 03 2018 at 13:50):

I thought I did too....

view this post on Zulip Paul Lynch (Oct 03 2018 at 14:59):

fhirpath.js does not yet support comparing dates at different time zones (so I won't bother including its output on those tests).

view this post on Zulip Bryn Rhodes (Oct 08 2018 at 16:27):

Thank you for the feedback on this, we've proposed a disposition here: GF#18607 and will review and hopefully approve on tomorrow's ITS call.

view this post on Zulip Bryn Rhodes (Oct 08 2018 at 19:42):

Correction, the next ITS call is the 16th, not tomorrow.


Last updated: Apr 12 2022 at 19:14 UTC