# Expression Repository in RF2

## Expression Repository Extension

Implementing an expression repository using the standard format specified by SNOMED International is comparable to the implementation of a SNOMED CT extension. As for SNOMED CT extensions, the content contained in the expression repository depends on a specific versioned Edition of SNOMED CT, and it requires ongoing maintenance to align with new versions of SNOMED CT.

<figure><img src="/files/8GVSWxVDCvp59bHkE20g" alt=""><figcaption></figcaption></figure>

The difference between a common SNOMED CT Extension and an Expression Repository Extension can be summarized as follows:

**Difference in the representation of clinical meanings**

* Clinical meanings expressed in a common extension are represented as **SNOMED CT concept components** and require creation and management by SNOMED CT authors
* Clinical meanings expressed in an expression repository extension are represented as **SNOMED CT expression components**

**Difference in the content included**

* A common SNOMED CT Extension may contain various components and derivatives (see [SNOMED CT Extension Guide](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-extension-guide/))
* An expression repository extension contains only the components and derivatives required to represent postcoordinated expressions\
  Consequently, the following components and derivatives may be contained to meet the requirements outlined in [Requirements](https://github.com/SNOMED-Documents/snomed-postcoordination-guide/blob/main/expressions-in-a-terminology-server/5.1%20requirements):
  * Expression components to uniquely identify the expressions
  * A reference set to hold the CTU expressions
  * A reference set to hold the CF expressions
  * Expression relationships to represent the NNF of the expressions
  * A component annotation reference set to hold the display terms associated with the expression
* Release process
  * Extensions are released
  * Expressions are not released

### Logical Model

The image below illustrates the logical model of an expression repository extension.

<figure><img src="/files/tvaqaRWuRFVk6RNdO2uH" alt=""><figcaption><p>Overview of the logical model of a SNOMED CT Expression Repository</p></figcaption></figure>

### **Expression Component**

Implementing an expression repository involves the creation of expression components, where the expression identifier uses the partition id of '16'. For more information about SNOMED CT identifiers, please refer to the [release file specification.](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-release-file-specification/)

This identifier enables the unique identification of an expression and is used to establish a link between all required forms of the expression.

* The expression identifier is:
  * Used as the id for the expression component
  * Referenced in the [1119435002 | Canonical close to user form expression reference set (foundation metadata concept)|](http://snomed.info/id/1119435002) as the value of the referencedComponentId
  * Referenced in the [1119468009 | Classifiable form expression reference set (foundation metadata concept)|](http://snomed.info/id/1119468009) as the value of the referencedComponentId
  * Used as the source of the expression relationships to represent the necessary properties of the expression

The moduleId attribute of the expression component refers to a concept that represents and names the module in which the expressions are maintained. This concept is a subtype of [900000000000443000 | Module|](http://snomed.info/id/900000000000443000) , and the terms associated with this concept should clearly indicate that this module is an expression repository, e.g. [1234567890 | national extension expression repository module|](http://snomed.info/id/1234567890) .

### **Canonical Close to User Form Expression Reference Set**

The CTU is stored in a separate reference set [1119435002 | Canonical close to user form expression reference set (foundation metadata concept)|](http://snomed.info/id/1119435002) which is of the type [Postcoordinated Expression Type Reference Set](https://confluence.ihtsdotools.org/display/WIPRELFMT/5.2.1.10++Postcoordinated+Expression+Type+Reference+Set?src=sidebar) .

Expressions in the close-to-user form will get an effectiveTime as soon as they are saved, this will match that of the current dependent code system version.

### **Classifiable Form Expression Reference Set**

The CF is stored in a separate reference set [1119468009 | Classifiable form expression reference set (foundation metadata concept)|](http://snomed.info/id/1119468009) which is of the type [Postcoordinated Expression Type Reference Set](https://confluence.ihtsdotools.org/display/WIPRELFMT/5.2.1.10++Postcoordinated+Expression+Type+Reference+Set?src=sidebar).

Members in the classifiable form reference set are given an effectiveTime. This will happen before the code system is upgraded to a new dependent version. Once these components are versioned they will keep the effectiveTime until the values of their fields are changed, via the transformation or classification processes. At this point changed components will have their effectiveTime cleared and will be versioned again when the code system is next versioned.

### **Expression Relationship**

Following the classification of the CF expression, the NNF of the expression is represented as relationships. In the same way as SNOMED CT concepts, expression components include subtype and attribute relationships to represent the properties of the expression.

Components of expressions in the classifiable and necessary normal forms will have an effectiveTime set when the expression code system is versioned. This will happen before the code system is upgraded to a new dependent version. Once these components are versioned they will keep the effectiveTime until the values of their fields are changed, via the transformation or classification processes. At this point changed components will have their effectiveTime cleared and will be versioned again when the code system is next versioned.

<a href="https://docs.google.com/forms/d/e/1FAIpQLScTmbZIf0UEQwYDkY27EEWBkaiYkHSbR0_9DmFrMLXoQLyL7Q/viewform?usp=pp_url&#x26;entry.1767247133=Postcoordination+Guide&#x26;entry.670899847=expression-repository-in-rf2" 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-practical-guides/snomed-ct-postcoordination-guide/expressions-in-a-terminology-server/implementation-examples/expression-repository-in-rf2.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.
