Skip to content

Cooking with CQL Examples

Bryn Rhodes edited this page Jun 30, 2019 · 56 revisions

This page provides an index to the examples developed as part of the Cooking with CQL Series of Webinars in reverse chronological order. Cooking with CQL examples are collected from various sources including participant submissions. Please feel free to submit examples to cql-esac@esacinc.com.

Cooking with CQL - Session 37 - TBD

In this session we are currently planning to review:

  1. Medications present on admission
  2. Representing SQL joins in CQL

Cooking with CQL - Session 36 - 2019-06-27

In this session we reviewed:

  1. Criteria with nested definitions
  2. Hospitalization with observation function
  3. QDM versus CQL timing phrases and interpretation
  4. Pressure Injury Measure

Cooking with CQL - Session 35 - 2019-05-23

In this session we reviewed:

  1. Multi-source Query Examples
  2. Timing Considerations given new QDM 5.5 timing attributes

Cooking with CQL - Session 34 - 2019-04-25

In this session we reviewed examples from questions and issues that have been submitted through the CQL Issues tracker:

Cooking with CQL - Session 33 - 2019-03-28

In this session we reviewed the following:

  • QDM 5.5 Change Review

  • CQL 1.4 Ballot Review

  • Negation Rationale Examples

  • Related Context Retrieves

  • Examples

Cooking with CQL - Session 32 - 2019-02-28

In this session we will review common patterns from across all the measures:

  1. Age Calculation
  2. Most Recent Lab Result
  3. Comparing Pairs of Events
  4. Sequential Events
  5. Age Based Risk Factors
  6. Followup Timeframe
  7. Intermediate Results
  8. Maximum Value
  9. Determining Coverage

Cooking with CQL - Session 31 - 2019-01-31

In this session, we reviewed and discussed:

  1. Singleton Results
  2. Lowest Most Recent Blood Pressure
  3. Same Or After Semantics
  4. Default Temporal Precision
  5. Blood Pressure Exam Without Inpatient Stay
  6. Coalesce Semantics
  7. Glucocorticoid Dosage

Cooking with CQL - Session 30 - 2018-12-06

In this session, we reviewed and discussed:

  1. Characterization of Hypoglycemia Risk
  2. Appropriate use of anti-MRSA Antibiotics
  3. Positive Depression Screening
  4. ACO38 - "Risk Standardized Readmission Rates" - Part I (Diagnosis Counts)
  5. ACO38 - "Risk Standardized Readmission Rates" - Part II (Risk Adjustment Variables)

Cooking with CQL - Session 29 - 2018-10-25

In this session we reviewed:

  1. Measure Terminology Usage and the Value Set Authority Center
  2. Hospitalization Admission Source CQLIT-136
  3. Calculate Age Discussion
  4. Calendar Age for Immunization Question
  5. Naming conventions for Boolean-valued expressions

Cooking with CQL - Session 28 - 2018-09-27

In this session we reviewed:

  1. A Continuous Variable Ratio Measure (Hypoglycemia)
  2. First occurrence of a blood transfusion
  3. Blood pressure readings as an average
  4. Calculating conception date using gestational age assessments
  5. Reviewed user-defined functions in CQL
  6. Indicators of adverse events following a blood transfusion
  7. Calculation methods for determining doses per day using QDM medication elements

Cooking with CQL - Session 27 - 2018-07-26

In this session we reviewed the concept of "Observation Status" and its impact on the definition of an Episode-of-Care. We then looked at how that would impact the existing Hospitalization functions and proposed new Hospitalization with Observation and Hospitalization with Outpatient functions to allow observation to be considered as part of an episode-of-care within a measure.

Cooking with CQL - Session 26 - 2018-06-28

In this session we reviewed:

  • Stratification
  • Supplemental Data
  • Risk Adjustment Variables
  • Common Error Messages

For Stratifiers, Supplemental Data Elements, and Risk Adjustment Variables, we used a draft contraceptive measure to illustrate building these components. The draft measure is included in the examples for this session here.

For CQL Validation Messages, we've developed a new topic on the CQL Formatting and Usage wiki that provides CQL authors with an overview of how validation is performed on CQL, the kinds of messages that it will produce, and a catalog of validation messages that may be encountered when authoring CQL in tools like the Measure Authoring tool.

The new page is available in the CQL Error Messages topic.

Cooking with CQL - Session 25 - 2018-05-31

In this session we reviewed the following:

  1. Calculation Differences between QDM Logic and CQL
  2. Negation Redux
  3. QDM 5.4 Upcoming Changes Review

Cooking with CQL - Session 24 - 2018-04-26

In this session we reviewed the following:

  1. Detailed Review of the Overlaps operator
  2. A Claim query in FHIR
  3. Regional Anesthesia Measure Question
  4. Review of Contraceptive Provision Measure
  5. Radiology Report Measure Discussion

