A real-time approach for dynamic scheduling PET activities in a hospital

Background: At present, medical personnel use manual scheduling methods to calculate usage times of PET devices, hospital beds, operating rooms, and other treatment spaces. However, as patient treatment and recovery times are unequal and uncertain, arriving times of the scheduled/temporary patients are unexpected, examination items, beds requirements, and drugs waiting times are different, and scan-again requirements are unexpected. Manual scheduling arrangements are easy to make mistakes and put pressure on employees. With changing scheduling arrangements, it is difficult to announce the estimated time to patients and their families in real time. As a result, family members keep asking medical staff about various situations and waiting time. This makes the process unstable and exhausts the medical staff. Although previous researches proposed algorithms for specific inspections to solve the equipment resource allocation problems and calculate outpatient visit time for outpatient clinics, there is no research on improving the PET process. This paper proposes a real-time automatic scheduling and control system for PET patients with Bluetooth Beacon positioning. Results: This system can automatically schedule, estimate, and instantly update the start and end time of various tasks of PET patients during examinations, and automatically allocate beds and real-time announce schedule information, allowing the schedule being automated, instant and almost optimized. Moreover, this system promptly reminds medical staffs in each area. This can greatly reduce the work of medical staff, avoid human error, improve the safety of drugs, and provide medical staff, patients and family members to view the inspection progress and estimated waiting time in real time, reducing the number of patients and family members to query medical staff. We implemented this system in an application for the Android system to prove the feasibility of the system. We also collected time data of 200 actual patients for 2 weeks in the Department of Nuclear Medicine of Chang Gung Memorial Hospital, Linkou, and put these data into the implementation program for simulation and comparison. It was found that the average time difference between manual and automatic scheduling was 7.32 minutes, and it could reduce the average examination time of 82% of patients by 6.14 minutes, proving the system's correctness and efficiency. To our knowledge, this paper is the first to propose a real-time automatic scheduling and control system for PET patients.


Background
Hospital medical equipment resources are often in short supply. Equipment scheduling control is an important issue. This issue is roughly divided into three categories: "reservation scheduling", "real-time scheduling" and "smart device applications".

Reservation scheduling
There are many different outpatient clinics in the hospital, as well as multiple physical examination equipment. However, the number of patient examination needs is far greater than medical resources. The resources provided by the hospital are in short supply, so good scheduling is required to resolve the problem. Burdett et al. [1] robustly schedule appointments by strategically inserting buffer times, and combine simulated annealing and evolutionary search to improve scheduleability. Jiang et al. [2] found that most studies on appointment systems assume that patients arrive at appointment time, but the actual situation is not the case. Therefore, they proposed a random planning appointment scheduling system considering late patients, using the BD-SAA method to find the best appointment time that reaches the least patient waiting time and doctor idle time. Qiu et al. [3] proposed algorithms using NSGA-II and MOEA / D for a single MRI device to arrange the order of appointment and appointment time for patients of different types of examination. Wu et al. [4] calculated the length of MRI examinations in different body parts and assigned corresponding MRI equipment, and then combined the statistical data to determine the length of each examination to increase the usage of MRI equipment and reduce the patient waiting time. Xiao et al. [5] proposed a method based on genetic algorithms for the nuclear medicine department to solve complex scheduling problems with many conditions. The background of this study [5] is similar to this article, but their method can only be applied in appointment situations, while our proposed method can estimate the patient waiting time for various tasks in real time.
However, appointment scheduling can only maximize the number of patients by arranging the examination dates and order for patients, but it cannot solve the problem that patients do not arrive at the hospital according to the appointment time. In fact, on the examination day, patients often arrive early or late, have not arrived, or join examination temporarily. It will widen the gap between the actual and the appointment time, and the patients' original examination time may change due to these factors. In order for patients to understand the on-site conditions, this paper proposed real-time automatic scheduling and control system. It is an effective method to provide on-site scheduling and estimated inspection time, and it can optimize the entire inspection process and ease the workload of medical staffs.

