Genetic Algorithm Based Automatic Out-Patient Experience Management System (GAPEM) Using RFIDs and Sensors

This article introduces a novel framework which combines the outputs from Radio Frequency Identification (RFID) technology, the automated outpatient feedback survey form, Hospital Management Information System (HMIS) and sensors to develop an automated patient experience management system (PEMS) using a Genetic algorithm (GA). The output from the RFID tag is the time spent by a patient at various stations in the hospital. While the output from the automated survey is an overall satisfaction index (OSI), which is the overall experience (in the form of a number) a patient has during his/her stay in the hospital. HMIS has details regarding the structure of the hospital; this includes details about doctors, nurses, rooms, location of various departments, etc. In addition, environmental conditions (temperature and humidity) from installed sensors are used to capture the physical context of the patient’s experience. To develop an automated PEMS GA is used for computing the patient experience. The collected data (timing information, HMIS and sensor data) is given as input so that the GA generates optimized weights which are then applied to the final PEMS to automatically produce the overall satisfaction index best matching with OSI. This proposed framework reduces the time taken by manual statistics by automating the complete interaction of patient and hospital staff at all stations. The experiments are performed using the developed tool, in a local hospital, and the results demonstrate an accuracy of 80.3%. This accuracy gives a good indication to hospital management in real-time to take measures in areas where the patient experience is going relatively low.


I. INTRODUCTION
Healthcare service providers are focusing on providing automated services to patients. In this era of digitization, people, irrespective of their socioeconomic demographic [1], backgrounds, prefer their work to be automated as opposed to waiting for manual tasks to be performed. When a patient enters a hospital, he/she has to follow certain steps before reaching the doctor.These steps include: patient registration, vitals checking etc. These tasks are performed manually thereby increasing delays and, in turn, causing discomfort to patients who have to wait a considerable amount of time The associate editor coordinating the review of this manuscript and approving it for publication was Vyasa Sai. even before their examination or consultation starts; this significantly impacts service quality [2]. Many studies have shown automation in healthcare industry but they have not catered the automatic ways of emotional characteristics of the patients [3]. In recent years the perspective of patients and hospital management regarding hospital services is gaining more importance in order to improve healthcare systems either at individual level or at managerial levels. Due to a large number of patients and comparatively fewer hospital facilities, patients have to spend a considerable amount of time waiting for their turn, where the actual consultation/examination time is significantly less than the wait or the queue time. This, in many cases, irritates the patient and affect the patient-hospital relationship with regard to trust, VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ care and satisfaction [4].Patients shall be treated as customer and they shall be facilitated by a proper recommendation system [5], [6], which gives on time suggestions to the hospital management regarding issues patients are encontering with the hospital services [7]. The patient satisfaction survey is a useful tool for hospitals to gather necessary feedback on the patient's experience. In broad-spectrum there exists no recognized methods in measuring patient satisfaction. Traditional methods have used statistical analysis of feedback from patient surveys. This manual survey approach decreases the possibility of collecting realistic responses as during the time of the survey the patient may be, for instance, agitated or frustrated by a long wait [8]. In addition, the assessment process can only commence once all the data has been collected, thereby, delaying response to issues that need to be dealt with on a real time basis. Furthermore, there is a need to focus on certain important attributes while designing a survey as some patients will not want to fill the survey form if they feel it is not dealing their particular issues [9]. The increase in the handling of big medical data at the managerial level, along with the development of scientific techniques in healthcare, enables researchers to focus on automation instead of using a manual survey process [10], [11]. keeping in perspective this important issue, we have defined our problem statement as to develop a system which uses automatically acquired digital patient data (RFID timing information, HMIS details and sensor data) and then using an intelligent algorithm trained on survey data of sampled patients and their digitally acquired data automatically generates a patient experience index (OSI) for every patient visiting the hospital. In order to automatically generate the patient experience index (OSI) for all patients a Genetic Algorithm based Automatic Patient Experience Management System (GAPEM) is introduced in this research that uses data from RFID, HMIS, sensors and an electronic survey app developed for outpatient feedback form. To develop GAPEM, RFIDs are installed at five different stations (Registration, Vitals, Doctor, Laboratory, Pharmacy,) of a hospital.A RFID card is given to each patient which he/she swipes on a RFID machine placed on each station in a patient's journey. The time of arrival of the patient at each station is saved in a database. After the patient is done with the treatment, he/she is asked to fill an electronic survey form on a Tablet PC regarding his/her overall experience at the hospital. HMIS has all the details regarding the hospital structure, information on the doctors, nurses, location of various clinics, etc. Ambient temperature and humidity are measured using sensors installed at the main waiting area.The collected database has timing information, Overall Satisfaction Index(OSI), information from HMIS and data from sensors. This data is input to train GA which is a soft computing metaheuristic search algorithm inspired by Charles Darwin's theory of natural selection [12]. The fittest individuals are selected for reproduction to produce offspring for the next generation. The biggest advantage of using GA is, it gives optimal values in lesser iterations, and it well suited for skewed data, where other evolutionary algorithms fails.
GA generates the optimized weights which are then used in the final PEMS to automatically generate the OSI instead of taking feedback from all the patient every time. As it is difficult for the all the patient to fill the survey form, this system asks a few patients to fill the electronic survey form, and, based on their response generates an automatic patient experience management system which gives the OSI for all the patients. The output of the system shows overlapping between the actual and predicted results which conforms the achievement of the proposed framework.

