Skip to end of metadata
Go to start of metadata

In this section, we explain the steps involved in generating a set of SNOMED CT expressions from a SNOMED CT expression template and a set of input data. As illustrated in 7. Processing Expression Templates, this includes:

  • Adding repetition and connectors;
  • Replacing slot values;
  • Removing information slots; and
  • Cleaning up.

Please note that these steps do not necessarily need to be performed in this order. 

Add Repetition and Connectors

Expression templates may use explicit or default cardinalities to indicate parts of the expression that may be repeated (i.e. where the maximum cardinality is great than 1). In particular, a focus concept may be repeated, a relationship group may be repeated, or an attribute-value pair may be repeated. Repetition, however, is only required when multiple values are provided in the input data for a particular part of the template (see 7.1. Preparing Input Data). When multiple values are found in the input data, and this corresponds to a repeatable part of the expression template, the associated part of the expression must be duplicated to enable each separate value to be included.

For example, let's consider the following expression template and input data.

    [[1..*]] [[+id (<<  64572001 |Disease| ) @Disease]]:
        [[1..* @Group]] { [[1..* @CausedBy]] 
246075003 |Causative agent|  = [[+id (<  410607006 |Organism| ) @Organism]],
                            [[0..1 @After]] 
255234002 |After|  = [[+id (<  404684003 |Clinical finding| ) @Finding]] }

The input data above includes 2 focus concepts, 2 relationship groups, and 2 CausedBy attribute-name value pairs in the first relationship group. To support this input data, the expression template must duplicate the focus concept, relationship group, and the attribute name-value pair (in the first relationship group).

When parts of an expression template are repeated, it is important to ensure that the correct connector is added between repeated parts. For example, a "+" is added between repeated focus concepts, a "," is added between repeated relationship groups (although this is optional), and a "," is added between repeated name-value pairs.

The result of adding repetition and connectors to the above expression template (for the given input data) is shown below:

    [[1..*]] [[+id (<<  64572001 |Disease| ) @Disease]] + [[+id (<<  64572001 |Disease| ) @Disease]]:
        [[1..* @Group]] { [[1..* @CausedBy]] 
246075003 |Causative agent|  = [[+id (<  410607006 |Organism| ) @Organism]],
                                            
246075003 |Causative agent|  = [[+id (<  410607006 |Organism| ) @Organism]],
                            [[0..1 @After]] 
255234002 |After|  = [[+id (<  404684003 |Clinical finding| ) @Finding]] },
                        { [[1..* @CausedBy]] 
246075003 |Causative agent|  = [[+id (<  410607006 |Organism| ) @Organism]],
                            [[0..1 @After]] 
255234002 |After|  = [[+id (<  404684003 |Clinical finding| ) @Finding]] }
Please note that when an expression is used to populate an attribute value, it may be required to add brackets around the attribute value to ensure syntactic correctness of the resulting expression

Replace Slot Values

With the repetition and connectors in place, the replacement slots must now be replaced with values. Each definition status, focus concept, attribute name and attribute value replacement slot must be removed, and the corresponding value from the input data inserted into the expression. After this step, the expression template above would look like the following:

    [[1..*]]  40733004 |Disorder due to infection|  +  19342008 |Subacute disease| :
        [[1..* @Group]] { [[1..* @CausedBy]] 
246075003 |Causative agent|  =  80166006 |Streptococcus pyogenes| ,
                                            
246075003 |Causative agent|  =  113985000 |Streptococcus gallolyticus| ,
                            [[0..1 @After]] 
255234002 |After|  =  58718002 |Rheumatic fever|  },
                        { [[1..* @CausedBy]] 
246075003 |Causative agent|  =  49872002 |Virus| ,
                            [[0..1 @After]] 
255234002 |After|  = }

Remove Information Slots

Once the information contained in the information slots has been interpreted and processed, the information slots can be removed from the template. After this step, the expression template above would look like the following:

Clean Up

Clean up is an activity that can occur at any or all stages of template processing. However, any clean up that has not occurred during the previous stages, should be performed before completion. 

In particular, this step involves moving any extra brackets (i.e. "( ... )"), braces (i.e. "{ ... }"), colons (i.e. ":"), equals (i.e. "="), attribute names or connectors (i.e. "+" or ",") that would cause the resulting expression to be syntactically invalid. Extraneous characters are most likely to occur when optional parts of an expression template have no corresponding value in the populated expression. When this occurs,  clean up may be required to remove these characters.

In our example expression above, this step would involve removing the second instance of the attribute name 255234002 |After|, the comma before it, and the equals signs after. The resulting expression would look like:


Feedback
  • No labels