Healthcare pack
Diagnoses CSV import API
Map diagnosis lists to FHIR R4 Condition: format-checked ICD-10 codes, clinical status, onset and recorded dates. Multilingual headers handled.
curl -X POST https://api.adaptivmapr.com/v1/uploads \
-H "Authorization: Bearer $ADAPTIVMAPR_API_KEY" \
-F "template=conditions_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.
conditions_v1FHIR · Condition- fields
- 7
- required
- 2
- validated
- 1
- hints
- 44
| Canonical column | Type | Required | Validators | Header hints the cascade matches |
|---|---|---|---|---|
condition_id | string | — | — | diagnose-iddiagnosis idid diagnosticid diagnosiid diagnóstico |
patient_id | string | yes | — | patientpatient_idpidpatienten-idid patient |
icd10_code | string | yes | icd10_code | icdicd-10icd10icd codediagnosecodecode diagnosticcodice diagnosidiagnosis codecódigo ciecie-10 |
diagnosis | string | — | — | diagnosediagnosticdiagnosidiagnosisdiagnósticobezeichnung |
clinical_status | enumactiverecurrencerelapseinactiveremissionresolved | — | — | statusstatutstatoestadoklinischer statusclinical status |
onset_date | date | — | — | beginnerstdiagnosedate de débutdata di insorgenzaonsetfecha de inicio |
recorded_date | date | — | — | erfasst amdokumentiert amdate de saisiedata di registrazionerecordedfecha de registro |
Read the same definition as JSON at GET /v1/templates/conditions_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.
- 7 canonical fields
- 2 required
- 1 validated
- 44 header hints, 5 languages
- FHIR Condition
Why it exists
Written for the file you actually receive.
The Diagnoses template carries a problem list or a discharge-diagnosis extract — one coded condition per row. Only two columns are required: patient_id and an ICD-10 code. Around them sit an optional row identifier, the human-readable diagnosis label, a clinical status, the onset date and the date the diagnosis was recorded. On FHIR output each row becomes an R4 Condition: code and label form a single coding in Condition.code under the WHO ICD-10 system URI, the status becomes a condition-clinical coding in clinicalStatus, onset fills onsetDateTime, the recording date fills recordedDate, and the patient becomes a Patient/ reference. Diagnoses are about as sensitive as clinical data gets, so the template is `medium` risk and production refuses the commit until someone in the workspace has approved that precise mapping in the dashboard. It is a data-mapping schema: it moves codes between systems and never interprets them.
The ICD-10 validator checks shape — a letter, two digits, an optional dot and up to three more digits — not membership in one edition, so ICD-10-GM, ICD-10-CM and WHO codes all pass, and so does an invented code of the right shape. When a cell holds words instead of a code ("type 2 diabetes"), a small built-in lookup of common diagnoses substitutes the code if it is confident, and leaves the row invalid if it is not. clinical_status takes the six condition-clinical values; verificationStatus is not emitted.
Migration scenarios & the foreign headers they ship
Diagnosis files move whenever a record changes hands: a hospital exporting coded discharge diagnoses for case-mix grouping, a GP practice handing its problem lists to a new EMR, a registry or research cohort receiving coded conditions from several contributing sites, and a payer matching claimed diagnoses to the provider's own list. The headers vary more than the codes do: "ICD / ICD-10 / ICD10 / ICD code / Diagnosecode / Code diagnostic / Codice diagnosi / Código CIE / CIE-10 / Diagnose / Diagnostic / Diagnosi / Diagnóstico / Bezeichnung / Klinischer Status / Statut / Beginn / Erstdiagnose / Date de début / Data di insorgenza / Erfasst am / Date de saisie". The Spanish "CIE-10" is the one a dictionary built on English abbreviations misses; it is a registered hint on icd10_code here.
The cascade
Six 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/conditions_v1.
curl -X POST https://api.adaptivmapr.com/v1/uploads \
-H "Authorization: Bearer $ADAPTIVMAPR_API_KEY" \
-F "template=conditions_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 a few example values.
// In Cursor or Claude Desktop with the AdaptivMapr MCP server installed:
adaptivmapr.match_headers({
template_id: "conditions_v1",
headers: ["condition_id", "patient_id", "icd10_code", "diagnosis"]
})The mappings response comes back flagged. PATCH /uploads/:id/mappings returns requires_hitl: true and hitl_status: "pending_review" and on the hosted API a commit waits until a workspace member records an approval. Schema-only mode (column names and a few example values, never the full file) is a data-minimization mode enforced at the HTTP edge. Full-data mode routes the metered layer-5 call to phi-cloud in-region under a BAA, costs 20% more on the whole map charge, and stays locked until the workspace accepts the BAA/NDA in Settings → Security & Data.
Questions








