# Named Replacement Slots

In addition to a type and a constraint, replacement slots may also be given a name. Slot names are explained in more detail below.

## Slot Names

Replacement slots may be given a slot name, to allow them to be referenced from outside the slot. There are a variety of reasons to do this, including assigning a value to each slot and creating a co-dependency constraint between slots. The most common use of slot names is to refer to the slot to which a value is assigned, during the process of populating the template.

Slot names are defined within the slot using an '@' prefix. For example, the following expression template includes one slot that represents the value of [| Associated with|](http://snomed.info/id/246090004) . This slot has been given the slot name "finding".

{% @snomed-syntax-highlighter/snomed-syntax-highlighter lines="6" content="243796009 |Situation with explicit context|: { 246090004 |Associated finding| = \[\[+id (< 404684003 |Clinical finding|) @finding]], 40873100 |Temporal context| = 410511007 |Current or past (actual)| , 408729009 |Finding context| = 410515003 |Known present| , 408732007 |Subject relationship context| = 444148008 |Person in family of subject| }" %}

If a segment of code, a data file or a document assigns the value [56265001 | Heart disease|](http://snomed.info/id/56265001) to the finding slot (e.g. finding = [56265001 | Heart disease|](http://snomed.info/id/56265001) ), then the following expression can be created.

{% @snomed-syntax-highlighter/snomed-syntax-highlighter lines="7" content="243796009 |Situation with explicit context|: { 246090004 |Associated finding| = 56265001 |Heart disease| , 40873100 |Temporal context| = 410511007 |Current or past (actual)| , 408729009 |Finding context| = 410515003 |Known present| , 408732007 |Subject relationship context| = 444148008 |Person in family of subject| }" processed="true" %}

## Repeated Slot Names

Slot names may be repeated within a template. When the same slot name is associated with more than one slot in the same template, it indicates that these slots must be populated with the same value.

For example, the expression template below has two slots, which have each been given the name "site".

{% @snomed-syntax-highlighter/snomed-syntax-highlighter lines="5" content="404684003 |Finding|: { 363698007 |Finding site| = \[\[+ @site]], 363714003 |Interprets| = ( 363787002 |Observable entity|: 704319004 |Inheres in| = \[\[+ @site]] ) }" processed="true" %}

If we assign the value [| Liver structure|](http://snomed.info/id/10200004) to the slots named "site" (i.e. site = [| Liver structure|](http://snomed.info/id/10200004) ), the below expression would be created.

{% @snomed-syntax-highlighter/snomed-syntax-highlighter lines="5" content="404684003 |Finding|: { 363698007 |Finding site| = 10200004 |Liver structure| , 363714003 |Interprets| = ( 363787002 |Observable entity|: 704319004 |Inheres in| = 10200004 |Liver structure| ) }" processed="true" %}

For additional uses of slot names, please refer to [8.6. Advanced Expression Templates](/snomed-ct-specifications/snomed-ct-template-syntax-specification/8-expression-template-examples/8.6-advanced-expression-templates.md).

<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=Named%20Replacement%20Slots" 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/8-expression-template-examples/8.4-named-replacement-slots.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.
