Previously submitted to: JMIR Formative Research (no longer under consideration since Jan 14, 2026)
Date Submitted: Sep 9, 2025
Warning: This is an author submission that is not peer-reviewed or edited. Preprints - unless they show as "accepted" - should not be relied on to guide clinical practice or health-related behavior and should not be reported in news media as established information.
LTR-ICD: A Learning-to-Rank Approach for Automatic Medical Coding
ABSTRACT
Background:
Clinical notes contain unstructured text provided by clinicians during patient encounters. These notes are usually accompanied by a sequence of diagnostic codes following the International Classification of Diseases (ICD). Correctly assigning and ordering ICD codes are essential for medical diagnosis and reimbursement. However, automating this task remains challenging. State-of-the-art methods treated this problem as a classification task, leading to ignoring the order of ICD codes that is essential for different purposes.
Objective:
In this work, as a first attempt, we approach this task from a retrieval system perspective to consider the order of codes, thus formulating this problem as a classification and ranking task. Thereby addressing the limitations of existing classifier-based approaches and improving the order-aware prediction of ICD codes.
Methods:
We propose a novel language model-based framework that integrates classification and ranking to recommend order-aware ICD codes for clinical notes. Our model consists of a classifier module which predicts diagnoses codes for an input clinical note and a generative module which is used to identify the order of the codes. Finally, a ranking algorithm integrates the outputs of both components to produce a final ranked list of recommended ICD codes. The framework is evaluated on benchmark datasets and compared against state-of-the-art multi-label classifiers using standard classification and ranking metrics.
Results:
Our results and analysis show that the proposed framework has a superior ability to identify high-priority codes compared to other methods. For instance, our model’s accuracy in correctly ranking primary diagnosis codes is ~47%, compared to ~20% for the state-of-the-art classifier. Additionally, in terms of classification metrics, the proposed model achieves a micro- and macro-F1 scores of 0.6065 and 0.2904, respectively, surpassing the previous best model with scores of 0.597 and 0.2660.
Conclusions:
Reformulating ICD coding as a combined classification and ranking task enhances both sequencing and predictive accuracy. The proposed framework provides a more effective solution for real-world automated ICD coding and has the potential to better support clinical, billing, and research applications.
Citation
Request queued. Please wait while the file is being generated. It may take some time.
Copyright
© The authors. All rights reserved. This is a privileged document currently under peer-review/community review (or an accepted/rejected manuscript). Authors have provided JMIR Publications with an exclusive license to publish this preprint on it's website for review and ahead-of-print citation purposes only. While the final peer-reviewed paper may be licensed under a cc-by license on publication, at this stage authors and publisher expressively prohibit redistribution of this draft paper other than for review purposes.