Uploaded image for project: 'CQL Issue Tracker'
  1. CQL Issue Tracker
  2. CQLIT-162

Interval with NULL and closed endpoints

XMLWordPrintable

    • Icon: Question Question
    • Resolution: Done
    • Icon: Moderate Moderate
    • None
    • None
    • All patients with Major Depressive disorder diagnosis, and no AntidepressantDispensed qualify for IPOP.

      CMS 128 'Has Initial Major Depression Diagnosis' uses an Interval with both low and high endpoints closed.  In CQL this is expressed as

      MajorDepression.prevalencePeriod starts 60 days or less before or on day of AntidepressantDispensed.authorDatetime

       

      In ELM JSON, this becomes:

      {{{}}
        "locator" : "55:56-55:70",
        "lowClosed" : true,
        "highClosed" : true,
        "type" : "Interval",
          "low" : {
          "locator" : "55:116-55:129",
          "type" : "Subtract",
            "operand" : [ {
              "localId" : "122",
              "locator" : "55:92-55:129",
              "path" : "authorDatetime",
              "scope" : "AntidepressantDispensed",
              "type" : "Property"
            }, {
              "localId" : "123",
              "locator" : "55:56-55:62",
              "value" : 60,
              "unit" : "days",
              "type" : "Quantity"
            } ]
          },
          "high" : {
            "localId" : "122",
            "locator" : "55:92-55:129",
            "path" : "authorDatetime",
            "scope" : "AntidepressantDispensed",
            "type" : "Property"
      {{    }}}
      {{  }}}
      }

      The Logical spec states for Interval

      If the low bound of the interval is null and closed, the interval is interpreted to start at the minimum value of the point type, and computations involving the low boundary will be performed with that value.

       
      and
       

      If the high bound of the interval is null and closed, the interval is interpreted to end at the maximum value of the point type, and computations involving the high boundary will be performed with that interpretation.

      So if the AntidepressantDispensed is Null, the Subtract of 60 days results in Null, "If either argument is null, the result is null" making the low Null, and the High is also Null.  

      So the resulting Interval has two Null and Closed DateTime endpoints which result in an infinite date range.  This removes the requirement of having AntidepressantDispensed, which can't be right either.

      Can you provide guidance as to where we are going wrong?

      Many thanks for your help, this is a long one.

            bryn_rhodes Bryn Rhodes
            theschmitzer Jeff Schmitz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: