ECL Language Tools

A Language Server for SNOMED CT Expression Constraint Language — bringing diagnostics, completion, formatting, and terminology integration to every editor through a single LSP.

expression.ecl
Loading ECL editor…

Try it — click the lightbulb to add display terms, or just start typing a concept name to search

Terminology server is currently unavailable. The editor is running in offline mode — syntax checking is still active.
CI status ECL 2.2 Node.js >= 18 License

What is ECL?

Expression Constraint Language (ECL) is the standard query language for SNOMED CT, the world's most comprehensive clinical terminology. ECL lets you define precise sets of clinical concepts — from "all types of diabetes" to "any procedure on the left knee" — using a compact, composable syntax of operators, refinements, and filters.

At the core is a Language Server implementing the Language Server Protocol (LSP), built on an ANTLR4-based parser with FHIR terminology integration. One server powers plugins for VS Code, IntelliJ, Eclipse, Neovim, Sublime, Emacs, and Claude Code — plus embeddable web editors and a Slack bot.

Read the ECL 2.2 specification →

Features

Everything you need to write, understand, and maintain ECL expressions.

Diagnostics

Real-time syntax and semantic error detection with actionable messages, powered by the ANTLR4 parser and FHIR terminology validation.

Completion

Context-aware suggestions for operators, SNOMED CT concepts, attributes, and refinement patterns triggered as you type.

Hover Docs

Inline documentation for ECL operators, concept identifiers, and attributes, including descriptions resolved from FHIR.

Formatting

Opinionated formatter with configurable line width, indentation, and multi-line refinement breaking for consistent, readable expressions.

Refactoring

Automated code actions: add or remove terms, toggle constraint operators, extract sub-expressions, and normalize whitespace.

Code Lens

Inline concept counts and membership previews, evaluated live against FHIR terminology servers above each expression.

Semantic Tokens

Fine-grained syntax highlighting that distinguishes concept IDs, terms, operators, constraints, and filters with distinct colors.

FHIR Integration

Connects to any FHIR R4 terminology server for live concept lookup, ECL evaluation, value set expansion, and version detection.

Editor & IDE Support

One Language Server, seven editor plugins. Install the plugin and get full ECL support instantly.

In Action

Syntax highlighting, diagnostics, completion, and hover docs working together.

ECL syntax highlighting with semantic tokens distinguishing concept IDs, terms, operators, and constraints
Syntax Highlighting
Real-time error diagnostics with inline messages showing syntax and semantic errors
Error Diagnostics
Context-aware autocompletion showing SNOMED CT concept suggestions
Autocompletion
Hover information displaying concept details and operator documentation
Hover Information
ECL editor in dark theme showing a complex expression with refinements and filters
Dark Theme — Full Editor View

npm Packages

Install what you need. Every package is scoped under @aehrc.

Package Description Install
@aehrc/ecl-core Zero-dependency core: parser, AST, formatter, completion, refactoring, validation, terminology npm i @aehrc/ecl-core
@aehrc/ecl-lsp-server Language Server Protocol server for any LSP-compatible editor npm i @aehrc/ecl-lsp-server
@aehrc/ecl-editor-react React component with Monaco editor, FHIR integration, and all language features npm i @aehrc/ecl-editor-react
@aehrc/ecl-editor Web component <ecl-editor> for any framework or plain HTML npm i @aehrc/ecl-editor
@aehrc/ecl-editor-core Monaco editor integration core: language registration, markers, completions, hover npm i @aehrc/ecl-editor-core

Get Started

Add an ECL editor to your app in under a minute.

React App.tsx
import { EclEditor } from '@aehrc/ecl-editor-react';

export default function App() {
  return (
    <EclEditor
      fhirUrl="https://tx.ontoserver.csiro.au/fhir"
      theme="vs-dark"
      semanticValidation
      onChange={(ecl) => console.log(ecl)}
    />
  );
}
HTML index.html
<script src="https://unpkg.com/
  @aehrc/ecl-editor@^1.0.0/
  dist-standalone/
  ecl-editor.standalone.js"></script>

<ecl-editor
  theme="vs-dark"
  fhir-url="https://tx.ontoserver.csiro.au/fhir"
  semantic-validation
><!-- initial ECL here --></ecl-editor>

<script>
  const editor = document.querySelector('ecl-editor');
  editor.addEventListener('ecl-change', e => {
    console.log(e.detail);
  });
</script>

Interactive Demos

Explore the editor components in Storybook with live controls.