Skip to main content
BMC Medical Informatics and Decision Making logoLink to BMC Medical Informatics and Decision Making
. 2026 Jul 8;26:380. doi: 10.1186/s12911-026-03675-y

Graph representation and learning for drug administration prediction

Simone Cammarasana 1,✉, Giuseppe Patanè 1
PMCID: PMC13629112  PMID: 42420993

Abstract

Background

The management of drug administration to patients promotes the customisation and accuracy of the treatments, reducing the risk of ineffective therapies and negative drug effects, and improving drug efficiency and management.

Methods

We propose a graph representation learning model for predicting drug administration using the MIMIC-III database, which contains over 53K critical care admissions. We design a heterogeneous, weighted, directed, and multi-feature graph from patient demographics, diagnoses, and drug administration records. Our method uses a graph convolutional network to process node and edge features, predicting edge connections between patients and drugs. This choice enables us to analyse database properties, such as the relationship between drug administration and demographic classes, as well as the prediction accuracy with respect to drug occurrence.

Results

We analyse the results in terms of correct, false positive, and false negative edge predictions of drug-patient administration. Our method has an accuracy of Inline graphic on the MIMIC-III database, with an F1-score of Inline graphic. We discuss the training results regarding convergence and execution time, analyse the accuracy on low-occurrence drugs, and compare our method with previous work.

Conclusion

Previous work has focused primarily on query and classification tasks for feature extraction and diagnosis prediction, achieving comparable accuracy but is often limited to specific pathologies (e.g., diabetes), patient groups (e.g., pregnant women), or drug types (e.g., antibiotics). Our approach processes heterogeneous data encompassing various patient characteristics, pathologies, and drug types, providing a more comprehensive and scalable solution.

Keywords: Drugs administration, Graph convolutional network, Graph learning, Graph representation, Healthcare, MIMIC-III database

Introduction

Drug administration is a relevant task in managing patient medications. In particular, intensive care units (ICUs) manage a diverse range of patients with various diagnoses and priorities, and collect heterogeneous information from multiple sources (e.g., laboratory measurements, manual annotations from clinicians). Analysing drug administration is crucial for personalising and optimising patient therapies, minimising the risk of ineffective treatments and adverse drug reactions, and enhancing drug efficiency and management. The wide variability and complexity of both patients (e.g., differences in drug absorption and metabolism) and drugs (e.g., type and dosage), along with factors such as drug interactions, comorbidities, and disease heterogeneity, introduce significant challenges to predicting drug-patient responses. In this context, it is relevant to support clinicians in correctly monitoring patients in terms of drug administration and evaluation of potential mismanagement. Adverse drug reactions (ADRs) introduce a major challenge in contemporary healthcare, especially in the context of complex therapeutic regimens, ageing populations, and growing multimorbidity. Between 5% and 10% of patients may suffer from an ADR upon hospital admission, during their stay, or at discharge, with associated morbidity, mortality, and financial costs [1]. Polypharmacy, defined as the regular use of five or more medications, is an independent risk factor for falls and related injuries, with an incidence nearly 20% higher for those taking more than four drugs [2, 3]. Medication mismanagement occurs in 5% of patients admitted each year to more than one thousand US hospitals, with causes including insufficient pharmacy staffing and resource allocation [4].

Complex and heterogeneous clinical data about patients are stored in electronic health record (EHR) systems, which include personal details, medical histories, images, clinical reports, pathologies, and laboratory results. For example, the MIMIC-III database provides a large amount of data for processing and analysing drug administration. Processing and analysing these data is challenging and time-consuming. Artificial intelligence tools support the monitoring of drug administration to patients, allowing clinicians to reduce medication errors, the risk of adverse drug interactions and incompatibilities, the cost and effort of prescribing and evaluating drug administration, and the evaluation of patient comorbidities. Graph data structures model complex databases (e.g., MIMIC-III) representing the relationships among the entities (e.g., patient-drugs), characterising the data with both node (e.g., personal details) and edge features (e.g., amount of administered drug), allowing us to process information from different and heterogeneous databases.

Graph convolutional networks (GCNs) apply learning-based methods to graph data structures to predict interactions among the entities. GCNs are suitable for capturing complex relationships in EHR data and support the modelling and encoding of multi-entity data and their distinct attributes, preserving the complexity of the information. Unlike standard methods, GCNs allow us to integrate unstructured data (e.g., clinical notes) and gather them into a unique framework for the improvement of the accuracy of the drug administration task. Finally, graph visualisation supports the interpretability of the data (e.g., principal directions of propagation of the information). In the literature, GCNs are applied to predict patients’ interventions in ICUs (e.g., mechanical ventilation interventions) [5], patients’ readmission by analysing free text data of EHR [6], and drug-disease interactions against COVID-19 [7].

We propose a graph representation learning model for predicting drug administration using the MIMIC-III database [8], which contains over 53,000 ICU admissions data. To this end, we generate a heterogeneous weighted multi-parameter directed graph for the representation of the EHR data of the MIMIC-III database, accounting for personal, demographic, diagnostic, and therapeutic features. Then, we introduce a novel learning-based approach, and the related design and training of a graph convolutional network to predict drug administration to patients (Fig. 1). For the graph generation, we select the MIMIC-III database, which provides a large dataset of patient hospitalisations in the ICU with associated features (e.g., vital signs, medications, laboratory measurements, observations and notes charted by care providers, fluid balance, diagnostic codes, imaging reports) for more than 38K adult patients in more than 53K distinct hospital admissions. We select a set of 4K patients affected by the four main pathologies of the database (i.e., pneumonia, sepsis, congestive heart failure and coronary heart disease) and the drug administration to each patient, e.g., the type and amount of fluid intake as intravenous medications. The four main pathologies represent more than 10% of the diagnostic codes in the ICU. In particular, coronary disease is associated with approximately the 7% of the total number of admissions. We account for personal (e.g., age), demographic (e.g., religion), laboratory (e.g., drug administration occurrence and amount), and diagnostic (e.g., coronary heart disease) data. Each patient is linked with one node of each class (i.e., gender, religion, ethnicity, marital status, diagnosis, insurance), and each drug is connected to zero, one or more patient nodes (Section “Our graph learning-based method”).

Fig. 1.

Fig. 1

Pipeline of our framework. The proper data frames and the associated graph and convolutional network are generated from the MIMIC-III database. Our model is subsequently trained to predict drug-patient administration, which corresponds to edge connections between two sets of nodes, i.e., patients and drugs

For the training, we design a graph convolutional network that accounts for node features (e.g., patient’s age), edge connections (e.g., patient diagnosis), and edge features (e.g., amount of administered drug). The features of the nodes are processed through a graph convolutional layer, passed through a module composed of batch normalisation, activation function, and dropout, and aggregated to the hidden layer. Then, a second graph convolution layer is applied to generate the node output features. The edge features are processed with an edge dropout function. Then, an edge aggregator module is applied to generate 2 output features. The edge and node features are linked into a patient-drug embedding, where a multi-layer perceptron module is applied to generate the edge scoring. We train our network to predict drug-patient administration, corresponding to edge connections between two sets of nodes, i.e., patients and drugs. According to the experimental analysis (Section “Experimental results”), our method has an accuracy of 84.4%. The F1-score is 0.84, the precision is 79.9%, and the recall is 77.7%. We analyse the results for individual drug items in terms of prediction accuracy and occurrence, discuss the training results in terms of convergence and execution time, and compare our results with those of previous works. We perform the tests on the CINECA Leonardo cluster [9], and the execution time of the training is 0.1 seconds per epoch. Finally, we discuss the conclusions and future work regarding the data and model enrichment (Section “Conclusions and future work”).

Our contribution

The proposed method can be applied both as a screening strategy and a validation tool for prescribed drugs to support personalised therapies, dynamic monitoring when new medications are introduced, and identification of redundant or unnecessary drugs. Furthermore, our method supports clinicians in diagnostic inference, analysis of disease-symptom relationships, and potential correlations among drug administration and personal details (e.g., the type of insurance). Our contribution can be summarised as: (i) the generation of a heterogeneous and multi-feature graph from the MIMIC-III database; (ii) the design of a novel graph convolutional network for the prediction of drug administration to patients; and (iii) the analysis and visualisation of prediction results to support clinicians in drug management.

While previous work has largely focused either on medication recommendation from longitudinal visit sequences or on generic biomedical interaction prediction, our approach addresses drug administration prediction by defining a static heterogeneous clinical graph that accounts for patient-drug relations, demographic, diagnostic, and laboratory features. The methodological novelty of the proposed approach consists of the graph-based representation of patients, drugs, diagnoses, and patient-level contextual attributes as distinct node types, and formulates drug administration prediction as a patient-drug edge prediction problem over this multi-relational structure. This design differs from sequence-based medication recommendation methods, since it does not require longitudinal visit modelling, and it also differs from generic heterogeneous graph applications, because the graph model, edge semantics, and evaluation protocol are all directly aligned with the clinical objective of predicting patient-specific drug administration. Therefore, the main contribution of the paper is a task-oriented heterogeneous graph formulation that combines clinically interpretable graph construction, relational message passing, and edge-level patient-drug prediction within a unified framework. The proposed method is evaluated against heterogeneous graph baselines adapted to the same prediction setting, as well as dynamic medication recommendation methods, allowing us to position our static graph formulation with respect to both relational and longitudinal approaches. The generated dataset is available at https://github.com/cammarasana123/drugAdministration. To ensure reproducibility, we provide a demonstration notebook in Google Colab, showing the generation of the graph, the architecture of the graph convolutional network, and the training and testing. The results show quantitative metrics and the confusion matrix. https://colab.research.google.com/drive/1ZMmfrOeeaZkmCqg6VGAeFo6c81ouinlb?usp=sharing

