> For the complete documentation index, see [llms.txt](https://docs.snomed.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-template-syntax-specification/6-snomed-ct-language-templates.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
