-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not Equal and Not Equivalent clause coverage calculation handling #291
Conversation
Coverage report
Test suite run success451 tests passing in 31 suites. Report generated by 🧪jest coverage report action from ceb446f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just needs some unit testing.
// If so, we will want to treat this as a 'Not Equivalent' or 'Not Equal' expression which we can do so | ||
// by mapping the 'Equal' or 'Equivalent' clause localId to that of the 'Not' clause | ||
if (statement.operand) { | ||
if (statement.operand.type === 'Equivalent' || statement.operand.type === 'Equal') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole set of logic could use a test case. It's one of the few things in here that isn't tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call! I added a unit test for the !~
...however, I do not think I am able to add a unit test for the !=
logic at the moment since an update to the translator will be coming soon that puts a localId on the Equal
expression (but it doesn't right now). Am I correct in this? @birick1 may have additional insight as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and added test covers most of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regression test shows some changes that were unexpected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New tests are looking good
Summary
#287 contains CMS69 which includes a
!~
(not equivalent) operation in the CQL that has some undesirable coverage calculation behavior due to the way Not Equivalent and Not Equal operations are translated from CQL to ELM json. This PR provides a workaround so that Not Equivalent and Not Equal clauses behave like Equal and Equivalent clauses.New behavior
Before, in order to reach 100% clause coverage with CMS69, test cases where
BMIEncounter.class
WAS equivalent to 'virtual' AND whereBMIEncounter.class
was NOT equivalent to 'virtual' needed to be provided. This behavior did not match the clause coverage highlighting where only the not equivalent test case was needed for the clause to be highlighted as covered. Now, the coverage calculation matches the coverage highlighting. For CMS69 to reach 100% clause coverage, ONLY a test case whereBMIEncounter.class
is NOT equivalent (!~
) to 'virtual' is needed.Code changes
ClauseResultsHelpers.ts
- a workaround was added to for this specific case infindAllLocalIdsInStatement
so that the result of the equal or equivalent is now the result of the not.Testing guidance
npm run check
npm run cli -- detailed -m <path-to-CMS69> --patients-directory <path-to-CMS69-patients-directory> --trust-meta-profile true --debug
on the master branch with the test cases provided in the should result in 96% clause coverage.!~
clause is now included in the calculation.npm link
this branch to fqm-testify to play around with different test cases.