Inferensys

Glossary

Cohort Definition Language

A standardized, machine-readable syntax for expressing the complex inclusion and exclusion rules that define a patient group for research or trial recruitment purposes.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
CLINICAL INFORMATICS

What is Cohort Definition Language?

A standardized, machine-readable syntax for expressing the complex inclusion and exclusion rules that define a patient group for research or trial recruitment purposes.

Cohort Definition Language (CDL) is a declarative, machine-readable syntax for formally expressing the complex inclusion and exclusion criteria that define a specific patient group for observational research or clinical trial recruitment. It translates narrative eligibility rules into an unambiguous, executable logic that can be run against electronic health record data to identify qualifying individuals.

CDL enables the construction of computable phenotypes by defining temporal constraints, value sets from standard ontologies like SNOMED CT and RxNorm, and logical operators. This structured approach replaces manual chart review with automated, reproducible cohort identification, ensuring consistent patient selection across different sites and studies.

SYNTAX COMPONENTS

Key Features of Cohort Definition Language

A machine-readable grammar for expressing complex patient group definitions. CDL translates clinical logic into executable queries against electronic health data.

01

Declarative Rule Structure

CDL uses a declarative syntax where rules describe what constitutes cohort membership, not how to retrieve it. This separates clinical intent from execution logic.

  • Inclusion criteria: Conditions that must be true for a patient to qualify
  • Exclusion criteria: Conditions that disqualify an otherwise eligible patient
  • Rule composition: Atomic criteria combine via logical operators (AND, OR, NOT)

Example: INCLUDE (Diagnosis.type = "T2DM") AND NOT (Medication.code IN {"insulin"})

02

Temporal Constraint Operators

CDL natively supports time-window logic to express sequence-dependent eligibility rules that are common in trial protocols.

  • BEFORE / AFTER: Ordering of clinical events relative to each other
  • WITHIN [n] DAYS: Proximity constraints between events
  • DURATION >= [n]: Minimum length of a condition or treatment
  • FIRST_OCCURRENCE: References the earliest instance of an event

Example: Diagnosis.date AFTER Procedure.date WITHIN 30 DAYS

03

Ontology-Backed Value Sets

CDL references standardized terminologies rather than free-text, ensuring unambiguous interpretation across heterogeneous data sources.

  • SNOMED CT: Clinical findings and procedures
  • RxNorm: Medication concepts
  • LOINC: Laboratory tests and results
  • ICD-10-CM: Diagnosis and procedure codes

Value sets group related codes: Condition.code IN ValueSet("Cardiovascular_Disease") expands to hundreds of mapped codes automatically.

04

Nested Grouping Logic

Complex protocols require hierarchical rule nesting to express precedence and scoping correctly.

  • Parentheses define evaluation order for compound expressions
  • Sub-groups can represent distinct eligibility domains (e.g., lab criteria, medication criteria)
  • Each group evaluates independently before combining at the parent level

Example structure:

code
INCLUDE (
  (Age >= 18 AND Age <= 65) AND
  (Diagnosis.code = "T2DM") AND
  (Lab.HbA1c.value > 7.5)
)
EXCLUDE (
  (Medication.code IN {"insulin"}) OR
  (Condition.code IN ValueSet("Renal_Impairment"))
)
05

Quantitative Threshold Expressions

CDL supports numerical comparisons against clinical measurements with unit awareness for precise eligibility filtering.

  • Comparison operators: >, <, >=, <=, =, !=
  • Unit specification: Lab.HbA1c.value > 7.5 unit="%"
  • Range expressions: Lab.eGFR.value BETWEEN 30 AND 60 unit="mL/min/1.73m2"
  • Trend operators: Lab.HbA1c.value DECREASING OVER 6 MONTHS

This enables criteria like "eGFR must be between 30 and 60 mL/min" to be evaluated correctly regardless of source data units.

06

Modular Rule Reuse

CDL supports named rule definitions that can be referenced across multiple cohort definitions, promoting consistency and reducing duplication.

  • Define-once, use-many: Common criteria like "Adult Type 2 Diabetic" become reusable modules
  • Parameterized rules: Modules accept arguments for flexible instantiation
  • Version control: Rule modules carry version identifiers for audit trails

Example: DEFINE AdultT2DM AS (Age >= 18 AND Diagnosis.code = "T2DM") then INCLUDE AdultT2DM in any cohort.

COHORT DEFINITION LANGUAGE

Frequently Asked Questions

Explore the technical foundations of Cohort Definition Language (CDL), a standardized syntax for expressing complex patient group rules that power automated clinical trial eligibility screening and real-world evidence generation.

Cohort Definition Language (CDL) is a standardized, machine-readable syntax for expressing the complex inclusion and exclusion rules that define a patient group for research or trial recruitment purposes. It works by translating narrative clinical logic—such as 'adult patients with Type 2 Diabetes and an HbA1c > 7.0% within the last 6 months, excluding those on insulin'—into a structured, computable format that can be executed against electronic health record (EHR) databases. CDL typically leverages a JSON or YAML-based schema to define phenotype criteria using logical operators (AND, OR, NOT), temporal constraints, and value comparisons. The language decomposes each criterion into atomic components: a clinical concept (e.g., HbA1c laboratory test), a value constraint (e.g., > 7.0%), a time window (e.g., within 180 days), and a modifier (e.g., most recent). A phenotype execution engine then parses this definition, translates it into database queries such as SQL or FHIR API calls, and returns a cohort of qualifying patient identifiers. This approach ensures reproducibility across institutions, enables protocol amendment handling through version-controlled definitions, and forms the backbone of automated patient pre-screening and site feasibility assessment workflows.

Prasad Kumkar

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.