Optimisation of Patient Flow and Scheduling in an Outpatient Haemodialysis Clinic

*Corresponding author: snwaneri@unilag.edu.ng doi: http://dx.doi.org/10.4314/njtd.v18i2.6 ABSTRACT: The demand for renal replacement therapy (RRT) from the growing number of patients suffering from chronic kidney disease (CKD) and end stage renal disease (ESRD) in Nigeria is reported to be on the rise. However, dialysis clinics are few with limited facilities to meet the increasing demand leading to congestion, long waiting time and increased length of stay (LOS) in dialysis clinics. This paper presents an optimisation model for scheduling patient flow in an outpatient haemodialysis clinic. The objective is to minimize patient LOS using Genetic Algorithm (GA), implemented in Python programming language with Spyder Integrated Development Environment (IDE). The model was tested using data obtained from a haemodialysis clinic, in Lagos, Nigeria. The model generated optimum LOS values (193.01, 275.02 and 390.01) minutes compared to the mean LOS values at the haemodialysis clinic (235.50, 296.62 and 424.50) minutes for the 3-hour, 4-hour and 6-hour dialysis sessions. Furthermore, a simulation experiment of patient flow in a typical haemodialysis clinic was performed by gradual variations in patient arrival rates, λ. Simulation results at (λ = 0.1, 0.2, 0.3, 0.4) revealed mean LOS (minutes) as (312.85 ± 73.45, 348.18 ± 84.89, 342.18 ± 81.30, 305, 28 ± 63.67) respectively. The optimisation model was effective in reducing patient LOS. .


I. INTRODUCTION
Haemodialysis is the most common renal replacement therapy (RRT) for patients suffering from chronic kidney disease (CKD) and end-stage renal disease (ESRD) in lowand-middle income countries (LMICs) (Bamgboye, 2003). The machine uses a dialyzer to eliminate metabolic wastes from the blood based on the principle of diffusion (Man et al., 1995). Unfortunately, lack of access to treatment accounts for high mortality from both CKD and ESRD estimated at over 2.3 million deaths (Liyanage et al., 2015). In addition to this, dialysis is overly expensive which is aggravated by the need for patients to undergo dialysis frequently. Usually, patients are frequently dialysed for about three times a week. (Adejumo et al., 2017;Chan et al., 2019).
Furthermore, only few haemodialysis centres are available in LMICs. With increased demand for dialysis, congestion and delays are common in the few functional dialysis centres available eventually leading to long waiting time and length of stay (LOS) which are significant determinants of patient satisfaction and quality of care (Ho et al., 2006;Ahsan et al., 2019). Extended LOS in haemodialysis clinics often leads to poor functional outcomes and reduction in the number of haemodialysis sessions (Collins et al., 2010;Liu et al., 2017). Also, most dialysis centres have no structured policy and strategies for efficient patient scheduling (Jafar et al., 2020). Consequently, effective optimisation of patient flow and scheduling has become necessary (Odubanjo et al., 2011;Ajayi et al., 2016). In a typical haemodialysis clinic, the patient needs to undergo various processes that often lead to long waiting times and LOS (Choi et al., 2017). Patients may be served based on any of the following queuing policies including first-come first served (FCFS), last-come first served (LCFS), service in random order (SIRO), round robin service (RRS) and priority service (Ayandele and Nnamseh, 2012). However, FCFS is the preferred queuing policy in most haemodialysis clinics largely due to its simplicity. Industrial and systems engineering strategies have been widely applied in health systems improvement as well reported in literature (Fei et al., 2010;Lee et al., 2013;Nwaneri and Anyaeche, 2018). However, few studies have developed optimisation models for haemodialysis scheduling (Afrane and Appah, 2014;Choi et al., 2017). Choi et al., (2017) modeled an ESRD problem with various dialysis conditions using a variable-volume two-compartment kinetic model and used Genetic Algorithm (GA) to find the optimal haemodialysis schedule for each individual. There is need to determine the optimal combination of processes that will minimise LOS in a typical haemodialysis clinic. Therefore, the optimisation of an outpatient haemodialysis schedule is the main thrust of this paper. The model was also expected to provide a framework to improve the efficiency of patient flow in a typical haemodialysis clinic. Optimisation and efficient planning of processes in haemodialysis centres is perceived to significantly reduce LOS and improve patient flow (Forrest et al., 2005;Kainzinger et al., 2009;Karkar et al., 2015). The remaining sections of this paper are structured as follows: Literature is reviewed in section II; the methodology is described in section III. The research results and discussion are presented in sections IV and V respectively and the conclusion in section VI closes the paper.
II. LITERATURE REVIEW Optimisation of patient flow and scheduling in hospitals have received considerable research attention (Augusto et al., 2010;Fleming et al., 2019). Various analytical and heuristic optimisation strategies have been proposed to improve scheduling in healthcare systems including the use of Lagrangian relaxation-based methods (Augusto et al., 2010), Column generation based heuristic procedure (Fei et al., 2010), simulation models (Lee et al., 2013). These models may be constrained or unconstrained. Constrained optimisation methods have been widely used in healthcare to improve various processes by including patient scheduling. In a study to address resource allocation and outpatient appointment scheduling problems, Lin et al., (2017) proposed an approach based on a multiphase and multi-server queuing system with stochastic factors in order to optimise the weighted objectives of patient waiting time, resource overtime and waiting room congestion. This method utilizes a two-stage simulation-based heuristic algorithm to assess various tactical and operational decisions for optimising the multiple objectives. In another study, Hribar et al., (2018) modeled an outpatient ophthalmology clinic workflow using discrete event simulation for testing new scheduling templates.
Fleming et al., (2018) developed an analytical method and a decision support tool for scheduling dialysis patients. Two objective functions were developed. While the first function was used to minimise the maximum waiting time for patients to start the dialysis process, the second objective function minimised the maximum scheduled finish time. Nappo and Ross (2020) used queuing theory principles to optimise schedules by including timing and workflow for every dialysis process step to design a new schedule. The study revealed improvements in facility efficiency and urea clearance reduction ratios. With the increased need for efficient scheduling of haemodialysis procedures and processes, innovative strategies should be deployed to minimise patient LOS. Most of the previous studies focused on the minimisation of patient waiting time (Bakker et al., 2016;Fleming et al., 2019).
The application of real-life data to minimise LOS in outpatient haemodialysis clinic is yet to be fully investigated. This study focused on developing a haemodialysis schedule optimisation model for an outpatient dialysis clinic. The development of scheduling optimisation model will enable the haemodialysis unit to manage their resources more efficiently, and to minimise treatment delays and avoid extending LOS of CKD and ESRD patients on dialysis due to various complications. Also, the study includes the simulation of patient flow to mimic real-life dialysis processes.

