<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.2 20190208//EN" "JATS-journalpublishing1.dtd"[]>
<article xml:lang="en" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" dtd-version="1.2" article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">IJPDS</journal-id>
<journal-title-group>
<journal-title>International Journal of Population Data Science</journal-title>
<abbrev-journal-title>IJPDS</abbrev-journal-title>
</journal-title-group>
<issn pub-type="epub">2399-4908</issn>
<publisher>
<publisher-name>Swansea University</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.23889/ijpds.v11i5.3567</article-id>
<article-id pub-id-type="publisher-id">11:5:3567</article-id>
<article-id pub-id-type="pii">S2399490821035679</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Population Data Science</subject>
</subj-group>
</article-categories>
<title-group>
<article-title>Temporal Signals of Disease: A Transformer Approach for Predicting Diabetes from Longitudinal EHRs</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author"><name><surname>Pan</surname><given-names initials="J">Jie</given-names></name><xref ref-type="aff" rid="affil-1"><sup>1</sup></xref></contrib>
<contrib contrib-type="author"><name><surname>Lee</surname><given-names initials="S">Seungwon</given-names></name><xref ref-type="aff" rid="affil-1"><sup>1</sup></xref></contrib>
<contrib contrib-type="author"><name><surname>Virani</surname><given-names initials="A">Adam</given-names></name><xref ref-type="aff" rid="affil-1"><sup>1</sup></xref></contrib>
<contrib contrib-type="author"><name><surname>Riazi</surname><given-names initials="K">Kiarash</given-names></name><xref ref-type="aff" rid="affil-1"><sup>1</sup></xref></contrib>
<contrib contrib-type="author"><name><surname>Martin</surname><given-names initials="E">Elliot</given-names></name><xref ref-type="aff" rid="affil-1"><sup>1</sup></xref></contrib>
<contrib contrib-type="author"><name><surname>Leung</surname><given-names initials="A">Alexander</given-names></name><xref ref-type="aff" rid="affil-1"><sup>1</sup></xref></contrib>
<contrib contrib-type="author"><name><surname>Quan</surname><given-names initials="H">Hude</given-names></name><xref ref-type="aff" rid="affil-1"><sup>1</sup></xref></contrib>
<contrib contrib-type="author"><name><surname>Li</surname><given-names initials="N">Na</given-names></name><xref ref-type="aff" rid="affil-1"><sup>1</sup></xref></contrib>
<aff id="affil-1"><label>1</label><institution>University of Calgary, Calgary, Canada</institution></aff>
</contrib-group>
<pub-date date-type="pub" publication-format="electronic"><day></day><month></month><year></year></pub-date>
<pub-date date-type="collection" publication-format="electronic"><year></year></pub-date>
<volume>11</volume>
<issue>5</issue>
<elocation-id>3567</elocation-id>
<permissions>
<license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by-nc-nd/4.0/">
<license-p>This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.</license-p>
</license>
</permissions>
<self-uri xlink:href="https://ijpds.org/article/view/3567">This article is available from the IJPDS website at: https://ijpds.org/article/view/3567</self-uri>
<abstract>
<sec>
<title>Objective</title>
<p>To develop and evaluate a Transformer-based temporal representation learning framework for predicting incident diabetes using longitudinal laboratory data, and to compare its performance with state-of-the-art pretrained models and traditional machine-learning baselines.</p>
</sec>
<sec>
<title>Approach</title>
<p>We deterministically linked a cardiac registry cohort (2015–2019) in Alberta, Canada, and retrieved three years of laboratory tests preceding each patient’s diabetes diagnosis. Each laboratory event was modelled as a triplet consisting of test type, test value, and time gap with the previous test, to preserve temporal structure. Our Transformer architecture learned contextual embeddings that capture both intra-test dynamics and inter-test interactions, indicating the onset of diabetes. Performance was benchmarked against two pretrained Transformer models (Moment, PatchTST) and an XGBoost baseline trained on aggregated test summaries (mean, standard deviation, minimum, maximum).</p>
</sec>
<sec>
<title>Results</title>
<p>The final cohort included 30,462 patients and 19 laboratory test types relevant to diabetes. The proposed method achieved the highest predictive accuracy (AUC = 0.92), outperforming Moment (0.80), PatchTST (0.74), and XGBoost (0.88). It also demonstrated superior sensitivity (0.70) and positive predictive value (0.777) while maintaining high specificity (0.938) and negative predictive value (0.911). Conclusion: Modelling raw laboratory trajectories with a dedicated temporal Transformer substantially improves diabetes prediction compared with both pretrained sequence models and aggregation-based baselines.</p>
</sec>
<sec>
<title>Implications</title>
<p>This framework provides a generalizable pathway for leveraging routine laboratory data in early disease detection. It highlights the clinical value of sequence-level modelling and supports the integration of temporal representation learning into population-level surveillance and decision-support systems.</p>
</sec>
</abstract>
</article-meta>
</front>
</article>