Real-time scheduling
Many scholars have proposed solutions to the random variability of on-site patients. Azadeh et al. [6] proposed a mixed integer linear programming model in order to solve the scheduling difficulties caused by multiple examinations in a single patient, and combined genetic algorithms to solve the problem of finding the best solution. Peng et al. [7] proposed a method using discrete event simulation combined with genetic algorithms to maximize the number of patients served. This method can dynamically schedule patients who have been booked, booked on-site or waited on-site. However, they [6,7] can only provide queue status (number of patients, queue position), but cannot provide patients with estimated examination time.
Many scholars [8][9][10] have proposed methods for outpatients to arrive at the scene close to the consultation time. Montecinos et al. [8] used the method of particle filters to estimate the waiting time of consultation using historical data of patient visit time and new input data. Tantitharanukul et al. [9] developed an estimated waiting time system WTE based on the queuing theory, and used the MQTT protocol to transfer the waiting time and number to the patient's cell phone. Obulor et al. [10] also used the queuing theory to develop an appointment queuing system to provide better resource utilization to solve the problem of long waiting times for patients. These studies [7][8][9][10] estimate the time for a single treatment, while the system proposed in this paper is for multi-stage treatment such as PET, and can dynamically estimate the start and end time of each different stage, and instantly announce these time information on the public screen or send it to the patient's mobile phone.
Because appointed patients are sometimes late or absent, which affects the time of patients who are registered and waiting at the scene, the original schedule must be constantly modified and updated in real time. The above studies [9] and [11] are aimed at improving the situation. Qu et al. [11] used the Markov Model to optimize the scheduling of patients waiting on-site, and proposed Heuristic Algorithm for other possible situations. The model divides the time of a day's visits into multiple time slots, and then queues the patients into each time slot one by one.
Ruth Luscombe et al. [12,22] developed Job shop scheduling, combined with heuristic algorithms, to quickly coordinate the activities and resources of emergency departments. Wiesche et al. [13] proposed an optimization model of Optimal Reservation of Capacity for Appointments (ORCA), a system that can arrange patients without appointments and patients who already have appointments, and provide them on days when the demand for patients is low. Make an appointment to get as much capacity as possible to treat a walk-in patient on a high-demand day. The system of Kortbeek et al. [14] used the day process model and access process of scheduled arrivals model to balance "waiting machine time for patients without appointments" and "examination time for patients with appointments" and 3 divided the time of day into multiple time slot to arrange patients.
However, in the PET examination, it is necessary to consider that each patient has a different medicine cycle time in different examination sites, and there are also cases where the examination fails and the examination is repeated. Therefore, these studies cannot solve the problem of realtime scheduling of PET inspections.

Smart device applications
Some patients have multiple examinations in the hospital, and some examinations have multiple tasks [19][20][21]. Without proper time control, patients will spend a lot of time waiting. By recording the start and end time of each task, we can analyze the data and reduce patient waiting time.
Frisby et al. [15] proposed a new method for controlling patients in the emergency room. Each doctor wore a medical Bluetooth device and installed a Bluetooth signal receiver in each bed. Within the acceptable range, the treatment time is automatically recorded, which effectively reduces the doctor's work. Ewing et al. [16] and Elnahrawy et al. [17] have used the instant positioning system to collect data on the patient's movements in the hospital and the time spent at each station to analyze the data and improve the hospital workflow. Kortbeek et al. [14] developed a frame that combines data collection with electronic medical records for data analysis. This method effectively understands the flow of patients in various areas of the hospital, and can be used to control different situations in the future. Naruse et al. [18] set up a Beacon signal receiver made of Raspberry Pi in the room to detect the Beacon signal. When someone enters the room, they will identify the Beacon, transmit the Beacon data to the database, and calculate the duration of the Beacon carrier stay. This paper proposes a method for arranging mobile phones as receivers in various areas of PET, receiving signals from patients wearing Beacon devices, and automatically recording the time of patients during various inspection tasks, saving medical staff time for manual transcription and improving overall automation.

