> ## 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.

# Map Concepts

> Map medical concepts between OMOP vocabularies to find equivalent or related concepts across SNOMED, ICD-10, LOINC, RxNorm, and other terminologies.

## Overview

This endpoint maps medical concepts from source vocabularies to target vocabularies, finding equivalent or related concepts across different medical terminology systems. It's essential for healthcare data integration, cross-system interoperability, and clinical data standardization.

## Request Body

Array of source OMOP concept IDs to map (1-100 concepts). Use this OR `source_codes`, not both.

**Important**: These must be OMOP concept IDs (internal database IDs), NOT vocabulary-specific codes. Use `/v1/concepts/by-code/{vocabulary}/{code}` to look up concept IDs from codes, or use `source_codes` parameter instead.

**Example**: `[201826, 192671]` (OMOP concept IDs for Type 2 diabetes and Myocardial infarction)

Array of vocabulary/code pairs to map (1-100 concepts). Use this OR `source_concepts`, not both.

This allows mapping directly from source system codes (e.g., SNOMED codes) without first looking up the OMOP concept ID.

**Example**:

```json theme={null}
[
  {"vocabulary_id": "SNOMED", "concept_code": "44054006"},
  {"vocabulary_id": "SNOMED", "concept_code": "22298006"}
]
```

Target vocabulary identifier to map concepts to

**Examples**: `"ICD10CM"`, `"SNOMED"`, `"ICD9CM"`, `"LOINC"`, `"RxNorm"`

Type of concept mapping to filter results by. When not specified, all mapping types are returned.

**Options**:

* `"direct"` - Direct mappings only (Maps to, Mapped from)
* `"equivalent"` - Equivalent concepts (Maps to, Source - contains, Has precise ingredient)
* `"broader"` - Broader concepts (Is a, Subsumes, Has ingredient)
* `"narrower"` - Narrower concepts (Subsumes, Consists of)

Include mappings whose relationship or target concept is deprecated. Defaults
to `false` - only currently-valid mappings are returned unless you ask for
more.

This page previously documented the default as `true`. That was wrong: the
endpoint has always excluded deprecated mappings when the field is omitted, and
the documentation has been corrected rather than the behaviour, so no existing
request changes.

> [!NOTE]
>
> The sibling `GET /v1/concepts/{id}/mappings` defaults `include_invalid` to
> **`true`**. The two differ deliberately: that endpoint lists what exists for
> one concept, where hiding deprecated mappings would misrepresent the record,
> while this one resolves sources for downstream use, where a deprecated mapping
> is rarely what you want by default. Pass the parameter explicitly on both if
> you need them to agree.

## Query Parameters

**vocab\_release** `string`

Specific vocabulary release version to use for mapping (e.g., "2025.1", "2024.2").
When not specified, uses the default/latest vocabulary version.

## Response

**success** `boolean`

Indicates if the request was successful

**error** `object`

Error information (present only on error responses)

**error**

**code** `string`

Error code identifier (e.g., "INVALID\_VOCABULARY", "RATE\_LIMIT\_EXCEEDED")

**message** `string`

Human-readable error message

**details** `object`

Additional error details including supported vocabularies and validation failures

**details**

**supported\_vocabularies** `array`

List of supported vocabulary names when vocabulary validation fails

**data** `object`

Contains the concept mapping results

**data**

**mappings** `array`

Array of concept mappings found

**mappings**

**source\_concept\_id** `integer`

OMOP concept ID of the source concept

**source\_concept\_name** `string`

Name of the source concept

**source\_vocabulary\_id** `string`

Vocabulary of the source concept

**target\_concept\_id** `integer`

OMOP concept ID of the mapped target concept

**target\_concept\_name** `string`

Name of the target concept

**target\_vocabulary\_id** `string`

Vocabulary of the target concept

**target\_concept\_code** `string`

Original source code in the target vocabulary

**target\_domain\_id** `string`

The target's OMOP domain - **this is what decides which CDM table the
row belongs in.** `Condition` goes to `condition_occurrence`, `Drug` to
`drug_exposure`, `Measurement` to `measurement`, `Procedure` to
`procedure_occurrence`, `Observation` to `observation`.

