Healthcare pack
Lab result catalog CSV import API
Import a LOINC-coded lab test catalog from CSV. Format-validated, with resolver fallback from free-text test names.
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"Canonical columns
The whole schema, printed as it ships.
Every canonical column, 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. This is the shipped definition, not a summary of it.
lab_result_catalog_v1FHIR · Observation- fields
- 5
- required
- 2
- validated
- 1
- hints
- 14
| Canonical column | Type | Required | Validators | Header hints the cascade matches |
|---|---|---|---|---|
loinc_code | string | yes | loinc_code | loinccode loinc |
name | string | yes | — | analysetestexamen |
unit | string | — | — | einheitunitéunidad |
ref_low | number | — | — | referenz minréférence minvalor min |
ref_high | number | — | — | referenz maxréférence maxvalor max |
Read the same definition as JSON at GET /v1/templates/lab_result_catalog_v1. A hint match resolves on layer 2 — no LLM call, no token spend, just the flat per-map fee. Hover a validator id to see what it checks.
- 5 canonical fields
- 2 required
- 1 validated
- 14 header hints, 5 languages
- FHIR Observation
Why it exists
Written for the file you actually receive.
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 & the foreign headers they ship
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.
The cascade
Five layers, and the cheapest one wins.
Layers run in order and stop the moment a column resolves. That is the single biggest cost lever in the system: a column caught on layer 2 never reaches the metered layer 5.
- L1Statisticsno LLM
Auto-accepts a header that past confirmations already resolved the same way, at {minN:100, minRatio:0.95} or {minN:20, minRatio:1.00}.
- L2Heuristicno LLM
Normalises accents, punctuation and whitespace, then compares against the column name, the label, and every registered hint (DE / FR / IT / EN / ES).
- L3Fuzzyno LLM
Token-set ratio plus Levenshtein over the normalised strings. Auto-accepts at 0.80 — it absorbs typos and reordered words.
- L4Semanticcheap, cached
Embedding cosine between the header and the field’s label + hints. Catches the long tail of paraphrases.
- L5LLMmetered
Everything still unresolved goes up in ONE batched, collision-aware call, constrained to this template’s column set so it cannot invent a field.
Try it
One template id, two ways in.
REST for your import pipeline, MCP for your editor. Both run the same cascade and both honour the same schema-only clamp.
REST · POST /v1/uploads
Name the template; the cascade picks up the rest. The canonical definition is read-only at GET /v1/templates/lab_result_catalog_v1.
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"MCP · Cursor / Claude Desktop
Drop AdaptivMapr into your editor and call the same cascade as a tool. Schema-only calls leave only column names and up to three clamped sample rows.
// In Cursor or Claude Desktop with the AdaptivMapr MCP server installed:
adaptivmapr.match_headers({
template_id: "lab_result_catalog_v1",
headers: ["loinc_code", "name", "unit", "ref_low"]
})Questions
Lab result catalog CSV import — FAQ
Ready when you are
Map lab result catalog in production — without shipping raw records.
Schema-only mode leaves only headers and a handful of clamped samples. Add full-data when you need row-level AI, routed in-region under a BAA.