Policlinico San Donato AritmoLab · Policlinico San Donato

Role of AI in the Analysis of Unstructured Clinical Databases

How we turned a mix of structured and free-text clinical records into a research data platform — the AritmoLab platform experience.

AritmoLab A clinical data platform hosting cardiology data and analysis tools
Dr. Marco Pancotti - MultiPhysixLab Dr. Sara Paratico - I.R.C.C.S. Policlinico San Donato

“Multidimensional Characterization of Cardiac Arrhythmias: Role of Electrocardiology in the Artificial Intelligence Era”

San Donato Milanese, Milan, Italy · 2–3 October 2026

Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202601 / 15
AritmoLab · Policlinico San Donato
Twenty years ago

Four islands and two missing pieces

MISSINGNo Health Intelligencenothing usable to analyse historical data
MISSINGNo ML-ready datamartsnothing ready for predictive statistics or machine learning

▸ click a system: how it was used — and what held it back

Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202602 / 15
AritmoLab · Policlinico San Donato
The plan

What we wanted to build

One platform, two destinations: the 360° patient portal and a research-ready warehouse. Built on open-source pillars, with AI coding agents wherever they helped. This talk follows the hardest piece — the unstructured data.

What existed
Cardiorefcardiology records · procedures · letters
Genetic datalabs · variants · nomenclature
ECGsignals · device follow-up
+Future sourcesnew subsystems can be connected as sources
→
What we built
Stagingraw replica of the sources
→
Integrationcleaned, normalized, deduplicated
AI reads the clinical text: pathologies, procedures, drug-challenge outcomes
→
Star schemadimensional transformation
→
Datamartsresearch-ready marts
AI builds them on demand from plain-English questions (ThothII)
→
AritmoLab Data Warehousequeried for research
AritmoLab Portalmanagement & exploration
AI coding agents — Anthropic · OpenAI — used wherever they helped, 360° in the code Airflow · orchestration Superset · dashboards Django · portal scaffolding Authentik · auth — GSD LDAP
Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202603 / 15
AritmoLab · Policlinico San Donato
Mappings as code

LLM agents draft it. Humans review it. Git versions it.

  • Staging → integration mappings are declarative YAML: schema-validated, reviewed, versioned
  • LLM agents authored them from prompts (etl/prompts/fill_integration_yaml.md)
  • The same file wires the runtime text mining: analysis_function + version_function per enrichment
  • Every extracted row records its pattern-library version — reproducible by design
etl/config/integration-map.yaml19,764 lines · 42 mappings
text_cascade_enrichments:
- source_columns:
  - cr_diagnosi
  - cr_anamnesi_cardio
  - cr_anamnesi_extra_cardio
  analysis_function: get_letter_pathologies_cascade
  version_function: get_letter_pathology_version
  integration_table: cr_lettera_dimissione_diagnosi
  output_columns:
  - column: patologia
    postgres_type: TEXT NOT NULL
Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202604 / 15
AritmoLab · Policlinico San Donato
From free text to a research platform

The clinical truth lives in unstructured columns

“Il paziente riferisce sincope ricorrente; ECG basale con sopraslivellamento ST in V1–V3; test provocativo con flecainide positivo per pattern Brugada.” One sentence from a discharge letter (example) — diagnosis, history and test outcome, all in free text
SourcesCardioref · SQL Server
Kokoro · PostgreSQL
→
Stagingraw replica
→
Integration3NF · text miningAI
→
Data Warehousestar schema
→
Martsdbt · Superset
↑
AIThothII — natural-language → SQL over the DWH, builds the final datamarts
Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202605 / 15
AritmoLab · Policlinico San Donato
What the text mining produced

Deterministic AI, audited numbers

58,438discharge letters readfree-text fields, bilingual IT/EN patterns
73,389pathologies extractedtwo-tier clinical ontology
10,908drug-challenge tests parsedflecainide · ajmaline · adrenaline · isoprenaline
2,307Brugada patients identifiedconfirmed by clinical review on dashboards

Every row carries its pattern-library semver (pattern_version) · quality gate: ≥95% accuracy on 100 manual reviews.

Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202606 / 15
AritmoLab · Policlinico San Donato
Clinical NLP