Read it from the **target**, never from the source: cross-domain maps
are ordinary, so a `Condition` source can have a `Measurement` target,
and two rows in one response can belong in two different tables.

**target\_standard\_concept** `string | null`

`S` for a standard concept, `C` for a classification concept, `null`
otherwise.

Every valid `Maps to` target is expected to be standard. A `Maps to`
row whose `target_standard_concept` is anything but `S` should not be
written to a CDM -- a non-standard target silently corrupts it.

**relationship\_id** `string`

Type of relationship between concepts

**relationship\_name** `string`

Human-readable relationship description

**mapping\_confidence** `number`

Confidence score for the mapping (0.0 to 1.0)

**valid\_start\_date** `string`

Start date when the mapping became valid

**valid\_end\_date** `string`

End date when the mapping expires

**source\_concept\_code** `string`

Original source code in the source vocabulary

**invalid\_reason** `string`

Reason if the mapping is invalid, null otherwise

**mapping\_type** `string`

Classification of the mapping: direct, equivalent, broader, narrower, or related

**unmapped\_sources** `array`

Every submitted source that produced no mappings, with the reason. A
source appears here or as the `source_concept_id` of at least one entry in
`mappings` - never both, and never neither.

**unmapped\_sources**

**source\_concept\_id** `integer`

The OMOP concept ID, when the source resolved or was submitted as an ID

**vocabulary\_id** `string`

Echoed back when the source was submitted through `source_codes`

**concept\_code** `string`

Echoed back when the source was submitted through `source_codes`

**reason** `string`

`source_not_found` - the code or concept ID does not exist in this
vocabulary release. `no_mapping_found` - the source exists but has no
mapping to `target_vocabulary`.

**summary** `object`

Counts for the request as a whole

**summary**

**requested\_sources** `integer`

Number of sources submitted

**mapped\_sources** `integer`

Number of sources that produced at least one mapping

**unmapped\_sources** `integer`

Length of the `unmapped_sources` array

**total\_mappings** `integer`

Length of the `mappings` array

**meta** `object`

Response metadata

**meta**

**request\_id** `string`

Unique request identifier for tracing and support

**timestamp** `string`

ISO 8601 timestamp of when the request was processed

**vocab\_release** `string`

Vocabulary release version used for this request

```bash cURL (ICD-10 to SNOMED) theme={null}
curl -X POST "https://api.omophub.com/v1/concepts/map" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source_codes": [
      {"vocabulary_id": "ICD10CM", "concept_code": "E11.9"},
      {"vocabulary_id": "ICD10CM", "concept_code": "I21.9"}
    ],
    "target_vocabulary": "SNOMED",
    "mapping_type": "direct"
  }'
```

```bash cURL (with OMOP concept IDs) theme={null}
curl -X POST "https://api.omophub.com/v1/concepts/map" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source_concepts": [45576876, 45591524],
    "target_vocabulary": "SNOMED",
    "mapping_type": "direct",
    "include_invalid": false
  }'
```

```ts TypeScript theme={null}
import { OMOPHub } from '@omophub/omophub-node';

const client = new OMOPHub();
// Map ICD-10 codes to SNOMED. `sourceCodes` and `sourceConcepts` are XOR
// (use one or the other, never both).
const { data } = await client.mappings.map({
  sourceCodes: [
    { vocabulary_id: 'ICD10CM', concept_code: 'E11.9' },
    { vocabulary_id: 'ICD10CM', concept_code: 'I21.9' },
  ],
  targetVocabulary: 'SNOMED',
  mappingType: 'direct',
});
```

