Lab result catalog CSV import API

lab_result_catalog_v1

lowFHIR · Observation5 fields · 2 required · 1 validatedPack · Healthcare

Import this template via API. Import a LOINC-coded lab test catalog from CSV. Format-validated, with resolver fallback from free-text test names.

30-second curl

curl -X POST https://api.adaptivmapr.com/v1/uploads \
  -H "Authorization: Bearer $ADAPTIVMAPR_API_KEY" \
  -F "template=lab_result_catalog_v1" \
  -F "file=@your_data.csv"

At a glance

Pack
Healthcare
FHIR resource
Observation
Risk level
low
Fields
5 (2 required, 1 validated)

Why this template?

The Lab result catalog template defines the master list of tests a lab performs, not the results themselves — that is the separate lab_results_v1 template. Each row carries a LOINC code (5-digit number, dash, check digit), a human-readable analyte name (Hämoglobin, Hémoglobine, Hemoglobin all map to the same canonical entry), a unit (g/dL, mmol/L), and a numeric reference range (low and high bounds for the population). The catalog is low-risk because it contains no patient information — it is a configuration object. Hospitals and reference labs import this once and refresh it quarterly as LOINC publishes new codes. AdaptivMapr also runs an ontology resolver behind the LOINC validator: if a row carries the text "Sodium serum" instead of the code, the resolver attempts to find the canonical code and substitutes it on commit when confidence ≥ 0.85.

The loinc_code validator first checks the canonical format (NNNNN-N), then — on failure — calls the resolver to map free-text to a code. The resolver only commits a substitution when its confidence clears 0.85 and the resolved code re-validates. Reference ranges are number-typed so downstream charting works; unit is a string because LOINC units do not enumerate cleanly.

Migration scenarios & common foreign headers

Migration scenarios for the Lab result catalog: standing up a brand-new LIS with a curated panel, quarterly LOINC refreshes when Regenstrief publishes a new release, harmonising two reference-lab catalogues after a network consolidation, and importing a vendor panel definition for a new analyser. Foreign headers seen in the field: "Code LOINC / LOINC-Code / Analyse / Test / Examen / Esame / Einheit / Unité / Unidad / Unità / Referenz min / Référence min / Valor mínimo / Valore minimo / Referenz max / Référence max / Valor máximo". Because lab catalogues are typically maintained by senior med-techs who write headers however feels natural to them, this template lives or dies by hint coverage — and the cascade has been tuned to absorb the variation without escalating to the paid layer.

Schema

The canonical column set, with the type each row carries, whether it is required, the field-level validators that fire on commit, and the multilingual header hints the cascade resolves against.

ColumnTypeRequiredValidatorsHints
loinc_codestringyesloinc_codeloinc · code loinc
namestringyesanalyse · test · examen
unitstringeinheit · unité · unidad
ref_lownumberreferenz min · référence min · valor min
ref_highnumberreferenz max · référence max · valor max

How AdaptivMapr maps your headers to this template

Five layers run in order, cheapest first. Layer 1 (Statistics) auto-accepts headers that have been mapped the same way across past uploads. Layer 2 (Heuristic) compares your header to the column name, the optional label, and every registered hint (DE / FR / IT / EN / ES) after a Unicode-and-punctuation-normalising pass. Layer 3 (Fuzzy) catches typos and reordered words. Layer 4 (Semantic) uses cached embeddings to catch the long tail of paraphrases. Layer 5 (LLM) only fires on genuinely ambiguous columns, constrained to the template’s allowed column set so it cannot invent a field. When a layer auto-accepts, the lower-cost layers below it never run — that is the cost lever.

REST · POST /v1/uploads

Pass the template_id; the cascade picks up the rest.

curl -X POST https://api.adaptivmapr.com/v1/uploads \
  -H "Authorization: Bearer $ADAPTIVMAPR_API_KEY" \
  -F "template=lab_result_catalog_v1" \
  -F "file=@your_data.csv"

The canonical template definition is read-only at GET /v1/templates/lab_result_catalog_v1.

MCP · Cursor / Claude Desktop

Drop AdaptivMapr into your IDE. Schema-only calls are free and unlimited.

// In Cursor or Claude Desktop with the AdaptivMapr MCP server installed:
adaptivmapr.match_headers({
  template: "lab_result_catalog_v1",
  headers: ["loinc_code", "name", "unit", "ref_low"]
})
MCP install instructions →

FAQ — Lab result catalog CSV import

What if my source uses local lab codes instead of LOINC?

Map your local code to a separate field and add LOINC as a derived column upstream, or fork the template to make loinc_code optional. The resolver can map free-text test names to LOINC codes for the rows it has high confidence on.

Does the template include reference-range stratification (by sex, age)?

Not in the canonical shape. Add `stratification` and per-subgroup ranges via a fork — the catalog template is deliberately flat so the cascade is fast.

Are LOINC codes case-sensitive in validation?

LOINC codes are numeric so the question does not apply. The resolver matches test names case-insensitively after normalisation.

How do I keep two regional catalogues in sync after import?

Tag the rows with a `region` column on a fork and run two parallel imports. The cascade is stateless per upload, so deduplication and merge logic belong downstream in your LIS or warehouse.

Keep exploring

Browse other templates in the Healthcare pack