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.

30-second curl
curl -X POST https://api.adaptivmapr.com/v1/uploads \
  -H "Authorization: Bearer $ADAPTIVMAPR_API_KEY" \
  -F "template=conditions_v1" \
  -F "file=@your_data.csv"
→ 7 canonical fields · 1 validated · medium risk

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 columnTypeRequiredValidatorsHeader hints the cascade matches
condition_idstring——diagnose-iddiagnosis idid diagnosticid diagnosiid diagnóstico
patient_idstringyes—patientpatient_idpidpatienten-idid patient
icd10_codestringyesicd10_codeicdicd-10icd10icd codediagnosecodecode diagnosticcodice diagnosidiagnosis codecódigo ciecie-10
diagnosisstring——diagnosediagnosticdiagnosidiagnosisdiagnósticobezeichnung
clinical_statusenumactiverecurrencerelapseinactiveremissionresolved——statusstatutstatoestadoklinischer statusclinical status
onset_datedate——beginnerstdiagnosedate de débutdata di insorgenzaonsetfecha de inicio
recorded_datedate——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.

  1. 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}.

  2. L2Heuristicno LLM

    Normalises accents, punctuation and whitespace, then compares against the column name, the label, and every registered hint (DE / FR / IT / EN / ES).

  3. L3Fuzzyno LLM

    Token-set ratio plus Levenshtein over the normalised strings. Auto-accepts at 0.80 — it absorbs typos and reordered words.

  4. L4Semanticcheap, cached

    Embedding cosine between the header and the field’s label + hints. Catches the long tail of paraphrases.

  5. 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.

bash
curl -X POST https://api.adaptivmapr.com/v1/uploads \
  -H "Authorization: Bearer $ADAPTIVMAPR_API_KEY" \
  -F "template=conditions_v1" \
  -F "file=@your_data.csv"
→ upload created · mappings ready · confirm before commit

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.

mcp
// 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"]
})
schema-only · column names and a few examples only
MCP install instructions
medium-risk template

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.

How the wallet is charged

Questions

Diagnoses CSV import — FAQ

Which ICD-10 edition does the FHIR output declare?
The coding carries the WHO ICD-10 system URI (http://hl7.org/fhir/sid/icd-10). The code itself is passed through unchanged, so if your file holds ICD-10-CM or ICD-10-GM codes, tell your destination which edition it is receiving.
Can one row carry several diagnoses?
No — one row, one Condition, one code. A cell like "E11.9; I10" fails the format check. Split multi-code cells into separate rows before import, repeating the patient_id.
Does the template decide whether a diagnosis is still active?
No. clinical_status is copied from your file and validated against the allowed values; nothing is inferred from dates or codes. A blank status stays blank in the FHIR output.
Is the commit blocked until someone approves?
In production, yes. Diagnoses is a medium-risk template: POST /v1/uploads/:id/commit returns 428 hitl_approval_required until a workspace member approves the exact mapping in the dashboard, and a mapping changed after approval needs approving again.

Map diagnoses in production — without shipping raw records.

Minimal data mode sends only column names and a few example values — never the full file. Add full-data when you need row-level AI, routed in-region under a BAA.