Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Replacement slots may be given a replacement type to indicate what type of value may be used to replace the slot. The replacement type directly follows the '+' symbol inside the slot (with optional whitespace between). Permitted replacement types include:
id : The slot may be replaced by a single SNOMED CT concept reference.
scg : The slot may be replaced by a SNOMED CT compositional grammar expression (either a precoordinated or postcoordinated expression).
tok : The slot may be replaced by a token (or symbol) that is defined in the base syntax.
str : The slot may be replaced by a quoted string of characters. This is used to represent a concrete attribute value that is typed as a string.
int : The slot may be replaced by a integer (preceded by a '#' symbol). This is used to represent a concrete attribute value that is typed as an integer.
dec : The slot may be replaced by a decimal (preceded by a '#' symbol). This is used to represent a concrete attribute value that is typed as a decimal.
bool : The slot may be replaced by a boolean. This is used to represent a concrete attribute value that is typed as a boolean.
Please note, that if no replacement type is specified after the '+' symbol, then a replacement type of 'scg ' is assumed.
Slots with a replacement type of 'id ' may only be replaced by a single concept reference. For example, the replacement slot in the following expression template
may be replaced by the concept to form the expression
However, it is not possible to generate a nested expression using this expression template, as the slot may not be replaced by a postcoordinated expression.
Slots with a replacement type of 'scg ' may be replaced by any (precoordinated or postcoordinated) expression. For example, the slot in the following expression template
may be replaced by any of the following values
: = +
to generate the following expressions.
Please note that for the second and third replacements, the template processor must add round brackets around the subexpression to ensure that the resulting expression is syntactically valid.
Slots with a replacement type of 'tok ' may be replaced by any token (or symbol) that is defined in the base language. For example, the following expression has a definition status that has not yet been defined.
If the definitionStatus is used to complete the slot then the resulting expression would be:
Slots with a replacement type of 'str ', 'int ', 'dec ' or 'bool ' may be replaced by any string, integer, decimal or boolean value respectively. For example, the slot in the expression template below: (see footnote 1)
may be replaced by the string PANADOL to form the following expression
Please note that the template processor must add quotation marks around the string to ensure that the resulting expression is syntactically valid.
The slot in the following expression template:
may be replaced by the integer value 30 to form the expression
Please note that the template processor must add a hash symbol ("#") before the integer value to ensure that the resulting expression is syntactically valid.
The slot in the following expression template:
may be replaced by the decimal value 1.5 to form the expression
Please note that the template processor must add a hash symbol ("#") before the decimal value to ensure that the resulting expression is syntactically valid.
And lastly, the slot in the following expression template:
may be replaced by the boolean value TRUE to form the expression
1
Please note that these example expression templates are based on a hypothetical drug concept model, and are not intended to reflect any specific drug model. In these expressions, the SNOMED CT identifiers created with the '9999999' namespace are for example only, and should not be used in a production environment.
2
Please note that the concept 859999999102 |Is in national benefit scheme| is a fictitious attribute used here to illustrate boolean values.
In this chapter, we present a variety of examples to illustrate how the template syntax defined in Syntax Specification can be used to represent expression templates. A SNOMED CT expression template is a SNOMED CT expression, which contains one or more template slots. As defined in Syntax Specification, all template slots are represented using a pair of double square brackets - i.e. [[ ]].
There are two main types of template slots:
Replacement Slots , which are replaced by a concept, expression or string during template processing, and
Information Slots , which are purely there to provide metadata about how the template is to be processed.
In addition to a type and a constraint, replacement slots may also be given a name. Slot names are explained in more detail below.
Replacement slots may be given a slot name, to allow them to be referenced from outside the slot. There are a variety of reasons to do this, including assigning a value to each slot and creating a co-dependency constraint between slots. The most common use of slot names is to refer to the slot to which a value is assigned, during the process of populating the template.
Slot names are defined within the slot using an '@' prefix. For example, the following expression template includes one slot that represents the value of | Associated with| . This slot has been given the slot name "finding".
If a segment of code, a data file or a document assigns the value 56265001 | Heart disease| to the finding slot (e.g. finding = 56265001 | Heart disease| ), then the following expression can be created.
Slot names may be repeated within a template. When the same slot name is associated with more than one slot in the same template, it indicates that these slots must be populated with the same value.
For example, the expression template below has two slots, which have each been given the name "site".
If we assign the value to the slots named "site" (i.e. site = ), the below expression would be created.
For additional uses of slot names, please refer to .
Replacement slots serve as a placeholder for a value that is not known at the time of authoring, but which can be completed at a subsequent time using data recorded elsewhere (such as in an information model or entered into a data entry form). A slot indicates that it may be replaced by a value by including a plus sign ( + ) as the first symbol within the slot. Replacement slots may be used in an expression template wherever a concept, expression or symbol may appear within an expression.
A replacement slot may be used to delay the selection of a focus concept in an expression. For example, the expression template below uses a slot to indicate that the focus concept in the expression can be replaced with any appropriate SNOMED CT expression. This expression template represents any expression with a single refinement in which the | Laterality| equals | Right| .
If the following values are provided to complete the slot:
182245002 |Entire upper limb| 182281004 |Entire lower limb| 244486005 |Entire eye| 1910005 |Entire ear|
then the expressions that result from processing the template would be:
A replacement slot may also be used to replace an attribute value in an expression. For example, the expression template below represents any expression with a focus concept of and a refinement which uses the attribute . The value of the attribute may be replaced by any valid value at a future time.
If the following value is provided to complete the slot:
then the expression that results from processing the template would be:
If, however, the value provided to complete the slot was the expression:
then the result of processing the template would be:
Please note that the template processor must add round brackets around the subexpression to ensure that the resulting expression is syntactically valid.
A replacement slot may also be used to replace an attribute name in an expression. For example, the expression template below represents any expression with a focus concept of and a refinement whose value equals The attribute name in the expression may be replaced by any valid attribute concept at a future time.
If the following values are provided to complete the slot:
then the expressions that result from processing the template would be:
The value that can be used to replace a slot in an expression template may be constrained by an expression constraint, value list constraint or range constraint (depending on the type of replacement slot). The following types of slot constraint may be used:
Expression constraints may be used to constrain replacement slots of type id and scg
Value list constraints may be used to constrain replacement slots of type tok, str, int, dec and bool.
Range constraints may be used to constrain replacement slots of type int and dec.
The following sections provide examples of each of these types of replacement constraints.
Expression constraints may be used to constrain the values permitted to replace a slot of type id or scg in an expression template.
For example, the slot in the following expression template can only be replaced by a concept reference that is a descendant or self of .
Because the concept is a descendant or self of , it may be used to replace the slot in the above expression template, resulting in the following expression.
However, the concept may not be used as a replacement (because it is not a descendant or self of ).
Similarly, in the following expression template, the slot can be replaced by any expression that is a descendant of .
Value list constraints can be used to constrain the possible values that may replace slots of type tok, str, int, dec and bool.
For example, the following expression template uses a value list constraint to specify the possible definitionStatus tokens that may be used. The slot in this expression template may be replaced with either the token "<<<" or the token "===".
If the causative agent is assigned the value then the following two expressions can be generated (depending on the token selected to replace the first slot).
The expression template below uses a value list constraint to constrain the value of the slot to the string "PANADOL", the string "TYLENOL", or the string “HERRON”.
Depending on the value used to replace the slot, any of the following three expressions may be generated.
In the next example, a value constraint is used to constrain a replacement slot of type int. In this case, the slot may be replaced by the integer values 10, 20 or 30.
The possible expressions that may be generated by filling the slot are:
Range constraints can be used by slots of type int or dec to constrain the permitted replacement values. Range constraints may specify the minimum permitted value, the maximum permitted value, or both. By default, ranges are inclusive (that is, the range includes the stated minimum and maximum values). However exclusive ranges (in which the stated minimum or maximum is not itself allows as a value) may be specified.
For example, the following expression template allows any pack size to be used that is between 20 and 30 capsules (inclusive).
To specify exclusive minimum values, a greater than sign (‘>’) is placed before the minimum value, and to specify exclusive maximum values, a less than sign (‘<’) is placed before the maximum value. For example, the following expression template allows any pack size that is between 20 and 30 capsules (exclusive). This range constraint is equivalent to an inclusive range of 21..29.
Multiple ranges may be specified in a single range constraint. When multiple ranges are specified, these should be interpreted as alternative ranges. For example, the expression template below permits any pack size between 10 and 20 capsules (inclusive), or between 30 and 40 capsules (inclusive). This template does not, for example, permit a pack size between 21 and 29 capsules.
When a minimum value is required with no maximum, it is possible to omit the maximum value in a range constraint. For example, the expression template below permits any pack size greater than or equal to 20 capsules.
Similarly, it is also possible to state a maximum without a minimum constraint. For example, the expression template below permits any pack size less than or equal to 20 capsules. It should be noted that without a concept model rule to ensure that all pack sizes are greater than zero, this template will, by default, allow a pack size of zero or a negative pack size to be defined.
Unlike replacement slots, information slots are added to an expression template purely to provide metadata about how the template should be processed. When an expression template is processed, the information contained in the information slots is used and then the information slot itself is removed.
Information slots may be added to an expression template in one of three places:
Before a focus concept slot to indicate information about the focus concept that follows,
Before a relationship group to indicate information about the relationship group that follows, and
Before an attribute to indicate information about the attribute name-value pair that follows.
Information slots may include either a cardinality constraint or a slot name (or both). In the following sections, we describe how each of these may be used in an information slot.
One of the important roles of an information slot is to specify the cardinality of the expression part that follows. A cardinality constraint states the minimum and maximum number of times that the focus concept, relationship group or attribute name-value pair that follows may be repeated in an expression that is generated from the given template.
For example, the expression template below allows between one and three concepts to be used to populate the finding slot, and exactly one _ _ name-value pair.
Based on the cardinality specified in the information slots, the finding slot could be replaced by the two concepts and and the site slot could be replaced by the concept to generate the following expression:
Please note that when two or more concepts are used to replace a focus concept slot in an expression template, a plus sign ( + ) must be added between them to ensure the resulting expression is syntactically valid.
When a cardinality constraint is not provided in an information slot preceding a focus concept, relationship group or attribute name-value pair, the default cardinality that is assumed is 1..*. This means that by default focus concepts, relationship groups and attribute name-value pairs must appear at least once in the resulting expression, but may also be repeated many times. The SNOMED CT concept model, if enforced, may also impose some additional cardinality constraints on the number of times an attribute may be repeated. However, these additional concept model rules are not directly implied by the expression template itself.
As an example, the following expression template allows one or more procedures to be collectively refined by one or more relationship groups, each containing one or more values for and .
The above expression template is therefore equivalent to the following template, in which the cardinality of 1..* is explicitly stated on the focus concept, the relationship group, and each attribute name-value pair.
The replacement slots in this expression template could, for example, be replaced to generate the following expression:
Please note that if the international SNOMED CT concept model was enforced, the above expression would not be valid due to the appearing twice in the one relationship group.
Information slots can also be given a slot name, to allow the expression part that follows the slot (i.e. focus concept, relationship group, or attribute name-value pair) to be referenced. The most common use of information slot names is to support the process of populating the template (e.g. as part of a programmatic value replacement process).
For example, the following expression template uses the name mpGroup to name the relationship group that contains both a and a
In addition to the simple examples shown on the previous pages, more advanced expression templates can also be used. On this page we show some examples of expression constraints with multiple replacement slots, multiple cardinality constraints and slot co-dependency constraints.
In many situations, it is useful for an expression template to contain more than one replacement slot. Below are some examples.
The following expression template uses three replacement slots to generate an expression that represents a type of procedure. The first slot (named "Procedure") is a placeholder for the focus concept, while the second slot (named "BodySite") is a placeholder for the | Procedure site - Direct| , and the third slot (named "Method") is a placeholder for the | Method| .
If the slots are populated with the values:
Procedure =
BodySite =
Method =
then the following expression would be generated.
Another example of an expression template with multiple slots is shown below. This expression template is used to generate expressions that represent the family history of a patient. The template contains two slots - the first slot (named "Finding") is a placeholder for the known to be present in the family member, while the second slot (named "Relationship") is a placeholder for the of this .
If the following input data is provided (in which each row represents a separate expression):
Then the following family history expressions would be generated.
Expression templates may also use more than one cardinality constraint to indicate the repeatability of different parts of the expression. Below are some examples.
The following expression template uses three replacement slots to generate an expression that represents a type of procedure. The first slot (named "Procedure") is a placeholder for the focus concept, while the second slot (named "BodySite") is a placeholder for the , and the third slot (named "Method") is a placeholder for the .
The first cardinality constraint (i.e. 1..1 ) indicates that exactly one value should be populated in the Procedure slot. The second cardinality constraint (i.e. 1..2 ) indicates that it is valid to include either 1 or 2 relationship groups in the resulting expression. The last two cardinality constraints, that appear inside the relationship group, (i.e. 1..1 ) indicate that in each instance of a relationship group, exactly one value and exactly one value should be used.
The following input data satisfies these cardinality constraints.
If the slots are populated with the values above, then the following expressions would be generated
Another example of an expression template with multiple cardinality constraints is shown below. This expression template is used to generate expressions that represent a clinical finding with explicit context.
The first cardinality constraint (i.e. 1..1 ) indicates that exactly one value should be populated in the Condition slot. The second cardinality constraint (i.e. 1..2 ) indicates that it is valid to include either 1 or 2 relationship groups (named "AFgroup") in the resulting expression. Each AFgroup relationship group must have exactly one , exactly one , exactly one and exactly one . The value of the in each AFgroup is an expression, may optionally be refined using a single relationship group named "SSgroup". Each SSgroup optionally has one and optionally has one . Based on these cardinality constraints, the input data shown in would be valid.
Table 8.6-1: Valid Input Data for Example 2
If the slots are populated with the values above, then the following expressions would be generated.
Please note that when part of an expression is repeated, connectors (e.g. a comma) must be added between the parts during processing. Similarly, when part of an expression is absent then clean up is required (e.g. to remove commas and brackets). For more information on these processing steps, please refer to .
28231008 |Gallbladder structure|
129304002 |Excision - action|
387713003 |Surgical procedure|
1
66754008 |Appendix structure|
129304002 |Excision - action|
24484000 |Severe|
444292000 |Paternal grandfather of subject|
410512000 |Current or specified time|
410515003 |Known present|
2
22298006 |Myocardial infarction|
444292000 |Paternal grandfather of subject|
410589000 |All times past|
410516002 |Known absent|
57177007 |Family history with explicit context|
1
363346000 |Cancer|
6736007 |Moderate|
76752008 |Breast structure|
444244000 |Maternal grandmother of subject|
410512000 |Current or specified time|
410515003 |Known present|
160303001 |FH: Diabetes mellitus|
1
46635009 |Diabetes mellitus type 1|
444301002 |Mother of subject|
410512000 |Current or specified time|
410515003 |Known present|
387713003 |Surgical procedure|
1
28273000 |Bile duct structure|
281615006 |Exploration - action|
243796009 |Situation with explicit context|
1
2
56265001 |Heart disease|