# Relationship File Specification

The Relationship file holds one relationship per row. Each relationship is of a particular type, and has a source concept and a destination concept.

*An example of a relationship is given below for: <mark style="color:blue;">|</mark>Outpatient procedure<mark style="color:blue;">|</mark> where:*

* [*371883000 |Outpatient procedure|*](http://snomed.info/id/371883000) *is the source concept;*
* [*116680003 |Is a|*](http://snomed.info/id/116680003) *is the relationship type concept and;*
* [*71388002 |Procedure|*](http://snomed.info/id/71388002) *is the destination concept.*

***

<table data-full-width="true"><thead><tr><th width="177.0625">Field</th><th width="110.421875">Data type</th><th width="695.7500610351562">Purpose</th><th width="89.9718017578125">Mutable</th><th>Part of Primary Key</th></tr></thead><tbody><tr><td>id</td><td>SCTID</td><td>Uniquely identifies the relationship.</td><td><mark style="color:red;"><strong>NO</strong></mark></td><td><p><mark style="color:green;"><strong>YES</strong></mark></p><p>(Full/</p><p>Snapshot)</p></td></tr><tr><td>effectiveTime</td><td>Time</td><td><p>Specifies the inclusive date at which the component version's state became the then current valid state of the component.</p><p><strong>Note</strong> : In distribution files the effectiveTime should follow the short ISO date format (<em>YYYYMM DD</em>) and should not include the hours, minutes, seconds or timezone indicator.</p></td><td><mark style="color:green;"><strong>YES</strong></mark></td><td><p><mark style="color:green;"><strong>YES</strong></mark></p><p>(Full)</p><p><mark style="color:green;">Optional</mark> (Snapshot)</p></td></tr><tr><td>active</td><td>Boolean</td><td>Specifies whether the state of the relationship was active or inactive from the nominal release date specified by the effectiveTime field.</td><td><mark style="color:green;"><strong>YES</strong></mark></td><td><mark style="color:red;"><strong>NO</strong></mark></td></tr><tr><td>moduleId</td><td>SCTID</td><td>Identifies the relationship version's module. Set to a child of <a href="http://snomed.info/id/900000000000443000">900000000000443000 | Module|</a> within the metadata hierarchy.</td><td><mark style="color:green;"><strong>YES</strong></mark></td><td><mark style="color:red;"><strong>NO</strong></mark></td></tr><tr><td>sourceId</td><td>SCTID</td><td>Identifies the source concept of the relationship version. That is the concept defined by this relationship. Set to the identifier of a concept.</td><td><mark style="color:red;"><strong>NO</strong></mark></td><td><mark style="color:red;"><strong>NO</strong></mark></td></tr><tr><td>destinationId</td><td>SCTID</td><td>Identifies the concept that is the destination of the relationship version.That is the concept representing the value of the attribute represented by the typeId column. Set to the identifier of a concept. Note that the values that can be applied to particular attributes are formally defined by the <a href="https://app.gitbook.com/o/h8Z6qGxuQrzM9vbx5bPT/s/wLJPOzgAQsSAYr6nhvCl/">SNOMED CT Machine Readable Concept Model</a>.</td><td><mark style="color:red;"><strong>NO</strong></mark></td><td><mark style="color:red;"><strong>NO</strong></mark></td></tr><tr><td>relationshipGroup</td><td>Integer</td><td>Groups together relationship versions that are part of a logically associated relationshipGroup. All active Relationship records with the same relationshipGroup number and sourceId are grouped in this way.</td><td><mark style="color:green;"><strong>YES</strong></mark></td><td><mark style="color:red;"><strong>NO</strong></mark></td></tr><tr><td>typeId</td><td>SCTID</td><td><p>Identifies the concept that represent the defining attribute (or relationship type) represented by this relationship version.</p><p>That is the concept representing the value of the attribute represented by the typeId column.</p><p>Set to the identifier of a concept. The concept identified must be either 116680003 <mark style="color:blue;">|</mark>Is a<mark style="color:blue;">|</mark> or a subtype of 410662002 <mark style="color:blue;">|</mark>Concept model attribute<mark style="color:blue;">|</mark>. The concepts that can be used as in the typeId column are formally defined as follows:</p><p><a href="http://snomed.info/id/116680003">116680003 |is a|</a> <mark style="color:green;">OR &#x3C;</mark> <a href="http://snomed.info/id/410662002">410662002 |concept model attribute|</a></p><p>Note that the attributes that can be applied to particular concepts are formally defined by the <a href="https://app.gitbook.com/o/h8Z6qGxuQrzM9vbx5bPT/s/wLJPOzgAQsSAYr6nhvCl/">SNOMED CT Machine Readable Concept Model</a>.</p></td><td><mark style="color:red;"><strong>NO</strong></mark></td><td><mark style="color:red;"><strong>NO</strong></mark></td></tr><tr><td>characteristicTypeId</td><td>SCTID</td><td>A concept enumeration value that identifies the characteristic type of the relationship version (i.e. whether the relationship version is defining, qualifying, etc.) This field is set to a descendant of <a href="http://snomed.info/id/900000000000449001">900000000000449001 |Characteristic type|</a> in the metadata hierarchy.</td><td><mark style="color:green;"><strong>YES</strong></mark></td><td><mark style="color:red;"><strong>NO</strong></mark></td></tr><tr><td>modifierId</td><td>SCTID</td><td><p>A concept enumeration value that identifies the type of Description Logic (DL) restriction (some, all, etc.). Set to a child of <a href="http://snomed.info/id/900000000000450001">900000000000450001 |Modifier|</a> in the metadata hierarchy.</p><p>Currently the only value used in this column is <a href="http://snomed.info/id/900000000000451002">900000000000451002 |Some|</a> and thus in practical terms this column can be ignored. For further clarification please see <a href="https://github.com/SNOMED-Documents/snomed-release-file-specification/blob/main/4%20component-release-files-specification/4.2%20file-format-specifications/broken-reference/README.md">Notes on modifierId</a>.</p></td><td><mark style="color:green;"><strong>YES</strong></mark></td><td><mark style="color:red;"><strong>NO</strong></mark></td></tr></tbody></table>

{% hint style="info" %}
PK\* indicates if the attribute is part of the primary key for that file/table.
{% endhint %}

Only one relationship record with the same id field will be current at any point in time. The current record will be the one with the most recent effectiveTime before or equal to the point in time under consideration.

If the active field of this record is false ('0'), then the relationship is inactive at that point in time. If the active field is true ('1'), then there is a relationship between the SNOMED CT concepts identified by sourceId and destinationId.

The sourceId, destinationId, relationshipGroup, typeId, characteristicTypeId and modifierId will not change between two rows with the same id, in other words they are immutable. Where a change is required to one of these fields, then the current row will be de-activated (by appending a row with the same id and the active field set to false) and a new row with a new id will be appended.

The relationshipGroup field is used to group relationships with the same sourceId field into one or more logical sets. A relationship with a relationshipGroup field value of '0' is considered not to be grouped. All relationships with the same sourceId and non-zero relationshipGroup are considered to be logically grouped.

The relationshipGroup field will be an unsigned Integer, and will not be limited to a single digit value. There is no guarantee that they will be assigned sequentially, and the values will not be unique across concepts.

## Related Links

* [SNOMED CT Machine Readable Concept Model](https://app.gitbook.com/o/h8Z6qGxuQrzM9vbx5bPT/s/wLJPOzgAQsSAYr6nhvCl/).
* [Appendix C. Unicode UTF-8 encoding](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-release-file-specification/appendices/appendix-c-unicode-utf-8-encoding)

<a href="https://docs.google.com/forms/d/e/1FAIpQLScTmbZIf0UEQwYDkY27EEWBkaiYkHSbR0_9DmFrMLXoQLyL7Q/viewform?usp=pp_url&#x26;entry.1767247133=Release+File+Specification&#x26;entry.670899847=Relationship%20File%20Specification" 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-release-file-specification/component-release-file-specification/4.2-file-format-specifications/4.2.3-relationship-file-specification.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.
