arXiv 2026PreprintOpen source

EHR2Trace: Auditable EHR Data Infrastructure for Patient World Models and Clinical Agents

Xinye Yang, Yuli Wang, Cheng Ting Lin, Harrison Bai

arXiv preprint arXiv:2609.38193 (2026) · DOI: 10.48550/arXiv.2609.38193

TL;DR

EHR2Trace converts EHRs from different sources into source-linked patient events with separate event and availability times, exports OMOP CDM and MEDS, and validates the saved outputs; across three clinical datasets it converted 846.4 million events and detected all 28 injected faults, and backdating diagnoses to admission inflated a mortality model's AUROC from 0.829 to 0.965.

中文简介:EHR2Trace 把不同来源的 EHR 转换为可追溯到源记录的患者事件,事件时间与信息可得时间分开存储,导出 OMOP CDM 与 MEDS 并校验落盘结果;在三个临床数据集上转换 8.464 亿条事件,28 个注入故障全部检出;把诊断回填到入院时间会把死亡预测模型的 AUROC 从 0.829 虚高到 0.965。

Key points

Abstract

Patient world models and clinical agents aim to predict changes in patients' health and support clinical work. Developing these systems requires reliable histories of patient conditions, treatments, and the information available at each decision. Electronic health records (EHRs) contain these histories, but differences in how events are recorded make them difficult to use consistently. We present EHR2Trace, a system that converts EHRs from different sources into traceable patient events for model training and evaluation. It links events to source records, separates event time from information availability, and distinguishes medication orders, dispensing, and administration. A shared event representation supports both OMOP and MEDS exports, with automated validation and reproducible builds. Across three clinical datasets, EHR2Trace converted 846.4 million events, with every applicable check passing except one unit-consistency check on MIMIC-IV, and detected all 28 injected faults. A controlled prediction experiment showed that assigning later diagnoses to admission time substantially inflated measured performance, and that a model trained on such data lost accuracy when deployed on histories filtered by availability. EHR2Trace provides a reusable data foundation for patient world models and clinical agents, helping researchers inspect patient histories, check conversion decisions, and evaluate models with explicit data rules.

License: CC BY 4.0 (arXiv).

Citation

Xinye Yang, Yuli Wang, Cheng Ting Lin, Harrison Bai. EHR2Trace: Auditable EHR Data Infrastructure for Patient World Models and Clinical Agents. arXiv preprint arXiv:2609.38193 (2026). https://doi.org/10.48550/arXiv.2609.38193

@article{yang2026ehr2trace,
  title   = {{EHR2Trace}: Auditable {EHR} Data Infrastructure for Patient World Models and Clinical Agents},
  author  = {Yang, Xinye and Wang, Yuli and Lin, Cheng Ting and Bai, Harrison},
  journal = {arXiv preprint arXiv:2609.38193},
  year    = {2026},
  doi     = {10.48550/arXiv.2609.38193}
}

FAQ

What is EHR2Trace?

An open-source system that converts electronic health records from different sources into source-linked patient events and exports them to OMOP CDM 5.4 and MEDS, with automated validation of the saved outputs and reproducible builds.

Why separate event time from information-availability time?

A result or diagnosis is often recorded after the clinical event it describes. Using event time alone can place information in a model's input before a clinician could have seen it. In the paper, backdating admission diagnoses inflated held-out AUROC from 0.829 to 0.965, and a model trained that way scored 0.642 on availability-filtered histories.

How is EHR2Trace validated?

55 automated checks compare saved outputs with source records, audit records and dataset declarations. They detected all 28 faults in an injected catalogue; the OHDSI Data Quality Dashboard detected 5 of the 9 faults that reach OMOP.

Which datasets were converted?

A Johns Hopkins CT pulmonary embolism extract, MIMIC-IV v3.1, and a University of Colorado CT pulmonary angiography extract, 846.4 million canonical events in total. The code runs on the open MIMIC-IV demonstration subset without credentialed access.

Where is the code?

github.com/Yangxinyee/ehr2trace, under the Apache-2.0 license, with the experiment records behind the paper's numbers.