Abstract:Drug recommendation aims to formulate the most suitable medication treatment plan based on patients’ clinical consultation information. However, existing drug recommendation methods usually lack effective exploration of longitudinal and structured features in patient consultation sequences. To address this issue, this study proposes an end-to-end drug recommendation method based on structured sequence modelling with multi-source information. Specifically, this method first constructs an efficient compression encoder to depict fine-grained EHR-encoded information. Then, a recurrent attention network is designed, which captures the global dependencies in the consultation sequence through a masked attention mechanism on the temporal dimension, allowing the network to dynamically adjust the weight of historical visits during learning. This enhances the accuracy of capturing longitudinal dependencies in consultation sequences. Moreover, by introducing a graph contrastive learning strategy and a knowledge-enhanced retrieval module, the model’s capability for structured representation is improved, facilitating the understanding of the structural relationships among drugs and reducing the risk of DDI. Experimental results on real-world datasets (i.e., MIMIC-III and MIMIC-IV) demonstrate that the proposed method outperforms comparative methods across multiple performance metrics.