{
  "abstract": "BACKGROUND & AIMSInflammatory bowel disease (IBD) is often diagnosed months to years after symptoms begin, and diagnostic delay is associated with complications. We tested whether longitudinal machine learning using electronic health record (EHR) data can identify incident IBD before diagnosis, and quantified lead time and deployment burden.\n\nMETHODSWe studied adults with an IBD-compatible symptom, sign, or finding at UCSF (2012-2024). Incident cases were confirmed by structured filtering and validated large language model note review. We trained a state space model (Mamba) and comparators on pre-diagnostic EHR data, excluding diagnostic-workup features, and assessed discrimination at 6- and 12-month landmarks. We externally tested Mamba without recalibration at ZSFG, a safety-net hospital serving a demographically and socioeconomically distinct population, and simulated diagnosis-code-only deployment at UCSF.\n\nRESULTSSix months after presentation, among patients still undiagnosed (67% of UCSF test cases), Mamba achieved an AUROC of 0.969 (95% CI, 0.928-0.999) at UCSF and 0.965 (0.952-0.976) at ZSFG. Median lead time was 20 months at UCSF and 15 months at ZSFG. Among future cases with an initially normal colonoscopy (N=32) or a histological finding of acute inflammation without chronicity (N=63), the model flagged 84% and 89% of these patients, respectively, before those procedures, indicating the potential for pre-diagnostic detection. Among 358,886 symptomatic patients not used for training (60 incident cases), the diagnosis-code-only model achieved an AUROC of 0.926; reviewing 20 alerts/month identified 34 cases (PPV, 1.09%; 64-fold above baseline).\n\nCONCLUSIONSLongitudinal machine learning can identify increased IBD risk months to years before diagnosis and may define a population for prospective studies of early IBD biology. Prospective evaluation should determine whether earlier identification reduces diagnostic delay.\n\nWhat You Need to KnowO_ST_ABSBackground and ContextC_ST_ABSIBD is often diagnosed months to years after symptoms begin. Whether routinely collected electronic health record data can identify future IBD before diagnosis, and at what alert burden, is unknown.\n\nNew FindingsA longitudinal model identified future IBD six months after first symptomatic presentation with an AUROC of 0.97 and a median lead time of 20 months, with similar external discrimination.\n\nLimitationsThis was a retrospective study; external case labels were inferred rather than adjudicated, and colonoscopy analyses were exploratory. Whether earlier flagging shortens time to diagnosis requires prospective evaluation.\n\nClinical Research RelevanceRoutinely collected structured EHR data could support targeted gastroenterology review of recurrently symptomatic patients. Because incident IBD is rare among symptomatic patients, a service reviewing 20 flagged charts per month would identify roughly one future case every five months. Deployment should therefore begin in silent mode, with locally calibrated thresholds and prospective measurement of alert burden.\n\nBasic Research RelevanceThe model flagged most future cases before a pre-diagnostic colonoscopy read as normal, or before biopsies showing only acute inflammation. Patients flagged despite normal-appearing mucosa may represent a preclinical population in which the earliest immunologic, serologic, and microbial events of IBD could be studied prospectively, including through model-guided mucosal sampling.\n\nLay SummaryAn AI system reviewing medical records data is able to identify people who would later be diagnosed with inflammatory bowel disease, often more than a year before doctors made the diagnosis.",
  "abstract_shown": true,
  "affiliations": [
    "University of California, San Francisco"
  ],
  "article_type": "PUBLISHAHEADOFPRINT",
  "arxiv": null,
  "author_total": 5,
  "authors": [
    {
      "name": "G. Onal"
    },
    {
      "name": "A. Ayati"
    },
    {
      "name": "M.-Y. Chen"
    },
    {
      "name": "A. Mukherjee"
    },
    {
      "affs": [
        0
      ],
      "name": "V. A. Rudrapatna"
    }
  ],
  "bibtex": "https://research.draconitic.com/paper/ckwn3yq84m2q9.bib",
  "cited_by": 0,
  "doi": "10.64898/2026.10.12.26365307",
  "fulltext_url": "https://www.medrxiv.org/content/10.64898/2026.10.12.26365307v1.full",
  "id": "ckwn3yq84m2q9",
  "issns": [],
  "landing_url": "https://www.medrxiv.org/content/10.64898/2026.10.12.26365307v1",
  "language": null,
  "licence": "CC-BY-NC-ND",
  "licence_label": "CC BY-NC-ND",
  "licence_source": "article",
  "licence_url": "https://creativecommons.org/licenses/by-nc-nd/4.0/",
  "metadata_licence": null,
  "native_subjects": [
    [
      "medrxiv",
      "gastroenterology"
    ],
    [
      "openalex",
      "1702|Machine Learning in Healthcare"
    ]
  ],
  "openalex": "W7221601389",
  "pdf_url": "https://www.medrxiv.org/content/10.64898/2026.10.12.26365307v1.full.pdf",
  "pmcid": null,
  "pmid": null,
  "published": "2026-10-12",
  "publisher": null,
  "ris": "https://research.draconitic.com/paper/ckwn3yq84m2q9.ris",
  "sources": [
    {
      "first_seen": "2026-10-30T12:20:49Z",
      "native_id": "10.64898/2026.10.12.26365307",
      "source": "medrxiv",
      "url": "https://www.medrxiv.org/content/10.64898/2026.10.12.26365307v1"
    }
  ],
  "subjects": [
    {
      "field": "medicine",
      "origin": "medrxiv:gastroenterology",
      "subfield": "general"
    }
  ],
  "title": "Prediction of incident inflammatory bowel disease from routine electronic health records: development and external validation of a longitudinal machine learning model",
  "title_text": "Prediction of incident inflammatory bowel disease from routine electronic health records: development and external validation of a longitudinal machine learning model",
  "type": "preprint",
  "updated_at": "2026-10-30T12:20:49Z",
  "url": "https://research.draconitic.com/paper/ckwn3yq84m2q9",
  "venue": "medRxiv",
  "versions": []
}