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

Add disableHTMLOrdering Calculation Option #256

Closed sarahmcdougall closed 1 year ago

sarahmcdougall commented 1 year ago

Summary

Adds a new calculation option disableHTMLOrdering that disables CQL statement sorting in HTML output.

New behavior

When the disableHTMLOrdering Calculation Option is used, the CQL statements in the HTML output do not get sorted based on the type of statement (population statement, non-function, function). See https://github.com/projecttacoma/fqm-execution/pull/242 for more information on the sorting that occurs when this calculation option is absent. By default, disableHTMLOrdering is set to false.

Code changes

Testing guidance

  1. Run calculation as is with the CervicalCancerScreeningFHIR measure.

Example CLI command:

npm run cli -- -p ecqm-content-r4-2021/bundles/measure/CervicalCancerScreeningFHIR/CervicalCancerScreeningFHIR-files/tests-denom-EXM124-bundle.json -m ecqm-content-r4-2021/bundles/measure/CervicalCancerScreeningFHIR/CervicalCancerScreeningFHIR-bundle.json -o ordered-output.json --debug
  1. Examine the HTML output for logic highlighting and clause coverage. The HTML output should start with statements “Initial Population,” “Denominator,” “Denominator Exclusions,” etc.
  2. Run calculation with HTML ordering disabled. This can be done by changing line 73 to the line options.disableHTMLOrdering = true; inCalculator.ts. Then, run calculation again with the same command as above, but change the output path to something like unordered-output.json.
  3. Examine the HTML output for logic highlighting and clause coverage. The HTML output should now start with the functions “Normalize Interval,” “Normalize Abatement,” etc.
  4. Compare the clause coverage percentage across the ordered and unordered HTML output - it should be the same. Check that the highlighting is also the same across the two sets of HTML output.
  5. Compare the output of both calculations - the calculation output should be the same. An easy way to do this in VSCode is to use the “Select for Compare” feature with the two JSON files, which shows them side by side and highlights any diffs
github-actions[bot] commented 1 year ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟢 Statements
86.33% (+0.01% 🔼)
2273/2633
🟡 Branches
75.52% (+0.02% 🔼)
2101/2782
🟢 Functions 89.43% 423/473
🟢 Lines
86.65% (+0.01% 🔼)
2193/2531

Test suite run success

426 tests passing in 31 suites.

Report generated by 🧪jest coverage report action from 9081e4a05dc7e61e7973d7d0573e79639c0c1212