Appendix D - ECL Quick Reference

This section provides a quick reference to the key syntax features of the Expression Constraint Language.

Syntax Overview

The following table summarises the key symbols used in the Expression Constraint Language's brief syntax, with the ECL version in which each symbol was introduced. For more information about the version history of ECL, please refer to the 'History' section in Introduction.

Symbol
Name
Version
Notes

|

Pipe

1.0

Used on either side of a concept's term for human readability

{{ }}

Description filter

1.5

Filters the result set, by matching only on concepts which have a description with a matching term, language, type, dialect and/or acceptability

{{+ HISTORY}}

History supplement

2.0

Supplements the results with relevant inactive concepts

{{ M }}

Member filter

2.0

Filters the result set based on the value of specific fields in a reference set.

{{ D }}

Description filter

1.6

Filters the result set, by matching only on concepts which have a description with a matching term, language, type, dialect and/or acceptability

{{ C }}

Concept filter

1.6

Filters the result set based on the definition status, module, effectiveTime and active status of each concept

R

Reverse flag

1.0

Retrieves the set of attribute values (i.e. destination concepts) of a specified attribute for a specified set of concepts

OR

Disjunction

1.0

Retrieves the union of the results of each sub-expressions

MINUS

Exclusion

1.0

Retrieves the members of the first expression and excludes the members returned by the second expression

AND

Conjunction

1.0

Retrieves the intersection of the results of each sub-expressions

A#B

Alternate identifier

2.2

Retrieves a single concept based on an alternate identifier, where A is the identifier scheme alias and B is the identifier code

^ [ A, B]

Member of (with field selection)

2.0

Retrieves the values of fields A and B of all (active) members of a reference set (or set of reference sets) that match the included Member filters (if applicable)

^

Member of

1.0

Retrieves the referencedComponentId of all (active) members of a reference set (or set of reference sets)

[1..3]

Cardinality

1.0

Used to indicate the minimum and maximum number of occurrences of attributes or relationship groups

>>!

Parent or self of

1.4

Retrieves all parents (immediate supertypes) of the specified concept including the concept itself

>>

Ancestor or self of

1.0

Retrieves all ancestors (supertypes) of the specified concept including the concept itself

>!

Parent of

1.1

Retrieves all parents (immediate supertypes) of the specified concept excluding the concept itself

>

Ancestor of

1.0

Retrieves all ancestors (supertypes) of the specified concept excluding the concept itself

<<!

Child or self of

1.4

Retrieves all children (immediate subtypes) of the specified concept including the concept itself

<<

Descendant or self of

1.0

Retrieves all descendants (subtypes) of the specified concept including the concept itself

<!

Child of

1.1

Retrieves all children (immediate subtypes) of the specified concept excluding the concept itself

<

Descendant of

1.0

Retrieves all descendants (subtypes) of the specified concept excluding the concept itself

:

Refinement

1.0

Used before one or more attribute-value pairs to refine the set of concepts retrieved

/* */

Comment

1.1

Allows comments to be added within the text of an expression constraint

.

Dot notation

1.2

Retrieves the set of attribute values (i.e. destination concepts) of a specified attribute for a specified set of concepts

*

Any

1.0

Retrieves all concepts in the substrate

!!>

Top of set

2.2

Filters the results set, by matching only on concepts that have no ancestors within the set

!!<

Bottom of set

2.2

Filters the results set, by matching only on concepts that have no descendants within the set

Examples

The following table provides some examples of each of the key syntax features of the Expression Constraint Language.

Notes:

  1. In the table above:

    • 'id' represents a single SNOMED CT concept identifier,

    • 'term' represents a term associated with the concept identified by 'id',

    • 'x', 'y' and 'v' each represent either a single concept or a set of concepts defined using an expression constraint,

    • 'z' represents either a single concept or a set of concepts that are a subtype of 900000000000455006 | Reference set| ,

    • 'a' and 'b' each represent either a single concept or a set of concepts that are a subtype of 410662002 | Concept model attribute| , and

    • 'min' and 'max' are two numeric values that represent the minimum and maximum cardinality allowed.

  2. The default substrate, to which expression constraints are applied, includes all concepts, active relationships, active descriptions and active reference set members of a chosen SNOMED CT versioned edition.

Simple Expression Constraints

Syntax
Evaluation Notes
Example
Example Expansion Concepts

id | term |

Only the concept with the identifier id

128477000 | Abscess|

128477000 | Abscess|

*

All concepts in the given substrate

*

Any concept in the given substrate

^ z

The set of concepts which are members of the reference sets in z

^ 723264001 | Lateralizable body structure reference set|

181216001 | Entire lung| 65784005 | Structure of fundus of eye|