Cooking with CQL - Session 23 - 2018-03-29

In this session we reviewed the following:

  1. Representation of QDM specific occurrences in CQL
  2. Walkthrough of CQL representation of CMS 105

Cooking with CQL - Session 22 - 2018-02-22

In this session we reviewed the following:

  1. Encounter diagnoses
  2. ED Encounters
  3. Consecutive Heart Rates
  4. Allergy to Eggs
  5. Smoking Cessation

Cooking with CQL - Session 21 - 2018-01-18

In this session we reviewed the following:

  1. 2nd Tylenol Administration During an Encounter
  2. Vaccination Example from NCQA
  3. Opioid Overuse Potential Quality Measure Utilizing Decision Support Logic for MME Calculation

Cooking with CQL - Session 20 - 2017-11-30

In this session we provided an introduction to and overview of CQL using a measure tour of the Public Comment review draft version of CMS 117 - Infant Vaccination.

Cooking with CQL - Session 19 - 2017-10-26

This session covered the following topics:

  1. Hepatitis B Vaccination in an adolescent vaccine measure
  2. Turning a specific age during the measurement period
  3. Review of portions of CMS program measure drafts of 128, 159, 160, 161, and 169

Cooking with CQL - Session 18 - 2017-09-21

This session covered the following topics:

  1. Matching Multiple Encounter Diagnoses
  2. Determining Arrival and Departure Time from Multiple Facility Locations
  3. Addressing Multiple Components of a Diagnostic Study

Cooking with CQL - Session 17 - 2017-08-17

This session covered the following topics:

  1. Use of terminology operations and references in measures
  2. Use of multi-source queries
  3. QDM-CQL side-by-side review of CMS 68 and CMS 22
  4. Review of the common library functions available in the MAT
  5. Use of plural attributes in the upcoming QDM 5.3 release
  6. Use of the relatedTo attribute to implement fulfills in the upcoming QDM 5.3 release
  7. Preliminary review of calculations with quantities

Cooking with CQL - Session 16 - 2017-07-20

This session covered the following topics:

  1. Review of test measure 68: Medications documented
  2. Using exists with a singleton
  3. Using "choice" unions
  4. Review of test measure 111: continuous variable measures
  5. Combining "and" and "not"
  6. QDM vs CQL timing calculations
  7. Length Of Stay calculations

Cooking with CQL - Session 15 - 2017-06-15

In this session we reviewed QDM 5.3, then discussed how result types are used and determined by expressions within CQL. We then reviewed issues with an expression of AMI8 and CMS31.

Cooking with CQL - Session 14 - 2017-05-18

In this session we reviewed creation of libraries in the MAT, and then focused on the use of specific occurrences in a complex stroke measure, CMS72v5. We then used the Hospitalization function to demonstrate how to significantly simplify the logic of CMS72v5, avoiding the need to express the difference between inpatient encounters with and without prior emergency department visits in each criterion.

Cooking with CQL - Session 13 - 2017-04-20

In this session, we focused on continuous variable measures, as well as demonstrated the use of common functions between measures that could potentially be added to a common library. Specifically, we worked CMS32, CMS55, and CMS111.

Cooking with CQL - Session 12 - 2017-03-16

In this session, we expressed a complete measure (CMS146) in CQL and the MAT and produced the HQMF artifacts. The measure example was chosen for its use of specific occurrences. The "working" version of the example measure contains walkthrough text describing how the measure development proceeded. The final version of the example measure library is CMS146.cql.

Cooking with CQL - Session 11 - 2017-02-16

In this session, we focused on valuesets expressed in measure CMS53. We also identified valuesets MultipleWithClauses. The "working" version of the example measure contains walkthrough text describing how the measure development proceeded.

Cooking with CQL - Session 10 - 2017-01-26

In this session, we focused on valuesets expressed in measure CMS22. We also identified valuesets RelatedToGestationalAge. The "working" version of the example measure contains walkthrough text describing how the measure development proceeded.

Cooking with CQL - Session 09 - 2016-11-17

In this session, we focused on valuesets expressed in the following measures:

  • CMS129 - Variable definition with Most Recent and attributes;

  • CMS104 -Denominator Exclusion with multiple discharge statuses;

  • CMS154 - Denominator Exclusion with timing relative to a Diagnosis;

  • CMS72 - Denominator Exception;

  • CMS105 – Discharged on Statin medication. The "working" version of the example measure contains walkthrough text describing how the measure development proceeded.

  • Examples

Cooking with CQL - Session 08 - 2016-10-20

In this session, we discussed JIRA ticket CQM-1608 about VTE prophylaxis DuringObservation. We also focused on valuesets expressed 3 different measures – CMS117, CMS9, and CMS104. The "working" version of the example measure contains walkthrough text describing how the measure development proceeded.

