Machine Learning Based Emergency Patient Classification System

—Public Health Office and the risk map created from the patient information. Many provincial hospitals currently have to admit a large number of patients to their emergency room. Each year, the number outgrow limited medical resources, causing tremendous operational delay, and thus undermining quality of medical services. In addition, existing ER flows remain lacking means of communicating with patients’ relatives and notifying them with treatment status of patients under their care. To addresses these concerns, registered nurses with experiences are required not only to make initial patient screening and prioritization, but also to serve as liaison between physicians and patients’ relatives. These double tasks impose great burden to already overloaded medical staffs. An emergency patient classification system, based on support vector machine was developed. It was implemented as a web application, written in PHP, and running on MySQL database. GIS technology was employed to analyze spatial data and producing relevant reports. The proposed system could classify emergency patient into different groups based on their severity, according to the government standard. The resultant recommendation, verified by a nurse on duty, as well as treat-ment status were presented to patients’ relatives on a digital screen. Moreover, the hospital was able to use the summarized reports, in both standard and spatial forms, for its managerial purposes. The develop system could help the hospital to make the most of their limit resources for treating emergency patients. The produced reports were useful for making relevant policies and executive planning.


Introduction
Emergency room (ER) in a hospital provides treatment and medical care to people with injuries or acute illnesses [1] [2].Typical symptoms are, for examples, stomachache, headache, insect bites, accidents, seizure, etc. Regularly positioned at an ER screening point in most hospitals are registered nurses [3] [4] [5].Unfortunately, due to tremendous demands of medical attention, especially in provincial hospitals, ER is always filled with patients, 24-7.For example, Suratthani Hospital in Thailand accommodated 60,061 ER patients in 2017 alone.This capacity equaled to 165 patients per day on average [6].This demand puts great burden to physicians and nurses at any given shift.To lessen patient crowdedness, a nurse on duty has to perform initial screening to classify emergency patients, based on their level of illnesses or injuries, to prioritize their treatment accordingly.In addition, ER patients often been taken by their relatives who mostly anxious about treatment status and progress of patients under their care.More often than not, they turn to physicians and nurses for such information or immediate attention.These situations not only cause chaos in the ER but also undermine the quality of medical services.Spending some time in an ER, for instance, we may have witnessed emotional altercation between patient's relatives and ER nurses, their outbursts, or serious accusations toward medical practices, etc.
Ministry of Public Health (MPH) in Thailand, recently announced the policy on ER quality development to accommodate acute illnesses [7][8] [9].In compliance with this policy, licensed hospitals are mandated to setup a clear emergency patient classification system, so that ER can fairly and adequately provide medical services only to patients who really need them.Especially, due to a great share of checking in patients, large and central hospitals do need to establish highly efficient ER patient screening system to ensure optimal treatment prioritization.Their primal aim is to minimize mortality rate and chance of disabilities of patients under their care as much as possible.Moreover, current hospital operations remain lack of effective means of communication between medical staffs and patient's relatives.As such, long waiting and anxious relatives are thus unable to be notified in time of the treatment progress and status of patients under their care.This shortcoming often leads to dissatisfaction toward the hospital [10] [11].
Thus far, most ER patient classification systems were operated by qualified ER nurses, with experiences in emergency patient treatment and screening [12] [13] [14].Particularly, a nurse responsible for the task must have working experience in ER operations of at least 6-12 months [9].Alternatively, they must pass any basic training courses required for ER operations, e.g., Advanced Cardiac Life Support Certification, and Certification in Emergency Nursing [15] [16].In either case, they must also have good assessment and decision-making skills [17] [18] [19].Unfortunately, there are only a few qualified ER nurses in a hospital.This understaff issue leads to screening delay, especially during peak hours, when a large number of patients are checking in.To alleviate their workload, some hospitals install a public signage in front of ER to communicate with interested parties.They are typically simple whiteboards or sometimes digital monitors.On this screen, shown patients' names, waiting time to receive medical attention, and treatment status.Details in each record are labelled with a color, according to their emergency status.This notation offers a means of not only notifying patient's relatives but also communicating with medical staffs between shifts.Nonetheless, it still requires experienced and skilled nurses to make classification, prior to announcing on this screen.In addition, the status of each patient is updated as their treatment proceeds, without any means of systematically recording historical data.Consequently, one was unable to analyzed past data nor summarize their statistics.
With the recent development in information technology (IT) [20][21] [22] and hospital information system (HIS), modern hospitals have rapidly adopted computerized ER patient management systems.These systems, however, were usually able to record only patients' basic information and their medical records.Only few existing systems supported ER patient classification and were able to report relevant information on a digital screen [23].However, the classification itself still had to be done by a qualified nurse.Apart from empirical data, they did not offer any recommendation, regarding the emergency status screening nor classification.Moreover, they could not produce any statistics on the past classification and treatment status, that would have been useful for the hospital to make, for instance, informed management planning in future.
To address those limitations, this research presents the development of an emergency patient classification system in ER, based on machine learning technology.Its key objectives were to increase operational efficiency, to reduce unnecessary waiting time, to enhance communicating with patients' relatives and involved parties.With this system, historical data could be analyzed, to produce meaningful reports for managerial uses.

