Clinical Quality Language

Grammar Reference

Interactive railroad diagrams for all 113 production rules of the CQL 1.5 grammar. Click any rule name on a diagram to navigate directly to its definition.

library root rule

The root rule of every CQL file. A library may optionally begin with a library declaration, followed by zero or more definitions (using, include, codesystem, valueset, code, concept, parameter), then zero or more statements (expressions, contexts, functions), and finally the end-of-file marker.

View →
v1.5 Mixed Normative / Trial-Use 113 rules · 11 groups

The root production rules that define the overall structure of a CQL library.

Executable declarations within a CQL library: expression definitions, context switches, and function definitions.

Fundamental expression units: literals, identifiers, invocations, and selector expressions.

Lexer token definitions describing the low-level character patterns for identifiers, literals, and other terminal symbols.

Grammar source: HL7 Clinical Quality Language Specification 1.5 (ANTLR4). Non-terminals link to their respective rule pages.