< x

All descendants (direct + indirect) of x

< 73211009 | Diabetes mellitus|

46635009 | Diabetes mellitus type 1| 8801005 | Secondary diabetes mellitus|

<< x

All descendants of x, plus x itself

<< 73211009 | Diabetes mellitus|

73211009 | Diabetes mellitus| 46635009 | Diabetes mellitus type 1| 8801005 | Secondary diabetes mellitus|

<! x

All immediate children of x

<! 362965005 | Disorder of body system|

49601007 | Disorder of cardiovascular system| 362969004 | Disorder of endocrine system|

<<! x

All immediate children of x, plus x itself

<<! 362965005 | Disorder of body system|

362965005 | Disorder of body system| 49601007 | Disorder of cardiovascular system| 362969004 | Disorder of endocrine system|

> x

All ancestors (direct + indirect) of x

> 279420009 | Hematoma of skin|

106076001 | Skin finding| 297968009 | Bleeding skin|

>> x

All ancestors of x, plus x itself

>> 279420009 | Hematoma of skin|

106076001 | Skin finding| 297968009 | Bleeding skin| 279420009 | Hematoma of skin|

>! x

Immediate parents of x

>! 22298006 | Myocardial infarction|

57809008 | Myocardial disease| 251061000 | Myocardial necrosis|

>>! x

Immediate parents of x, plus x itself

>>! 22298006 | Myocardial infarction|

22298006 | Myocardial infarction| 57809008 | Myocardial disease| 251061000 | Myocardial necrosis|

Conjunction, Disjunction and Exclusion

Syntax
Evaluation Notes
Example
Example Expansion Concepts

x AND y

Concepts that are in both x and y (intersection)

< 19829001 | Disorder of lung| AND < 87628006 | Bacterial infectious disease|

430395005 | Pneumonia caused by Gram negative bacteria| 154283005 | Pulmonary tuberculosis|

x OR y

Concepts that are in either x or y (union)

< 73452002 | Abscess of lung| OR < 275504005 | Cyst of lung|

446543007 | Tuberculous abscess of lung| 87119009 | Congenital cystic lung|

x MINUS y

Concepts in x but not in y (exclusion)

< 29303009 | Electrocardiographic procedure| MINUS < 75444003 | Fetal electrocardiogram|

447114004 | 12 lead electrocardiogram during exercise|

252417001 | 24 Hour electrocardiogram|

Refinement

Syntax
Evaluation Notes
Example
Example Expansion Concepts

x : a = y

Concepts in x with attribute a = value y

< 385494008 | Hematoma| : << 370135005 | Pathological process| = << 441862004 | Infectious process|

698573001 | Infected hematoma| 444109008 | Infection of wound hematoma|

x : a = y, b = v

Concepts in x with a=y and b=v

< 71388002 | Procedure| : << 363704007 | Procedure site| = << 69695003 | Stomach structure| , << 405815000 | Procedure device| = << 86174004 | Laparoscope|

708987006 | Laparoscopic total gastrectomy| 57922004 | Laparoscopic pyloromyotomy|

x : { a = y, b = v }

Concepts in x with a role group containing both a=y and b=v

< 71388002 | Procedure| : { 405813007 | Procedure site - Direct| = << 10200004 | Liver structure| , 260686004 | Method| = << 129433002 | Inspection - action| }

773252007 | Diagnostic laparoscopy of liver| 20933000 | Endoscopy of liver|

Cardinality

Syntax
Evaluation Notes
Example
Example Expansion Concepts

x : [min..max] a = y

Concepts in x with between min and max relationships where a=y

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

786732006 | Product containing only brompheniramine and codeine and phenylpropanolamine| 787979009 | Product containing cyanocobalamin and folic acid and pyridoxine|

x : [min..max] { a = y }

Concepts in x with between min and max role groups where a=y

< 404684003 | Clinical finding| : [2..3]{ 363698007 | Finding site| = * , 116676008 | Associated morphology| = 72704001 | Fracture| }

271577005 | Fracture of shaft of tibia and fibula | 75857000 | Fracture of radius AND ulna|

Reversed Attributes

Syntax
Evaluation Notes
Example
Example Expansion Concepts

y : R a = x

Concepts in y that are destinations of attribute a from source x

< 91723000 | Anatomical structure| : R 363698007 | Finding site| = < 445945000 | Infectious disease associated with AIDS|

280369009 | Brain tissue structure| 39607008 | Lung structure|

x . a

Values of attribute a from source x

< 27658006 | Product containing amoxicillin| . 127489000 | Has active ingredient|

372687004 | Amoxicillin| 395939008 | Clavulanic acid|

Last updated