// case study — healthcare
A lab platform that
keeps its chain of custody.
Pathoflex takes a pathology laboratory from patient registration through sample collection, analyser results and pathologist authorisation to a released report — without anybody retyping a number along the way.
// the problem
Results that were read off one screen and typed into another.
A diagnostics laboratory runs a strict sequence: a patient is registered, a sample is collected and labelled, an analyser processes it, a technician reviews the output, a pathologist authorises it, and only then does a report reach the patient. Each of those handovers is a point where a number can be transcribed wrongly, and in a clinical setting a transcription error is not a cosmetic bug.
The brief was to build a single system that holds that whole chain — with roles that reflect how a lab actually staffs itself, and with results arriving from the analyser directly rather than by hand.
// what we built
Seven roles, because a lab has seven roles.
Most lab software collapses staff into “admin” and “user”, which forces real people to share logins and destroys the audit trail. Pathoflex models the roles that actually exist: lab admin, receptionist, phlebotomist, technician, pathologist, collection centre and superadmin.
Each sees a different slice of the system, and a sample moves through an explicit status lifecycle rather than an ad-hoc flag. A pathologist is assigned to a test; authorisation is a recorded act by a named person, not a checkbox anyone can tick. When a report is questioned months later, the record shows who released it and when.
Because it is multi-tenant, isolation had to be structural rather than a filter somebody might forget. Every table is partitioned by lab_id, and the tenant identifier is carried inside the authentication token itself, so a query cannot quietly reach across a tenant boundary. Partitions are created automatically as new tenants and periods arrive.
// the interesting part
Getting results out of the analyser, and not losing them.
The component we are most pleased with is the least visible. Hematology analysers do not speak HTTP; they speak ASTM E1381/E1394 over a raw TCP socket, on the local network, to whatever is listening. In this deployment that is a Nihon Kohden MEK-6420P.
We built the Pathoflex Machine Connector: a small Windows service that runs on a PC inside the lab, speaks ASTM properly — framing, checksums, acknowledgements — parses each result, and posts it to the cloud.
The requirement that shaped its design was the one nobody puts in a brief: the internet will go down. If it does mid-run, results cannot simply be lost, and the analyser will not replay them on request. So the connector queues every result to disk before acknowledging it, and drains that queue when connectivity returns. It installs as a service and restarts itself, because a lab technician should not have to know it exists.
The practical consequence is that a number measured by the machine reaches the pathologist's screen without a human having read it off a display and typed it in again. The transcription error is not reduced, it is removed from the path entirely.
// what it took
Where the difficulty actually was.
Very little of the effort went into screens. It went into the parts that are expensive to get wrong: the partitioning strategy and the migration discipline around it, timestamp handling that stays correct across timezone and daylight boundaries, reference ranges that vary by age and sex so a flag means something clinically, and delivery semantics in the connector that are safe against duplicates when a retry overlaps a recovery.
It also went into report generation — a pathology report is a legal document with a specific layout, letterhead, signature block and versioning, and a PDF that is nearly right is not right.
The system is live at pathoflex.com and under continuing development. Operational metrics belong to the client; we are happy to arrange a reference conversation on request rather than publish numbers we would be paraphrasing.
// next step
Tell us what is actually broken.
A short message is enough to start. The first scoping call is free, and you will be talking to the person who would write the code.