<?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.3730</article-id>
<article-id pub-id-type="publisher-id">11:5:3730</article-id>
<article-id pub-id-type="pii">S2399490821037307</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Population Data Science</subject>
</subj-group>
</article-categories>
<title-group>
<article-title>Mapping Free-Text Emergency Department Diagnoses to ICD-10 Codes Using Large Language Model Embeddings</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author"><name><surname>Hartka</surname><given-names initials="T">Thomas</given-names></name><xref ref-type="aff" rid="affil-1"><sup>1</sup></xref></contrib>
<contrib contrib-type="author"><name><surname>Alexander</surname><given-names initials="R">Robin</given-names></name><xref ref-type="aff" rid="affil-2"><sup>2</sup></xref></contrib>
<contrib contrib-type="author"><name><surname>Raman</surname><given-names initials="R">Rajendra</given-names></name><xref ref-type="aff" rid="affil-3"><sup>3</sup></xref></contrib>
<contrib contrib-type="author"><name><surname>Mulhern</surname><given-names initials="E">Eilidh</given-names></name><xref ref-type="aff" rid="affil-4"><sup>4</sup></xref></contrib>
<contrib contrib-type="author"><name><surname>McCowan</surname><given-names initials="C">Colin</given-names></name><xref ref-type="aff" rid="affil-2"><sup>2</sup></xref></contrib>
<aff id="affil-1"><label>1</label><institution>University of Virginia, Charlottesville, USA</institution></aff>
<aff id="affil-2"><label>2</label><institution>University of St. Andrews, St. Andrews, United Kingdom</institution></aff>
<aff id="affil-3"><label>3</label><institution>Emergency Department, Victoria Hospital, Kirkcaldy, United Kingdom</institution></aff>
<aff id="affil-4"><label>4</label><institution>University of Glasgow, Glasgow, United Kingdom</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>3730</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/3730">This article is available from the IJPDS website at: https://ijpds.org/article/view/3730</self-uri>
<abstract>
<sec>
<title>Objective</title>
<p>In many emergency departments (EDs) in Scotland, discharge diagnoses are documented as free-text rather than coded using the International Classification of Diseases, Tenth Revision (ICD-10). This study aimed to validate an automated approach for mapping free-text ED discharge diagnoses to ICD-10 codes using large language model (LLM)–based text embeddings.</p>
</sec>
<sec>
<title>Methods</title>
<p>Data were obtained from the Health Informatics Centre for the years 2018–2021. From this data, 90 free-text ED discharge diagnoses were randomly selected. Three physicians independently assigned the ICD-10 code they felt best matched each diagnosis, with disagreements adjudicated by a fourth reviewer to establish a reference standard. Free-text diagnoses and ICD-10 code descriptions were embedded using the Hugging Face all-MiniLM-L6-v2 sentence-transformer model. For each diagnosis, the closest ICD-10 match was identified using cosine similarity. The accuracy of each physician reviewer and of the embedding-based approach, relative to the adjudicated reference standard, was assessed at increasing levels of ICD-10 specificity.</p>
</sec>
<sec>
<title>Results</title>
<p>Physician agreement with adjudicated codes ranged from 93–96% at the first character, 91–92% at the first two characters, 88–90% at the first three characters, and 76–79% for the full ICD-10 code. The embedding-based approach achieved accuracies of 89%, 86%, 83%, and 68% at the corresponding levels of specificity.</p>
</sec>
<sec>
<title>Conclusion</title>
<p>Mapping free-text ED diagnoses to ICD-10 codes is challenging and subject to inter-physician variability. While the embedding-based approach did not match physician-level performance, it demonstrated reasonable accuracy and may support scalable classification of ED diagnoses in large administrative databases.</p>
</sec>
</abstract>
</article-meta>
</front>
</article>