Reading clinical text is not keyword matching

  • Negation — “fibrillazione atriale esclusa”, “non FA”: the rule scans a window around every match before deciding
  • Family ≠ patient — “padre con FA” is attributed to the family member, not to the patient
  • Two languages — every pattern matches IT and EN forms: fibrillazione atriale / atrial fibrillation
  • Abbreviations & noise — FA, f.a., “TA 140/90” (blood pressure, not a diagnosis)
  • One field, many statements — the text is split into clauses before matching
what the rules seeexamples from the corpus
“padre con fibrillazione atriale”
  → patologia: FA · attribuzione: familiare

“fibrillazione atriale esclusa”
  → patologia: FA · negato

“test provocativo con flecainide
  positivo per pattern Brugada”
  → test: flecainide · esito: POSITIVO
Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202607 / 15
AritmoLab · Policlinico San Donato
The clinical ontology

Two tiers, one clinical order

TIER 1 · arrhythmic
FABrugadaFlutterTATRNWPW / TPSVTVFVExtrasistolia V.SincopeQT lungo
TIER 2 · structural
Blocco AVBlocco di brancaCardiomiopatiaScompensoValvulopatia
  • Order encodes clinical precedence — “Brugada” is matched before “TV”, so “substrato per TV” can't mask a Brugada pattern
  • Synonyms live inline — FA / f.a. / fib. atriale / atrial fibrillation → one canonical label
  • Versioned like software — semver per pattern library, pattern_version on every extracted row
Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202608 / 15
AritmoLab · Policlinico San Donato
Validation

Trusting the text is a process, not a promise

  • Quality gates — ≥95% procedure classification, ≥85% pathology detection, validated on 100 manually reviewed records
  • Clinical review — the extracted Brugada cohort was validated by clinicians on Superset dashboards
  • Feedback loop — ~893 Brugada false positives found and removed in pattern-library v1.3.1
  • Nothing is silently dropped — negated and family-attributed findings are stored too, filtered only at the mart layer
Quality gateAn extraction is accepted only after 100 manual reviews confirm the agreed accuracy — the same standard for every new pattern release.
Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202609 / 15
AritmoLab · Policlinico San Donato
The portal, today

AritmoLab — a quick tour

screenshot
screenshot
screenshot
screenshot
screenshot
screenshot

[MP: 6-7 real screenshots of the portal, anonymized or demo data]

Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202610 / 15
AritmoLab · Policlinico San Donato
All good? Not yet.

The warehouse speaks SQL. Research needs more.

  • Clinicians and researchers don't write SQL — a star schema is built for analysts, not for the ward
  • Health Intelligence — to present the past, the Unit needs ready-made aggregates: volumes, incidence, outcomes
  • Predictive research — multivariate analysis and ML models need clean, wide, cohort-shaped tables
  • Hand-made datamarts are the bottleneck — even with coding agents, each one takes hours of careful work
The gapTwenty years of data, one warehouse — and no fast road from a research question to an answer.
Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202611 / 15
AritmoLab · Policlinico San Donato
Role 3 — AI for analysis

Ask the warehouse in plain English

“How many Brugada patients had an effective ablation?” a researcher, in natural language
NL → SQLAI writes the query over the star schemaAI
→
Human reviewthe researcher checks every proposed query
→
Datamartcurated, research-ready martsAI
→
Supersetstatistics & dashboards

The session is a conversation: refine the question, iterate on the datamart — every step reviewable.

Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202612 / 15
AritmoLab · Policlinico San Donato
ThothII, step by step

From question to datamart — the app

screenshot
screenshot
screenshot
screenshot
screenshot
screenshot

[MP: 6-7 real screenshots of ThothII — ask, review SQL, datamart, dashboard]

Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202613 / 15
AritmoLab · Policlinico San Donato
From datamart to discovery

One datamart — many questions answered

Multivariate analysis[SVG chart — next step]
Machine learning[SVG chart — next step]

[Illustrative data, modeled on published arrhythmology predictors — Brugada focus]

Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202614 / 15
AritmoLab · Policlinico San Donato
Questions?

Thank you

Want the deep dives? The technical walkthroughs of the text miner, the mapping agents and ThothII are coming as videos on our Substack.

Dr. Marco Pancotti - MultiPhysixLab Dr. Sara Paratico - I.R.C.C.S. Policlinico San Donato
Role of AI in the Analysis of Unstructured Clinical DatabasesDr. Marco Pancotti - MultiPhysixLabDr. Sara Paratico - Gruppo San DonatoSan Donato Milanese, Milan, Italy · 2–3 October 202615 / 15