Abstract

Accurate medication recommendation is central to clinical decision-making, directly determining therapeutic efficacy and patient safety. However, existing methods suffer from two key limitations: drugs are often abstracted as discrete tokens, ignoring their molecular structures and pharmacological mechanisms, and the commonly used "flat" recommendation paradigm fails to leverage the hierarchical logic of the internationally standardized Anatomical Therapeutic Chemical (ATC) classification system. To address these issues, we propose HADRec, a Hierarchy-Aware Drug Recommendation framework that integrates molecular knowledge with electronic health records (EHRs). HADRec employs LLaMA-7B to encode clinical notes for rich patient representations and ChemBERTa to encode drug Simplified Molecular Input Line Entry System strings, building a global molecular knowledge base. A cross-attention mechanism then performs deep multimodal fusion between patient states and drug features. The framework further incorporates a hierarchical predictor and a novel consistency constraint loss to enforce strict adherence to ATC logical dependencies. Extensive experiments on MIMIC-III demonstrate that HADRec achieves state-of-the-art performance across Jaccard, F1, and PR-AUC. External validation on MIMIC-IV confirms strong generalization under distribution shifts, and calibration analysis shows well-calibrated predictive confidence on MIMIC-IV with ECE = 0.04, and Brier = 0.06. Counterfactual evaluation reveals clinically aligned reasoning, disentangling disease-specific treatments from general care. Together, these results establish HADRec as a high-performance, interpretable, and clinically grounded pathway toward safe and reliable AI-driven medication recommendation.

Keywords

Subject

Publication details

Journal
Not available
Open access
Green open access

Cite this article

APA 7

Wang, J., Ling, H., Zhang, L., Wu, J., Shao, T., Wang, F., & Gao, Y. (2026). HADRec: A Hierarchy-Aware Drug Recommendation Framework by Fusing Molecular Knowledge and Electronic Health Record. https://omanscience.com/en/articles/hadrec-a-hierarchy-aware-drug-recommendation-framework-by-fusing-molecular-knowledge-and-electronic-health-record

MLA 9

Wang, Junke, et al. "HADRec: A Hierarchy-Aware Drug Recommendation Framework by Fusing Molecular Knowledge and Electronic Health Record." https://omanscience.com/en/articles/hadrec-a-hierarchy-aware-drug-recommendation-framework-by-fusing-molecular-knowledge-and-electronic-health-record.

Chicago (author–date)

Wang, Junke, Hongshun Ling, Li Zhang, Jinjing Wu, Tong Shao, Fang Wang, and Yuan Gao. 2026. "HADRec: A Hierarchy-Aware Drug Recommendation Framework by Fusing Molecular Knowledge and Electronic Health Record." https://omanscience.com/en/articles/hadrec-a-hierarchy-aware-drug-recommendation-framework-by-fusing-molecular-knowledge-and-electronic-health-record.

Harvard

Wang, J., Ling, H., Zhang, L., Wu, J., Shao, T., Wang, F. and Gao, Y. (2026) 'HADRec: A Hierarchy-Aware Drug Recommendation Framework by Fusing Molecular Knowledge and Electronic Health Record', Available at: https://omanscience.com/en/articles/hadrec-a-hierarchy-aware-drug-recommendation-framework-by-fusing-molecular-knowledge-and-electronic-health-record.

Vancouver

Wang J, Ling H, Zhang L, Wu J, Shao T, Wang F, et al. HADRec: A Hierarchy-Aware Drug Recommendation Framework by Fusing Molecular Knowledge and Electronic Health Record. https://omanscience.com/en/articles/hadrec-a-hierarchy-aware-drug-recommendation-framework-by-fusing-molecular-knowledge-and-electronic-health-record

IEEE

J. Wang, H. Ling, L. Zhang, J. Wu, T. Shao, F. Wang, and Y. Gao, "HADRec: A Hierarchy-Aware Drug Recommendation Framework by Fusing Molecular Knowledge and Electronic Health Record," https://omanscience.com/en/articles/hadrec-a-hierarchy-aware-drug-recommendation-framework-by-fusing-molecular-knowledge-and-electronic-health-record.