Skip to content
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

MAT-7668: Ignore localIds not related to coverage calculation. #269

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 7 additions & 1 deletion dist/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,9 @@ module.exports = class MeasureHelpers {
emptyResultClauses,
parentNode,
) {
// Nearly all ELM nodes now have a localId. We can no longer rely on the presence or lack of a localId to determine
// whether a node's localId should be collected.

// Stop recursing if this node happens to be any TypeSpecifier. We do not want to collect localIds for these clauses
// as they are not executed and will negatively affect clause coverage if captured here. ChoiceTypeSpecifiers do not
// identify their type and instead put [] at the `type` attribute which is a deprecated field.
Expand All @@ -684,6 +687,9 @@ module.exports = class MeasureHelpers {
) {
return localIds;
}
// Stop recursing if this node represents the Patient obj since it is not part of coverage consideration.
if (statement?.name === "Patient") return localIds;

// looking at the key and value of everything on this object or array
for (const k in statement) {
let alId;
Expand Down Expand Up @@ -872,7 +878,7 @@ module.exports = class MeasureHelpers {
} else if (k === 'localId') {
localIds[v] = { localId: v };
// if the value is an array or object, recurse
} else if (Array.isArray(v) || typeof v === 'object') {
} else if (Array.isArray(v) || (typeof v === 'object' && k !== "codes")) {
this.findAllLocalIdsInStatement(
v,
libraryName,
Expand Down
Loading
Loading