Overview of results
This paper proposes a real-time, automatic and dynamic scheduling and control system for PET patients with Bluetooth Beacon positioning. This system can automatically schedule, estimate and update the start and end time of various tasks of PET patients during the examination, and automatically allocate beds and real-time announce schedule information, allowing the schedule being automated, instant and almost optimized. This can greatly reduce the work of medical staff, avoid human error, improve medication safety, and provide medical staff, patients and family members to instantly check the progress of the inspection and estimated waiting time, reducing the number of patients and family members to ask medical staff. We also implemented the proposed method in the Android system to prove the feasibility of the system.
We also developed an app that can automatically collect data. This app collected various "manually scheduled" data from 200 actual patients in the Department of Nuclear Medicine of Linkou Chang Gung Hospital as a control group. We also feed the initial situation of the same 200 original data collected into the above-implemented Android system, and obtain various "auto-scheduled" data as the experimental group. It was found that the average time difference between the "manually-scheduled control group" and the "autoscheduled experimental group" was 7.32 minutes, indicating the correctness of this method. Besides, the "auto-scheduled experimental group" can reduce the average examination time of 82% of patients by 6.14 minutes, which proves the progress of this method.

Methods
This section explains the system requirements and the detailed scheme of the proposed system. In the inspection schedule of PET, due to many conditions and changes to be considered, such as the limitation of the time limit of special drugs, limited medical equipment, and possible re-scanning, manual scheduling and time control are quite difficult. This paper proposes a real-time automatic scheduling and control system for PET examination, which can instantly estimate the examination time, allocate medical resources, and respond possible re-scanning in time.

System requirement
System requirements of the proposed system are described as Definition 1.

Details of the proposed system
The traditional PET examination process is shown in Fig. 1. Based on Definition 1 and Fig. 1, we proposed a new scheduling and control system (Fig. 2), which contains five roles and eight phases.
The five roles are patient i P , medical staff MS , radiologist j RD , server S and announcement screen, where MS is at indwelling needle area in IV indwelling needle room (or called the outer injection room) IV R , and on the indwelling needle desk we equipped with a mobile device  Table 1 defines the symbols and parameters used in the proposed method.
The system is divided into seven phases and two algorithms: initial phase, patient check-in phase, patient indwelling needle phase, bed allocation phase, algorithm for scheduling examination room, estimating injection time and scan time, injection phase, scanning phase, end examination phase, and algorithm to determine Beacon's entry and exit from a certain area.

5
(1) Initial phase          e  e  diff  IV  IV  IV  IV  IV  IV  IV   T  a  T  a  t Finally, S calculates the average indwelling time from The indwelling needle process is shown in Fig. 4.

(4) Bed allocation phase
After processing a "successful scan" patient Finally, S calculates the average injection time from 1 P to i P : The patient injection process is shown in Fig. 7.

Materials
We first collected the status and time data of various tasks and examinations of 200 actual patients at the Linkou Chang Gung Hospital as a PET medical database and control group. We also implemented the proposed system in the Android system, and fed the patient's physical condition, check-in time and rescan status of the PET medical database data collected above into our implementation system, using the obtained time data as the experimental group. Finally, we do data analysis, compare and analyze the results of the experimental group and the control group.

Data collection of control group
We set up receivers in five places in Linkou Chang Gung Hospital (Fig. 11). We let actual patients wear Beacon and perform PET inspection procedures under the current manual scheduling method, and record time data and examination information of 200 patients for two consecutive weeks (12 days).
We used a desktop computer (using Windows 10 operating system, Intel (R) Xeon (R) CPU E3-1230 @ 3.3GHz&3.7GHz processor, 8G RAM memory) as the server to collect data, calculate and process communication matters. We also used four Android 5.0 operating system phones, including three HTC Desire816 (Qualcomm S400 1.6GHz quad-core processors) as Beacon signal receivers in three scan rooms to determine patients' in or out of the room, and another HTC One E8 (Qualcomm S801 2.5GHz quad-core processor) is responsible for inputting and transmitting patient examination information to the server. We chose THLight's B3029T as the Beacon for each patient.
The system program structure of data collection is divided into six parts according to different tasks: nurse device during check-in phase, nurse device during indwelling needle, radiologist device during injection, radiologist APP on the scan room side, Server, and receivers in scan rooms. The communication method between the Server and the mobile devices of the medical staff is Wi-Fi. The screens of the mobile phone APP operated by the medical staff at each inspection stage are described below.

