Skip to content

MRM-MB/MEDFLOW

Repository files navigation

🩺 MedFlow: A Privacy-Preserving AI Clinical Assistant

MedFlow

MedFlow is a local-first consultation support system created by a six-student Software Engineering team at the University of Southern Denmark. It was designed for a potential local hospital or outpatient clinic in Sønderborg. The system records outpatient consultations, transcribes them locally, produces structured clinical draft material, and keeps the doctor in control of every approval.

Sensitive consultation data stays within the local deployment. AI output is advisory and editable; nothing is accepted as clinical content without explicit doctor approval.

What It Does

  • Records consultation audio and transcribes it with Faster-Whisper.
  • Generates structured draft reports through Ollama and Qwen3:8b.
  • Supports review, editing, approval, PDF export, email follow-up, and auditability.
  • Uses MySQL for relational records and MongoDB for flexible AI artifacts.

Run Locally

Requirements: Docker Desktop. An NVIDIA GPU is optional; the transcription service falls back to CPU.

Windows users should ensure Docker Desktop is running. GPU acceleration also requires the NVIDIA Container Toolkit.

git clone https://github.com/MRM-MB/MEDFLOW.git
cd MEDFLOW
cp .env.example .env
docker compose up -d --build
docker compose exec ollama ollama pull qwen3:8b

Open the application at http://localhost:8000 and the local MailHog inbox at http://localhost:8025.

The first build downloads the Faster-Whisper large-v3 model. The Ollama command downloads Qwen3:8b once and stores it in the Docker volume.

The Docker stack starts six services: app, whisper, mysql, mongodb, ollama, and mailhog.

🔑 Demo Access

All demo accounts use the password password.

Role Email
Doctor doctor@example.local
Admin admin@example.local
Patient giulia@example.local

The project ships with pre-seeded users, appointments, and consultations. Additional demo patients are available after sign-in.

Explore the Workflow

  • Doctor: start a consultation, record audio, generate a report, review or edit the draft, approve it, and issue a PDF prescription.
  • Admin: manage staff, patients, appointments, configuration, and audit records.
  • Patient: view consultation history and prescriptions, and book appointments.

MailHog captures outgoing prescription and notification email locally, so no external SMTP service is required for the demo.

Architecture

MedFlow local runtime architecture

The FastAPI application coordinates MySQL, MongoDB, an Ollama local LLM, and a Faster-Whisper sidecar. The code follows Clean Architecture boundaries, allowing the infrastructure integrations to evolve independently.

Local AI and Validation

Ollama model comparison

Qwen3:8b was selected for reliable structured output within the available local hardware budget. The project includes unit, integration, smoke, stress, benchmark, and UI validation.

Automated test distribution

Run the automated suite inside the application container:

docker compose exec app pytest

Configuration and Operations

.env.example provides working defaults. USE_MOCK_ADAPTERS=true uses the supplied in-memory demo data; set it to false only when configuring persistent MySQL and MongoDB writes. WHISPER_MODEL_NAME, LLM_MODEL_NAME, SMTP_HOST, SMTP_PORT, and SECRET_KEY are also configured there.

# Stop services while preserving Docker volumes
docker compose down

# Restart without rebuilding
docker compose up -d

# Reset all local data and volumes
docker compose down -v

If a service fails to start, first confirm that Docker Desktop is running. Use docker compose logs app for application errors and docker compose logs whisper to confirm that the transcription model initialized. If ports are busy, stop local MySQL or MongoDB instances using ports 3306 or 27017.

Project Material

  • docs/ contains the diagrams and supporting documentation.
  • Validation_Reports/ contains the validation evidence and charts.
  • overleaf-report/ contains the source for the project report.

👥 Contributors

Name GitHub Profile
Luigi Lucol24
Aleksandra Kwiatek05
Gabriele Gabbo693
Gabija GabijaSt
Mats mqts241
Manish -

About

No description, website, or topics provided.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors