projecttacoma / fqm-execution

fqm-execution is a library that allows users to calculate FHIR-based electronic Clinical Quality Measures (eCQMs) and retrieve the results in a variety of formats
https://projecttacoma.github.io/fqm-execution/
Apache License 2.0
18 stars 6 forks source link

Calculations are not accurate to "seconds" in Condition.onsetDateTime #241

Closed RohitKandimalla closed 1 year ago

RohitKandimalla commented 1 year ago

Summary

When I have a patient whose "Condition.onSetDateTime" is less than the Measurement Period End date, the calculations don't seem to be accurate.

The test patient should pass denominator exclusion when Condition.onSetDateTime = "2024-12-31T23:59:59.000Z" as that meets the timing criteria 'starts on or before end of measurement period'. The test case does not pass until I change the time to 23:59:00 or earlier on 12/31 - having the time of 23:59:01 fails. Screenshots of CQL logic and test case resource can be found in the attached external ticket.

MADiE is using CalculationOptions to override MP start and end dates.

Measurement Period start date: 2024-01-01T00:00:00.000+00:00 Measurement Period End date: 2024-12-31T23:59:59.999+00:00

MeasureBundle: measureBundle.txt patientBundle.txt

Also, the documentation says that the measurement period should be in YYYY-MM-DD format. but looks like it does calculations to the last minute but doesn't take seconds into consideration.

External Tracking Ticket

https://oncprojectracking.healthit.gov/support/browse/BONNIEMAT-1481

Expected Behavior

Version or Commit

Inputs (e.g. Measure Bundle, Patient Bundle, CQL Library)

Relevant Calculation Options (e.g. Measurement Period, meta.profile Validation)

cql-to-elm Version Used for Measure Logic Translation (if known)

Any Additional Info

mgramigna commented 1 year ago

Hi @RohitKandimalla, I believe you are correct in the assertion that our calculation/code for this level of precision on the measurement is incorrect. I think we should update fqm-execution to support precision of measurement period down to the millisecond to avoid issues like this in the future. We should also fix our wording in the documentation to be clearer on the supported format(s) of measurement period input.

We plan a new sprint this Wednesday, and will ensure that this issue gets prioritized and included in the next fqm-execution release

RohitKandimalla commented 1 year ago

Awesome, Thank you @mgramigna

mgramigna commented 1 year ago

This issue has been resolved and released in v1.2.0

Updated documentation for allowed formats of measurement period input to fqm-execution can be found here

In short, any value adhering to the FHIR datetime format should now be supported.