Intelligent queuing method based on patient type
By employing a patient-type-based intelligent queuing method that combines static basic priority and dynamic hunger value, and using an incremental local rearrangement algorithm to optimize the queue, the problem of long waiting times for low-priority patients in existing technologies is solved, thereby improving clinic utilization and patient satisfaction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NINGBO HUIZHONG INFORMATION TECH CO LTD
- Filing Date
- 2026-04-16
- Publication Date
- 2026-06-26
AI Technical Summary
Existing medical outpatient queuing scheduling methods cannot effectively balance the needs of different groups of people, resulting in long waiting times for low-priority patients, dissatisfaction among ordinary patients, low utilization of consultation rooms, and an inability to dynamically respond to changes in the scenario.
A patient-type-based intelligent queuing method is adopted. The static basic priority is calculated by the analytic hierarchy process, and the dynamic hunger value and real-time priority are combined. An incremental local rearrangement algorithm is used to optimize the queue, dynamically adjust the patient position, and select the clinic in a multi-clinic scenario.
It achieved priority compensation for low-priority patients, reduced waiting time, improved clinic utilization, reduced dissatisfaction, adapted to high-concurrency scenarios, and optimized the allocation of resources across multiple clinics.
Smart Images

Figure CN122290248A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a smart queuing method based on patient type. Background Technology
[0002] In existing outpatient settings, queuing mechanisms directly impact service efficiency, resource utilization, and public satisfaction. Existing queuing methods primarily fall into two categories: one employs a first-come, first-served (FFS) algorithm, which adds static priority tags for specific groups (such as the elderly, military personnel, disabled individuals, and patients with appointments) to the traditional "first-come, first-served" system. When these patients take a number, the system inserts them at the front of the queue or into a dedicated priority segment, while other patients queue in order of arrival time. The other method uses a fixed-priority queuing algorithm, which divides patients into several predefined categories (such as "emergency," "appointment," and "general"), each corresponding to an independent virtual queue. The system calls numbers sequentially from highest to lowest priority according to a fixed priority order.
[0003] However, the first-come, first-served algorithm has the following drawbacks: all "elderly" patients, regardless of age (e.g., 60 vs. 90), health status, or whether they are accompanied, enjoy the same priority, lacking fine-grained differentiation; priority patients are usually placed directly at the front of the queue or in a fixed position, which can easily cause dissatisfaction among ordinary patients and may lead to excessive concentration of high-priority patients, disrupting the doctor's consultation schedule; patients who are late retain their original priority, or their weight cannot be temporarily increased when there is a sudden surge in emergency cases, failing to dynamically respond to changes in the scenario. The fixed-priority queueing algorithm has the following drawbacks: when the high-priority queue is empty, low-priority patients still need to wait, reducing the utilization rate of the consultation room; ordinary patients wait for a long time without receiving compensatory priority opportunities, easily leading to "service starvation"; all patients in the same queue receive completely identical treatment, failing to reflect differences in age, complexity of illness, etc.
[0004] Therefore, there is an urgent need for a queuing and scheduling mechanism that can intelligently balance the needs of various groups of people. Summary of the Invention
[0005] One objective of this application is to provide a patient-type-based intelligent queuing method that can address at least one of the deficiencies in the aforementioned background art.
[0006] To achieve at least one of the above objectives, the technical solution adopted in this application is: an intelligent queuing method based on patient type, comprising the following steps:
[0007] S100: Obtain the attribute information of each patient in the current team, and calculate the static basic priority of each patient in the current team based on the obtained attribute information using the analytic hierarchy process.
[0008] S200: Calculate the dynamic hunger value of each patient based on their waiting time in the current queue, and move the patient's queue position forward when the patient's dynamic hunger value reaches the preset maximum value and continues for a set time.
[0009] S300: The dynamic hunger value and static base priority of patients are weighted to obtain the real-time priority of each patient, and the real-time priority of multiple patients ahead of the current queue is updated after each call.
[0010] S400: When a new patient needs to be enqueued, calculate the real-time priority of the new patient and determine the insertion position of the new patient in the current queue through an incremental local rearrangement algorithm based on the scope of influence.
[0011] Preferably, in step S100, the patient's attribute information includes patient type, age, appointment status, arrival time, and historical medical behavior. The process of obtaining the patient's static basic priority through the patient's attribute information is as follows: analyze the factors affecting the priority based on the patient's attribute information; invite multiple experts to conduct pairwise comparisons of each factor and construct comparison matrices; calculate the weight vector and consistency ratio of each comparison matrix, and perform geometric mean synthesis of the expert weights that pass the consistency test to obtain the final weight; use the obtained final weights to calculate the static basic priority through the patient attribute scoring function.
[0012] Preferred, static basic priority S i The specific calculation expression is as follows:
[0013] S i =ω1⋅f illness +ω2⋅f age +ω3⋅I status +ω4⋅f appt +ω5⋅f history ;
[0014] ;
[0015] In the formula, f illness f represents the triage level score. age I represents the patient's age score. status Indicates the patient type score, f appt The score for punctuality is indicated by f. history ω represents the score of historical medical visits. k This represents the final weight corresponding to the k-th criterion item, and N represents the number of experts participating in the scoring. and Let represent the individual weights of the k-th and j-th criteria given by the n-th expert, respectively, and m represent the number of criteria.
[0016] Preferably, in step S200, the dynamic hunger value H of the patient at the current time t is non-linearly increasing. i The expression for calculating (t) is as follows:
[0017] H i (t)=min{H max ,α·[(tt arrival ) / T base ] β};
[0018] In the formula, H max t represents the maximum hunger value. arrival Indicates the patient's sign-in time, T base α represents the baseline waiting time threshold, α represents the hunger gain coefficient, and β represents the nonlinear exponent.
[0019] Preferably, in step S400, the specific process of obtaining the patient's insertion position using the incremental local rearrangement algorithm based on the influence range is as follows: Based on the real-time priority order of the queue, the current queue is divided into multiple ordered segments according to a fixed number of patients, and segment boundaries are constructed based on the maximum real-time priority in each ordered segment; all segment boundaries are compared sequentially with the real-time priority of the new patient in ascending order, so that the new patient is initially inserted into the middle position of the ordered segment whose first segment boundary is greater than the real-time priority of the new patient; starting from the initial insertion position of the new patient, real-time priority comparisons are performed between the preceding and following positions, and the new patient is moved forward or backward within the ordered segment based on the comparison results to obtain the precise insertion position of the new patient.
[0020] Preferably, as new patients are inserted, if the number of patients in an ordered segment exceeds a set upper limit, the ordered segment is divided into two new ordered segments from the middle position; the number of ordered segments corresponding to the current team is counted at set intervals, and if the number of ordered segments exceeds the set upper limit, the current team is re-divided into ordered segments.
[0021] Preferably, for scenarios with multiple parallel general clinics, the clinic selection for a new patient includes the following process: Constructing a prediction model to output estimated service duration based on current patient and doctor characteristics, and training the prediction model using historical service data from each clinic; using the trained prediction model to output the estimated service duration for the new patient in each clinic; calculating the insertion cost for inserting the new patient into the corresponding position in each clinic's patient queue based on the obtained estimated service duration, where the insertion cost includes the weighted waiting time increment of all patients in the clinic queue after the new patient's insertion position and the new patient's own estimated waiting time; calculating the variance change in the total consultation time of each clinic after the new patient's insertion based on the obtained insertion cost, and calculating the equilibrium benefit based on the obtained variance change; calculating the comprehensive score of each clinic using the insertion cost and equilibrium benefit, and inserting the new patient into the patient queue corresponding to the clinic with the highest comprehensive score.
[0022] Preferably, for scenarios with multiple parallel ordinary clinics, the process of real-time dynamic scheduling of the current patient queues in each clinic is as follows: Collect service information for each clinic, including the total service time completed in each clinic, the real-time priority and estimated service time of each patient in the current queue of each clinic, and the remaining time from the preset end time; construct a multi-objective function that maximizes the total number of patients that can be served in all clinics within the remaining time, and minimizes the variance of the total consultation time for each clinic from the start of the day to the completion of all patients in its current queue; set constraints: patients with real-time priority higher than a preset threshold must not be transferred to clinics with service efficiency lower than the standard value; solve the constructed multi-objective function using an optimization algorithm at set intervals to obtain a redistribution scheme for patients among different clinics and an order adjustment scheme within the queues of each clinic.
[0023] Preferably, a greedy rescheduling algorithm is used to solve the multi-objective function. The specific process is as follows: calculate the current total consultation time of each clinic, find the first clinic with the largest total consultation time and the second clinic with the smallest total consultation time, select a candidate patient from the queue of the first clinic and move them to the second clinic. If the multi-objective function is improved after the move and the constraints are met, then the move is executed. Otherwise, a candidate patient is reselected and the move is executed. Repeat the move-up step until the termination condition is met.
[0024] Preferably, a first objective function Z1 is constructed to maximize the total number of patients that all clinics can serve within the remaining time, and a second objective function Z2 is constructed to minimize the variance of the total consultation time of each clinic from the start of the day until all patients in its current queue are served. By weighting the first and second objective functions, a multi-objective function Z is obtained, the specific expression of which is:
[0025] Z = λ1⋅(Z1 / N)total )−λ2⋅(Z2 / σ 2 );
[0026] ;
[0027] ;
[0028] ;
[0029] In the formula, λ1 and λ2 represent the preset weights of the corresponding terms, and N total σ represents the total number of all patients. 2 Let represent the variance of the initial total consultation time; M represents the total number of concurrent consultation rooms; p represents the individual patient identifier; and Q represents the variance of the initial total consultation time. a Let y represent the set of patients corresponding to the current consultation room a. p,a This represents the decision variable indicating whether patient p can receive services from clinic a within the remaining time. This indicates the total consultation time for clinic a from the start of the day until all patients in its current queue are seen. This represents the arithmetic mean of the total consultation time across all clinics. This indicates the total service time that clinic A has spent from the start of its workday to the current moment. This indicates the estimated service time for patient p in consultation room a.
[0030] Compared with the prior art, the beneficial effects of this application are as follows:
[0031] (1) Through the starvation value function, any patient with a long waiting time can receive priority compensation. The algorithm principle ensures that low-priority patients will not wait indefinitely, which is in line with human psychological expectations and reduces the dissatisfaction caused by "being constantly cut in line". The parameters of the algorithm are adjustable and can adapt to various scenarios.
[0032] (2) The incremental local rearrangement algorithm based on the scope of influence can effectively reduce the complexity of new patients entering the queue and can meet the needs of high concurrency scenarios; the periodic background sorting ensures that the error between the final queue order and the result of the full rearrangement is within an acceptable range. Attached Figure Description
[0033] Figure 1 This is a schematic diagram of the overall workflow of this application. Detailed Implementation
[0034] The present application will now be further described in conjunction with specific embodiments. It should be noted that, in the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms should not be construed as necessarily referring to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. In addition, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.
[0035] In the description of this application, it should be noted that the terms "center", "lateral", "longitudinal", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc., which indicate the orientation and positional relationship based on the orientation or positional relationship shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and should not be construed as limiting the specific protection scope of this application.
[0036] It should be noted that the terms "first," "second," etc., in the specification and claims of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0037] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0038] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature being directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature being directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.
[0039] The terms “comprising” and “having”, and any variations thereof, in the specification and claims of this application are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or device.
[0040] One preferred embodiment of this application, such as Figure 1 As shown, a smart queuing method based on patient type includes the following steps:
[0041] S100: Obtain the attribute information of each patient in the current team, and calculate the static basic priority of each patient in the current team based on the obtained attribute information using the analytic hierarchy process.
[0042] It should be noted that in existing technologies, the static basic priority of individuals in the current queue is often assigned through experience or simple weighting. The weighting coefficients (such as the importance percentage of attributes like age, illness, and identity) are subjectively determined by system developers or hospital administrators, which presents the following problems:
[0043] Highly subjective and lacking scientific basis: Different people have vastly different perceptions of the importance of the same attribute, leading to arbitrary prioritization; Difficult to reach a group consensus: Opinions from doctors, nurses, managers, and other stakeholders within the hospital cannot be effectively integrated; Lack of consistency verification: Whether the weights are self-consistent is not verified, which may lead to logical contradictions.
[0044] Therefore, this application provides a method for determining static basic priority weights based on the analytic hierarchy process (AHP). By constructing a hierarchical structure, collecting expert pairwise comparison matrices, calculating weight vectors, and performing consistency checks, scientific and quantifiable weights of each attribute are finally obtained, which are used to calculate the static basic priority of queuing objects.
[0045] S200: Calculate the dynamic hunger value of each patient based on their waiting time in the current queue, and move the patient's queue position forward when the patient's dynamic hunger value reaches the preset maximum value and continues for a set time.
[0046] It should be understood that existing outpatient queuing systems generally use static priority or fixed-weight scoring methods when handling priority; for example, a preset priority of 100 for "emergency," 80 for "80-year-old seniors," and 90 for "military personnel," etc. When a new patient joins the queue, the system compares their static weight with the weights of other patients in the queue and inserts them directly into the appropriate position. However, this method has the following technical drawbacks:
[0047] The technical root of the starvation phenomenon: Once static weights are set, patients with lower weights (such as regular patients) can never surpass those with higher weights. In extreme cases, if high-priority patients arrive continuously (such as 10 consecutive emergency room patients), the waiting time for regular patients will tend to infinity, resulting in "service starvation." From a queuing theory perspective, this is a problem of "low-priority infinite delay" in a non-preemptive priority queue. The lack of fairness metrics: Static priority only focuses on patient "identity characteristics," completely ignoring the core fairness indicator of "waiting time." A regular patient who has already waited 60 minutes may feel a much greater urgency to see a doctor than a newly arrived patient with a slightly higher static weight, but existing algorithms cannot reflect this difference.
[0048] Therefore, this application provides a dynamic hunger value that grows non-linearly over time, which can both prevent ordinary patients from experiencing excessively long waiting times and prevent ordinary patients from "unreasonably suppressing" truly critically ill patients. Compared with traditional methods, this application, through a hunger value function, ensures that any patient with an excessively long waiting time receives priority compensation. The algorithm's principle guarantees that low-priority patients will not wait indefinitely, aligning with human psychological expectations and reducing dissatisfaction caused by "being constantly cut in line." The algorithm's parameters are adjustable, adapting to various scenarios.
[0049] S300: Weights the dynamic hunger value and static base priority of patients to obtain the real-time priority of each patient, and updates the real-time priority of multiple patients ahead of the current queue after each call.
[0050] S400: When a new patient needs to be enqueued, calculate the real-time priority of the new patient and determine the insertion position of the new patient in the current queue through an incremental local rearrangement algorithm based on the scope of influence.
[0051] It should be noted that when a new patient arrives, existing queuing systems often need to reorder the entire queue when handling priority insertion. While this method can guarantee the globally optimal order, it has the following drawbacks:
[0052] High computational complexity: Full sorting during peak periods (such as queues of hundreds of people and multiple inbound requests per second) can cause CPU spikes and response latency exceeding seconds, impacting the self-service machine experience; Excessive perturbation: Frequent full sorting will constantly change the positions of patients already in the queue. Even if the system sends a change notification, patients will see their position change from 5th to 8th and then back to 6th, leading to confusion and distrust; Wasteful resources: In reality, the insertion of a new patient usually only affects the order within a limited range of their vicinity, and full sorting will generate a large amount of unnecessary computation.
[0053] Therefore, this application provides an incremental local rearrangement algorithm based on the scope of influence. The core idea is to divide the queue into multiple ordered segments, and when a new patient joins the queue, only a limited number of local adjustments are made within the affected segments. Compared with traditional methods, this application, through the incremental local rearrangement algorithm based on the scope of influence, can effectively reduce the complexity of joining new patients and can meet the needs of high-concurrency scenarios; periodic background cleanup ensures that the error between the final queue order and the result of the full rearrangement is within an acceptable range.
[0054] In this embodiment, during step S100, the patient's attribute information includes patient type, age, appointment status, arrival time, and historical medical history. For ease of understanding, the specific process of calculating the static basic priority of each patient using the analytic hierarchy process will be described in detail below.
[0055] First, analyze the factors that influence priority based on the patient's attribute information.
[0056] Specifically, the factors influencing priority mainly include the urgency of the patient's condition (represented by triage level score), the patient's age (represented in segments), the patient's status (military personnel, family members of martyrs, disabled persons, elderly persons, ordinary persons, etc.), appointment cooperation (whether an appointment is made and whether it is on time), and historical medical behavior (number of recent no-shows, etc.). These factors can be ranked to obtain five criteria.
[0057] Then, several experts were invited to conduct pairwise comparisons of each factor and construct a comparison matrix.
[0058] Specifically, at least five experts are invited, representing various departments, such as chief physicians, head nurses, and outpatient administrators. Each expert independently compares the importance of any two criteria. Therefore, for any nth expert, an m×m comparison matrix can be constructed. Where m represents the number of criteria; for example, m=5. This represents the elements in the i-th row and j-th column of the comparison matrix corresponding to the n-th expert, that is, the scores of the n-th expert in comparing the importance of the two criteria represented by the i-th row and j-th column.
[0059] Then, the weight vector for each comparison matrix is calculated.
[0060] Specifically, for comparison matrix A (n) Normalize each column by dividing each row element of that column by the sum of all elements in that column; sum the normalized comparison matrix row by row to obtain the initial weight parameter for each row; normalize the obtained initial weight parameters again by dividing the initial weight parameter for each row by the sum of all initial weight parameters to obtain the normalized initial weight matrix; and construct the weight vector W using the initial weights of each row. (n) ={ ω n-1 ω n-1 , ..., ω n-m} T ; where ω n-m This represents the initial weight corresponding to the m-th criterion.
[0061] Then, the consistency ratio of the weight vector is calculated for consistency verification.
[0062] Specifically, this can be based on the obtained weight vector W (n) Calculate the comparison matrix A (n) The largest eigenvalue λ max That is, through the weight vector W (n) And comparison matrix A (n) Multiply them to get an m×1 vector, then calculate the weight vector W for each component. (n) The ratios of the corresponding components are then averaged; the largest eigenvalue λ is obtained from this. max Then, calculate the consistency index CI=(λ) max -m) / (m-1); Based on the value of m, find the random consistency index RI (when m=5, RI=1.12); Based on the obtained consistency index CI and RI, calculate the consistency ratio CR=CI / RI; If the calculated CR<0.1, the consistency of the comparison matrix is considered acceptable; otherwise, experts need to readjust the comparison scores.
[0063] Then, the expert weights that passed the consistency test are geometrically averaged to obtain the final weight ω. k This refers to the final weight corresponding to the k-th criterion term, where k = {1, 2, ..., m}, and m = 5. The specific calculation expression is as follows:
[0064] .
[0065] In the formula, N represents the number of experts participating in the scoring. and These represent the individual weights of the k-th and j-th criteria given by the n-th expert, respectively.
[0066] Finally, based on the calculated final weight ω k Static baseline priority S is calculated using a patient attribute scoring function. i The specific calculation expression is:
[0067] S i =ω1⋅f illness +ω2⋅f age +ω3⋅I status +ω4⋅f appt +ω5⋅f history .
[0068] In the formula, f illness This indicates the triage level score, which can be divided into multiple levels based on the urgency of the patient's condition, such as levels 1 to 5 (level 1 being the most urgent). The corresponding scores for each level are 1, 0.8, 0.5, 0.3, and 0.1, respectively. age The patient's age score can be represented using a piecewise function, such as ≥80 = 1 point, 70-79 = 0.8 points, 60-69 = 0.5 points, and <60 = 0.2 points; status The score indicates the patient's type; a score of 1 indicates a special status such as military personnel, family members of martyrs, or disabled persons; otherwise, a score of 0. appt Points are awarded for punctuality: 1 point for being on time, 0.5 points for being late, and 0.2 points for not having an appointment. history The score represents the history of medical visits. For example, if there are more than 2 missed appointments in the past three months, the score is 0; if there is 1 missed appointment, the score is 0.3; and if there are no missed appointments, the score is 0.7.
[0069] To make it easier to understand, a detailed explanation will be provided below using specific examples.
[0070] Assume the final weight for the urgency criterion is 0.45, the final weight for the patient age criterion is 0.25, the final weight for the patient status criterion is 0.15, the final weight for the appointment cooperation criterion is 0.08, and the final weight for the historical medical behavior criterion is 0.07.
[0071] If Patient A's attribute information is: Triage Level 2 (score 0.8), age 75 (score 0.8), no preferential treatment (score 0), punctual appointment (score 1), no no-shows (score 0.7); and Patient B's attribute information is: Triage Level 4 (score 0.3), age 30 (score 0.2), disabled (score 1), no appointments (score 0.2), 1 no-show (score 0.3).
[0072] Then, the static baseline priority S1 of patient A is: S1=0.45×0.8+0.25×0.8+0.15×0+0.08×1+0.07×0.7=0.36+0.2+0+0.08+0.049=0.689.
[0073] Patient B's static baseline priority S2 is: S2 = 0.45 × 0.2 + 0.25 × 0.3 + 0.15 × 1 + 0.08 × 0.2 + 0.07 × 0.3 = 0.09 + 0.075 + 0.15 + 0.016 + 0.021 = 0.352.
[0074] Based on the static priority, although Patient B is disabled, Patient A's condition is more serious and he is older, which makes Patient A's priority higher than Patient B's.
[0075] In this embodiment, when executing step S200, the dynamic hunger value H of the patient at the current time t is... i (t) can employ a non-linearly increasing hunger function, causing the hunger value to rise exponentially after the patient's waiting time exceeds a baseline threshold. However, to ensure that patients with high static baseline priority, such as those in the emergency department, maintain their advantage within a reasonable range, an upper limit needs to be set on the dynamic hunger value, after which it should no longer increase. Based on the above requirements, the dynamic hunger value H... i The expression for calculating (t) is as follows:
[0076] H i (t)=min{H max ,α·[(tt arrival ) / T base ] β}
[0077] In the formula, H max This represents the maximum hunger value, i.e., the set upper limit of the hunger value. The specific value can be set according to the actual needs of those skilled in the art, for example, 60 minutes; t arrival Indicates the patient's sign-in time; T baseα represents the baseline waiting time threshold, and the specific value can be set according to the actual needs of those skilled in the art, for example, it can be 30 minutes; α represents the hunger gain coefficient, which is used to control the growth rate of the hunger value, and the value can be set according to the actual needs of those skilled in the art; β represents the nonlinear exponent, which is used to accelerate the growth of the hunger value, and the value needs to be greater than 1, for example, it can be 1.5.
[0078] It is important to note that when a patient's dynamic hunger value reaches the upper limit H... max If the duration exceeds the set time, such as 10 minutes, a "forced promotion" will be triggered; at this time, the patient will be directly moved to the front N positions of the queue. force The number of patients in a patient's number is assigned to a specific digit, such as the first three, and their positions are locked to prevent them from being pushed back by subsequent high-priority patients until they are called.
[0079] In this embodiment, during step S300, the patient's real-time priority P i The expression for calculating (t) is:
[0080] P i (t)=W s ·S i +W h ·H i (t).
[0081] In the formula, W s This represents the static weighting coefficient, and its specific value can be set according to the actual needs of those skilled in the art, such as 0.6; W h This represents the dynamic weighting coefficient, and the specific value can be set according to the actual needs of those skilled in the art, such as 0.4.
[0082] It's important to note that to avoid excessive computation by recalculating the real-time priority P(t) of all patients every time a number is called, a partial update strategy can be employed. That is, each time a number is called (the first patient in the queue is removed), only the real-time priority of the first X (e.g., 20) patients after the first patient in the new queue is recalculated, as only the relative order of these patients might change due to dynamic hunger values. Simultaneously, a complete real-time priority recalculation and reordering of the entire queue can be performed at fixed intervals, such as every 30 minutes.
[0083] In this embodiment, during step S400, the specific process of obtaining the patient's insertion position using the incremental local rearrangement algorithm based on the influence range is as follows: First, according to the real-time priority order of the queue, the current queue is divided into multiple ordered segments according to a fixed number of patients, and segment boundaries are constructed based on the maximum real-time priority in each ordered segment. For ease of understanding, a specific example will be used to describe this below. Then, all segment boundaries are compared with the real-time priority of the new patient in ascending order, so that the new patient is initially inserted into the middle position of the ordered segment whose first segment boundary is greater than the new patient's real-time priority. Finally, starting from the new patient's initial insertion position, the real-time priorities of the preceding and following positions are compared, and the new patient is moved forward or backward within the ordered segment according to the comparison results to obtain the precise insertion position of the new patient.
[0084] To make it easier to understand, a specific example will be used to illustrate this in detail below.
[0085] Assuming the current queue has 100 patients, the queue can be divided into 5 ordered segments, numbered #1 to #5, with 20 patients per segment. If the real-time priorities of the patients in the queue, from highest to lowest, are 1, 0.99, ..., 0.02, 0.01, then the boundary of ordered segment #1 is 1, the boundary of ordered segment #2 is 0.8, the boundary of ordered segment #3 is 0.6, the boundary of ordered segment #4 is 0.4, and the boundary of ordered segment #5 is 0.2. Assuming a new patient has a real-time priority of 0.68, since 0.6 is less than 0.68 and 0.8 is greater than 0.68, the new patient will be inserted into ordered segment #2, initially positioned between patients with real-time priorities of 0.7 and 0.71. Subsequently, since the real-time priority of patients before the initial insertion position of the new patient is higher than that of the new patient, the insertion position of the new patient can only be moved backward until it is moved backward to before the patient with a real-time priority of 0.67.
[0086] It's important to note that as new patients are inserted, the number of patients within an ordered segment gradually increases. For example, if 10 new patients are inserted into the same ordered segment consecutively within a short period, the number of patients in that segment increases from the initial 20 to 30. If another new patient appears and is also inserted into the ordered segment, and this new patient's real-time priority is close to the boundary of the ordered segment, this means the new patient will need to undergo 15 transpositions within the ordered segment, leading to increased computational overhead. Therefore, an upper limit can be set on the number of patients within an ordered segment, such as 30. When the number of patients in an ordered segment reaches the set upper limit, the ordered segment can be divided into two new ordered segments from the middle, thereby reducing the length of a single ordered segment and improving the computational efficiency of new patient insertion positions.
[0087] Meanwhile, as ordered segments are split, the number of ordered segments may become excessively long; for example, if the number of ordered segments increases from 5 to 10, the number of segment boundaries that need to be calculated and compared during the initial positioning of a new patient's insertion location will also increase, indirectly increasing the calculation efficiency of the new patient's insertion location. Therefore, the number of ordered segments corresponding to the current team can be counted at set intervals. If the number of ordered segments exceeds the set upper limit, the current team should be re-divided into ordered segments.
[0088] It is also important to note that when inserting new patients, a minimum interval should be set for people of the same type to avoid consecutive patients with the same special needs, such as avoiding three elderly people queuing together in a row; a maximum waiting list should also be set for special groups, such as a maximum of two emergency patients.
[0089] It's important to understand that the aforementioned technical solutions often address patient queuing in a single consultation room. However, in large hospitals, multiple consultation rooms are typically set up for the same specialty. These consultation rooms can be further categorized into specialist rooms and general consultation rooms, with multiple general consultation rooms also often existing. For specialist rooms, patients typically book appointments based on the doctor they wish to see, and in this case, the queueing process simply follows the aforementioned guidelines. For general consultation rooms, or for patients with common ailments, the priority is often faster service, with less emphasis on the doctor. In other words, patients with common ailments can be consulted in any general consultation room. In scenarios with multiple general consultation rooms operating concurrently, new patients arriving need to be assigned to a specific consultation room's queue. Existing methods primarily allocate patients based on the number of people in each consultation room's queue, but this ignores the differences in real-time patient priority and doctor service speed. This could result in high-priority patients being placed in slower-access consultation rooms, negatively impacting the overall patient experience.
[0090] To address the aforementioned technical issues, in a multi-consultation-room parallel scenario where patients choose a specialist consultation room, they will be queued within the consultation room according to their real-time priority; that is, the patient will not be dynamically assigned to another consultation room's queue during the queuing process. For a multi-consultation-room parallel scenario where patients choose a general consultation room, this application provides a consultation room selection method based on queue priority distribution characteristics and insertion cost evaluation. This method can dynamically queue patients for consultation rooms during the queuing process to achieve the fastest possible consultation completion. For ease of understanding, a detailed description will follow.
[0091] In this embodiment, for a scenario with multiple parallel general clinics, the clinic selection for a new patient includes the following process: A prediction model is constructed to output estimated service duration based on current patient and doctor characteristics, and this model is trained using historical service data from each clinic. The trained prediction model outputs the estimated service duration for the new patient in each clinic. Based on the estimated service duration, the insertion cost for inserting the new patient into the corresponding position in each clinic's patient queue is calculated. The insertion cost includes the weighted waiting time increment of all patients in the clinic queue after the new patient's insertion position and the new patient's own estimated waiting time. Based on the obtained insertion cost, the variance change in the total consultation time of each clinic after the new patient's insertion is calculated, and the equilibrium benefit is calculated based on the variance change. The comprehensive score for each clinic is calculated using the insertion cost and the equilibrium benefit, and the new patient is inserted into the patient queue corresponding to the clinic with the highest comprehensive score.
[0092] To facilitate understanding, the specific steps of the clinic selection method based on team priority distribution characteristics and insertion cost evaluation will be described in detail below.
[0093] Specifically, the prediction model can be constructed using one of the following algorithms: linear regression, random forest, or gradient boosting tree. After constructing the prediction model, patient, doctor, and service features are extracted from the historical service data of each clinic. Patient features include age, preliminary diagnosis, triage level, and whether a follow-up visit has occurred; doctor features include doctor ID, department, title, and historical average consultation time; and service features include actual service time. The extracted patient and doctor features are used as inputs to the prediction model, and the service features are used as outputs to train the model. After training, the features of the current new patient and the current doctor features in each clinic are used as inputs to obtain the estimated service time d for the new patient in each clinic. new .
[0094] Specifically, for new patients, based on their real-time priority, for each consultation room, the insertion into the correct position is simulated using steps S100~S400 described above. The insertion cost (Cost) for each consultation room can then be obtained, and the specific calculation expression is as follows:
[0095] Cost = μ1·∆Wait existing +μ2·∆Wait new .
[0096] In the formula, ∆Wait existing This represents the waiting increment for all patients currently in the consultation room queue. Specifically, after a new patient is inserted into position A of the queue, the expected waiting time for each patient originally at position A and after that position increases by d. new Therefore, ∆Waitexisting =(n x -A+1)·d new ;n x This represents the total number of patients in the current consultation room x. ∆Wait new This indicates that the new patient needs to wait for the sum of the service times of the preceding A-1 patients. The estimated service times of the preceding A-1 patients can be calculated using a predictive model. μ1 and μ2 represent the weighting coefficients of the corresponding terms, and their specific values can be set according to the actual needs of those skilled in the art.
[0097] Specifically, based on the insertion cost of each clinic corresponding to the new patients obtained from the simulation, the equilibrium benefit for each clinic can be calculated; the specific expression is:
[0098] Benefit = -ζ·∆Variance.
[0099] In the formula, ζ represents the benefit coefficient, and the specific value can be set according to the actual needs of those skilled in the art; ∆Variance represents the change in the variance of the total consultation time of all clinics after the insertion of a new patient. If the variance decreases, the balance is more balanced.
[0100] Specifically, after calculating the insertion cost and equilibrium benefit, a comprehensive score (Score) for each clinic's insertion of new patients can be calculated; the specific calculation expression is as follows:
[0101] Score = -Cost + μ·Benefit.
[0102] In the formula, μ represents the comprehensive coefficient, and the specific value can be selected by those skilled in the art based on their actual needs.
[0103] It is important to understand that in a scenario with multiple parallel general consultation rooms, due to differences in service efficiency and the randomness of patient service times, some windows often complete all patients early and become idle, while other windows still have a large number of patients waiting, resulting in a decrease in overall service efficiency and uneven patient waiting times. To ensure that the total number of people served by all consultation rooms is maximized and the total service time of each consultation room tends to be consistent, it is necessary to dynamically schedule the current patient queues in each consultation room in real time during the actual operation of each consultation room. Therefore, the solution in this application provides a parallel consultation room balanced scheduling method based on multi-objective optimization, which will be described in detail below.
[0104] In this embodiment, the specific working process of the multi-objective optimization parallel clinic scheduling method is as follows:
[0105] First, service information for each clinic is collected, including the total service time completed in each clinic, the real-time priority and estimated service time of each patient in the current queue of each clinic, and the remaining time until the preset end time. Then, a multi-objective function is constructed that maximizes the total number of patients that can be served by all clinics within the remaining time, and minimizes the variance of the total consultation time for each clinic from the start of the day until all patients in its current queue are served. Next, constraints are set: patients with a real-time priority higher than a preset threshold cannot be transferred to clinics with service efficiency lower than the standard value. Finally, at set intervals, an optimization algorithm is used to solve the constructed multi-objective function to obtain a patient redistribution scheme among different clinics and an order adjustment scheme within each clinic's queue.
[0106] To facilitate understanding, the specific construction process of multi-objective functions will be described in detail below.
[0107] Specifically, for a multi-objective function, it can be viewed as a set of two separate objectives; the first objective is to maximize the total number of people served in the remaining time, and the second objective is to ensure consistency in the total consultation time of each clinic.
[0108] For the first objective, the maximum number of patients a clinic can serve is limited by its service speed and remaining working hours. However, since patients may be reassigned or transferred to other clinics, the first objective requires overall optimization. Specifically, the decision variable y can be defined. p,a This indicates whether patient p can receive services from clinic a within the remaining time. If the services can be completed, the decision variable y... p,a Assign a value of 1 if the first objective is not found, otherwise assign a value of 0. Then, the first objective function Z1 can be constructed based on the first objective, with the specific expression as follows:
[0109] .
[0110] In the formula, M represents the total number of parallel consultation rooms, and Q... a This represents the set of patients corresponding to the current consultation room a.
[0111] For the second objective, the total consultation time for clinic a from the start of the day until all patients in its current queue are completed can be defined as follows: Therefore, the second objective is to minimize the variance of the total consultation time in each consultation room. The second objective function Z2 can then be constructed, with the following expression:
[0112] .
[0113] .
[0114] In the formula, This represents the arithmetic mean of the total consultation time across all clinics. This indicates the total service time that clinic A has spent from the start of its workday to the current moment. This indicates the estimated service time for patient p in consultation room a.
[0115] By weighting the first objective function Z1 and the second objective function Z2, the desired multi-objective function Z can be obtained; the specific expression is:
[0116] Z = λ1⋅(Z1 / N) total )−λ2⋅(Z2 / σ 2 ).
[0117] In the formula, λ1 and λ2 represent the preset weights of the corresponding terms, and their specific values can be selected according to the actual needs of those skilled in the art; N total σ represents the total number of all patients. 2 This represents the variance of the total consultation time for each initial consultation room. The specific calculation process is well known to those skilled in the art, and therefore will not be described in detail here.
[0118] In this embodiment, a greedy rescheduling algorithm can be used to solve the multi-objective function. The specific solution process is as follows: calculate the current total consultation time of each clinic, find the first clinic with the largest total consultation time and the second clinic with the smallest total consultation time, select a candidate patient from the queue of the first clinic and move them to the second clinic. If the multi-objective function is improved and the constraints are met after the move, then the move is executed. Otherwise, a candidate patient is reselected and the move is executed. Repeat the move-up step until the termination condition is met.
[0119] It should be noted that when patients make appointments, they can select whether they need room scheduling on the appointment window. That is, when making an appointment, patients can book with doctors by name, and the system will provide an option to enable dynamic scheduling to improve the speed of treatment. If the patient selects this option, the system will dynamically adjust the queue based on the aforementioned queue settings during the process of inserting into the queue and waiting, ensuring the patient can complete their treatment as quickly as possible. If the patient does not select this option, they will remain in the queue of a fixed consultation room and be seen according to real-time priority. Of course, if patients choosing specialist consultations also have consultation efficiency requirements, the aforementioned dynamic scheduling option can also be set when booking specialist appointments.
[0120] The basic principles, main features, and advantages of this application have been described above. Those skilled in the art should understand that this application is not limited to the above embodiments. The embodiments and descriptions in the specification are merely the principles of this application. Various changes and modifications can be made to this application without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claims. The scope of protection claimed by this application is defined by the appended claims and their equivalents.
Claims
1. A smart queuing method based on patient type, characterized in that, Includes the following steps: S100: Obtain the attribute information of each patient in the current team, and calculate the static basic priority of each patient in the current team based on the obtained attribute information using the analytic hierarchy process. S200: Calculate the dynamic hunger value of each patient based on their waiting time in the current queue, and move the patient's queue position forward when the patient's dynamic hunger value reaches the preset maximum value and continues for a set time. S300: The dynamic hunger value and static base priority of patients are weighted to obtain the real-time priority of each patient, and the real-time priority of multiple patients ahead of the current queue is updated after each call. S400: When a new patient needs to be enqueued, calculate the real-time priority of the new patient and determine the insertion position of the new patient in the current queue through an incremental local rearrangement algorithm based on the scope of influence.
2. The intelligent queuing method based on patient type as described in claim 1, characterized in that, In step S100, the patient's attribute information includes patient type, age, appointment status, arrival time, and historical medical behavior; The process of obtaining a patient's static baseline priority based on their attribute information is as follows: Analyze the factors influencing priority based on patient attribute information; Several experts were invited to conduct pairwise comparisons of each factor and construct a comparison matrix; Calculate the weight vector and consistency ratio for each comparison matrix, and then perform a geometric mean summation of the expert weights that pass the consistency test to obtain the final weights. The static baseline priority is calculated using the obtained final weights through a patient attribute scoring function.
3. The intelligent queuing method based on patient type as described in claim 2, characterized in that, Static base priority S i The specific calculation expression is as follows: S i =ω1⋅f illness +ω2⋅f age +ω3⋅I status +ω4⋅f appt +ω5⋅f history ; ; In the formula, f illness f represents the triage level score. age I represents the patient's age score. status Indicates the patient type score, f appt The score for punctuality is indicated by f. history ω represents the score of historical medical visits. k This represents the final weight corresponding to the k-th criterion item, and N represents the number of experts participating in the scoring. and Let represent the individual weights of the k-th and j-th criteria given by the n-th expert, respectively, and m represent the number of criteria.
4. The intelligent queuing method based on patient type as described in claim 1, characterized in that, In step S200, the patient's non-linearly increasing dynamic hunger value H at the current time t is... i The expression for calculating (t) is as follows: H i (t)=min{H max ,α·[(t-t arrival ) / T base ] β }; In the formula, H max t represents the maximum hunger value. arrival Indicates the patient's sign-in time, T base α represents the baseline waiting time threshold, α represents the hunger gain coefficient, and β represents the nonlinear exponent.
5. The intelligent queuing method based on patient type as described in any one of claims 1-4, characterized in that, In step S400, the specific process of obtaining the patient's insertion position using the incremental local rearrangement algorithm based on the influence range is as follows: Based on the real-time priority of the teams, the current teams are divided into multiple ordered segments according to a fixed number of patients, and the segment boundaries are constructed according to the maximum real-time priority in each ordered segment. All segment boundaries are compared with the real-time priority of the new patient in ascending order, so that the new patient is initially inserted into the middle position of the ordered segment whose first segment boundary is greater than the real-time priority of the new patient; Starting from the initial insertion position of the new patient, a real-time priority comparison of the preceding and following positions is performed, and the new patient is moved forward or backward within an orderly segment based on the comparison results to obtain the precise insertion position of the new patient.
6. The intelligent queuing method based on patient type as described in claim 5, characterized in that, If the number of patients in an ordered segment exceeds the set upper limit as new patients are inserted, the ordered segment will be divided into two new ordered segments from the middle position. At set intervals, the number of ordered segments corresponding to the current team is counted. If the number of ordered segments exceeds the set upper limit, the current team is re-divided into ordered segments.
7. The intelligent queuing method based on patient type as described in claim 1, characterized in that, For scenarios involving multiple parallel general consultation rooms, the consultation room selection for a new patient includes the following process: A predictive model is constructed to output the estimated service duration based on the current patient and doctor characteristics, and the predictive model is trained based on the historical service data of each clinic. The trained prediction model is used to output the estimated service duration for new patients in each clinic. Based on the estimated service duration, the insertion cost of inserting a new patient into the corresponding position in the patient queue of each consultation room is calculated. The insertion cost includes the weighted waiting time increment of all patients in the consultation room queue after the insertion position of the new patient and the new patient's own estimated waiting time. Based on the obtained insertion cost, calculate the variance change of the total consultation time in each clinic after the insertion of a new patient, and calculate the equilibrium revenue based on the obtained variance change. The overall score for each clinic is calculated by considering insertion cost and equilibrium benefit. New patients are then inserted into the patient queue corresponding to the clinic with the highest overall score.
8. The intelligent queuing method based on patient type as described in claim 7, characterized in that, For a scenario with multiple parallel general consultation rooms, the process of real-time dynamic scheduling of the current patient queues in each consultation room is as follows: Collect service information for each clinic, including the total service time completed in each clinic, the real-time priority and estimated service time of each patient in the current queue in each clinic, and the remaining time from the preset end time. Construct a multi-objective function that maximizes the total number of patients that all clinics can serve within the remaining time, and minimizes the variance of the total consultation time for each clinic from the start of the day until all patients in its current queue are served. Set constraints: Patients with real-time priority higher than a preset threshold shall not be transferred to clinics with service efficiency lower than the standard value; At set intervals, an optimization algorithm is used to solve the constructed multi-objective function to obtain the patient redistribution scheme among different consultation rooms and the order adjustment scheme within the queue of each consultation room.
9. The intelligent queuing method based on patient type as described in claim 8, characterized in that, A greedy rescheduling algorithm is used to solve the multi-objective function. The specific process is as follows: Calculate the total consultation time for each consultation room, and identify the first consultation room with the longest total consultation time and the second consultation room with the shortest total consultation time. Select a candidate patient from the queue of the first consultation room and transfer them to the second consultation room. If the multi-objective function is improved and the constraints are met after the transfer, then execute the transfer; otherwise, select a new candidate patient and execute the transfer. Repeat the move-up step until the termination condition is met.
10. The intelligent queuing method based on patient type as described in claim 8, characterized in that, We construct a first objective function Z1 that maximizes the total number of patients that all clinics can serve within the remaining time, and a second objective function Z2 that minimizes the variance of the total consultation time for each clinic from the start of the day until all patients in its current queue are served. By weighting the first and second objective functions, we obtain a multi-objective function Z, the specific expression of which is: Z=λ1⋅(Z1 / N total )−λ2⋅(Z2 / σ 2 ); ; ; ; In the formula, λ1 and λ2 represent the preset weights of the corresponding terms, and N total σ represents the total number of all patients. 2 Let represent the variance of the initial total consultation time; M represents the total number of concurrent consultation rooms; p represents the individual patient identifier; and Q represents the variance of the initial total consultation time. a Let y represent the set of patients corresponding to the current consultation room a. p,a This represents the decision variable indicating whether patient p can receive services from clinic a within the remaining time. This indicates the total consultation time for clinic a from the start of the day until all patients in its current queue are seen. This represents the arithmetic mean of the total consultation time across all clinics. This indicates the total service time that clinic A has spent from the start of its workday to the current moment. This indicates the estimated service time for patient p in consultation room a.