Materials and Methods
According to the literature on patient classification, it can be concluded that thorough and accurate assignment of a patient into specific managerial group, based on their condition could help healthcare staffs to make the most appropriate informed decision on their treatments and related administrations, especially during emergency.Accordingly, a patient will undergo treatments that most suit their symptoms.This part of effective patient management system can help minimizing the treatment delay in ER, preventable fatality, treatment resources, mishandling due to wrongly classified condition [24], and duration of hospital stay [25], and avoiding overcrowding treatment areas [26].Local studies conducted in Thailand also concurred to those findings.The byproducts of such good practices could well lessen staffs' tension and increase satisfaction of customers and interested parties alike [27].On the contrary, erroneous patient classification may impose tremendous burden to the hospital and its resource utilization [28].For instance, unnecessarily referring a patient to costly tomographic scans would not only incur excessive medical charges but also involve medical personnel who would be otherwise needed in other cases.This inappropriate patient management would delay the treatment of other emergency patients in much greater need and hence inevitably affecting their survival [25].
A number of patient classification systems have been proposed over the years.Most systems recently developed in the USA were based on a standard framework, called Emergency Severity Index (ESI) (Version 4 since 2005) [9].The framework focuses on patients with severe conditions who are at great risk and in need of urgent care.Therefore, it is typically adopted in ER patient management process to avoid overcrowding ER facilities.Unlike other screening systems, it considers resources required to treat each patient, regardless of timespan.For examples, a patient identified as ESI Level 1 must receive treatment immediately, while those in the ESI Level 2 should take the first priority in receiving one, once it is available.In Thailand, ER operations must comply with a similar scheme.This scheme describes criteria, regulations, and procedure for prioritizing, managing, and treating emergency patients as per their classification [9].The criteria, specified by Emergency Medical Board (EMB), are based on 25 groups of symptoms, under Criteria based Dispatch (CBD) definition, and 5 levels of Emergency Severity Index (ESI), version 4. Based on the guidelines set by these criteria, an emergency level of a patient is classified into either of the following groups based on their symptoms.
• Resuscitative patient refers to a person with acute fatal injuries or illnesses.If they do not receive immediate medical care to fix respiratory, blood circulation, and/ or nervous systems, there is a high risk of death, worsen symptoms, or acute complications.This level is denoted in red color.• Emergent patient refers to a person with very acute injuries, illnesses, or severe pain, who requires urgent medical care.Otherwise, the symptoms will get worse or complications may occur, eventually resulting in death.This level is denoted in pink color.• Urgent patient refers to a person with acute but not severe injurie or illnesses.They can wait for medical care for a certain period or check in to receive the treatment on their own.If their injuries or illnesses are not treated within reasonable time, the symptoms will get worse or complications may occur.This level is denoted in yellow color.
• Less urgent patient refers to a person with small injuries or illnesses, but not emergency ones.They may wait or opt for public health services during normal work hours.This level is denoted in green color.• Non-urgent patient refers to a person who voluntarily comes to receive public health services.They usually do not undergo full medical examination, nor require much resource.For example, the patient may want to fill their prescription, or to request a medical certificate.This level is denoted in white color.
A large number of studies concurred that a large number of ER patients checking in a hospital on a daily basis calls for a not only non-subjective but also accurate and efficient patient screening system.Without such system, incorrect severity assessment would result in unsuitable resource utilization.Assessing severity of patient's condition lower than it actually is, called "under-triage", puts a patient at greater risk due to long waiting list to get medical attention.On the contrary, over assessment, called "overtriage", results in unnecessary demand on limited medical resources, that otherwise should have been allocated to patients, whose conditions are indeed serious.Accurate initial assessment is therefore crucial not only for ensuring patient's safety but also for optimal resource utilization.Furthermore, several studies also reported that communication of this assessment between medical staffs, both between shifts and cross professions, also plays an important part in the process.Particularly, it was much efficient to assign each severity level with intuitive color notations.Colored labelling can be applied to, for examples, patient's name tag, abbreviate description (status) of their treatment, and waiting time to receive a treatment at each step, etc.According to our literature survey that, information technology (IT) has also been applied to enhance this process.So far, many medical agencies have developed computer software for managing and prioritizing emergency patients in practice.Thus far, most software considered only patient's basic information.There are a few studies addressing patient screening based on severity classification.Thus far, in those works, recommendation was made only by nurses on duty.Their medical skills and ER experiences were, therefore, crucial factors in accurate classification and hence suitable management.As such, induced stress and fatigue might as well affect intra-observer variability on the assessment.It has also been reported in existing works that, displaying some information concerning the progress and status of patient treatment, for example, on a monitor in front of ER, can reduce anxiety of their relatives.But there remains lacking summative information, that would be useful in supporting executive decision making and management planning.
To address these issues, this study proposes an automated severity rating and recommendation system for ER patients, based on machine learning of clinically relevant information.In addition, the proposed system was able to compile and present statistics of various factors in the process, in both attributive and spatial forms.

