[CQLIT-325] Invalid unit calculation error assistance Created: 07/26/22 Updated: 07/06/23 Resolved: 09/27/22 |
|
Status: | Resolved |
Project: | CQL Issue Tracker |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Question | Priority: | Blocker |
Reporter: | Dorothy Lee | Assignee: | eCQM Standards Team |
Resolution: | Done | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() ![]() ![]() ![]() ![]() ![]() |
Impact: | This impacts the upcoming publication for the measure. |
Description |
Hi Bonnie team, Would you kindly assist with troubleshooting this error message "Invalid unit 1"? This is in relation to but a separate issue from https://oncprojectracking.healthit.gov/support/browse/BONNIEMAT-1207 where there is a logic issue identified for “CumulativeDuration” function to handle null inputs from “RolloutIntervals” function. "CumulativeDuration" function has been removed and I am now only testing “RolloutIntervals” to make sure there are no errors in execution for that function first. "RolloutIntervals" is referenced/nested in these definitions: "Has ADHD Cumulative Medication Duration Greater Than or Equal to 210 Days" and "Initial Population 2". The error message (see screenshot) was displayed when uploading the draft MAT package (see attached) to Bonnie v5.1.2. It appears that the function "RolloutIntervals" is causing this error. Any insights you can provide to help narrow down the issue would be appreciated. Thank you! define function "RolloutIntervals"(intervals List<Interval<Date>> ): intervals I aggregate R starting ( null as List<Interval<Date>>): R union ( { I X let S: Max({ end of Last(R)+ 1 day, start of X } ), E: S + duration in days of X return Interval[S, E]} ) define "Has ADHD Cumulative Medication Duration Greater Than or Equal to 210 Days": "RolloutIntervals"("ADHD Medications Taken on IPSD or During Continuation and Maintenance Phase") define "Initial Population 2": AgeInYearsAt(date from start of "Intake Period")>= 6 and AgeInYearsAt(date from end of "Intake Period" )<= 12 and exists "Qualifying Encounter" and "First ADHD Medication Prescribed During Intake Period" is not null and exists "Has ADHD Cumulative Medication Duration Greater Than or Equal to 210 Days"... |
Comments |
Comment by eCQM Standards Team [ 09/27/22 ] |
Bryn has updated the CumulativeMedicationDuration libraries in MAT and ecqm-content-r4-2022 a) return all define function "CumulativeDuration"(Intervals List<Interval<Date>> ): b) Quantity { value: Coalesce(duration in days of X, 0), unit: 'day' } define function "RolloutIntervals"(intervals List<Interval<Date>> ): ),
This ticket will be closed. Thank you. PMuir MD ICF/ESAC Standards Team. |
Comment by eCQM Standards Team [ 09/08/22 ] |
Bryn discussed updates to the Cumulative Medication Duration shared libraries on the FHIR CQM call 2022-08-16. Changes have been applied to MAT library. The ToDaily() functions are aligned for maximum daily amount calculation across MAT as well as r4-2022 and qicore-2022 in github; however the Rollout Interval and CumulativeDuration edits are only been applied to MAT for Bonnie issue. Will keep this ticket open as tracker for now. |
Comment by eCQM Standards Team [ 08/17/22 ] |
Bryn discussed updates to the Cumulative Medication Duration shared libraries on the FHIR CQM call 2022-08-16. PMuir MD ICF/ESAC Standards Team. |
Comment by Dorothy Lee [ 08/12/22 ] |
Hello! Sharing additional updates to the CQL for the QDM version of CMD.“RolloutInterval” function and CMD.“CumulativeDuration” function. It looks like the following updates to the QDM/CQL CMD functions would be necessary, for the current AU, to fully address the Bonnie QDM errors identified in both this ticket and in CMD.”RolloutIntervals”
CMD.”CumulativeDuration”
//Before define function "RolloutIntervals"(intervals List<Interval<Date>> ): intervals I aggregate R starting (null as List<Interval<Date>>): R union ({ I X let S: Max({ end of Last(R) + 1 day, start of X }), E: S + duration in days of X return Interval[S, E] })define function "CumulativeDuration"(Intervals List<Interval<Date>> ): Sum((collapse Intervals per day) X return all (difference in days between start of X and end of X)+1) //After define function "RolloutIntervals"(intervals List<Interval<Date>> ): intervals I aggregate all R starting ( null as List<Interval<Date>>): R union ( { I X let S: Max({ end of Last(R)+ 1 day, start of X } ), E: S + Quantity { value: Coalesce(duration in days of X, 0), unit: 'day' } return Interval[S, E]} ) define function "CumulativeDuration"(Intervals List<Interval<Date>> ): if Intervals is not null then ( Sum((collapse Intervals per day)X return all(difference in days between start of X and end of X )+ 1 ) ) else null |
Comment by eCQM Standards Team [ 08/12/22 ] |
Hi Dorothy. Just to confirm that define function "RolloutIntervals"(intervals List<Interval<Date>> ): ), ..... define "CumulativeDays": define "Has ADHD Cumulative Medication Duration Greater Than or Equal to 210 Days TEST": define "ADHD Medications Taken on IPSD or During Continuation and Maintenance Phase TEST": define "CumulativeDays TEST": define "Has ADHD Cumulative Medication Duration Greater Than or Equal to 210 Days TEST": Thank you. Will flag for Bryn re shared libraries. PMuir MD ICF/ESAC Standards Team |
Comment by eCQM Standards Team [ 08/12/22 ] |
Hi Dorothy. Thank you for your update. Since your quantity and aggregate comments impact the Cumulative Medication Duration libraries for QDM, FHIR and QI-Core, let us leave this ticket open for now. PMuir MD ICF/ESAC Standards Team |
Comment by Dorothy Lee [ 08/11/22 ] |
Thanks for the update! I may have a solution now. It looks like “duration in days of X” would need to be updated to “Quantity { value: duration in days of X, unit: ‘day’ }”. Making this adjustment would resolve the “Invalid unit 1” error message in Bonnie. This appears to be a similar issue to //Before define function "RolloutIntervals"(intervals List<Interval<Date>> ): intervals I aggregate R starting ( null as List<Interval<Date>>): R union ( { I X let S: Max({ end of Last(R)+ 1 day, start of X } ), E: S + duration in days of X return Interval[S, E]} ) //After define function "RolloutIntervals"(intervals List<Interval<Date>> ): intervals I aggregate all R starting ( null as List<Interval<Date>>): R union ( { I X let S: Max({ end of Last(R)+ 1 day, start of X } ), E: S + Quantity { value: duration in days of X, unit: 'day' } return Interval[S, E]} )
|
Comment by eCQM Standards Team [ 08/10/22 ] |
Update. I have created a test measure that confirmed the issue re RollOutIntervals() and contains modified definitions to display the data at different stages. In progress, although delayed due to other tickets. PMuir MD ICF/ESAC Standards Team |
Comment by Dorothy Lee [ 08/08/22 ] |
Thank you for investigating this issue! Clarifying that the Bonnie error message referenced in this ticket is in relation to the implementation of “RolloutIntervals”. I have included new materials (i.e., two MAT packages and test cases export) for easier replication of the error message in Bonnie v5.1.2. The only difference between MAT packages #1 and #2 is the usage of "RolloutIntervals”. They produce different results when executed against the same test cases in #3. 1. Attachment “CMS136-v12-0-012- define "Has ADHD Cumulative Medication Duration Greater Than or Equal to 210 Days": ( "ADHD Medications Taken on IPSD or During Continuation and Maintenance Phase" ) // "RolloutIntervals"("ADHD Medications Taken on IPSD or During Continuation and Maintenance Phase") 2. Attachment “CMS136-v12-0-013- define "Has ADHD Cumulative Medication Duration Greater Than or Equal to 210 Days": // ( "ADHD Medications Taken on IPSD or During Continuation and Maintenance Phase" ) "RolloutIntervals"("ADHD Medications Taken on IPSD or During Continuation and Maintenance Phase") 3. Attachment “patients_703CC49B-B653-4885-80E8-245A057F5AE9_QDM_56_1659986570” – 3 test cases a) One interval – No issues when executed against #1 and #2 MAT packages b) Two nonoverlapping intervals – No issues when executed against #1 MAT package but generated Bonnie "invalid unit error" when executed against #2 MAT package c) Two overlapping intervals – No issues when executed against #1 MAT package but generated Bonnie "invalid unit error" when executed against #2 MAT package |
Comment by eCQM Standards Team [ 08/01/22 ] |
Hi Dorothy. I still have some further testing CMD and Rollout with additional test cases, but this Coalesce revision to the CQL logic of v12.0.011 seems to avoid the error message so am providing this in the interim to avoid delay: /*PJM original define "Has ADHD Cumulative Medication Duration Greater Than or Equal to 210 Days": define "CumulativeDays": /*PJM not utilized
The above revision passes 91/91 for Population 1 and Population 2 using February patient export from Round 2. Please let me know if the above works for you. (TestPJMCQLIT325 in MAT). PMuir MD ICF/ESAC Standards Team |
Comment by eCQM Standards Team [ 07/28/22 ] |
Thank you for submitting your question. We will review your ticket and provide a response as soon as possible. PMuir MD ICF/ESAC Standards Team |
Comment by Heather Frideres [ 07/28/22 ] |
Moving ticket to the CQL Issue Tracker per discussion with Mathematica. As some fields are removed when moving to that project, documenting the information here. This ticket is regarding the QDM measure CMS 136, FollowUpCareforChildrenPrescribedADHDMedicationADD |
Comment by Heather Frideres [ 07/27/22 ] |
Hello Dorothy, We discussed this ticket with the Bonnie team and also with Mathematica. We are going to transfer this ticket to the CQL Issue Tracker, and will reach out to meeting organizers to request this be included as an agenda item on an upcoming Cooking with CQL or eCQM Working Group call. You indicated this issue impacts publication for CMS136 - is there a deadline we should be mindful of? Thank you |
Comment by MADiE Team [ 07/26/22 ] |
Thank you for submitting your question/issue. We will assign this to a team member and respond in one business day. If your question/issue is related to a particular measure, please upload the corresponding measure package. |