A. RESEARCH CONTRIBUTION
GAPEM is unique from previously published work, as it makes the following contributions to healthcare monitoring, and research: 1) It uses RFID technology to save patients time at each station which is further used by the GA to generate overall satisfaction index. Previously, RFID tags were used for object identification, tracking, and security purposes, etc.
2) It provides android application for conducting automatic patient experience survey data collection with real time analysis, which is normally done using a paper based manual survey and then statistical analysis are performed on the collected data. 3) It uses sensors to check environment temperature and humidity, these sensors are normally used for security purposes. 4) The collected data is used to check congestion at various stations by checking queue time and the actual process time.

B. IMPORTANT CONCEPTS
Patient Experience defines a person's experience of illness and how the healthcare system treats him/her. Patient experience management has become a crucial ''Quality'' attribute for healthcare service providers [13]. PEM encompasses a range of interactions that a patient has with healthcare facilities, e.g. including health services, interaction with staff, nurses and doctors [14]. Radio-frequency identification (RFID) uses electromagnetic fields for automatic identification of objects and data capture (AIDC) with RFID tags attached. There are two types of tags: active tags and passive tags [15]. These tags are used to track medical equipment, control special hospital equipment, collect information from patients, track patients while revealing and confirming identity, and automatically collect and transfer data. RFID reduces the risk of error made by employees. The use of recent technologies like RFIDs, sensors and IOTs improves the way of living [16].
The rest of this article is organized as follows: Section II describes the literature work, how RFIDs are used in hospitals, how patient experience survey performed previously, how genetic algorithm is applied to medical datasets. Section III describes the methodology, Section IV describes the attribute selection, Section V explains in detail the GAPEM, Section VI describes the results and discussion, Section VII concludes the paper.

