Data query method and system based on memory database
By acquiring and analyzing the target diagnostic indicators in the physiological indicator examination table on the application server, predicting the surgical incidence rate of the target patients, and adding their medical data to the Redis database, the problem of low query efficiency in the existing technology is solved and improved Data query efficiency.
Patent Information
- Application Number
- CN202410728601.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, when the patient's medical data is not marked as hot data, it needs to be obtained from the SQL database, resulting in low query efficiency.
Before the patient's medical data is queried, the target diagnosis index in the physiological index examination table is obtained to determine the surgical incidence rate of the target patient, and the medical data is added to the Redis database according to the preset threshold to improve the efficiency of subsequent queries.
It realizes the analysis and prediction of surgery probability before the patient's medical data is queried, and adds the data to the Redis database, which improves the efficiency of subsequent queries and avoids the inefficiency of obtaining data from the SQL database before querying.
Smart Images

Figure CN118737353A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data query, and in particular relates to a data query method and system based on a memory database. Background Art
[0002] For hospitals that operate in a group or chain, the SQL database is deployed on a remote server (referred to as an SQL server) and provides data storage and query services for multiple hospitals. In order to reduce the load of the SQL server, medical data that is frequently queried (for example, frequent queries are defined as: more than 10 queries within 24 hours) is marked as hot data. Hot data can generally be added to the Redis database. Since the Redis database is a memory-based database, it can also have a faster query speed. Therefore, in the prior art, after the application server detects that the doctor frequently queries a patient's medical data on the query terminal, it generally marks the patient's medical data as hot data and then adds it to the Redis database, which is convenient for reducing the load of the SQL server and having a faster query speed.
[0003] However, the above scheme for determining hot data has the following shortcomings: when a patient's medical data is not marked as hot data, the patient's medical data needs to be obtained from the SQL database; therefore, there is a technical problem of inefficient querying of the patient's medical data before the patient's medical data is queried. Summary of the invention
[0004] The purpose of the present invention is to solve at least one of the above problems and to provide a data query method and system based on an in-memory database, which can mark the medical data corresponding to a patient as hot data before the patient's medical data is queried, so as to improve the efficiency of subsequent queries on the patient's medical data.
[0005] In order to achieve the above-mentioned object of the invention, the present invention provides a data query method based on a memory database, which is applicable to an application server, and the method comprises:
[0006] Obtaining a target diagnostic indicator in a physiological indicator examination table newly entered into an SQL database; the target diagnostic indicator is a diagnostic indicator belonging to a target patient in the physiological indicator examination table;
[0007] Determining the surgical incidence rate of the target patient based on the target diagnostic indicator;
[0008] When the surgical incidence of the target patient is greater than a preset threshold, the medical data of the target patient is added to the Redis database; the medical data of the target patient includes various data corresponding to the target patient collected by various modules of the HRP system;
[0009] When receiving the query instruction sent by the query terminal, the medical data of the target patient is obtained from the Redis database and the medical data is returned to the query terminal.
[0010] As a further improvement, the method further comprises:
[0011] For the first-category patients who are in hospital, after detecting that the medical data of the first-category patients in the SQL database is updated, the updated data is synchronized to the Redis database; when detecting that the first-category patients are in the discharged state, the medical data of the first-category patients in the Redis database is deleted;
[0012] For the second type of patients who are not in hospital, when it is detected that the medical data of the second type of patients in the SQL database is updated or the storage time in the Redis database is greater than the expiration time, the medical data of the second type of patients in the Redis database is deleted.
[0013] As a further improvement, determining the probability of the target patient undergoing surgery based on the target diagnostic indicator specifically includes:
[0014] Input the target diagnostic index into the surgery prediction model; wherein the surgery prediction model is obtained by training using multiple sets of training data, the multiple sets of training data include a first type of training data and a second type of training data, each set of training data in the first type of training data includes: a diagnostic index array consisting of diagnostic indexes in a physiological index examination table corresponding to patients in historical medical records of the same disease as the target patient who have undergone surgery, and a label indicating that the patient corresponding to the diagnostic index array needs surgery; each set of training data in the second type of training data includes: a diagnostic index array consisting of diagnostic indexes in a physiological index examination table corresponding to patients in historical medical records of the same disease as the target patient who have not undergone surgery, and a label indicating that the patient corresponding to the diagnostic index array does not need surgery;
[0015] The surgical incidence rate of the target patient is determined according to the results output by the surgical prediction model.
[0016] As a further improvement, when it is determined that the surgical incidence of the target patient is greater than a preset threshold, the method further includes:
[0017] Obtain multiple historical diagnosis and treatment reports for the same disease as the target patient;
[0018] Calculating reference similarity scores between the plurality of historical diagnosis and treatment reports and the medical records of the target patient;
[0019] Sorting according to the reference similarity scores to obtain a sorting result;
[0020] When a reference instruction sent by the query terminal is received, each historical diagnosis and treatment report is returned to the query terminal according to the sorting result.
[0021] As a further improvement, the reference similarity score S of the plurality of historical diagnosis and treatment reports and the medical records of the target patient is calculated according to the following formula 1: AB :
[0022] Formula 1:
[0023] Where n is the number of diagnostic indicators; A i is the value of the i-th diagnostic indicator in the target patient’s medical record, B i is the value of the i-th diagnostic index in one of the multiple historical diagnosis and treatment reports, f(A i , B i ) is the key factor judgment function of surgery, w(A i , B i ) is the key factor weight function.
[0024] As a further improvement, the key surgical factor judgment function f(A) is determined according to the following formula 2: i , B i ) value:
[0025] Formula 2:
[0026] Among them, Q i is the abnormal range set of the value of the i-th diagnostic indicator, and otherwise represents other situations.
[0027] As a further improvement, the key factor weight function w(A) is determined according to the following formula 3: i , B i ) value:
[0028] Formula 3:
[0029] Among them, Q i is the abnormal range set of the value of the i-th diagnostic indicator; P is the serial number set corresponding to the first type of diagnostic indicator, R is the serial number set corresponding to the second type of diagnostic indicator, and otherwise represents other situations.
[0030] As a further improvement, the Redis database is deployed on a Redis server, the SQL database is deployed on a SQL server, and the Redis server, the SQL server and the application server are in the same local area network.
[0031] As a further improvement, after obtaining the sorting result, the method further includes:
[0032] According to the ranking results, various diagnostic indicators of each historical diagnosis and treatment report are displayed on the interface of the query terminal;
[0033] In response to the selection operation of the corresponding diagnostic indicator, the operation record content corresponding to the selected diagnostic indicator is displayed on the query terminal.
[0034] On the other hand, the present invention provides a data query system based on an in-memory database, comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above method.
[0035] In yet another aspect, the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when the computer program / instruction is executed by a processor.
[0036] Beneficial effects:
[0037] Compared with the prior art, in which a patient's medical data must be queried before the corresponding medical data can be added to the Redis database, the present application provides a data query method and system based on an in-memory database, which can analyze the patient's medical data before the data is queried, and predict the probability that the patient needs surgery. If it is determined that the patient needs surgery, the patient's medical data is added to the Redis database before it is queried by the query terminal, thereby improving the efficiency of subsequent queries on the patient's medical data. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to make the technical problems solved by the present invention, the technical means adopted and the technical effects achieved more clearly, the specific embodiments of the present invention will be described in detail with reference to the accompanying drawings. However, it should be noted that the drawings described below are only drawings of exemplary embodiments of the present invention, and those skilled in the art can obtain drawings of other embodiments based on these drawings without creative work.
[0039] Figure 1 A flowchart of a data query method based on a memory database provided by an embodiment of the present invention;
[0040] Figure 2 A flowchart of a data query method based on a memory database provided by an embodiment of the present invention;
[0041] Figure 3 A flowchart of a data query method based on a memory database provided by an embodiment of the present invention;
[0042] Figure 4A flowchart of a data query method based on a memory database provided by an embodiment of the present invention;
[0043] Figure 5 A flowchart of a data query method based on a memory database provided by an embodiment of the present invention;
[0044] Figure 6 A schematic diagram of an application environment of a data query method based on a memory database provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] HRP system refers to the Hospital Resource Planning system, which is designed to help hospitals and other medical institutions manage their internal resources efficiently. These systems mainly include the following key functions: Patient management module: including patient registration, hospitalization and discharge management, and patient history management. Medical service management module: manages various medical services provided by the hospital, such as surgery, treatment and examination arrangements. Bed management module: efficiently allocates and tracks bed usage to ensure that resources are maximized. Drug and medical equipment management module: tracks and manages drug inventory, medical equipment usage and maintenance. Human resource management module: scheduling, training, performance evaluation and salary management of hospital employees. Financial management module: handles the financial affairs of the hospital, including cost calculation, bill management and budget control.
[0047] The medical data collected by each module of the HRP system will be organized in the form of tables and stored in the same SQL database. These tables include patient information table (Patients), medical record table (Medical_Records), drug usage record table (Medication_Usage), drug usage record table (Medication_Usage), financial transaction record table (Financial_Transactions), etc. When each module collects new medical data, it will also update the corresponding table in the SQL database. After logging into the HRP system, doctors can query the patient's data in various links through the query module to conduct hospital operation management or formulate patient diagnosis and treatment plans. For example, the doctor enters the patient's name "Zhang San" in the query interface of the query module. Using the SQL join operation, the medical data in two or more tables can be merged together according to the associated fields (such as when Patient_ID is "Zhang San") during the query. This query allows information to be extracted from multiple related tables and integrated into a single output result. This is particularly important for the HRP system because it allows medical staff to quickly obtain a comprehensive view of the patient, including medical, drug, equipment usage and financial conditions.
[0048] Figure 6The structural block diagram of the HRP system in one embodiment is shown, and the data query method based on the memory database provided by the present application is applied to the application server in the HRP system. Specifically, the hardware part of the HRP system includes an application server, an SQL server, a Redis server, a query terminal, a patient management module, a bed management module, a human resource management module, a financial management module, a drug and medical equipment management module, etc., and the above-mentioned hardware parts can be composed of computer devices with data transmission, storage and processing capabilities. Among them, the corresponding patient management client program is installed on the patient management module for patient registration, hospitalization and discharge management, and patient history management. The corresponding medical service management client program is installed on the medical service management module for managing various medical services provided by the hospital, such as surgery, treatment and examination arrangements. The corresponding bed management client program is installed on the bed management module for efficient allocation and tracking of bed usage to ensure that resources are maximized. The corresponding drug and medical equipment management client program is installed on the drug and medical equipment management module for tracking and managing drug inventory, the use and maintenance of medical equipment. The corresponding human resource management client program is installed on the human resource management module for scheduling, training, performance evaluation and salary management of hospital employees. The corresponding financial management client program is installed on the financial management module to handle the hospital's financial affairs, including cost calculation, bill management, and budget control. The application server, as the central node, processes data from each module, is responsible for the initial processing and forwarding of data, and handles query requests from the query terminal. The SQL server is responsible for persistent storage of all medical data and processing complex queries from the application server. The Redis server, as a fast-access cache database, stores frequently accessed data, reduces query pressure on the SQL server, and improves data access speed.
[0049] In SQL databases, data structures are usually organized in the form of tables. Each table represents an entity type and consists of rows and columns. Each row represents an instance of an entity (such as a patient, a drug use record, a financial transaction), and each column represents an attribute of the entity (such as the patient's name, the name of the drug, the amount of the transaction).
[0050] Here is an example of possible tables in a simplified hospital management system that describe patient information, medical records, medication usage, medical equipment, and financial transactions:
[0051] 1. Patient Information Form (Patients)
[0052] Patient_ID: Unique identifier, such as 1001.
[0053] Name: Patient’s name, such as Zhang San.
[0054] Age: Patient age, such as 30.
[0055] Address: Patient's address, such as "Yuehai Street, Nanshan District, Shenzhen City".
[0056] Phone_Number: Contact number, such as "123-4567".
[0057] 2. Medical Records
[0058] Record_ID: Unique identifier of the medical record, such as 2002.
[0059] Patient_ID: The associated patient's unique identifier, such as 1001.
[0060] Date: record date, such as "2024-01-01".
[0061] Diagnosis: Diagnosis result, such as "heart disease".
[0062] Treatment: Treatment options, such as "heart bypass surgery."
[0063] 3. Medication Usage Record (Medication_Usage)
[0064] Usage_ID: Unique identifier of the drug usage record, such as 3003.
[0065] Patient_ID: The associated patient's unique identifier, such as 1001.
[0066] Medication_Name: The name of the drug, such as "aspirin".
[0067] Dosage: dosage, such as "100mg".
[0068] Administration_Date: Administration date, such as "2024-01-02".
[0069] 4. Medical equipment usage record (Equipment_Usage)
[0070] Equipment_ID: Unique identifier of the equipment, such as 4004.
[0071] Patient_ID: The associated patient's unique identifier, such as 1001.
[0072] Equipment_Name: Equipment name, such as "ECG monitor".
[0073] Usage_Start_Date: Usage start date, such as "2024-01-01".
[0074] Usage_End_Date: The usage end date, such as "2024-01-03".
[0075] 5. Financial transaction record table (Financial_Transactions)
[0076] Transaction_ID: The unique identifier of the transaction, such as 5005.
[0077] Patient_ID: The associated patient's unique identifier, such as 1001.
[0078] Amount: transaction amount, such as 2000 yuan.
[0079] Transaction_Date: transaction date, such as "2024-01-04".
[0080] Description: Transaction description, such as "surgery fee".
[0081] Specifically, after each module collects the medical data corresponding to Zhang San, it sends it to the application server through the corresponding client program, and the application server forwards the corresponding data to the SQL server to store the data in the SQL database.
[0082] When a doctor needs to query Zhang San's medical data on the query terminal, the process is as follows:
[0083] 1. User input: The user enters the patient's name in the query interface.
[0084] 2. Send a query request: The query terminal sends a query request containing the patient's name to the application server through the network.
[0085] 3. SQL query execution: After receiving the request, the application server constructs an SQL query statement. For example, if the user enters "Zhang San", the SQL query is: SELECT * FROM patients WHERE name = 'Zhang San'.
[0086] 4. Database interaction: The application server sends SQL queries to the SQL database of the SQL server.
[0087] 5. Data retrieval: The SQL database executes an SQL query to retrieve all relevant data matching the patient's name.
[0088] 6. Return data: The SQL server sends the query results back to the application server.
[0089] 7. Data processing: The application server will format or process the data as necessary. Each table is associated with other tables through key fields (such as Patient_ID), so that these tables can be joined through SQL queries to extract comprehensive information. For example, to query all relevant information about patient Zhang San, you can join these tables and use Patient_ID as the basis for the join.
[0090] 8. Data display: The application server sends the processed data back to the query terminal through the network and displays it to the user.
[0091] If Redis is deployed as a cache system, the application server will first check the cache to reduce the number of SQL database accesses, reduce the load on the SQL server, and improve overall query efficiency. Specifically, the application server first communicates with the Redis server to query the Redis database. If there is data in the Redis database (cache hit), the application server directly returns the cached data in Redis to the query terminal. If there is no data in Redis (cache miss), the application server will build an SQL query to request the SQL database to execute the SQL query and retrieve all relevant data that matches the patient name.
[0092] The above solution introduces Redis. After the application server detects that the doctor frequently queries a patient's medical data on the query terminal, it will generally mark the patient's medical data as hot data and then add it to the Redis database, which is convenient for reducing the load of the SQL server and has a faster query speed. However, the above solution has the following shortcomings in determining hot data: when a patient's medical data is not marked as hot data, the patient's medical data needs to be obtained from the SQL database; therefore, there is a technical problem of low efficiency in querying the patient's medical data before the patient's medical data is queried.
[0093] Based on this, some embodiments of the present application provide a data query method and system based on an in-memory database, which can mark the medical data corresponding to the patient as hot data before the patient's medical data is queried, so as to improve the efficiency of subsequent queries on the patient's medical data.
[0094] like Figure 1 As shown, this embodiment provides a data query method based on a memory database, which is applicable to an application server, and the method includes:
[0095] Step S202, the application server obtains the target diagnostic index in the physiological index examination table newly entered into the SQL database. The target diagnostic index is the diagnostic index belonging to the target patient in the physiological index examination table.
[0096] Specifically, after the outpatient consultation, the patient will generally undergo a corresponding physiological index examination, so it is necessary to establish a corresponding physiological index examination form for each disease. The following shows some diagnostic indicators in the physiological index examination form for heart disease:
[0097] Record_ID 6006,--Unique identifier of the physiological index examination form.
[0098] Patient_ID 1001. The associated patient unique identifier.
[0099] Type 021. Disease type identifier
[0100] Date DATE 2024-01-01, check date.
[0101] Systolic_BP INT, -- Systolic blood pressure.
[0102] Diastolic_BP INT,--diastolic blood pressure.
[0103] Heart_Rate INT,--heart rate.
[0104] Cholesterol_Total FLOAT,--Total cholesterol.
[0105] LDL FLOAT,--low-density lipoprotein.
[0106] HDL FLOAT,--high-density lipoprotein.
[0107] Triglycerides FLOAT,--Triglycerides.
[0108] Fasting_Glucose FLOAT,--Fasting blood sugar.
[0109] CRP FLOAT,--C-reactive protein.
[0110] Creatinine FLOAT,--creatinine.
[0111] Ejection_Fraction FLOAT,--Ejection fraction.
[0112] Among them, INT indicates that the value of the diagnostic indicator is an integer, and FLOAT indicates that the value of the diagnostic indicator is a floating point number.
[0113] Specifically, the data of the physiological index check form is uploaded to the application server by the physical examination module. When the application server receives the data uploaded by the physical examination module, it determines that there is a new physiological index check form to be entered into the SQL database, so the data uploaded by the physical examination module is obtained as the target data, and the various diagnostic indicators in the target data are the target diagnostic indicators. If the corresponding patient in the form is Zhang San, the target diagnostic indicator is the diagnostic indicator belonging to Zhang San in the physiological index check form.
[0114] Step S204: the application server determines the surgical incidence rate of the target patient based on the target diagnostic indicator.
[0115] like Figure 2 As shown, determining the probability of the target patient undergoing surgery based on the target diagnostic indicator specifically includes:
[0116] Step S2041, input the target diagnostic index into the surgery prediction model. The surgery prediction model is obtained by training using multiple sets of training data, and the multiple sets of training data include first-type training data and second-type training data, and each set of training data in the first-type training data includes: a diagnostic index array consisting of diagnostic indexes in a physiological index examination table corresponding to patients who have undergone surgery in the historical medical records of the same disease as the target patient, and a label indicating that the patient corresponding to the diagnostic index array needs surgery; each set of training data in the second-type training data includes: a diagnostic index array consisting of diagnostic indexes in a physiological index examination table corresponding to patients who have not undergone surgery in the historical medical records of the same disease as the target patient, and a label indicating that the patient corresponding to the diagnostic index array does not need surgery.
[0117] Specifically, if the disease type is heart disease, the diagnostic index array is composed of the values corresponding to diagnostic indicators such as systolic blood pressure, diastolic blood pressure, heart rate, total cholesterol, low-density lipoprotein, high-density lipoprotein, triglycerides, fasting blood sugar, C-reactive protein, creatinine, and ejection fraction. For patients who have undergone surgery, the label is 1; for patients who have not undergone surgery, the label is 0. How to use data and labels to train neural networks belongs to the existing technology and will not be elaborated here.
[0118] Step S2042: determining the surgical incidence rate of the target patient according to the result output by the surgical prediction model.
[0119] The neural network can learn the pattern between the diagnostic index array of heart disease patients and whether they need surgery. If the output result is 1, it is judged that patient Zhang San needs surgery, that is, the surgery incidence is 1, and patient Zhang San is likely to need to be diagnosed with heart disease and undergo surgery. Therefore, before the surgery, the doctor needs to query the medical data of patient Zhang San many times to inform the patient or the patient's family of the condition, and discuss the diagnosis and surgery plan with doctors in the same department. If the output result is 0, it is judged that the patient's surgery incidence is 0, and no surgery is needed for heart disease.
[0120] Step S206, when the surgical incidence of the target patient is greater than a preset threshold, the application server adds the medical data of the target patient to the Redis database. The medical data of the target patient includes various data corresponding to the target patient collected by various modules of the HRP system.
[0121] Specifically, the preset threshold is 0. Once the output result is 1, it is determined that patient Zhang San needs surgery, that is, the surgery incidence rate is 1. At this time, the medical data of the target patient needs to be added to the Redis database, so that the doctor can query the medical data of the patient in the near future with higher efficiency.
[0122] Step S208, when the application server receives the query instruction sent by the query terminal, it obtains the medical data of the target patient from the Redis database and returns the medical data to the query terminal.
[0123] To sum up, compared with the prior art, in which a patient's medical data must be queried before the corresponding medical data can be added to the Redis database, the data query method and system based on the in-memory database provided in the present application can analyze the patient's medical data before the medical data is queried, and predict the probability that the patient needs surgery. If it is determined that the patient needs surgery, the patient's medical data is added to the Redis database before it is queried by the query terminal, thereby improving the efficiency of subsequent queries on the patient's medical data.
[0124] like Figure 3 As shown, in some embodiments, the method further includes:
[0125] Step S302, for the first type of patients in hospital, after the application server detects that the medical data of the first type of patients in the SQL database is updated, the updated data is synchronized to the Redis database;
[0126] Step S303, when it is detected that the first category of patients is in a discharged state, the medical data of the first category of patients in the Redis database is deleted.
[0127] Patients who are hospitalized are classified as Category 1 patients. Their conditions are more serious and doctors generally need to check their treatment status frequently. Therefore, when the application server detects the hospitalization data uploaded by the patient management module, it will save the medical data belonging to the patient to Redis according to the patient name in the hospitalization data and will not delete it from Redis before discharge.
[0128] Step S304: For the second type of patients who are not hospitalized, when the application server detects that the medical data of the second type of patients in the SQL database is updated or the storage time in the Redis database is greater than the expiration time, the medical data of the second type of patients in the Redis database is deleted.
[0129] It should be noted that the prior art generally sets an expiration time for the data on Redis. Once a piece of data has not been accessed for more than the expiration time, it will be deleted from the Redis database to save Redis memory resources. However, the strategy for setting the expiration time is insufficient. If it is set too long, the memory resources of the Redis server will be occupied by a large amount of data that does not need to be accessed. If it is set too short, the data on Redis will be frequently cleared. When these data are accessed again, they can only be obtained from the SQL database, reducing the efficiency of data query. The core of solving this problem is to more intelligently identify which data should be retained on Redis, and set the corresponding retention time according to the characteristics of different data in business scenarios, rather than just setting a general expiration time. As shown in steps S302 to S303, the data of hospitalized patients will be frequently queried. For this type of medical data, the expiration time is not used to delete it from Redis, while the expiration time strategy is still used for other data, thereby ensuring the balance between the memory resource occupancy rate of the Redis server and the efficiency of querying medical data.
[0130] like Figure 4 As shown, in some embodiments, when it is determined that the surgical incidence of the target patient is greater than a preset threshold, the method further includes:
[0131] Step S402, obtaining multiple historical diagnosis and treatment reports of the same disease as the target patient; wherein each of the historical diagnosis and treatment reports includes an operation record.
[0132] In one example, the disease is heart disease, and 200 historical diagnosis and treatment reports of heart disease are obtained. Each of the 200 historical diagnosis and treatment reports includes the patient's historical medical history and operation records.
[0133] Step S404, calculating reference similarity scores between the multiple historical diagnosis and treatment reports and the medical records of the target patient.
[0134] It is understandable that before operating on a new patient, the doctor needs to obtain the historical diagnosis and treatment reports of the patients with the closest condition to the patient for reference, in order to make up for the lack of personal experience and improve the efficacy of the formulated surgical plan. When there are many historical diagnosis and treatment reports, it is inefficient to search manually. Therefore, in this embodiment, an application server is used to automatically calculate the reference similarity scores of multiple historical diagnosis and treatment reports and the medical records of the target patient. The higher the reference similarity score, the more reference value it has.
[0135] Step S406, sorting according to the reference similarity scores to obtain a sorting result.
[0136] Step S408, upon receiving the reference instruction sent by the query terminal, each historical diagnosis and treatment report is returned to the query terminal according to the sorting result.
[0137] In this embodiment, a computer is used instead of manual search for historical medical reports with reference value, thereby improving the efficiency of doctors in searching for information on surgical plans for patients. At the same time, since the historical medical reports are sorted according to their reference value, doctors can view the historical medical reports according to the sorting number, further improving the efficiency of doctors in searching for information on surgical plans for target patients.
[0138] In some embodiments, the reference similarity score S of the plurality of historical diagnosis and treatment reports and the medical records of the target patient is calculated according to the following formula 1: AB :
[0139] Formula 1:
[0140] Where n is the number of diagnostic indicators; A i is the value of the i-th diagnostic indicator in the target patient’s medical record, B i is the value of the i-th diagnostic index in one of the multiple historical diagnosis and treatment reports, f(A i , B i ) is the key factor judgment function of surgery, w(A i , B i ) is the key factor weight function.
[0141] Determine the key surgical factor judgment function f(A) according to the following formula 2 i , B i ) value:
[0142] Formula 2:
[0143] Among them, Q i is the abnormal range set of the value of the i-th diagnostic indicator, and otherwise represents other situations.
[0144] Determine the key factor weight function w(A) according to the following formula 3 i , B i ) value:
[0145] Formula 3:
[0146] Among them, Q i is the abnormal range set of the value of the i-th diagnostic indicator; P is the serial number set corresponding to the first type of diagnostic indicator, R is the serial number set corresponding to the second type of diagnostic indicator, and otherwise represents other situations.
[0147] Specifically, when formulating a surgical plan, abnormal diagnostic indicators are key factors that need to be considered. For example, when creatinine levels are in an abnormal range, it may indicate impaired renal function. Surgical considerations: Heart disease patients with renal insufficiency are at higher risk when undergoing heart surgery (such as coronary artery bypass graft surgery). Doctors may adjust the surgical approach or postpone the surgery until renal function improves. For example, the high-sensitivity C-reactive protein (hs-CRP) range is abnormal. Since C-reactive protein is a marker of inflammation in the body, high levels of hs-CRP indicate the presence of inflammation. Surgical considerations: Inflammatory states may increase the risk of surgical complications, such as infection and difficulty in postoperative recovery. For example, ejection fraction is an important indicator of the heart's ability to pump blood, and normal values are usually between 55% and 70%. Surgical considerations: Low ejection fractions in the abnormal range (such as less than 40%) indicate that the heart's pumping function is severely limited, and patients in this case are at higher risk for heart surgery. Doctors may consider using circulatory assist devices or other special surgical techniques. Before surgery, medication may be needed to reduce inflammation levels.
[0148] Furthermore, different diagnostic indicators have different degrees of influence on the formulation of surgical plans for certain diseases. For example, weight in an abnormal range usually does not directly affect the surgical process. Therefore, among the four diagnostic indicators of weight, creatinine level, high-sensitivity C-reactive protein (hs-CRP) and ejection fraction, creatinine level, high-sensitivity C-reactive protein (hs-CRP) and ejection fraction are factors that are more worthy of doctors' attention, and weight is second. At this time, for heart disease, creatinine level, high-sensitivity C-reactive protein (hs-CRP) and ejection fraction are first-class diagnostic indicators, and weight is second-class diagnostic indicators. For example, in the medical record, the serial numbers corresponding to the four diagnostic indicators of weight, creatinine level, high-sensitivity C-reactive protein (hs-CRP) and ejection fraction are 1, 11, 12, and 13, respectively, where P is the serial number set corresponding to the first-class diagnostic indicator, which includes 11, 12, and 13, and R is the serial number set corresponding to the second-class diagnostic indicator, which includes 1. Whether each diagnostic indicator belongs to the first or second class diagnostic indicator can be determined by an expert.
[0149] For example, the number of diagnostic indicators is 20, which are numbered from 1 to 20. The first 10 diagnostic indicators of the target patient are all within the normal range, the last 10 diagnostic indicators are all within the abnormal range, and the last 10 diagnostic indicators all belong to the first category of diagnostic indicators.
[0150] In one example, the first 15 diagnostic indicators in the first historical diagnosis and treatment report are all within the normal range, and the last 5 diagnostic indicators are all within the abnormal range. Substitute them into formulas 1, 2, and 3 to calculate the reference similarity score
[0151] In one example, the first 10 diagnostic indicators in the second historical diagnosis and treatment report are all within the normal range, and the last 10 diagnostic indicators are all within the abnormal range. Substitute them into formulas 1, 2, and 3 to calculate the reference similarity score
[0152] In one example, the first 12 diagnostic indicators in the third historical diagnosis and treatment report are all within the normal range, and the last 8 diagnostic indicators are all within the abnormal range. Substitute them into formulas 1, 2, and 3 to calculate the reference similarity score
[0153] The value range is between 0 and 1. It can be seen that in the above three examples, Formula 1 gives the highest score to the historical diagnosis and treatment reports whose last 10 items are all within the abnormal range. Its ranking is the highest, which makes it easier for doctors to quickly and efficiently obtain the most valuable historical diagnosis and treatment reports when formulating surgical plans.
[0154] In one example, all 20 diagnostic indicators in the fourth historical diagnosis and treatment report are in the abnormal range. Substituting into formulas 1, 2, and 3, the reference similarity score is calculated.
[0155] It can be seen that the second historical diagnosis and treatment report is more valuable for reference, and doctors prefer to refer to the surgical records in the second historical diagnosis and treatment report. Comparing the second historical diagnosis and treatment report with the fourth historical diagnosis and treatment report, since the first 10 diagnostic indicators in the second historical diagnosis and treatment report are all within the normal range, therefore, in general, the A corresponding to the first 10 diagnostic indicators in the second historical diagnosis and treatment report is i -B i Less than the A corresponding to the first 10 diagnostic indicators in the fourth historical diagnosis and treatment report i -B i , so the second historical medical report corresponds to Greater than the fourth historical medical report That is, the reference similarity score of the second historical diagnosis and treatment report is greater than the reference similarity score of the fourth historical diagnosis and treatment report, so the second historical diagnosis and treatment report ranks higher.
[0156] In one example, the first 16 diagnostic indicators in the fifth historical diagnosis and treatment report are all within the normal range, and the last 4 diagnostic indicators are all within the abnormal range. Substitute them into formulas 1, 2, and 3 to calculate the reference similarity score
[0157] In one example, the first 16 diagnostic indicators in the sixth historical diagnosis and treatment report are all within the normal range, and the last 4 diagnostic indicators are all within the abnormal range. Substitute them into formulas 1, 2, and 3 to calculate the reference similarity score
[0158] Specifically, the A corresponding to the first 16 diagnostic indicators in the fifth historical diagnosis and treatment report i -B i All are 4, and the A corresponding to the last 4 diagnostic indicators in the fifth historical diagnosis and treatment report i -B i The A values of the first 16 diagnostic indicators in the sixth historical diagnosis and treatment report are all 20. i -B i All are 20, and the A corresponding to the last 4 diagnostic indicators in the sixth historical diagnosis and treatment report i -B i All are 4. It can be seen that although the differences between most (i.e. 16) diagnostic indicators in the fifth historical diagnosis and treatment report are very small (A i -B i All of them were 4), only a small part (i.e. 4 items) had a large difference in diagnostic indicators (A i -B i In the sixth historical diagnosis and treatment report, most (i.e., 16 items) of the diagnostic indicators differed greatly (A i -B i 20), only a small number of diagnostic indicators (i.e., 4 items) had a small difference (A i -B i Both are 4). However, of the fifth and sixth reports, the sixth report should be more valuable for doctors to make surgical plans, because when making surgical plans, abnormal diagnostic indicators can better remind doctors to pay attention to the corresponding abnormal treatment plan, and the sixth historical diagnosis and treatment report is very close in terms of various abnormal diagnostic indicators and is more valuable for reference.
[0159] The A corresponding to the first 16 diagnostic indicators in the fifth historical diagnosis and treatment report i -B i All are 4, and the A corresponding to the last 4 diagnostic indicators is i -B i Both are 20, and the reference similarity score S is calculated by substituting them into formula 1. AB =40+0.129=40.129.i -B i All are 20, and the A corresponding to the last 4 diagnostic indicators is i -B i Both are 4, and substitute them into formula 1 to calculate the reference similarity score S AB =40+0.196=40.196. Therefore, the sixth historical diagnosis and treatment report is ranked ahead of the fifth historical diagnosis and treatment report. Formula 1 can be used to rank the historical diagnosis and treatment reports that are more valuable for doctors to make surgical plans, so that doctors can quickly and efficiently obtain the most valuable historical diagnosis and treatment reports when making surgical plans.
[0160] In summary, the higher the reference similarity score calculated by Formula 1, the more valuable it is as a reference, which can improve the efficiency of doctors in searching for information before surgery and provide a guarantee for the safe formulation of surgical plans.
[0161] In some embodiments, the Redis database is deployed on a Redis server, the SQL database is deployed on a SQL server, and the Redis server, the SQL server and the application server are in the same local area network. Since the three are in the same local area network, when querying data, the application server can quickly obtain medical data from the database, thereby improving the efficiency of the query.
[0162] like Figure 5 As shown, in some embodiments, after obtaining the sorting result, the method further includes:
[0163] Step S502: displaying various diagnostic indicators of each historical diagnosis and treatment report on the interface of the query terminal according to the sorting result.
[0164] Step S504: in response to the selection operation of the corresponding diagnostic indicator, the operation record content corresponding to the selected diagnostic indicator is displayed on the query terminal.
[0165] Specifically, each historical medical report has 20 diagnostic indicators. The selection operation can be a single-click operation. Each diagnostic indicator is bound to a hyperlink. When the user clicks on the diagnostic indicator of creatinine level in a historical medical report, the query terminal jumps to the surgical record position of the corresponding historical medical report to display the surgical record content corresponding to the selected diagnostic indicator, so that the user can view the measures that should be paid attention to in the surgical plan when the diagnostic indicator is abnormal.
[0166] On the other hand, the present invention provides a data query system based on a memory database, comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above method.
[0167] In yet another aspect, the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when the computer program / instruction is executed by a processor.
[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A data query method based on a memory database, applicable to an application server, characterized in that: The method comprises: Obtaining a target diagnostic indicator in a physiological indicator examination table newly entered into an SQL database; the target diagnostic indicator is a diagnostic indicator belonging to a target patient in the physiological indicator examination table; Determining the surgical incidence rate of the target patient based on the target diagnostic indicator; When the surgical incidence of the target patient is greater than a preset threshold, the medical data of the target patient is added to the Redis database; the medical data of the target patient includes various data corresponding to the target patient collected by various modules of the HRP system; When receiving the query instruction sent by the query terminal, the medical data of the target patient is obtained from the Redis database and the medical data is returned to the query terminal.
2. The data query method based on the memory database according to claim 1 is characterized in that: The method further comprises: For the first-category patients who are in hospital, after detecting that the medical data of the first-category patients in the SQL database is updated, the updated data is synchronized to the Redis database; when detecting that the first-category patients are in the discharged state, the medical data of the first-category patients in the Redis database is deleted; For the second type of patients who are not in hospital, when it is detected that the medical data of the second type of patients in the SQL database is updated or the storage time in the Redis database is greater than the expiration time, the medical data of the second type of patients in the Redis database is deleted.
3. The data query method based on the memory database according to claim 1 is characterized in that: Determining the probability of the target patient undergoing surgery based on the target diagnostic indicator specifically includes: Input the target diagnostic index into the surgery prediction model; wherein the surgery prediction model is obtained by training using multiple sets of training data, the multiple sets of training data include a first type of training data and a second type of training data, each set of training data in the first type of training data includes: a diagnostic index array consisting of diagnostic indexes in a physiological index examination table corresponding to patients in historical medical records of the same disease as the target patient who have undergone surgery, and a label indicating that the patient corresponding to the diagnostic index array needs surgery; each set of training data in the second type of training data includes: a diagnostic index array consisting of diagnostic indexes in a physiological index examination table corresponding to patients in historical medical records of the same disease as the target patient who have not undergone surgery, and a label indicating that the patient corresponding to the diagnostic index array does not need surgery; The surgical incidence rate of the target patient is determined according to the results output by the surgical prediction model.
4. The data query method based on the memory database according to claim 1 is characterized in that: When it is determined that the surgical incidence of the target patient is greater than a preset threshold, the method further includes: Obtain multiple historical diagnosis and treatment reports for the same disease as the target patient; Calculating reference similarity scores between the plurality of historical diagnosis and treatment reports and the medical records of the target patient; Sorting according to the reference similarity scores to obtain a sorting result; When a reference instruction sent by the query terminal is received, each historical diagnosis and treatment report is returned to the query terminal according to the sorting result.
5. The data query method based on the memory database according to claim 4 is characterized in that: The reference similarity score S of the multiple historical diagnosis and treatment reports and the medical records of the target patient is calculated according to the following formula 1: AB : Formula 1: Where n is the number of diagnostic indicators; A i is the value of the i-th diagnostic indicator in the target patient’s medical record, B i is the value of the i-th diagnostic index in one of the multiple historical diagnosis and treatment reports, f(A i , B i ) is the key factor judgment function of surgery, w(A i , B i ) is the key factor weight function.
6. A data query method based on a memory database according to claim 5, characterized in that: Determine the key surgical factor judgment function f(A) according to the following formula 2 i , B i ) value: Formula 2: Among them, Q i is the abnormal range set of the value of the i-th diagnostic indicator, and otherwise represents other situations.
7. The data query method based on the memory database according to claim 5 is characterized in that: Determine the key factor weight function w(A) according to the following formula 3 i , B i ) value: Formula 3: Among them, Q i is the abnormal range set of the value of the i-th diagnostic indicator; P is the serial number set corresponding to the first type of diagnostic indicator, R is the serial number set corresponding to the second type of diagnostic indicator, and otherwise represents other situations.
8. The data query method based on the memory database according to claim 1 is characterized in that: The Redis database is deployed on a Redis server, the SQL database is deployed on a SQL server, and the Redis server, the SQL server and the application server are in the same local area network.
9. The data query method based on the memory database according to claim 1 is characterized in that: After obtaining the sorting result, the method further includes: According to the ranking results, various diagnostic indicators of each historical diagnosis and treatment report are displayed on the interface of the query terminal; In response to the selection operation of the corresponding diagnostic indicator, the operation record content corresponding to the selected diagnostic indicator is displayed on the query terminal.
10. A data query system based on a memory database, comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of any one of claims 1 to 9 of the data query method based on the memory database.
Citation Information
Patent Citations
Big data association storage based medical data query system and method
CN106815336A
Data query method and device and data storage system
CN108874806A
A database distributed caching system and method
CN109033292A
Information query method and apparatus based on Redis database and electronic equipment
CN110750539A
System and method for processing primary-level medical information based on edge computing
CN111161860A
Cited By
Artificial intelligence agent for operating rooms and surgery
WO2026167569A1
