Orders ready to sign

Primary care · kidney damage · family doctors

1 in 7 people with diabetes or high blood pressure have signs of kidney damage hiding behind a normal blood test. 19 in 20 of them have never been told.

Every morning, this tool reads a family doctor's list, finds those people, and prepares the next test, ready to sign. The computer does the checking. The doctor decides.

The problem, from one patient's side

Meet Amparo. Nothing hurts. Nothing looks wrong.

Amparo is 69, with type 2 diabetes and high blood pressure. Her blood test says her kidneys filter well, so her results are called "acceptable".

But a urine test found albumin, a protein that should not be there. That is often the first sign that diabetes and high blood pressure are damaging the kidneys. A second high result came in a letter from her private insurer and was typed into a note, where no filter looks.

Her record has no kidney diagnosis. She is not on the blood-pressure medicine that also protects the kidneys. The warning sign is hiding behind a normal blood test.

Amparo is made up: she is patient 251 in our synthetic demo. The numbers below are real.

Amparo's record

  1. Type 2 diabetes, then high blood pressure
  2. Urine albumin 85 mg/g normal is under 30
  3. Blood test eGFR 68 "acceptable"
  4. Note: insurer's report, urine albumin 110 mg/g only in free text
  5. No kidney diagnosis · metformin only · appointment at 10:20

How many people are like Amparo

Measured on the US national health survey (NHANES, CDC)

1 in 7adults with diabetes or high blood pressure have albumin in their urine while their blood test looks normal.143 per 1,000 (95 % CI 128–159) · NHANES 2021–2023, n = 2,216
19 in 20of them have never been told they have a kidney problem.953 per 1,000 (95 % CI 904–977) · NHANES 2021–2023, n = 313
1 in 5of those who also have both diabetes and high blood pressure take no ACE inhibitor or ARB, the medicine guidelines recommend for this (some may have a reason not to).218 per 1,000 (95 % CI 151–304) · NHANES 2017–2020, n = 204

That is about 10.6 million US adults, an undercount, since a third of people had no lab result. The same gap exists in Spain: 54 % of kidney disease in 5,009 adults with type 2 diabetes in Spanish primary care was undiagnosed, "mainly in patients with isolated eGFR or uACR abnormalities" (DIAMOND2, 2026).

Why it matters

There is a clear next step. It just doesn't happen.

  • Albumin in the urine predicts a higher risk of death, independently of the kidney blood test (105,872 people, 14 population studies; Matsushita et al., Lancet 2010).
  • The international kidney guideline: "We recommend that treatment with an ACEi or an ARB be initiated in patients with diabetes, hypertension, and albuminuria" (KDIGO 2022, Rec. 1.2.1).
  • But one urine test is not a diagnosis: about half of high results are high again on a second sample 10 days later. So the right first step is simple: repeat the urine test.

Why it gets missed

Attention, not knowledge

The blood test is the number most people read as "the kidney result", and it looks fine. The urine result sits elsewhere in the record, sometimes only in a note or a letter, and goes out of date quietly.

No one has time to check every chart, every morning.

What we built

Three steps. The doctor makes every decision.

  1. It reads the list

    Every morning, it checks everyone with diabetes or high blood pressure with rules from kidney guidelines (KDIGO, Valencian primary-care protocol), signed by the project's physician. A small open AI model also reads the notes for results typed there; the code checks every sentence it points to.

  2. It prepares the next step

    For each person it finds: the test order, one line for the notes and a date to review the result, with the reason, the number and the date.

  3. The doctor signs

    One click to sign, or "no" with a reason. If a test is already ordered or was repeated recently, the person is not listed again.

Inside the tool, step by step, with Amparo
How it works, traced with Amparo: 1 Extract, 2 Signed rules find her urine test was never repeated, 3 the note reader points to the sentence with her second result and the code checks it, 4 the final rules see two high results 8 months apart, 5 the doctor signs an order to consider a kidney disease code. Each step also shows a real NHANES participant, the median case of those like Amparo (a woman in her 60s, eGFR 105, urine albumin 98, then 31 on a sample 10 days later); the note reader and the final rules are marked not tested on real data.
Drawn from the code by docs/diagram/build.mjs; the numbers are read from the committed results.

Evidence · pre-registered protocol, reproducible

What we measured, and how

The kidney rules were signed before we touched any real data. We wrote the evaluation plan down first, then ran the unchanged rules on public CDC survey data.

External evaluation on NHANES (survey-weighted, 95 % CI)
QuestionResultHow
How many kidney warning signs does a blood-test-only filter find?48 %Filter "eGFR under 60" on NHANES 2021–2023 adults with diabetes or high blood pressure (481 per 1,000; 445–517). The other 52 % are the people like Amparo; the tool prepares a repeat urine test for each of them.
When the tool asks for a repeat urine test, how often is it confirmed?52 %NHANES 2009–2010, the only cycle with a second urine sample (524 per 1,000; 441–606; n = 360). Not flagged but high on the second sample: 13.5 per 1,000.
Do we read the CDC files the way the CDC does?7 of 8Figures in the CDC's own analytic note reproduced exactly. The eighth is explained in the results file.

Limits: single visits (a kidney diagnosis needs 3 months); self-reported diagnoses; a third of people had no lab result; US data, while the tool is designed for Spanish primary care. The note reader, tested on real published case reports, found an ACR result in 5 of 21 real case reports that state one, and read none of their values; Amparo's note is synthetic. Full protocol, results and code: docs/EVAL_PROTOCOL.md, eval/results/.

pip install -r requirements-eval.txt
python3 eval/nhanes/fetch.py     # public CDC files, pinned by SHA-256
python3 eval/nhanes/run.py       # engine on NHANES → eval/results/nhanes.md
python3 eval/nhanes/people.py    # awareness, treatment → eval/results/nhanes_people.md

Who benefits, and who could be harmed

Honest about what it can and can't do

Who benefits

  • People like Amparo: a kidney problem found while it can still be slowed.
  • Family doctors: the checking is done before the clinic opens.

Who could be harmed

  • Extra tests: about half of repeat orders come back normal.
  • False reassurance: not on the list is not "cleared"; it only sees the record.
  • Wrong setting: the numbers are from the US.