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
17 stars 6 forks source link

Null and case coverage fixes #273

Closed elsaperelli closed 11 months ago

elsaperelli commented 11 months ago

Summary

A @hossenlopp and @elsaperelli collab.

This PR addresses https://oncprojectracking.healthit.gov/support/browse/BONNIEMAT-1479. The measure and test cases provided in this ticket can now reach 100% clause coverage. The case in which CQL case statements were not properly being included in the clause coverage calculation and the clause coverage highlighting was discovered as a result of #262.

New behavior

In the above ticket, the else null clause in the SDE Sex definition could never be highlighted. We now have a way to identify Null literals (and Literal types with value false) and make sure they are highlighted based on whether or not they were executed rather than their value (which is null or false).

In addition, we noticed that the when and then parts of the case statements were not getting highlighted even though they were included in the clause coverage calculation. This also required an update in findAllLocalIdsInStatement in ClauseResultsHelpers.ts so that when pieces of CaseItems get results from the expression that defines them (use of sourceLocalId).

Code changes

Testing guidance

github-actions[bot] commented 11 months ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟒 Statements
86.49% (+0.34% πŸ”Ό)
2350/2717
🟑 Branches
73.69% (+0.56% πŸ”Ό)
2171/2946
🟒 Functions 89.08% 424/476
🟒 Lines
86.85% (+0.35% πŸ”Ό)
2271/2615

Test suite run success

444 tests passing in 31 suites.

Report generated by πŸ§ͺjest coverage report action from 6dd24534cc73bec036bfc3f1569d54630cedfa77