II. RELATED WORK
Patient satisfaction survey is an important and prioritized indicator in the healthcare industry. It deals with both tangible (hospital process) and intangible aspects (patient related) that need to be investigated for better clinical outcomes [17]. Liu et al conducted a survey in 65 hospitals and collected results from 18,329 patients. The questionnaire consisted of 7 different parts with 40 questions in all. Patients gave rating from 0 to 10 to all the questions after which they selected an option of either a patient is happy (recommend) or unhappy (not recommend) with the hospital. According to this system, data preprocessing for missing values is done through binary dummy indicator. Random forest algorithm is used for the prediction. It is a tree based structure well suited for survey data as the variables are either binary or ordinal. Results from random forest predicted happy and unhappy patients with the feature set involved in the decision. Bootstrapping extended the minority class (unhappy patients p = 5%) as many classification models overlook minority classes. More deep down analysis is done through local explanation method (lazy lasso) for the unhappy patients. Lazy lasso is built for each unhappy patients to capture important features that influence their satisfaction. The individual results from lazy lasso are joined with the local explanation method to show the set of attributes which helped the service providers to take the corrective actions [18].
Wan et al, conducted a questionnaire-based study to collect patient experience data for a hospital. They focused on 7 departments with 300 patients. A scale of 0 to 5 is used for ratings. In this research process Pearson correlation is used to derive the correlation between attributes of happy and unhappy patients through their ratings. The team also described the six V structure (Volume, Velocity, Variety, Veracity, Value, Validity) that plays an important role in patient satisfaction. Clinical performance is highly dependent on a strong relationship between patients and hospital staff. A relationship is derived through a ''patient-centric measure'' and a ''expert-centric'' measure. These two measures from the survey are, vectors, used for ''the cosine measure''. Schulze's algorithm merged the ranking given by the patients and the experts. The output of the algorithm is the ranked sequence which has no conflict with the expert opinions [19].
Bouamrane et al, developed an intelligent patient modelling system using Ontologies. They transformed the simple mechanical system into a knowledge aware system. The issues with simple questionnaire based statistical analysis systems is that they are rigid as they ask only preplanned questions and save the answers into the database. There are situations where a single question needs to be broken down into further questions. This concept of question breakdown is used to develop a rule engine based on ontologies. The questions ranged from 30-90 because of the adaptive nature of the system. The system worked as follows; patient answers the current question; action manager dispatches answer to the adaptive engine which consults the questionnaire ontology to bring the next question which is returned back to the action manager. The system GUI then displays the next question. The action manager then sends the current question and answer to the patient modeler class whose purpose is to develop the patient semantic medical profile [20].
Yadav P. conducted a survey for capturing patient experience and developed a simple questionnaire with 11 questions on a three-point scale. 26,991 patients participated in the survey. According to this method the questions are about medical care in emergency, nursing stations, laboratory services, cafeterias, housekeeping, overall behavior of staff, the admission process, discharge and the environment. There is a separate option in the questionnaire about overall experience in the hospital. According to the study conducted by Yadav P, the statistical analysis of the data showed nursing care as the best rated service among others in the hospital. Environment, admission process and housekeeping needed constant improvement [21]. Safdar et al, conducted a qualitative survey on healthcare epidemiology. He argued that the qualitative survey method was easy to conduct in hospitals. He also focused on considering key issues while conducting a survey [22].Jui-che Tu et al, conducted a survey using a questionnaire for diabetes 2 patients. The survey was planned using face to face interviews. The questions were about different attributes of the hospital services to check whether a patient is happy with the hospital or not [23].
Sadeghi et al, discussed the need of necessary infrastructure and readiness of the organization before implementing RFID in hospitals. It is the norm that whenever some new technology is introduced every organization wants to implement it without considering its readiness towards the new infrastructure. Hospitals that are located far away from cities do not need new technologies like RFIDs, as their target patients are not that literate and they have limited resources. Sadeghi highlighted three factors which need to be considered before implementing RFID technology in hospitals. They conducted a survey based study with 21 questions about the three variables that include the organization and its cultural and human resource readiness. LISREL statistical software package is used to analyze the data. Results showed high correlation between these factors. Readiness of these three factors can provide a strong base for the success of RFID in the hospitals [24].
With the increase in the number of patients worldwide, chances of mistreatment due to medical errors also increase, therefore patient safety must be highlighted, as a dominant and life threatening health concern [25]. A majority of medical errors are due to misidentification of specimen and incorrect blood and drug transmission which results in mistreatment of the patients [26]. To address these issues RFID technology is being used to automatically identify each patient within the hospital. Other uses of RFID technology are patient tracking, patient monitoring and drug compliance. Patient identification is done through a RFID smart wristband VOLUME 9, 2021 with a tag inside. Most of the time spent by patients in the hospital is the waiting time. Patient tracking through RFID has the capability to reduce this wait time by automatically displaying the station where the patient is. This also helps the hospital staff in reducing the wait time and resource utilization as they are aware of which patient is done with his/her treatment thereby identifying the space available for other patients. Patient monitoring and drug compliance is done using RFID with sensors. This is mostly available for handicapped and bed ridden patients [27].
Lilac et al, developed a clinical decision support system (CDSS) using RFID technology and simulation modeling. RFID worked as a resource tracking system to collect real time data about the movable resources. These resources included patients, staff, equipment's, beds/statures, etc. Simulation modelling provides an environment where hospital officials can easily track the utilization of proper resources between different stations and can easily identify congestion among them. Decision Trees were developed to provide recommendations on the simulation results. In this system RFID readers are set up at various departments of the hospital and a RFID tag is given to each resource which notifies its flow within the hospital. The system also shows the flow of patients at various stations and calculates the actual process time and the wait time. Patient wait time is directly connected to the clinical performance. This performance is dependent on different variables including nurses, receptionists, doctors, beds, etc. This CDSS is able to identify which resources are needed in which department at what time, thus decreasing the wait time of a patient and increasing clinical performance [28].
Turc et al, developed an RFIDTrackerSystem (RTS) used to track objects (patients, staff, beds) in the hospital. The developed system is divided into two parts: the first part describes the potential of RFID used in patient identification, anti-counterfeiting for drugs, inventory management and tracking entities. The second part describes the RFID systems deployed in various countries, such as: RFID and medication compliance in Finland; RFID and blood transfusion in Italy; RFID and SARS in Taiwan, etc. The second part also identified the components that RFIDTrackerSystem (RTS) consisted of: passive tags, fixed RFID readers and pocket PC and a mobile phone with RFID reader attached. RFID tags are given to patients (wristband with a fixed RFID tag storing information like blood type, allergic medicines, health history), and the nurses/doctors/staff (RFID card storing employee ID). RTS is able to track which patient is in which department of the hospital [29].
Yeung et al, designed and developed an RFID patient tracking and mobile alert system (RPTMAS), that focused on the problems of hospitals being overcrowded and under staffed, and issues of patient's safety and comfort. To overcome these issues, RFID technology was merged with mobile technology to maximize patient comfort. This system works on a five tier model: device (mobile phone), application (location awareness), communication (RFID technology), data analysis (decision support system) and backend tier (repository). Apart from the patient tracking facilities this system generates a two-way alert message. When a patient visits a sensitive area where only staff can go or stays at a place more than the usual time, the system generates an alert message on the staff mobile with the patient's ID. When the staff cancels an appointment or there is an increase in the waiting time the system generates an alert message on the patient's mobile [30].
Genetic algorithm (GA) implementation can be seen in various medical diagnostic systems. The GA medical systems are; heart attack prediction system, tumor detection system, brain tumor detection system, breast cancer detection system, etc. [31]. Ghaheri et al, discussed in detail the use of Genetic algorithm in almost all fields of medicines such as radiology, oncology, endocrinology, pediatrics, gynecology, surgery, orthopedics, pulmonology, neurology, etc. [32]. GA is used to find the weights for NN as it discovers the good set of weights in fewer iterations. The dataset consisted of 303 patients with 14 attributes. Data transformation is used for data preprocessing. Min-Max normalization is applied on preprocessed data. The results are passed on to the weight optimization engine. These weights are stored in the weight base and are used by the training engine to predict the cardiovascular diseases. Classification accuracy of this system is 94% [33].
Cervantes et al, discussed the classification problems of imbalanced datasets, in which one object type has more occurrences and the other has less. Normal classification algorithms such as the support vector machine do not work well with these type of skewed datasets [34]. Genetic algorithm with the support vector machine is used to solve classification problems of these datasets. First the dataset is divided into training and testing subsets. Then SVM is applied on training data to find support vectors. Then GA is used to find new data near support vectors until the performance criteria is achieved. Results showed that classification accuracy increased by this method. Varpa et al, implemented GA for weight selection on a medical dataset. The dataset consisted of 951 patients with 176 attributes. The objective of GA is to find the most important/frequent attributes among all the patients. Population size of 21 is selected using three different machine learning methods for population evaluation; named as nearest pattern method (ONE), attribute weighted KNN method using neighbors class based attribute weighting (cwk-NN), attribute weighted KNN method using one versus all the other classifiers (wk-NN OVA). Dataset is divided into 10 equal sized subsets: 6 for training and 4 for testing. After initializing population size, roulette wheel selection method selects chromosomes with highest fitness for crossover. Elitism with (1%) is used to preserve best individuals for further runs. Crossover with probability 0.8 and mutation rate of 0.01 is used. GA converged after 20 generations with best classification accuracy using cwkNN [35].
Jafari et al, presented a hybrid approach for brain tumor detection using support vector machine(SVM) and genetic 8964 VOLUME 9, 2021 algorithm (GA). To select informative features, among a set of three feature sets (Statistical, Fourier and Wavelet) the genetic algorithm is used. Optimal features are then given as input to support vector machine to detect which brain tissues are normal and which are abnormal. The system worked as follows: Median filter is used to remove noise from the images. Histogram equalization is used for contrast enhancement to separate normal and abnormal images. Next, the segmentation process differentiates the brain from the skull. Feature selection is done through GA and the fitness function used is MaxRelevance and Min-Redundancy. SVM used linear function and quadratic programming for classification of brain tumor cells [36].
The most annoying feature for a patient in the hospital is the waiting time. Usually, the actual process time is less than the waiting time. Patients are standing in long queues before the actual process starts [37]. To overcome this situation Podgoreleca et al, developed an automated scheduler system that used genetic algorithm and machine learning techniques. The system is deployed in a physical therapy department of a hospital. The system is divided into two subsystems: a task component (genetic algorithm that generates schedules) and a learning component (to find optimal parameter values that affect the execution of algorithm). The learning component determines the population size. The fitness function selects the individuals for next generation based on constraints (time related to devices and patients, including waiting time and idle time). The selection criteria used is modified exponential ranking. The individuals with minimum fitness are passed onto crossover that uses single point; but changes its location after every generation to produce a new offspring. Mutation probability is set to 0.003 up to 2.7 %. The system has the ability to reschedule appointments if any patient has a problem during therapy or cancels his/her his appointment. The system has a strong feature of rescheduling the activities with minimum waiting time. This is a prodigious issue with all schedulers, however, this system performed quite well due to the diversity retained in the population [38].
S. Durga foresees the interconnection of sensors with healthcare devices to develop a new set of applications depending on medical data handling. These machine learning algorithms, when applied in the healthcare domain, helped health professionals to better monitor and diagnose diseases and also focused on areas of the problem, and propose on time solutions. Different machine learning algorithms are discussed with their pros and cons in different healthcare situations [39]. Y.A Qadri et al, highlighted the relevance of the Internet of Things (IoT) in improving the healthcare industry. This vision led to the development of H-IOT systems. ''The basic enabling technologies include the communication systems between the sensing nodes and the processors; and the processing algorithms for generating an output from the data collected by the sensors'' [40]. The use of Artificial intelligence and machine learning algorithms in H-IOT has improved the Quality of Service (QoS). ''New technologies such as Internet of Things (IoT), Augmented Reality (AR), Virtual Reality (VR), Mixed Reality (MR), virtual assistants, chatbots, and robots, which are typically powered by Artificial Intelligence (AI), are dramatically transforming the customer experience'' [41], [42]. The literature on patient experience management focused more towards statistical ways of generating the overall satisfaction index. There are many issues in conducting these manual surveys, such as entering large amounts of data, no real time tracking of patients, late response of surveys, delay in improvements, etc., [17]- [23]. RFIDs are used in hospitals for patient identification, anti-counterfeiting for drugs, inventory management and tracking entities [24]- [30].
Different machine learning algorithms are used to focus more towards the development of automated health care diagnostic systems which are used to diagnose certain diseases or for online appointments [31]- [38]. Researchers influenced the use of sensors and other AI powered technologies like HIOT, virtual reality, augmented reality, etc., [41], [42]. So, there is a need of a system which benefits from smart technologies like RFIDs and machine learning algorithms to automatically generate a patient experience management system to fulfill the patient's needs on timely basis, as this is a key quality indicator for health service providers.The details of the proposed work are given below. It uses three different techniques to capture patient experience. The collected data is used to train GA to generate final PEM system.

A. GENETIC ALGORITHM BASED OUT-PATIENT EXPERIENCE MANAGEMENT SYSTEM 1) TECHNIQUES
It uses RFID technology to save patients time at each station. It uses android application for capturing electronic patient experience survey data with real time analysis. It uses sensors to check environment temperature and humidity.

2) DATASET
The dataset collected are: Data from RFID (time related information of each patient), Patient experience from survey application. Data from sensors and HMIS is also incorporated.

3) ALGORITHM
Genetic algorithm is applied on the dataset to generate the overall patient experience management system. To the best of our knowledge, there is no framework published in literature which combines the data from RFIDs, sensors, HMIS and electronic survey application to generate the OSI using GA. A benchmark table is shown in table 1. It shows year wise details of work done in medical datasets including the techniques applied, the datasets used and the limitation of each. The last row of the table shows the details of the proposed work.

III. PROPOSED METHODOLOGY
When a patient enters a hospital, he/she has to go through various stations, such as registration and vitals checking before reaching to the doctor. Figure 1 shows the complete detail of each step. It is clear from the Figure that at each station a patient has to either wait for his/her turn (in the sitting area of each station) or has to stand in queue for registration. This waiting time annoys the patient. It normally happens because of manual work performed at each station. After the patient is done with the treatment from the hospital, an outpatient feedback form (survey form) is given which has some questions relating to the overall experience at the hospital. This again is a tedious task for all the patients as some of the patients are in a hurry and cannot fill the survey form. On the other hand, answers to these surveys reflect the quality of service, a hospital is providing to its patients. The hospital management needs real time analysis of the survey answers to incorporate improvements at a weaker stations on a timely basis. These are the key attributes which can destroy a patient-hospital relationship. So, there is a need of a system which takes data from a few patients and trains the algorithm to automatically generate the overall satisfaction index. This research proposes the automatic generation of patient experience management system using a genetic algorithm. Figure 2 shows the proposed framework. It has two parts: the first part deals with data collection and the second part deals with the application of the genetic algorithm on the collected data. Data collection is done using RFIDs, HMIS, sensors and an electronic survey. All data is merged into one database for correlation using the GA. The results show whether a patient is satisfied with the hospital services or not based on the generated OSI.

