A percentage in a PDF is not enough to identify the denominator. Before a developer builds an evidence-table plot, the extraction row should retain the event count, the participant denominator, the study arm and an exact location in the source.
Here is a small, dependency-free Python validator with synthetic teaching data. It rejects booleans, non-integers, impossible participant counts, zero denominators and missing source locators. It does not infer missing values or reconstruct counts from a rounded percentage.
def check_binary_row(row): # The caller must establish that these are participant counts. events, total = row["events"], row["total"] if type(events) is not int or type(total) is not int: raise ValueError("events and total must be integer participant counts") if total <= 0 or not 0 <= events <= total: raise ValueError("require 0 <= events <= total and total > 0") if not row.get("source_locator", "").strip(): raise ValueError("source locator is required") return {**row, "proportion": events / total} rows = [ {"study": "synthetic-A", "events": 2, "total": 20, "source_locator": "teaching table A"}, {"study": "synthetic-B", "events": 18, "total": 60, "source_locator": "teaching table B"}, ] checked = [check_binary_row(row) for row in rows] print([row["proportion"] for row in checked]) # [0.1, 0.3] for bad in [dict(rows[0], events=21), dict(rows[0], total=0), dict(rows[0], events=True), dict(rows[0], source_locator="")]: try: check_binary_row(bad) except ValueError: pass else: raise AssertionError("invalid teaching row was accepted") The output is [0.1, 0.3]. The included negative cases exercise different failures. The source locators are teaching labels, not citations to actual trial results.
Passing the validator proves only these structural checks. It cannot prove that a copied number is correct, that the denominator is the randomized population, or that two studies measure the same outcome at the same time. It also must not be reused for recurrent-event rates: an event count may exceed the number of people when participants can have multiple events. Store that data under an appropriate schema.
For a real extraction, check every row against the paper and record the analysis population, arm, endpoint and follow-up. Cochrane Handbook chapter 6 explains why binary, count/rate and time-to-event data require different effect measures: https://www.cochrane.org/authors/handbooks-and-manuals/handbook/current/chapter-06
We build RigorMed, an AI research workspace for organizing research materials into source-linked evidence tables and reviewable analyses, drafts, figures and presentations. The public-paper example is a starting point for a clinical journal club; execution may use credits and the output needs researcher review.


