hapifhir / org.hl7.fhir.core

Apache License 2.0
146 stars 149 forks source link

Boundary functions return incorrect results #1659

Open johngrimes opened 2 weeks ago

johngrimes commented 2 weeks ago

It seems as though the spec has been updated with respect to the semantics of the boundary functions, but the implementations within this library have not been changed to reflect this.

Here is the specification for lowBoundary: https://build.fhir.org/ig/HL7/FHIRPath/#lowboundaryprecision-integer-decimal--date--datetime--time

The first example is:

1.587.lowBoundary(8) // 1.58700000

The result returned by the library:

Utilities.lowBoundaryForDecimal("1.587", 8)  // 1.58650000
johngrimes commented 2 weeks ago

I note that the FHIRPath page in the CI build of the FHIR spec seems to be different, I am a bit confused by this: https://build.fhir.org/fhirpath.html#fn-lowBoundary

grahamegrieve commented 3 days ago

I don't think that they're wrong, but see discussion here: https://chat.fhir.org/#narrow/stream/179266-fhirpath/topic/Boundary.20functions