HealthAtoms
Terminologies & Code Systemsinteractive · 12 min · updated Jun 11, 2026

ECL — querying SNOMED

By HealthAtoms Editorial (AI-assisted draft)Awaiting expert review

Expression Constraint Language: one line that selects exactly the set of concepts you mean — subtypes, attributes, refinements and all.

SNOMED CT

The answer in one paragraph

ECL (Expression Constraint Language) is how you select sets of concepts from SNOMED CT in one line. Where compositional grammar describes one meaning, ECL describes a constraint that many concepts satisfy — "myocardial infarction and everything beneath it", "any clinical finding whose finding site is within the lung". Terminology servers execute ECL directly, and FHIR ValueSets can be defined by an ECL expression — which means a value set that maintains itself as the terminology grows.

The operators that do 90% of the work

<< 22298006 |MI|        // MI and every descendant   (the workhorse)
<  22298006 |MI|        // descendants only, not MI itself
>> 22298006 |MI|        // MI and every ancestor
^  450970008 |refset|   // members of a reference set

Combine with set logic:

<< 404684003 |Clinical finding|  AND  << 87628006 |Bacterial infectious disease|
<< 19829001 |Pneumonia|  MINUS  << 233604007 |Viral pneumonia|

Refinements: constraints on attributes

The same attribute = value machinery from post-coordination, now as a filter:

<< 404684003 |Clinical finding| :
   363698007 |Finding site| = << 39607008 |Lung structure|

Every clinical finding whose finding site is the lung or any part of it. One line — that's a respiratory-disease cohort definition that updates itself with every release.

Where you'll actually use ECL

  • FHIR ValueSets: ValueSet.compose.include.filter with ECL keeps value sets intensional (a rule) instead of extensional (a frozen list someone forgets to update).
  • Analytics cohorts: the "all ischemic heart disease patients" query from the hierarchies entry — formalised.
  • Decision support: triggers expressed as constraints, immune to new subtypes.
  • Terminology QA: find concepts that shouldn't match a constraint but do.

Try it (this entry becomes hands-on)

Public SNOMED browsers and terminology servers (Snowstorm, Ontoserver) accept ECL — and this entry upgrades to a live ECL playground when Shabda's lookup ships. Until then: open any SNOMED browser's ECL tab and run << 22298006. Watching 50 subtypes appear from one line is the moment ECL clicks.

Where to go next

Refsets, extensions & SNOMED India — how the international core adapts to a country without forking.

References

  1. SNOMED CT Expression Constraint Language Specification
  2. HL7 FHIR — ValueSet compose with ECL

Related entries