Before a clinic AI agent files lab results: 12 checks

11 min readSimon BudziakBy Simon Budziak

On this page8 sections
Title card reading A clinician signs every result, with signs in gold and 12 checks before an AI agent files lab results beneath, beside a printed lab results sheet with two highlighted rows where a hand with a gold pen reaches the clinician signature line, and a monitor behind showing the same results stamped DRAFT.

A private clinic that wants an AI agent to read incoming referral letters and lab result PDFs into the patient record has to settle a short list of things before the first document goes through. In a 2026 study, test results were the category GPT-4o missed most, with recall of 70.4% against clinicians, so the agent writes a draft and a clinician confirms every field. The twelve checks below cover what the agent is in law, how you test it on your own documents, how the record shows who confirmed what, and how you run it once it is live.

Why one missed lab value decides the whole design

A missed lab value is invisible, so the design starts from the field the model is worst at. The numbers come from a medRxiv preprint posted on August 24, 2026, where seven models extracted seven categories of information from 98 public ear, nose and throat notes and fourteen medical professionals did the same work by hand. It covers one specialty, models already a generation old and narrative notes rather than referral letters. Read it as a map of where errors sit. Your own agent’s accuracy is something you measure.

GPT-4o in the study All seven categories Test results only
Accuracy 86.9% 77.9%
Recall 84.9% 70.4%
Precision 97.0% not stated in the text
False negative rate not stated in the text 29.6%

Agreement points the same way. Cohen’s kappa was 0.752 between the clinicians and 0.391 between the models and the clinicians. High precision with low recall means what the model writes is usually right, and what it leaves out is the problem. A clinician reviewing a tidy draft does not see the potassium value that never made it in.

The trap: a reviewer checks what the agent wrote. The error that matters is the value it never wrote, so review has to start from the source document.

The authors conclude that the models are “best suited for initial extraction with human verification”, and every check below assumes that shape. The agent drafts and a named person confirms.

Checks 1 to 3: settle what the agent is before you build it

Three legal checks come first, because each one changes the architecture when it goes wrong.

1. Keep the agent on the transfer side of the medical device line

Scope the agent to moving and formatting what a document already says, never to interpreting it. The EU’s MDCG 2019-11 guidance on medical device software says that not all software used in healthcare is a medical device, and that information systems “intended only to transfer, store, convert, format, archive data” are not medical devices in themselves. Software that interprets or creates medical information for a medical purpose may be. An agent that copies a creatinine value into the right field stays on one side of that line; one that flags the value as worrying, or suggests a diagnosis code, may cross it. The usual slip is a request to highlight abnormal results, which quietly changes what the product is. Write the intended purpose down and hold every new feature against it.

2. Run the data protection impact assessment before the first document

The GDPR’s Article 35 requires an impact assessment before processing that is likely to be high risk, naming large-scale processing of the special categories in Article 9, health data among them, as one such case. Whether one practice counts as large scale is a question for your data protection officer, asked early. Where the assessment gets written after the pilot, the pilot ran on real patients without one. Have it signed before any real referral reaches the agent.

3. Sign the processor contract and pin the region

Every service the agent calls with patient data is a processor, and Article 28 requires a contract that binds each processor to the clinic. Then check where the model call runs. On Amazon Bedrock’s geographic cross-Region inference, requests to an EU profile stay inside the EU, but prompts and outputs may be processed in an EU Region other than the one you called, and data kept for abuse detection is stored in the destination Region. That usually meets an EU data residency requirement, as long as your contract and your assessment say so. The failure is a developer switching the model ID to a global profile for capacity. Pin the profile in configuration and log the Region on every call.

Checks 4 to 7: build the test before you trust the agent

Your test set comes from your own past documents, because your referral letters look like nobody’s benchmark.

4. Build a ground-truth set from your own past referrals and lab reports

Take two or three hundred past documents across your senders (the hospital referral template, the two labs you use most, the handwritten fax) and have clinicians record the correct fields. That ground truth becomes your eval dataset, and every model, prompt or parser change runs against it before release. Teams that test on twenty clean PDFs from one lab meet the scanned fax on day two. Before you start, check that every sender and document type you receive has examples in the set.

5. Measure recall per field, lab values first

Report recall for each field and each document type separately. In the study above, 84.9% overall hid 70.4% on test results. Set a floor for each field before you look at the numbers, and count a missing value as a failure even when everything the agent did write is correct. Otherwise a 90% average ships while lab values sit far lower. A per-field table on every release catches it.

6. Cap false positives, and count what they would cost

