Medical lab report extraction and standardisation
A multi-service platform that ingests lab report PDFs and images, redacts identifiers, extracts results with a generative model, standardises names and units, and routes low-confidence items to human review.
The challenge
Laboratories and health platforms receive reports in many layouts, languages and units, so results must be re-keyed or reconciled by hand before they can be used. Patient identifiers must be removed before data is processed, and automated extraction needs a controlled path to human review when confidence is low.
What we built
A background worker polls a shared database for newly received reports, downloads each file from cloud storage, redacts personal identifiers with OCR plus pattern and model-assisted detection, then extracts biomarker rows with a Gemini model. Test names are mapped to a standard catalogue using vector similarity search with an LLM assist and aligned to each client template, and units are converted using factor tables and special-case formulas. Each record gets an error-based quality score; records at or above a configurable threshold bypass review and are transformed to JSON, HL7 or FHIR, while the rest enter a reviewer workflow in a NestJS API and Next.js portal. Client webhooks with retry, status polling and subscription billing sit around the pipeline.
Key capabilities
- PII redaction of PDFs and images using OCR, regex patterns and an LLM pass
- Generative-AI extraction of biomarker names, values, units and reference ranges
- Vector-similarity mapping of test names to a standard catalogue with client-template alignment
- Unit conversion with non-linear special cases and OCR-error cleanup
- Quality scoring with configurable auto-bypass versus human review queue
- JSON, HL7 and FHIR output plus outbound webhooks with retry
What it delivers
- Replaces manual re-keying of lab results with an automated extract, map and convert flow
- Keeps a human in the loop for low-confidence records through a score threshold rather than all-or-nothing automation
- Produces standards-based outputs (HL7, FHIR, JSON) that downstream systems can consume
- Records per-record score breakdowns and error codes so processing failures and stale jobs can be recovered and audited
Have a similar backlog?
Most of our work started as a single painful workflow. Tell us yours.


