Needles converging on a box made of binary digits, which emits one confident stream of bits.
AI & Agents

The part no model fixes

August 4, 20268 min read

I pointed an AI at seventeen years of my own medical records. It was confidently wrong three times before it was right once. No current AI untangles this alone.

health-dataaihealthcareblood-work

Over in the Blood Work series, I've been reassembling my own medical history. Don't get me wrong: we've had some wins, and the biggest one is scope. The original goal was ten years of records, back to my diagnosis in June of 2016. What we've actually collected reaches to June of 2009, seventeen years, seven of them from before I was ever a patient. Seven health systems, 888 documents, 333 MB of XML. Leukemia, a transplant, CAR-T, and a very long tail of follow-up.

But that summary is exactly the problem. It's what the data shows, and the data is wrong. I had two allogeneic transplants, not one. I've had far more bone marrow biopsies and spinal taps than anything we've found in the current dataset. The one-sentence version of my own history, read straight off 888 documents, undercounts it. Keep that in mind for everything that follows.

Recently I asked the simplest question in the whole project: how many lab results do I have?

It took three attempts to answer. The first attempt said 67,387, and it was counting "are you deaf, or do you have serious difficulty hearing" as a lab result, because in the export format every Epic portal produces, a survey answer and a hemoglobin value are structurally identical. The second attempt found 25,352 results that all shared a single test name, units, because the actual names live somewhere else. The third attempt produced 11,896, a number I wrote down as final. It was also wrong. One hospital encodes a red blood cell count as a physical quantity and another encodes it as a bare number, and my filter silently dropped 68% of my RBC values, every one of them from a single health system. The chart didn't look broken. It looked like a multi-year stretch where nobody tested me. It looked like clinical history.

The series covers the extraction in detail. This post is about what the exercise demonstrates, because I don't think it's a parsing story. I think I was running a small, well-instrumented experiment on a question people keep answering with a hand wave: can AI fix healthcare's data problem?

I used AI heavily throughout. It wrote the parsers. It was fast, capable, and tireless. And every one of those wrong answers came out of that collaboration looking exactly like a right answer. Nothing crashed. Nothing warned. A plausible number and a correct number are indistinguishable until something outside the analysis checks.

The numbers would not sit still

Here's the pattern, and it repeated too many times to be an accident.

I measured how often the same blood draw appears in two health systems' records. First answer: 12. The real number was 65, whole panels' worth, because one lab writes Urea Nitrogen where another writes BUN, and for three tests one lab omits the standard identifying code entirely, so there was nothing to match on. I had already written 12 into a document as a finding.

I found 385 days where one test carried multiple values, and filed them as unresolved conflicts. Then we checked the timestamps. Every result in the corpus carries a real clock time, and 357 of the 385 were never conflicts at all, just a morning draw and an afternoon draw. The remaining 28 shared an exact instant, and we read all 28 instead of sampling. Not one was a conflicting measurement. They were defects in our own model: blood product expiration dates promoted as if they were measurements, donor and recipient chimerism merged onto one code, and twelve cases of a single code carrying two different neutrophil counts under one name. On a hunch we checked the gap between each of those twelve pairs against the band-form neutrophil count. It matched exactly, all twelve times. The lower value was segmented neutrophils, the higher was the ANC. Not a judgement call at all.

After all of it, the lab count settled at 11,897. One more than attempt three, having passed through numbers thousands off in both directions on the way. Fewer results and more distinct tests than we'd counted before, and correct in both directions for the first time.

Every one of those corrections came the same way: from putting the data somewhere it could be queried consistently and asking a follow-up question. Not one came from reading the XML more carefully. That distinction is the whole post, so hold onto it.

Nothing here is broken

The tempting summary is "health data is a mess," and it's true and useless. The sharper observation is that every organization's data is locally fine. Each hospital's encoding is valid. Epic's export does what its own boilerplate says, which is contain what was disclosed, not what occurred. Each silo is internally consistent, and the chaos lives entirely in the handoffs between them, in the gaps nobody owns. If you've read the MajorBoost story, you know I spent years learning that healthcare doesn't break inside anyone's specialty. It breaks between specialties. The data is that same lesson, written down in XML.