```python Python theme={null}
import requests

url = "https://api.omophub.com/v1/concepts/map"

# Map ICD-10 codes to SNOMED standard concepts
payload = {
    "source_codes": [
        {"vocabulary_id": "ICD10CM", "concept_code": "E11.9"},
        {"vocabulary_id": "ICD10CM", "concept_code": "I21.9"}
    ],
    "target_vocabulary": "SNOMED",
    "mapping_type": "direct"
}

response = requests.post(
    url,
    json=payload,
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)
data = response.json()
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "mappings": [
      {
        "source_concept_id": 45576876,
        "source_concept_name": "Type 2 diabetes mellitus without complications",
        "source_concept_code": "E11.9",
        "source_vocabulary_id": "ICD10CM",
        "target_concept_id": 201826,
        "target_concept_name": "Type 2 diabetes mellitus",
        "target_concept_code": "44054006",
        "target_vocabulary_id": "SNOMED",
        "target_domain_id": "Condition",
        "target_standard_concept": "S",
        "relationship_id": "Maps to",
        "relationship_name": "Maps to",
        "valid_start_date": "2023-01-01",
        "valid_end_date": "2099-12-31",
        "invalid_reason": null,
        "mapping_confidence": 1.0,
        "mapping_type": "direct"
      },
      {
        "source_concept_id": 45591524,
        "source_concept_name": "Acute myocardial infarction, unspecified",
        "source_concept_code": "I21.9",
        "source_vocabulary_id": "ICD10CM",
        "target_concept_id": 4329847,
        "target_concept_name": "Myocardial infarction",
        "target_concept_code": "22298006",
        "target_vocabulary_id": "SNOMED",
        "target_domain_id": "Condition",
        "target_standard_concept": "S",
        "relationship_id": "Maps to",
        "relationship_name": "Maps to",
        "valid_start_date": "2023-01-01",
        "valid_end_date": "2099-12-31",
        "invalid_reason": null,
        "mapping_confidence": 1.0,
        "mapping_type": "direct"
      }
    ],
    "unmapped_sources": [],
    "summary": {
      "requested_sources": 2,
      "mapped_sources": 2,
      "unmapped_sources": 0,
      "total_mappings": 2
    }
  },
  "meta": {
    "request_id": "req_abc123",
    "timestamp": "2025-01-05T12:00:00.000Z",
    "vocab_release": "2025.1"
  }
}
```

## Sources That Produce No Mappings

Every source you submit is accounted for. A source either appears as the
`source_concept_id` of at least one entry in `mappings`, or it appears in
`unmapped_sources` with a reason:

```json theme={null}
{
  "success": true,
  "data": {
    "mappings": [],
    "unmapped_sources": [
      {
        "vocabulary_id": "ICD10CM",
        "concept_code": "ZZ9.99",
        "reason": "source_not_found"
      },
      {
        "source_concept_id": 35223478,
        "vocabulary_id": "ICD10CM",
        "concept_code": "W79",
        "reason": "no_mapping_found"
      }
    ],
    "summary": {
      "requested_sources": 2,
      "mapped_sources": 0,
      "unmapped_sources": 2,
      "total_mappings": 0
    }
  }
}
```

The two reasons mean different things and should be handled differently:

* **`source_not_found`** - the code or concept ID does not exist in this
  vocabulary release. Usually a data-quality problem on your side: a typo, the
  wrong `vocabulary_id`, or a code that was retired before the release you are
  querying.
* **`no_mapping_found`** - the source exists, but OMOP has no mapping from it to
  `target_vocabulary`. Often correct and expected: mappings run from
  non-standard concepts to standard ones, so a SNOMED source frequently has no
  mapping *to* ICD-10-CM (see below).

### Duplicate inputs

Sources are accounted for per submitted entry, not per distinct concept. Sending
the same code twice gives `requested_sources: 2` and `mapped_sources: 2`, so
`mapped_sources + unmapped_sources == requested_sources` always holds and you
can line the counts up against what you sent.

`mappings` is not duplicated to match - the database is asked about each
distinct concept once - so `total_mappings` may be lower than `mapped_sources`.
`total_mappings` is always the length of the `mappings` array.

### Restricted vocabularies

Licensed vocabularies (CPT4, GPI, MedDRA) are not reported through
`unmapped_sources`, and the two input styles differ:

