> ## Documentation Index
> Fetch the complete documentation index at: https://ekacare-mintlify-dfb0ffc0.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# LOINC

## Overview

**LOINC** (Logical Observation Identifiers Names and Codes) is the global
standard for identifying lab tests and clinical observations. Eka Care's
codification pipeline links free-text lab test names to LOINC codes.

| Property   | Value                    |
| ---------- | ------------------------ |
| `ontology` | `loinc`                  |
| `version`  | `v1.0`                   |
| `metadata` | **Strongly recommended** |

## Why context matters

A lab test name on its own is often ambiguous. `Hemoglobin` measured in blood is
a different LOINC code from hemoglobin measured in urine; the same test reported
as a mass concentration differs from one reported as a molar concentration.

LOINC codification therefore relies on the `metadata` field to disambiguate.
Supplying the unit and specimen is the difference between a confident, correct
link and an uncertain one.

## The `metadata` field

| Key                  | Description                                                           |
| -------------------- | --------------------------------------------------------------------- |
| `unit`               | Test unit, e.g. `g/dl`, `mg/dl`, `%`. The single most important hint. |
| `value`              | Numeric result value — improves value-type matching.                  |
| `range`              | Reference range for the result.                                       |
| `specimen`           | Specimen type, e.g. `blood`, `urine`.                                 |
| `specimen_text`      | Free-text specimen description (auto-detected if omitted).            |
| `panel_name`         | Panel name for multi-test panels.                                     |
| `extended_test_name` | Extended or alternate test name.                                      |

## Context changes the result

Consider the query `hemoglobin`:

* **Without `metadata`** — the top candidate is `haemoglobin_urine` and
  `is_linked` is `false`. The pipeline cannot tell which hemoglobin you mean.
* **With** `metadata: { "unit": "g/dl", "value": "14.5", "specimen": "blood" }`
  — the pipeline links to LOINC `718-7` ("HEMOGLOBIN (HB) \[Mass/Vol]") with
  `is_linked: true`.

## Reading the results

* `term_id` — the LOINC code (e.g. `718-7`)
* `is_linked` — `true` only when test name, unit and specimen all match
* `metadata.matching_breakdown` — which dimensions matched (`component_match`,
  `unit_match`, `specimen_match`, …)
* `metadata.eka_id` — Eka's internal lab identifier for the test

The response also includes a `query_breakdown` showing how the test name, unit
and specimen were parsed from your request.

## Supported lab tests

Eka Care maintains a curated list of lab tests that link to LOINC. Browse the
full catalogue here:

<Card title="Eka's LOINC-linkable lab tests" icon="flask" href="https://ekacare.notion.site/726b13df13ea4409b0cd30c6f3a80315?v=dcd10c722d3149d880ae889b06f4820a">
  Public list of every lab test Eka can link to a LOINC code, with their
  expected names, units and specimens.
</Card>

If the test you need isn't in the list, [get in touch](mailto:ekaconnect@eka.care)
— the catalogue is expanded continuously.

## Try it out

See the [Link Entity API](/api-reference/health-ai/medical-entity-codification/link-entity)
and select the **LOINC** example to try it.