And here's the part that should stop you: none of this record-keeping is optional. Every one of these seven organizations is required by law to collect this data, retain it for years, and keep it linked to me, the specific human it describes. Federal law gives me the right to a copy. More recent law requires them to hand it over through an API. As far as I can tell, every one of them complied with all of it. Everything I've described in this post, the four-times-overcounted labs, the vanishing red cell values, the biopsies that exist only as sentences, is what the system produces when it's working as regulated. The law mandates custody. It does not, it turns out, mandate coherence.

The labs are still the easy case. I have had more than fifty bone marrow biopsies; I stopped counting at fifty. Across seven health systems and seventeen years, my records contain five coded as procedures. I have had forty spinal taps with intrathecal chemotherapy. The records contain zero. This isn't thin record-keeping either: the transplant year alone carries 2,130 coded procedure entries, none of them a biopsy. The information exists, but as sentences. One note reads "a history of 30-40 doses of intrathecal chemotherapy," corroborating my count in prose while the structured field beside it says nothing happened.

Forty, by the way, is not a round number. Forty is the ceiling, the point where cumulative intrathecal chemo starts causing brain damage. The most clinically consequential number in my history exists because I kept track of it myself.

Now put an AI in it, alone

A large language model is a plausibility engine. That's not an insult; it's the mechanism, and most days it's the thing I'm paying for. But look at the failure mode this domain serves up: errors that are silent, confident, and shaped exactly like answers. 67,387 was plausible. 12 duplicates was plausible. Five biopsies was, to a system with no memory of my mornings in a procedure room, plausible. The domain's trap and the tool's blind spot are the same shape. An AI working alone in this data doesn't resolve the chaos. It launders it: chaos in, a confident, well-formatted, wrong number out, and no exception to catch because nothing failed.

And that's the optimistic case, where the data exists. No model infers forty spinal taps from documents that contain zero. The missing data doesn't even look missing; absence in this system is indistinguishable from history. Disclosure is a legal and organizational boundary, not a technical one, and there is no context window big enough to hold what was never written down. The most likely place my real biopsy count lives is an insurance claims export, because every one of those procedures was billed, and that request has never been made. The answer isn't hiding in my 333 MB. It's in a filing cabinet I haven't asked for yet.

Instrument, not oracle

What actually worked was AI plus two unglamorous things.

A database whose job was never speed (parsing all 888 documents takes eleven seconds) but making assumptions sit still: every judgement call about what counts as a result or which names are the same test lives in a table, where it can be named, reviewed, and corrected once instead of re-derived wrong forever.

And a human who knows the territory, because I am, inconveniently for the machine, the world's leading authority on how many times I've been on that table. We've made that structural: the schema now distinguishes facts that were coded, facts extracted from prose, and facts attested by the patient, because a forty that comes from me is better evidence than a zero that comes from Epic, and the data model has to be able to say so. Same rule for counts: five biopsies is not a finding, it's a parsing artifact. "Nineteen reconstructed, fifty-plus actual" is a finding.

That's the shape of every win this project has had. AI as instrument, pointed and checked by someone holding ground truth, got my biopsy count from five to nineteen by hunting pathology text for the arrival of specimen containers. It cannot get to fifty, because fifty isn't in there. Every failure, without exception, was AI as oracle.

The chaos inside the health system is real, it's structural, and it's invisible from inside any one institution. Current AI doesn't resolve it alone, because it isn't a computation problem. It's a coordination problem wearing a data costume, and coordination is exactly the work these systems can't yet own.

Seven health systems, 888 documents, seventeen years, and the number that determined whether another spinal tap was even available to me lived in my head. Any AI that's serious about fixing healthcare starts by admitting where the record actually is.


More Blood Work articles are coming later this week, after a multi-day river float in central Oregon. When I'm back, the next targets are the insurance claims history and a complete list of providers. I'm not done, and I don't intend to stop until I have every useful piece of information there is to have. Because once you have leukemia, you always have leukemia. Mine has been kept at bay by the generosity of a mother who shared her newborn's stem cells. That gift is why I'm still walking this earth, and still floating its rivers.

Loading discussion…

Written by

Andrew @ CodeLifter

All Posts