Clinical Quality Language (CQL) is a high-level, domain-specific language designed to express clinical quality measures (eCQMs) and clinical decision support (CDS) rules. It enables the authoring of logic that queries and manipulates clinical data retrieved via a FHIR-based data model, known as the Quality Data Model (QDM) or FHIR directly. CQL is designed to be both human-readable, allowing clinicians to validate the intent of a measure, and computable, enabling direct execution by a CQL engine against a FHIR server or clinical data repository.
Glossary
Clinical Quality Language (CQL)

What is Clinical Quality Language (CQL)?
Clinical Quality Language (CQL) is an HL7 authoring standard for expressing clinical quality measures and decision support rules in a human-readable, computable format that leverages a FHIR-based data model.
CQL separates the expression of clinical logic from the implementation details of data retrieval, using a declarative syntax inspired by languages like SQL and XQuery. It defines libraries of reusable logic, value sets for terminology binding, and expressions that compute scores, stratifications, and patient cohorts. The standard is integral to the FHIR Clinical Reasoning module, where CQL libraries are packaged as Library resources and evaluated by a $evaluate operation, enabling interoperable, shareable clinical knowledge artifacts across healthcare systems.
Key Features of CQL
CQL is an HL7 standard for expressing clinical quality measures and decision support rules in a human-readable, computable format that leverages a FHIR-based data model.
Human-Readable Authoring
CQL is designed to be both human-readable and computable, bridging the gap between clinical domain experts and software engineers. Its syntax is inspired by common programming languages but uses clinical terminology, allowing non-programmers to review and validate the logic. This dual nature ensures that a quality measure's intent is transparent and auditable, reducing the risk of misinterpretation during implementation.
FHIR Data Model Alignment
CQL is fundamentally designed to operate on the FHIR (Fast Healthcare Interoperability Resources) data model. It uses a domain-specific data model called QUICK (Quality Improvement Core) as a logical view, which maps directly to FHIR resources. This tight coupling allows CQL expressions to natively traverse FHIR profiles, retrieve specific resources like Patient, Observation, or MedicationRequest, and access their elements using a path-based syntax, ensuring seamless integration with modern healthcare APIs.
Expression Logic and Timing
CQL provides a rich set of operators for defining complex clinical logic:
- Comparison and Logical Operators:
=,>,and,or,notfor building conditional rules. - Timing and Interval Operators: Operators like
before,after,during, andwithinallow precise temporal reasoning, such as checking if a lab test occurred within 30 days of a diagnosis. - List and Aggregate Functions:
exists,forall,count,sum, andavgenable population-level analysis and cohort identification.
Terminology Service Integration
CQL has first-class support for value set membership testing. Authors can define expressions that check if a clinical concept belongs to a specific value set (e.g., 'Diabetes' value set) without hardcoding individual codes. The language includes a valueset keyword and an in operator, allowing the expression "Diabetes" in "Diabetes Value Set". This decouples the clinical logic from the specific code systems like SNOMED CT, LOINC, or ICD-10, making measures resilient to terminology updates.
Library and Component Model
CQL promotes modularity and reuse through a library model. Logic can be packaged into named libraries, versioned, and shared across multiple measures or decision support artifacts. A library can declare:
- Parameters: Input values provided at runtime.
- Expressions: Named reusable logic fragments.
- Functions: Parameterized, callable blocks of logic. This component-based architecture prevents duplication and ensures consistent implementation of common clinical definitions across an organization.
Translation to ELM
For machine execution, CQL is translated into a canonical, XML-based representation called Expression Logical Model (ELM). The CQL-to-ELM translator produces a deterministic, unambiguous abstract syntax tree that calculation engines consume directly. This two-layer approach—human-readable CQL for authoring and machine-optimized ELM for execution—ensures that the original clinical intent is preserved while enabling high-performance, deterministic computation in clinical decision support and quality reporting systems.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Clear, authoritative answers to the most common questions about the HL7 Clinical Quality Language (CQL) standard for expressing computable clinical logic.
Clinical Quality Language (CQL) is an HL7 authoring standard designed to express clinical quality measures (CQMs) and decision support rules in a human-readable, computable format. It works by defining a formal logic language that operates over a FHIR-based clinical data model, allowing authors to write expressions that query, filter, and aggregate patient data. CQL separates the clinical logic from the implementation layer, meaning the same CQL logic can be executed against any compliant data source. The language uses a syntax familiar to clinical informaticists, with constructs like define, where, and return, while compiling down to Expression Logical Model (ELM) for machine execution. This dual-representation ensures that clinicians can review the logic for accuracy while engines can execute it deterministically against standardized data.
Related Terms
Clinical Quality Language (CQL) is a foundational component of a broader clinical informatics stack. These related standards and specifications define the data models, execution environments, and integration patterns that make CQL-based logic computable and interoperable across healthcare systems.
Quality Data Model (QDM)
An older, relational data model used primarily for eCQM expression in the United States. QDM defines clinical concepts as datatypes with specific attributes and relationships. CQL can target QDM-based data sources, though the industry is transitioning toward FHIR-based models for CMS quality reporting.
FHIRPath
A path-based navigation language that serves as the syntactic foundation for CQL. CQL's fluent query syntax extends FHIRPath's core capabilities with:
- Clause-based filtering (where, return, sort)
- Temporal operators for interval logic
- Aggregate functions like Count() and Sum()
- Terminology resolution for value set membership testing
Expression Logical Model (ELM)
A machine-readable XML representation of CQL logic. CQL source is translated into ELM for distribution and execution. ELM defines an abstract syntax tree (AST) that engines can evaluate directly. The ELM schema is versioned alongside CQL to ensure deterministic translation between the human-readable and computable formats.
CDS Hooks
A decision support invocation framework that triggers CQL-based rules at specific points in a clinician's workflow. A CDS Hooks service receives a FHIR payload, executes CQL logic against it, and returns guidance cards to the EHR. This decouples the authoring of clinical logic from the user interface.
Value Sets and Terminology Services
CQL relies on externally defined value sets to test membership in clinical code groups. A CQL library declares a valueset identifier and uses operators like in to check if a concept belongs to it. At runtime, a FHIR TerminologyService resolves these value sets against code systems like SNOMED CT, LOINC, and ICD-10.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us