> 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-diagramming-specification/appendix/appendix-a-template-expressions.md).

# Appendix A - Template Expressions

This appendix describes potential future changes designed to support template expressions. That is, expressions with predefined variables which when assigned values populate the expression.

As these are potential future extensions, this section is not a normative part of this document. It exists to gather feedback on proposed handling of template expressions. Once appropriate extensions are made to the SNOMED CT Compositional Grammar to support template extensions this section will be updated with feedback and moved to the normative part of this document.

## Slots

For diagrams representing a template expression or definition, it is possible to represent "slots" which represent a placeholder a concept can fill when the template is used (see A.3). Slots are expressed using a parallelogram as shown below. The name of the slot can be considered like a variable for replacement and is surrounded by angle brackets "<" and ">".

<figure><img src="/files/Yi9nvrUcGSfVsAiV0MRh" alt=""><figcaption></figcaption></figure>

## Color for Slots

Slots as described in section A.1 are optionally coloured with RGB FF9999 (decimal 255, 153, 153) as shown below:

<figure><img src="/files/lAwpsIrYBv7xwLdL02As" alt=""><figcaption></figcaption></figure>

## Concept Definition Template Diagrams

Using the "slot" element described in A.1 it is possible to define diagrams that represent a template for concept definition or expressions. It is then possible to use this template to create concepts or expressions by filling the "slots" with appropriate concepts.

<figure><img src="/files/5vBCeQRWalhHBcm4kzSd" alt=""><figcaption><p>Figure Appendix A-1: Example template diagram using "slots"</p></figcaption></figure>

These template diagrams are a specialisation of concept definition diagrams as described in section 3.2; however, some of the attribute value concepts are replaced by "slots", making the definition general and reusable.

Note the names provided for the "slots" are enclosed in angle brackets "<" and ">". These slot names are inserted into the name of the concept in the top left of the diagram.

The names associated with slots operate as unique variable names for a diagram or set of diagrams. When populated, every slot with the same name on a diagram, or set of related diagrams, receives the same concept value associated with that slot name. Unless all slots names used are assigned concept values, the expression is not complete.

<a href="https://docs.google.com/forms/d/e/1FAIpQLScTmbZIf0UEQwYDkY27EEWBkaiYkHSbR0_9DmFrMLXoQLyL7Q/viewform?usp=pp_url&#x26;entry.1767247133=SNOMED+Diagramming+Specification&#x26;entry.670899847=Appendix%20A%20-%20Template%20Expressions" 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 dynamically by asking a question.

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

```
GET https://docs.snomed.org/snomed-ct-specifications/snomed-ct-diagramming-specification/appendix/appendix-a-template-expressions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