(1) Patient check in
When the patient checks in, the nurse at the needleindwelling area of the injection room will enter the patients' report information screen. Because there are many numbers in the patients' medical record number, it is easy to make mistakes when manually inputting it. Therefore, the scan button "SCAN" is designed to scan the one-dimensional barcode of the medical record number to reduce the error (Fig. 12).

(2) Indwelling needle and injection phase
The interfaces of the medical staff during the indwelling phase and during the injection phase are the same (Fig. 13). The medical staff enters the patient information required for the examination. When the needle or injection is started, click the start button "STA" to capture the start time. When the indwelling needle or injection ends, click the button again to grab the end time.    patients who have been assigned a scan room, their information is displays in each page according to each different scan room (shown on the right of Fig. 14).

(4) Total queue list
Patients who have already checked in and have not completed the examination will be displayed in the screen of Fig. 15 for medical staff at each stage of the examination. Clicking on the MRN number will jump to interface of Fig.  13 for medical staff to enter or view detailed information.
When there are a large number of patients, it is not easy to find the medical record number to view detailed information. We can use "SCAN" button to scan the MRN barcode of a patient, and the system will directly display the detailed information of the patient.

Data collection of experimental group
We then fed these 200 PET medical database data on the patient's physical condition, report time and rescan status into our proposed system for the output of experimental group data. (Fig. 16) (1) Estimate time to indwell time initially Initially, the program downloads one day's data from the database, and then calculates the initial estimated indwelling time for all patients.  TP . If j P is assigned to a bed, the program then proceeds with his estimated time of scan and injection.

A. Arrange beds
The bed allocation algorithm () j assignBed P is shown in Fig. 5 of Section 2, and the program flow is shown in Fig. 17.

B. Estimate injection time and scan time
For patient j P assigned to a bed, the program then performs () i estimateEETime P to estimate injection and scan time.
The algorithm is shown in Fig. 6 of Section 2, and the program flow is shown in Fig. 18.

Discussion
In this section, we compare and analyze the experimental group and the control group, and discuss the results in four parts. We first calculate the average time difference between the two groups at three start times (i.e. indwelling needle, injection, and scan) in 12 days to see if there is an error between the time calculated by the experimental group and the actual time of the control group (Table 3.) "Absolute value" and "Relative value" respectively represents "with" and "without" positive and negative values, and respectively stands for the average value of the "absolute value" and "relative value" of each experimental group time minus the control group time on a certain day. We also explored whether the estimated time by using the proposed automatic scheduling method can be faster than the original manual scheduling time, and what the proportion of time earlier is. (That is, how many patients benefit from this.) "Ahead rate" represents the proportion that the estimated times of the experimental group is earlier than the actual times of the control group.
We then analyze and discuss the proposed method in four parts.
(1) Analysis of indwelling needle time The last update time for each patient is the time the previous patient entered the scan room. Comparing the final data with the actual data collected, the average time difference is about 2.94 minutes. (Table 3) Maximum value (time early up) and minimum value (time late up) are 17 and -12 minutes, respectively. (Table 4) 13 (2) Analysis of injection and scan times At the stage of estimating the injection, the time difference may be caused by that the pharmacy cycle time has a buffer time of plus or minus ten minutes and the radiologist manually calculating the estimated time. According to our observations at the scene, the radiologist had only grasped the approximate time during the manual calculation, resulting in extra time between the end of the injection by the previous patient and the time when the next patient started the injection. In addition, when each time the indwelling needle ends, the nurse must call the pharmacy to ask the pharmacist to give the medicine, and the radiologist must wait for the pharmacist to give the medicine before injecting the patient. These actions will take up the time of the patient inspection process. However, the method proposed in this article can remove the above problems. If the medical staff performs the inspection process based on the estimated time calculated by the APP, the injection process can be advanced 6.14 minutes in average. (Table 3) During the estimated scanning stage, the radiologist will try to let the patient scan five to ten minutes in advance. However, the proposed algorithm is designed according to the standard pharmaceutical cycle time, allowing the radiologist to adjust the scan according to the standard time. As a result, the high time difference (Table 4) and low ahead rate is caused (Table 3.) Besides, the reason the standard deviation is larger during the injection phase and the photographic phase that the indwelling needle phase is that some machines were idle for less than the average imaging time of the patient, but some radiologists still arranged the patient to the gap to reduce the idle time of the imaging equipment. In addition to causing the time difference, it also makes it very compact for the patients who need to be scanned again in the future.
In addition to the above-mentioned causes of time differences in injection and scan phases, unexpected situations sometimes occur on the scene, and the delay of the process is also one of the reasons for the time differences.

