Use case · Public health
Predicting which overdue patients will return to care, so health workers call them first
Machine-learning scores that rank overdue hypertension patients by their chance of returning to care, synced to the mobile devices health workers already use.
Client details are kept confidential. This use case describes the problem and what we built.
The brief
A public-health programme runs a clinical platform that helps primary-care teams manage hypertension and diabetes patients across several countries. Missed follow-ups are one of the biggest risks to blood-pressure control, and nurses have limited time for reminder calls.
We built a machine-learning scoring pipeline that predicts which overdue patients are most likely to return to care. We then extended the platform’s server so these scores sync to health workers’ devices, along with several other improvements contributed to the main codebase.
The challenge
What needed solving
Too many overdue patients, too little time
Primary-care facilities in a large hypertension-control programme have long lists of patients who missed follow-up visits. Health workers can't call everyone, so they need to know whom to call first.
Different behaviour after a call
Patients who have already been contacted behave differently from those who haven't. A single model would blur these two groups.
Scores must reach offline phones
Health workers use a mobile app that syncs with a central server. Any score has to travel through that sync reliably, without dropped or duplicated records.
The solution
What we built
Two-track model design
Separate scikit-learn pipelines for patients who were already called and those who weren't. Each pairs a random-forest classifier (will the patient visit?) with a regressor (how long until they do?).
Combined likelihood score
The two outputs are combined into one score: the chance a patient returns within 30 days. Validation scripts report AUC, precision, recall and the ranking quality of the combined score.
Reproducible training pipeline
Numbered scripts cover extraction, splitting, training, validation and evaluation, and they run in Docker. Scores are written back to a PostgreSQL table by a batch scoring job.
Sync API for patient scores
We added a read-only sync endpoint to the Ruby on Rails server with (updated_at, id) keyset pagination and UTC-safe process tokens, so devices receive every score exactly once.
Platform improvements
We also added a feature-flagged district and facility filter for patient de-duplication, country-specific reporting configuration, and a QA pipeline.
The outcome
What changed
Prioritised call lists
Health workers can sort overdue patients by their chance of returning, instead of working through lists in date order.
Reliable delivery to devices
Keyset pagination removed the skipped and duplicated records that timestamp-only sync could cause.
Technology used
- Python
- scikit-learn
- pandas
- PostgreSQL
- Ruby on Rails
- RSpec
- Docker
Related use cases
Turning open-banking transactions into credit scores, categories and affordability checks
Analytics services that categorise bank transactions and score credit risk for lenders, with country-specific logic, explainable models and queue-based delivery.
Read the use caseMapping hospital service catalogues to clinical codes, with reviewers in the loop
A mapping engine, hospital onboarding portal and LLM contract-rules extraction that turn messy hospital price lists into auditable, coded data for an insurer.
Read the use caseDeveloper onboarding where every training assignment gets an AI code review
A training and onboarding platform that links trainee pull requests to topics, sends them for AI review, scores them and keeps mentors in control.
Read the use caseHave a similar problem to solve?
Share a few lines about your project. A senior engineer — not a salesperson — replies within one business day.