Related work

Graphs and EHRs

Low-dimensional embeddings of EHR data can be obtained by separately modelling medical services, physicians, and patients applying shallow networks and graph neural networks [10], jointly performing medication recommendation and lab test imputation within the same framework. Attention mechanisms are applied to EHR data and medical ontologies to characterise hierarchical relationships [11]. A mixed pooling, multi-view and self-attention auto-encoder generates representations to predict either the risk of developing a disease or the diagnostic codes in future visits [12]. A hybrid long short-term memory (LSTM) and GNN model encodes patient status sequences and medical events to predict future prescriptions [13], exploiting both the temporal ordering of clinical events and the relational structure among medical concepts. Similarity among patients is addressed in a graph and learned by an LSTM-GNN model to predict patients’ diagnoses [14]. In [15], the spatial and temporal dependencies of EHR data generate patient diagnoses. The responses of the patients to medications, diagnosis event sequences, and outcome dependencies [16] estimate deterioration paths of chronic hepatitis B.

Graphs and drug administration

EHRs can be supplemented with additional data, such as disease, symptom, molecular data, and drug interactions [17, 18], the latter encoding medical knowledge via Markov random fields and distributed representations to capture semantic relationships among EHR entities. A probabilistic knowledge graph of EHRs encoding medical history, drug prescriptions, and laboratory examination results addresses the semantic relationships between EHR data in a shallow network embedding [19]. Meta-paths within EHR-derived knowledge graphs represent higher-order and semantically important relationships for disease classification [20]. Node features for drugs and diseases are processed with a Graph neural network (GNN) using multi-layer message-passing to predict adverse drug events [21]. The combination of recurrent and graph neural networks is applied to EHRs and integrated with drug and disease interactions to recommend effective medication combinations [22], augmenting memory networks with a drug-drug interaction graph to avoid unsafe prescriptions. Graph convolutional networks are used for drug repurposing [23], screening large databases of approved drugs and predicting potential treatments for novel diseases. A multimodal graph of protein-drug interactions [24] predicts the manifestation of side effects for a given combination of drugs, whereas unknown drug-disease associations are predicted through a heterogeneous network [25]. In [26], a multi-view drug features and edges network is addressed by modelling each drug as a node and drug-drug interactions as node labels in the network representing drug connections.

Graphs and heterogeneous data

Deep graph learning identifies signs of disease progression in biomedical images while other modalities, such as genomic features, are integrated [27], fusing histopathology and genomic representations for cancer diagnosis and prognosis within a unified framework. Magnetic resonance images are converted into graph-based structures where GNNs are employed to analyse and classify the progression of Alzheimer’s disease [28]. GNNs represent relational structures, including similarities among chest X-rays, to enhance domain-specific tasks such as disease diagnosis and localisation [29]. Weighted and undirected graphs with spatial gene expression and corresponding histopathology images are aggregated to generate embeddings of genes and investigate spatial domains, e.g., classification of cancer regions in tissues [30].

Our graph learning-based method

First (Section “Pre-processing of the MIMIC-III database for graph generation”), we discuss the generation of a heterogeneous weighted multi-parameter directed graph for the representation of the MIMIC-III database, accounting for personal, demographic, diagnostic, and therapeutic features. Then (Section “Proposed graph convolutional network”), we introduce the design and training of a graph convolutional network to predict the drug administration to a patient, accounting for both node features (e.g., patient’s age), edge connections (e.g., patient diagnosis), and edge features (e.g., amount of administered drug).

Pre-processing of the MIMIC-III database for graph generation

MIMIC-III database

The MIMIC-III - Medical Information Mart for Intensive Care [8] (Fig. 1) is a large, single-centre database comprising information about patients admitted to critical care units at a large tertiary care hospital. MIMIC-III consists of 26 tables and contains data associated with more than 38K adult patients aged 16 years or above between 2001 and 2012. Data includes vital signs, medications, observations and notes charted by care providers, laboratory measurements, fluid balance, procedure and codes, imaging reports, hospital length of stay, survival data, and more. Additional information was collected from hospital and laboratory health record systems, including patient demographics and in-hospital mortality, laboratory test results (e.g., haematology, chemistry, and microbiology results), discharge summaries and reports of electrocardiogram and imaging studies, billing-related information such as International Classification of Disease, 9th Edition (ICD-9) codes, diagnosis related group (DRG) codes, and current procedural terminology (CPT) codes. Finally, MIMIC-III includes unstructured data (e.g., free-text clinical notes).

Heterogeneous graph network from the MIMIC-III database

We account for personal, demographic, diagnostic, and laboratory data from the MIMIC-III database and generate a heterogeneous graph for our graph-based learning and prediction model. In particular, we select a subset of 4K patients affected by the four main pathologies among those registered by the ICUs as admission diagnosis: pneumonia (33% of admissions), sepsis (24% of admissions), congestive heart failure (22% of admissions), and coronary heart disease (21% of admissions). For each patient associated with every admission, we account for the demographic data: gender (i.e., male or female), religion (e.g., Catholic, Jewish), marital status (e.g., single, widowed), insurance (e.g., Medicare, private), ethnicity (e.g., white, Asian), and personal data (e.g., age). Then, we account for the laboratory events as drug administration to each patient, e.g., the fluid intake as intravenous medications. We record the occurrence and number of administrations for each event.

Through these data, we build our heterogeneous multi-feature directed and weighted graph (Fig. 2a). More precisely, the weighted graph includes eight sets of nodes: 4K patients, 4 diagnoses, 32 ethnicities, 2 genders, 5 insurances, 91 drugs, seven marital statuses, and 17 religions. Each patient is connected with one node of each category (i.e., gender, religion, ethnicity, marital status, diagnosis, insurance) through a non-weighted directed edge; then, each drug is connected to zero, one or more nodes of patients through a weighted directed edge. Each patient node is associated with a feature (i.e., the age), while each weighted edge is associated with multiple features (i.e., occurrence and amount). The full graph is composed of 18,834 positive patient-drug connections, with 4000 patients and 91 drugs. The training dataset is composed of 11,300 positive patient-drug connections and 11,300 negative patient-drug connections. Both the validation and test datasets are composed of 7534 samples. The target of the network (i.e., our prediction) is an edge between the patients of the test dataset and each drug, as we want to predict whether a drug is administered or not to a patient.

Fig. 2.

Fig. 2

(a) Our heterogeneous, directed, weighted, and multi-feature graph. Labels: patients (cyan); gender (red); religion (blue); ethnicity (grey); drug (brown); marital (purple); diagnosis (green); insurance (orange). (b) Architecture of our network

The graph includes only relations between nodes of different classes, since same-class associations (e.g., patient-patient or drug-drug edges) are either not directly available in the structured EHR data or would require additional modelling assumptions and external resources. We note that heterogeneity and multi-feature are distinct properties: heterogeneity refers to the presence of multiple node and edge types, while multi-feature refers to the fact that nodes and edges carry associated quantitative attributes. Both properties are present in our graph. Compared with larger externally enriched clinical knowledge graphs, the proposed graph is intentionally compact and task-oriented, prioritising specificity, interpretability, and portability, as it does not rely on external ontologies or auxiliary databases.

Proposed graph convolutional network

Graph neural network architecture

Our graph convolutional network operates on a heterogeneous graph whose nodes represent patients and drugs, and whose edges represent drug-patient connections. The model is trained on the training graph and evaluated by predicting held-out drug-patient links in the test set. More precisely, node features are processed through relation-specific graph convolution modules defined on the different edge types of the heterogeneous graph, and their outputs are aggregated at the destination node-type level. The features of the nodes are processed through a graph convolutional layer, passed through a module composed of batch normalisation, an activation function, and dropout (dropout rate p=0.2), and aggregated through the mean operator to the hidden layer. Then, a second graph convolution layer is applied to generate the node output features. The edge features are processed with edge dropout (p=0.2) and reduced to a two-dimensional representation using PCA, fitted on the training edge features only. The edge and node features are linked into a patient-drug embedding, where a multi-layer perceptron module is applied to generate the edge scoring. The input layer for both the nodes and the edges is defined by the number of features of our graph. The hidden and output layers of the node features are experimentally set at 64 and 32 elements. The output layer of the edge feature is experimentally set to 2 elements.

The multi-layer perceptron (MLP) is composed of three linear modules with 32 hidden features and 1 output feature, including batch normalisation, ReLU activation function and dropout (p=0.3 and 0.2 respectively between the first and second and second and third layers). The number of input features of the MLP can be adapted according to the presence of the edge features. In case edge features are processed, the input of the MLP is composed of 66 features (i.e., 32 features for the patient embedding, 32 features for the drug embedding, 2 features for the edges). Otherwise, the input of the MLP is composed of 64 features (Fig. 2b). In particular, let G = (N, E, X, W) be a directed heterogeneous graph, where N is the set of nodes representing patients and drugs, Inline graphic is the set of directed edges, Inline graphic, with Inline graphic, denotes the node feature vectors, and Inline graphic, with Inline graphic, denotes the edge feature vectors. Here, Inline graphic and Inline graphic are the dimensions of the node and edge feature vectors, respectively. The learning process is performed relation-wise on the heterogeneous graph.