Conceptual Framework
The framework on which the proposed system was developed is illustrated in Fig. 1.It involves main 4 groups, i.e., executives, physicians, nurses, and patient's relatives.

Fig. 1. Conceptual framework of the proposed system
A user was assigned to either of these groups, based on their roles and functions.A member in the nurse group plays the vital part in the system and thus uses most functionalities of the system.As the first contact with patients, they are in charge of preliminary screening, taking notes on patient history, and most importantly, performing basic medical procedure and obtaining vital information from the patient, e.g., blood pressure and heart rate, in preparation for the treatment.Once these basic information were rec-orded in the system and exploited by the emergency classification module.The recommendation reported by the system was then verified by the nurse.During the course of treatment, the nurse could make necessary amendments if needed.Meanwhile, patient's relatives were able to view the status of the ongoing procedure on the screen in front of ER.Physicians could also view patient data to support their treatment, while hospital executives could query statistical summaries for planning and management purposes.
In compliance with this framework, the proposed emergency patient classification system was developed, by using integrated technologies, i.e., web technology, machine learning (ML) [29], and generic and geographical information system (GIS) [30].The main component of the system is the patient classification module driven by SVM [31].This module classifies a patient into one of the ESI levels, based on their clinically relevant factors, i.e., age, symptom, severity, and congenital conditions.It is worth emphasized that, the resultant classification was presented only for screening purpose and preliminary recommendation.In the end, it is up to a nurse on duty to make a final judgement, also considering other current contextual factors.The system also included other functionalities, which are summarized in a use case diagram shown in Fig. 2. In this diagram, there are 4 user groups, i.e., executives, physicians, nurses, and patient's relatives.A nurse organized a waiting list (queue) to receive treatment and medical care of patients, based on their severity classification.This decision could be made based on that recommended by SVM per individual medical record.At their own discretion and/ or by consulting with medical experts, the nurse could make appropriate adjustments and update patient status throughout the course of treatment.Depending on levels of data access, different groups may be able to view different sets of relevant reports.Treatment statistics, for example, could be viewed by nurses and physicians, while treatment status could be viewed by physicians and patient's relatives, on personal devices and ER signage monitor, respectively.On this monitor, patient's relative would also be able to see severity levels and progress on treatment statuses of each patient.At management level, hospital executives could query all data, i.e., treatment status, individual severity level, statistical, and spatial reports.
The system was developed with PHP [32] and Java script [33] languages, also by using Google Map API [34].MySQL database system was used for data storage [35].The system was designed to support operations on variety of personal devices, based on a responsive framework, and static graphical display for ER signage monitor.