A. DATA COLLECTION
The first part of the main framework is presented in Figure 2. The detailed conceptual framework for data collection of the proposed methodology is shown in Figure 3. It has five tiers: device, application, communication, data application and backend tier. The first tier deals with the hardware used in the framework which includes the RFID machine, laptop, tablet PC, smart phone and sensors (temperature and humidity). The framework uses the ZKTeco model K30 RFID machine which uses EM cards of Low Frequency (LF) of 125 KHz. These cards are low powered (as mentioned above) and are safe to be used in the hospital as these cards/tags are just swiped on the stations machine. The second layer deals with the applications built using hardware shown in Figure 4 and 5. The third layer defines the technologies used for communication. The fourth layer collects data from different sources and the fifth layer saves all the data in the repository.
The details of these layers are: RFIDs at five different stations (Registration, Vitals, Doctor, Laboratory, Pharmacy) are installed. A RFID card is given to each patient which records some basic information (name, MR No., disease, blood group, age, address, allergies) regarding the patient when he/she first registers -as shown in Figure 4 [43]. The GUI of RFID has three tabs: Basic Information, Addition and AC information. The 'Basic Information' tab saves the basic patient's information as mentioned above. The 'Addition' tab saves the history of disease(s) and allergies of the patient. The third tab deals with the account history. When a patient enters a hospital, instead of standing in queue for registration and his/her turn, he simply swipes the card at each station's RFID reader which records its time and location. The RFID card is swiped three times at each station and the RFID system's database records the time.    The above equations calculate the waiting time and the actual process time. The real time location of the patient can also be tracked using this framework, as when a patient swipes the card the station ID is also saved in the RFID database. After the treatment, a patient is asked to fill the electronic survey form on a Tablet PC. The survey application is developed using Android technology and the data is saved in a wamp server, as shown in Figure 5. Each patient is given a Tablet PC on which he/she enters the MR No. (Medical Record number) on the first screen. The second screen has 18 questions regarding six stations shown in figure 5.The patient is asked to rank them between 0 to 5 with 0 being the worst and 5 the best. At the end of the survey the patient is asked to rank the overall satisfaction index that also has a scale of 0 to 5. This electronic survey application helps the service providers to check all the weak services at each station with this on time analysis. The survey results are saved in the survey application database. The fifth layer saves the data from both the applications and the combined database is used for developing an automatic patient experience management system using a genetic algorithm which determines whether a patient is satisfied or unsatisfied with the hospital.
The dataset that we have used consists of 200 patients of a private hospital.The dataset is in two parts. The data of 120 patients is used for training and the remaining 80 is used for testing data. The MR No. is the medical record number of each patient against which all the timing information, OSI, HMIS details and sensor data is given.

