Skip to content

Cooking with CQL Q&A: General CQL

cnguyenn4 edited this page Oct 26, 2022 · 13 revisions

Each Q&A has the Cooking with CQL session number and date. For the most current and accurate information, please check the CQL Qs&As for a more recent answer to your question.

$cql operation and test case representation/packaging: Where can I locate the example used in the discussion of $cql operation and test case representation/packaging? (Session 57 - 9/16/21)
Building measures for testing for the September 2022 Connectathon: For the September 2022 Connectathon, is it acceptable to build measures for testing using the Quality Improvement (QI)-Core 2022 repository? (Session 66 - 7/28/22)
  • The standards team is currently addressing a few reported issues within the Visual Studio (VS) Code Clinical Quality Language (CQL) plug-in impacting some functionality (e.g., ToConcept). However, it is appropriate to use the QI-Core 2022 repository for the September 2022 Connectathon. Review known issues with the VS Code CQL plug-in at the GitHub tracking site.
CQL vs FHIRv4.0 nested structures: Is the structure of Clinical Quality Language (CQL) in a similar format to the Fast Healthcare Interoperability Resources® (FHIR®) 4.0 nested structure? (Session 53 - 4/22/21)
  • Yes. The FHIR model information for CQL follows the same structure as in the FHIR documentation. The code, using FHIR version '4.0.1', tells the translator to bring FHIR into scope.

Additionally, the translator has built-in support for several versions of FHIR and the Quality Data Model (QDM) and now has support for dynamic loading of model information.

Databases in CQL: How do we actually use CQL against a database to generate results? Is this just another way to express measure functions, or does it run somewhere? (Session 25 - 5/31/18)
  • CQL is designed to enable the description and distribution of eCQMs, but it also can be a basis for evaluation. There are at least two open source engine implementations of CQL that will actually evaluate the measures and supporting logic.
Double quotes in Clinical Quality Language 1.5 Library: In the Clinical Quality Language 1.5 library, if you use double quotes for identifiers, can you pull in a value set using double quotes? (Session 63 - 4/28/22)
  • Yes, a value set can be referenced using a double-quoted identifier, for example, the "Office Visit" value set.
define "Qualifying Encounters":
	  ( [Encounter: "Office Visit"]
	    union [Encounter: "Preventive Care Services - Established Office Visit, 18 and Up"]
	    union [Encounter: "Preventive Care Services-Initial Office Visit, 18 and Up"]
	    union [Encounter: "Home Healthcare Services"]
	    union [Encounter: "Telephone Visits"]
	    union [Encounter: "Online Assessments"]
	  ) ValidEncounter
	    where ValidEncounter.status = 'finished'
	      and ValidEncounter.period during "Measurement Period"
Fast Healthcare Interoperability Resources® (FHIR®) encounter in a JAVA implementation: In a JAVA implementation, when a __retrieve__ expression is performed on a Fast Healthcare Interoperability Resources® (FHIR®) encounter, does the __retrieve__ expression return a FHIR object, or is the object transformed into a tuple, and is the alias a tuple type? (Session 63 - 4/28/22)
  • In the JAVA implementation, data is physically represented as JAVA objects. The core engine defines interfaces for dealing with data access, terminology, and library loading, and the implementation of the interface is responsible for providing the actual data in response to a retrieve. In this case, a HAPI FHIR client is used, so the object is an instance of a HAPI FHIR Encounter class. Clinical Quality Language (CQL) supports both class and tuple types (aka anonymous types). The result of a retrieve is typed as a class, but class types are generally compatible with tuple types with the same structure, so most operations can be performed on either. One exception is the type testing operations, where is and as will only work with the actual type. Note also that using the return clause to shape the result of a query will typically result in a tuple type as well.
IG Refresh tooling: In the IG Refresh tooling, when tracking patients that are inpatients in the hospital and have outpatient visits, can a quality measure reference data that would be expected to be present in different systems across both those visits? (Session 56 - 7/29/21)
  • Measure specifications do not specify the location of the data or what system the data comes from, although eCQM guidance indicates that the data come from an Electronic Health Record. Current reporting processes typically report from a single data store, though that store may itself be an aggregate such as an HIE. Digital Quality Measures explicitly recognize that data for a measure may come from various sources, including EHRs, Clinical Data Repositories, Health Information Exchanges, and even Personal Health Records and other patient feeds. As an exchange standard, FHIR supports the description of data across all of these servers by using web URLs to reference resources. Note that some expressions used to trace references within FHIR CQL assume that the reference’s logical ID is on the same server., which is a known gap. Approaches are being added to CQL used in a FHIR context to address this issue.
Measuring negation using QI-Core: If measuring a negation using Quality Improvement-Core, is it a requirement to use one code in the value set as a direct reference code? (Session 67 - 9/29/22)
  • Yes. Use a single code in a direct reference code to measure negation.
September 2022 Connectathon testing: Can we use the Quality Improvement (QI)-Core 5.0 release in the September 2022 Connectathon? (Session 66 - 7/28/22)
  • The QI-Core 5.0 release will probably not be ready for the September 2022 Connectathon. We will use the 4.1.1 QI-Core release for testing.
Status information on negation in QI-Core: Where is the status information on negation in Quality Improvement Core (QI-Core) to understand the details and nuances of the functionality? (Session 67 - 9/29/22)
  • You can find this information in the QI-Core Implementation Guide. We currently have this information in the Negation Reason Codes discussion and each of the profiles in QI-Core have the examples and usage. We also have a patterns page for high-level patterns. This guidance is being applied as part of the latest ballot for QICore and will be available in the next published release.
Testing negation in QI-Core at the September 2022 Connectathon: At the September 2022 Connectathon, when testing negation in Quality Improvement-Core (QI-Core), did measure developers install a new plug-in resulting in a change in logic and test cases? (Session 67 - 9/29/22)
  • The change was not related to the logic, but to the profile tag. The profile tag on the resource states this device request conforms to the QI-Core DeviceNotRequested profile. In Clinical Quality Language (CQL,) when logic asks for DeviceNotRequested, the profile tag is used. If you remove this meta profile tag, then the logic will not work correctly. You must use the profile tag. Additionally, the release of Visual Studio Code CQL plug-in v0.4.0 was around the time of Connectathon, which provided other features.
Use of direct reference codes for the negation expression in QDM measure: In the current Quality Data Model (QDM) measures for the Annual Update, direct reference codes are not used in the negation expression. Can you use direct reference codes for the negation expression in the QDM measure? (Session 67 - 9/29/22)
  • No. Direct reference codes will not work in QDM for negation purposes.
Use of negation in future FHIR updates: Will there be updates to the use of negation in future updates of Fast Healthcare Interoperability Resources®? (Session 67 - 9/29/22)
  • There is a plan for support of negation logic for the next Annual Update.

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