Uploaded image for project: 'BONNIE MAT MADiE Issue Tracker'
  1. BONNIE MAT MADiE Issue Tracker
  2. BONNIEMAT-986

Invalid unit error with daysSupplied and calculation using supply, dosage, and frequency

XMLWordPrintable

    • Icon: Question Question
    • Resolution: Resolved
    • Icon: Major Major
    • Test Case Builder
    • None
    • BONNIE
    • Bonnie QDM
    • Follow-Up Care for Children Prescribed ADHD Medication (ADD)
    • CMS136
    • QDM/CQL
    • Test, TestCMD
    • Our goal is to test these functions in Bonnie QDM v5.0.0 by Friday 9/10 before submitting proposed logic through Annual Update (AU) Change Review Process (CRP) for public commenting.

      Hi Bonnie QDM Team,

      Our team is testing this function “MedicationPeriod” presented at recent eCQM work group meetings which we will use in 3 eCQMs this year, but we ran into a measure calculation error in Bonnie v5.0.0.

       

      define function "MedicationPeriod"(Medication Choice<"Medication, Order", "Medication, Dispensed", "Medication, Discharge"> ):  Coalesce(MedicationOrderPeriod(Medication), MedicationDispensedPeriod(Medication), MedicationDischargePeriod(Medication)) 
      
      define function "MedicationOrderPeriod"(Order "Medication, Order" ):  if Global.HasEnd ( Order.relevantPeriod ) then Interval[Coalesce(start of Order.relevantPeriod, Order.authorDatetime),  end of Order.relevantPeriod]    else ( Coalesce(Order.daysSupplied, Order.supply /(Order.dosage * ToDaily(Order.frequency)))* ( 1 + Coalesce(Order.refills, 0)) ) durationInDays    let startDatetime: Coalesce(start of Order.relevantPeriod, Order.authorDatetime)    return Interval[startDatetime, startDatetime + durationInDays]
      

       

      For context, this function provides an approach to calculating cumulative medication duration as outlined in QDM 5.6 Section 5.7.3: https://ecqi.healthit.gov/sites/default/files/QDM-v5.6-508.pdf. Further descriptions of the function "MedicationPeriod" can be found in the latest commit of the CumulativeMedicationDuration library on GitHub: https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/tree/master/Source/Libraries.

      Expected performance:

      • Function “MedicationPeriod” will reference function “MedicationOrderPeriod”, which calculates the expected period of a medication order using the following approach: If the `relevantPeriod` element is present and completely specified, it is used directly. If the `daysSupplied` element is present, the duration is `daysSupplied * (1 + refills)`. Otherwise, `daysSupplied` is calculated using `(supply / dosage * frequency)) * (1 + refills)`. The result is then the interval from `authorDatetime` to `authorDatetime + daysSupplied`.

      Test scenario & Measure calculation error:

      • See CMS136v11 test patient “Test, TestCMD” in Population Criteria Section 2 and the result of definition “Test ADHD Medications Taken on IPSD or during Continuation and Maintenance Phase”. We are testing the scenario when Medication Order has no relevantPeriod.end, in which case the logic should use either daysSupplied or a calculation using supply, dosage, frequency to calculate expected period.
      • We started with a Medication order with relevantPeriod.start and no relevantPeriod.end.
        • relevantPeriod.start: 1/1/2012 8:00AM
        • relevantPeriod.end: null
        • authorDatetime: 1/1/2012 8:00AM
      • Adding days supplied attribute triggered measure calculation error with message: “invalid unit 1”. Removing the attribute resolved the error. See screenshot 1 and 2.
        • daysSupplied: 10
        • Refills: Not specified, logic will set to 0
        • Expected result: Interval: 1/1/2012 8:00AM – 1/11/2012 8:00AM
        • Actual result: Measure calculation error
      • Adding all three attributes, dosage, supply, and frequency, triggered measure calculation error with message: “invalid unit 1”. Removing any one of the attributes would resolve the error. See screenshot 3 and 4.
        • Dosage: 10 (no unit specified)
        • Supply: 180 (no unit specified)
        • Frequency: SNOMEDCT code 229797004, “Once daily (qualifier value)” (logic will set to 1)
        • Refills: Not specified, logic will set to 0
        • Expected result: Interval: 1/1/2012 8:00AM – 1/19/2012 8:00AM
        • Actual result: Measure calculation error: invalid unit 1
      • Adding units to attributes dosage and supply also triggered measure calculation error. See screenshot 5 and 6.
        • Dosage: 5 mL (UCUM unit)
        • Supply: 150 mL (UCUM unit)
        • Frequency: SNOMEDCT code 229797004, “Once daily (qualifier value)” (logic will set to 1)
        • Refills: Not specified, logic will set to 0
        • Expected result: Interval: 1/1/2012 8:00AM – 1/31/2012 8:00AM
        • Actual result: Measure calculation error: invalid unit 1

      Please advise on how we can resolve this "invalid unit 1" error. Thank you in advance!

        1. CMS136-v11-1-008-QDM-5-6.zip
          122 kB
        2. Screenshot 1.png
          Screenshot 1.png
          81 kB
        3. Screenshot 2.png
          Screenshot 2.png
          92 kB
        4. Screenshot 3.png
          Screenshot 3.png
          105 kB
        5. Screenshot 4.png
          Screenshot 4.png
          106 kB
        6. Screenshot 5.png
          Screenshot 5.png
          104 kB
        7. Screenshot 6.png
          Screenshot 6.png
          107 kB

            nalbritton Noel Albritton
            dlee38 Dorothy Lee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: