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

Madie production FQM-Execution-Execution bug #227

Closed
mcmcphillips opened this issue Apr 19, 2023 · 3 comments · Fixed by cqframework/cql-execution#310
Closed

Madie production FQM-Execution-Execution bug #227

mcmcphillips opened this issue Apr 19, 2023 · 3 comments · Fixed by cqframework/cql-execution#310
Labels
added to backlog Task has been added to the team's backlog and will be prioritized accordingly bug Something isn't working engine Issues related to the uderlying execution engine and data source

Comments

@mcmcphillips
Copy link

Summary

When running FQM execution with the provided measure bundle and patient bundle, an error is thrown specifying an iterable.
Elm for supporting libraries does not appear to have any issues.

` error occurred in FQM-Execution TypeError: The following error occurred in the cql-execution engine: intervals is not iterable

- Inspect the content of the ELM and ensure the data types in the expressions are correct


at collapseIntervals (interval.js:606:1)
at Collapse.exec (interval.js:599:1)
at async Collapse.execute (expression.js:24:1)
at async Promise.all (index 0)
at async Query.exec (query.js:196:1)
at async First.exec (list.js:224:1)
at async First.execute (expression.js:24:1)
at async Promise.all (index 0)
at async OverlapsAfter.exec (interval.js:165:1)
at async OverlapsAfter.execute (expression.js:24:1)

o`

Expected Behavior

FQM-Execution Calculate.calculate runs without error

Version or Commit

Inputs (e.g. Measure Bundle, Patient Bundle, CQL Library)

measure bundle
ATM-v0.0.000-FHIR.txt
patient bundle
patientBundle.txt

Relevant Calculation Options (e.g. Measurement Period, meta.profile Validation)

cql-to-elm Version Used for Measure Logic Translation (if known)

Any Additional Info

@mgramigna

@JSRankins
Copy link

Attached is the JSON.
patientBundle.txt

@mgramigna mgramigna added bug Something isn't working engine Issues related to the uderlying execution engine and data source added to backlog Task has been added to the team's backlog and will be prioritized accordingly labels Apr 20, 2023
@natjoe4
Copy link
Contributor

natjoe4 commented Apr 21, 2023

@JSRankins, @mcmcphillips Thank you for bringing this to our attention. @elsaperelli and I traced this error back to an issue in cql-execution that caused calculation to fail when collapsing a null interval.

From AHAOverall.cql Library:

when Event is MedicationRequest then
                  First( ( collapse (Event.dosageInstruction.timing.repeat.bounds DoseTime
                                        return DoseTime.toInterval()) ) DrugPeriods
                           sort by start of $this ) overlaps after day of ModerateOrSevereLVSDHFOutpatientEncounter.period 

The MedicationRequests included in the Patient Bundle do not have values for dosageInstruction.timing.repeat.bounds[x], so DoseTime.toInterval() was evaluating to null. Cql-execution's interpretation of collapse had a small logic issue that caused the argument of the collapse function to be iterated over before checking if it was null hence the intervals is not iterable message. We submitted the above PR to cql-execution, and were able to successfully run calculation with your bundles after these changes.

@hossenlopp
Copy link
Contributor

This has been fixed and published to npm in cql-execution v3.0.0-beta.5 and fqm-execution v1.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
added to backlog Task has been added to the team's backlog and will be prioritized accordingly bug Something isn't working engine Issues related to the uderlying execution engine and data source
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants