How to Build a Bloodwork Tracker That Detects Real Change
A bloodwork tracker is a small database plus a decision rule. The database holds one row per analyte per draw. Each row carries the value, the unit, the LOINC code, the lab, and the assay method. The decision rule tells you whether a difference between two draws is larger than the combined analytical and biological noise of that analyte. Most consumer trackers do the first part and skip the second, which is why they show you a red arrow when your alanine aminotransferase (ALT) moves from 28 to 34 U/L. That change is well inside the noise floor for ALT and means nothing on its own.
This piece covers how to get your results out of lab portals in a machine-readable form, how to model them, and how to test for change without fooling yourself.
Getting the data out
There are four realistic sources, in descending order of quality.
The best is FHIR R4 from the lab or health system patient API. Labs and health systems in the United States are required to expose a patient-access API under the ONC rules, and the relevant resources are DiagnosticReport and Observation. Each Observation carries code, usually a LOINC code, along with effectiveDateTime and often referenceRange. It also carries valueQuantity holding value, unit, and a UCUM code. This is the only source where analyte identity and units arrive already structured.
The second is Apple Health’s clinical records, which mirror the same FHIR JSON. Export from the Health app produces a zip containing export.xml plus a clinical-records/ directory of one JSON file per resource. Parse the JSON directly and ignore export.xml for labs.
The third is CSV export from a portal, which usually loses the LOINC code and the method. The fourth is PDF. If you are stuck with PDFs, pdfplumber with extract_table() works on Quest and Labcorp report layouts more often than pdftotext -layout, but both fail on multi-page panels where the header row does not repeat. Budget for a manual review pass. Store the source PDF hash alongside every parsed row so you can re-extract when your parser improves.
A schema that survives lab switching
Use long format, one row per measurement. A workable SQLite schema:
CREATE TABLE result (
id INTEGER PRIMARY KEY,
collected_at TEXT NOT NULL, -- ISO 8601 with offset
loinc TEXT, -- e.g. '1742-6' for ALT
analyte TEXT NOT NULL, -- normalized internal name
value_num REAL,
value_text TEXT, -- '<0.2', 'NEGATIVE'
unit_ucum TEXT NOT NULL, -- 'U/L', 'mg/dL', 'nmol/L'
ref_low REAL,
ref_high REAL,
lab TEXT NOT NULL, -- 'Labcorp', 'Quest', 'Boston Heart'
method TEXT, -- 'immunoturbidimetric', 'LC-MS/MS'
fasting_hours REAL,
source_doc TEXT, -- sha256 of PDF or FHIR resource id
UNIQUE(collected_at, loinc, lab, method)
);
Two columns do most of the work. value_text keeps censored results such as <0.2 mg/L from being silently coerced to 0.2 or to NULL, which distorts any trend on high-sensitivity C-reactive protein. method is what lets you detect step changes caused by the lab. Such a change does not come from you.
Method matters more than people expect. An LDL cholesterol calculated by the Friedewald equation and one calculated by Martin-Hopkins will differ systematically at low triglyceride and low LDL values. Testosterone by immunoassay and testosterone by liquid chromatography tandem mass spectrometry are not interchangeable at the low end. If you change labs and the value jumps, check method before you change anything else.
Normalizing units and analyte identity
Key on LOINC where you have it, and maintain your own mapping table from lab-specific analyte names to LOINC where you do not. Expect the mapping to be messy. “Vitamin D, 25-Hydroxy” and “25-OH Vitamin D, Total” are the same measurement. “Vitamin D, 1,25-Dihydroxy” is not.
Convert everything to a single canonical unit per analyte at write time, and keep the original. The conversions that bite people are the molar ones. Glucose in mg/dL times 0.0555 gives mmol/L. Creatinine in mg/dL times 88.4 gives µmol/L. Total cholesterol in mg/dL times 0.0259 gives mmol/L. Ferritin is reported as ng/mL and µg/L interchangeably because they are numerically identical, which is fine, but your unit parser should know that rather than flag a change.
Deciding whether a change is real
This is the part that separates a tracker from a spreadsheet. Two sequential results differ because of analytical imprecision (CVa, the coefficient of variation of the assay) and within-subject biological variation (CVi, how much your own true value fluctuates around your set point). The reference change value combines both:
RCV = √2 × Z × √(CVa² + CVi²)
At 95% two-sided confidence, Z is 1.96 and the leading constant is 2.77. Published CVi estimates live in the EFLM Biological Variation Database, and your lab can give you CVa for its own platform.
Worked examples. Creatinine has CVi near 6% and CVa near 3%, so the RCV is roughly 18%. A move from 0.95 to 1.05 mg/dL is noise. ALT has CVi near 19%, so with CVa at 5% the RCV is above 50%. A move from 28 to 34 U/L is noise. Thyroid stimulating hormone has a similarly wide CVi, and much of it is diurnal.
Store CVa and CVi per analyte in a lookup table and compute the RCV band on every chart. The band is the useful output. Any point inside it, relative to the previous draw, should not trigger a second thought. Anything outside it deserves a repeat draw before it deserves an interpretation, and a result far outside it deserves a clinician rather than a plot.
Reference ranges deserve the same skepticism. A standard interval covers the central 95% of a reference population. Across a 40-analyte panel, the chance that every result falls inside its interval is about 0.95^40, or roughly 13%. You should expect about two flagged values per comprehensive panel from chance alone. This is why a single out-of-range asterisk is weak evidence and a consistent within-person trend is strong evidence.
Controlling the inputs
Longitudinal comparison only works if the pre-analytical conditions are stable. Fix what you can and record what you cannot.
Draw at the same time of day, ideally early morning, because cortisol, testosterone, iron, and TSH all have real diurnal swings. Fast for 10 to 12 hours when you are tracking lipids or glucose, and log fasting_hours every time. Avoid vigorous exercise for 48 hours before a draw. Creatine kinase, ALT, and aspartate aminotransferase all respond to muscle work. Sit quietly for five minutes before the venipuncture, since moving from supine to upright shifts albumin and anything bound to it by several percent through plasma volume change. Ask for the hemolysis index if potassium or lactate dehydrogenase looks odd, since a difficult stick inflates both.
Use the same lab for the same analyte whenever you can. When you must switch, run one overlapping draw at both labs on the same morning so you can estimate the offset.
What ordinary panels do and do not see
A basic metabolic and liver panel carries more prognostic information than its cost suggests. In a large cohort of COVID-positive US veterans, abnormal serum albumin, ALT, and blood urea nitrogen were each associated with higher risk of mechanical ventilation and in-hospital mortality.1 Those are three of the cheapest analytes in medicine, and they are on almost every panel you have already had drawn.
What panels miss is anything that changes before the standard chemistry does. Epigenetic marks in blood show cardiometabolic disruption well before conventional risk markers move.2 Glycosylation patterns on immunoglobulin G shift with inflammatory and metabolic state and carry diagnostic information that no routine panel reports.3 Rare circulating cells can be characterized from a peripheral blood draw to track plasma cell disorders and their precursor states.4 Circulating tumor DNA has been used to follow the emergence of treatment resistance in real time.5 None of these appear on a standard requisition, and all of them are measured from the same tube of blood.
The practical implication for your tracker is to design the schema so that non-panel assays fit. Keep analyte free text with a LOINC column that may be null. Do not hard-code a list of 60 markers.
Questions people also ask
How many draws do I need before a trend means anything? Three is the minimum to see direction and four to see whether the direction persists. Do not fit ordinary least squares to three points and report a slope. Use a Theil-Sen estimator, which is resistant to a single outlier draw, and compare the total change against the RCV rather than the p-value.
Should I use the reference range printed on my report? Use it as a coarse safety check and nothing more. It describes a population, not you, and it varies by lab and method. Your own prior results are a better comparator once you have four or five of them.
What happens when I switch labs? Expect a step change in some analytes, especially immunoassays. Run one split draw at both labs, record the offset, and treat pre-switch and post-switch series as separate segments in any trend fit. A CUSUM test on the residuals will find step changes you did not anticipate, such as an assay lot or platform migration at your existing lab.
Can I just upload the PDF to a language model? For explanation of what an analyte measures, that works well. For extraction, verify the numbers, because table parsing errors in these reports are quiet and frequent. Give the model your structured database and the RCV bands rather than the raw PDF, and it will give you better answers.
How often should I test? For a healthy baseline, two to four times a year is enough to establish a set point and estimate your own CVi. Testing monthly mostly buys you noise, unless you are following something with a short biological time constant or you have a specific clinical reason discussed with a physician.
Footnotes
-
Whitney D. Moss, Giovanna R. Pires, Guo Wei, et al. Abnormal Serum Albumin, Alanine Aminotransferase, and Blood Urea Nitrogen are Associated with Higher Risks for Mechanical Ventilation and In-Hospital Mortality in COVID-19 Positive US Veterans. Biomarker Insights, 2026. https://doi.org/10.1177/11772719251409897 ↩
-
Andrea A. Baccarelli, José Ordovás. Epigenetics of Early Cardiometabolic Disease: Mechanisms and Precision Medicine. Circulation Research, 2023. https://doi.org/10.1161/circresaha.123.322135 ↩
-
Benjamin S. Haslund-Gourley, Brian Wigdahl, Mary Ann Comunale. IgG N-glycan Signatures as Potential Diagnostic and Prognostic Biomarkers. Diagnostics, 2023. https://doi.org/10.3390/diagnostics13061016 ↩
-
Stephanie N. Shishido, Jeremy Mason, Mohamed Kamal, et al. Characterizing circulating rare cells in peripheral blood for detecting and monitoring multiple myeloma and precursor states. npj Precision Oncology, 2025. https://doi.org/10.1038/s41698-025-01175-2 ↩
-
Susan Jenks. Tracking Tumor Resistance: The Early Promise of “Liquid” Cancer Tests. Journal of the National Cancer Institute, 2016. https://doi.org/10.1093/jnci/djw220 ↩
Pothos builds longitudinal molecular profiles of individuals: whole-genome sequencing, single-cell RNA sequencing, and plasma proteomics, delivered as a detailed report, every data file, and stored cells. Build your profile.