Skip to content

QA First and Intersect

Darren Duncan edited this page Oct 12, 2017 · 1 revision

Questions and Answers


Q&A - First and Intersect

Question

I encounter one issue after using new structure of First ICU. This is the last issue for VTE-2 measure I am currently working on. The package is successfully exported from MAT but it shows 8 issue cases that are all related to the "intersect" in "Numerator".

  define "Numerator":
    "VTEProphylaxis"
    union
    (
      "Medication of Xa"
      intersect
      (
        "Diagnosis of Atrial Fib_VTE"
        union
        "Procedure of Hip Knee"
      )
    )

  define "First ICU": 
    "Initial Population" E
      return
        First(
          ["Encounter, Performed": "ICU Admission or Transfer"] ICU
            where ICU.relevantPeriod during E.relevantPeriod
            sort by start of relevantPeriod
        )

  define "Medication of Xa":
    (
      from 
        "First ICU" ICU,
        ["Medication, Administered": "Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment"] M
      where M.relevantPeriod starts 1 day or less on or after day of start of ICU.relevantPeriod
        and M.relevantPeriod starts on or after start of ICU.relevantPeriod
      return ICU
    )
    union
    (
      from 
        "First ICU" ICU,
        ["Procedure, Performed": "General or Neuraxial Anesthesia"] P,
        ["Medication, Administered": "Oral Factor Xa Inhibitor for VTE Prophylaxis or VTE Treatment"] M
      where P.relevantPeriod ends 1 day or less on or after day of start of ICU.relevantPeriod
        and P.relevantPeriod ends on or after start of ICU.relevantPeriod
        and M.relevantPeriod starts 1 day or less on or after day of end of P.relevantPeriod
        and M.relevantPeriod starts on or after end of P.relevantPeriod
      return ICU
    )

  define "Procedure of Hip Knee":
    "Initial Population" E
      with (
        ["Procedure, Performed": "Hip Replacement Surgery"]
        union
        ["Procedure, Performed": "Knee Replacement Surgery"]
      ) P
        such that P.relevantPeriod starts on or before end of E.relevantPeriod

In Bonnie, case shows passing "Medication of Xa" and "Procedure of Hip Knee" as individual definition, but "intersect" does not work so Numerator section failed. I think it might be because "Medication of Xa" return "First ICU" and another return "Initial Population"? But "First ICU" return Initial Population with First of ICU as well. If that is the issue, how to fix it?

Answer

Yes, that's the issue, the Medication of Xa is returning the ICU Encounter, but the Procedure of Hip Knee is returning the Inpatient Encounter in the Initial Population, so the intersection is empty.

Is the intent that there must be an ICU encounter? If so, you could specify the Medication of XA as a "with":

  define "Encounters with Medication of Xa":
    "Initial Population" Encounter
      with "Medication of Xa" Medication
        such that Medication.relevantPeriod during Encounter.relevantPeriod

  define "Numerator"
    "VTEProphylaxis"
      union
    (
      "Encounters with Medication of Xa"
        intersect
        (
          "Diagnosis of Atrial Fib_VTE"
            union "Procedure of Hip Knee"
        )
    )

Wiki Index

Home

Authoring Patterns - QICore v4.1.1

Authoring Patterns - QICore v5.0.0

Authoring Patterns - QICore v6.0.0

Authoring Measures in CQL

Composite Measure Development

Cooking with CQL Examples

Cooking with CQL Q&A All Categories
Additional Q&A Examples

CQL 1.3 Impact Guidance

CQL Error Messages

Developers Introduction to CQL

Discussion Items

Example Measures

Formatting and Usage Topics

Formatting Conventions

Library Versioning

Negation in QDM

QDM Known Issues

Specific Occurrences

Specifying Population Criteria

Supplemental Data Elements

Terminology in CQL

Translator Options For Measure Development

Unions in CQL

Clone this wiki locally