FHIR / sql-on-fhir-v2

This project provides the source for the SQL on FHIR v2.0 Implementation Guide
https://build.fhir.org/ig/FHIR/sql-on-fhir-v2/
MIT License
100 stars 27 forks source link

Implements lowBoundary and highBoundary #229

Open Diferti opened 6 months ago

Diferti commented 6 months ago

This pull request implements lowBoundary and highBoundary as functions on userInvocationTable

The FHIRPath spec says that lowBoundary and highBoundary should work with decimal, date, datetime, and time. To come up with idea how keep picoseconds in Javascript was fun.

To implement this, we need to pass a FHIR model to fhirpath.evaluate. If we do not, we will not have TypeInfo to determine dateTime and date because they overlap when using string checking.

I imported R4 model to use in the reference implementation to do this.

johngrimes commented 4 months ago

Digging into this has raised more questions than answers for me - there are multiple versions of the specification and the semantics are not clear to me in any of them.

I've posted a question thread about this in Zulip: https://chat.fhir.org/#narrow/stream/179266-fhirpath/topic/Boundary.20functions

Let's see what the FHIR community comes back with.

johngrimes commented 3 months ago

I don't actually think that this is necessary to resolve for the spec to go out - it is more of an issue on the reference implementation.