Closed elsaperelli closed 11 months ago
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 |
444 tests passing in 31 suites.
Report generated by π§ͺjest coverage report action from 6dd24534cc73bec036bfc3f1569d54630cedfa77
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 theSDE Sex
definition could never be highlighted. We now have a way to identifyNull
literals (andLiteral
types with valuefalse
) and make sure they are highlighted based on whether or not they were executed rather than their value (which isnull
orfalse
).In addition, we noticed that the
when
andthen
parts of the case statements were not getting highlighted even though they were included in the clause coverage calculation. This also required an update infindAllLocalIdsInStatement
inClauseResultsHelpers.ts
so thatwhen
pieces of CaseItems get results from the expression that defines them (use ofsourceLocalId
).Code changes
.gitignore
- Update paths.ClauseResultsBuilder.ts
- UpdatesetFinalResults()
to set the result of aNull
orLiteral false
to true if its localId exists inrawClauseResults
.ClauseResultsHelpers.ts
- UpdatefindAllLocalIdsInStatement()
to handlewhen
pieces of CaseItems, nulls, and false literals.ClauseResultsHelper.test.ts
- Add unit tests for the new cases.CaseStatement.cql
- simple CQL of a case statement for unit testing.CaseStatement.json
- generated ELM json (generated using the Makefile in this directory) fromCaseStatement.cql
for unit tests.Testing guidance
npm run test:plus
npm run check