IV. ATTRIBUTE SELECTION FOR GENETIC ALGORITHM
One of the main contributions of this research is the formulation of a PEM calculation model in order to find the overall patient experience. Six attributes (R1, R2, V1, V2, D1, D2) of three stations (Registration, Vitals and Doctor) are considered for this purpose. The attributes of these stations are selected because a patient has to go through each one of these stations. Patients may or may not go to other stations, such as the pharmacy and laboratory. Calculation of these attributes is shown in Table 2. R-AT is the patient arrival time, R-PS is the process start time and R-PE is the process end time at the registration station. The same attributes are used for Vitals and Doctor's stations. These attributes represent the actual process time a patient spends at each station. R1 shows the process start time, R2 represents the process end time; V1 shows the vitals start time, V2 shows vital end time; and  D1 shows that the patient is in the doctor's room, D2 shows that the patient has come out from the doctor's station.
Equation (1) RPS is the registration process start time, RAT is the patient arrival time at the registration station.

Process End Time−Process Start Time
RPE is the registration process end time and RPS is the registration process start time. Likewise, attributes for vitals and doctor's station are selected. R1 and R2 are the attributes of the registration station, V1 and V2 are the attributes from vitals and D1 and D2 are the attributes from the doctor's station. So the R1, R2, V1, V2, D1, D2, therefore, represents the six attributes used to train GA. We conducted two experiments, one with the timing data, HMIS, OSI and the other with the sensors data, HMIS and OSI. Both had similar results. Details of the experiment with timing data are shown in this article.