(3) Analysis of allocating beds
Because bed-ridden patients require larger space, some require special equipment, and the types of uptake rooms vary, if the general patients occupy the uptake room of the bedridden patient, it will lead to prolonged waiting time of the bedridden patient. The proposed weight allocation method (Table2) (i.e. using b() function) can shorten the average waiting time from indwelling needle to injection by 14 3.29 minutes (Table 5), save 40.35% of patient waiting time, and effectively solve this problem.

(4) Overall improvement
After analysis, the proportion of patients with a time difference of less than ten minutes reaches 68%, indicating that about 70% of the number is close to the actual situation, achieving high accuracy. In addition, 82% of the patients had an average reduction of 6.14 minutes (based on the estimated injection time), which verified the high efficiency of the proposed system.

Comparison
This section analyses and compares the properties including the eight requirements in definition 1 and other features. Table 6 summarizes the comparison of the properties for the proposed system and those schemes proposed by Xiao et al. [5], Tantitharanukul and Throngjai [9], and Luscombe and Kozan [12], and Table 7 displays those for the proposed automatic scheduling system and the current manual scheduling system.

Comparison with proposed and previous works
Based on the system requirements proposed in Definition 1, we compare our method with previous works (Table 6).

Comparison with proposed and current scheduling system
We functionally compare the current manual system with the proposed automatic system (Table 7). Our system has four automatic functions to solve the problem of smooth processes. We also compared the two systems in "the time required" for medical staff or patients to process each task. The details are as follows.
A. Scheduling of patient examination order: Scheduling: The system automatically orders the order of patient examinations, eliminating the need for radiologists to manually order. B. Scheduling of each inspection time: The system calculates the best patient examination time for different drug cycle times, and the radiologist does not need to calculate it manually. C. Patient interrupts MS workflow by asking questions about examination time: The system calculates the estimated time of each inspection task and announces it to medical staff and patients, reducing the number of times when medical staff is interrupted by patients' inquiry.

CONCLUSION
Due to the limited equipment resources and cycle time of PET, it is not an easy task for medical staff to calculate time and allocate resources on their own. This paper proposes a method for real-time estimation and scheduling of multiresource allocation and pharmacy limitation, combined with Beacon to automatically detect patient entry and exit, and effectively control the inspection process. The results showed that the time difference between the experimental group and the control group was about 2.94 minutes, 7.95 minutes, and 7.32 minutes in the indwelling needle phase, the injection phase, and the scanning phase, respectively. Moreover, the proportion of patients with a time difference of less than ten minutes reaches 68%, indicating that most number is close to the actual situation, achieving high accuracy. In addition, 82% of the patients had an average reduction of 6.14 minutes, verifying the high efficiency of the proposed system. Therefore, the proposed system not only reduces the work of medical staff, but also provides patients and their families with credible estimates of time. Future research will focus on more detailed data analysis to improve the accuracy of estimated time. In addition, some patients will not only have a PET examination on this day, there will be other radiological procedures to be performed. The radiologist must consider these conditions together to schedule. Future studies can consider combining the scheduling of other radiology departments to make the entire radiological diagnosis process easier and smoother.