Cooking with CQL - Session 07 - 2016-09-15

In this session, we focused on valuesets expressed in 7 different measures – CMS143, CMS149, CMS165, CMS102, CMS 124, CMS65, and CMS 159. The "working" version of the example measure contains walkthrough text describing how the measure development proceeded.

Cooking with CQL - Session 06 - 2016-08-18

In this session, we reviewed QDM version 4.3 and draft of QDM 5.0 for Clinical Quality Language Measure Developers. There are no examples associated with this session.

  • This session covered changes to QDM 5.0, there are no examples associated

Cooking with CQL - Session 05 - 2016-07-21

In this session, we focused on the use of CQL with FHIR and the differences between QDM version 4.2 and QDM version 5.0 for Negation Rationale and Timing Periods. We also discussed the definitions of Assessment Result Types, Care Goal, Transfer From, Transfer To, Cumulative Medication Duration, and Allergy and AdverseEvent.

Cooking with CQL - Session 04 - 2016-06-30

In this session, we focused on the feedback received from Session 3. We looked at various criteria in the measure, CMS159, as presented in the clean version. The criteria discussed were Initial Population, $DepressionEncounter, $DepressionEncounterBH, $DepressionF2Fnomed, and $DepressionIndex. The "working" version of the example measure contains walkthrough text describing how the measure development proceeded.

The next part looked at a different measure, CMS9v5 (Exclusive Breastmilk Feeding), and described this episode-based measure in QDM and looked at how it is expressed in CQL. We looked at Population Criteria, Data Criteria, Supplemental Data Elements, and Risk Adjustment Variables as presented in the clean version. The "working" version of the example measure contains walkthrough text describing how the measure development proceeded.

Cooking with CQL - Session 03 - 2016-06-09

In this session, we shared a new resource that will help explain all things CQL and will host the examples presented in the Cooking with CQL sessions. The link to the resource is https://github.com/esacinc/CQL-Formatting-and-Usage-Wiki/wiki/Cooking-with-CQL-Examples and is titled CQL Formatting and Usage Wiki.

We also focused on describing initial populations as seen in the “Clean Version” using examples from the following measures: Patient-based Proportion Measure

  • CMS117 – Age and encounter;
  • CMS125- Age, sex, and encounter;
  • CMS129 – Diagnosis overlaps MP and sex;
  • CMS138 – Count of encounters;
  • CMS135 - Count of encounters with diagnosis;
  • CMS136 – Cumulative medication;
  • CMS140 – First occurrence;
  • CMS154 – Satisfies any with satisfies all;
  • CMS159 – Timing, diagnosis, satisfies; Episode of Care Proportion Measure;
  • CMS53 – Diagnosis overlaps encounter;
  • CMS113 – Procedure during encounter; Episode of Care Continuous Variable Measure;
  • CMS55 – Encounter relative to another encounter;
  • CMS111 – Encounter relative to another encounter Procedure-based Proportion Measure;
  • CMS133 – Procedure relative to MP end.

The "working" version of the example measure contains walkthrough text describing how the measure development proceeded.

Cooking with CQL - Session 02 - 2016-05-19

The Cooking with CQL sessions provides guidance on how to use CQL to express measures. In this session, we focused on how to calculate age in CQL by describing various criteria using examples from the following measures:

  • CMS132 – Initial Population;

  • CMS104 - Initial Population, $EncounterInpatientNonElective;

  • CMS122 - Initial Population;

  • CMS113 - Initial Population, $EncounterInpatient;

  • CMS2 - Initial Population;

  • CMS124 - Initial Population;

  • CMS153 - Initial Population, Stratification 1, Stratification 2;

  • CMS82 - Initial Population, Numerator.

  • Examples

Cooking With CQL - Session 01 - 2016-04-28

In this session, we demonstrated how to build an eCQM using CQL. The measure focused in this session is the PHQ-9 Scoring examples, as there are difficult criteria of this measure to express in CQL. Specifically, we focused on understanding “Measurement Period” using QDM version 4.2. In example 1, we discussed the measure “utilization of the PHQ-9 to monitor Depression Symptoms for Adolescents and Adults,” we explored the Measurement Period as defined in “In Initial Population”, “Depression Encounter”, “Depression Diagnosis”, “Assessment Period 1”. “Assessment Period 2”, and “Assessment Period 3.” We also looked at different numerator and stratification examples.

Example 2 looked at the measure “Depression Remission or Response for Adolescents and Adults” using the “Measurement Period” and evaluated “Initial Population”, Depression Followup, Depression Remission, Depression Response, Depression Encounter, and Depression Index.

You can’t perform that action at this time.