Patient Context-Aware Medical Entity Alignment
Full text
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 1 Patient Context-Aware Medical Entity Alignment STAN OSTASZEWSKI†,Institute of Data Science, Maastricht University, Netherlands ADINATH DUNDI MOHAN KUMAR, Institute of Data Science, Maastricht University, Netherlands DURUKAN KILIÇ, Institute of Data Science, Maastricht University, Netherlands ENSAR EROL, Institute of Data Science, Maastricht University, Netherlands MICHEL DUMONTIER, Institute of Data Science, Maastricht University, Netherlands REMZI CELEBI, Institute of Data Science, Maastricht University, Netherlands Healthcare data interoperability hinges on aligning disparate terminologies—such as CPT procedures, NDC drugs, LOINC observations, and ICD-9 diagnoses—to a unified ontology like SNOMED CT. This paper presents a hybrid, code-agnostic framework that leverages expert-curated refsets for direct 1-to-1 mappings, augmented by algorithmic strategies for incomplete or 1-to-M cases. For unmapped codes, medBERT text embeddings power logistic regression-based imputation and non-contextual ranking, while a novel patient-context-aware ranking exploits SNOMED’s graph structure via three proximity metrics: textual cosine similarity, exact shortest-path distances, and Node2Vec embeddings. Imputation yields high AUCs (0.95+ for NDC, 0.85 for CPT); and contextual ranking for ICD-9’s generic mappings achieves Hits@1 of 0.37-0.45 (Node2Vec) and Hits@5 of 0.82-0.88 on synthetic EHR-like tests—outperforming text-only methods by 3-4x while delivering 480x speedup over computing exact distances. Interpretable confidences ( 𝜅𝑖 ) reward context-specific outliers, enabling robust entity resolution in graph-triple pipelines. This framework bridges ontology gaps in data science workflows, reducing mapping ambiguity for EHR analytics. Limitations include synthetic validation and single-epoch Node2Vec training; future extensions target multi-epoch scaling and LLM hybrids for real-world noise. By fusing refsets with embeddings, our approach advances scalable semantic integration in clinical informatics. CCS Concepts: •Applied computing → Health care information systems;•Computing methodologies → Machine learning; Ontology engineering;•Information systems →Data management systems. Additional Key Words and Phrases: SNOMED CT ontology mapping, Graph embeddings for entity alignment, Node2Vec in biomedical knowledge graphs, medBERT text embeddings, Contextual ranking in EHR data, 1-to-M code imputation, Healthcare terminology interoperability, Logistic regression for semantic proximity ACM Reference Format: Stan Ostaszewski, Adinath Dundi Mohan Kumar, Durukan Kılıç, Ensar Erol, Michel Dumontier, and Remzi Celebi. 2025. Patient Context-Aware Medical Entity Alignment. In .ACM, New York, NY, USA, 10 pages. https://doi.org/XXXXXXX.XXXXXXX 1 INTRODUCTION Different healthcare vocabularies or ontologies often contain complementary or overlapping information about the same real-world entities. However, identical entities are frequently represented using different identifiers, names, or attribute sets due to variations in data collection practices, ontological standards, languages, abbreviations, and notational conventions. Such heterogeneity poses a major challenge for integrating health data coming from heterologous sources. Entity alignment (EA), also known as entity matching or entity resolution, aims to identify entities across different knowledge bases that refer to the same real-world object, as well as to distinguish those that are genuinely distinct. Successful alignment enables richer, more complete, and more interoperable knowledge graphs. When there are different data sources, there is a high probability that the different datasets will use their own labels and naming, with potentially different meaning (and confusing meaning such as the same term used for different concepts). Similarly, different data sources may use different terminologies, like ICD and SNOMED. To achieve interoperability, it is essential to align labels and terminologies with the common terminology used in the Reference Ontology. This alignment process can be effectively executed through automated or semi-automated approaches. If the identifier of the entity is already known, open-source mapping services can be employed to identify previously linked entities. These tools offer filtering 1 ∗corresponding author Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. ©2025 Copyright held by the owner/author(s). Publication rights licensed to ACM. Manuscript submitted to ACM 1
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 Conference acronym ’XX, June 03–05, 2018, Woodstock, NY ..., et al. options based on criteria like entity type, enabling retrieval of the corresponding entity in the target vocabulary for a given source entity. 2 RELATED WORK There are two main categories of entity alignment models: translation-based and aggregation-based. 2.1 Translation-based entity alignment MTransE (Multilingual Knowledge Graph Embeddings for Cross-lingual Knowledge Alignment)[ 3 ]. One of the first entity alignment models, it extends TransE[ 1 ] by learning embeddings on the individual knowledge graphs and simultaneously learning how to align the embeddings. The approach is supervised and uses a set of per-aligned entity pairs as input. JAPE (Cross-Lingual Entity Alignment via Joint Attribute-Preserving Embedding)[ 8 ]. The model builds upon MTransE by embedding the structures of the input knowledge graphs into a unified vector space and further leverages attribute correlations BootEA (Bootstrapping Entity Alignment with Knowledge Graph Embedding)[ 9 ].The model is a semi-supervised approach to bootstrap likely alignments. It builds upon other entity alignment models and iteratively extends the set of aligned entity pairs. Even if the results are somewhat better than those achieved by previous models, this comes at the price of a slower model. KDCoE (Co-training Embeddings of Knowledge Graphs and Entity Descriptions for Cross-lingual Entity Alignment)[ 2 ]. The model leverages semi-supervised cross-lingual learning using entity descriptions for entity alignment. The descriptions are embedded using an attentive gated recurrent unit encoder, a form of recurrent neural network. BERT-INT (a BERT-based Interaction Model For Knowledge Graph Alignment)[ 10 ]. The model consists of a BERT model that is used as a basic representation unit to embed the name, description, attribute and value of an entity, and an interaction model built upon the BERT embeddings to compute the interactions between these embeddings 2.2 Aggregation-based entity alignment RDGCN (Relation-Aware Entity Alignment for Heterogeneous Knowledge Graphs)[ 12 ]. The model extends graph convolutional neural networks for entity embeddings such that they can handle different relations in a better, more informative way. A dual graph whose vertices are the relations of the two input graphs is created. Embeddings are trained using a graph neural network architecture that integrates the original knowledge graph and the dual graph. RREA (Relational Reflection Entity Alignment)[ 6 ]. The model unifies existing entity alignment methods into a common framework and trains relation specific embeddings for each entity. NMN (Neighborhood Matching Network for Entity Alignment) [ 13 ]. The model can be seen as an improvement of the RDGCN model. It is based on weighted 1-hop neighbor sampling with attention weights. Individual entities are classified using ideas based on convolutional kernels between node neighborhoods. AttrGNN (Exploring and Evaluating Attributes, Values, and Structures for Entity Alignment)[ 5 ] .The entity alignment model is built on a novel method called Attributed Graph Neural Network (AttrGNN) that incorporates both relation triples and attribute triples. 3 METHODOLOGY This study develops a hybrid mapping framework to align codes from disparate medical terminologies - CPT, NDC, LOINC, and ICD-9 - to the SNOMED CT ontology. The framework leverages publicly available reference sets (refsets) curated by domain experts, supplemented by newly proposed algorithmic ranking utilizing contextual graph embeddings for 1-to-M mappings as well as text embeddings for incomplete mappings. 3.1 Dataset Our mapping framework relies on a diverse dataset drawn from established clinical coding systems. These were sourced from public repositories and official endpoints. For unmapped codes, candidate SNOMED concepts were restricted to semantically relevant sub-hierarchies to ensure computational feasibility. The following enumerates the scale and code count for each mapping. (1) SNOMED CT (Systematized Nomenclature of Medicine–Clinical Terms) is a comprehensive, multilingual clinical terminology interconnected via hierarchical and associative relations (e.g., "is-a" and "caused by"). It serves as the target structure that organizes medical knowledge into a hierarchical graph of concepts and relationships, enabling standardized representation of clinical data in electronic health records. It is comprised of 470,800 SNOMED CT codes from a public endpoint, forming an ontology graph with nodes and relations. 2
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 Patient Context-Aware Medical Entity Alignment Conference acronym ’XX, June 03–05, 2018, Woodstock, NY (2) CPT codes (Current Procedural Terminology) are standardized numeric identifiers maintained by the American Medical Association for reporting medical, surgical, and diagnostic procedures (e.g., 99213 for an established patient office visit). Of 11,500 CPT codes, 3,000 exhibit one-to-one refset mappings to 2,655 SNOMED procedure concepts; no one-to-many mappings exist, leaving 8,420 unmapped. Approximately 100,000 SNOMED concepts descending from the “Procedure” root node were selected as mapping candidates. (3) NDC codes (National Drug Codes) are unique 10or 11-digit identifiers assigned by the U.S. Food and Drug Administration to human prescription drugs, over-the-counter medications, and biologics (e.g., 1671-4029-904 for amoxicillin capsules). Among 950,000 NDC codes, publicly available refsets map 525,000 to 4,665 unique SNOMED concepts (461,000 one-to-one and 86,000 one-to-many mappings), leaving 425,000 unmapped. Candidates for unmapped NDCs are ∼ 50,000 descendants of the “Pharmaceutical / biologic product” SNOMED root node. Different NDC drug codes frequently represent the same substances, therefore they map to relatively few SNOMED codes. (4) LOINC codes (Logical Observation Identifiers Names and Codes) provide universal identifiers for laboratory and clinical observations, often as compositional strings (e.g., code 4548-4 has description “Hemoglobin A1c/Hemoglobin.total in Blood”). A public refset mapping over 90,000 most commonly used LOINC codes decomposes them into multiconcept SNOMED mappings without ranking. The above example yields SNOMED concepts for “Hemoglobin”, “Blood”, “Measurement”, and “Point in time”. It is worth pointing out that the dash followed by a single digit at the end of each code is a checksum, not a code subcategory, and can be removed without loss of information. (5) ICD-9 (The International Classification of Diseases, Ninth Revision), is a World Health Organization standard for coding diagnoses and procedures in healthcare billing and statistics (e.g., 428.0 for congestive heart failure). Refsets cover 14,000 ICD-9 diagnosis codes, with 8,350 exhibiting one-to-one mappings to SNOMED CT representing clinical findings and 2,630 mapping to between 2 and 1,436 SNOMED candidates (median 6). 3.2 Entity Alignment Procedures The aim of this study is to provide strategies for performing entity alignment (mapping from various coding systems) to the SNOMED CT ontology in a code-agnostic manner,. Afterwards, we show how specific code datasets were aligned using those approaches. It is important to underline that no strategy is needed when a code is present in a publicly available refset with a dedicated 1-to-1 mapping, where a direct mapping can be returned. However, if that is not the case, we propose strategies for candidate code filtering,missing mapping imputation,ranking without context, and, most importantly, ranking with context. 3.2.1 Candidate Code Filtering. Whenever returning only the most informative SNOMED candidate codes allowing differentiation of patients whom they are assigned to is required, it is advantageous to filter out those candidates from the refset that appear in every mapping. A group of such uninformative codes in the SNOMED CT ontology are all descendants of the "observable entity" and "qualifier value" nodes. Therefore, descendants of these node types were always filtered out. Fig. 1 shows the workflow demonstrated on an example LOINC code mapping for clarity, although this method can be applied to any refset. 3.2.2 Missing Mapping Imputation. Missing refset mappings are imputed following the procedure from Fig. 2. The objective is to train a Logistic Regression model that will decide if a connection between a pair of codes should imputed or not. This decision is based solely on the highest cosine similarity between any pair of embedded textual descriptions belonging to different codes. All codes usually have a few alternative descriptions representing their meaning using different words. Text descriptions were embedded using the medBERT[ 7 ] transformer-based language model that was post-trained specifically on medical terminology. Importantly, the training set for the Logistic Regression model contained positively and negatively labeled pairs. All code-SNOMED pairs present in the related refset were given a positive label (with 1-to-M mappings split into M independent pairs) and an equivalent number of negative pairs was generated by choosing two random nodes from the SNOMED CT ontology and ensuring they are not present in the positive pairs. 3.2.3 Ranking without Context. Codes from 1-to-M refsets were ranked using a Logistic Regression model trained with the same procedure as was shown in Fig. 2, however only 1-to-1 mappings were used to generate positive pairs used to train the model. Relevantly, 1-to-M pairs were not included in the training, because using them to rank those same pairs would bias results. Afterwards, the Logistic Regression class probability predicted by the model obtained from the highest cosine pair similarity was used to rank the candidates. 3
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 Conference acronym ’XX, June 03–05, 2018, Woodstock, NY ..., et al. Fig. 1. The process of filtering out irrelevant candidates is explained on an example LOINC code mapped to a set of candidate SNOMED codes. Fig. 2. A Logistic Regression model is trained on labeled pairs (any Code->SNOMED code), where positive pairs come from a refset and synthetic negative pairs are generated. 4
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 Patient Context-Aware Medical Entity Alignment Conference acronym ’XX, June 03–05, 2018, Woodstock, NY Fig. 3. All candidate codes are ranked using context nodes and a similarity metric. Relative code confidence is calculated for every prediction. 3.2.4 Ranking with Context. The main contribution of this study is a ranking procedure that makes use of patient context usually represented as electronic health records (EHR) to inform the ranking of 1-to-M mappings. Given a patient context — a list of codes aligned to SNOMED CT beforehand — it is possible to narrow down the number of relevant candidates by finding which candidates are most closely related to the context nodes in the SNOMED CT ontology graph. Consequently, three approaches for calculating the closeness of relations between candidate codes and context codes are investigated with a method to combine them mentioned later. Firstly, the cosine similarity between medBERT embeddings of textual descriptions can be applied as in the aforementioned methods. However, such an approach does not leverage the knowledge encoded in the ontological connections between nodes in the SNOMED CT graph. Each node is not only related to other nodes via hierarchy but also relations. An alternative way to calculate closeness including all SNOMED relations is to calculate the shortest path between each pair of nodes in the ontology graph. This task is expected to be computationally exhaustive, given that SNOMED CT has 470 thousand nodes with a distribution of shortest path lengths between [2,13] (median 6). Moreover, this approach limits the closeness metric to integer values only. An improvement in speed can be achieved by embedding the entire SNOMED CT ontology graph using Node2Vec[ 4 ] graph embeddings, which is done by generating random walks through graph nodes and treating them as "sentences" used to train a modified Word2Vec[ 11 ] model. The resulting graph embeddings are useful for approximating how closely related any pair of nodes in the graph is in a computationally efficient manner. Additionally, cosine similarity used as the closeness metric takes fractional values allowing for more expressive comparisons. Once a similarity metric — using medBERT embeddings, shortest path distance, or Node2Vec graph embeddings — is chosen, previously aligned context codes are used to rank the candidates and a relative prediction confidence is calculated following the process in Fig.3. The process starts by computing similarities 𝑑(𝐾𝑖,𝐶𝑗) between each candidate code 𝐾𝑖∈ {𝐾1, 𝐾2, . . . , 𝐾𝑛} and context code 𝐶𝑗∈ {𝐶1,𝐶2, . . . ,𝐶𝑚} using the selected similarity metric transformed to ensure that higher values indicate greater semantic proximity. Afterwards, for each context 𝐶𝑗 code, the distance vector to all candidates is calculated as d 𝑗=[𝑑(𝐾1,𝐶𝑗), 𝑑(𝐾2,𝐶𝑗), . . . ,𝑑(𝐾𝑛,𝐶𝑗)] . Since no assumptions about the distribution of values in d 𝑗 can be made, relative fit scores (normalized [0,1]) 𝑠𝑖,𝑗 are derived 5
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 Conference acronym ’XX, June 03–05, 2018, Woodstock, NY ..., et al. using percentile ranks 𝑟𝑖,𝑗 following Eq. 1. 𝑠𝑖,𝑗 =1−𝑟𝑖,𝑗 −1 𝑛−1(1) While there are many ways to combine the fit scores 𝑠𝑖,𝑗 to obtain a ranking, we assume that in real-world scenarios only a handful of context codes are closely related to a few candidate SNOMED codes, while the rest of the context is random, unrelated and its presence should be ignored. To include context importance weight 𝑤𝑗 is computed in Eq. 2for each candidate index 𝑗using the inter-quartile range (IQR) of d𝑗, to ensure the measurement’s insensitivity to outliers or non-normality. 𝐼𝑄𝑅𝑗=𝑄3(d𝑗) − 𝑄1(d𝑗)(2) With 𝑄1 and 𝑄3 being the 25th and 75th percentiles, the context importance weight 𝑤𝑗 is calculated as in Eq. 3, which ensures that contexts with IQR𝑗=0(perfect clustering) contribute nothing. 𝑤𝑗=max(IQR𝑗,0)(3) The ranking score 𝑆𝑖for candidate 𝐾𝑖is then the weighted average percentile-based fit score across contexts from Eq. 4. 𝑆𝑖= Í𝑚 𝑗=1𝑤𝑗𝑠𝑖,𝑗 Í𝑚 𝑗=1𝑤𝑗+𝜖(4) We add 𝜖= 10 −6 for numerical stability. If all 𝑤𝑗= 0, we default to unweighted means (not in the formula). This formulation amplifies contributions from high-spread contexts, where percentile differences reflect meaningful separations, while suppressing uniform contexts that fail to differentiate candidates. 3.3 Procedure-Code Assignment The entity alignment procedures defined above were assigned to each code depending on the completeness of their refset and other domain knowledge. (1) The refsets of LOINC codes were considered sufficient, so only Candidate Code Filtering was applied. (2) Missing Mapping Imputation was applied to CPT and NDC codes that were not handled by the refset. Additionally, Ranking without Context was applied to all the 1-to-M mappings, since all candidates were exclusive and needed to be ranked. (3) Ranking with Context was applied exclusively to 1-to-M mappings of ICD-9 codes, which are often very generic in meaning and refsets often map them to a whole subtree of hundreds of more specific SNOMED codes. Patient context allows narrowing down the number of relevant candidates. 3.4 Ranking Confidence Calculation To inform about the reliability of rankings and imputations, we provide a confidence calculation strategy for each type of code imputation. Apart from assigning 100% confidence to all 1-to-1 refset mappings, we follow the following methodologies: (1) After filtering, the remaining candidate SNOMED codes are all returned with 100% confidence, since only together do they describe the full meaning of a single LOINC code. (2) The confidence score for both the ranked and imputed CPT and NDC codes is the Logistic Regression class probability. This confidence is calculated for each candidate independently of what the other candidates are. (3) To assess confidence of each candidate when ranking ICD-9 codes, we introduce a per-candidate metric 𝜅𝑖∈ [ 0 , 1 ] that emphasizes positive outlier behavior — candidates excelling markedly in at least one discriminative context receive high confidence, while those performing consistently near the median garner low values. For each 𝑗 , we compute the positive deviation from the expected median percentile as in Eq. 5using 𝑠𝑖,𝑗 from Eq. 1and 𝑤𝑗 from Eq. 3. 𝛿𝑖,𝑗 =max(𝑠𝑖,𝑗 −0.5,0)(5) The confidence is then the scaled maximum weighted deviation from Eq. 6. 𝜅𝑖=2·max 𝑗=1,...,𝑚 𝛿𝑖,𝑗 ·𝑤𝑗(6) This formulation assigns 𝜅𝑖= 1to a candidate achieving 𝑠𝑖,𝑗 = 1in a context 𝑗 that dominates the total weight ( ˜ 𝑤𝑗≈ 1), as in the limiting case where all candidates tie across contexts except one high-spread context favoring a single outlier. Mediocre candidates, with 𝛿𝑖,𝑗 ≈ 0everywhere, receive 𝜅𝑖= 0; partial standouts in low-weight contexts 6
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 Patient Context-Aware Medical Entity Alignment Conference acronym ’XX, June 03–05, 2018, Woodstock, NY yield intermediate values. This metric thus quantifies ranking robustness by rewarding decisive, context-specific superiority. 4 EXPERIMENTS 4.1 Candidate Code Filtering The performance of Sec. 3.2.1 is not measured, since this deterministic filtering strategy is applied to an already correct mapping. 4.2 Missing Mapping Imputation and Ranking without Context The performance of Sec. 3.2.1 and Sec. 3.2.2 is measured by training a Logistic Regression model following strategies outlined in that section. The discriminative power of each of the four models is analyzed — those fitted only to 1-to-1 mappings as well as combined 1-to-1 and 1-to-M mappings trained on CPT or NDC refsets. 4.3 Ranking with context 4.3.1 Node2Vec graph embedding hyperparameter tuning. To find the optimum hyperparameter settings for the Node2Vec model, the Spearman correlation rho 𝜌 was calculated between the shortest path distances of nodes in the SNOMED CT ontology graph and their embedded node similarity. Since nodes with a smaller distance should have a higher cosine similarity, embeddings with 𝜌 values closer to -1 are considered better. Experiments were run on a subtree of SNOMED CT with only 3000 tightly connected nodes (to save time). The Node2Vec model was run with hyperparameter values p=1 (for less returns) and q=0.5 (for medium exploration/exploitation balance), with one run trying 10 random walks per node with walk lengths 10, 15, 20, and another trying 10, 20, 30 walks per node all of length 10. Each individual run (3+3) was evaluated on 50,000 random node pairs after training for 10 epochs. The best hyperparameter setting was trained on the whole SNOMED CT graph of 470,000 nodes. Only a single epoch of the best hyperparameter setting was trained and used in the final model. This stems from a long runtime, since the Node2Vec algorithm does not benefit from GPU acceleration[4]. 4.3.2 Synthetic test set generation. Since no labeled set of ranked candidates with contextual codes was available, two synthetic test sets were generated to test the performance of the contextual ranking method. Each test set was generated starting by choosing 100 random 1-to-M mappings from the ICD-9 refset. Then, one candidate from the M available was selected and context that would be more closely connected to it than any of the other candidates was generated. (1) The first test set generated a single context node within a shortest-path-distance of 1 from the selected candidate. (2) Meanwhile, the second test set, on top of the single context node, additionally added 10 random nodes from the SNOMED CT graph simulating unrelated context to test if our model will be misled by it. The contextual ranking model was benchmarked on these two test sets for each of the three similarity metrics proposed in Sec. 3.2.3 measuring the Hits@1 and Hits@5 performance metrics. To obtain an estimate of the performance metrics’ repeatability, the whole process starting from test set generation was repeated 10 times. 5 RESULTS 5.1 Missing Mapping Imputation and Ranking without Context The discriminative power of the Logistic Regression models applied in each of the four scenarios from Sec. 4.2 is shown in Figs. [4-5]. The textual embeddings of NDC code descriptions from Fig. 4allowed for a much more discriminative categorization of node pairs into positive (mapped) and negative (unrelated) classes than the embeddings from Fig. 5. However, more positive CPT-SNOMED code pairs shared literally the same description than the NDC-SNOMED code pairs. 5.2 Ranking with context Fig. 6shows the results of hyperparameter tuning of Node2Vec graph embeddings on a subset of the SNOMED CT ontology graph with 3,000 nodes. In both comparisons, the setting of p=1, q=0.5, 10 walks of length 10 per node were the optimum setting. Therefore, the final graph embeddings trained on all 470,000 SNOMED CT nodes were trained with these settings. Consequently, the results obtained by the contextual ranking method including all three similarity implementations are shown in Table 1. As can be seen, both similarity metrics that considered contextual graph relations outperformed the approach of using only code description similarity. Moreover, using Node2Vec graph embeddings matched the performance of 7
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 Conference acronym ’XX, June 03–05, 2018, Woodstock, NY ..., et al. Fig. 4. While not many NDC and SNOMED codes shared equivalent descriptions, there is less overlap between classes resulting in a high AUC. Subfig. a) shows the model used for 1-to-M ranking, while b) for imputing missing links. Similarity metric Test set (below) Performance metric (below) medBERT Text Embeddings Shortest SNOMED Graph Distances Node2Vec Graph Embeddings Set1 Hits@1 0.06-0.12 0.44-0.52 0.37-0.45 Set1 Hits@5 0.53-0.63 0.82-0.88 0.82-0.88 Set2 Hits@1 0.21-0.27 0.29-0.35 0.28-0.36 Set2 Hits@5 0.69-0.75 0.75-0.79 0.75-0.81 Table 1. Table showing the performance of contextual ranking for each of the three similarity metric implementations. Showing obtained metrics with +- 1 std (10 reps). Set1 is defined at 1, while Set2 is at 2. calculating the shortest path after training for only 1 epoch. The graph embedding approach can perform 1000 rankings in 1 sec, while the shortest path method takes 8 minutes for the same number of rankings. 6 DISCUSSION The results of this study demonstrate the efficacy of a hybrid mapping framework that integrates expert-curated refsets with algorithmic enhancements, including text-based embeddings from medBERT and graph-based approximations via Node2Vec, to address the challenges of aligning disparate medical terminologies to SNOMED CT. Notably, the superior performance of graph-informed similarity metrics—both shortest-path distances and Node2Vec embeddings—over pure textual embeddings in contextual ranking tasks (Table 1) underscores the value of leveraging the ontological structure inherent in SNOMED CT. In our framework, Node2Vec’s ability to approximate shortest paths enables efficient 1-to-M ranking for ICD-9 codes, where generic diagnoses benefit most from patient context. The discriminative power of Logistic Regression models for imputation and non-contextual ranking (Figs. 4and 5) highlights domain-specific nuances: NDC mappings exhibit cleaner class separation due to diverse pharmaceutical descriptions, while 8
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 Patient Context-Aware Medical Entity Alignment Conference acronym ’XX, June 03–05, 2018, Woodstock, NY Fig. 5. Many procedure descriptions of CPT and SNOMED codes were equivalent resulting in a similarity of 1.0, even though the overall overlap between classes is larger than for NDC codes. a) shows the model used for 1-to-M ranking, while b) for imputing missing links. Fig. 6. The plots show the Spearman correlation 𝜌 between shortest path distances and cosine similarities of node-pairs in a subtree of SNOMED CT obtained by each of the 6 tested hyperparameter settings. (Lower values are better.) CPT’s frequent verbatim code description overlaps with SNOMED procedures inflate similarities, while yielding lower overall AUCs. This suggests that textual embeddings alone suffice for procedureand drug-centric alignments but falter in generic diagnosis-heavy scenarios without graph context, as evidenced by the 0.06-0.12 Hits@1 for medBERT in Set1 versus 0.37-0.45 for Node2Vec. Limitations of this work include reliance on synthetic test sets for contextual evaluation, which, while controlled, may not fully capture the noise and multimodality of real EHR data. Additionally, the framework’s code-agnostic design assumes access to refsets and sub-hierarchies, which may not generalize to emerging terminologies without curation. Finally, training 9