Method for calculating doctor seeing indexes by using patient outpatient doctor seeing decision model based on flow calculation
Through the patient outpatient clinic decision-making model based on flow calculation, the waiting time and cohort length that outpatient patients can tolerate in real time is calculated, which solves the problem of unreasonable allocation of outpatient resources in medical institutions, improves patient satisfaction and meets real-time needs.
Patent Information
- Application Number
- CN202411685606.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-23
- Publication Date
- 2025-02-28
AI Technical Summary
Existing medical institutions have unreasonable utilization of outpatient resources allocation, resulting in patients waiting too long and reducing patient satisfaction.
Using a flow-based computing-based patient outpatient visit decision-making model, through the Kafka distributed message distribution system and Spark Streaming flow computing framework, the longest waiting time that outpatients can tolerate and the longest tolerant queue that outpatients can tolerate in real time.
The hospital resource allocation has been optimized, the reasonable scheduling of outpatient visits has been realized, the patient satisfaction has been improved, and the real-time requirements have been met through containerized and high throughput data processing.
Smart Images

Figure CN119541861A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical consultation technology, and in particular to a method for calculating consultation indexes using a patient outpatient consultation decision model based on stream computing. Background Art
[0002] As the number of primary medical institutions increases, the number of patients they treat decreases relatively, while the number of patients treated in hospitals, especially tertiary hospitals, increases significantly. The imbalance between the proportion of different types of medical institutions in China and the number of patient visits leads to irrational use of health resources. If hospitals increase their outpatient resource investment, it will increase investment or cause idle resources to be wasted; conversely, if outpatient resources are reduced, it will cause patients to wait too long, reduce patient satisfaction, and have adverse effects on patients and society. Therefore, it is of great practical significance to analyze hospital outpatient scenarios, study the factors that affect patients' outpatient visits, and rationally allocate hospital outpatient resources.
[0003] Patients' medical decisions are affected by many factors, such as waiting time, arrival time and service time, quality of medical services, travel time and distance, hospital size, cleanliness and availability of supporting facilities. Among them, waiting time is a core factor in patients' medical choice. When visiting outpatient clinics, waiting time directly affects patients' satisfaction with medical treatment. Patients' arrival time and service time are constantly changing. Even if time slots have been reserved, there is still a possibility that patients will leave. The quality of medical services also plays an important role in patients' medical choices. Larger hospitals can provide more comprehensive medical services than small hospitals. In China, the coverage of the medical system has typical regional differences, and the degree of perfection of the urban medical system is significantly higher than that of rural areas. Travel time and distance are also one of the key factors for patients to make medical decisions. A survey study in the UK found that choosing a hospital that is closer is the most critical reason for patients. When faced with multi-factor choices, patients will weigh other factors and distance.
[0004] Based on the above key factors, establishing a patient outpatient visit decision model is of great significance to hospitals, especially tertiary hospitals with large outpatient volumes.
[0005] It is necessary to provide a method for calculating the visit index using a patient outpatient visit decision model based on stream computing, which will help optimize hospital resource allocation, achieve reasonable scheduling of outpatient visits, and improve patient satisfaction. Summary of the invention
[0006] Therefore, the purpose of the present invention is to provide a method for calculating the outpatient visit index using a patient outpatient visit decision model based on flow computing, which helps to optimize hospital resource allocation, achieve reasonable scheduling of outpatient visits, and improve patient satisfaction.
[0007] The first embodiment of the present application proposes a method for calculating a visit index using a patient outpatient visit decision model based on stream computing, comprising the following steps:
[0008] Step 1: Build a patient outpatient visit decision model based on stream computing;
[0009] Step 2: The Kafka distributed message distribution system obtains the existing outpatient patient information from the hospital information system and stores the above model and the parameters required by the model;
[0010] Step 3: When a new patient visits the outpatient clinic, the parameters related to the new patient required by the model are obtained, and based on the model and parameter information stored in the Kafka distributed message distribution system, the Spark Streaming stream computing framework is used to calculate in real time the longest waiting time and the longest queue that the outpatient patient can tolerate.
[0011] According to an embodiment of the present application, the construction of a patient outpatient visit decision model based on stream computing includes the following steps:
[0012] Step 110, establish a service quality model: Q(r) = (Q max -rμ)*α*β, where Q represents the service quality; r represents the doctor's grade, the larger the value, the higher the grade; Q max represents the best service quality, Q max =μ*r max *α max *β max , μ represents the doctor service rate, α represents the doctor reputation, β represents the hospital scale, α ranges from [0, 1], the larger the value, the better the doctor's reputation, β ranges from [0, 1], the larger the value, the larger the hospital scale.
[0013] According to an embodiment of the present application, the construction of a patient outpatient visit decision model based on stream computing further includes the following steps:
[0014] Step 120, establish a patient-perceived benefit-loss model:
[0015]
[0016] Where C represents the patient's perceived benefit and loss, C(t q ) represents the waiting cost for outpatient treatment, t q represents the patient waiting time, C(t q ) is t q The linear function of p(r) represents the registration fee, which can be represented by a linear function. r represents the doctor's grade, and the values are 1, 2, and 3. p(r) = p(r max +1-r), r maxIndicates the maximum doctor level. represents sunk cost. The longer the waiting time, the higher the sunk cost. c represents the waiting cost per unit time, ω1, ω2 and ω3 represent the weights of the waiting cost, registration fee and sunk cost of outpatient treatment, respectively; C(t q ) is calculated as follows: The arrival of patients follows a Poisson distribution, and the patient arrival rate is λ, t q The expectation is:
[0017]
[0018] Therefore, the expected value of the outpatient waiting cost is: b also represents the waiting cost per unit time, t represents the doctor's service time, μ = 1 / t, and C(t q ) is used to characterize C(t q ).
[0019] According to an embodiment of the present application, the construction of a patient outpatient visit decision model based on stream computing further includes the following steps:
[0020] Step 130, establish a patient outpatient decision model: whether a patient chooses a doctor's outpatient clinic depends on the service value obtained. The service value V can be expressed as:
[0021]
[0022] Where a represents the value coefficient of each unit of service quality.
[0023] According to an embodiment of the present application, the model parameters required for storing the above model and the model parameters in step 2 include a, r, μ, Q max , α max , β max , α, β, ω1, ω2, ω3, λ, linear coefficient of the linear function p(r), r max .
[0024] According to one embodiment of the present application, when a new patient visits an outpatient clinic, the parameters required by the model and related to the new patient are obtained, and the parameters required by the model and related to the new patient include b and c.
[0025] According to one embodiment of the present application, the real-time calculation of the longest waiting time and the longest tolerable queue of outpatients includes the following steps:
[0026] The binary variable s(i)∈{0,1} is used to represent the treatment selection strategy of the i-th patient. When s(i)=1, it means that the patient stays in the treatment queue; when s(i)=0, it means that the patient leaves the queue, which can be expressed as the following equation:
[0027]
[0028] When V i >0, the patient will enter the outpatient waiting queue. At this time, let V i =0, corresponding to t q The longest waiting time that patients can tolerate Then we have:
[0029]
[0030] According to the parameters in step 2 and step 3, the longest waiting time that the patient can tolerate can be obtained.
[0031] The M / M / 1 / K queuing model is adopted, where K represents the number of outpatients treated by doctors in each time period, that is, the capacity of the queuing system. According to the queuing model, the arrival process of outpatients and the process of receiving diagnosis and treatment services are independent of each other, so:
[0032]
[0033] Where N q Indicates that the outpatient patients who choose this doctor can tolerate the longest queue, given that In the case of and μ, N can be obtained q .
[0034] The beneficial effects of the present invention are:
[0035] (1) Use containerization to build a Kafka distributed message distribution system. Containerization has the following advantages: the part of the operating system shared by the container is read-only. Compared with virtualization technology, containers are lighter and consume less system resources. Containers can be started and stopped quickly. Using containers can be based on modular considerations, making applications easier to manage.
[0036] (2) Use the Spark Streaming framework to process data in the distributed message distribution system. The experimental results show that the system response time is completed within a few seconds, which can meet the real-time requirements of practical applications.
[0037] (3) The present invention establishes a service value model for outpatient visits and implements a highly available and scalable information distribution processing middleware. The system can calculate the patient's visit time and the longest tolerated queue in real time, provide timely data support for the hospital's outpatient department, help optimize resource allocation, and improve patient satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 The present invention is a flowchart of a method for calculating a visit index using a patient outpatient visit decision model based on stream computing in the first embodiment of the present invention.
[0040] Figure 2 This is a diagram of the Spark Streaming processing process. DETAILED DESCRIPTION
[0041] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0042] In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the present application may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present application is not limited to the specific embodiments disclosed below.
[0043] Reference Figure 1 This embodiment provides a method for calculating a visit index using a patient outpatient visit decision model based on stream computing, including the following steps:
[0044] Step 1: Build a patient outpatient visit decision model based on stream computing;
[0045] Step 2: The Kafka distributed message distribution system obtains the existing outpatient patient information from the hospital information system and stores the above model and the parameters required by the model;
[0046] Specifically, the containerization method is combined with the Kafka distributed message distribution system. Containerization has the following advantages: the part of the operating system shared by the container is read-only. Compared with virtualization technology, the container is lighter and consumes less system resources; the container can be started and stopped quickly, and the instantiation and release of the container can be completed in a very short time; the use of containers can be based on modular considerations, making the application easier to manage. Patient outpatient visit information may be stored in multiple medical information systems. By establishing an efficient distributed message distribution system, the queried data can be reliably transmitted and support real-time access by computing devices. Based on containerization, we built a Kafka distributed message system. As a distributed message system, Kafka has the following advantages: efficient data persistence capability; high throughput; support for partitioned storage of messages in Broker, and orderly reading of messages in partitions; support for online horizontal expansion. Zookeeper is a high-performance, distributed application coordination service. Distributed applications implement more advanced services such as synchronization and configuration management based on Zookeeper. Kafka clusters use Zookeeper for coordination and management. When Kafka agents increase or decrease, the Zookeeper service will be triggered to notify producers and consumers.
[0047] By establishing a query service, the existing outpatient patient visit information is obtained from the hospital information system and sent to a specific topic of the distributed message distribution system through a unified interface. The message consumption service obtains historical information from the topic, analyzes the historical values of the parameters required by the model through business logic, and stores the results persistently.
[0048] Step 3: When a new patient visits the outpatient clinic, the parameters related to the new patient required by the model are obtained, and based on the model and parameter information stored in the Kafka distributed message distribution system, the Spark Streaming stream computing framework is used to calculate in real time the longest waiting time and the longest queue that the outpatient patient can tolerate.
[0049] Specifically, we use the Spark Streaming stream computing framework to process messages in the distributed message distribution system in real time. When a new patient visits the outpatient clinic, the real-time analysis data stream is output to Kafka, which provides real-time data to Spark Streaming through subscription.
[0050] Spark is a memory-based iterative computing framework. Its intermediate computing results are stored in memory, eliminating the need for frequent read and write operations on the storage system. Spark Streaming is a large-scale real-time data stream processing framework developed on the basis of Spark. It can achieve high throughput and has a fault-tolerant mechanism. Spark Streaming divides the stream processing process into time slices. The data received in each time slice is combined into a discrete stream (Discretized Stream, DStream), which is finally handed over to Spark Core for calculation.
[0051] like Figure 2 As shown in the figure, the Spark Streaming processing process is demonstrated using 5 seconds as an example. DStream encapsulates a series of resilient distributed datasets (RDDs). Every 5 seconds, DStream releases an RDD that contains the patient's outpatient visit information within these 5 seconds. When processing DStream, the "patient outpatient visit information" event appears in the Spark batch. Finally, Spark Streaming processes the batch event containing "patient outpatient visit information".
[0052] According to an embodiment of the present application, the construction of a patient outpatient visit decision model based on stream computing includes the following steps:
[0053] Step 110, establish a service quality model: Q(r) = (Q max -rμ)*α*β, where Q represents the service quality; r represents the doctor's grade, the larger the value, the higher the grade; Q max represents the best service quality, Q max =μ*r max *α max *β max , μ represents the doctor service rate, α represents the doctor reputation, β represents the hospital scale, α ranges from [0, 1], the larger the value, the better the doctor's reputation, β ranges from [0, 1], the larger the value, the larger the hospital scale.
[0054] Step 120, establish a patient-perceived benefit-loss model:
[0055]
[0056] Where C represents the patient's perceived benefit and loss, C(t q ) represents the waiting cost for outpatient treatment, t q represents the patient waiting time, C(t q ) is t qThe linear function of p(r) represents the registration fee, which can be represented by a linear function. r represents the doctor's grade, and the values are 1, 2, and 3. p(r) = p(r max +1-r), r max Indicates the maximum doctor level. represents sunk cost. The longer the waiting time, the higher the sunk cost. c represents the waiting cost per unit time, ω1, ω2 and ω3 represent the weights of the waiting cost, registration fee and sunk cost of outpatient treatment, respectively; C(t q ) is calculated as follows: The arrival of patients follows a Poisson distribution, and the patient arrival rate is λ, t q The expectation is:
[0057]
[0058] Therefore, the expected value of the outpatient waiting cost is: b also represents the waiting cost per unit time, t represents the doctor's service time, μ = 1 / t, and C(t q ) is used to characterize C(t q ).
[0059] Step 130, establish a patient outpatient decision model: whether a patient chooses a doctor's outpatient clinic depends on the service value obtained. The service value V can be expressed as:
[0060]
[0061] Where a represents the value coefficient of each unit of service quality.
[0062] According to an embodiment of the present application, the model parameters required for storing the above model and the model parameters in step 2 include a, r, μ, Q max , α max , β max , α, β, ω1, ω2, ω3, λ, linear coefficient of the linear function p(r), r max .
[0063] It should be noted that μ represents the doctor service rate, that is, how many patients the doctor sees per unit time. For example, if the doctor sees 40 patients in 4 hours, then μ = 1 / t. This value is calculated from the hospital information system and can be stored after calculation. For example, if the doctor releases 40 numbers in the morning, then λ = 40 / 4 = 10. t is the service time, which is an unknown variable and can be calculated assuming that other parameters are known. r is the doctor level, for example, it is set as 1, 2, and 3 in the hospital information system. Qmax, α, β, ω1, ω2, ω3 can be empirical values or derived from historical data. In the experimental stage, empirical values are used.
[0064] According to one embodiment of the present application, when a new patient visits an outpatient clinic, the parameters required by the model and related to the new patient are obtained, and the parameters required by the model and related to the new patient include b and c.
[0065] The real-time calculation of the longest waiting time and the longest queue that can be tolerated by outpatients includes the following steps:
[0066] The binary variable s(i)∈{0,1} is used to represent the treatment selection strategy of the i-th patient. When s(i)=1, it means that the patient stays in the treatment queue; when s(i)=0, it means that the patient leaves the queue, which can be expressed as the following equation:
[0067]
[0068] When V i >0, the patient will enter the outpatient waiting queue. At this time, let V i =0, corresponding to t q The longest waiting time that patients can tolerate Then we have:
[0069]
[0070] According to the parameters in step 2 and step 3, the longest waiting time that the patient can tolerate can be obtained.
[0071] The M / M / 1 / K queuing model is adopted, where K represents the number of outpatients treated by doctors in each time period, that is, the capacity of the queuing system. According to the queuing model, the arrival process of outpatients and the process of receiving diagnosis and treatment services are independent of each other, so:
[0072]
[0073] Where N q Indicates that the outpatient patients who choose this doctor can tolerate the longest queue, given that In the case of and μ, N can be obtained q .
[0074] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0075] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for calculating a visit index using a patient outpatient visit decision model based on stream computing, comprising the following steps: Step 1: Build a patient outpatient visit decision model based on stream computing; Step 2: The Kafka distributed message distribution system obtains the existing outpatient patient information from the hospital information system and stores the above model and the parameters required by the model; Step 3: When a new patient visits the outpatient clinic, the parameters related to the new patient required by the model are obtained, and based on the model and parameter information stored in the Kafka distributed message distribution system, the Spark Streaming stream computing framework is used to calculate in real time the longest waiting time and the longest queue that the outpatient patient can tolerate.
2. The method for calculating the visit index of the patient outpatient visit decision model based on stream computing according to claim 1 is characterized in that: The construction of the patient outpatient visit decision model based on stream computing includes the following steps: Step 110, establish a service quality model: Q(r) = (Q max -rμ)·α*β, where Q represents the service quality; r represents the doctor's grade, the larger the value, the higher the grade; Q max represents the best service quality, Q max =μ*r max *α max *β max , μ represents the doctor service rate, α represents the doctor reputation, β represents the hospital scale, α ranges from [0,1], the larger the value, the better the doctor's reputation, β ranges from [0,1], the larger the value, the larger the hospital scale.
3. The method for calculating the visit index of the patient outpatient visit decision model based on stream computing according to claim 2 is characterized in that: The construction of the patient outpatient visit decision model based on stream computing also includes the following steps: Step 120, establish a patient-perceived benefit-loss model: Where C represents the patient's perceived benefit and loss, C(t q ) represents the waiting cost for outpatient treatment, t q represents the patient waiting time, C(t q ) is t q The linear function of p(r) represents the registration fee, which can be represented by a linear function. r represents the doctor's grade, with values of 1, 2, and 3. p(r) = p(r max +1-r),r max Indicates the maximum doctor level. represents sunk cost. The longer the waiting time, the higher the sunk cost. c represents the waiting cost per unit time, ω1, ω2 and ω3 represent the weights of the waiting cost, registration fee and sunk cost of outpatient treatment, respectively; C(t q ) is calculated as follows: The arrival of patients follows a Poisson distribution, and the patient arrival rate is λ, t q The expectation is: Therefore, the expected value of the outpatient waiting cost is: b also represents the waiting cost per unit time, t represents the doctor's service time, μ = 1 / t, and C(t q ) is used to characterize C(t q ).
4. The method for calculating the visit index of the patient outpatient visit decision model based on stream computing according to claim 3 is characterized in that: The construction of the patient outpatient visit decision model based on stream computing also includes the following steps: Step 130, establish a patient outpatient decision model: whether a patient chooses a doctor's outpatient clinic depends on the service value obtained. The service value V can be expressed as: Where a represents the value coefficient of each unit of service quality.
5. The method for calculating the visit index of the patient outpatient visit decision model based on stream computing according to claim 4 is characterized in that: The model and the parameters required by the model are stored in step 2. The parameters required by the model include a, r, μ, Q max , α max , β max , α, β, ω1, ω2, ω3, λ, linear coefficient of the linear function p(r), r max .
6. The method for calculating the visit index of the patient outpatient visit decision model based on stream computing according to claim 5, characterized in that: When a new patient visits the outpatient clinic, the parameters required by the model and related to the new patient are obtained, and the parameters required by the model and related to the new patient include b and c.
7. The method for calculating the visit index of the patient outpatient visit decision model based on stream computing according to claim 6 is characterized in that: The real-time calculation of the longest waiting time and the longest queue that can be tolerated by outpatients includes the following steps: The binary variable s(i)∈{0,1} is used to represent the treatment selection strategy of the i-th patient. When s(i)=1, it means that the patient stays in the treatment queue; when s(i)=0, it means that the patient leaves the queue, which can be expressed as the following equation: When V i >0, the patient will enter the outpatient waiting queue. At this time, let V i =0, corresponding to t q The longest waiting time that patients can tolerate Then we have: According to the parameters in step 2 and step 3, the longest waiting time that the patient can tolerate can be obtained. The M / M / 1 / K queuing model is adopted, where K represents the number of outpatients treated by doctors in each time period, that is, the capacity of the queuing system. According to the queuing model, the arrival process of outpatients and the process of receiving diagnosis and treatment services are independent of each other, so: Where N q Indicates that the outpatient patients who choose this doctor can tolerate the longest queue, given that In the case of and μ, N can be obtained q .