This section explains the correct order of operation for unary operators, binary operators, filters and supplements.
Unary Operators
Unary operators (e.g. descendantOf, descendantOrSelfOf, ancestorOf, ancestorOrSelfOf, memberOf) are applied from inside to out (i.e. from right to left). For example, when the following expression constraint is processed, the memberOf operator is applied first to the Example problem list concepts reference set, and then the descendants of the referenced components are determined.
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< ^ 700043003 |Example problem list concepts reference set| |
Binary Operators
Whenever potential ambiguity in binary operator precedence may occur, round brackets must be used to clearly disambiguate the order in which these operators are applied. For example, the following expression constraint is not valid:
...
Please note that unary operators are always applied before binary operators.
Filter Constraints
Filter constraints (e.g. concept, description, or member filters) apply only to the sub-expression constraint part that is directly to the left of the filter.
For example, the following expression constraint will apply the term filter to only the descendants or self of
. This expression constraint will match descendants of Concept |
---|
t | 404684003 |Clinical finding| |
---|
|
with a finding site that is a descendant or self of Concept |
---|
t | 39057004 |Pulmonary valve structure| |
---|
|
, and an associated morphology that is any descendant or self of which has a description matching the term "insufficiency". Therefore, the concept Concept |
---|
t | 123801008 |Heart valve stenosis and regurgitation (disorder)| |
---|
|
will match this expression constraint because it has the associated morphology Concept |
---|
t | 708027006 |Valvular stenosis with valvular insufficiency| |
---|
|
. Scg expression |
---|
Border | solid |
---|
ShowFormat | block |
---|
|
< 404684003 |Clinical finding| :
363698007 |Finding site| = << 39057004 |Pulmonary valve structure| ,
116676008 |Associated morphology| = << 415582006 |Stenosis| {{ term = "insufficiency" }} |
To apply a filter to a sub-expression constraint, which includes a refinement or binary operators, the subexpression must be enclosed in brackets. For example, the following expression constraint will find all the descendants of clinical finding, with a finding site that is a descendant or self of
Concept |
---|
t | 39057004 |Pulmonary valve structure| |
---|
|
and an associated morphology that is a descendant or self of , and will then match only those clinical finding concepts that have a description that matches the term "insufficiency". Therefore, the concept Concept |
---|
t | 123801008 |Heart valve stenosis and regurgitation (disorder)| |
---|
|
will not match this expression constraints, as it does not have a description that matches the term "insufficiency". Scg expression |
---|
Border | solid |
---|
ShowFormat | block |
---|
|
(< 404684003 |Clinical finding| :
363698007 |Finding site| = << 39057004 |Pulmonary valve structure| ,
116676008 |Associated morphology| = << 415582006 |Stenosis|) {{ term = "insufficiency" }} |
History Supplements
History supplements are applied only to the sub-expression constraint part that is directly to its left, after any filter constraints on this sub-expression constraint part have been applied.
For example, the following expression constraint will match all concepts that are both an active member of the
Concept |
---|
t | 734139008 | Anatomy structure and part association reference set| |
---|
|
and also either an active member of the Concept |
---|
t | 734138000 |Anatomy structure and entire association reference set| |
---|
|
or an inactive concept associated with an active member of the Concept |
---|
t | 734138000 |Anatomy structure and entire association reference set| |
---|
|
via the Concept |
---|
t | 900000000000527005 |SAME AS association reference set| |
---|
|
. Because all active members of the Concept |
---|
t | 734139008 | Anatomy structure and part association reference set| |
---|
|
are active, there will be no inactive concepts in the result set. Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
^ 734139008 | Anatomy structure and part association reference set|
AND ^ 734138000 |Anatomy structure and entire association reference set|
{{ + HISTORY (900000000000527005 |SAME AS association reference set|) }} |
To apply the history supplement to the entire sub-expression constraint above, the sub-expression constraint must be enclosed in round brackets. For example, the following expression constraint will match concepts that are both members of the
Concept |
---|
t | 734139008 | Anatomy structure and part association reference set| |
---|
|
and also members of the Concept |
---|
t | 734138000 |Anatomy structure and entire association reference set| |
---|
|
; and it will also match on any inactive concept that is associated via a Concept |
---|
t | 900000000000527005 |SAME AS association reference set| |
---|
|
to a member of both reference sets.
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
( ^ 734139008 | Anatomy structure and part association reference set|
AND ^ 734138000 |Anatomy structure and entire association reference set| )
{{ + HISTORY (900000000000527005 |SAME AS association reference set|) }} |