Just a moment.

Clinical triage that doesn't overlook the silent emergencies

Turns what a patient describes into a Manchester urgency level, and audits every prediction so emotional weight doesn't hide a serious case.

ProjectMedFlowYear2026RepositoryGitHub
HEALTHTECHAI/MLNLP
OVERVIEW
Type
Clinical triage platform
Data
272 real interviews · Fareez et al. (Nature)
Year
2026

What it is

MedFlow assigns each patient a Manchester urgency level, from C1 to C5, based on what they describe by text or voice.

The goal was to make that triage consistent and deployable in any environment. An LLM extracts and labels the symptoms, an ML model predicts the level and an ethics audit reviews every prediction; on top of that, each AI step is swappable between a free local backend and Azure, without touching code.

MedFlow
THE PROBLEM

Classifying urgency depends on human judgement under pressure

And the most serious cases aren't always the loudest: the way the patient communicates can hide an emergency.

triage_gaps.log - 4 issues detected
WARN_01
Variable judgement
The same description can get different levels depending on who assesses it and under how much pressure.
CONSISTENCY
CRIT_02
Masked severity
A patient carrying a lot of emotional weight can convey a serious case as if it were mild.
CRITICAL
ERR_03
Unstructured input
The patient expresses themselves freely by text or voice; nothing guarantees normalised, comparable symptoms.
INPUT
ERR_04
Unaudited decisions
Without a record reviewing every classification, under-estimates go unnoticed.
AUDIT

The pipeline

A FastAPI gateway receives the case and Airflow orchestrates the pipeline end to end.

  • Transcription: the patient's audio is turned into text with whisperx.

  • Translation and summary: the clinical corpus is English and the patient speaks Spanish.

  • LLM enrichment: symptom extraction, normalisation against a closed dictionary, labelling and an anxiety score.

  • Training and prediction: the ML model assigns the Manchester level.

n8n fires the clinical and technical alerts. Everything runs on Postgres and minIO in Docker.

Product

Three screens cover the full flow: create a case from text or voice, review the history of processed interviews and audit a specific case's prediction against the real medical judgement.

Alert system

When the pipeline finishes, n8n fires real-time notifications: an urgent C1/C2 case to the clinical team and a processing failure to the technician, each with the context needed to act.

Deployment

Each AI step is swappable between a local backend (free) and Azure, switchable via an environment variable with keyless authentication.

  • LLM: OpenRouter locally, Azure OpenAI in the cloud.

  • Transcription: whisperx locally, Azure AI Speech in the cloud.

  • Normalisation: CSV dictionary locally, Azure AI Search in the cloud.

  • PII redaction: regex locally, Azure AI Language in the cloud.

The rest of the system (ML, infrastructure and business logic) is independent of the cloud provider. A regression gate in CI (GitHub Actions) blocks, on every PR, prompt changes that degrade triage quality.

Moving normalisation to semantic search wasn't free: with no threshold it over-matches and sinks precision. With a score threshold it matches the literal dictionary and additionally catches linguistic variants that exact matching misses ("I can't get air" ↔ "I'm suffocating").

Ethics audit

The pipeline's last stage compares the model's prediction with the emotional weight detected by the LLM. When a high-anxiety case gets a low urgency level, the alert fires: it's the under-triage pattern the system is designed not to let through.

The alert doesn't just warn. It records the real category against the predicted one, a hypothesis for why the bias happened and a concrete corrective action (retrain with reinforced class_weight, review the scoring prompts). The case is routed to human review before any communication with the patient.

RESULTS

A real system, from ingestion to audit

MedFlow is an orchestrated microservice architecture, with quality verified in CI and deployable locally or on Azure.

13
MICROSERVICES

Independent FastAPI services (gateways, AI, ML and audit) orchestrated in Docker.

7
AIRFLOW DAGS

They cover ingestion, enrichment, training, prediction, evaluation and audit.

112
CLINICAL TERMS

Closed dictionary that normalises symptoms to a comparable Manchester vocabulary.

272
REAL CLINICAL INTERVIEWS

Fareez et al. corpus (Nature): real medical interviews, with the imprecise language people use to describe their symptoms.

NEXT PROJECT
Scholarium