...
The example below is satisfied only by the set of lung disorders, which have an associated morphology that is exactly equal to
Scg expression |
---|
|
79654002|Edema| |
.
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 19829001 |Disorder of lung|:
116676008 |Associated morphology| = 79654002 |Edema| |
Using the long syntax, the above expression is represented as:
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
descendantOf 19829001 |Disorder of lung| :
116676008 |Associated morphology| = 79654002 |Edema| |
In many cases, however, the value of the matching attribute is allowed to be either the concept itself, or a descendant of that concept. In these cases, the descendantOrSelfOf operator is used prior to the concept representing the attribute value. For example, the expression constraint below (in brief and long syntaxes respectively) is satisfied only by the set of lung disorders, which have an associated morphology of Scg expression |
---|
|
79654002|Edema| |
or any descendant of
Scg expression |
---|
|
79654002|Edema| |
.
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 19829001 |Disorder of lung|:
116676008 |Associated morphology| = << 79654002 |Edema| |
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
descendantOf 19829001 |Disorder of lung| :
116676008 |Associated morphology| = descendantOrSelfOf 79654002 |Edema| |
When more than one attribute is defined in an expression constraint, the attributes are normally separated by a comma. A comma between two attributes indicates a conjunction and implies that both attribute conditions must be true. For example, the expression constraint below, written in brief syntax, is satisfied only by the set of clinical findings, which have both a finding site of Scg expression |
---|
|
39057004|Pulmonary valve structure| |
(or a subtype of
Scg expression |
---|
|
39057004|Pulmonary valve structure| |
) and an associated morphology of 'stenosis' (or a subtype of 'stenosis').
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 404684003 |Clinical finding|:
363698007 |Finding site| = << 39057004 |Pulmonary valve structure|,
116676008 |Associated morphology| = << 415582006 |Stenosis| |
Please note that attribute refinements may also be used when the focus concept is '*' (or ANY). The following expression constraint represents any concept that has a Scg expression |
---|
246075003|Causative agent| |
attribute whose value is
Scg expression |
---|
387517004|Paracetamol| |
.
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
* : 246075003 |Causative agent| = 387517004 |Paracetamol| |
Using the long syntax, the above expression may also be represented as:
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
ANY : 246075003 |Causative agent| = 387517004 |Paracetamol| |
...
Similarly to SNOMED CT compositional grammar, expression constraints use curly braces (i.e. "{..}") to indicate that a set of attributes should be grouped together in an attribute group. For example, the expression constraint below is satisfied only by the set of clinical findings with an associated morphology of 'stenosis' (or descendant) at the finding site 'pulmonary valve structure' (or descendant), and also with an associated morphology of 'hypertrophy' (or descendant) at the finding site 'right ventricular structure' (or descendant).
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 404684003 |Clinical finding|:
{ 363698007 |Finding site| = << 39057004 |Pulmonary valve structure|,
116676008 |Associated morphology| = << 415582006 |Stenosis|},
{ 363698007 |Finding site| = << 53085002 |Right ventricular structure|,
116676008 |Associated morphology| = << 56246009 |Hypertrophy|} |
Using the 'long syntax', the above expression constraint is represented as: Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
descendantOf 404684003 |Clinical finding|:
{ 363698007 |Finding site| = descendantOrSelfOf 39057004 |Pulmonary valve structure|,
116676008 |Associated morphology| = descendantOrSelfOf 415582006 |Stenosis|},
{ 363698007 |Finding site| = descendantOrSelfOf 53085002 |Right ventricular structure|,
116676008 |Associated morphology| = descendantOrSelfOf 56246009 |Hypertrophy|} |
...
Similarly to the SNOMED CT Compositional Grammar, it is also possible to nest expression constraints within an attribute value. Please note that when the attribute value is a simple expression constraint (as per the above examples), brackets are not required around the value. However, when the attribute value is either an expression constraint with a refinement, or a compound expression constraint with a binary operator, then brackets must be placed around the attribute value. For example, the following expression constraint represents the set of clinical findings which are associated with another clinical finding that has an associated morphology of 'infarct' (or subtype).
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 404684003 |Clinical finding|:
47429007 |Associated with| = (< 404684003 |Clinical finding|:
116676008 |Associated morphology| = << 55641003 |Infarct|) |
In this example, brackets are required around the nested attribute value "
Scg expression |
---|
< 404684003 |Clinical finding|: 116676008 |Associated morphology| = << 55641003 |Infarct| |
".
Using the long syntax, the above expression constraint may be represented as:
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
descendantOf 404684003 |Clinical finding|:
47429007 |Associated with| = (descendantOf 404684003 |Clinical finding|:
116676008 |Associated morphology| = descendantOrSelfOf 55641003 |Infarct| ) |
...
In some cases, an attribute concept has subtypes in the SNOMED CT hierarchy. Where this occurs, it is possible to indicate that an attribute condition may be satisfied by matching one of the subtypes of the given attribute. This is done using the 'descendantOf' or 'descendantOrSelfOf' operator directly before the attribute name concept. For example, the expression constraint below will not only match clinical findings that are associated with edema, but also those that are due to, after or caused by an edema. This result occurs because the
Scg expression |
---|
47429007|Associated with| |
attribute concept has three subtypes:
Scg expression |
---|
255234002|After| |
,
Scg expression |
---|
246075003|Causative agent| |
and
Scg expression |
---|
42752001|Due to| |
.
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
<< 404684003 |Clinical finding|:
<< 47429007 |Associated with| = << 267038008 |Edema| |
This expression constraint is represented in the long syntax as: Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
descendantOrSelfOf 404684003 |Clinical finding|:
descendantOrSelfOf 47429007 |Associated with| = descendantOrSelfOf 267038008 |Edema| |
...
The following expression constraint
Footnote Macro |
---|
Please note that these examples are based on a hypothetical drug concept model, and is not intended to reflect any specific drug model. Concepts for which an identifier has not been assigned have been shown with an identifier of '111115'. |
is satisfied only by amoxicillin capsules, whose strength is greater than or equal to 500 mg.
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 27658006 |Amoxicillin |:
411116001 |Has dose form| = << 385049006 |Capsule|,
{ 111115 |Has basis of strength| = ( 111115 |Amoxicillin only|:
111115 |Strength magnitude| >= #500, 111115 |Strength unit| = 258684004 |mg|)} |
Please note that, as per SNOMED CT Compositional Grammar, integer and decimal values are preceded by a hash character (e.g. "#500"), while string values are surrounded by double quotes (e.g. "PANADOL").
To find those capsules that have a strength between 500 and 800 mg (inclusive), the following expression constraint may be used:
Scg expression |
---|
ShowFormatBorder | ridge |
---|
ShowFormat | block |
---|
|
< 27658006 |Amoxicillin |:
411116001 |Has dose form| = << 385049006 |Capsule|,
{ 111115 |Has basis of strength| = ( 111115 |Amoxicillin only|:
111115 |Strength magnitude| >= #500, 111115 |Strength magnitude| <= #800, 111115 |Strength unit| = 258684004 |mg|)} |
Concrete values of type string may also be included in an expression constraint, and compared using an 'equal to' (i.e. "=") or 'not equal to' (i.e. "!=") operator. The following expression constraint is satisfied only by products with a trade name equal to "PANADOL".
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 373873005 |Pharmaceutical / biologic product|:
111115 |Trade name| = "PANADOL" |
...
In most cases, an attribute refinement is satisfied by those concepts, which are the source concept of a defining relationship whose target destination concept matches the attribute value. In some cases, however, it may be necessary to select the target destination concept of a relationship and constrain the source concept to a given attribute value. To achieve this, an expression constraint indicates that an attribute is to be constrained in the reverse order using a 'reverse flag'
Footnote Macro |
---|
It should be noted that using a reversed attribute joined by conjunction with a non-reversed attribute may lead to a nonsensical constraint (e.g. "<<a: {b=c, Rd=e}"). This is because the target concept of the reversed attribute must be matched with the source concept of the non-reversed attribute, which in turn must be the same as the source concept of the reversed attribute (being in the same attribute group). This would require the reversed attribute to be reflexive (i.e. the source and target concept to be the same). |
. In the brief syntax, the reverse flag is represented by
placing preceding the name of the attribute
being reversed inside a pair of round brackets, and preceding this with a capital letter 'R'.
For example, the expression constraint below finds the set of substancesanatomical structures, which are active ingredients of 'TRIPHASIL tablet'the finding site of a type of bone fracture (e.g.
Scg expression |
---|
85050009 |Humerus| |
, Scg expression |
---|
71341001 |Femur| |
). Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
|
|
< 10559000191723000 |SubstanceAnatomical structure|:
R 127489000363698007 |HasFinding active ingredientsite| = < 111115125605004 |TRIPHASILFracture of tabletbone| |
The above expression constraint is represented in
the long syntax asthe long syntax as: Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
descendantOf 91723000 |Anatomical structure|:
reverseOf 363698007 |Finding site| = descendantOf 125605004 |Fracture of bone| |
An alternative way of representing these 'reversed attributes' is also provided in both brief and long syntaxes, called the 'dot notation'. Using this alternative notation, " Scg expression |
---|
< 123456 |X|.234567 |Y| |
" represents the set of attribute values (i.e. destination concepts) of the attribute "Y" for descendants or self of concept "X". This is therefore equivalent to " Scg expression |
---|
* : R 234567|Y| = < 123456|X| |
" using the reverse flag.The previous expression constraint (which finds the set of body sites for any subtype of bone fracture) has an equivalent representation using the 'dot notation' of:
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 91723000 |Anatomical structure| AND < 125605004 |Fracture of bone|.363698007 |Finding site| |
Because all values of Scg expression |
---|
363698007 |Finding site| |
must be Scg expression |
---|
< 91723000 |Anatomical structure| |
(according to the), this expression constraint can be further simplified to: Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 125605004 |Fracture of bone|.363698007 |Finding site| |
The next example below finds the set of substances, which are active ingredients of a 'TRIPHASIL tablet'. Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 105590001 |Substance|:
R 127489000 |Has active ingredient| = 111115 |TRIPHASIL tablet| |
This expression constraint is represented in the long syntax as: Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
descendantOf 105590001 |Substance|:
reverseOf 127489000 |Has active ingredient| = 111115 |TRIPHASIL tablet| |
An equivalent way of representing this constraint, using the 'dot notation' is: Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 105590001 |Substance| AND 111115 |TRIPHASIL tablet|.127489000 |Has active ingredient| |
or (using the to simplify):
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
descendantOf111115 105590001|TRIPHASIL |Substance|:
reverseOf tablet|.127489000 |Has active ingredient| = 111115 |TRIPHASIL tablet| |
Any Attribute Name and Value
A single 'star' (i.e. "*") may be used in the place of an attribute name to represent any attribute in the substrate. The expression constraint below evaluates to the set of clinical findings which have any attribute with a value of
Scg expression |
---|
79654002 |Edema| |
.
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 404684003 |Clinical finding|: * = 79654002 |Edema| |
Using the long syntax, the above expression constraint may also be represented as:
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
descendantOf 404684003 |Clinical finding|: ANY = 79654002 |Edema| |
The 'star' symbol (i.e. "*") may also be used to represent any attribute value (either with or without refinement). The following expression constraint evaluates to the set of clinical findings which have an associated morphology (with any value).
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
< 404684003 |Clinical finding|: 116676008 |Associated morphology| = * |
Using the long syntax, the above expression constraint may also be represented as:
Scg expression |
---|
Border | ridge |
---|
ShowFormat | block |
---|
|
descendantOf 404684003 |Clinical finding|: 116676008 |Associated morphology| = ANY |
...