A. Problem Description and Formulation
The process starts with the arrival of patients to the clinic. In a typical haemodialysis clinic, patients undergo several processes classified in this study as pre-dialysis, dialysis and post-dialysis sessions. Pre-dialyses processes include the examination of patients for signs of Oedema followed by vital signs and weight measurement. Pre-dialysis tests are performed to reveal the urea and creatinine levels of patients before dialysis. Dialysis is performed after patients are connected to the machine using any of the following access routes including femoral catheterization, fistulas and internal jugular (IJ) catheters. Standard haemodialysis procedures could last between 3 -4 hours and 6 hours for patients that need sustained low efficient dialysis (SLED) (Sethi et al., 2018).
Post-dialysis processes include measurement of post disconnection vitals, post dialysis radiology and laboratory testing, post-dialysis consultation and collection of drugs at pharmacy. Not all patients pass through all the processes in the post-dialysis stages. For instance, a patient who has not exhausted his drugs may not need to visit the pharmacy. The effectiveness of the dialysis process is evaluated by postdialysis laboratory tests. The study was performed with data obtained from a private haemodialysis clinic in Lagos, Nigeria. Treatment was based on a 'First Come, First Served' (FCFS) and preferential treatments were only given to emergency cases. The entire process is clearly depicted in Figure 1 which describes the clinical arrangement and patient flow for a dialysis operation at the clinic. The haemodialysis clinic used as case study has two rooms dedicated for haemodialysis procedures. There are five machines in each room with identical amenities. The rooms are equipped with electrically adjustable chairs for patients and a water treatment unit that has the capacity to power a maximum of 5 dialysis machines. A minimum of two dialysis nurses are assigned to each room as well as a dialysis technician who provides technical support for the equipment.
The problem is formulated as a single objective optimisation model and described as follows: Consider a haemodialysis clinic with N number of patients, each patient p, is treated using a given treatment option j. The patient p undergoes several processes within a given duration including pre-dialysis time , dialysis time, and post-dialysis time, . The problem is to determine the optimal combination of , , and , that seeks to minimise the patient's length of stay, LOS. A mathematical model was developed to minimise patient LOS in a typical haemodialysis clinic. The mathematical notations used in this paper are presented in Table 1.  The model was developed based on the following assumptions: i. Patients are served on arrival. ii. The number of operating hours and medical resources are fixed. iii. The number of dialysis stations are fixed. iv. Non-dialysis procedures may be delayed to accommodate the dialysis treatment. v. Delays between processes are neglected. vi. Delays in the process due to emergencies are neglected.

