The HL7 CQL specification defines both a high-level, author friendly syntax for expressing clinical knowledge, as well as a machine friendly, syntax-independent canonical representation of clinical knowledge called Expression Logical Model (ELM). The high level syntax is designed to support measure and decision support authors, while the canonical representation is designed to support point-to-point sharing and machine processing applications.
The specification describes a formal mechanism for translating the high-level CQL syntax into the canonical ELM representation. This project provides a reference implementation of that translation. The translation component is designed to support use within an Integrated Development Environment (IDE), and has several options and features focused on providing translation support in such an environment. The reference implementation is intended to be used in support of CQF implementations as a tool to enable CQL output to be uniformly and automatically translated into ELM XML or JSON documents for sharing and distribution to support implementation, integration, translation, and execution of CQL-based artifacts.
The CQL-to-ELM Translator is licensed under the open source Apache Version 2.0 license, and releases are made available via the Sonatype Maven repository:
<repository>
<id>sonatype-public</id>
<name>Sonatype Public</name>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
The cql
, model
, elm
, and cql-to-elm
packages are required to use the translator:
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>cql</artifactId>
<version>1.2.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>model</artifactId>
<version>1.2.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>elm</artifactId>
<version>1.2.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>cql-to-elm</artifactId>
<version>1.2.5-SNAPSHOT</version>
</dependency>
In addition, to use the translator with QDM, FHIR, and QUICK, the model info packages must be included:
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>quick</artifactId>
<version>1.2.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>info.cqframework</groupId>
<artifactId>qdm</artifactId>
<version>1.2.5-SNAPSHOT</version>
</dependency>
CQL is defined using an ANTLR4 grammar. ANTLR4 is a simple language for describing language grammars and automatically generating the lexical analysis and parsing components for the resulting grammar. The CQL-to-ELM translator uses the visitor classes generated by ANTLR4 to perform the translation processing.
The CQL-to-ELM Translator is substantially complete, supporting all language constructs of the latest version of CQL (Release 1 STU 2 (1.2)), as well as a broad range of functionality to support use of the translator in an Integrated Development Environment. Implementations making use of the translator can submit issues and track resolution progress through the Issues tracker in the Github repository.