ECL Operators

For a step by step introduction about writing ECL queries, please refer to the Expression Constraint Language specification and guide from SNOMED International.

Table 1. ECL operators

Operator

Function

<<

Retrieves concepts and all of their subtypes

<

Retrieves all subtypes of the selected concept

<!

Retrieves all immediate children of the specified concept

>>

Retrieves the concept and all ancestors of the specified concept

>

Retrieves all ancestors of the specified concept

>!

Retrieves all immediate parents of the specified concept

|text|

Display Preferred term of the concept to aid readability

^

Retrieves all the members of this reference set

*

Retrieves all concepts

R

Represents reverse attributes

:

Defines an attribute refinement, e.g. a Finding site or a Causative agent

=

Refines an attribute range, the operator is used in combination with an attribute

!=

Defines an attribute range, represents not equals to

MINUS

Exclude concepts or members

AND

Used to express intersections of attribute ranges

OR

Used to express unions of attribute ranges

[..]

Used to express cardinality on attributes and attribute groups

Table 2. ECL examples

Query

Meaning

22298006|Myocardial infarction|

Retrieves the specified concept

<<267038008|Oedema|

Retrieves the specified concept and all of its subtypes

<267038008|Oedema|

Retrieves the subtypes of the specified concept, but not the concept itself

<! 405533003|Adverse incident outcome categories|

Retrieves the immediate children of the specified concept

>>247441003|Erythema|

Retrieves the concept and all ancestors of the concept

> 247441003|Erythema|

Retrieves all ancestors of the concept

>! 40541001|Acute pulmonary edema|

Retrieves the immediate parents of the specified concept

^999001381000000100|Activity of daily living simple reference set|

Retrieves all members of the specified reference set

*

Retrieves all concepts

<91723000|Anatomical structure|:R 363698007|Finding site|= <125605004|Fracture of bone|

Retrieves the set of anatomical structures, which are the finding site of a type of bone fracture

< 19829001|Disorder of lung|: 116676008|Associated morphology|= <<79654002|Edema|

Retrieves the specified lung disorder and their subtypes which have an associated morphology relationship with the value of Edema or its subtypes

*:246075003|Causative agent|= 387517004|Paracetamol|

Retrieves all those concepts which have a Causative agent with the value of Paracetamol

< 404684003|Clinical finding|:{363698007|Finding site|= <<39057004|Pulmonary valve structure|, 116676008|Associated morphology|= <<415582006|Stenosis|}

Retrieves the subtypes of Clinical finding which have Finding site with the value of Pulmonary valve structure or its subtypes and Associated morphology with the value of Stenosis or its subtypes in the same relationship group. Curly braces represent relationship group

<373873005|Pharmaceutical / biologic product|: [1..3] 127489000|Has active ingredient|= <105590001|Substance|

Retrieves those pharmaceutical /biological products which have one, two, or three active ingredients with the value of Substance subtypes

< 19829001|Disorder of lung|AND <301867009|Edema of trunk|

Retrieves the subtypes of Disorder of lung and the subtypes of Edema of trunk

<404684003|Clinical finding|: 363698007|Finding site|= <<39057004|Pulmonary valve structure|AND 116676008|Associated morphology|= << 415582006|Stenosis|

Retrieves the subtypes of Clinical finding which have a Finding site with the specified value range and an Associated morphology with the specified value range

< 404684003|Clinical finding|: 116676008|Associated morphology|= << 55641003|Infarct|OR 42752001|Due to|= <<22298006|Myocardial infarction|

Retrieves the subtypes of Clinical finding which have either an Associated morphology with the value of Infarct or its subtypes or a Due to relationship with the value of Myocardial infarction or its subtypes

<< 19829001|Disorder of lung|MINUS <<301867009|Edema of trunk|

Retrieves the subtypes of and the specified concept itself with the exception of the subtypes of and Edema of trunk itself

For more examples, please visit the Examples section of Expression Constraint Language specification and guide.

In order to help writing ECL queries, Snow Owl offers a built-in content assist. To invoke it, press Ctrl/Cmd + Space and you can pick from a set of operators that are valid depending on the current position of the cursor.