$evaluate-measure forces the measurement period to second precision, so CMS's millisecond boundary test data evaluates as uncertain
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 43/100
Research direction
Start by tracing MeasureProcessorTimeUtils.getMeasurementPeriod through DateHelper.buildMeasurementPeriodInterval to DateHelper.convertToDateTime, where the issue identifies setPrecision(Precision.SECOND) as the point that coarsens the period. Compare the parameterized period with the measure's default millisecond precision and the boundary cases described for CMS165 and CMS125. Done means parameterized evaluation preserves the needed boundary precision and agrees with the steward's expected reports; the issue does not name tests to run.
Written by the indexing model from the issue text.
Description
What happened?
When periodStart and periodEnd are supplied to $evaluate-measure, the measurement period is built at second precision. CMS's MADiE test data puts events on the period boundaries at millisecond precision, so those comparisons come out uncertain (null) and the patients fall out of the population.
The path is MeasureProcessorTimeUtils.getMeasurementPeriod → DateHelper.buildMeasurementPeriodInterval → DateHelper.convertToDateTime, which calls convertedDateTime.setPrecision(Precision.SECOND). This is in v4.13.0 and on main.
CMS's measures declare their default period at millisecond precision, e.g. Interval[@2026-01-01T00:00:00.000, @2027-01-01T00:00:00.000). When the operation is called without period parameters, the same cases agree.
How can we reproduce it?
- Server:
hapiproject/hapi:v8.12.0-2(HAPI FHIR 8.12.0, clinical-reasoning 4.13.0), digestsha256:0ff86aac4c7bd13a1ee226444a70263bb46ed1c28ef543c30a44f865b80ca04e, with a fresh container per run. - Content:
CMS165FHIRControllingHighBPfromcqframework/dqm-content-qicore-2025atca4b495, with its 68 MADiE test cases. - Request:
Measure/$evaluate-measureper subject.
CMS165's initial population requires:
Hypertension.prevalenceInterval() overlaps Interval[start of "Measurement Period", start of "Measurement Period" + 6 months)
51 of its IPP cases put the earliest hypertension onset at 2026-06-30T23:59:59.000+00:00.
| Run | Agree with the MADiE expected reports |
|---|---|
periodStart=2026-01-01&periodEnd=2026-12-31 |
13/68 |
| no period parameters (the library's default period) | 67/68 |
as the first run, but with only the 63 hypertension onsets at 2026-06-30T23:59:59.000 moved to 2026-06-30T12:00:00.000 |
67/68 |
With the period at second precision, the window's open end is 2026-06-30T23:59:59 at second precision. An onset of 23:59:59.000 matches it to the second but has more precision, so overlaps is null. (The one remaining case is #1071.)
CMS125 shows the same thing at the period end. Its ends on or before end of "Measurement Period" meets mastectomy procedures at 2026-12-31T23:59:59.000: 64/66 with the parameters, and 66/66 when only those 5 procedures move to noon the same day.
What did you expect to happen?
The period should keep the precision of the measure's own default (milliseconds, ending at 23:59:59.999), as fqm-execution does. At least, it should not be coarsened below the precision of the value supplied.
I realise the DEQM $evaluate documentation uses 2014-12-31T23:59:59 as its example end, so the intended precision may be partly a spec question. As it stands, though, the steward's own test cases fail.
(The other path, DateHelper.resolveDate, carries a TODO: Seems like we might want set the precision appropriately here?.)
- Dominant language
- Java
- Stars
- 52
- Forks
- 46
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cqframework/clinical-reasoning
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
cqframework/clinical-reasoning#1152 ·
Maintainers usually reply within 1 day
-
Provide a supported public API to get CQL results (and optionally MeasureDef data) from R4 measure evaluationPossibly taken @c-schuler claimed this 5 days ago. Openenhancement
cqframework/clinical-reasoning#1150 · 1 assignee ·
Maintainers usually reply within 1 day
-
R4 PlanDefinition/$apply: two requests from the same ActivityDefinition still get the same id, and one is dropped when the CarePlan is written to JSON (follow-up to #779)Possibly taken @dhes claimed this 34 days ago. Open
Difficulty 4/5 1-2 days Newbie friendliness 35/100
cqframework/clinical-reasoning#1137 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 40/100
cqframework/clinical-reasoning#1132 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
cqframework/clinical-reasoning#1128 · 1 comment ·
Maintainers usually reply within 1 day
All issues in cqframework/clinical-reasoning
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
testng-team/testng#3672 ·
Maintainers usually reply within 1 day
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eclipse-edc/IdentityHub#1296 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
cloudfoundry/uaa#4194 ·
Maintainers usually reply within 1 day
-
area: ui priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
tetsuji16/microProject#1721 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days