Let Inline graphic denote the subset of edges of type r, and let Inline graphic be the set of edge types such that Inline graphic. For each relation Inline graphic, we consider the corresponding relation-specific subgraph Inline graphic, where Inline graphic are the edge features restricted to Inline graphic. A graph convolution operator is applied to propagate information from source nodes to destination nodes. Given the node feature matrix Inline graphic at layer l, with Inline graphic, Inline graphic, and Inline graphic, where Inline graphic is the number of input node features, the update associated with relation r is defined as Inline graphic, where Inline graphic denotes a learnable graph convolution module associated with relation r. The outputs of all relations ending at the same destination node type t are then aggregated through the mean operator as Inline graphic, where Inline graphic is the set of relations whose destination node type is t. Therefore, while the convolution associated with every single relation is GCN-like, the overall model is heterogeneous because different relation types are processed separately and then combined at the node-type level. Using the message-passing notation, the relation-specific update of node i at layer l+1 can be expressed as

graphic file with name d33e703.gif

where Inline graphic is the set of incoming neighbours of node i under relation r, Inline graphic and Inline graphic are the degrees associated with the normalised relation-specific adjacency matrix, Inline graphic is the learnable weight matrix of Inline graphic at layer l, and Inline graphic denotes the composition of batch normalisation, ReLU activation, and dropout applied after aggregation. This case corresponds to the standard symmetric GCN normalisation [31], applied relation-wise. The overall matrix form across all nodes is defined as Inline graphic, where Inline graphic is the symmetrically normalised adjacency matrix associated with relation r.

The graph is modelled as directed, where reverse edge types are included in Inline graphic to enable bidirectional information propagation. The directed formulation reflects the natural asymmetry of the considered relations (e.g., a patient is connected to a diagnosis), and has an operational role in the message-passing scheme, where edge direction determines the aggregation neighbourhood. Reverse edge types are explicitly added to Inline graphic to allow information to flow in both directions while preserving the identity of each relation. For link prediction, the loss between the target classification Inline graphic and the predicted value Inline graphic is computed over the set of positive and negative training patient-drug pairs Inline graphic through a weighted binary cross-entropy loss function as

graphic file with name d33e784.gif

where α is the ratio of negative to positive training pairs. In our balanced training set, α is set to one, making the weighted loss equivalent to standard binary cross-entropy. The weighted formulation is nevertheless retained for generality, so that the framework can be directly applied to datasets with class imbalance without any modification to the loss function.

Experimental protocol and leakage control

We apply a 60/20/20 split into training, validation, and test sets to preserve a sufficiently large training portion while maintaining separate validation and test partitions for threshold selection and final evaluation. More specifically, positive patient-drug edges are first partitioned into train, validation, and test subsets, and negative edges are then sampled separately for each split. The heterogeneous graph used during training is masked to avoid direct data leakage, so that only training patient-drug positive edges are retained, while validation and test patient-drug edges are excluded from the graph and used only for evaluation. Therefore, the model does not observe validation or test target edges during optimisation, and the decision threshold is selected exclusively on the validation set before being applied to the test set. We underline that edge features derived from historical records are only legitimate inputs when they are constructed exclusively from administrations that precede the prediction period. Using contemporaneous information, such as features that overlap with the edges being predicted, would constitute data leakage.

Training and hyper-parameters set-up

Despite some works proposing an automatic method to select the hyper-parameters [32], most of the hyper-parameters have been initialised according to [33] and then experimentally tuned to optimise the approximation accuracy and avoid over-fitting. We train our network with 200 epochs and Adam optimiser with Inline graphic, Inline graphic, ε=1 e-08, and Inline graphic, where the parameters represent respectively the decay rate for momentum, the decay rate for squared gradients, tolerance for avoiding zero gradients and improving numerical stability, and learning rate. We select ReduceLROnPlateau as an optimisation scheduler to reduce the learning rate after a maximum of 10 epochs by a factor of 0.5. Since the training time is extremely short, we do not apply an early stop criterion; instead, we monitor the model at each validation step. In particular, the best validation accuracy is achieved after 90 epochs.

Experimental results

Drugs administration prediction

Table 1 shows the quantitative metrics of the prediction of drug administration to patients, the confusion matrix and the precision-recall curve. The accuracy of our prediction is 84.4%, with an F1-weighted score of 0.844, a recall of 77.7%, and a precision of 79.9%. The area under the curve (AUC) of the precision-recall curve is 0.872. The number of true positives (TP) is 2176, true negatives (TN) is 4186, false positives (FP) is 549, and false negatives (FN) is 623. The method shows good prediction results, both in terms of true administration and false administration predictions. In our test, we have repeated the training ten times with a random selection of training/validation/test data sets, in percentages 60/20/20. The accuracy result is Inline graphic, showing that the method is robust to dataset heterogeneity. Figure 3(a) shows the chord representation of the link prediction, where the patients’ nodes are ordered according to diagnosis, gender, and insurance classes. This representation shows that the model’s accuracy is well balanced among different classes (e.g., males and females) when the full graph is trained. Figure 3(a, right), i.e., insurance-ordered, shows a larger number of red edges associated with private insurance patients. This result can be interpreted as a higher uniformity of the treatments on patients with private and governmental insurance, allowing our model to characterise the data better and improve prediction accuracy. Figure 3(b) shows the full connection image of the test dataset between 1500 patients (rows) and 91 drugs (columns) for a total of approximately 136K potential connections.

Table 1.

Top: quantitative metrics of the prediction results with the test dataset. Bottom: confusion matrix and precision-recall curve (blue line) with respect to the precision baseline (red line), with recall (x-axis), precision (y-axis)

graphic file with name 12911_2026_3675_Tab1_HTML.webp

Fig. 3.

Fig. 3

(a) Chord-based representation of link predictions for the full graph. Green/red edges represent correct/wrong predictions. Left: diagnosis-ordered patients, sepsis (i), Coronary disease (ii), pneumonia (iii), congestive heart failure (iv); centre: gender-ordered patients, male (i), Female (ii); right: insurance-ordered patients, government (i), Medicare (ii), private (iii). Dark blue items represent the drugs. (b) Full connection image between patients (rows) and drugs (columns): dark green: true link prediction; light green: true non-link prediction; dark red: false negative prediction; red: false positive prediction

Table 2 reports the prediction accuracy of two of the main frequently administered drugs (i.e., Fentanyl and D5W), and two of the main less frequent drugs (i.e., Drotrecogin Alfa and Potassium Phosphate). We underline that the method performs well on high-frequency administered drugs, e.g., more than 90% of correct predictions on administered D5W. The accuracy of the method slightly decreases with low-frequency drugs, e.g., 12 false negatives on Drotrecogin Alfa and 8 false positives on Potassium Phosphate. Through the analysis of low-frequency drugs, we mention that the model tends to accurately predict false connections, while generating more wrong predictions on true connections. For this reason, the model better fits to avoid unnecessary administration of drugs. Table 3 shows the prediction accuracy of the drug administration of our model when varying the number of nodes of the patient class. In particular, the accuracy passes from 68.7% with 50 patients to 84.4% with 4000 patients. Figure 4 shows the convergence of the training method with 50, 200, 1000, and 4000 patients. All the data sets allow our model to converge, and increasing the number of patients reduces the loss value. The execution time of the training on the CINECA cluster is 0.1 seconds per epoch on the data set with 4K patients for a total running time of 20 seconds. To further assess the robustness of the proposed method, we test two additional train/validation/test configurations (i.e., 70/15/15 and 80/10/10) and apply stratified 5-fold cross-validation. For each split, we repeat the experiment ten times under different random seeds and report mean ± standard deviation values. The results remain consistent across all settings, confirming that the proposed approach is robust to data partition and maintains stable predictive performance across different evaluation protocols (Table 4).

Table 2.

Quantitative metrics for high-occurrence and low-occurrence drugs: true positives (TP), true negatives (TN), false positives (FP), false negatives (FN). (figure): occurrences of predicted edges (y-axis) for each drug (x-axis): TP (green), TN (light green), FP (red), FN (dark red)

Drug TP TN FP FN Accuracy F1-score
D5W 422 0 39 0 91.5% 0.96
Fentanyl 227 15 24 2 90.3% 0.95
Drotrecogin Alfa 16 44 1 12 82.2% 0.71
Potassium Phosphate 4 44 8 4 80.0% 0.40
graphic file with name 12911_2026_3675_Tab2_HTML.gif

Table 3.

Prediction accuracy varying the number of patients’ nodes

Dataset 50 200 1000 4000
F1-score 0.679 0.796 0.830 0.844
Accuracy 68.7 % 78.0 % 83.1 % 84.4 %

Fig. 4.

Fig. 4

(a) Training (blue line) and validation (red line) loss function with respect to the epochs (x-axis) with a data set of 4000 patients; training loss for dataset with (b) 50, (c) 200, and (d) 1000 patients

Table 4.

Robustness analysis under different data splits and stratified 5-fold cross-validation with mean and standard deviation values

Setting AUC-ROC AUC-PR F1-Macro F1-Weighted Accuracy
60/20/20 0.924±0.013 0.872±0.015 0.833±0.033 0.844±0.024 0.844±0.011
70/15/15 0.928±0.012 0.876±0.019 0.829±0.012 0.838±0.014 0.838±0.015
80/10/10 0.930±0.005 0.878±0.011 0.836±0.004 0.846±0.005 0.846±0.007
5-fold CV 0.915±0.010 0.845±0.016 0.825±0.021 0.835±0.020 0.834±0.020

Comparison with related work

We compare several methods that account for the MIMIC-III database to perform queries, clustering, and classification. In [34], the query of structured (e.g., diagnosis, administrations) and unstructured (e.g., free-text clinical notes) data on 25K patients identifies a set of 1844 candidates for inclusion in the dialysis cohort with an accuracy of 78.4 % and 21.6 % false positives. In [35], the body site and severity modifiers are identified through a learning-based approach. In particular, a support vector machine (SVM) classifies a set of features extracted from the clinical annotations (e.g., diseases, symptoms, procedures) with an accuracy between 74% and 91%. Similarly, the analysis of clinical text through an SVM model [36] for disorder identification reaches an accuracy of 81%. A deep learning approach extracts features from free-text clinical notes [37] and performs the identification of the top-10 ICD-9 codes in the full MIMIC-III database (50K patients) with an accuracy of Inline graphic. The same task is addressed with a graph convolutional neural network [38], where the top-50 ICD-9 labels are identified with Inline graphic accuracy. Our method achieves similar accuracy results, even if we consider different data (e.g., structured vs unstructured), number of patients (i.e., 4K vs the entire data set of 50K), methodology (e.g., database query vs graph learning), and task (i.e., diagnosis vs administration identification).

We present a comparison of our method with previous work that addresses drug administration. A deep learning sequence model and a logistic regression model [39] are applied to EHR and predict medication orders with an accuracy between 50% and 75%. In [40], local order entry data and Bayesian networks automatically find multivariate associations to predict treatments for pregnant women with an accuracy of 71%. Temporal relationships between medications are identified through sequential pattern mining [41] to predict the next medication to be prescribed for a patient. The accuracy is 63.5-64.9% when predicting the generic drug (i.e., as per our method), and Inline graphic when predicting the drug class. Our method has comparable or better results with respect to previous work. We emphasise that compared methods differ in terms of data set dimension, prediction techniques, and complexity of the properties of the data set. We also include a comparison of four methods implemented on the MIMIC-III data set. We have tested Gradient Boosting [42], Random Forest [43], k-NN search [44], and Multi-layer Perceptron [45] methods. Table 5 compares the quantitative metrics, and Fig. 5 shows the related precision-recall curves. The compared methods yield low accuracy results according to all the quantitative metrics. For example, the random forest method has an accuracy of 57.2%, compared to the 84.4% of our method. In particular, these machine learning methods do not correctly process heterogeneous and multi-feature data.

Table 5.

MIMIC-III: comparison with related methods under the 60/20/20 dataset split. SafeDrug-52 is evaluated on the mapped 52-drug subset only

Method AUC-ROC AUC-PR F1-Macro F1-Weighted Accuracy
Gradient Boosting 0.604±0.005 0.575±0.006 0.433±0.007 0.402±0.006 0.588±0.006
MLP 0.516±0.007 0.521±0.008 0.336±0.010 0.340±0.009 0.503±0.005
Random forest 0.577±0.004 0.563±0.005 0.413±0.006 0.386±0.007 0.572±0.006
k-NN 0.512±0.008 0.504±0.009 0.329±0.012 0.313±0.011 0.498±0.010
HHGAT 0.658±0.010 0.465±0.007 0.569±0.006 0.552±0.006 0.579±0.005
GAMENet 0.898±0.004 0.841±0.010 0.792±0.004 0.804±0.003 0.801±0.004
SafeDrug 0.874±0.007 0.809±0.007 0.771±0.007 0.789±0.007 0.792±0.007
SafeDrug-52 0.926±0.003 0.887±0.004 0.830±0.005 0.838±0.005 0.837±0.005
Our Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic

Fig. 5.

Fig. 5

Comparative precision-recall curves on MIMIC-III of the proposed method (a), The four standard machine-learning baselines (b-e), and the graph-based/dynamic baselines (f-i)

We compare our heterogeneous graph model with three further models (Table 5). Hyperbolic Heterogeneous Graph Attention Networks (HHGAT) [46] extend heterogeneous graph attention models by learning node representations in hyperbolic space while accounting for meta-path instances to capture heterogeneous semantic relationships. Graph Augmented Memory Networks (GAMENet) [22] is a dynamic longitudinal medication recommendation model that exploits multiple visits of the same patient through a graph-augmented memory mechanism. SafeDrug [47] is a dynamic longitudinal medication recommendation model that incorporates explicit pharmacological priors through molecular graph encoders and drug-drug interaction control. Our method significantly outperforms HHGAT across all metrics, indicating that directly applying a meta-path attention model to our heterogeneous graph is substantially less effective than the proposed relational graph convolutional design. Then, our method has better results than both GAMENet and SafeDrug across all metrics in the full 91-drug setting, achieving an AUC-ROC of 0.924 and an accuracy of 84.4% compared to 0.898 and 80.1% for GAMENet and 0.874 and 79.2% for SafeDrug. As an additional analysis, SafeDrug-52 restricts the evaluation to the drug subset for which Anatomical Therapeutic Chemical (ATC)-based prior information is fully available. In this reduced setting, SafeDrug reaches an AUC-ROC of 0.926, which marginally exceeds our full-setting value; however, since this result is obtained on a restricted subset, it is not directly comparable with the full 91-drug evaluation, and our method remains the most robust solution in the realistic full-vocabulary setting.

Table 5 summarises the quantitative metrics and Fig. 5 shows the precision-recall curves of the tested methods. Overall, the proposed graph-based model achieves stronger quantitative results and better precision-recall performance across the recall range, consistently outperforming previous work. Table 6 reports the split sensitivity of our method and the compared methods, including the five-fold cross-validation setting. The proposed method remains stable across the three train/validation/test splits, with accuracy ranging from 0.838±0.015 to 0.846±0.007, and obtains 0.834±0.020 under five-fold cross-validation. A similar stability is observed for GAMENet (0.792±0.004-0.801±0.004; five-fold CV: 0.797±0.006) and SafeDrug-91 (0.791±0.002-0.798±0.007; five-fold CV: 0.794±0.008). Finally, we perform a hyperparameter tuning analysis for the MLP method. The MLP is implemented as a feature-only non-relational baseline using patient and drug node attributes, with the decision threshold selected on the validation set. We vary the hidden architecture, dropout rate, learning rate, and weight decay (Table 7). The calibrated sensitivity results remain close to the MLP baseline results: across the tested configurations, AUC-ROC ranges from 0.501 to 0.526, while AUC-PR ranges from 0.502 to 0.522. The best AUC-ROC and AUC-PR values therefore improve only marginally over the baseline MLP results, and the F1-weighted score remains in the range 0.323–0.357. Therefore, the MLP remains substantially below the proposed graph-based model, suggesting that the performance gap is mainly due to the absence of heterogeneous relational message passing.

Table 6.

Accuracy comparison between our method and previous work, across different dataset split configurations and five-fold cross-validation (CV)

Method 60/20/20 70/15/15 80/10/10 5-fold CV
Gradient Boosting 0.588±0.008 0.592±0.006 0.595±0.007 0.591±0.009
MLP 0.503±0.005 0.514±0.004 0.509±0.002 0.509±0.008
Random forest 0.572±0.006 0.576±0.005 0.579±0.006 0.575±0.008
k-NN 0.498±0.010 0.502±0.009 0.505±0.012 0.501±0.012
HHGAT 0.579±0.005 0.585±0.005 0.587±0.009 0.584±0.010
SafeDrug-91 0.792±0.007 0.791±0.002 0.798±0.007 0.794±0.008
SafeDrug-52 0.837±0.005 0.846±0.003 0.850±0.003 0.845±0.006
GAMENet 0.801±0.004 0.797±0.003 0.792±0.004 0.797±0.006
Our 0.844±0.011 0.838±0.015 0.846±0.007 0.834±0.020

Table 7.

MLP hyper-parameter sensitivity analysis

Hidden layers Dropout LR Weight decay AUC-ROC AUC-PR F1-Weighted
64 0.0 Inline graphic 0 0.518 0.518 0.323
64 0.2 Inline graphic Inline graphic 0.526 0.522 0.344
128–64 0.2 Inline graphic Inline graphic 0.501 0.502 0.340
128–64 0.4 Inline graphic Inline graphic 0.519 0.509 0.351
256–128 0.2 Inline graphic Inline graphic 0.516 0.517 0.353
256–128 0.4 Inline graphic Inline graphic 0.520 0.519 0.357

Set-up and software

Our pipeline is developed in Python through several libraries. The database [8] is provided through comma-separated values files. Then, the files are pre-processed through the pandas [48] library to generate the proper data frames. Pytorch [49] and the Deep Graph Library [50] generate both the heterogeneous graph and the graph convolutional network. Finally, HoloViews [51] is used to visualise the prediction results. The training of the model is performed on the CINECA Leonardo cluster, at the 7th position in the “top500” list [9]. The cluster comprises two modules: the data-centric module is composed of 1536 nodes, each based on a dual socket of 56 cores of Intel Sapphire Rapids CPUs (Inline graphic), while the booster module uses 3456 nodes and it is based on BullSequana XH2135 supercomputer nodes, each composed of four accelerators Nvidia custom Ampere GPU 64GB HBM2 and a single CPU Intel Xeon 8358 with 32 cores (Inline graphic). The module provides 110,592 cores and a Inline graphic (i.e., theoretical peak performance) of 304.47 PFlop/s.

Discussion

Our analysis shows that graph neural methods provide a better representation of large, complex, and heterogeneous data, effectively handling different levels of connections and hierarchies (e.g., the temporal progression of a disease, related comorbidities, family history), multi-feature elements (e.g., disease parameters), and weighted connections among data points. Compared with other approaches such as data mining (e.g., cluster analysis, decision trees), regression (e.g., logistic regression), and learning-based methods (e.g., deep learning), graph neural methods can process non-Euclidean data, capture intricate relationships among entities, scale efficiently to large and complex datasets, handle multi-feature data with varying or incomplete properties, and perform real-time queries.

The main novelty of our method is the application of a graph-based learning model for the analysis of a large database (i.e., MIMIC-III) for the prediction of drug administration to patients, accounting for demographic, diagnostic, and laboratory information. Our model proposes a link-predictor framework on a heterogeneous and directed graph with multiple features on both nodes and edges. The framework allows us to manage drug administration without prior knowledge of the patient’s EHRs. In contrast, most methods apply standard data mining [52] and machine learning [53] methodologies. Graph-based methods [54, 55] apply the clinical features from longitudinal data to prescribe a set of medicines. These prior studies often focus on datasets limited to a specific pathology (e.g., diabetes [41]), patient group (e.g., pregnant women [40]), or drug type (e.g., antibiotics). In contrast, our approach processes MIMIC-III data that are heterogeneous, capturing diverse patient characteristics (e.g., women, children), pathologies, and drug types, as these data are collected from ICUs.

The main aspects of our learning architectures are the multi-dimensional features associated both to nodes and edges, processing of the connections through dropout and PCA for the dimensionality reduction that addresses the main graph connections, the application of a multi-layer perceptron to the embedding of drug-patients connections, binary cross-entropy loss function to address unbalanced true/false connections, and data leakage prevention among training, validation, and test dataset through a proper edge masking function. Our method reaches an accuracy of 84.4%, which is significant for several reasons: it (i) supports physicians in pre-screening patients for drug administration; (ii) enables analysis of the distribution and clustering of drug administration patterns; (iii) provides insights into the impact of various features (e.g., religion, marital status) on the uniformity of drug administration among patients. Incorporating additional patient information (e.g., radiomics, free-text data) could further improve accuracy.

Our graph-based framework for the prediction of drug administration to patients is general and can be extended to different datasets, as it is oblivious to the pathologies, patients, or hospital units. The application of the framework to a new dataset would require dedicated training or fine-tuning that accounts for the specificity of the dataset. The analysis [56] and integration [57] of clinical notes with structured data represent a further development of our framework. The addition of clinical notes would enrich the characterisation of the patients, with benefits to the accuracy of the prediction and therapy personalisation, supporting drug administration [58] and pharmacovigilance [59] tasks.

Stratified analysis

We analyse the prediction performance stratified by five demographic attributes: gender, ethnicity, insurance type, marital status, and religion. For each subgroup, we report accuracy, precision, recall, and F1-score on the test set (Table 8). The results show that the model achieves consistent performance across most demographic subgroups, with accuracy ranging from 78.4% to 84.8% across all groups and attributes. Gender has no impact on prediction quality: female and male patients achieve identical accuracy (83.2%) and nearly identical F1-scores (0.791 and 0.782, respectively), suggesting that the model does not exhibit gender bias in drug administration prediction. The most significant disparity is observed along the ethnicity dimension. WHITE patients, who represent the largest subgroup ( > 50%), achieve the highest F1-score (0.796), while BLACK (0.744) and HISPANIC (0.750) patients show a moderate performance gap of approximately 5% points. Insurance type shows limited overall variation in F1-score (range 0.759-0.809), with Government-insured patients achieving the highest recall (0.889) and Medicaid patients the lowest F1 (0.759). Marital status and religion introduce minor differences, with F1-scores ranging from 0.776 to 0.813 and 0.748 to 0.796 respectively.

Table 8.

Prediction metrics stratified by demographic subgroup

Attribute Group Accuracy Precision Recall F1
Gender Female 83.2% 0.756 0.829 0.791
Male 83.2% 0.740 0.829 0.782
Ethnicity WHITE 84.1% 0.757 0.840 0.796
UNKNOWN 82.8% 0.740 0.832 0.784
BLACK 79.7% 0.694 0.801 0.744
OTHER 82.3% 0.709 0.812 0.757
ASIAN 82.1% 0.800 0.727 0.762
HISPANIC 78.4% 0.719 0.784 0.750
Insurance Private 83.2% 0.751 0.828 0.788
Medicare 83.7% 0.739 0.843 0.788
Medicaid 80.5% 0.755 0.763 0.759
Government 84.8% 0.742 0.889 0.809
Self Pay 83.8% 0.762 0.842 0.800
Marital Status MARRIED 83.6% 0.744 0.832 0.785
OTHER 82.9% 0.744 0.811 0.776
SINGLE 82.6% 0.762 0.831 0.795
WIDOWED 84.4% 0.733 0.848 0.786
DIVORCED 82.0% 0.762 0.871 0.813
Religion CATHOLIC 83.6% 0.757 0.836 0.794
UNOBTAINABLE 83.2% 0.737 0.820 0.776
NOT SPECIFIED 81.5% 0.763 0.831 0.796
OTHER 82.8% 0.713 0.787 0.748
PROTESTANT 84.6% 0.747 0.843 0.792
JEWISH 83.6% 0.740 0.853 0.793

Component ablation study

We perform a component ablation by removing one class of nodes at a time and estimating the corresponding normalised contribution to prediction accuracy (Table 9). The largest individual contribution is associated with the drug-administration structure (39.8%), followed by insurance, ethnicity, diagnosis, gender, religion, and marital status. When grouped into broader components, the demographic attributes (i.e., insurance, ethnicity, gender, religion, and marital status) account for 48.4% of the normalised contribution, while diagnosis accounts for 11.8%. These results indicate that demographic context provides a relevant complementary signal, although patient-drug administration remains the main structural component of the prediction task.

Table 9.

Component ablation, showing the normalised expected performance drop when removing each node type from the training graph

Class Drug Insurance Ethnicity Diagnosis Gender Religion Marital
Contribution 39.8% 12.2% 11.8% 11.8% 8.8% 8.2% 7.4%

Hyperparameter sensitivity analysis

We perform a hyperparameter sensitivity analysis to assess the stability of the proposed model to architectural and optimisation choices. Starting from the baseline (i.e., hidden dimension = 64, embedding dimension = 32, dropout rate = 0.2, learning rate = 0.01), we vary one hyperparameter at a time while keeping all others fixed, and evaluate each variant on the test set (Table 10). The embedding dimension is the most critical hyperparameter: reducing it to 16 causes a degradation across all metrics (e.g., AUC-ROC = 0.47), showing us that the heterogeneous graph structure requires a sufficiently expressive latent space to encode the relationships among the eight node types. Conversely, the model is relatively robust to changes in the hidden dimension. Both 32 and 128 reach AUC-ROC values above 0.91, comparable to the baseline. Dropout shows limited sensitivity in the range 0.1–0.3, with both variants performing similarly to the baseline. The learning rate has a larger effect on convergence. With Inline graphic, the model achieves an AUC-ROC value of 0.87 but a very low F1-weighted score (0.49), indicating that 151 epochs are insufficient for convergence at this rate and the optimal threshold becomes unstable on the validation set. With Inline graphic, both discriminative ability and calibration degrade. The baseline value of 0.01 allows us to achieve the best balance between convergence speed and stability. The sensitivity analysis confirms that the baseline configuration is well-founded: the embedding dimension and the learning rate are the parameters that most critically affect performance, while the model is stable to moderate variations in the hidden dimension and dropout rate.

Table 10.

Hyperparameter sensitivity analysis

Parameter Value AUC-ROC AUC-PR F1-weighted
baseline hid = 64, emb = 32, 0.927 0.878 0.843
dr = 0.2, lr = 0.01
hidden_dim (hid) 32 0.912 0.856 0.746
128 0.910 0.830 0.806
embed_dim (emb) 16 0.470 0.448 0.651
64 0.868 0.772 0.802
dropout (dr) 0.1 0.895 0.834 0.808
0.3 0.902 0.847 0.819
learning rate (lr) 0.001 0.872 0.794 0.485
0.05 0.823 0.717 0.643

The proposed architecture includes a principal component analysis (PCA) applied to the edge features associated with patient-drug connections. This component is motivated by its common use in heterogeneous graph settings, where it is applied to reduce noise and harmonise feature dimensionality across edge types. For instance, in [60] the authors apply PCA to drug and protein features in a heterogeneous graph for drug-target interaction prediction. An ablation on our dataset, where edge features are already of limited dimensionality, shows negligible performance difference with or without PCA (i.e., AUC-ROC difference < 0.1%), confirming that the component is inert in this setting but retains value as a modular element for deployments with richer or more heterogeneous edge features. For example, patients with long and varied administration records may exhibit high-dimensional edge feature patterns that are idiosyncratic to their individual trajectory rather than reflective of a general drug-patient relationship. In this context, compressing the historical signal through PCA may limit the influence of such patient-specific variance, forcing the model to rely on the structural patterns learned by the graph convolutional layers rather than on the fine-grained details of any particular history.

Experimental tests on MIMIC-IV database

We extend the same heterogeneous graph-based pipeline to MIMIC-IV to further assess the generality of the proposed framework. MIMIC-IV contains structured tables for patient demographics, admissions, diagnoses, prescriptions, and related clinical events, and the dataset is larger than MIMIC-III in terms of both subjects and hospitalisations. MIMIC-IV contains 364,627 unique patients and 546,028 hospital admissions, whereas MIMIC-III contains approximately 53,000 ICU admissions collected at the same medical centre in an earlier time span. We build a clinically coherent balanced cohort of approximately 4,000 patients, selected from four target macro-pathologies (pneumonia, sepsis, congestive heart failure, and coronary heart disease), and retained the top 91 prescribed drugs and the top 200 diagnosis nodes within this subset. The final graph used for the MIMIC-IV experiments contains 3,999 patient nodes, 91 item nodes, and 200 diagnosis nodes, with 90,230 patient-item edges and 40,964 patient-diagnosis edges. With respect to the original MIMIC-III graph, the adaptation mainly consists of: (i) reusing the same static heterogeneous graph formulation; (ii) simplifying the auxiliary node set to the subset of structured variables that were both readily available and informative in MIMIC-IV; and (iii) performing light hyperparameter tuning to stabilise training on the new cohort. In terms of features, the religion relation used in the original graph was removed, since this attribute is not available in the MIMIC-IV database.

Table 11 reports the MIMIC-IV performance of the proposed method compared with graph-based methods under the same 60/20/20 split protocol. Our model achieves the highest AUC-ROC (0.833±0.001) and AUC-PR (0.833±0.002), with a clear improvement over HHGAT, GAMENet, and SafeDrug. It also obtains the best macro-F1 and weighted-F1 scores among the compared methods, both equal to 0.745±0.002. Figure 6 shows the precision-recall curves and the confusion matrix of the proposed model, confirming the better precision-recall performance of our method with respect to previous work. The transfer from MIMIC-III to MIMIC-IV shows model-dependent behaviour. The proposed method performs below its MIMIC-III results, as expected when moving to an external benchmark with different feature distributions, coding practices, drug-label prevalence, and harmonisation constraints. Nevertheless, it remains the most competitive method on the MIMIC-IV dataset. GAMENet and SafeDrug show a stronger degradation, particularly in AUC-PR. For GAMENet, this may be related to the shift in longitudinal medication co-administration patterns and EHR-derived graph structure. For SafeDrug, the drop may also reflect the sensitivity of its drug-centred representation to the drug-label mapping adopted when transferring the task to MIMIC-IV. In contrast, HHGAT shows improved performance on MIMIC-IV, increasing from 0.658 to 0.726 in AUC-ROC and from 0.465 to 0.740 in AUC-PR, suggesting that the effect of dataset transfer is architecture-dependent rather than uniform across models. We recall that GAMENet and SafeDrug are originally developed and benchmarked in the MIMIC-III medication-recommendation setting, whereas HHGAT is a dataset-agnostic heterogeneous graph representation model.

Table 11.

Comparison between our method and graph-based methods on MIMIC-IV under the 60/20/20 dataset split

Method AUC-ROC AUC-PR F1-Macro F1-Weighted Accuracy
HHGAT 0.726±0.003 0.740±0.001 0.666±0.001 0.666±0.001 0.668±0.001
GAMENet 0.727±0.003 0.457±0.013 0.614±0.007 0.727±0.004 0.744±0.004
SafeDrug 0.756±0.007 0.503±0.016 0.640±0.012 0.742±0.002 0.745±0.005
Our Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic

Fig. 6.

Fig. 6

MIMIC-IV evaluation. Top row: precision-recall curve and confusion matrix of the proposed method. Bottom row: comparative precision-recall curves for HHGAT, GAMENet, and SafeDrug. Precision-recall curves (blue line) show precision on the y-axis and recall on the x-axis with respect to the precision baseline (red line)

Real-case scenarios

The proposed framework has real-world clinical applicability, as it operates on structured EHR data, including demographic, diagnostic, and laboratory features, that are routinely available in hospital information systems, without requiring specialised instrumentation or manual annotation beyond standard clinical practice. This makes the framework deployable in ICU settings as a decision-support tool, complementing the clinical judgment of physicians rather than replacing it. The heterogeneous graph structure also naturally accommodates multi-source data integration: clinical notes, imaging-derived features, and laboratory time-series can be incorporated as additional node or edge attributes without redesigning the overall architecture, making the framework adaptable to the varying data ecosystems of different hospital units.

The framework can serve as a pre-screening tool for drug administration: given the demographic and diagnostic profile of a newly admitted patient, the model can suggest a ranked list of candidate drugs that are statistically consistent with patients sharing similar characteristics, helping clinicians to prioritise therapeutic options and reduce omission errors. Then, the model can be used for medication validation and reconciliation: when a prescription is issued, the predicted drug-patient compatibility score can flag potentially inconsistent or unusual administrations, providing an early-warning signal for cases that deviate from the learned population-level patterns, a task particularly relevant in polypharmacy management, where the risk of adverse drug reactions is highest. Finally, the graph-based representation enables population-level analysis of drug administration patterns, supporting hospital pharmacovigilance activities and the identification of demographic subgroups, stratified by gender, ethnicity, insurance type, or diagnosis, that may be systematically under- or over-treated, thereby contributing to equity-aware drug management.

Conclusions and future work

We explore the MIMIC-III database through a graph-based representation and train a graph convolutional network to learn and predict information on drug administration to patients from personal, demographic, laboratory, and diagnostic data. Our method shows good results in terms of prediction accuracy and allows us to analyse database properties, such as the relationship between drug administration and demographic classes (e.g., gender-unique graph) or the prediction accuracy with respect to drug occurrences. Even with little demographic and personal information, our method reaches an accuracy of 84.4% in the prediction of drug administration, with a precision of 79.9% and a recall of 77.7% with 4K patients. Our approach is not limited to a specific class of patients, diagnosis, or drug typology. Our framework can include heterogeneous features such as relationships among patients, co-morbidities, disease inference, and drug-disease interactions. Our model can be adapted to different datasets involving various pathologies, patient categories, and parameters.

In future work, we plan to enrich the patient-drugs data with additional data from images, laboratory measures (e.g., blood exams), and semantic information extracted from the free-text notes [61]. Free-text notes are rich in information, and their analysis through semantic modelling and ontologies is widespread. The integration of heterogeneous data is well developed in the literature, such as the integration of the semantic level with knowledge graph [62] and images [63]. The extracted semantic information will be integrated as features of the patients/drugs and processed by the graph learning network to improve and specialise the prediction. To this end, we plan to enrich our graph-based model with a knowledge-driven model (e.g., ontologies), which is a predictive model based on cause-and-effect relationships and built using available scientific knowledge in drug administration, including data-driven parameters. The knowledge-driven model will then be applied to increase the predictive power of our graph/data-driven model, as an additional source of data/information, thus reducing the size of the training data set through the inclusion of prior knowledge. In the clinical context, we plan to enhance the clinical validation through: (i) a real-world scenario involving a selected cohort of patients admitted to ICUs, with diverse pathologies and/or treatments; (ii) a clinical team that prescribes medications and performs a quantitative comparison between the prescribed and predicted drugs; (iii) the deployment of our framework within ICUs as a decision-support tool for drug administration tasks. Finally, our framework should be assessed in settings with different data (e.g., specialised pathologies) to validate the generalisability of the proposed method.

Although the proposed model is defined as a static heterogeneous graph predictor, we include comparisons with dynamic methods, i.e., GAMENet and SafeDrug, to position our model against longitudinal treatment prediction approaches. These experiments suggest that extending the framework to dynamic modelling is a significant direction. In particular, a natural continuation of this work is to move from static graph-based prediction toward longitudinal modelling of patient trajectories, where temporal clinical evolution can be explicitly incorporated. Moreover, the current formulation of our method does not address the more challenging scenario of generalisation to completely unseen patients. Therefore, an important future research direction is the development of dynamic, interpretable, and generalisable treatment prediction models that can operate on sequential clinical histories and be evaluated under patient-level splits. Future extensions could also explore heterogeneous information network approaches [64, 65] to improve further drug-patient interaction modelling, as well as integrating multi-modal and sequence-based representations [66, 67] to enhance generalisation to complex datasets and rare drug-patient interactions. Finally, inspired by recent advances in drug-target binding affinity prediction [68] and computational drug repositioning, a promising direction is to explicitly model drug-drug interactions within the graph structure, accounting for molecular and pharmacological representations as well as EHR features. Combining such interaction-aware modelling with multi-omics tissue characterisation [69] could further support clinicians in personalised drug administration decisions, particularly for complex polypharmacy scenarios

Acknowledgment

We thank CINECA for the support on the experimental tests through the ISCRA-C project US-SAMP, HP10CXLQ1S. We thank the Reviewers for their comments, which have significantly improved the quality, clarity, and impact of our work.

Abbreviations

CPT

Current procedural terminology

EHR

Electronic health record

GNN

Graph neural network

ICU

Intensive care unit

MLP

Multi-layer perceptron

SVM

Support vector machine

DRG

Diagnosis related group

GCN

Graph convolutional network

ICD-9

International classification of diseases, 9th Edition

LSTM

Long short-term memory

PCA

Principal component analysis

Author contributions

Both authors have contributed equally to this work.

Funding

This work has been partially supported by the PNRR RAISE Innovation Ecosystem, ECS00000035.

Data availability

The datasets generated and analysed in the current study are available from the corresponding author upon reasonable request.

Declarations

Ethics approval and consent to participate

The proposed work includes no ethically approved human or animal experiments.

Consent for publication

Not applicable.

Competing interests

The authors have no relevant financial or non-financial interests to disclose.

Footnotes

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.Coleman JJ, Pontefract SK. Adverse drug reactions. Clin Med (Northfield Il). 2016;16(5):481–85. 10.7861/clinmedicine.16-5-481. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Halli-Tierney AD, Scarbrough C, Carroll D. Polypharmacy: evaluating risks and deprescribing. Am Fam Physician. 2019;100(1):32–38. [PubMed] [Google Scholar]
  • 3.Dhalwani NN, Fahami R, Sathanapally H, Seidu S, Davies MJ, Khunti K. Association between polypharmacy and falls in older adults: a longitudinal study from England. BMJ Open. 2017;7(10):e016358. 10.1136/bmjopen-2017-016358. [DOI] [PMC free article] [PubMed]
  • 4.Bond C, Raehl CL, Franke T. Medication errors in United States hospitals. Pharmacother: J Hum Pharmacol Drug Ther. 2001;21(9):1023–36. 10.1592/phco.21.13.1023.34617. [DOI] [PubMed] [Google Scholar]
  • 5.Xu Z, Guo J, Qin L, Xie Y, Xiao Y, Lin X, et al. Predicting ICU interventions: a transparent decision support model based on multivariate time series graph convolutional neural network. IEEE J Biomed Health Inf. 2024;28(6):3709–20. 10.1109/JBHI.2024.3379998. [DOI] [PubMed] [Google Scholar]
  • 6.Lu Q, Nguyen TH, Dou D. Predicting patient readmission risk from medical text via knowledge graph enhanced multiview graph convolution. Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval. 2021. p. 1990–94.
  • 7.Che M, Yao K, Che C, Cao Z, Kong F. Knowledge-graph-based drug repositioning against COVID-19 by graph convolutional network with attention mechanism. Future Internet. 2021;13(1):13. 10.3390/fi13010013. [DOI] [Google Scholar]
  • 8.Johnson AE, Pollard TJ, Shen L, LwH L, Feng M, Ghassemi M, et al. MIMIC-III, a freely accessible critical care database. Sci Data. 2016;3(1):1–9. 10.1038/sdata.2016.35. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Leonardo C. Accessed: 2024-06-01. https://top500.org/lists/top500/2024/06/.
  • 10.Mao C, Yao L, Luo Y. MedGCN: medication recommendation and lab test imputation via graph convolutional networks. J Biomed Inf. 2022;127:104000. 10.1016/j.jbi.2022.104000. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Ma F, You Q, Xiao H, Chitta R, Zhou J, Gao JK. Knowledge-based attention model for diagnosis prediction in healthcare. Proceedings of the 27th ACM International Conference on Information and Knowledge Management. 2018. p. 743–52.
  • 12.Chowdhury S, Zhang C, Yu PS, Luo Y. Mixed pooling multi-view attention autoencoder for representation learning in healthcare. arXiv:191006456. 2019.
  • 13.Liu S, Li T, Ding H, Tang B, Wang X, Chen Q, et al. A hybrid method of recurrent neural network and graph neural network for next-period prescription prediction. Int J Mach Learn Cyber. 2020;11(12):2849–56. 10.1007/s13042-020-01155-x. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Rocheteau E, Tong C, Veličković P, Lane N, Liò P. Predicting patient outcomes with graph representation learning. arXiv:210103940. 2021.
  • 15.Li Y, Qian B, Zhang X, Liu H. Graph neural network-based diagnosis prediction. Big Data. 2020;8(5):379–90. 10.1089/big.2020.0070. [DOI] [PubMed] [Google Scholar]
  • 16.Wu Z, Xu D, Pjh H, Huang TS. A hierarchical multilabel graph attention network method to predict the deterioration paths of chronic hepatitis B patients. J Am Med Inf Assoc. 2023;30(5):846–58. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Nelson CA, Butte AJ, Baranzini SE. Integrating biomedical research and electronic health records to create knowledge-based biologically meaningful machine-readable embeddings. Nat Commun. 2019;10(1):3045. 10.1038/s41467-019-11069-0. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Zhao C, Jiang J, Guan Y, Guo X, He B. EMR-based medical knowledge representation and inference via Markov random fields and distributed representation learning. Artif Intell Med. 2018;87:49–59. 10.1016/j.artmed.2018.03.005. [DOI] [PubMed] [Google Scholar]
  • 19.Li L, Wang P, Wang Y, Wang S, Yan J, Jiang J, et al. A method to learn embedding of a probabilistic medical knowledge graph: algorithm development. JMIR Med Inf. 2020;8(5):e17645. 10.2196/17645. [DOI] [PMC free article] [PubMed]
  • 20.Hosseini A, Chen T, Wu W, Sun Y, Sarrafzadeh M. Heteromed: heterogeneous information network for medical diagnosis. Proceedings of the 27th ACM International Conference on Information and Knowledge Management. 2018. p. 763–72.
  • 21.Kwak H, Lee M, Yoon S, Chang J, Park S, Jung K. Drug-disease graph: predicting adverse drug reaction signals via graph neural network with clinical data. Advances in Knowledge Discovery and Data Mining: 24th Pacific-Asia Conference, PAKDD 2020. Singapore: Springer; p. 633–44, May 11–14, 2020, Proceedings, Part II 24.
  • 22.Shang J, Xiao C, Ma T, Li H, Sun J. Gamenet: graph augmented memory networks for recommending medication combination. Proceedings of the AAAI Conference on Artificial Intelligence. 2019. p. 1126–33. vol. 33.
  • 23.Doshi S, Chepuri SP. A computational approach to drug repurposing using graph neural networks. Comput Biol Med. 2022;150:105992. 10.1016/j.compbiomed.2022.105992. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24.Zitnik M, Agrawal M, Leskovec J. Modeling polypharmacy side effects with graph convolutional networks. Bioinformatics. 2018;34(13):i457–66. 10.1093/bioinformatics/bty294. [DOI] [PMC free article] [PubMed]
  • 25.Zhao BW, Hu L, You ZH, Wang L, Su XR. HINGRL: predicting drug–disease associations with graph representation learning on heterogeneous information networks. Briefings Bioinf. 2022;23(1). 10.1093/bib/bbab515. [DOI] [PubMed]
  • 26.Ma T, Xiao C, Zhou J, Wang F. Drug similarity integration through attentive multi-view graph auto-encoders. Proceedings of the 27th International Joint Conference on Artificial Intelligence. IJCAI’18. AAAI Press; 2018. p. 3477–83.
  • 27.Chen RJ, Lu MY, Wang J, Williamson DF, Rodig SJ, Lindeman NI, et al. Pathomic fusion: an integrated framework for fusing histopathology and genomic features for cancer diagnosis and prognosis. IEEE Trans Med Imag. 2020;41(4):757–70. 10.1109/TMI.2020.3021387. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28.An X, Zhou Y, Di Y, Ming D. Dynamic functional connectivity and graph convolution network for Alzheimer’s disease classification. Proceedings of the 2020 7th International Conference on Biomedical and Bioinformatics Engineering. 2020. p. 1–4.
  • 29.Mao C, Yao L, Luo Y. Imagegcn: multi-relational image graph convolutional networks for disease identification with chest X-rays. IEEE Trans Med Imag. 2022;41(8):1990–2003. 10.1109/TMI.2022.3153322. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30.Hu J, Li X, Coleman K, Schroeder A, Ma N, Irwin DJ, et al. SpaGCN: integrating gene expression, spatial location and histology to identify spatial domains and spatially variable genes by graph convolutional network. Nat Methods. 2021;18(11):1342–51. 10.1038/s41592-021-01255-8. [DOI] [PubMed] [Google Scholar]
  • 31.Kipf TN, Welling M. Semi-supervised classification with graph convolutional networks. arXiv:160902907. 2016.
  • 32.Cui H, Bai J. A new hyperparameters optimization method for convolutional neural networks. Pattern Recognit Lett. 2019;125:828–34. 10.1016/j.patrec.2019.02.009. [DOI] [Google Scholar]
  • 33.Kingma D, Ba J. Adam: a method for stochastic optimization. International Conference on Learning Representations. 2014;12.
  • 34.Abhyankar S, Demner-Fushman D, Callaghan FM, McDonald CJ. Combining structured and unstructured data to identify a cohort of ICU patients who received dialysis. J Am Med Inf Assoc. 2014;21(5):801–07. 10.1136/amiajnl-2013-001915. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 35.Dligach D, Bethard S, Becker L, Miller T, Savova GK. Discovering body site and severity modifiers in clinical texts. J Am Med Inf Assoc. 2014;21(3):448–54. 10.1136/amiajnl-2013-001766. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Xu J, Zhang Y, Wang J, Wu Y, Jiang M, Soysal E, et al. UTH-CCB: the participation of the SemEval 2015 challenge–task 14. Proceedings of the 9th International Workshop on Semantic Evaluation (SemEval 2015). 2015. p. 311–14.
  • 37.Huang J, Osorio C, Sy LW. An empirical evaluation of deep learning for ICD-9 code assignment using MIMIC-III clinical notes. Comput Methods Programs Biomed. 2019;177:141–53. 10.1016/j.cmpb.2019.05.024. [DOI] [PubMed] [Google Scholar]
  • 38.Xie X, Xiong Y, Yu PS, Zhu Y. EHR coding with multi-scale feature attention and structured knowledge graph propagation. Proceedings of the 28th ACM International Conference on Information and Knowledge Management. 2019. p. 649–58.
  • 39.Rough K, Dai AM, Zhang K, Xue Y, Vardoulakis LM, Cui C, et al. Predicting inpatient medication orders from electronic health record data. Clin Pharma Ther. 2020;108(1):145–54. 10.1002/cpt.1826. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 40.Klann J, Schadow G, Downs SM. A method to compute treatment suggestions from local order entry data. AMIA Annual Symposium Proceedings. American Medical Informatics Association; 2010. p. 387. [PMC free article] [PubMed]
  • 41.Wright AP, Wright AT, McCoy AB, Sittig DF. The use of sequential pattern mining to predict next prescribed medications. J Biomed Inf. 2015;53:73–80. 10.1016/j.jbi.2014.09.003. [DOI] [PubMed] [Google Scholar]
  • 42.Friedman JH. Greedy function approximation: a gradient boosting machine. Ann Statist. 2001;29(5):1189–232. 10.1214/aos/1013203451. [DOI] [Google Scholar]
  • 43.Genuer R, Poggi JM. Random forests. In: Random forests with R. Springer; 2020. p. 33–55.
  • 44.Cover T, Hart P. Nearest neighbor pattern classification. IEEE Trans Inf Theory. 1967;13(1):21–27. 10.1109/TIT.1967.1053964. [DOI] [Google Scholar]
  • 45.Hornik K. Approximation capabilities of multilayer feedforward networks. Neural Networks. 1991;4(2):251–57. 10.1016/0893-6080(91)90009-T. [DOI] [Google Scholar]
  • 46.Park J, Han S, Jeong S, Lim S. Hyperbolic heterogeneous graph attention networks. Companion Proceedings of the ACM Web Conference 2024. p. 561–64.
  • 47.Yang C, Xiao C, Ma F, Glass L, Sun JS. Dual molecular graph encoders for safe drug recommendations. Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI 2021..
  • 48.McKinney W, et al. Pandas: a foundational Python library for data analysis and statistics. Python High Perform Sci Comput. 2011;14(9):1–9. [Google Scholar]
  • 49.Paszke A, Gross S, Chintala S, Chanan G, Yang E, DeVito Z, et al. Automatic differentiation in pytorch. 2017.
  • 50.Wang MY. Deep graph library: towards efficient and scalable deep learning on graphs. ICLR Workshop on Representation Learning on Graphs and Manifolds. 2019.
  • 51.Stevens JLR, Rudiger PJ, Bednar JA. HoloViews: building complex visualizations easily for reproducible science. SciPy 2015. p. 59–66. [Google Scholar]
  • 52.Kurniati AP, Hall G, Hogg D, Johnson O. Process mining in oncology using the MIMIC-III dataset. J Phys Conf Ser. 2018;971:012008. 10.1088/1742-6596/971/1/012008. [DOI] [Google Scholar]
  • 53.Hou N, Li M, He L, Xie B, Wang L, Zhang R, et al. Predicting 30-days mortality for MIMIC-III patients with sepsis-3: a machine learning approach using XGboost. J Transl Med. 2020;18(1):462. 10.1186/s12967-020-02620-5. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 54.Mishra R, Shridevi S. Knowledge graph driven medicine recommendation system using graph neural networks on longitudinal medical records. Sci Rep. 2024;14(1):25449. 10.1038/s41598-024-75784-5. [DOI] [PMC free article] [PubMed] [Google Scholar] [Retracted]
  • 55.Kim T, Heo J, Kim H, Shin K, Kim SW. Vita: ‘carefully chosen and weighted less’ is better in medication recommendation. Proceedings of the AAAI Conference on Artificial Intelligence. 2024. p. 8600–07. vol. 38.
  • 56.LePendu P, Iyer SV, Fairon C, Shah NH. Annotation analysis for testing drug safety signals using unstructured clinical notes. J Biomed Semant. 2012;3(Suppl S1). 10.1186/2041-1480-3-S1-S5. [DOI] [PMC free article] [PubMed]
  • 57.Scheurwegs E, Luyckx K, Luyten L, Daelemans W, Van den Bulcke T. Data integration of structured and unstructured sources for assigning clinical codes to patient stays. J Am Med Inf Assoc. 2016;23(e11–19):e11–19. 10.1093/jamia/ocv115. [DOI] [PMC free article] [PubMed]
  • 58.Gunningberg L, Pöder U, Donaldson N, Leo Swenne C. Medication administration accuracy: using clinical observation and review of patient records to assess safety and guide performance improvement. Evaluation Clin Pract. 2014;20(4):411–16. 10.1111/jep.12150. [DOI] [PubMed] [Google Scholar]
  • 59.LePendu P, Iyer SV, Bauer-Mehren A, Harpaz R, Mortensen JM, Podchiyska T, et al. Pharmacovigilance using clinical notes. Clin Pharmacol Ther. 2013;93(6):547–55. 10.1038/clpt.2013.47. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 60.Yao K, Wang X, Li W, Zhu H, Jiang Y, Li Y, et al. Semi-supervised heterogeneous graph contrastive learning for drug–target interaction prediction. Comput Biol Med. 2023;163:107199. 10.1016/j.compbiomed.2023.107199. [DOI] [PubMed] [Google Scholar]
  • 61.Wang Z, Xu S, Zhu L. Semantic relation extraction aware of N-gram features from unstructured biomedical text. J Biomed Inf. 2018;86:59–70. 10.1016/j.jbi.2018.08.011. [DOI] [PubMed] [Google Scholar]
  • 62.Shi L, Li S, Yang X, Qi J, Pan G, Zhou B. Semantic health knowledge graph: semantic integration of heterogeneous medical knowledge and services. Biomed Res Int. 2017:1–12. 10.1155/2017/2858423. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 63.Jin Z, Liu B, Chu Q, Yu N. Isnet: integrate image-level and semantic-level context for semantic segmentation. Proceedings of the IEEE/CVF International Conference on Computer Vision. 2021. p. 7189–98.
  • 64.Zhao BW, Su XR, Hu PW, Ma YP, Zhou X, Hu L. A geometric deep learning framework for drug repositioning over heterogeneous information networks. Briefings Bioinf. 2022;23(6). 10.1093/bib/bbac384. [DOI] [PubMed]
  • 65.Zhao BW, Su XR, Yang Y, Li DX, Li GD, Hu PW, et al. A heterogeneous information network learning model with neighborhood-level structural representation for predicting lncRNA-miRNA interactions. Comput Struct Biotechnol J. 2024;23:2924–33. 10.1016/j.csbj.2024.06.032. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 66.Zhang Z, Zhou X, Qi Y, Zhu X, Deng X, Tan F, et al. Leveraging 3D molecular spatial visual information and multi-perspective representations for drug discovery. Adv Sci. 2026;13(2):e12453. 10.1002/advs.202512453. [DOI] [PMC free article] [PubMed]
  • 67.Li D, Li Z, Zhao B, Su X, Li G, Hu L. DeepHIV: a sequence-based deep learning model for predicting HIV-1 protease cleavage sites. IEEE Trans Comput Biol Bioinform. 2025;22(6):3557–63. 10.1109/TCBBIO.2025.3610881. [DOI] [PubMed] [Google Scholar]
  • 68.Yang X, Yang G, Chu J. GraphCL-DTA: a graph contrastive learning with molecular semantics for drug-target binding affinity prediction. IEEE J Biomed Health Inf. 2024;28(8):4544–52. 10.1109/JBHI.2024.3350666. [DOI] [PubMed] [Google Scholar]
  • 69.Yang X, Zhao F, Ren T, Chen C, Byrne KT, Danilov AV, et al. OmicsTweezer: a distribution-independent cell deconvolution model for multi-omics data. Cell Genomics. 2025;5(9):100950. 10.1016/j.xgen.2025.100950. [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The datasets generated and analysed in the current study are available from the corresponding author upon reasonable request.


Articles from BMC Medical Informatics and Decision Making are provided here courtesy of BMC

RESOURCES