V. GAPEM
Optimized weights for all the attributes are required to calculate the PEMI (Patient Experience Management Index (OSI)). To calculate the optimized weights for the selected attributes, a soft computing technique called Genetic Algorithm (GA) is used [44]. Figure 6 shows the steps of the genetic algorithm. First we calculate the fitness function using RFID data and OSI then GA operators are applied to develop the final PEM. Genetic algorithm starts with the initial population; each of the population is basically a solution to the problem that we are working to solve.A chromosome is an individual composed of factors known as Genes. Genes are combined together into a string to form a chromosome (solution). In this work the genes are attributes, and the chromosome is one sample composed of six attributes and the collection of chromosomes is the population. Among the population each individual chromosome is multiplied with the dataset and minimum fitness is calculated for all the chromosomes. The best chromosome with minimum fitness is chosen for developing the GAPEM. The GA algorithm is used to find the optimized weights which are then used for the final PEM model. Figure 6 shows the flowchart of the GAPEM. The flowchart describes the steps involved in developing the GAPEM. To build a model, the weights for the attributes are important. These attributes with the weights from the GA generate a PEM model by using equation (3).
Here [f1-f6] are six selected attributes and [w1-w6] are their respective weights generated by the GA. Details of the operational steps are as follows.
A. DATA NORMALIZATION Before applying the genetic algorithm the data is normalized in a range from 0 to 5, as the OSI value ranges from 0 to 5.

B. INITIALIZE POPULATION
In the genetic algorithm, the population consists of different chromosomes and the structure of each chromosome is important. In our framework, each chromosome consists of a 6-dimensional weight vectors W = W1, W2, W3. . . W6.. These weights are randomly generated and all weight vectors are normalized between 0-1. The initial population consists of 50 chromosomes with gene value of 6.

C. FITNESS FUNCTION
Fitness function, also known as objective function or cost function, is the mostly used criterion to increase or decrease the number of iterations based on the result. In our case, fitness function is the difference between PEMI which the model calculates and the actual OSI provided by the patient during the survey process. The objective is to find the optimal weight vector which provides least difference between both. Equation 4 is used to calculate the fitness function.
PEMI OSI is the actual satisfaction index given by the patient and PEMI model is the index the calculated by GA as shown in equation 1.

D. SELECTION
Selection is a GA operator which selects chromosomes for the offspring generation. The roulette wheel selection method is used to select chromosomes based on the fitness function value. In every iteration 20 chromosomes with the best fitness are preserved and 30 having the worst fitness function values are passed on for crossover.

E. CROSSOVER
In crossover, two parents are selected with the crossover location, that produces two new offsprings. The crossover used is a single point, but its location is different in every iteration, thus producing efficient results as compared to selecting one location every time. Figure 7 shows how crossover is performed with the crossover point set on the fourth location in the parent chromosome. The produced offspring is normalized before moving to the next generation. Crossover probability used is 0.65.

F. MUTATION
is also a genetic operator, it alters the values of two selected parents, i.e. swaps their values. But in our framework, mutation probability is set to 0% which means no change after crossover is performed. Once the cycle is completed a new population is produced by crossover which will again go through the whole process until the optimized weights are produced. Stopping criteria is different in genetic algorithm based on applications. It can be either a number of iterations or minimum error. In this article, a number of iterations is used as the stopping criteria. The algorithm stops at 100 iterations. The generated optimized weights are then applied to the testing data to find the accuracy of the developed model.

