# Simple Expression Constraints

The simplest type of expression constraint contains a single concept optionally preceded by an expression constraint operator and/or membership function. Expression constraint operators (e.g. descendant of) traverse the hierarchical relationships in SNOMED CT to return the set of concepts that are directly or transitively connected to the focus concept. Membership functions return the set of concepts referenced by a reference set.

In this section we consider some of these simple examples.

## Self <img src="https://3222256335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsOJBD7YbxAy9bD1Ko9L9%2Fuploads%2Fgit-blob-fe66e95cce4239d6bed95749583c755fd072b1a3%2FScreenshot%202025-09-24%20at%2017.38.47.png?alt=media" alt="Included in ECL Core" data-size="line">

If no expression constraint operator or membership function is applied, the expression constraint is satisfied only by the specified concept. For example, the expression constraint below is satisfied only by the concept `404684003 | Clinical finding|` .

{% code overflow="wrap" %}

```
404684003 |Clinical finding|
```

{% endcode %}

Please note that this expression constraint is equivalent to an expression that looks the same but is written in [SNOMED CT Compositional Grammar](http://snomed.org/scg).

## Descendant of <img src="https://3222256335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsOJBD7YbxAy9bD1Ko9L9%2Fuploads%2Fgit-blob-fe66e95cce4239d6bed95749583c755fd072b1a3%2FScreenshot%202025-09-24%20at%2017.38.47.png?alt=media" alt="Included in ECL Core" data-size="line">

A single 'less than' sign (i.e. "<") indicates that the expression constraint is satisfied by all descendants of the specified concept. The expression constraint below evaluates to the set of all subtypes (both direct children and transitive subtypes) of `404684003 | Clinical finding|` .

{% tabs %}
{% tab title="Brief syntax" %}
{% code overflow="wrap" %}

```
<404684003 |Clinical finding|
```

{% endcode %}
{% endtab %}

{% tab title="Long syntax" %}
{% code overflow="wrap" %}

```
descendantOf 404684003 |Clinical finding|
```

{% endcode %}
{% endtab %}
{% endtabs %}

The descendantOf function is primarily used on concepts, which serve as the 'grouper' of a set of values (e.g. `| Clinical finding (finding)|` , `| Severities (qualifier value)|` , `| Unit (qualifier value)|` ). The descendantOf function may also be applied to other concepts, or to nested expression constraints (as discussed in [Nested Expression Constraints](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-expression-constraint-language/behaviour-specification-with-examples/6.7-nested-expression-constraints)).

## Descendant or Self of <img src="https://3222256335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsOJBD7YbxAy9bD1Ko9L9%2Fuploads%2Fgit-blob-fe66e95cce4239d6bed95749583c755fd072b1a3%2FScreenshot%202025-09-24%20at%2017.38.47.png?alt=media" alt="Included in ECL Core" data-size="line">

Two consecutive 'less than' signs (i.e. "<<") indicates that the expression constraint is satisfied by all descendants of the specified concept plus the specified concept itself. The expression constraint below evaluates to the set of descendants of `73211009 | Diabetes mellitus|` , plus the concept `73211009 | Diabetes mellitus|` itself.

{% tabs %}
{% tab title="Brief syntax" %}
{% code overflow="wrap" %}

```
<< 73211009 |Diabetes mellitus|
```

{% endcode %}
{% endtab %}

{% tab title="Long syntax" %}
{% code overflow="wrap" %}

```
descendantOrSelfOf 73211009 |Diabetes mellitus|
```

{% endcode %}
{% endtab %}
{% endtabs %}

The descendantOrSelfOf function is primarily used for attribute values, which refer to a specific clinical value (e.g. `73211009 | Diabetes mellitus|` , `73761001 | Colonoscopy|` , `385055001 | Tablet dose form|` ), but any specialization of this value is also acceptable. The descendantOrSelfOf function may also be applied to other concepts, or to nested expression constraints (as discussed in [Nested Expression Constraints](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-expression-constraint-language/behaviour-specification-with-examples/6.7-nested-expression-constraints)).

## Child of <img src="https://3222256335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsOJBD7YbxAy9bD1Ko9L9%2Fuploads%2Fgit-blob-fe66e95cce4239d6bed95749583c755fd072b1a3%2FScreenshot%202025-09-24%20at%2017.38.47.png?alt=media" alt="Included in ECL Core" data-size="line">

A 'less than' sign directly followed by an exclamation mark (i.e. "\<!") indicates that the expression constraint is satisfied by the set of proximal children of the specified concept. The children of a concept are those concepts that are the source of a non-redundant `116680003 | is a|` relationship whose target is the given concept. The expression constraint below, represented using the brief syntax, evaluates to the set of immediate children of the concept `404684003 | Clinical finding|` .

{% tabs %}
{% tab title="Brief syntax" %}
{% code overflow="wrap" %}

```
<! 404684003 |Clinical finding|
```

{% endcode %}
{% endtab %}

{% tab title="Long syntax" %}
{% code overflow="wrap" %}

```
childOf 404684003 |Clinical finding|
```

{% endcode %}
{% endtab %}
{% endtabs %}

Please note that the childOf function may only be executed against a finite and pre-classified substrate, and that the results of this function are specific to the substrate used. The childOf function may also be applied to nested expression constraints (as discussed in [Nested Expression Constraints](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-expression-constraint-language/behaviour-specification-with-examples/6.7-nested-expression-constraints)).

## Child or Self of <img src="https://3222256335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsOJBD7YbxAy9bD1Ko9L9%2Fuploads%2Fgit-blob-fe66e95cce4239d6bed95749583c755fd072b1a3%2FScreenshot%202025-09-24%20at%2017.38.47.png?alt=media" alt="Included in ECL Core" data-size="line">

Two consecutive 'less than' signs directly followed by an exclamation mark (i.e. "<\<!") indicates that the expression constraint is satisfied by the set of proximal children of the specified concept plus the specified concept itself. The children of a concept are those concepts that are the source of a non-redundant `116680003 | is a|` relationship whose target is the given concept. The expression constraint below, represented using the brief syntax, evaluates to the set of immediate children of the concept `404684003 | Clinical finding|` , plus the concept `404684003 | Clinical finding|` itself.

{% tabs %}
{% tab title="Brief syntax" %}
{% code overflow="wrap" %}

```
<<! 404684003 |Clinical finding|
```

{% endcode %}
{% endtab %}

{% tab title="Long syntax" %}
{% code overflow="wrap" %}

```
childOrSelfOf 404684003 |Clinical finding|
```

{% endcode %}
{% endtab %}
{% endtabs %}

Please note that the childOrSelfOf function may only be executed against a finite and pre-classified substrate, and that the results of this function are specific to the substrate used. The childOrSelfOf function may also be applied to nested expression constraints (as discussed in [6.7-nested-expression-constraints](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-expression-constraint-language/behaviour-specification-with-examples/6.7-nested-expression-constraints "mention")).

## Ancestor of <img src="https://3222256335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsOJBD7YbxAy9bD1Ko9L9%2Fuploads%2Fgit-blob-fe66e95cce4239d6bed95749583c755fd072b1a3%2FScreenshot%202025-09-24%20at%2017.38.47.png?alt=media" alt="Included in ECL Core" data-size="line">

A single 'greater than' sign (i.e. ">") indicates that the expression constraint is satisfied by all ancestors of the specified concept. The expression constraint below, using the brief syntax, evaluates to the set of all supertypes (both direct parents and transitive supertypes) of [40541001 | Acute pulmonary edema|](http://snomed.info/id/40541001)

{% tabs %}
{% tab title="Brief syntax" %}

<pre data-overflow="wrap"><code><strong>> 40541001 |Acute pulmonary edema|
</strong></code></pre>

{% endtab %}

{% tab title="Long syntax" %}
{% code overflow="wrap" %}

```
ancestorOf 40541001 |Acute pulmonary edema|
```

{% endcode %}
{% endtab %}
{% endtabs %}

Please note that the ancestorOf function may also be applied to nested expression constraints (as discussed in [6.7-nested-expression-constraints](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-expression-constraint-language/behaviour-specification-with-examples/6.7-nested-expression-constraints "mention")).

## Ancestor or Self of <img src="https://3222256335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsOJBD7YbxAy9bD1Ko9L9%2Fuploads%2Fgit-blob-fe66e95cce4239d6bed95749583c755fd072b1a3%2FScreenshot%202025-09-24%20at%2017.38.47.png?alt=media" alt="Included in ECL Core" data-size="line">

Two consecutive 'greater than' signs (i.e. ">>") indicates that the expression constraint is satisfied by all ancestors of the specified concept plus the specified concept itself. The expression constraint below evaluates to the set of ancestors of `40541001 | Acute pulmonary edema|` , plus the concept `40541001 | Acute pulmonary edema|` .

{% tabs %}
{% tab title="Brief syntax" %}

<pre data-overflow="wrap"><code><strong>>> 40541001 |Acute pulmonary edema|
</strong></code></pre>

{% endtab %}

{% tab title="Long syntax" %}
{% code overflow="wrap" %}

```
ancestorOrSelfOf 40541001 |Acute pulmonary edema|
```

{% endcode %}
{% endtab %}
{% endtabs %}

Please note that the ancestorOrSelfOf function may also be applied to nested expression constraints (as discussed in [6.7-nested-expression-constraints](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-expression-constraint-language/behaviour-specification-with-examples/6.7-nested-expression-constraints "mention")).

## Parent of <img src="https://3222256335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsOJBD7YbxAy9bD1Ko9L9%2Fuploads%2Fgit-blob-fe66e95cce4239d6bed95749583c755fd072b1a3%2FScreenshot%202025-09-24%20at%2017.38.47.png?alt=media" alt="Included in ECL Core" data-size="line">

A 'greater than' sign directly followed by an exclamation mark (i.e. ">!") indicates that the expression constraint is satisfied by the set of proximal parents of the specified concept. The parents of a concept are those concepts that are the target of a non-redundant `|is a|` relationship whose source is the given concept. The expression constraint below, represented using the brief syntax, evaluates to the set of immediate parents of the concept `40541001 | Acute pulmonary edema|` .

{% tabs %}
{% tab title="Brief syntax" %}

<pre data-overflow="wrap"><code><strong>>! 40541001 |Acute pulmonary edema|
</strong></code></pre>

{% endtab %}

{% tab title="Long syntax" %}
{% code overflow="wrap" %}

```
parentOf 40541001 |Acute pulmonary edema|
```

{% endcode %}
{% endtab %}
{% endtabs %}

Please note that the parentOf function should only be executed against a finite and pre-classified substrate, and that the results of this function are specific to the substrate used. The parentOf function may also be applied to nested expression constraints (as discussed in [6.7-nested-expression-constraints](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-expression-constraint-language/behaviour-specification-with-examples/6.7-nested-expression-constraints "mention")).

## Parent or Self of <img src="https://3222256335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsOJBD7YbxAy9bD1Ko9L9%2Fuploads%2Fgit-blob-fe66e95cce4239d6bed95749583c755fd072b1a3%2FScreenshot%202025-09-24%20at%2017.38.47.png?alt=media" alt="Included in ECL Core" data-size="line">

Two consecutive 'greater than' signs directly followed by an exclamation mark (i.e. ">>!") indicates that the expression constraint is satisfied by the set of proximal parents of the specified concept plus the specified concept itself. The parents of a concept are those concepts that are the target of a non-redundant `|is a|` relationship whose source is the given concept. The expression constraint below, represented using the brief syntax, evaluates to the set of immediate parents of the concept `40541001 | Acute pulmonary edema|` , plus the concept `40541001 | Acute pulmonary edema|` itself.

{% tabs %}
{% tab title="Brief syntax" %}

<pre data-overflow="wrap"><code><strong>>>! 40541001 |Acute pulmonary edema|
</strong></code></pre>

{% endtab %}

{% tab title="Long syntax" %}
{% code overflow="wrap" %}

```
parentOrSelfOf 40541001 |Acute pulmonary edema|
```

{% endcode %}
{% endtab %}
{% endtabs %}

Please note that the parentOrSelfOf function should only be executed against a finite and pre-classified substrate, and that the results of this function are specific to the substrate used. The parentOrSelfOf function may also be applied to nested expression constraints (as discussed in [6.7-nested-expression-constraints](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-expression-constraint-language/behaviour-specification-with-examples/6.7-nested-expression-constraints "mention")).

## Member of <img src="https://3222256335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsOJBD7YbxAy9bD1Ko9L9%2Fuploads%2Fgit-blob-fe66e95cce4239d6bed95749583c755fd072b1a3%2FScreenshot%202025-09-24%20at%2017.38.47.png?alt=media" alt="Included in ECL Core" data-size="line">

In it's basic form the memberOf function evaluates to the set of concepts that are referenced by the given reference set. The concepts from the referencedComponentId field of active reference set members are returned. The concept themselves may be active or inactive.

Please note that this function may be applied only to reference sets whose referenced components are concepts. The SNOMED CT Expression Constraint Language does not support use of the memberOf function on reference sets whose referencedComponents are not concepts (i.e. descriptions or relationships).

The memberOf function is represented in the brief syntax using a 'caret' character (i.e. "^") and is usually followed by a single concept id for a concept-based reference set. For example, the following expression constraint is satisfied by the set of concepts which are members of [700043003 | Example problem list concepts reference set|](http://snomed.info/id/700043003)

{% tabs %}
{% tab title="Brief syntax" %}
{% code overflow="wrap" %}

```
^ 700043003 |Example problem list concepts reference set|
```

{% endcode %}
{% endtab %}

{% tab title="Long syntax" %}
{% code overflow="wrap" %}

```
memberOf 700043003 |Example problem list concepts reference set|
```

{% endcode %}
{% endtab %}
{% endtabs %}

The expression constraints above both return the values in the referencedComponentId field of the given reference sets. However, it is also possible to specify one or more fields, whose values will be returned, by including the relevant field names is square brackets after the memberOf operator ("^" or "memberOf"). For example, the following expression constraint is equivalent to the brief syntax example above.

{% code overflow="wrap" %}

```
^ [referencedComponentId] 700043003 |Example problem list concepts reference set|
```

{% endcode %}

The value of other fields can also be returned by an[ expression constraint](#user-content-fn-1)[^1] . For example, the following expression constraint will return the targetComponentId values (i.e. the 'Entire' anatomy concepts) from the `734138000 | Anatomy structure and entire association reference set|` .

{% code overflow="wrap" %}

```
^ [targetComponentId] 734138000 |Anatomy structure and entire association reference set|
```

{% endcode %}

It is also possible to return the values of more than one field in a reference set ([e.g. a pair or tuple of values](#user-content-fn-2)[^2]). For example, to return both the source and target of the `816210007 | SNOMED CT to MedDRA simple map reference set|` , the following expression constraint could be used:

{% code overflow="wrap" %}

```
^ [referencedComponentId, mapTarget] 816210007 |SNOMED CT to MedDRA simple map reference set|
```

{% endcode %}

To return all the non-metadata fields of a referenceSet (i.e. the values of the referencedComponentId and additional fields), a wildcard (i.e. "*" in the brief syntax, and "*" or "Any" in the long syntax) can be used. For example, the following expression constraint will return the referencedComponentId, mapGroup, mapPriority, mapRule, mapAdvice, mapTarget and correlationId for each row of the `447562003 | ICD-10 complex map reference set|` .

```
 ^[*] 447562003 |ICD-10 complex map reference set|
```

For more information on the use of reference set field names in ECL, please refer to [appendix-e-reference-set-fields](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-expression-constraint-language/appendices/appendix-e-reference-set-fields "mention").

Please note that it is also possible to apply the memberOf function to an expression constraint that returns a set of concept-based reference set concepts. For more information, please refer to [6.7-nested-expression-constraints](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-expression-constraint-language/behaviour-specification-with-examples/6.7-nested-expression-constraints "mention").

And for information about applying filter constraints to reference set members, please refer to [6.10-member-filters](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-expression-constraint-language/behaviour-specification-with-examples/6.10-member-filters "mention").

## Any <img src="https://3222256335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsOJBD7YbxAy9bD1Ko9L9%2Fuploads%2Fgit-blob-fe66e95cce4239d6bed95749583c755fd072b1a3%2FScreenshot%202025-09-24%20at%2017.38.47.png?alt=media" alt="Included in ECL Core" data-size="line">

A single 'star' (i.e. "\*") may be used in the place of a concept reference to represent any concept in the substrate. The expression constraint below evaluates to the set of all concepts in the given substrate.

{% tabs %}
{% tab title="Brief syntax" %}

<pre data-overflow="wrap"><code><strong>*
</strong></code></pre>

{% endtab %}

{% tab title="Long syntax" %}
{% code overflow="wrap" %}

```
ANY
```

{% endcode %}
{% endtab %}
{% endtabs %}

This wildcard character (or 'ANY' keyword) may be used anywhere within an expression constraint that a concept reference may be used. In many situations, the wildcard is equivalent to the following expression constraint:

```
<< 138875005 |SNOMED CT concept|
```

However, some situations exist in which the concept `138875005 | SNOMED CT concept|` is not included in the substrate, and therefore cannot be used to determine the full set of concepts available. In other cases, the single character wildcard may serve as a convenient shortcut for the longer expression constraint above.

Please note that the following three expression constraints evaluate to the same set of concepts:

```
*
```

```
<<*
```

<pre><code><strong>>>*
</strong></code></pre>

The two expression constraints below evaluate to all concepts in the substrate minus the root concept:

```
<*
```

```
<!*
```

And the two expression constraints below evaluate to all non-leaf concepts in the substrate:

```
>*
```

```
>!*
```

Finally, the expression constraint below evaluates to all concepts that are referenced by any reference set in the substrate:

```
^*
```

## Refset Containing <img src="https://3222256335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsOJBD7YbxAy9bD1Ko9L9%2Fuploads%2Fgit-blob-fe66e95cce4239d6bed95749583c755fd072b1a3%2FScreenshot%202025-09-24%20at%2017.38.47.png?alt=media" alt="Included in ECL Core" data-size="line">

The refsetContaining constraint includes a set of concepts. The constraint is satisfied the set of reference sets that contain at least one of the given concepts. Please note that this function may be applied only to reference sets whose referenced components are concepts. The SNOMED CT Expression Constraint Language does not support use of the refsetContaining function on reference sets whose referencedComponents are not concepts.

The refsetContaining function is represented in the brief syntax using a 'caret' character (i.e. "^") immediately followed by an uppercase 'R' and followed by either a single concept or a nested expression constraint.

For example, the following expression constraint is satisfied by the set of refset concepts that have an active member with a referenced component of the concept 73211009 |Diabetes mellitus|:

{% tabs %}
{% tab title="Brief syntax" %}

```
^R 73211009 |Diabetes mellitus|
```

{% endtab %}

{% tab title="Long syntax" %}

```
refsetContainingAny 73211009 |Diabetes mellitus|
```

{% endtab %}
{% endtabs %}

## Alternate Identifier

If an alternate identifier exists for a concept, in an identifier scheme other than SNOMED CT, then this can be used to refer to that concept[^3] (see [Identifier File Specification](https://app.gitbook.com/s/irKbJsZG57nSWZA4GT0M/component-release-file-specification/4.2-file-format-specifications/4.2.4-identifier-file-specification "mention")). For example there may be SNOMED CT concept for "Type of hemoglobin in blood at point in time" with an alternate identifier with the scheme alias "LOINC" and the code "54486-6":

```
LOINC#54486-6
```

The alternate identifier code can be surrounded by double quotes. Quoting may be necessary to ensure correct parsing of the constraint depending on the characters used in the code:

```
LOINC#"54486-6"
```

**Please note:** ECL is always evaluated against SNOMED CT concepts. When you run a query using alternate identifiers from another code system only concepts that are in the SNOMED CT representation of that other code system will be returned. For example the descendants of a concept in the SNOMED CT version of a code system is likely to be different from the code system of the alternate identifier.

<a href="https://docs.google.com/forms/d/e/1FAIpQLScTmbZIf0UEQwYDkY27EEWBkaiYkHSbR0_9DmFrMLXoQLyL7Q/viewform?usp=pp_url&#x26;entry.1767247133=ECL+Specification&#x26;entry.670899847=Simple%20Expression%20Constraints" class="button primary">Provide Feedback</a>

[^1]: **Note**: *If a reference set field is selected that does not exist in any of the identified reference sets, then the expression constraint should be considered erroneous.*

[^2]: ***Note:***

    * *Returning the values of more than one reference set field may only be done as the final operation of an expression constraint.*
    * *Attempts to select more than one reference set field on an inner subquery should result in an execution error.*

    - *In some implementation contexts, the memberOf function may be restricted to return only a single field.*

[^3]: *No alternate identifiers exist in the International Edition at this time.*