Result
To demonstrate the merits of this study, the results presented in this section is divided into two parts, i.e., 1) severity classification and recommendation systems, and 2) implementation of a corresponding web-based decision support system.Their findings and practical implications are presented in detail as follow.
In the first experiments, different machine learning strategies was employed and evaluated in turns.Their resulted recommendations were compared against those assessed by human experts.Accordingly, various performance metrics were evaluated.They were accuracy, precision, recall, F-measure, and Kappa.The metrics computed from logistic, naïve Bayes, artificial neural network (MLP), and support vector machine (SVM) are presented in Table 1.It is evident that SVM outperformed its counterparts in all measures.Therefore, it was anticipated that SVM would be the most reliable method for severity screening in practice.Accordingly, this classification method was employed in the development of a web-based decision support system, presented in the subsequent part.In the next part, the key functionalities of the implemented decision support system are elucidated.Firstly, the main interface as shown in Fig. 3, consisted of two modules, i.e., user authentication and recommendation, depicted in Fig. 3(a) and 3(b), respectively.The former ensured that only authorized healthcare officers were permitted the access to the system and information management.Functions that could be performed by a given user was determined by their predefined levels and roles.The latter module involved different tasks, related to patient's condition assessment.On this screen, a nurse could specify various attributes associated with patient's conditions, i.e., their severity and level, and treatment status.Presented with a preliminary recommendation made by SVM (highlighted by red texts), the nurse could make an informed judgement, of course, also taken into account factual circumstance, unknown to machine learning.Once the decision was made, it was then recoded to the system, and maybe communicated, at nurse's discretion, with the patient's relatives or involved parties (Fig. 4).iJOE -Vol.17, No. 05, 2021  Classification of severity and corresponding recommendation were automatically made by pre-trained machine learning.The key steps involved in this process are outlined in Fig. 5. Firstly, patient data, including their history and symptoms, were retrieved from the databased and then fed into recommendation module, driven by pretrained SVM.With this model, a patient is automatically classified based on the severity of their conditions, into resuscitative, emergent, urgent, less urgent, or non-agent group.Subsequently, a nurse on duty considered this machine recommended assignment, while making their own informed decision and prioritization, taken into account other present contexts.After meticulous adjustment, the final decision was stored in the database and ready for interactive online reporting.Further adjustments, e.g., on classification and status, during the course of treatment could be made per each patient by an authorized staff.To this end, basic information and current status of a patient could be searched by their hospital number (HN), as shown in Fig. 6.Depending on access clearance, the staff is able to visualize and/ or to make adjustment to certain fields of these patient data.
In making executive decision as well as devising relevant policies, statistical analyses on these data are also of great importance.For example, in this study, average time on treatment completion for each condition, monthly average of patients being checked in, ratio of classified conditions, were compiled and reported as shown in Fig. 7.
In addition, spatial reports presenting geographical characteristics of locations and dispersion of ER patients in each category could be advantageous.Government officials and authorized agencies could make1 a citywide policies and regulations, for examples, to prevent reoccurrence of situations, as shown in Fig. 8.They are colors coded by severity levels.

Discussion
Compared to traditional systems, it was shown by the demonstrations that the presented system facilitated nurses to preliminarily assess severity of patient's conditions faster and more efficiently.In addition, it enabled communication between healthcare workers, patients' relatives, and involved parties.The in-process reports generated by the systems were in the form of both generic attributes and spatial data.Unlike many other healthcare information systems, the proposed spatially enhanced information could greatly support decision making as well as management planning.It is also worth highlighted here that the main contribution of this research is integration of machine learning in automatic severity assessments.The resulted classification suggested to an officer in charge could help them making unbiased and well-informed judgements, especially care prioritization, virtually regardless of their operational experiences.Furthermore, essential statistics regarding diseases and symptoms found in certain population could be visualized in concise geographical formats to gain insights into their regional distribution.For instances, summary of areas that are more prone to motor acci-dents than others could be proposed to an authority, so that they can devise much effective transportation policies, aiming at preventing further incidents, and hence reducing personal injuries due to ones.

Conclusion
Classifying and assessing severity of ER patients' conditions are typically performed by ER nurses on duty.However, there are some issues associated with the conventional scheme.These included operational delays and lack of effective communication with patient's relatives.To remedy these issues, the presented system was developed to assist healthcare worker as a screening tool for efficient severity assessment, based on machine learning.In addition, it also served as a communication media among interested parties, regarding the progress during a course of treatment.Historical data involved in the processes were also systematically and securely stored for subsequent statistical and spatial analyses.It was also demonstrated by the prototype system that, the relevant reports were useful for supporting executive decision making, under certain situations, e.g., major accidents or natural hazard incidents [36]

Fig. 2 .
Fig. 2. Use case diagram describing the user-functionalities of the proposed system.

Fig. 3 .
Fig. 3. (a) User authentication (b) Severity condition, prioritization, and treatment recommended by SVM and amendable by authorized staffs.Also appear in (b) are the menus, navigating to various functionalities, such as data search and reporting.

Fig. 4 .
Fig. 4. Summarized reports that can be used to communicate with patients' relatives.They consisted of severity, severity level, and treatment status.

Fig. 5 .
Fig. 5.The key steps involved in the severity classification and recommendation system (left) and treatment data screen, showing five different patient classifications (right).

Fig. 8 .
Fig. 8. Spatial reports of locations and dispersion of ER patients.They are colors coded by severity levels.

Table 1 .
Assessment of patient classification accuracy based on different machine learning.