> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omophub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FHIR ConceptMap/$closure for subsumption tables

> Compute and maintain FHIR subsumption closure tables across OMOP concepts - track ancestor/descendant links between vocabulary version updates.

## Overview

Given a set of concept codes, computes all subsumption (is-a) relationships among them and returns a FHIR ConceptMap. Used by advanced FHIR clients for offline hierarchy reasoning.

This is a stateless operation -- the closure is computed fresh each request.

## Contract Parameters

**version** `string` (default: r4)

**vocab\_release** `string`

OMOP vocabulary release; defaults to the active release.

**X-Vocab-Release** `string`

Header alternative to `vocab_release`; the header takes precedence.

FHIR wire version (`r4`, `r4b`, `r5`, or `r6`).

**resourceType** `string` *required*

Must be `Parameters`.

**parameter** `array` *required*

FHIR Parameters entries. Include one optional `name` entry and between 1 and
50 repeatable `concept` entries.

**parameter entries**

**parameter\[].name** `string` *required*

Entry name: `name` for the client-defined closure-table name, or `concept`
for a concept Coding.

**parameter\[].valueString** `string`

Client-defined closure-table name when `parameter[].name` is `name`;
accepted but not persisted.

**parameter\[].valueCoding** `object`

Coding value when `parameter[].name` is `concept`. Supply 1–50 concept
entries.

**parameter\[].valueCoding.system** `string` *required*

Canonical code-system URI for the concept.

**parameter\[].valueCoding.code** `string` *required*

Code in the specified system.

## Request

```bash theme={null}
curl -X POST "https://fhir.omophub.com/fhir/r4/ConceptMap/\$closure" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/fhir+json" \
  -d '{
    "resourceType": "Parameters",
    "parameter": [
      { "name": "name", "valueString": "my-closure" },
      { "name": "concept", "valueCoding": { "system": "http://snomed.info/sct", "code": "73211009" } },
      { "name": "concept", "valueCoding": { "system": "http://snomed.info/sct", "code": "44054006" } },
      { "name": "concept", "valueCoding": { "system": "http://snomed.info/sct", "code": "46635009" } }
    ]
  }'
```

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `parameter` | array | Yes | FHIR Parameters entries |
| `parameter[name=name]` | string | No | Client-defined closure table name (accepted but not persisted) |
| `parameter[name=concept]` | Coding | Yes (repeatable) | Concept codes to include in the closure (max 50) |

## Response

### Response Fields

**resourceType** `string`

Always `ConceptMap`.

**name** `string`

Echoed closure name.

**status** `string`

Always `active`.

**group** `array`

Groups of relationships by source system.

**group\[].source** `string`

Source system URI.

**group\[].target** `string`

Target system URI.

**group\[].element** `array`

Ancestor codes and target descendants.

**group\[].element\[].target** `array`

Descendant code and `subsumes` equivalence.

```json theme={null}
{
  "resourceType": "ConceptMap",
  "name": "my-closure",
  "status": "active",
  "group": [
    {
      "source": "http://snomed.info/sct",
      "target": "http://snomed.info/sct",
      "element": [
        {
          "code": "73211009",
          "target": [
            { "code": "44054006", "equivalence": "subsumes" },
            { "code": "46635009", "equivalence": "subsumes" }
          ]
        }
      ]
    }
  ]
}
```

In this example, "Diabetes mellitus" (73211009) subsumes both "Type 2 diabetes mellitus" (44054006) and "Type 1 diabetes mellitus" (46635009).

## Limits

* Maximum **50 concepts** per request
* POST only (per FHIR specification)
* Stateless -- no server-side closure table is maintained

## Errors

| HTTP | Issue Code | Cause |
| - | - | - |
| 400 | `invalid` | No concept parameters provided, or exceeds 50 concepts |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.