In this section, we describe explain how the SNOMED CT template syntax can be applied to different SNOMED languages, and how the resulting templates should be processed to generate a completed expression, expression constraint or querythe computable languages to create template languages. In particular, we combine the Template Syntax with Compositional Grammar to create the Expression Template Language. A similar process can be used to combine the Template Syntax with the Expression Constraint Language to create an Expression Constraint Template Language.
SNOMED CT template languages are created by:
- Combining the base language (to which the slots are added) with the SNOMED CT template syntax;
- Adding any additional rules referenced by the SNOMED CT template syntax (e.g. the Expression Constraint Language to represent slot value constraints);
- Removing any duplicate rules (e.g. rules that are repeated in both the base language and the expression constraint language;
- Adding references to the template syntax in the appropriate rules of the base language to support the inclusion of slots. This involves:
- Renaming the first rule in the base language to add the word "Template" (e.g. from "expression" to "expressionTemplate");
- Adding the rule tokenReplacementSlot as an alternative wherever a token is referenced (e.g. "definitionStatus / tokenReplacementSlot");
- Adding the rules conceptReplacementSlot and expressionReplacementSlot as alternatives within the conceptReference rule;
- Adding the rule concreteValueReplacementSlot as an alternative attributeValue; and
- Adding the rule templateInformationSlot before each focus concept, each attribute group and each attribute name value pair.
For an example of how this process is applied to SNOMED CT compositional grammar to create expression templates, please refer to the Expression Template Language syntax in the next section.