B. Model objective function
The objective function is formulated as: Subject to the constraints: In this model, Eq. (1) minimizes the total LOS for each patient. The first constraint limits dialysis on each patient to one unit only. The second constraint ensures that the total completion time of each unit is less than the patient departure time. The third constraint ensures arrival time is less than departure time.

C. Model Implementation
The model was implemented using Genetic Algorithm (GA). GA is an adaptive evolutionary search optimisation technique that operates based on the principles of natural selection and natural genetics (Chiesa et al., 2020). Characteristically, GA works by generating a random population of individuals (parents) used to encode the solutions as chromosomes which consist of genes. The individuals reproduce and exchange genes with the offspring selected based on their level of fitness. The process is repeated until optimal solutions are generated. The procedure for GA implementation is clearly explained in literature (Goldberg, 1989;Hegazy, 1999;Bajpai and Kumar, 2010).
In this paper, the algorithm was implemented using Python programming language (Python 3.7.4) in Spyder integrated development environment (IDE) platform. Python was chosen because it is an open-source programming software with vast support libraries that enable model optimisation (Bakker et al., 2016). The algorithm is implemented by importing numerical python package (Numpy) and GA in Python. Objective function was defined using Eq. (1). Decision variable were selected which are P tp , D tp , and PD tp . Boundaries for the decision variables were set with the minimum and maximum values from each decision variable in Table 3 set as lower and upper limits respectively. Since the variables are continuous values, 'real variable types' were selected. Afterwards, the default GA parameters in Python were modified. A population size of 100, maximum iterations of 1000, mutation probability of 0.1, crossover probability of 0.5 and uniform crossover type were selected as shown in Table 2.
The pseudocode for the GA is summarized as shown in Figure  2. The scheduling time of various processes including the arrival and departure time, pre-dialysis, dialysis and postdialysis activities are shown in Appendix A.

C. Simulation of Patient Flow in a Haemodialysis Clinic
Patient flow in the haemodialysis clinic was further simulated using the SimPy discrete-event simulation Python library. It utilises queuing theory, a scientific theory that has been widely applied in a variety of service industries including healthcare to develop models that predict the behaviour of systems in a situation characterised by random demands for services (Gross et al., 2008). A G/G/10 queue is proposed and assumed to be based on finite queuing situation. Patient arrival is based on Poisson arrival distribution with a mean arrival rate, = 0.1 patients per minute computed as: For the service rates, 3 different service rates are adopted for the 3 stages of service. Service rate for pre-dialysis stage is exponentially distributed with probability density function computed as: where µ = mean pre-dialysis time For dialysis, the service rate is randomly selected from dialysis duration, d = [180, 240 and 360] minutes. While the post-dialysis stage is exponentially distributed with probability density function computed with Eq. (6). The algorithm for the simulation of haemodialysis processes is shown in Figure 3.

A. Results of Genetic Algorithm Optimisation
According to Table 3, the percentage of patients dialysed in 3-hour, 4-hour and 6-hour dialysis sessions respectively were 21 %, 74 % and 5 % respectively. Similarly, the mean post-dialysis procedures computed from Appendix A, for the 3-hour, 4-hour and 6-hour dialysis sessions occurred in 47.08 minutes, 46 minutes and 65 minutes respectively. The GA improved consistently the LOS for all the sessions. Accordingly, the objective function values represent the proportions of time spent across the process entirely. Table 3 shows the results of testing real-life data from the haemodialysis clinic on model. Accordingly, the objective function which represents the LOS values was optimised and gave optimum LOS values of 193.01 minutes, 275.02 minutes and 390.01 minutes from the corresponding pre-dialysis, dialysis and post-dialysis time used as decision variables for the 3-hour, 4-hour and 6-hour dialysis sessions as shown in Figures 3 and 4 Table 4 suggests a considerable improvement in the LOS achieved from optimisation. For the 3-hour, 4-hour and 6-hour dialysis procedures, the mean LOS reduced from 235.50 to 193.04; 296.62 to 275.02 and 424.50 to 390.01 minutes respectively. This demonstrates the utility of the model suggesting that the planned dialysis procedures are useful (Forrest et al., 2005).

