A service-based data query method and system
By storing medical data fields and desensitization data in the Redis database and generating desensitized files based on user permission combinations, the problem of difficult to balance the memory overhead of Redis server and the calculation overhead of application server in the prior art is solved, and efficient data query and desensitization processing are achieved.
Patent Information
- Application Number
- CN202410728369.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2044-06-06
AI Technical Summary
In the process of querying and displaying medical data for users with different permissions, the prior art is difficult to find a balance between reducing the memory overhead of Redis servers and reducing the overhead of real-time desensitization of application servers.
By storing the field data of the target file and the desensitized data corresponding to each permission level in the Redis database in the form of key-value pairs, the corresponding desensitized data and undesensitized data are obtained from the Redis database according to the user permission level, and the desensitized file is combined and returned to the user.
This method can reduce the memory overhead of Redis server while reducing the computing overhead of real-time desensitization of the application server, and improve the efficiency and performance of data query.
Smart Images

Figure CN118733605B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data query, and particularly relates to a service-based data query method and system. Background Art
[0002] Since the HRP system stores a lot of private data of patients, the query of medical data usually involves user permission management and data desensitization processing. To protect patient privacy, users with different permissions (for example, the permissions of attending doctors, intern doctors, and nurses are different) can only view the content in the medical data that matches their respective permissions. In the related art, there are two common practices as follows:
[0003] 1. Storage of multiple desensitized files: Store a complete desensitized medical data for each permission level. This method enables the application server to directly obtain the complete desensitized medical data that meets the user's permission from the Redis database and return it to the query terminal, which can reduce the computing resource overhead of the application server. However, it is necessary to store multiple complete medical data with different desensitization levels in Redis, resulting in a large amount of redundant data and wasting the memory resources of the Redis server.
[0004] 2. Real-time desensitization processing: Only store a copy of the original medical data in Redis, and perform real-time desensitization processing on the application server according to the user's permission. This method can reduce the memory overhead of the Redis server, but it will increase the computing resource overhead of the application server.
[0005] It can be seen that in the related art, the Redis technology is introduced to improve the data query performance. As a remote dictionary service, Redis stores key-value pairs in memory to achieve fast data access and storage, and it performs well in fields such as caching, session storage, and real-time analysis. However, in the process of querying and displaying medical data for users with different permissions, there is a contradiction between reducing the memory overhead of the Redis server and reducing the computing overhead of the application server for real-time desensitization. Summary of the Invention
[0006] The purpose of the present invention is to solve at least one of the above problems, and provide a service-based data query method and system, specifically a data query method and system based on the Redis remote dictionary service, which can reduce the memory overhead of the Redis server and the computing overhead of the application server for real-time desensitization while querying and displaying medical data for users with different permissions.
[0007] To achieve the above object of the invention, the present invention provides a service-based data query method, which is applicable to an application server, and the method includes:
[0008] Store the field data of the target file in the Redis database in the form of key-value pairs; where the target file is a file marked as hot data;
[0009] Store the desensitized data corresponding to each permission level in the target file in the Redis database in the form of key-value pairs;
[0010] When a user queries the target file, first obtain the corresponding desensitized data from the Redis database according to the user permission level, and then obtain the remaining non-desensitized data in the target file;
[0011] Combine the desensitized data obtained from Redis and the non-desensitized data to generate a desensitized file;
[0012] Return the desensitized file to the query terminal where the user logs in.
[0013] As a further improvement, the desensitized data corresponding to a lower permission level does not include the desensitized data corresponding to a higher permission level; the step of first obtaining the corresponding desensitized data from the Redis database according to the user permission level and then obtaining the remaining non-desensitized data in the target file specifically includes:
[0014] When a user queries the target file, first obtain the corresponding desensitized data and the desensitized data corresponding to a level higher than the user permission level from the Redis database, and then obtain the remaining non-desensitized data in the target file.
[0015] As a further improvement, the method further includes:
[0016] When receiving a query instruction sent by the query terminal, mark the file corresponding to the query instruction as hot data.
[0017] As a further improvement, when receiving a reference instruction sent by the query terminal, the method further includes:
[0018] Obtain multiple historical diagnosis and treatment reports of the same disease as the target patient; where the reference instruction carries the disease corresponding to the target patient;
[0019] Calculate the reference similarity score between the multiple historical diagnosis and treatment reports and the medical record of the target patient;
[0020] Sort according to the reference similarity score from high to low to obtain a sorting result;
[0021] Return each historical diagnosis and treatment report to the query terminal according to the sorting result.
[0022] As a further improvement, the method further includes:
[0023] Mark the historical diagnosis reports ranked in the top M in the sorting result as hot data; where M is an integer greater than 0.
[0024] As a further improvement, the method further includes:
[0025] When receiving a collection instruction for a historical diagnosis report sent by a query terminal, mark the corresponding historical diagnosis report as hot data.
[0026] As a further improvement, calculate the reference similarity score S between the multiple historical diagnosis reports and the medical record of the target patient according to the following formula 1 AB :
[0027] Formula 1:
[0028] where n is the number of diagnostic indicators; A i is the value of the i-th diagnostic indicator in the medical record of the target patient, and B i is the value of the i-th diagnostic indicator in a historical diagnosis report among the multiple historical diagnosis reports, and f(A i , B i ) is a surgical key factor judgment function, and w(A i , B i ) is a key factor weight function.
[0029] As a further improvement, determine the value of the surgical key factor judgment function f(A i , B i ) according to the following formula 2:
[0030] Formula 2:
[0031] where Q i is the set of abnormal ranges of the value of the i-th diagnostic indicator, and otherwise represents other situations.
[0032] As a further improvement, determine the value of the key factor weight function w(A i , B i ) according to the following formula 3:
[0033] Formula 3:
[0034] where Q i is the set of abnormal ranges of the value of the i-th diagnostic indicator; P is the set of serial numbers corresponding to the first type of diagnostic indicators, R is the set of serial numbers corresponding to the second type of diagnostic indicators, and otherwise represents other situations.
[0035] On the other hand, the present invention provides a service-based data query system, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the steps of the above method.
[0036] In yet another aspect, the present invention provides a computer-readable storage medium, on which a computer program / instructions are stored. When the computer program / instructions are executed by a processor, the steps of the above method are implemented.
[0037] Compared with the prior art, a service-based data query method and system provided by the present application at least have the following beneficial effects: During the process of querying and displaying medical data for users with different permissions, the present application can store only the incremental part of the desensitized data for users with lower permissions, without storing a complete desensitized file for each permission user, reducing the memory overhead of the Redis server. At the same time, when it is necessary to provide a complete desensitized file for users with different permissions, only the different incremental parts on the Redis server need to be combined, without re-executing the desensitization operation on the application server, which can reduce the computational overhead of real-time desensitization on the application server. 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 clearer, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the drawings described below are only the drawings of the exemplary embodiments of the present invention, and those skilled in the art can obtain the drawings of other embodiments without creative efforts based on these drawings.
[0039] Figure 1 It is a flowchart of a service-based data query method provided by an embodiment of the present invention;
[0040] Figure 2 It is a flowchart of a service-based data query method provided by an embodiment of the present invention;
[0041] Figure 3 It is a schematic diagram of the application environment of a service-based data query method provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present invention fall within the protection scope of the present invention.
[0043] The Hospital Resource Planning (HRP) system integrates various business processes within a hospital and also achieves effective docking with clinical information systems, providing a comprehensive and collaborative management platform for the hospital. The HRP system can be used for the entry, modification, deletion, and query of medical data, such as medical data like patients' hospitalization information, medical record files, diagnosis and treatment reports, and surgical records. Generally, after each module of the HRP system collects the corresponding medical data, it will be entered into the SQL database for persistent storage, and the frequently queried medical data is marked as hot data, which will be added to the Redis database. The Redis database is an in-memory database with higher access efficiency, improving the efficiency of querying medical data.
[0044] In related technologies, when a user queries the target medical data corresponding to a target patient on a query terminal, the query terminal sends a query request carrying the name of the target patient to the application server. When the application server receives the query request, it first searches the Redis database deployed on the Redis server to check if there is medical data corresponding to the name of the target patient. If not, the application server constructs an SQL query command and sends it to the SQL server. The SQL server matches the medical data corresponding to the name of the target patient from the SQL database according to the received SQL query command and returns it to the application server. The application server then returns the medical data corresponding to the name of the target patient to the query terminal for display. And when the application server detects whether the number of times the name of the target patient is queried exceeds a preset number within a preset duration, it adds the medical data corresponding to the name of the target patient to the Redis database so that when the application server receives a query request later, it can directly return the medical data corresponding to the name of the target patient searched from the Redis database to the query terminal.
[0045] Figure 3The structural block diagram of the HRP system in an embodiment is shown. The service-based data query method provided by this 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 resources management module, a financial management module, a drug and medical equipment management module, etc. These hardware parts can be composed of computer devices with data transmission, storage, and processing capabilities. Among them, a corresponding patient management client program is installed on the patient management module for patient registration, inpatient and discharge management, and patient history record management. A 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. A corresponding bed management client program is installed on the bed management module for efficiently allocating and tracking bed usage to ensure maximum utilization of resources. A 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. A corresponding human resources management client program is installed on the human resources management module for hospital staff scheduling, training, performance evaluation, and salary management. A corresponding financial management client program is installed on the financial management module for handling the financial affairs of the hospital, including expense calculation, bill management, and budget control. The application server, as the central node, processes data from each module, is responsible for the preliminary processing and forwarding of data, and processes query requests from the query terminal. The SQL server is responsible for persistently storing all medical data and processing complex queries from the application server. The Redis server, as a cache database for fast access, stores frequently accessed data, reduces the query pressure on the SQL server, and improves data access speed.
[0046] In an SQL database, data structures are usually organized in the form of tables. Each table represents an entity type and is composed of rows and columns. Each row represents an instance of an entity (such as a patient, a drug usage 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).
[0047] The following are example tables that might exist in a simplified hospital management system, which describe patient information, medical records, drug usage, medical equipment, and financial transactions:
[0048] 1. Patient Information Table (Patients)
[0049] Patient_ID: Unique identifier, such as 1001.
[0050] Name: Patient's name, e.g., Zhang San.
[0051] Age: Patient's age, e.g., 30.
[0052] Address: Patient's address, e.g., "Yuehai Street, Nanshan District, Shenzhen City".
[0053] Phone_Number: Contact phone number, e.g., "123 - 4567".
[0054] 2. Medical Records
[0055] Record_ID: Unique identifier of the medical record, e.g., 2002.
[0056] Patient_ID: Associated unique identifier of the patient, e.g., 1001.
[0057] Date: Recording date, e.g., "2024 - 01 - 01".
[0058] Diagnosis: Diagnosis result, e.g., "Heart disease".
[0059] Treatment: Treatment plan, e.g., "Heart bypass surgery".
[0060] 3. Medication Usage
[0061] Usage_ID: Unique identifier of the medication usage record, e.g., 3003.
[0062] Patient_ID: Associated unique identifier of the patient, e.g., 1001.
[0063] Medication_Name: Name of the drug, e.g., "Aspirin".
[0064] Dosage: Dosage, e.g., "100mg".
[0065] Administration_Date: Date of administration, e.g., "2024 - 01 - 02".
[0066] 4. Equipment Usage
[0067] Equipment_ID: Unique identifier of the equipment, e.g., 4004.
[0068] Patient_ID: Associated unique identifier of the patient, e.g., 1001.
[0069] Equipment_Name: Name of the equipment, such as "ECG monitor".
[0070] Usage_Start_Date: Start date of usage, such as "2024-01-01".
[0071] Usage_End_Date: End date of usage, such as "2024-01-03".
[0072] 5. Financial Transactions Record Table
[0073] Transaction_ID: Unique identifier of the transaction, such as 5005.
[0074] Patient_ID: Unique identifier of the associated patient, such as 1001.
[0075] Amount: Transaction amount, such as 2000 yuan.
[0076] Transaction_Date: Transaction date, such as "2024-01-04".
[0077] Description: Transaction description, such as "Surgery fee".
[0078] Specifically, after each module collects the medical data corresponding to Zhang San, it sends the data to the application server through the corresponding client program. The application server forwards the corresponding data to the SQL server to store the data in the SQL database. When a doctor needs to query Zhang San's medical data on the query terminal, the process is as follows:
[0079] 1. User input: The user enters the name of the patient in the query interface.
[0080] 2. Send query request: The query terminal sends a query request containing the patient name to the application server through the network.
[0081] 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'.
[0082] 4. Database interaction: The application server sends the SQL query to the SQL database of the SQL server.
[0083] 5. Data retrieval: The SQL database executes the SQL query and retrieves all relevant data that matches the patient name.
[0084] 6. Return data: The SQL server sends the query results back to the application server.
[0085] 7. Data processing: The application server performs necessary formatting or processing on the data. Each table is associated with other tables through key fields (such as Patient_ID), enabling these tables to be joined through SQL queries to extract comprehensive information. For example, to query all relevant information of patient Zhang San, these tables can be joined and the query can be executed based on Patient_ID as the joining basis.
[0086] 8. Data presentation: The application server sends the processed data back to the query terminal through the network for display to the user.
[0087] If Redis is deployed as a caching system, the application server will first check the cache to reduce the number of SQL database accesses, lower the load on the SQL server, and improve the overall query efficiency. Specifically, the application server first communicates with the Redis server to query the Redis database. If the data exists 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 construct an SQL query request to the SQL database to execute the SQL query and retrieve all relevant data that matches the patient name.
[0088] The above solution introduces Redis. After the application server detects that a doctor frequently queries the medical data of a certain patient at the query terminal, it generally marks the medical data of this patient as hot data and then adds it to the Redis database to reduce the load on the SQL server and have a faster query speed. Since the HRP system integrates a lot of privacy data of patients, the query of medical data usually involves user permission management and data desensitization processing. To protect patient privacy, users with different permissions (such as chief doctors, intern doctors, and nurses with different permissions) can only view the content that matches their respective permissions in the medical data. In related technologies, there are two common practices as follows:
[0089] 1. Storage of multiple desensitized files: Store a complete set of desensitized medical data for each permission level. This method enables the application server to directly obtain the complete desensitized medical data that meets the user's permission from the Redis database and return it to the query terminal, which can reduce the computing resource overhead of the application server. However, it is necessary to store multiple complete sets of medical data with different desensitization levels in Redis, resulting in a large amount of redundant data and wasting the memory resources of the Redis server.
[0090] 2. Real-time desensitization processing: Only store one copy of the original medical data in Redis, and perform real-time desensitization processing on the application server according to user permissions. This method can reduce the memory overhead of the Redis server, but will increase the computing resource overhead of the application server.
[0091] It can be seen that in the related technologies, there is a contradiction between reducing the memory overhead of the Redis server and reducing the computing overhead of real-time desensitization on the application server during the process of querying and displaying medical data for users with different permissions.
[0092] Based on this, some embodiments of the present application provide a service-based data query method and system, which can reduce the memory overhead of the Redis server and at the same time reduce the computing overhead of real-time desensitization on the application server during the process of querying and displaying medical data for users with different permissions.
[0093] As Figure 1 shown, this embodiment provides a service-based data query method applicable to an application server, and the method includes:
[0094] Step S202, the application server stores the field data of the target file in the Redis database in the form of key-value pairs. Wherein, the target file is a file marked as hot data.
[0095] For example, the name of the target patient is Zhang San. After the HRP system collects various medical data of Zhang San and stores them in various tables of the SQL database. When a doctor or nurse enters Zhang San's name in the search box of the query interface of the query terminal and clicks the query button, a query instruction is generated, and the application server composes the data in the relevant tables returned by the SQL into a complete file. If this file is marked as hot data by the application server, it is the target file referred to in step S202.
[0096] In this embodiment, when receiving the query instruction sent by the query terminal, the file corresponding to the query instruction is marked as hot data.
[0097] In an example, the target file is a medical record file, the medical record file is in json format, includes 100 fields, and the structure is as follows:
[0098] Among them, in Redis, the key-value pair form means storing data in the form of a pair of a key and a value. For the data of each field in the medical record file, the hash type can be used for storage. This type allows us to store multiple fields and their corresponding values under one key. To store the above data in Redis, the following instruction can be used: HMSET 123 patient_name "Zhang San" age "30" diagnosis "heart disease" field5 "data 5"... field100 "data 100".
[0099] Among them, "123" is the key, representing the unique identifier of the medical record file. The field names (such as patient_name, age, etc.) are the fields of the hash, and the specific content of the fields (such as Zhang San, 30, etc.) are the corresponding values.
[0100] For each target file marked as hot data, it is stored in the Redis database in the form of key-value pairs.
[0101] When the application server needs to query this medical record file, the following instruction can be used: HGETALL 123.
[0102] The result will return: 1) "patient_name", 2) "Zhang San", 3) "age", 4) "30", 5) "diagnosis", 6) "heart disease",... 199) "field100", 200) "data 100".
[0103] When only certain field data in the medical record file needs to be queried, for example, the patient's name and age, the following instruction can be used: HGET 123 patient_name age.
[0104] The result will return: 1) "Zhang San", 2) "30".
[0105] Step S204, store the desensitized data corresponding to each permission level in the target file in the Redis database in the form of key-value pairs.
[0106] Specifically, except for the general administrator of the HRP system who can view or authorize other users to view the original file without desensitization, other users at all levels (including doctors, nurses, orderlies, administrative staff, etc.) have desensitization requirements at different permission levels to ensure patient privacy and hospital business secrets. The different permission levels mentioned in this embodiment refer to the permission levels corresponding to users with desensitization requirements, and the general administrator who does not need desensitization is not ranked among the permission levels.
[0107] In one example, there are 100 fields in the target file, and the permission levels include three levels, which are marked as permission level 3, permission level 2, and permission level 1 from high to low. Among them, users with permission level 3 need to desensitize the data of the last 30 fields and are allowed to view the first 70 fields. Users with permission level 2 need to desensitize the data of the last 50 fields and are allowed to view the first 50 fields. Users with permission level 1 need to desensitize the data of the last 80 fields and are allowed to view the first 20 fields. It can be seen that in this embodiment, the lower the permission level, the more data needs to be desensitized.
[0108] For permission level 3, the desensitized data can be stored in another hash through the following instruction: HMSET123_desensitized_role3 field71"****".....field100"****".
[0109] Specifically, for the fields that need to be desensitized, the application server replaces the specific content of the field, such as replacing data 71 to data 100 with asterisks during desensitization, to achieve desensitization. Of course, other characters can also be used for replacement, and this application does not make any restrictions.
[0110] Among them, in order to implement the association relationship between the target file and the desensitized data corresponding to different permission levels, if the key of the target file corresponding to patient Zhang San is "123", then the key when the desensitized data corresponding to permission level 1 in this target file is stored in the Redis database in the form of key-value pairs is "123_desensitized_role1", the key when the desensitized data corresponding to permission level 2 in this target file is stored in the Redis database in the form of key-value pairs is "123_desensitized_role2", and the key when the desensitized data corresponding to permission level 3 in this target file is stored in the Redis database in the form of key-value pairs is "123_desensitized_role3", and so on.
[0111] Step S206, when a user queries the target file, the application server first obtains the corresponding desensitized data from the Redis database according to the user's permission level, and then obtains the remaining non-desensitized data in the target file.
[0112] Specifically, if a user with permission level 3 enters the patient name "Zhang San" in the search box of the query interface of the query terminal and clicks the query button, the query terminal will send a query instruction to the application server. After the application server receives the corresponding query instruction, it determines that the user has queried the target file. Given that there are 100 fields in the target file corresponding to "Zhang San", at this time, the application server first determines from the permission level information carried in the query instruction that the user's permission level is permission level 3. For permission level 3, the following instruction is used to obtain the desensitized data corresponding to fields 71 to 100: HGET 123_desensitized_role3 field71.....field100. After obtaining the data corresponding to fields 71 to 100 from the Redis database, the application server continues to obtain the remaining non-desensitized data corresponding to fields 1 to 70 from the target file. The instruction is: HGET 123field1.....field70.
[0113] Step S208, the application server combines the desensitized data and non-desensitized data obtained from Redis to generate a desensitized file.
[0114] It can be seen that in this embodiment, 30 pieces of desensitized data corresponding to permission level 3 are combined with 70 pieces of non-desensitized data to produce the following desensitized file after desensitization:
[0115]
[0116] Step S210, the application server returns the desensitized file to the query terminal where the user logs in.
[0117] Through the processing of the above steps S202 to S208, the user can see the desensitized file after desensitization on the query terminal.
[0118] Since in this embodiment, during the process of querying and displaying medical data for users with different permissions, only partial desensitized data is stored for users with different permission levels, and there is no need to store a complete desensitized file for each permission user, which reduces the memory overhead of the Redis server. At the same time, when it is necessary to provide a complete desensitized file after desensitization for users with different permissions, only different partial desensitized data on the Redis server needs to be combined, and there is no need to perform real-time desensitization operations on the application server, which can reduce the computational overhead of real-time desensitization on the application server.
[0119] In some embodiments, the desensitized data corresponding to a lower permission level does not include the desensitized data corresponding to a higher permission level; the step of first obtaining the corresponding desensitized data from the Redis database according to the user permission level and then obtaining the remaining non-desensitized data in the target file specifically includes:
[0120] When the user queries the target file, according to the user permission level, the corresponding desensitized data and the desensitized data corresponding to the user permission level higher than this level are first obtained from the Redis database, and then the remaining non-desensitized data in the target file is obtained.
[0121] Specifically, there are 100 fields in the target file, and the permission levels include level 3, which are marked as permission level 3, permission level 2, and permission level 1 from high to low in order. Among them, users with permission level 3 need to desensitize the data of the last 30 fields and are allowed to view the first 70 fields. Users with permission level 2 need to desensitize the data of the last 50 fields and are allowed to view the first 50 fields. Users with permission level 1 need to desensitize the data of the last 80 fields and are allowed to view the first 20 fields. It can be seen that in this embodiment, the lower the permission level, the more data needs to be desensitized.
[0122] For permission level 3, the desensitized data can be stored in another hash through the following instruction: HMSET123_desensitized_role3 field71"****".....field100"****".
[0123] For permission level 2, the desensitized data can be stored in another hash through the following instruction: HMSET123_desensitized_role2 field51"****".....field70"****".
[0124] For permission level 1, the desensitized data can be stored in another hash through the following instruction: HMSET123_desensitized_role1 field21"****".....field50"****".
[0125] It can be seen that in this embodiment, the desensitized data corresponding to the lower permission level does not include the desensitized data corresponding to the higher permission level, reducing redundant data.
[0126] Specifically, if a user with permission level 2 enters the patient name "Zhang San" in the search box of the query interface of the query terminal and clicks the query button, the query terminal will send a query instruction to the application server. After the application server receives the corresponding query instruction, it determines that the user has queried the target file. It is known that there are 100 fields in the target file corresponding to "Zhang San". At this time, the application server first determines from the permission level information carried in the query instruction that the user's permission level is permission level 2. For permission level 2, since there is still desensitized data corresponding to a higher permission level than the user's. Therefore, first obtain the desensitized data corresponding to fields 51 to 70 through the following instruction: HGET 123_desensitized_role2field51.....field70, and then obtain the desensitized data corresponding to fields 71 to 100 through the following instruction: HGET 123_desensitized_role3field71.....field100. After obtaining the data corresponding to fields 51 to 100 from the Redis database, the application server continues to obtain the non-desensitized data corresponding to the remaining fields 1 to 50 from the target file. The instruction is: HGET 123field1.....field50. Finally, jump to step S208 to combine to obtain a complete desensitized file.
[0127] In this embodiment, during the process of querying and displaying medical data for users with different permissions, only the incremental part of the desensitized data is stored for lower-permission users, and there is no need to store a complete desensitized file for each permission user, which reduces the memory overhead of the Redis server. At the same time, when it is necessary to provide a complete desensitized file for users with different permissions, only the different incremental parts on the Redis server need to be combined, and there is no need to perform desensitization operations again on the application server, which can reduce the computing overhead of real-time desensitization on the application server.
[0128] Specifically, after outpatient consultation, patients generally undergo corresponding physiological index examinations. Therefore, 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:
[0129] Record_ID 6006,-- The unique identifier of the physiological index examination form.
[0130] Patient_ID 1001. The unique identifier of the associated patient.
[0131] Type 021. Disease type identifier
[0132] Date DATE 2024-01-01, Examination date.
[0133] Systolic_BP INT, -- Systolic blood pressure.
[0134] Diastolic_BP INT, -- Diastolic blood pressure.
[0135] Heart_Rate INT, -- Heart rate.
[0136] Cholesterol_Total FLOAT, -- Total cholesterol.
[0137] LDL FLOAT, -- Low - density lipoprotein.
[0138] HDL FLOAT, -- High - density lipoprotein.
[0139] Triglycerides FLOAT, -- Triglycerides.
[0140] Fasting_Glucose FLOAT, -- Fasting blood glucose.
[0141] CRP FLOAT, -- C - reactive protein.
[0142] Creatinine FLOAT, -- Creatinine.
[0143] Ejection_Fraction FLOAT, -- Ejection fraction.
[0144] Among them, INT indicates that the value of the diagnostic index is an integer, and FLOAT indicates that the value of the diagnostic index is a floating - point number.
[0145] Specifically, the data in the physiological index examination form are all uploaded to the application server by the physical examination module.
[0146] Such as Figure 2 shown, in some embodiments, when receiving a reference instruction sent by the query terminal, the method further includes:
[0147] Step S302, obtaining multiple historical diagnosis and treatment reports of the same disease as the target patient; among them, each of the historical diagnosis and treatment reports includes an operation record, and the reference instruction carries the disease corresponding to the target patient and the name of the target patient.
[0148] When the user queries the medical record file of the target patient (such as Zhang San) on the query terminal, a surgical reference button is displayed on the interface for viewing the medical record file on the query terminal. When the user clicks this button, a reference instruction is generated. The query terminal sends the reference instruction to the application server, and the application server will obtain multiple historical diagnosis and treatment reports of the same disease as the target patient in response to the reference instruction.
[0149] In one example, the disease is a heart disease, and 200 historical diagnosis and treatment reports of heart diseases are obtained. Each of the 200 historical diagnosis and treatment reports includes the patient's historical medical record and surgical record.
[0150] Step S304, calculate the reference similarity score between the multiple historical diagnosis and treatment reports and the medical record of the target patient.
[0151] It can be understood that before performing surgery on a new patient, a doctor needs to obtain the historical diagnosis and treatment reports of the historical patient closest to the patient's condition for reference 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, the search efficiency is low through manual methods. Therefore, in this embodiment, the application server is used to automatically calculate the reference similarity score between the multiple historical diagnosis and treatment reports and the medical record of the target patient. The higher the reference similarity score, the more reference value it has.
[0152] Step S306, sort according to the reference similarity score from high to low to obtain a sorting result.
[0153] Step S308, return each historical diagnosis and treatment report to the query terminal according to the sorting result.
[0154] In this embodiment, the computer is used to replace manual search for historical diagnosis and treatment reports with reference value, which improves the efficiency of doctors searching for information on the surgical plan for patients. At the same time, since the sorting is performed according to the reference value of the historical diagnosis and treatment reports, doctors can view the historical diagnosis and treatment reports according to the sorting number, which further improves the efficiency of doctors searching for information on the surgical plan for the target patient.
[0155] In some embodiments, the reference similarity score S between the multiple historical diagnosis and treatment reports and the medical record of the target patient is calculated according to the following formula 1 AB :
[0156] Formula 1:
[0157] where n is the number of diagnostic indicators; A i is the value of the i-th diagnostic indicator in the medical record of the target patient, B i is the value of the i-th diagnostic indicator in one of the multiple historical diagnosis and treatment reports, f(A i , B i ) is the surgical key factor judgment function, and w(A i , B i ) is the key factor weight function.
[0158] The surgical key factor judgment function f(A i , B i) Value:
[0159] Formula Two:
[0160] where Q i is the set of abnormal range of the value of the i-th diagnostic indicator, and otherwise represents other situations.
[0161] Determine the key factor weight function w(A i , B i ) value according to the following Formula Three:
[0162] Formula Three:
[0163] where Q i is the set of abnormal range of the value of the i-th diagnostic indicator; P is the set of serial numbers corresponding to the first type of diagnostic indicators, R is the set of serial numbers corresponding to the second type of diagnostic indicators, and otherwise represents other situations.
[0164] Specifically, when formulating a surgical plan, abnormal diagnostic indicators are key factors that need to be considered emphatically. For example, when the creatinine level is in the abnormal range, it may indicate impaired renal function. Surgical consideration: Cardiac patients with renal insufficiency are at higher risk during cardiac surgery (such as coronary artery bypass grafting). Doctors may adjust the surgical method or postpone the surgery until the renal function improves. For example, the range of high-sensitivity C-reactive protein (hs-CRP) is abnormal. Since C-reactive protein is a marker of inflammation in the body, a high level of hs-CRP indicates the presence of inflammation. Surgical consideration: The inflammatory state may increase the risk of surgical complications, such as infection and difficult postoperative recovery. For example, the ejection fraction is an important indicator to measure the heart's pumping ability, and the normal value is usually between 55% and 70%. Surgical consideration: A low ejection fraction in the abnormal range (such as less than 40%) indicates that the heart's pumping function is severely limited, and patients in this situation are at higher risk during cardiac surgery. Doctors may consider using an assistive circulation device or other special surgical techniques. Before the surgery, it may be necessary to reduce the inflammation level through drug treatment.
[0165] Furthermore, for formulating a surgical plan for a certain disease, different diagnostic indicators have different degrees of influence. For example, being within an abnormal weight 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, the creatinine level, high-sensitivity C-reactive protein (hs-CRP), and ejection fraction are factors that deserve more attention from doctors, while weight is of secondary importance. At this time, for heart diseases, the creatinine level, high-sensitivity C-reactive protein (hs-CRP), and ejection fraction are the first type of diagnostic indicators, and weight is the second type of diagnostic indicators. For example, in a 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. Among them, P is the set of serial numbers corresponding to the first type of diagnostic indicators, and this set includes 11, 12, and 13. R is the set of serial numbers corresponding to the second type of diagnostic indicators, and this set includes 1. Whether each diagnostic indicator belongs to the first type or the second type of diagnostic indicators can be determined by experts.
[0166] For example, the number of diagnostic indicators is 20, and the serial numbers are sequentially from 1 to 20. The first 10 diagnostic indicators of the target patient are all within the normal range, and the last 10 diagnostic indicators are all within the abnormal range, and all the last 10 diagnostic indicators belong to the first type of diagnostic indicators.
[0167] In an 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 One, Two, and Three to calculate the reference similarity score.
[0168] In an 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 One, Two, and Three to calculate the reference similarity score.
[0169] In an 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 One, Two, and Three to calculate the reference similarity score.
[0170] The value range is between 0 and 1. It can be seen that in the above three examples, Formula One assigns the highest score to the historical diagnosis and treatment reports in which the last 10 are all within the abnormal range, and its ranking is the most forward, which is convenient for doctors to quickly and efficiently obtain the most valuable historical diagnosis and treatment reports when formulating a surgical plan.
[0171] In an example, all 20 diagnostic indicators in the fourth historical diagnosis and treatment report are within the abnormal range. Substitute them into Formulas One, Two, and Three to calculate the reference similarity score.
[0172] It can be seen that the second historical diagnosis and treatment report is more valuable for reference, and doctors are more willing to refer to the operation record of 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 of the second historical diagnosis and treatment report are all within the normal range, generally, the A i -B i corresponding to the first 10 diagnostic indicators of the second historical diagnosis and treatment report is less than the A i -B i corresponding to the first 10 diagnostic indicators of the fourth historical diagnosis and treatment report. Therefore, the corresponding to the second historical diagnosis and treatment report is greater than the corresponding to the fourth historical diagnosis and treatment 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.
[0173] 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. Substituting into Formulas One, Two, and Three, the reference similarity score is calculated
[0174] 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. Substituting into Formulas One, Two, and Three, the reference similarity score is calculated
[0175] Specifically, the A i -B i corresponding to the first 16 diagnostic indicators in the fifth historical diagnosis and treatment report are all 4, and the A i -B i corresponding to the last 4 diagnostic indicators in the fifth historical diagnosis and treatment report are all 20; the A i -B i corresponding to the first 16 diagnostic indicators in the sixth historical diagnosis and treatment report are all 20, and the A i -B i corresponding to the last 4 diagnostic indicators in the sixth historical diagnosis and treatment report are all 4. It can be seen that although the difference between most (i.e., 16) diagnostic indicators in the fifth historical diagnosis and treatment report is very small (A i -B i are all 4), only a small part (i.e., 4) of the diagnostic indicators have a large gap (A i -B i are all 20). While for the sixth historical diagnosis and treatment report, the difference between most (i.e., 16) diagnostic indicators is relatively large (A i -B iAll are 20), only a small part (i.e., 4 items) of the diagnostic indicators have a small difference (A i -B i All are 4). However, in the fifth and sixth reports, the sixth report is more valuable for doctors to formulate surgical plans. Because when formulating surgical plans, abnormal diagnostic indicators can better remind doctors to pay attention to corresponding abnormal treatment plans, and the sixth historical diagnosis and treatment report is very close in various abnormal diagnostic indicators, so it has more reference value.
[0176] Substitute 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 i -B i All are 20, and substitute them into Formula 1 to calculate the reference similarity score S AB = 40 + 0.129 = 40.129. Substitute the A corresponding to the first 16 diagnostic indicators in the sixth historical diagnosis and treatment report i -B i All are 20, and the A corresponding to the last 4 diagnostic indicators i -B i All 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 ranks ahead of the fifth historical diagnosis and treatment report. Through Formula 1, the historical diagnosis and treatment reports that are more valuable for doctors to formulate surgical plans can be ranked ahead, facilitating doctors to quickly and efficiently obtain the most valuable historical diagnosis and treatment reports when formulating surgical plans.
[0177] In summary, the higher the reference similarity score calculated by Formula 1, the more reference value it has, which can improve the efficiency of doctors querying information before surgery and provide guarantee for formulating surgical plans safely and steadily.
[0178] In some embodiments, the Redis database is deployed on a Redis server, and the SQL database is deployed on an SQL server. The Redis server, SQL server, and the application server are all 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, improving the query efficiency.
[0179] In some embodiments, the method further includes:
[0180] Mark the historical diagnosis and treatment reports ranked in the top M in the sorting result as hot data; where M is an integer greater than 0.
[0181] For example, if M is 10, the application server will mark the top 10 historical diagnosis and treatment reports in the sorting result as hot data. For the files marked as hot data, they will all be added to the Redis database for different users (including doctors and nurses) participating in the operation to view and reference. At the same time, the files marked as hot data will all be efficiently desensitized according to steps S202 to S210, facilitating subsequent efficient access to the corresponding historical diagnosis and treatment reports by users with different permission levels.
[0182] In some embodiments, the method further includes:
[0183] Marking the historical diagnosis and treatment reports with a reference similarity score greater than a preset score as hot data.
[0184] For example, if the preset score is 80, the application server will mark the historical diagnosis and treatment reports with a reference similarity score greater than 80 as hot data. For the files marked as hot data, they will all be added to the Redis database for different users (including doctors and nurses) participating in the operation to view and reference. At the same time, the files marked as hot data will all be efficiently desensitized according to steps S202 to S210, facilitating subsequent efficient access to the corresponding historical diagnosis and treatment reports by users with different permission levels.
[0185] In some embodiments, the method further includes:
[0186] When receiving a collection instruction for a historical diagnosis and treatment report sent by a query terminal, marking the corresponding historical diagnosis and treatment report as hot data.
[0187] For example, if the 10th to 20th historical diagnosis and treatment reports are collected by a user, the application server will mark the collected historical diagnosis and treatment reports as hot data. For the files marked as hot data, they will all be added to the Redis database for different users (including doctors and nurses) participating in the operation to view and reference. At the same time, the files marked as hot data will all be efficiently desensitized according to steps S202 to S210, facilitating subsequent efficient access to the corresponding historical diagnosis and treatment reports by users with different permission levels.
[0188] On the other hand, the present invention provides a service-based data query system, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the steps of the above method
[0189] On yet another aspect, the present invention provides a computer-readable storage medium, on which a computer program / instructions are stored. When the computer program / instructions are executed by a processor, the steps of the above method are implemented.
[0190] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A service-based data query method, applicable to an application server, characterized in that: The method comprises: The data of each field of the target file is stored in the Redis database in the form of key-value pairs; wherein the target file is a file marked as hot data; Store the desensitized data corresponding to each permission level in the target file in the form of key-value pairs in the Redis database; When a user queries a target file, the corresponding desensitized data is first obtained from the Redis database according to the user's permission level, and then the remaining un-desensitized data in the target file is obtained; Combine the desensitized data and the un-desensitized data obtained from Redis to generate a desensitized file. Return the desensitized file to the query terminal where the user logs in; The desensitized data corresponding to the lower permission level does not include the desensitized data corresponding to the higher permission level; the method of first obtaining the corresponding desensitized data from the Redis database according to the user permission level, and then obtaining the remaining un-desensitized data in the target file, specifically includes: When a user queries a target file, the corresponding desensitized data and desensitized data corresponding to a higher level of user authority are first obtained from the Redis database according to the user's authority level, and then the remaining un-desensitized data in the target file is obtained; There are N fields in the target file, and the permission level includes 3 levels, which are marked as permission level 3, permission level 2, and permission level 1 from high to low. Users with permission level 3 are allowed to view the first i fields, and the data of the next Ni fields need to be desensitized. Users with permission level 2 are allowed to view the first j fields, and the data of the next Nj fields need to be desensitized. Users with permission level 1 are allowed to view the first k fields, and the data of the next Nk fields need to be desensitized. Among them, N, i, j, and k are variables, and N>i>j>k; For the desensitized data corresponding to permission level 3, it includes the i+1th to Nth fields in the target file; For the desensitized data corresponding to permission level 2, it includes the j+1th to ith fields in the target file; For the desensitized data corresponding to permission level 1, it includes the k+1th to jth fields in the target file; For the desensitized data corresponding to permission level 2, first obtain the desensitized data corresponding to the j+1th field to the ith field, and then obtain the desensitized data corresponding to the i+1th field to the Nth field. After obtaining the data corresponding to the j+1th field to the Nth field from the Redis database, the application server continues to obtain the remaining non-desensitized data corresponding to the 1st field to the ith field from the target file.
2. A service-based data query method according to claim 1, characterized in that: The method further comprises: When a query instruction sent by the query terminal is received, the file corresponding to the query instruction is marked as hot data.
3. A service-based data query method according to claim 1, characterized in that: When receiving the reference instruction sent by the query terminal, the method further includes: Acquire multiple historical diagnosis and treatment reports of the same disease as the target patient; wherein the reference instruction carries the disease corresponding to 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; Each historical diagnosis and treatment report is returned to the query terminal according to the sorting result.
4. A service-based data query method according to claim 3, characterized in that: The method further comprises: The historical diagnosis and treatment reports ranked in the top M positions in the sorting results are marked as hot data; where M is an integer greater than 0.
5. A service-based data query method according to claim 3, characterized in that: The method further comprises: When a collection instruction for a historical diagnosis and treatment report is received from the query terminal, the corresponding historical diagnosis and treatment report is marked as hot data.
6. A service-based data query method according to claim 3, 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.
7. A service-based data query method according to claim 6, 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.
8. A service-based data query method according to claim 6, 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.
9. A service-based data query system, 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 the service-based data query methods of claims 1 to 8.
Citation Information
Patent Citations
Filter-based information encryption method, apparatus and device, and readable storage medium
CN109672523A
Case information data display method and device, computer equipment and storage medium
CN114510740A
Patient information recording method, device and equipment and computer readable storage medium
CN115240804A