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

Aggregate query calculation error in Bonnie

XMLWordPrintable

    • Icon: Question Question
    • Resolution: Answered
    • Icon: Blocker Blocker
    • Measure Calculation
    • None
    • BONNIE
    • Bonnie QDM
    • FollowUpCareforChildrenPrescribedADHDMedicationADD
    • CMS136
    • QDM/CQL
    • This impacts the upcoming publication for the measure.
    • Show
      https://oncprojectracking.healthit.gov/support/browse/CQLIT-325
    • Yes

      Hi Bonnie team,

      We implemented the following function CMD."RolloutIntervals" in a QDM/CQL measure and uploaded the MAT export to Bonnie v5.1.2.

      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]
            }) 

      This generated multiple errors indicating that the "object null is not iterable (cannot read property Symbol(Symbol.iterator))".

      Please see draft package attached. This function is referenced by the definition "Has ADHD Cumulative Medication Duration Greater Than or Equal to 210 Days".

      This function utilizes the aggregate clause: https://cql.hl7.org/03-developersguide.html#aggregate-queries.

      Per CQL Developer's Guide, "Note that in general, since the type of the aggregate expression is not known until the expression can be semantically analyzed, it may be necessary to provide a typed starting expression as illustrated in this example. The starting clause can be omitted if the type of the result can be inferred from the aggregate expression:"

      We had also tried omitting the starting clause in this aggregate query in MAT, but that generated a different error in MAT. See screenshots below.

      Please advise. Thank you!

            cbartleman@telligen.com Chandra Bartleman
            dlee38 Dorothy Lee
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: