Leveraging graph neural networks for supporting automatic triage of patients

Patient triage is crucial in emergency departments, ensuring timely and appropriate care based on correctly evaluating the emergency grade of patient conditions. Triage methods are generally performed by human operator based on her own experience and information that are gathered from the patient management process. Thus, it is a process that can generate errors in emergency-level associations. Recently, Traditional triage methods heavily rely on human decisions, which can be subjective and prone to errors. A growing interest has recently been focused on leveraging artificial intelligence (AI) to develop algorithms to maximize information gathering and minimize errors in patient triage processing. We define and implement an AI-based module to manage patients’ emergency code assignments in emergency departments. It uses historical data from the emergency department to train the medical decision-making process. Data containing relevant patient information, such as vital signs, symptoms, and medical history, accurately classify patients into triage categories. Experimental results demonstrate that the proposed algorithm achieved high accuracy outperforming traditional triage methods. By using the proposed method, we claim that healthcare professionals can predict severity index to guide patient management processing and resource allocation.


I. INTRODUCTION
Emergency department (ED) management faces a significant challenge in managing the influx of people.Properly managing queues can help improve the quality of hospitals and contain costs and reimbursement [1].The management of the patient queues in the ED follows the rules defined by national laws of the healthcare system.In Italy, healthcare services are accessible to all citizens, without any restriction.In parallel, in recent years, due to demographic modifications, and pandemics, emergency departments are often overcrowded, even in the absence of exceptional conditions such as pandemics, highlighting the relevance of the problem [2]- [5].In general, managing queues to emergency departments (EDs) is crucial, considering both economic and social aspects due to the potentially fatal outcomes resulting from the unfair prioritisation of patients.The prioritisation in the patient management process regarding cure and study is based on a process called triage.The triage consists of gathering information from a first rapid patient visit, measuring vital signs and parameters, thus defining a grade of emergency for each patient and indicating a class of treatment priority.Each priority class is assigned to an emergency code associated with a patient priority code and a related treatment protocol.Therefore, correct prioritisation of queues for new patients (i.e., classification) is A set of vital signs and biochemical parameters are evaluated and an emergency code is assigned.In the scenario, we envision patient data from previous admissions are used initially to build a network representing similarity among patients.The network is then used to learn a Graph Neural Network to classify patients in a latent space (the assignment of the severity index is translated into a multiclass classification problem).Finally, each patient who enters the emergency room is automatically classified after the acquisition of clinical data.
based on the clinical and health status conditions of patients and should be able to guarantee the proper prioritisation treatment to patients incoming from the emergency department [6], [7].
Methods and techniques for triage definition have been defined and adopted at a large scale level [8], [9].The Italian rules of the triage process rules have been defined in the Italian healthcare management guidelines, where triage is composed of four phases: 1) Immediate Evaluation Phase (so-called on the door): the identification of the conditions of the patients to screen people who need immediate intervention; 2) Phase of subjective and objective evaluation: evaluation of condition through anamnestic interviews and detection of clinical signs and vital parameters through clinical analysis.3) Triage Decision Phase: assignation of a priority code for each patient and implementation of waiting queues; 4) Re-evaluation Phase: the periodic analysis of patients to confirm or modify the priority code.They were taking into account the worldwide scenario [5], [10], some of the most adopted systems are the Canadian Triage and Acuity Scale (CTAS) [11], [12] the Australasian Triage System (ATS) [13], the Manchester Triage System (MTS) [14], the Emergency Severity Index (ESI, United States) [15], the Korean Triage and Acuity Scale (KTAS) [16], the Taiwan Triage Acuity Scale (TTAS) [17] and the South African Acuity Scale (SAAS) [18].All such systems share the streaming of patients, which is based on grouping patients using conditions and the subsequent assignment of patients into separate areas of the ED [10].
The application of triage rules is mostly based on operator decisions (both nursery and physician) interacting with patient parameters and data.The triage assessment is related to various factors determining the urgency of each incoming patient.
All the triage systems, based on manual interventions, share some common limitations also investigated by Fitzgerald et al., [19] which emphasise the inconsistency in triage assessment due to various factors determining the urgency of each incoming patient.Thus, many approaches have been to defining and introducing computational-based triage code automatic assignment mechanisms to minimise human-related error risks [20], [21].
Consequently, many authors explored the possibility of introducing automated systems based on computational intelligence to improve triage systems by suggesting the emergency code [20], [21].Moreover, machine learning (ML) and artificial intelligence (AI) algorithms have been used to analyse and learn from clinical data such as Electronic Medical Records (EMRs) as well as from additional information gathered, for instance, from sensors or wearable devices.More recently, machine learning (ML) and artificial intelligence (AI) algorithms have shown the possibility of analysing electronic medical records (EMRs) [22], [23] as well as unstructured patient data such as sensors and wearable devices.Thus, since triage systems are based on the observation of patient data, the possibility of using ML and AI has been explored to improve classical clinical scoring systems [9].Many prediction models have been developed to enhance the triage process, suggesting a more-grained stratification of patients inside the classical groups and better performances in guaranteeing better clinical outcomes [8], [9].A range of machine-learning approaches have been explored for automatic patient triage in emergency departments.Olivia et al., [24] effectively employed various supervised learning algorithms, including Naive Bayes, Support Vector Machine, Decision Tree, and Neural Network, to predict patients' medical conditions accurately.Caicedo-Torres et al ., [25] expertly utilised machine learning techniques in a Pediatric ED to determine which patients should be admitted to the Fast Track (i.e., rapid admission and pediatric treatment).Joseph et al., [26] conducted a deep study to identify critically ill patients using deep learning approaches, specifically analysing the use of limited information available at triage.Collectively, these studies demonstrate the immense potential of machine learning in managing patient triage in the emergency department.Existing prediction models are based on data collected at triage, such as demographic information, vital signs, primary complaints, nursing observations, and initial diagnostics [8], [9].Historical data such as patient access frequency and medical records frequencies are also used in some predicting models [27].Some models also include variables like hospital visit frequency and previous medical history.Thus, using data gathered from patient data regarding emergency department admission and treatment, it is possible to enrich and improve triage and processes to manage incoming patients.However, data obtained at later stages of a patient's current ED visit, such as laboratory tests, administered medications, and diagnoses made by ED staff, is more effective in predicting admissions.
Modelling similarities among patients' conditions and similarities among previous visits by joining for the same patient may support the definition of an admission prediction at the triage stage.Available solutions often use broad categories for chronic conditions [28], [29].Enriching EHR data to train models could improve prediction results [30].Moreover, tentative based on gradient boosting and deep neural networks improve prediction efficacy.Nevertheless, all the existing approaches need to include the explicit modelling of the similarity among patients [31].
We leverage network science methods to build a novel clinical algorithm based on artificial intelligence and network science for assigning priority to patients.We start by considering clinical patient data extracted from patient records.These data include analytical observations as well as subjective ones.A modelling phase is applied after an initial preprocessing step to identify possible noise and outliers.Each patient is modelled as a graph node in the learning phase, while edges represent the similarity among the observation data.At this point, the graph is embedded into a latent space.Finally, patients are classified into the risk groups by applying a node classification algorithm as summarised in Figure 2.
Prior models incorporating a patient's medical history often use broad categories for chronic conditions.Recently, a recent study [30] demonstrated that using comprehensive EHR data could robustly predict in-patient outcomes.Thus, a predictive model for hospital admission that leverages a thorough compilation of a patient's history could surpass earlier models in effectiveness.
Although gradient boosting and deep neural networks have been recognised as potent tools in predictive modelling, all the existing approaches lack in modelling the similarity among patients [31].Building upon previous research, we leverage network science methods to build a novel clinical algorithm based on artificial intelligence and network science for assigning priority to patients.We start by considering clinical patient data extracted from patient records.These data include analytical observations as well as subjective ones.A modelling phase is applied after an initial preprocessing step to identify possible noise and outliers resulting in the building of a network.Each patient is modelled as a graph node in this step, while edges represent the similarity among the observation data.At this point, the graph is embedded into a latent space.Finally, patients are classified into risk groups by applying a node classification algorithm as summarized in Figure 2.
Since the embedding is inductive, when a novel patient is available, a novel node is added to the graph and embedded [32], [33].We tested our pipeline on public data to demonstrate the effectiveness of our approach and the improvement concerning state-of-the-art approaches.

A. A Toy Example
This section describes the system through a toy example.In a classical triage system, patients requiring admission to ED are classified into a severity level using standard algorithms which produce a severity index based on the patient data.Such data may be given by the observation of the patient by the nurse, and evaluation of biochemical parameters.Such data are usually stored in hospital registries and EHRs.We start by considering these data to build a patient similarity network where each patient is a node.The edges among patients are weighted by calculating the similarity of patients on the basis of their data.Each node is also labeled with the previously assigned severity level.The network is embedded into a latent space and a node classifier is trained.Once that the classifier is trained, each new patient can be automatically assigned to a severity index by using the classifier.

II. RELATED WORK
Triage is a critical and systematic process used in an emergency department (ED).It helps prioritize patients based on the severity of their condition, the urgency of their need for care, and the availability of resources within the healthcare facility.The goal is to ensure that patients who need immediate attention receive it promptly, while those with less critical needs are attended to in an order that maximizes the overall efficiency and effectiveness of emergency medical services.
The triage process in an emergency department involves several key steps and principles, which are as follows.
Upon arrival at the ED, each patient undergoes an initial assessment by a triage nurse or a trained healthcare professional.This assessment is designed to quickly gather critical information about the patient's condition, including the chief complaint, vital signs (such as temperature, blood pressure, heart rate, and respiratory rate), and a brief history of the present illness or injury.
Urgency Categorization: Based on the initial assessment, patients are categorized into different levels of urgency ranging from immediate life-saving intervention needed (highest priority) to non-urgent care (lowest priority).
Triage categorization directly influences the allocation of resources.Patients with the highest urgency levels are treated immediately and often directed to specialized areas within the ED equipped to handle severe cases (e.g., resuscitation rooms).Those with lower urgency levels may wait longer and be seen in order of priority based on their triage category.
Triage is not a one-time assessment but a continuous process.Patients' conditions can change, necessitating a reassessment and potential re-categorization of their urgency level.Triage nurses or other designated healthcare professionals periodically re-evaluate waiting patients to ensure that changes in their condition are promptly identified and addressed.
Accurate documentation and effective communication are essential components of the triage process.Triage decisions, patient information, and any changes in condition must be thoroughly documented and communicated to the entire healthcare team involved in the patient's care.This ensures continuity of care and that all team members are aware of the patient's status and needs.
Triage involves ethical considerations, such as fairness, equity, and the principle of doing the most good for the greatest number of people.Healthcare professionals must make unbiased decisions based on clinical urgency and the potential for benefit from medical intervention, rather than factors like financial status, age, or social position.
The triage process faces various challenges, including overcrowding in emergency departments, fluctuating patient volumes, and limited resources.Effective triage requires flexibility and the ability to adapt to changing circumstances, such as public health emergencies or disasters, which may necessitate modifications to triage protocols and prioritization strategies.
Despite the worldwide adoption and diffusion, some common problems affect the triage systems: such as dependence on subjective medical staff assessment and the possibility of having many missing variables.
Conversely in an automatic triage system, the categorization of patients is fully automated and the level of severity is determined by computer algorithms as summarised in [28].
Automatic (or computating based), triage systems present some advantages such as: (i) stability of assignment [28], (ii) filtering out noise in the patient variables, (iii) model and analyse patient similarity, (i.e. by modelling the set of patients in a network which evidences patient similarity [28], [34]- [37]; (iv) avoiding patients under triaged into low severity levels [38]; (vi) avoid of racial, gender, age bias [39].Literature contains many approaches of the use of machine learning for patients emergency classification.Singh et la., [40] developed a cascading classifier for psychiatric patient triage, achieving high accuracy and reducing expert effort.Graca (2023) highlighted the potential of machine learning in ICU triage and patient transfer during crises, such as the Covid-19 pandemic.Olivia et al., [24] and Yan et al., [41] both emphasized the significance of machine learning in emergency department triage, focusing the effectiveness of Support Vector Machine and Decision Tree models.

III. ARCHITECTURE
Figure 3 describes the architecture of the system.The system receives as input patient data to build the patient similarity network where each node is a patient and the weighted edges model the similarity among them.The current implementation of the system uses four known measures for evaluating the similarity: cosine similarity, Euclidean, Manhattan, and Minkowsky distances.
The network embedding (or graph representation learning) module, is responsible for projecting the network into a latent space by using node embedding.GRL projects each node into a separate point in a subspace while preserving the initial distance between nodes.
The node classification module is responsible for the assignment of a triage level to each new patient requiring the assignment.Both the graph representation learning module and node classification module leverage the computational intelligence of Graph Neural Networks methods.From the existing methods for GRL we select those which are able to deal with node labels and based on inductive strategies.For instance, Graph Neural Networks are used for node embedding [42] because the present two main advantages: (i) they take into account data related to nodes, (i.e.node features); (ii) they are inherently inductive, so they do not need to recalculate the whole embedding in case of any graph modification (e.g.node/edge insertion or removal) [33], [43], [44].The current implementation uses three state of the art methods:Graph Convolutional Networks [45], GATv2Conv [46], and GraphSage [47], [48], which in general have better performances compared to the state of the art.
Graph Convolutional Networks (GCNs) [49] are specialized neural network architectures for processing data structured as graphs.These networks are particularly effective in scenarios where data points are interconnected, such as social networks, molecular structures, or communication networks.Unlike traditional convolutional neural networks that operate on grid-like data (e.g., images), GCNs leverage the graph structure to process data on nodes and their connections [49].They apply convolution operations directly on the graph, aggregating information from a node's neighbours capturing both the features of individual nodes and the complex relationships between them.The flexibility of GCNs in handling irregular graph structures makes them highly suitable for tasks like node classification, link prediction, and graph classification.
Graph Attention Networks (GATs) [50] use an attention mechanism to dynamically determine the relevance of each neighbor's features, allowing for a more nuanced and context-aware aggregation of neighbor information.This approach is different from traditional graph convolutional networks that aggregate neighboring node features in a uniform or predetermined manner.
In GATs, the attention mechanism assigns different weights to more relevant nodes in a neighborhood, which is particularly useful in dealing with complex graph structures where the relevance of neighboring nodes can vary significantly.This approach leads to more effective feature representation and learning.The implementation of GAT is defined as followed with two GATv2Conv layers: • first layer with input dimension equal to 16 as the number of features, output dimension equal to 8 and 4 attention heads to implement the mechanism of attention.
• second layer with input dimension equal to the output dimension of the previous layer (hidden dimension * number of attention heads) to obtain the output of dimension 4 as the size of the target class.GraphSAGE [47] is a framework for generating node embeddings for large graphs.Unlike conventional graph-based methods, it samples and aggregates from a node's local neighborhood to efficiently scale to large graphs.It can perform aggregation using various functions and capture diverse neighborhood structures effectively.GraphSAGE has inductive learning capability and is effective in classification, prediction, and recommendation systems for large-scale and dynamic graph data.

IV. EXPERIMENTAL RESULTS
To test the performances of our method we designed and performed a set of experiments as depicted in Figure 4.The input dataset is translated into networks using cosine similarity, Minkowski, Manhattan, and euclidean distance.We built many networks for each measure using different threshold levels.Then for each network we perform node embedding and we train a a classifier using GCN, GAT and GraphSage.Finally, we evaluated the performance of each classifier.

A. Dataset
We tested our methods on a publicly available dataset on the Kaggle platform (https://www.kaggle.com/datasets/hossamahmedaly/patient-priority-classification).The dataset contains 6962 instances (rows) of patient admission and 16 features for each instance.Each row describes the parameters of a patient described such as symptoms and some biochemical parameters used to determine the severity level as summarised in Table I.Each row also contains the assigned the triage level as follows with decrescent level of risk: • Red: the patient needs immediate attention; • Orange: the patient needs intervention in a short time; • Yellow: urgent condition needing interventions that can be deferred; • Green: condition with minor urgency because there are no alterations of vital functions and no critical symptoms.4) Oversampling and Undersampling: Since classes are unbalanced, we use SMOTE (Synthetic Minority Oversampling Technique) [51] to perform the sampling.5) Normalization with Min-Max Scaler: Finally data are normalized using a Min-Max approach, so a maximum value of each column is equal to 1 and a minimum value equal to 0.

B. Networks generated using Cosine Similarity
We first generated patient networks using cosine similarity to define edges.We used different thresholds (0.98, 0.95, 0.94,0.92,0.90).In this case an edge connect two nodes when the cosine similarity is greater than the threshold.We stopped at 0.90 since we reached a completely connected graph.Table II summarises the characteristics of the networks generated by using cosine similarity at different level of threshold.As it can be noticed, decreasing the value of the thresholds reduces the isolated nodes and increases the number of edges.In this way, it is possible to connect more patients due to the possibility to create ad an edge between two nodes with some more dissimilarities.

C. Networks generated using Euclidean Distance
We first generated patient networks using Euclidean Distance to define edges.We used different thresholds (0.20, 0.23, 0.25,0.28,0.31,0.38).In this case an edge connect two nodes when the euclidean distance is lower than the threshold.We stopped at 0.38 since we reached a completely connected graph.
Table III summarises the characteristics of the networks generated by using Euclidean Distance at different level of threshold.The considerations are similar to the case concerning cosine similarity, with the difference that the number of isolated nodes is is lower than the first obtained previously.It may be associated with the fact that considering distance allows for a greater number of connections between a larger number of different nodes.

D. Networks generated using Manhattan Distance
Table IV summarises the characteristics of the networks generated by using Manhattan Distance at different level of threshold.In this scenario, initially, the number of edges is lower than in previous cases, as the number of isolated nodes.On the contrary, after the first two, much less stringent thresholds have been chosen causing a substantial increase in the number of edges and a reduction to zero in the number of isolated nodes.

E. Networks generated using Minkowsky Distance
In this subsequent phase, it is interesting to generate graphs from tabular data, by exploring the Minkowski distance.It serves as a generalization of both Euclidean and Manhattan distances, therefore, it is appropriate to vary the value of p, which characterizes the modification of this metric.
Table V summarises the characteristics of the network generated by using Minkowsky Distance (p = 10) at different level of threshold.It may be observed that choosing p = 10 results in a notable reduction in network connections, differently from choosing p = 4 in which the values are closer to other measures.

F. Graph Convolutional Networks
We used GCN to analyze graphs created based on Cosine similarity, and Manhattan on Euclidean distance.We employed two architectures of GCN, the first one for cosine and Manhattan and the last one for the networks generated using Euclidean distance.
The first architecture is composed by five GCNConv layers: • layer 1 of dimensions (16,64), where the first one represents the input feature dimension for each node in the graph: each node is described by a vector of 16 features.• layers 2,3,4 of dimensions (64,64) representing hidden layers' dimension during GCN convolutions, followed by dropout function with a fraction of characteristics to be reset equal to 20%, during training and ReLu function for each layer.
• layer 5 of dimensions (64,4) with an output dimension appropriate to the number of classes to be identified as targets.Similarly, the second architecture is composed in the same way, excluding the fifth layer and using 32 as the hidden dimension during GCN convolutions.The input size is set to 16 (in agreement with the number of features), while the output equal to 4 (in agreement with the number of feature target's classes).Furthermore, the same number of Dropout layers are inserted with the same fraction of characteristics to be reset.

G. Graph Attention Networks
The implementation of GAT is defined as followed with two GATv2Conv layers: • first layer with input dimension equal to 16 as the number of features, output dimension equal to 8 and 4 attention heads to implement the mechanism of attention.
• second layer with input dimension equal to the output dimension of the previous layer (hidden dimension * number of attention heads) to obtain the output of dimension 4 as the size of the target class.The two Dropout layers have been introduced with a rate of 20% to improve the performances and to reduce the overfitting.

H. GraphSage
Firstly, the available data is further subjected to a phase which consists in the creation of batches to be able to apply the training on the mini-batches that are better manageable for training the GNN.The torch geometric.loadermodule provides the Neighborloader function with the possibility to choose both the size of each batch and the number of neighbours to consider at each iteration.Five sub-graphs are obtained for each considered graph choosing a dimension equal to 3000 for the batch size and a number of neighbours equal to 10 to be considered at each iteration for each node for 5 iterations.For all the graphs created by the similarity and distance measures, the same model is implemented using five SAGEConv layers.SAGEConv is better than simple GraphSage allowing to capture further details regarding the graph structure, thanks to its aggregate representation based on the degree of the nodes in the neighborhood.In the current implementation, each layer has an input dimension equal to the output dimension of the previous layer, with a sequence of 64, 32, 16, 8. Naturally, the input dimension of the first layer always reflects the number of features, and the output dimension of the last layer corresponds to the number of possible values for the target.Additionally, each SAGEConv layer uses the max pooling aggregation function, except for the third layer with mean aggregation function.Similar to the architectures described earlier, each layer applies a ReLU activation function after the aggregation.Also, a dropout of 20% is applied, but only after the fourth layer.

I. Classification Performances
We measured the classification performances for each network previously built.This helped us to study the impact of how some variations in parameters of the system affect the conclusions of a model.Indeed, the obtained results are visualized in Figures 6 and 7  Additionally, it can be observed that for all the considered metrics, opting for a less strict threshold enhances the model's performance.The only exception is made for the Minkowski distance with p=4, for which the performance slightly decreases.For this reason, further experiments were conducted with additional arbitrary thresholds, focusing only on the Minkowski distance with p = 10 and excluding p = 4.
Based on the preliminary results obtained, it seems appropriate to increase the number of threshold points, used to create the graph structures shown in the previous tables for each metric respectively.The aim will be to display the performance growth or the performance loss.All the values of the arbitrarily considered thresholds are reported in the previous tables, while in the following section, the resulting performances are presented as illustrated in the figure 8.For each experiment considering a different metric, there are some thresholds that influenced negatively the performances of the models.In fact, these models underperform compared to the others.In addition, the results are worse also than the baseline.On the contrary: • For the cosine similarity, choosing a threshold lower by a few points, is positive for the performances of the model, maybe because it helps to find more similarity useful for the classification.On the other hand, if the threshold is lower than 0.94, it isn't good.• Differently from the previous case, an intermediate value of Manhattan distance could be the better choice outperforming also the baseline.• Considering the Euclidean distance, higher thresholds deteriorate the results in some cases, as it can be seen, in a more evident manner, for thresholds like 0.23 and 0.25.• Ultimately, for the Minkowski distance, to outperform the baseline, the model requires thresholds to be increased in relation to the initial values.

J. Node Classification
For all the previous methods, we used following parameters to build the classifier: • the CrossEntropyLoss that is computed between the model predictions and the training labels to measure how well the model is learning.• the Adam optimizer that is employed to update the model weights with a weight decay = 5e-4 and a learning rate of 0.01.This last one is used in all cases, except for the model based on GAT layers, where it has been set to 0.005.

K. Comparison with respect classification on tabular data
It could be useful to compare the results obtained with networks related to classification on tabular data.Therefore, to do that, it was trained two types of algorithms: Support Vector Machine and K-Nearest Neighbors on the same patient data used for classification on graphs.Similarly, the same pre-processing phase was carried out.The tabular data were splitted in train, test and evaluation set with a proportion of 30% for test set.In addition, a percentage of 30% of the test set was used for evaluation.The results obtained (shown in figure 9) were higher than GCN and GAT applied on graph structures but are lesser than GraphSage results.Supporting the evidence, the test performances of the classification on tabular data are also associated to the Sensitivity Analysis results in the previous figures.

L. Ablation Study
To better test the performances of our approach, we performed an ablatio study [52], [53] considering GraphSage, as it emerged as the best-performing model in the initial analysis phase and using the graph wich resulted in best performances, i.e. cosine similarity with a threshold of 0.95.In this case, the study was conducted by removing one layer at a time, the second, third, and fourth layers, and finally all three layers, while varying the number of neurons and considering initially 8 neurons and then 64 neurons.In Figure 10 the results obtained are reported, on which it is possible to make the following considerations: • the removal of the fourth layer slightly reduces performance compared to removing the other layers.
• the removal of the third layer reduces performance slightly more than removing the second layer.
• the removal of the second, third, and fourth layers, considering 8 neurons, leads to the minimum accuracy value achieved in testing.
• the removal of the second, third, and fourth layers, considering 64 neurons, reduces the accuracy value achieved in testing, but it remains higher than that obtained under the same conditions with 8 neurons and higher than that obtained by removing only the second or third layer.Moreover, it could be argued that the fourth layer may be more important than others in aiding the task of node classification.

V. CONCLUSION
In this study, we introduced an innovative approach for managing patient triage in emergency departments through the application of artificial intelligence (AI) and network science.Utilizing machine learning algorithms and graph neural networks, our team crafted an AI module adapt at precisely categorizing patients into various triage levels.This system exhibited superior performance over conventional triage methods in our tests.
The findings from our research underscore the advantages of AI integration in healthcare, especially in the context of patient triage.This technological integration not only streamlines resource allocation but also minimizes errors in triage assessments.Our AI-driven method, which analyzes a patient's detailed medical history alongside their current vital statistics, enables a more detailed and accurate evaluation of their immediate medical needs.This approach significantly enhances the prioritization process of patients within emergency departments.
Moreover, our innovative strategy of representing patient data as graph nodes and employing graph neural networks for classification marks a notable advancement in the field of medical informatics.This technique not only boosts the precision of patient triage but also paves the way for novel methods of analyzing patient data in emergency healthcare scenarios.
To sum up, our study illuminates the transformative potential of merging AI with conventional healthcare methodologies to enhance both patient care and the operational efficiency of emergency departments.The adoption of AI-based systems in healthcare has the promise to redefine triage processes, ensuring more effective and optimized patient treatment.Looking ahead, the focus could be on refining these AI models and examining their applicability in diverse healthcare environments, which could further substantiate and expand upon the observed benefits of this study.

VI. DATA AND CODE AVAILABILITY
All the data used in this article and the code for reproducing the experiments are available at https://github.com/hguzzi/iatriage.git.

Fig. 1 .
Fig. 1. Figure compares automatic vs traditional triage systems.In the traditional triage system, patients go to the Emergency Departments for admission.A set of vital signs and biochemical parameters are evaluated and an emergency code is assigned.In the scenario, we envision patient data from previous admissions are used initially to build a network representing similarity among patients.The network is then used to learn a Graph Neural Network to classify patients in a latent space (the assignment of the severity index is translated into a multiclass classification problem).Finally, each patient who enters the emergency room is automatically classified after the acquisition of clinical data.

Fig. 2 .
Fig. 2. Patient data are used to build a network representing patient similarity.Each node has a previous severity index codified as a node label.The network is then used to learn a Graph Neural Network to classify patients.Therefore, the assignment of the severity index is translated into a multiclass node classification problem.A new patient requiring admission to ED is a node of the graph without a label, and the learned model is used to derive the correct label.

Fig. 3 .
Fig. 3.The Architecture of the System.

Fig. 4 .
Fig. 4. The Figure represents the experiments we performed to test the approach.The input dataset is converted into a network using cosine similarity, Euclidean, Manhattan, and Minkowski Distances.For each measure, we generated a set of networks using different thresholds.Then each single network is used to learn a classifier and finally results are evaluated.

Fig. 6 .
Fig. 6.Comparison of test accuracy considering an additional threshold for each metric.

TABLE I FEATURES
OF THE PATIENTS.
Data are pre-processed as follows: 1) Duplicates and null values: null values are removed from the dataset, reducing the number of entries in the patient tables.2) Inconsistent (or incomplete) records: missing values are replaced with the mode of the values of the whole corresponding column.3) Label Encoder for categorical features: Dataset contains three categorical features: Residence type, Smoking status and the third is the target feature.

TABLE II CHARACTERISTICS
OF THE NETWORKS GENERATED BY USING DIFFERENT LEVELS OF THRESHOLDS AND COSINE SIMILARITY AS MEASURE.

TABLE IV CHARACTERISTICS
OF THE NETWORKS GENERATED BY USING DIFFERENT LEVELS OF THRESHOLDS AND MANHATTAN DISTANCE AS SIMILARITY MEASURE.

TABLE V CHARACTERISTICS
OF THE NETWORK GENERATED BY USING DIFFERENT LEVELS OF THRESHOLDS AND MINKOWSKY DISTANCE (P = 10) AS

TABLE VI CHARACTERISTICS
OF THE NETWORK GENERATED BY USING DIFFERENT LEVELS OF THRESHOLDS AND MINKOWSKY DISTANCE (P = 4) AS SIMILARITY MEASURE.