VI. RESULTS
The main objective of collecting and then analyzing the datasets is to automatically generate a patient experience management system that strongly maps and correlates the OSI given by the patient and the OSI generated through the system. Two datasets are collected, one is the survey data that gives the OSI, and the other is the RFID dataset that gives the timing information of the patient in the hospital. Both the datasets are used to train GA to find the optimized weights for the final PEMI system. Figure 8 shows the OSI given by the patients through the electronic survey. The OSI of each patient is saved against his/her MR No. which is further used to correlate with timing information saved in RFID database. Figure 9 shows the timing information of each patient and the OSI given by the same patient.The blue line shows the time spent by each patient and the red line shows the OSI given by the same patient. This data is used to train the GA. In order to build an automatic PEM model using the GA, the algorithm first finds the optimal weights based on the data structure i.e. for the six selected attributes. Generated optimized weights using GA are shown in equation (5). These are the weights which are now used in the testing data to generate an automatic PEM model.
PEMI _model = 0.056f 1 + 0.251f 2 + 0.087f 3 +0.195f 4 + 0.108f 5 + 0.303f 6 (5) The stopping criteria used is the number of iterations as discussed in the previous section. At the 20th iteration the GA converges and returns the best optimal weights with least fitness value for all six features and then there is no change in the genes of chromosomes. Hence, the value of best fitness(minimum fitness value) is the stopping criteria of the GA iterations. Figure 10 shows the fitness values against each chromosome in the population and the mean of all the fitness. The selected chromosome for final PEM has fitness value of 0.008983. We found strong correlation between the predicted PEMI and the actual OSI given by the patient in the survey. The graph in Figure 11 shows that both the predicted and actual results are almost overlappled which forecasts the success of a developed GAPEM. The blue line shows the actual results and the orange line shows the GA results. The blue line shows the actual OSI given by the patient and the orange line shows the predicted results calculated using the GA. To evaluate the performance of the PEMI model, two evaluation criteria are used : average error and accuracy. The error is calculated as the difference between the actual OSI and the predicted PEMI value, as mentioned before. The minimum average error validates the accuracy of the predicted PEMI. Equation 6 is used for the average error calculation for all N samples.
where N = Total number of samples In the proposed approach, the average error is used as a cost function. Figure 12 shows the graph for the error and the average error calculated for testing data. The blue lines show the error of individual samples and the red line shows the average error of all the samples. Equation 7 mentions the accuracy of PEMI Model and is calculated by dividing the total number of true PEMIs with N (total number of samples). In equation 7, true PEMI refers to all the correct predictions; which is calculated using two condition equations. The predicted PEMI is the value   calculated by the genetic algorithm. The actual OSI (value) is given by the patient through the survey application. If both the values are the same after rounding off the predicted PEMI, then we count PEMI as true otherwise it is counted as false. So, the accuracy is calculated by counting the number of true PEMI divided by the total number of samples.    Table 3 shows the average error and accuracy of both the training data and testing data calculated using the equations 6 and 7 respectively. The accuracy on the training dataset is 92% and the average error is 0.212. When the same optimized weights are applied to the testing data the accuracy is about 80.3% and the average error is 0.322.
The results obtained with the proposed methodology are significant. The proposed work eliminates the use of conventional surveys and reduces the hectic overload of staff working with paper, by using RFID technology. Based on the collected, each patient's satisfaction index is calculated which eliminates the need of conducting independent surveys. In addition, the proposed technique calculates the PEMI in real-time thus enabling the service providers to take corrective measures in a timely fashion.

VII. CONCLUSION
Quality healthcare is a global problem, where patients need solutions that are safe, patient centered, cost-effective and efficient with the promise of ongoing and persistent efforts for improvement [45]. Patient satisfaction and improved outcomes from healthcare are some of the main elements of quality. Identifying, understanding and addressing patient issues on time using automated healthcare systems in a safe environment without disclosing patient particulars and providing solutions in an efficient manner are the key to success for healthcare service providers [46], [47]. The proposed work identifies and understands the issues of patient problems and provides real time solutions, which hinders the actual efficiency. The framework automates the overall patient flow in a hospital by introducing RFIDs at each station (Registration, Vitals, Doctor) which records patient time and location. Automated patient experience is calculated using a genetic algorithm, which takes this timing information, HMIS, sensor data and survey data as input and generates optimized weights. These weights are then applied to the final PEM model to automatically generate the patient's overall experience (OSI). The system is efficient as the patient does not need to interact with the staff every time. Patients swipe their RFID card at each station which saves his/her time and location. The proposed system is helpful for the hospital management-especially in the case of congestion and limited staff patient flow can be monitored. Because of real time analysis, appropriate actions can be taken rapidly instead of waiting for manual analysis. The system is also very helpful in maintaining social distancing in case of viral diseases like (SARS, COVID) as each patient has his/her own card. They do not need to stand in queues and to interact with other patients while waiting [48].