{'fraction_non_alphanumeric': 0.025252525252525252, 'fraction_numerical': 0.007820136852394917, 'mean_word_length': 4.959546925566343, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Medical Care in Emergency Units with Risk Classiﬁcation: Time to Attendance at a Hospital based on Parametric Models

. The present work intends to study the effectiveness of applying the Manchester Triage System to improve patient ﬂow in a Brazilian hospital, which allows a more welcoming and decisive service. Thus, time to event techniques is applied based on parametric regression models with the objective of inves-tigating indicators for the emergency/urgency sector and thus, contributing to better operational efﬁciency. The results show that different explanatory variables such as classiﬁcation, age, period, among others, inﬂuence the time of attendance. In the end, we provide a simple model that can be used to predict such time under different explanatory variables for a particular Brazilian hospital.


INTRODUCTION
Emergency units are confronted daily with a large number of patients with a wide range of illnesses. The workload of emergency units is highly dependent on the number of patients seeking medical care and the condition they present. It is essential that a risk classification system is in place to ensure that these patients receive medical care according to their degree of risk and not on a first-come, first-served basis (see, for instance, Menezes et al. [9]). Thus, the purpose of triage in an emergency service is to prioritize patients according to their degree of risk. Consequently, the accuracy of the triage systems becomes increasingly critical, especially because a risk subrated can worsen the patient's condition awaiting care, and a risk super-rated will consume the limited resources demand by the patients who require immediate care.
The Manchester Triage System (MTS) is a clinical management system tool, used worldwide to manage patient flow when clinical demand exceeds capacity safely. The MTS classifies patients based on information about medical history, signs and symptoms presented by patients to classifies them into five categories identified by colors and their maximum acceptable time respective: Red (immediate evaluation by a physician); Orange (very urgent requiring evaluation within 10 minutes); Yellow (urgent, 60 minute); Green (standard, 2 hours); and Blue (non-urgent, 4 hours). By using the Manchester protocol (MP) risk classification, it is improved the efficiency in emergency services and saves more lives.
Cooke and Jinks [4] discussed the application of the MP in England and indicated that this protocol is a sensitive tool for detecting who subsequently needs critical care and who is ill on arrival in the accident & emergency departments. Van der Wulp et al. [16] evaluated the reliability and validity of the MP applied to an emergency unit in the Netherlands and concluded that nurses' work experience does not influence protocol reliability. Martins et al. [8] concluded that the MP is more than a prioritization mechanism because it distinguishes between patients with high and low unadjusted risk of short-term death, as well as those who will remain in the hospital for at least 24 hours and those who will return home. Other studies related to the MP can be seen in [1,3,13,15].
The MTS was implemented in Brazilian hospitals as a public policy in 2008 [5] and has been studied since then by many authors [7,10,14]. Here, we considered a Brazilian hospital, which has recently adopted the Manchester Protocol, in order to classify/detect individuals needing admission to critical care areas. The hospital is located in São Paulo State and contains 38,699 patients' records from the period of March 1st to August 31st, 2016. The present study aims to describe the attendance for medical care of patients classified under the MTS based on some explanatory variables such as classification under the MT, the period of the day and if the patient is either an adult or children. To achieved this we considered survival analysis techniques with a regression structure to propose a probabilistic model in order to determine the different levels of probability related to the time spent until the patient receives medical attention according to his level of risk. With these results, we aimed to optimize the use of the resources of the emergency units by applying the proposed model to reduce operational costs, make medical care more welcoming, humanized and accurate.
The present study is organized as follows: Section 2 discusses a review of the Manchester protocol and presents the characteristics of the emergency unit, such as the waiting time until medical care, and the clinics attended, and methodology adopted. Section 3 reports on the detailed results from the data, and describes the modeling results, comparing different distributions, through the Bayesian information criterion (BIC), selecting the statistical model with most adherence and the co-variables. Finally, Section 4 shows the obtained conclusions.

BACKGROUND
In this section, we present an overview of the MTS, details about survival analysis techniques and the chosen distribution used for the data modeling.

Manchester Triage System
The Manchester Triage System was firstly considered in Manchester in 1997. Afterwards it was implemented as a standard in the United Kingdom. The MTS has a list of 52 pre-defined conditions that, combined with patients' complaints, are divided (see Table 1) in the following categories: Although the MTS is a worldwide triage system, various triage scales have been adopted different countries such as the Australasian Triage Scale, Canadian Triage and Acuity Scale, Emergency Severity Index, to list a few [6]. In Brazil, triage systems were first recommended in 2002 by the Ministry of Health. Already in this ordinance, the international term screening was changed to risk classification, as it did not involve diagnosis, but just the prioritization in care, which was reinforced in the National Humanization Policy (NHP) of the Ministry of Health. In 2008 the MTS was implemented in a Brazilian hospital in Minas Gerais and since then has been considered as triage system in all states.
Silva et al. [14] presented an interesting view about the use of MTS in Brazil and argued that "The data support the conclusion that efficient use of health communication and information strategies within emergency units of the Unified Health System can have a significant bearing on patient satisfaction with the service provided". In this regard, the MTS provided good patient satisfaction with the service provided. Other recent studies in the Brazilian context can be seen in [7,10,14].

Survival Analysis
Survival analysis is a statistical branch that involves modeling time to event data; this time can usually be related to one or more events. In this context, the event of interest is the attendance for medical care according to the classification system of the Manchester Protocol.
Although different approaches can be made to study the occurrence of an event of interest, our focus here will be in the parametric approach. This choice allows us to fit a simple parametric model to describe the event of interest. The parametric approach is widely used specially due to its well known and important Normal and t-student distributions. However, in many situations these distributions cannot fit the data properly, due to the presence of skew data. These data can be further modeled by more flexible distributions such as Weibull, Exponential, Logistic, Lognormal and Loglogistic. The survival analysis also includes covariates when the response variable is time to event data, i.e., variables that help us explain changes in the response, a simple case can be given by where ε = (ε 1 , . . . , ε n ) is the vector containing the individual errors, ε 1 , . . . , ε n are independent and identically distributed with a particular distribution, X are the explanatory variables with n × p size, β ∈ R p and σ > 0 . In this case, we have that T has a lognormal distribution and the probability density function is given by It is worth mentioning that this was implemented in the package Survival in R.

EMPIRICAL ANALYSIS
In this section, we present a descriptive analysis of the considered dataset. The dataset refers to a hospital located inland in São Paulo state, Brazil. The period considered was from March 1st to August 31st, 2016, containing a total were 38,699 patients, in which 26,816 were adults (approximately 69%) and 11,883 of children (almost 31%).
Patients attending in the hospital were included in the database system and classified according to their risk. The classification frequencies were divided respectively into five color categories: blue as not urgent; green as slightly urgent; yellow as urgent; orange as very urgent and red as an Emergency. Figure 1 and Table 2 summarise the dataset frequency as described, given its classification risk.  It is important to mention that based on this information, the directors make decisions toward reducing the waiting time inclined to improve the provided service. In addition to the MTS classification variable, the data set also contains another two explanatory variables that are important to describe the time to attend. Therefore, the covariates are: • Classification: Not Urgent: Blue, Slightly Urgent: Green, Urgent: Yellow, Very Urgent: Orange and Emergency: Red.
• Clinic: R: Adults and I: Children.  It can be observed from this figure that the afternoon period presents the highest frequency. Moreover, it also shows that the amount of adult attendance is only higher than the children attendance during mornings between 06:00 and 11: 59. Table 3 presents the descriptive statistics divided by the Period of the day and Clinical variable. As can be seen from Table 3, the median and mean are very different showing positive skew data. Moreover, we can observe that in some periods the adults are attended more quickly than the children, while in other periods the opposite can be observed. expected to be more chaotic during the services between 12:00 and 17:59. Besides, children tend to be attended more quickly in the Yellow and Orange groups.
Thus, the constant presence of attendances which exceeded the recommended time elucidates the importance of improving the patient's condition awaiting care. Table 4 segregates these patients by clinic type, showing a kind of reverse flow. Adults with more serious injuries tend to wait for more than children.
The results obtained from these descriptive analysis highlights the divergence between the risk classification groups, as well as their behavior over time. The next section will incorporate an approach based on parametric modeling to describe the time of attendance.

MODELING RESULTS UNDER PARAMETRIC MODELS
We considered different parametric models to describe the data set presented. These results were calculated through software R (R Core Development Team). The survival package was used that contains the regression models considered in this study. The estimates were obtained without needing initial values. The estimation procedure considered in this package is briefly described in the next session.
It is essential to mention that only 79 patients were classified as an emergency (red color) in this database. In these cases, they were immediately attended as the recorded times were 0, showing that attendance in this classification followed what was established by the MT protocol. therefore this category was not included in the modeling.
Regarding the parameter estimators of the proposed model, many different inferential procedures could be considered in this study (see, for instance, Bakouch et al. [2] or Ramos et al. [11]), however due to the large number of observations the different estimators will return similar results. Therefore, we considered the MLEs as they are implemented in R packages.

Model Selection Criterion
Different probability distribution will be considered to describe the proposed data. Therefore, a discrimination procedure is needed in order to select the most efficient model. Thus, Schwarz [12] proposed a selection method based on the Kullback-Leibler Information measure to discriminate different distributions. Let k be the number of parameters to be estimated, n the number of observations of t and θ an estimate of θ , the Bayesian information criterion (BIC) which is obtained by BIC = −2 log(L( θ ;t)) + k log(n). (4.1) Given a set of candidate models for T with already adjusted data, the preferred one will be the model that provides the lowest BIC. In addition to selecting a good fit, the criterion penalizes the addition of parameters, discouraging overfitting, that is, the selection of an extremely complex model with many parameters that has a poor predictive performance. Table 5 presents the results for the BIC considering the Exponential, Weibull, Gaussian, Logistic, Lognormal and Loglogistic distributions. The full model for each distribution was considered, i.e., the model with all covariates. Based on the results elucidated in Table 5, it can be observed that the Lognormal has the best fit to the data set. Furthermore, using the Lognormal distribution we considered the BIC to check either the presence or the absence of interaction between variables (see Table 6). As it can be seen from Table 6, for the proposed data set, the model with interaction between X2 and X3 returned the smaller BIC and should be used to describe the proposed data. Therefore, we can conclude that there is an interaction to describe the response depending on the office hours and if the patient is an adult or a child. Table 7 presents the estimates of the parameters that were significant to the model. The covariate X1 represents Classification, X2 -Clinic e X3 -Period of the day.

Selection of covariates
The residual analysis was conducted and is represented by Figure 4, where the left one corresponds to the histogram and the right one the quantil-quantil plot. The residual analysis seems to  It follows that we can easily calculate any statistics, such as different levels of probability, the expected value, standard deviation among others based on the predefined functions available in R.
To illustrate the adjusted model, in Figure 5  As it can be seen from Figure 5, the MP enables medical care to be assertive given the severity of patients conditions. In this case, as the classification increases, the faster the patients receive medical care. In the risk classification, Yellow and Orange (Urgent and Very Urgent) the children's group showed a probability to be attended more quickly than adult's group. Regarding the Blue and Green groups, we observed that the curves overlap, i.e., the probability to be attended if the patient is classified as blue or green is almost the same. Table 8 presents the percentage of time until the care took more than the pre-established period. This analysis is an essential metric in order to verify if the hospital is providing care for the patients according to the maximum time described in the Manchester classification. Using the proposed model, a product in which the patient can check the necessary time to be attended can be developed based on explanatory variables.

APP PROTOTYPE -DIGITAL PRODUCT DESIGN AND ITS WORKFLOW
In this section, we present the process flow of the data considered in the software development in the proposal called Life Care, as well as some part of its interface. According to the adjusted model, the next step to be developed will be an application for medical care applied in emergency units. The application is intended to notify the patient of an estimation of waiting time, associated with a probability, conditioned to its risk rating. Figure 6 demonstrates the data flow in the Life Care application, thus the input of the variables, risk classification and clinical type are collected after the statistical modeling is applied, resulting in the service estimation time. The prototype application which we called Life Care, has a modern interface with minimalist patterns between fonts and icons and therefore it is simple to handle and intuitive. Figure 7 illustrates some outputs of the prototype, in which the first two images refer to the patient's response, i.e., the description of his/her age category (Adult or Child), as well as the patient's perception of urgency (Emergency, Very Urgent, Urgent, Slightly Urgent, Not Urgent). Based on these variables, the model will predict the waiting time for care. Note that the patient has to insert the information related to the classification in the MTS. Therefore, the estimate will be presented in this circumstance. As the patient does not have the necessary training, the classification of the necessary time may differ depending on the classification obtained by trained professionals. As a future proposal, we intend to extend the collection of user geolocation information through the application including the possibility to filter nearby hospitals that make use of this model. Therefore the patient can verify which unit will provide care more quickly.

CONCLUSION
In this work, we proposed a probabilistic model that can be used to estimate the time of patient attendance in emergency care units under the Manchester Triage System. The model adjusted under the Lognormal distribution with regression structure can be used to describe the different levels of probability precisely related to the time spent until the patient receives medical attention according to his/her level of risk. According to these results, we aimed to optimize the use of resources of the emergency units, through the application of the proposed model to reduce operational costs, make medical care more welcoming, humanized and accurate.
Future studies will explore the improvement of this classifier, in which other variables could be included, especially the particular factor (different data from hospitals between regions and cities), or even the possibility of historical clinical antecedents. Moreover, more general models such as generalized gamma, generalized Weibull or generalized Lognormal distribution can be considered in the analysis. In the application prototype, we intend to include the user geolocation allowing the user the possibility to filter nearby hospitals that make use of this model. Thus, the patients will be able to verify which units can provide care more quickly.