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

# Medical Entity Codification

> Map free-text medical entities to standardised ontology codes — SNOMED CT, LOINC, ICD-10-CM and Eka's medication database.

## Overview

The **Medical Entity Codification API** (MedLink Named Entity Linking) takes a
free-text medical entity — a symptom, diagnosis, lab test or drug — and links it
to the matching code in a standardised clinical ontology.

It powers structured, interoperable medical data: turning `"chest pain"` into
SNOMED CT `29857009`, `"hemoglobin"` into LOINC `718-7`, or `"type 2 diabetes
mellitus"` into ICD-10-CM `E11`.

> [!NOTE]
>
> This API supersedes the legacy [`GET /eka-mcp/linking/v1/snomed`](https://developer.eka.care/api-sdk/datasets/linking/snomed)
> endpoint. See that page for a migration guide; the legacy endpoint remains
> operational for existing integrations.

## Base URL

All endpoints are served under:

```
https://api.eka.care/med-link/
```

## Authentication

Every request requires a Bearer access token:

```
Authorization: Bearer <access_token>
```

Generate the token using the Eka authorization flow — see
[Authorization](https://developer.eka.care/api-sdk/auth/getting-started.md).

## Supported ontologies

| Ontology | `ontology` | `version` | Use it for | `metadata` |
| - | - | - | - | - |
| SNOMED CT | `snomed` | `20250401_extended` | Symptoms, findings, disorders, procedures | Not used |
| LOINC | `loinc` | `v1.0` | Lab tests and observations | **Recommended** |
| Medication | `medication` | `v5.0` | Branded and generic drugs | Optional |
| ICD-10-CM (Comprehend) | `icd-10-cm` | `comprehend` | Diagnoses from natural-language clinical text | Not used |

> [!NOTE]
>
> Always call [List Registry](https://developer.eka.care/api-sdk/models/medical-entity-codification/registry.md)
> to confirm the live `ontology` and `version` values before linking.

## Endpoints

> **[List Registry](https://developer.eka.care/api-sdk/models/medical-entity-codification/registry.md)**
>
> Discover available ontologies, versions and indexes.

> **[Link Entity](https://developer.eka.care/api-sdk/models/medical-entity-codification/link-entity.md)**
>
> Link a single medical entity to ontology codes.

> **[Link Entities (Batch)](https://developer.eka.care/api-sdk/models/medical-entity-codification/link-entity-batch.md)**
>
> Link up to 5 entities in a single call.

## The `metadata` field

`metadata` carries ontology-specific hints that improve linking accuracy:

* **LOINC** — strongly recommended. A `unit` or `specimen` can change which code
  is linked (e.g. blood vs. urine hemoglobin).
* **Medication** — optional. `form`, `generic_name` and `dose_unit` help resolve
  ambiguous brand names.
* **SNOMED CT** and **ICD-10-CM Comprehend** — `metadata` is ignored.

See each endpoint page and the ontology guides in
**Spotlight → Technologies → [Medical Entity Codification](https://developer.eka.care/docs/models/technologies/codification/overview)** for details.

## Reading a result

Each candidate in `results` carries:

* `term_id` — the ontology code
* `term_name` — the human-readable term
* `score` — relevance/confidence (`null` for medication)
* `is_linked` — `true` when the pipeline is confident this is the single correct match
* `metadata` — ontology-specific detail about the candidate


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