A false positive here is a value in the record that the document never contained. The same study reported a 7.5% false positive rate for GPT-4o, which its authors described as acceptable but not negligible. Decide how many invented values per hundred documents your clinicians can catch in review, and count every one in your test run. Asking for structured output with a field for the source page and line makes an invented value easier to spot, because it has nowhere to point. An invented allergy looks as tidy as a real one, so sample drafts and trace each value back to the source text.

7. Gate on a signal you can measure

Route each field to review on a number you computed, never on the model saying it is sure. Confidence gating needs a score with a defined meaning. Microsoft’s Document Intelligence documentation defines field confidence as “an estimated probability between 0 and 1 that the prediction is correct”, notes that not all fields return one, and warns that the OCR read confidence and the field confidence are separate, so you check both. We wrote earlier about why self-reported LLM confidence makes a poor gate, and the same holds here. A blurry scan produces confident nonsense; your test set shows whether the low-scoring fields really are the wrong ones.

Checks 8 to 10: make the record show who confirmed what

The record itself has to say which values a machine drafted and which a clinician signed.

8. File the draft as partial, and let only a clinician make it final

If your record system speaks HL7 FHIR, the DocumentReference resource carries a docStatus bound to the composition status codes. There, partial means “data in the composition may be incomplete or unverified”, and final means “complete and verified by an appropriate person”. The agent writes partial, and only the clinician’s confirmation sets final. That writes the human-in-the-loop step into the data, so no report can mistake a draft for a signed result. Agents write final when a default says so; query the record for any final document without a clinician’s confirmation event.

9. Record the agent as the author of the draft

FHIR’s Provenance resource can record what an automated process did when it transformed input into records, with the software listed as one of its agents. Record the agent, its version and the model behind it on every draft, and the clinician on every confirmation. Skip it and, six months later, nobody can tell which values came from the old prompt. Pick any field in the record and you should be able to trace it to a document, a model version and a person.

10. Keep the source document next to the extracted fields

Store the original PDF or fax with the draft and link each field to the page it came from. The clinician confirms against the source itself, which is the document AI version of a rule we hold for every agent: a summary is not a source. Without the link, review becomes reading the agent’s draft and approving it. Time a review: a clinician should reach the source line for any field in one click.

Two-column card. The agent drafts: writes the document as partial, names itself, its version and the model in Provenance, links every field to its source page, sends low-scoring fields to review first. The clinician confirms: checks the source for values the draft left out, edits with every edit logged, sets the document to final, and is named in Provenance as the person who verified it.
The draft and the confirmation as two named steps in the record, drawing on checks 7 to 10 and 12.

Checks 11 and 12: run it like a production system

Once live, the agent needs trained reviewers and an off switch.

11. Train the people who confirm

The EU AI Act’s Article 4, as amended, says deployers “shall take measures to support the development of AI literacy” of the people using the system on their behalf, an obligation in force since February 2, 2025 and reworded by the Digital Omnibus on AI published in July 2026. For this agent, AI literacy is concrete. The clinicians know the agent misses values more often than it invents them, so they look in the source for what is absent as well as what is present. Untrained, review turns into a click. Hold a short session at go-live and keep a log of who attended.

12. Keep an audit trail, a weekly sample and a kill switch

Log every draft, every edit a clinician makes and every confirmation in an agent audit trail, then sample a set of confirmed documents each week against their sources. A rising edit rate on one sender usually means its template changed. Give the practice manager an agent kill switch that sends every incoming document back to manual entry in one step. Labs change PDF layouts without warning, so use the switch once before launch to know it works.

How a clinic gets this built

A clinic gets it built as a short pipeline on the systems it already runs. The agent reads the inbox or fax queue, extracts fields with a source line for each, routes low-scoring fields to review as in check 7, writes a partial document with its provenance, and pauses for the clinician. A finished AI scribe, like the ones in our ranking of AI scribe apps, solves a different job, drafting the note from a consultation, and will not read the referral and lab inbox for you. The data model also points ahead. Lab results are in the second group the European Health Data Space exchanges from March 26, 2031, so structured, confirmed lab data is worth having anyway.

The takeaway

Build the agent so the clinician confirms a draft against its source. It turns dangerous when review becomes approving a tidy summary. Settle the legal scope first, test recall per field on your own documents, write drafts as partial with the agent named as their author, and keep a switch that sends everything back to manual entry. Twelve checks, all of them settled before the first real document.

Sources

Want this built and running in production? Soba Labs builds custom AI agents. Talk to us