generated from mgramigna/typescript-node-starter
-
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
appliesResult to StratifierResult in detailed results output #308
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a64c226
appliesTo functionality in the detailed results
elsaperelli cd80e35
Add additional attribute appliesResult to StratifierResults
elsaperelli 0f94176
Pulled out handling stratifier results
elsaperelli 638cfa5
Remove console.logs, unnecessary function
elsaperelli 8bccbb3
Go through stratifierResults instead of group stratifiers
elsaperelli e5e62a6
handleStratifierValues after individual episode results
elsaperelli c726a36
Add all populations to stratum.population in measure report
elsaperelli 9f1aef3
Add stratifier info to readme
elsaperelli 8fd71a3
Update test/unit/MeasureReportBuilder.test.ts
elsaperelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -304,10 +304,27 @@ export function createPatientPopulationValues( | |
populationGroup.stratifier.forEach(strata => { | ||
if (strata.criteria?.expression) { | ||
const value = patientResults[strata.criteria?.expression]; | ||
|
||
// if the cqfm-appliesTo extension is present, then we want to consider the result of that | ||
// population in our stratifier result | ||
const appliesToExtension = strata.extension?.find( | ||
e => e.url === 'http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-appliesTo' | ||
); | ||
|
||
let popValue = true; | ||
if (appliesToExtension) { | ||
const popCode = appliesToExtension.valueCodeableConcept?.coding?.[0].code; | ||
if (popCode) { | ||
popValue = patientResults[popCode]; | ||
} | ||
} | ||
const result = isStatementValueTruthy(value); | ||
const appliesResult = isStatementValueTruthy(value && popValue); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This call to |
||
|
||
stratifierResults?.push({ | ||
strataCode: strata.code?.text ?? strata.id ?? `strata-${strataIndex++}`, | ||
result, | ||
appliesResult, | ||
...(strata.id ? { strataId: strata.id } : {}) | ||
}); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 isn't the right place to get the results for population as the
patientResults
is the raw data from the engine. The define statement that provides the results might not match the code. Should look back at thepopulationResults
that have already been collected and find bypopulationType
.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.
Additionally the populationResults will not be accurate at this point and should happen after the call to
handlePoulationValues
on line 35.