AI & Intelligent Automation · 6 min read · 3 December 2026

From AI to reliable data: designing a pipeline for healthcare documents

How an AI pipeline turns heterogeneous healthcare documents into structured data, while leaving the final word to the person.

The demo that always works

There is a shortcut everyone knows when working with language models: take a document, write a single instruction along the lines of “read this text and tell me everything in it”, and wait for the result. In demos, it almost always works.

The problem comes later, when something goes wrong. If an allergy is not recognised or a therapy ends up in the wrong place, a single instruction offers no specific point to look at. The result is the only clue, and it is precisely the wrong one.

This is where we started when designing a pipeline: a sequence of automated steps, built for the cloud, that processes heterogeneous healthcare documents. I will describe how we built it, what surprised us and why, in a setting where errors carry real consequences, we chose not to give AI the final word.

Documents that look nothing alike

The project comprises two complementary healthcare applications. One is aimed at A&E staff, the other at users, who can digitise their own medical records from reports in PDF or on paper. The pipeline I am describing belongs to this second context.

We needed to allow people to upload medical reports and healthcare documents, photographed or in PDF, and turn them into organised information that an application can use: allergies, therapies, surgical procedures, medical conditions.

The difficulty is that healthcare documents look nothing alike. A discharge letter, a lab report and a prescription differ in format and language. And very different kinds of information often sit side by side on the same page.

Five steps, each with a precise task

We organised the work as a small, modular assembly line, in which each step does one thing only.

  1. Read. The document is converted into text while preserving its structure: lists and tables stay as they are.
  2. Sort. The AI works out which types of information the document contains, for example allergies, therapies or past procedures.
  3. Extract. Each type of information goes to a dedicated “specialist”, which knows exactly what data to look for and in what form to return it.
  4. Check. An automated check verifies that the output is complete and consistent with what the application expects.
  5. Confirm. The user reviews the proposed information and decides whether to keep it.

In practice, the AI reads and proposes. The rules and the final decision remain with us and with the person.

Who does what: models, data contracts, checks

But dividing the process into stages is not enough. It is also necessary to establish precisely which responsibilities to entrust to AI models and which to keep under the control of explicit rules. AI models work in the steps that require understanding a text: reading a document, recognising what information it contains. Data contracts define in advance the form in which each specialist must return what it finds. Deterministic checks verify, for example, that the expected fields are present and that each piece of data has the form the application requires, using rules that do not depend on a model and always behave in the same way.

It is this separation that makes the system governable: each component has defined responsibilities, and results can be verified at the different steps of the process.

The surprise: not “what kind of document is it?”

The step that taught us the most was sorting. We had not expected how often a single document contains information of different kinds. A discharge letter may record an allergy, an operation from a few years earlier and two ongoing therapies, all on the same page.

Our first instinct was to classify the document (“this is an allergy report”) and process it accordingly. We realised that this way half of the content was lost.

So we changed approach.

The system no longer asks “what kind of document is it?”, but “what information does it contain?”

and sends each piece to the right specialist. It seems a minor difference, but it shifts the centre of gravity of the entire pipeline: from the document to the information.

Tidy does not mean true

An AI response can look perfect and still be wrong. The system can return an impeccable record, with every field in the right place, and still have misread a piece of data: for example, a discontinued therapy read as ongoing.

I have learnt to keep two questions separate: “is the answer in order?” and “is the answer true?”. Automated checks answer the first: they verify that the data follows the expected structure and is complete, but they cannot certify its clinical accuracy. They cannot answer the second question definitively: that is why the result is submitted to the user for review before it is used, and the person retains control over the information that goes into their own record.

That is why the user’s confirmation is not a bureaucratic step. It is part of the design.

The first results of an architectural choice

The system has been running since October 2026, for now on test data. We do not yet have production figures to share, and we prefer to say so clearly. Some benefits, however, are already visible:

  • We know where to look. Each stage has a precise task, so an error can be traced instead of remaining a mystery.
  • Growing is simpler. To handle a new type of information, we add a “specialist” without rewriting everything.
  • Nothing goes in without consent. In this first phase, the system reads and proposes, but writes nothing automatically to the user’s record: only what the person confirms ends up there.

A more powerful model is not enough

It is often assumed that, to do more with AI, all you need is a more powerful model or a longer, more detailed instruction. In our experience, this is only partly true.

The model matters, but the process it sits within matters more: who does what, who checks, who decides in the end. A well-organised system with an “ordinary” model is, from what we have seen, more reliable than an extremely powerful model left to its own devices.

Who decides in the end

When an organisation evaluates AI for a process involving sensitive data, the usual question is which model to choose. There is another, more fundamental question that is asked far less often: at which points in the process does AI propose, and at which does someone decide?

In our case, the answer is written into the architecture, step by step. Designing reliable AI systems also means deciding precisely where the model’s contribution ends and where checks, responsibilities and human decisions begin. In healthcare, this distinction is not an implementation detail. It is an architectural choice that determines how usable a system can truly be.

Let's talk about your project

Do you have documents to turn into data, but need to be able to trust the result?

Tell us about your technical challenge. A senior engineer will analyze it and respond within 24 business hours.

Let's talk about your project →

Or call us at 0461 1975740 · Response guaranteed within 24 business hours