# SNOMED CT Language Templates

In this section, we explain how the SNOMED CT template syntax can be applied to the computable languages to create template languages. In particular, we combine the [Template Syntax](http://snomed.org/sts) with [Compositional Grammar](http://snomed.org/scg) to create the [Expression Template Language](/snomed-ct-specifications/snomed-ct-template-syntax-specification/6-snomed-ct-language-templates/6.1-expression-template-language.md). A similar process can be used to combine the [Template Syntax](http://snomed.org/sts) with the [Expression Constraint Language](http://snomed.org/ecl) to create an Expression Constraint Template Language.

SNOMED CT template languages are created by:

1. Combining the base language (to which the slots are added) with the SNOMED CT template syntax;
2. Adding any additional rules referenced by the SNOMED CT template syntax (e.g. the Expression Constraint Language to represent slot value constraints);
3. Removing any duplicate rules (e.g. rules that are repeated in both the base language and the expression constraint language;
4. Adding references to the template syntax in the appropriate rules of the base language to support the inclusion of slots. This involves:
   1. Renaming the first rule in the base language to add the word "Template" (e.g. from "expression" to "expressionTemplate");
   2. Adding the rule **tokenReplacementSlot** as an alternative wherever a token is referenced (e.g. "definitionStatus / tokenReplacementSlot");
   3. Adding the rules **conceptReplacementSlot** and **expressionReplacementSlot** as alternatives within the **conceptReference** rule;
   4. Adding the rule **concreteValueReplacementSlot** as an alternative attributeValue; and
   5. 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](/snomed-ct-specifications/snomed-ct-template-syntax-specification/6-snomed-ct-language-templates/6.1-expression-template-language.md) syntax in the next section.

<a href="https://docs.google.com/forms/d/e/1FAIpQLScTmbZIf0UEQwYDkY27EEWBkaiYkHSbR0_9DmFrMLXoQLyL7Q/viewform?usp=pp_url&#x26;entry.1767247133=SNOMED+Template+Syntax+Specification&#x26;entry.670899847=6.%20SNOMED%20CT%20Language%20Templates" class="button primary">Provide Feedback</a>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snomed.org/snomed-ct-specifications/snomed-ct-template-syntax-specification/6-snomed-ct-language-templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
