[CQLIT-420] Unexpected error during execution Created: 11/09/23 Updated: 12/05/23 Resolved: 12/05/23 |
|
Status: | Resolved |
Project: | CQL Issue Tracker |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Question/Guidance | Priority: | Moderate |
Reporter: | Jasmin C Smith (Inactive) | Assignee: | Peter Muir |
Resolution: | Done | Votes: | 0 |
Labels: | MD_impact_tracking | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() ![]() ![]() ![]() |
Submitter Resolution Confirmed: | Yes |
Measure Model: | QI-Core/CQL |
2024 Performance Period EC eCQMs: |
CMS0125v12
|
Tool: | MADiE |
Description |
I imported my test cases, and some of them are giving the following error, as well as the entire test case bundle not running with the same error. "The following error occurred in the cql-execution engine: Encountered unexpected error during execution. Error Message: Cannot read properties of undefined (reading 'filter') CQL Library: BreastCancerScreeningFHIR|0.0.001 Expression: FunctionRef ELM Local ID: 126 CQL Locator: 91:25-91:67"
|
Comments |
Comment by Peter Muir [ 12/05/23 ] |
Thank you for notifying of your success. Yes, FHIRHelpers is needed to assist with FHIR to CQL processes. Will flag as resolved. |
Comment by Jasmin C Smith (Inactive) [ 12/05/23 ] |
I was able to solve this issue via a solution for fixing exports in ticket By adding FHIRHelpers to the measure, I was not only able to export the measure, but the original logic worked without throwing the engine errors, and all of my test cases passed! |
Comment by Dorothy Lee [ 12/04/23 ] |
Hi Kim/Peter/Bryn, we may have found the resolution to resolve the execution error upon further investigation. We will circle back with update/findings soon, so the group can probably hold off on adding this to meeting agendas. |
Comment by Kimberly Smuk [ 12/04/23 ] |
Hi Peter and NCQA - do you think it would be helpful to discuss this on tomorrow's FHIR Collab or Thursdays eCQM WG meeting? |
Comment by Jasmin C Smith (Inactive) [ 11/28/23 ] |
Hi Peter! I just wanted to update you with our findings so far. I have tried a couple of different functions based on your suggestions, and I will include the code snippets below. However, when I call in the bodySite aspect, highlighted in red, it continuously causes the same engine execution error. define fluent function isRbodySiteQualifier(condition Condition): define "Right Mastectomy Diagnosis":
define "Right Mastectomy Diagnosis": where exists (UnilateralMastectomyDiagnosis.bodySite C
|
Comment by Peter Muir [ 11/22/23 ] |
Hi Dorothy. I have asked Bryn to respond. Note that "exam" is expressed as a code. It might be beneficial for bodySite funluent function to be added to Authoring Patterns and QICoreCommon? |
Comment by Dorothy Lee [ 11/22/23 ] |
Thank you for flagging and sharing your priorities. Sharing our additional findings in the meantime: MADiE currently doesn’t support display of CQL return type (that is a pending resolution for |
Comment by Peter Muir [ 11/20/23 ] |
ADDENDUM: The rationale for previous suggestion to test of commenting out constraints was to identify that as the issue, not the timing. . bodySite SΣ 0..* CodeableConcept Target body sites Laterality defined as a Direct Reference Code rather than as a member of a value set can have impact. Suggested next steps would be to leave Diagnosis which involve laterality with the laterality constraint commented out. Restore commented out expressions from in if no laterality is specified. Will get to myself when AUr1 tasks completed. |
Comment by Dorothy Lee [ 11/20/23 ] |
Hi Peter, based on these lines that needed to be comment out (in order to resolve the cql-execution error), it seems like the issue could be related to Condition.bodySite since the other lines are common authoring patterns which have not caused cql-execution errors in other measures. A reminder that these CQL lines were able to be saved successfully, and the cql-execution error only occurs when running the test case. The current test cases are all valid in MADiE, and the test cases inclusive of Condition.bodySite seem to be constructed correctly (see snippet below), so the issue seems to reside somewhere else beyond CQL and test case, perhaps in the tooling. { "resourceType": "Bundle", "id": "DENEXPass-UniMastDxRQualOnJan1OfMP", "type": "collection", "entry": [ { "fullUrl": "https://madie.cms.gov/Patient/7e5d94fa-3630-43b6-9b6e-b75c0fba7cd0", "resource": { "resourceType": "Patient", "id": "7e5d94fa-3630-43b6-9b6e-b75c0fba7cd0", "meta": { "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient" ] }, "extension": [ { "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", "extension": [ { "url": "ombCategory", "valueCoding": { "code": "2028-9", "system": "urn:oid:2.16.840.1.113883.6.238", "display": "Asian" } }, { "url": "text", "valueString": "Asian" } ] }, { "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", "extension": [ { "url": "ombCategory", "valueCoding": { "code": "2135-2", "system": "urn:oid:2.16.840.1.113883.6.238", "display": "Hispanic or Latino" } }, { "url": "text", "valueString": "Hispanic or Latino" } ] } ], "identifier": [ { "system": "http://hospital.smarthealthit.org", "value": "999999995" } ], "name": [ { "family": "Bertha", "given": [ "Betty" ] } ], "birthDate": "1973-12-31", "gender": "female" } }, { "fullUrl": "https://madie.cms.gov/Encounter/Encounter-10", "resource": { "resourceType": "Encounter", "id": "Encounter-10", "meta": { "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter" ] }, "subject": { "reference": "Patient/7e5d94fa-3630-43b6-9b6e-b75c0fba7cd0" }, "status": "finished", "class": { "code": "AMB", "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", "display": "ambulatory" }, "type": [ { "coding": [ { "code": "185463005", "system": "http://snomed.info/sct", "display": "Visit out of hours (procedure)" } ] } ], "period": { "start": "2025-01-01T00:00:00.000Z", "end": "2025-01-01T00:00:00.000Z" } } }, { "fullUrl": "https://madie.cms.gov/Condition/Condition-10", "resource": { "resourceType": "Condition", "id": "Condition-10", "meta": { "profile": [ "http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition" ] }, "category": [ { "coding": [ { "code": "problem-list-item", "system": "http://terminology.hl7.org/CodeSystem/condition-category", "display": "Problem List Item" } ] } ], "subject": { "reference": "Patient/7e5d94fa-3630-43b6-9b6e-b75c0fba7cd0" }, "code": { "coding": [ { "code": "248802009", "system": "http://snomed.info/sct", "display": "Absence of breast (finding)" } ] }, "onsetDateTime": "2025-01-01T00:00:00.000Z", "clinicalStatus": { "coding": [ { "code": "active", "system": "http://terminology.hl7.org/CodeSystem/condition-clinical" } ] }, "bodySite": [ { "coding": [ { "code": "24028007", "system": "http://snomed.info/sct", "display": "Right (qualifier value)" } ] } ] } } ] } |
Comment by Jasmin C Smith (Inactive) [ 11/20/23 ] |
CMS125FHIR.txt After some more troubleshooting, I have narrowed down the issue to all of the following lines of code that are commented out. It seems to be something with the timing aspect of these functions, though I am following the same pattern used throughout our measures. When these lines of code are commented out, I am able to at least run the test cases. However, with even one of them commented back in, the test cases will not run at all either as a collective, or individually, with the same ELM errors indicating that particular line of code. |
Comment by Peter Muir [ 11/16/23 ] |
Is there any further detail or localization to the error message? The following is incompletely commented out which can cause issues: Also, you need to also comment out any definitions that used the procedure definition since calling an unknown function would throw an error. Recommend commenting out all procedure definitions and from calling definitions. Will flag for Bryn's attention - you missed your opportunity on the CQM WG call. |
Comment by Jasmin C Smith (Inactive) [ 11/16/23 ] |
I found that I was getting errors for both UnilateralMastectomyLeftPerformed.performed and UnilateralMastectomyRightPerformed.performed. I commented both definitions using these functions out, and then came across this error now.
|
Comment by Peter Muir [ 11/16/23 ] |
re: library BreastCancerScreeningFHIR version '0.0.001' contains: ELM localID="126" points to: library Status version '1.6.000' contains: First, could you please try removing the .isProcedurePerformed() function from the initial retrieve to remove that as a potential factor. Note that USCore and QICore for Procedure profile only specify performedDateTime as must support. If the issue persists, could you please try removing the .toInterval() function from the initial retrieve to remove that as a potential factor. 'performed' for timing may be a <choice type> issue. |
Comment by Jasmin C Smith (Inactive) [ 11/16/23 ] |
I have recreated the json bundle, confirmed the test case in question was no longer invalid, as well as deleted the entire test case, and am still having the issue. |
Comment by Peter Muir [ 11/16/23 ] |
I have reopened since suggested course of action does not appear to have resolved your issue. |
Comment by Lisa Anderson (Inactive) [ 11/16/23 ] |
jasmincimone can you provide additional context and information for what is not working? |
Comment by Peter Muir [ 11/10/23 ] |
Question: "The following error occurred in the cql-execution engine: Encountered unexpected error during execution. Error Message: Cannot read properties of undefined (reading 'filter') CQL Library: BreastCancerScreeningFHIR|0.0.001 Expression: FunctionRef ELM Local ID: 126 CQL Locator: 91:25-91:67" Response: CQL Locator: 91:25-91:67" indicates that the issue relates to line 91, characters 25-67 which is UnilateralMastectomyLeftPerformed.performed in the cql file. Using VScode, one can open the CQL file then right click within and select view the ELM representation, and then search for localId="126". QICore and USCore specify that Procedure.performed[x] is MustSupport for performedDatetime but not for performedPeriod. In MADiE, test case "DENEXFail-UniMastDxRQualOnJan1AfterMP" is invalid with the following Validation error message: , ] , ] ] "coding": [ { "code": "24028007", "system": "http://snomed.info/sct", "display": "Right (qualifier value)" } ] If the above resolves your issue, please set the flag in the issue. |
Comment by eCQM Standards Team [ 11/09/23 ] |
Thank you for submitting a ticket to the CQL JIRA Issue Tracker. Our experts are reviewing your ticket and will provide feedback as soon as possible. Thank you for your patience. |
Comment by Lisa Anderson (Inactive) [ 11/09/23 ] |
jasmincimone did you update the test cases to align with the QI Core profile? If yes, can you update the Measure Model to QI Core? |