Modeling Complex Short EHR Visits With xLSTM and Medical Entity Enhancement for Medication Recommendation
Abstract
Medication recommendation aims to provide accurate and safe medication combinations tailored to patients’ clinical records. Existing methods suffer from two key limitations: insufficient modeling of disease–medication relationships, resulting in under-expressive medical entity embeddings, and limited capability in capturing short and complex visit sequences in electronic health records, which restricts patient representation quality. To address these issues, we propose XMERec, a dual-level medication recommendation framework that jointly models medical entity interactions and short-term visit sequences. At the instance level, XMERec integrates drug substructures with current visit conditions to generate instance-level recommendations under limited medical history. At the longitudinal level, a medical knowledge graph is constructed and leveraged by a knowledge graph convolutional network to enhance disease and medication representations, while an extended long short-term memory network models short and complex visit histories to extract key clinical patterns. Finally, instance-level and longitudinal-level predictions are fused with an association-guided correction mechanism to improve recommendation accuracy and safety. Experiments on MIMIC-III and MIMIC-IV demonstrate the effectiveness of XMERec.