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 A Hybrid Framework for Medical Entity Alignment STAN OSTASZEWSKI†,Institute of Data Science, Maastricht University, Netherlands ADINATH DUNDI MOHAN KUMAR, Institute of Data Science, Maastricht University, Netherlands ÖMER 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, Ömer Durukan Kılıç, Ensar Erol, Michel Dumontier, and Remzi Celebi. 2025. A Hybrid Framework for Medical Entity Alignment. In .ACM, New York, NY, USA, 11 pages. https://doi.org/10.5281/zenodo.17772412 1 INTRODUCTION In Europe and many other countries around the world, the standards used for representing health data vary greatly. Different healthcare vocabularies or ontologies often contain complementary or overlapping information about the same medical concepts. 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 different systems or countries. The AIDAVA project[ 5 ] aims to integrate patient health data collected from different countries and systems into a personal knowledge graph structure and to develop solutions for the interoperability issues that arise in this context. One of the main interoperability issues when integrating patient data arises from the semantic ambiguity created when they are represented using heterogeneous medical terminologies, which complicates the process of accurately aligning and interpreting concepts across systems[ 1 ]. Entity alignment, also known as ontology matching or entity resolution, solutions aim 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 semantically richer, more complete, and more interoperable knowledge graphs. To mitigate this issue, many methods for the alignment of terms or ontologies are proposed [ 6 ]. In particular, frequently used 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 SWAT4HCLS ’26, March 23 – 26, 2025, Amsterdam, Netherlands ..., et al. terminologies such as ICD, LOINC, CPT and NDC are converted into their SNOMED CT equivalents to achieve shared semantics. In this work, as part of the AIDAVA project, we present a hybrid alignment framework in which we developed three main approaches for different cases. SNOMED CT ontology is used as the target ontology because of its comprehensive medical coverage and rich cross-terminology mappings. Since medical codes in patient data often can be mapped to multiple potential matches, dynamic alignment is more preferable over static mappings. The first approach filters multiple SNOMED CT candidate codes for a concept from other terminologies (e.g., LOINC) by using the entity’s semantic type to narrow the matches. The second approach identifies the closest meaningful SNOMED CT code for an entity by learning or embedding the structure and semantics of the terminology. This also applies to the case when no SNOMED CT code for an entity is available in the existing reference mappings. The third approach selects the most appropriate SNOMED CT code by utilizing the patient’s contextual information, which is important when translating general and contextually ambiguous concepts, such as those from ICD, to SNOMED CT. 2 RELATED WORK There are two main categories of entity alignment models using knowledge graphs or their embeddings: translation-based and aggregation-based. 2.1 Translation-based entity alignment MTransE (Multilingual Knowledge Graph Embeddings for Cross-lingual Knowledge Alignment)[ 4 ]. One of the first entity alignment models, it extends TransE[ 2 ] 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)[ 11 ]. 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)[ 12 ].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)[ 3 ]. 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)[ 13 ]. 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)[ 15 ]. 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)[ 9 ]. 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) [ 16 ]. 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)[ 8 ] .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 alignment framework (available at https://github.com/AIDAVA-DEV/entity-alignment-public) 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. 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 A Hybrid Framework for Medical Entity Alignment SWAT4HCLS ’26, March 23 – 26, 2025, Amsterdam, Netherlands 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) 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 Approaches The aim of this work is to propose strategies for aligning entities from various coding systems with the SNOMED CT ontology in a code-agnostic manner. We show the application of these strategies on specific datasets. It is important to note that these strategies are needed when a mapping for code is not present in a publicly available reference set (refset) with a dedicated 1-to-1 mapping, otherwise the corresponding 1-to-1 mapping can be retrieved directly. We propose strategies for candidate code filtering,missing mapping imputation, and, most importantly, ranking with context. These are explained in the following sub-sections. 3.2.1 Candidate Code Filtering. Whenever 1-to-1 refsets map to a list of SNOMED codes (used together to describe the original code’s meaning), it is important to filter out those SNOMED codes, which are present in all mappings, since they do not convey unique meaning that could be used to differentiate the original codes. These non-informative SNOMED codes are the 362981000 "qualifier value" code with all its desdendants as well as the 363787002 "observable entity" code. Fig. 1shows the workflow applied to an example LOINC code mapping for clarity, although this method can be applied to any refset. 3.2.2 Ranking without Context. The mappings that are missing in the refset, are imputed following the approach from Fig. 2. We trained a Logistic Regression model that can decide if a connection between a pair of codes should be imputed or not. The model make this decision based 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 text. Text 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 SWAT4HCLS ’26, March 23 – 26, 2025, Amsterdam, Netherlands ..., 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. descriptions were embedded using the medBERT[ 10 ] transformer-based language model that was post-trained specifically on medical terminology. The training set for the Logistic Regression model included positively and negatively labeled mapping pairs. All code pairs present in the related refset were assigned a positive label (with 1-to-M mappings split into M independent pairs) and an equivalent number of negative labels was generated by choosing two random codes — one from the original terminology and one from SNOMED CT ontology — and ensuring they are not present in the positive pairs. 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. 1-to-M pairs were not included in the training because using them to rank those same pairs would create bias. Afterwards, the Logistic Regression class probability predicted by the model obtained from the highest cosine pair similarity was used to rank the candidates. 3.2.3 Ranking with Context. Another proposed approach is based on a ranking procedure that makes use of patient context usually represented as electronic health records (EHRs) to inform the ranking of 1-to-M mappings. Given a patient context — defined as a list of codes from their EHRs mapped 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. We investigate three methods for measuring the closeness of relations between candidate codes and context codes. First method is the cosine similarity between medBERT embeddings of textual descriptions, as mentioned before in Section3.2.2. However, such a calculation does not leverage the rich ontological structure of SNOMED CT. Each node is connected not only hierarchically but also through axiomatic relations. A second method incorporates all SNOMED relations by computing the shortest path between node pairs in the ontology graph. However, this computation becomes expensive given that SNOMED CT’s 470,000 nodes and shortest-path lengths ranging from 2 to 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 structure using Node2Vec[ 7 ] graph embeddings, which is generated by making random walks through graph nodes and treating them as "sentences" used to train a modified Word2Vec[ 14 ] model. The resulting graph embeddings can be used to approximate 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. 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 A Hybrid Framework for Medical Entity Alignment SWAT4HCLS ’26, March 23 – 26, 2025, Amsterdam, Netherlands 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. Once a similarity metric — using medBERT embeddings, shortest-path distance, or Node2Vec graph embeddings — is chosen, previously mapped codes defining context are used to rank the candidates and a relative confidence for prediction is calculated following the process shown 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 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) 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 SWAT4HCLS ’26, March 23 – 26, 2025, Amsterdam, Netherlands ..., et al. Fig. 3. All candidate codes are ranked using context nodes and a similarity metric. Relative code confidence is calculated for every prediction. 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. 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 A Hybrid Framework for Medical Entity Alignment SWAT4HCLS ’26, March 23 – 26, 2025, Amsterdam, Netherlands (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 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.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 due to the computational cost. 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[ 7 ]. 4.3.2 Synthetic test set generation. Since no labeled set of ranked candidates with patient 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. Having generated the test sets, performance testing was performed on each by passing the candidate codes with the generated context to the contextual ranking pipeline. For each test example, the rank of the code marked correct during generation was measured using the Hits@1 and Hits@5 performance metrics. 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 SWAT4HCLS ’26, March 23 – 26, 2025, Amsterdam, Netherlands ..., 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. The pipeline was benchmarked on both test sets for each of the three similarity metrics proposed in Sec. 3.2.2. To obtain an estimate of the performance metrics’ repeatability, the whole process starting from test set generation was repeated 10 times to obtain a confidence interval for the results. 5 RESULTS 5.1 Missing Mapping Imputation and Ranking without Context The discriminative power of the Logistic Regression models were analyzed for each of the scenarios from Sec. 4.2 (shown in Figs. [4-5]). The textual embeddings of NDC code descriptions shown in 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 the literal same description than the NDC-SNOMED code pairs. 5.2 Ranking with context Fig. 6shows the results of Node2Vec graph embeddings on a subset of the SNOMED CT ontology graph with 3,000 nodes after hyperparameter tuning. 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 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. 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 A Hybrid Framework for Medical Entity Alignment SWAT4HCLS ’26, March 23 – 26, 2025, Amsterdam, Netherlands 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.) Similarity metric and scores 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.370.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 scores with +- 1 std (10 reps). Set1 is defined at 1, while Set2 is at 2. 9