/cql-evaluator

Core cql evaluation modules

Primary LanguageJavaApache License 2.0Apache-2.0

CQL Evaluator

Maven Central Build Status project chat

This project provides a Java-based CQL evaluation environment and related components.

The front-end of the evaluator is the cql-to-elm translator (which provides translation of CQL to ELM) and the backend is the cql-engine (which provides ELM execution). The evaluator glues those two components together and provides DataProvider and TerminologyProvider implementations that allow execution of CQL against a filesystem, FHIR server, and in-process FHIR resources.

Prerequisites

Java 8+

Maven 3.5+

Usage

The cql-evaluator project includes a cli tool that allows execution of CQL from the command line. You can build this tool with:

mvn package

Then you can run the cli with:

java -jar ./evaluator.cli/target/evaluator.cli-2.2.0-shaded.jar --help

That will list the command line options. There is some CQL content available in the Connectathon IG repository. If you have that repository checked out as a sibling repo to this one, you can execute a sample Measure test case by running:

java -jar ./evaluator.cli/target/evaluator.cli-2.2.0-shaded.jar \
--lu ../connectathon/fhir4/input/pagecontent/cql \
--ln EXM104_FHIR4 \
-m FHIR=../connectathon/fhir4/input/tests/EXM104_FHIR4-8.1.000 \
-t ../connectathon/fhir4/input/vocabulary/valueset \
-c Patient=numer-EXM104-FHIR4
-fv R4

Repository Structure

.
|-- evaluator            # core cql-evaluator classes, code to glue the engine/translator together
|   |-- src
|   |   |-- main
|   |   `-- test
|-- evaluator.builder    # factories for constructing a cql-evaluator
|   |-- src
|   |   |-- main
|   |   `-- test
|-- evaluator.cli        # cli tool for running the cql-evaluator
|   |-- src
|   |   |-- main
|   |   `-- test
|-- evaluator.expression # functionality for evaluating CQL snippets
|   |-- src
|   |   |-- main
|   |   `-- test
|-- evaluator.fhir       # FHIR Resource adapters and operations
|   |-- src
|   |   |-- main
|   |   `-- test
|-- evaluator.library    # functionality for evaluating CQL/FHIR Libraries
|   |-- src
|   |   |-- main
|   |   `-- test
`-- evaluator.measure    # functionality for evaluating FHIR Measures
    `-- src
        |-- main
        `-- test

Getting Help

Bugs and feature requests can be filed with Github Issues.

The implementers are active on the official FHIR Zulip chat for CQL.

Inquires for commercial support can be directed to info@alphora.com.

Related Projects

Clinical Quality Language - Tooling in support of the CQL specification, including the CQL verifier/translator used in this project.

CQL Engine - The open source Java-based ELM evaluation engine used in this project.

CQL Support for Atom - Open source CQL IDE with syntax highlighting, linting, and local CQL evaluation provided by this project.

CQF Ruler - Integrates this project into the HAPI FHIR server, providing CQL Library evaluation among other functionality.

License

Copyright 2019+ Dynamic Content Group, LLC (dba Alphora)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.