* **`source_codes`** naming a restricted `vocabulary_id` fails the whole request
  with **HTTP 403 `vocabulary_restricted`**, matching
  `GET /v1/search/concepts`. Because you named the vocabulary, refusing outright
  reveals nothing you did not already state.
* **`source_concepts`** carrying the ID of a restricted concept is reported as
  `source_not_found`, deliberately. An OMOP concept ID does not say which
  vocabulary it belongs to, so a 403 here would confirm that the concept exists
  and is licensed - which is exactly what the restriction is meant to withhold.

`target_vocabulary` is checked first: naming a restricted vocabulary there is
always a 403, whichever input style you use.

A request in which nothing resolved still returns HTTP 200 - the status code
does not change with the proportion of sources that resolved, so a partial
result and a total miss have the same shape and one parsing path. Check
`summary.mapped_sources` rather than inferring failure from an empty `mappings`
array.

> [!NOTE]
>
> `unmapped_sources` and `summary` were added on 2026-09-05. Before that, a code
> that did not exist was silently dropped from the request and the response was
> indistinguishable from one whose concepts genuinely had no mappings.

## Understanding OMOP Mapping Direction

> [!WARNING]
>
> In OMOP, mappings go from **non-standard** concepts TO **standard** concepts. This means:
>
> * **ICD-10-CM → SNOMED** works (ICD-10 is non-standard, SNOMED is standard)
> * **SNOMED → ICD-10-CM** often returns empty (SNOMED concepts are already standard - they are mapping *targets*, not *sources*)
>
> If you get empty results, check whether your source concept is already a standard concept. Use `GET /v1/concepts/{id}` to check the `standard_concept` field - if it's `"S"`, try mapping in the opposite direction.

## Usage Examples

### ICD-10 to SNOMED (most common use case)

Map ICD-10-CM diagnosis codes to SNOMED standard concepts:

```json theme={null}
{
  "source_codes": [
    {"vocabulary_id": "ICD10CM", "concept_code": "E11.9"},
    {"vocabulary_id": "ICD10CM", "concept_code": "I21.9"}
  ],
  "target_vocabulary": "SNOMED",
  "mapping_type": "direct"
}
```

### Cross-System Integration

Map multiple ICD-10 codes for EHR standardization:

```json theme={null}
{
  "source_codes": [
    {"vocabulary_id": "ICD10CM", "concept_code": "E11.9"},
    {"vocabulary_id": "ICD10CM", "concept_code": "I21.9"},
    {"vocabulary_id": "ICD10CM", "concept_code": "J44.1"}
  ],
  "target_vocabulary": "SNOMED",
  "mapping_type": "direct",
  "include_invalid": false
}
```

### Drug Mapping

Map drug codes from NDC to RxNorm:

```json theme={null}
{
  "source_codes": [
    {"vocabulary_id": "NDC", "concept_code": "00002-4462-30"},
    {"vocabulary_id": "NDC", "concept_code": "00093-3147-01"}
  ],
  "target_vocabulary": "RxNorm",
  "mapping_type": "equivalent"
}
```

### Using OMOP Concept IDs

If you already have OMOP concept IDs (e.g., from a search result), use `source_concepts` instead of `source_codes`:

```json theme={null}
{
  "source_concepts": [45576876, 45591524],
  "target_vocabulary": "SNOMED",
  "mapping_type": "direct"
}
```

> [!NOTE]
>
> The `source_concepts` parameter expects **OMOP concept IDs** (internal database IDs), NOT vocabulary-specific codes.
> If you have vocabulary codes (e.g., ICD-10 code "E11.9"), use the `source_codes` parameter instead,
> or first look up the OMOP concept ID using `/v1/concepts/by-code/{vocabulary}/{code}`.

## Related Endpoints

* [Batch Map Concepts](https://docs.omophub.com/api-reference/mappings/batch-map-concepts.md) - Batch mapping operations
* [Get Concept Mappings](https://docs.omophub.com/api-reference/mappings/get-concept-mappings.md) - Get mappings for a specific concept
* [Validate Mappings](https://docs.omophub.com/api-reference/mappings/validate-mappings.md) - Validate mapping accuracy


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