Parameter Value
Population size 100

Crossover type uniform
Step 1: Initialize the population Step 2: Define objective function based on equation (1) Step 3: Choose , , and as decision variables and set boundary values.
Step 4: Set the population size, crossover and mutation types, crossover and mutation probability and variable type.
Step 5: Compute the objective function Step 6: Repeat steps 2 -5 for N number of iterations Step 7: Endif maximum iteration = N Step 8: Return the lowest objective function and its corresponding decision variables Step 1: Set , mean , and values Step 2: Generate haemodialysis patients according to Poisson distribution. Initialize patients created.
Step 3: While (patients generated < N), generate next , service rates for pre-dialysis, dialysis and post-dialysis duration of each patient.
Step 4: Generate bed request and release for each patient Step 5: Compute LOS for each patient using equation (1) Step 6: End While

B. Results of Model Simulation
Simulation experiments were performed with interarrival rates set at = 0.1, = 0.2, = 0.3 and = 0.4 with the results shown in Tables 6 -9 respectively. The start times for pre-dialysis events which represent pre-connection procedures were performed at fixed intervals. The duration for pre-dialysis events varies randomly from one patient to the other which typically depicts what happens in real-life situations. Also, the dialysis duration of each patient is randomly selected from the three options available that last for 180, 240 and 360 minutes. We found from the results in Tables 5 -8 that the LOS is mostly affected by the duration of the dialysis and post-dialysis procedures but not by the arrival time. Consequently, a reduction in LOS could be achieved by improving the efficiencies of the dialysis and post-dialysis procedures. In particular, specific improvement by increasing manpower or equipment as well as the processes in postdialysis activities such as radiology, laboratory tests, and pharmacy could lead to a reduction in LOS but a corresponding increase in cost. The management may need to take a trade-off decision depending on their preferences. Table 9 shows the comparison of simulation results for the different arrival rates. The mean LOS for all mean arrival rates in this study range from 305.28 minutes to 348.18 minutes. At = 0.4, the mean ± standard deviation of the LOS, was minimal (305.28± 63.67) minutes. We found no significant differences between the means and standard deviations of the LOS for the different arrival rates. The implication of this for a haemodialysis clinic is that the system can be optimised to use less resources at the pre-dialysis stage by scheduling patient arrivals at short intervals to avoid congestion in the system. Overall, careful planning of the operations of the haemodialysis clinic is necessary as it could lead to cost minimisation and increased efficiency of the system. The results suggest that with a well-planned scheduling strategy, patients' LOS in haemodialysis clinics could be improved. Our findings are in agreement with similar studies which demonstrated the effectiveness of optimisation tools in planning haemodialysis processes (Stecz et al., 2019).
Furthermore, the simulation of patient flow for a typical haemodialysis clinic modeled to reflect the real-life peculiarities by incorporating uncertainty in patient arrival rate showed interesting results. We observed no significant difference in the means and standard deviations of the LOS for the different patient interarrival rates. The implication of this for a haemodialysis clinic is that the system can be optimised to use less resources at the pre-dialysis stage by      scheduling patient arrivals at short intervals to avoid congestion in the system. Overall, careful planning of the operations of the haemodialysis clinic is necessary as it could lead to cost minimisation and increased efficiency of the system. Finally, the results also suggest that a few patients seeking emergency haemodialysis services can be accommodated for dialysis procedures that last for 2 -3 hours without causing much disruption to the system. The high rates of patients seeking emergency haemodialysis procedures is a research problem of significant public health concern (Zhang et al., 2019). With minor adjustments in the schedule of regular patients expected to arrive at a short interval, unscheduled emergency patients can be treated.
V. CONCLUSION In this paper, a haemodialysis schedule optimisation model was developed to reduce patient length of stay. Due to the increased demand for dialysis from CKD and ESRD patients in Nigeria, there is need to improve the processes in the few available clinics with limited facilities to reduce congestion, long waiting time and increased LOS. The model was realized in Python using GA. We compared the performance of the model with the mean LOS at the haemodialysis clinic used as case study and found that the optimised model showed better performance compared to the mean LOS at the clinic. The model was therefore effective in reducing patients LOS. Further simulation of patient flow in a typical haemodialysis clinic with small variations in patient interarrival rate revealed no significant differences in LOS. We also found that the LOS was mostly determined by the duration of dialysis procedure rather than the arrival time when patient arrival rates are at closely spaced intervals.