CN-116303594-B - SQLite-based medical information data caching method, device and system
Abstract
The invention relates to the technical field of data caching, and discloses a medical information data caching method, device and system based on SQLite. The method comprises the steps that when the local client detects that the login state of a target medical account is in an on-line state, a main program is started to enable cache data in a basic SQLite cache database to correspond to cache information indexes of the server database, the server database stores all medical information data, after the main program is started, a data acquisition instruction of a target client terminal system corresponding to the target medical account is received, the needed cache data is downloaded from the server database, and the basic SQLite cache database and the corresponding subsystem SQLite cache database are updated. The invention can realize lightweight cache and on-demand cache, and improves the reusability and the application efficiency of medical data.
Inventors
- Pang Tujian
- Shi Biwu
- TANG JIAN
Assignees
- 广东阳普智慧医疗信息科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20230216
Claims (10)
- 1. The medical information data caching method based on SQLite is applied to a local client and is characterized in that a caching database of the local client is divided into a basic SQLite caching database and a subsystem SQLite caching database; The method comprises the following steps: when the login state of the target medical account is detected to be in an online state, starting a main program to enable cache data in the basic SQLite cache database to correspond to the cache information index of the server database; the server database stores all medical information data; The starting the main program to enable the cache data in the basic SQLite cache database to correspond to the cache information index of the server database comprises the following steps: obtaining a cache information index of a server database, wherein the server database stores all medical information data; comparing a local cache information index corresponding to cache data in the basic SQLite cache database with the cache information index to determine whether data updating is needed or not, and obtaining a data updating judging result; when the data updating judging result is that the data updating is needed, a data updating request is initiated to a server side, wherein the data updating request comprises a data index to be updated; receiving target cache data corresponding to the data index to be updated, which is sent by the server; writing the target cache data into the basic SQLite cache database, wherein when the target cache data is written, the starting of the main program is completed; after the main program is started, receiving a data acquisition instruction of a target client subsystem corresponding to the target medical account, wherein the data acquisition instruction accords with the authority of the target medical account; searching first target SQLite cache data corresponding to the data acquisition instruction in the basic SQLite cache database to obtain a searching result; When the search result is that the first target SQLite cache data is searched, judging whether the first target SQLite cache data is consistent with corresponding SQLite cache data in the server database according to the update size and update time of the first target SQLite cache data, and obtaining a data consistency judgment result; When the data consistency judging result is that the data is inconsistent, determining target identification information of the SQLite cache data to be downloaded according to the data inconsistent part; downloading corresponding SQLite cache data from the server database according to the target identification information to obtain downloaded SQLite cache data; Updating the first target SQLite cache data according to the downloaded SQLite cache data to obtain second target SQLite cache data; Updating the basic SQLite cache database according to the second target SQLite cache data, and updating the subsystem SQLite cache database corresponding to the target client subsystem according to the second target SQLite cache data; The method further comprises the steps of: and when the searching result is that the first target SQLite cache data cannot be searched, downloading corresponding SQLite cache data from the server database in a full amount according to the data acquisition instruction, and correspondingly updating the basic SQLite cache database and the subsystem SQLite cache database corresponding to the target client subsystem.
- 2. The SQLite-based medical information data caching method according to claim 1, wherein downloading the corresponding SQLite cache data from the server database according to the target identification information to obtain the downloaded SQLite cache data comprises: Determining a target data interface of the server according to the type of SQLite cache data to be downloaded; and downloading the required SQLite cache data through the corresponding target data interface according to the target identification information.
- 3. The SQLite-based medical information data caching method according to claim 2, wherein the target data interface comprises a HIS system for acquiring medical diagnosis and treatment and prescription information, an EMR module for acquiring electronic medical record information, and a DRG diagnostic module for acquiring diagnostic information; the HIS system comprises an inspection application module for acquiring inspection information, an inspection application module for acquiring inspection information and a prescription module for acquiring medicine diagnosis and treatment information.
- 4. The SQLite-based medical information data caching method according to claim 2, wherein the downloading the required SQLite cache data through the corresponding target data interface according to the target identification information comprises: determining whether paging downloading is needed according to the content size of SQLite cache data to be downloaded; And when the paging downloading is needed, downloading the needed SQLite cache data from the server database through the corresponding target data interface according to the target identification information in a paging downloading data mode.
- 5. The SQLite-based medical information data caching method of claim 1, wherein the data acquisition instruction is generated upon logging into the target client subsystem or upon detecting a target business operation instruction on the target client subsystem.
- 6. The SQLite based medical information data caching method of claim 1, further comprising: And recording a failure result and uploading the failure result to a server when the corresponding SQLite cache data fails to be downloaded from the server database according to the target identification information.
- 7. A SQLite-based medical information data caching apparatus, comprising: a memory for storing instructions for implementing the SQLite-based medical information data caching method of any one of claims 1-6; And the processor is used for executing the instructions in the memory.
- 8. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the SQLite based medical information data caching method according to any of claims 1-6.
- 9. The medical information data caching device based on the SQLite is applied to a local client and is characterized in that a caching database of the local client is divided into a basic SQLite caching database and a subsystem SQLite caching database, and the medical information data caching device comprises: The system comprises a starting module, a server side database, a target medical account number management module and a target medical account number management module, wherein the starting module is used for starting a main program when detecting that the login state of the target medical account number is in an online state so as to enable cache data in a basic SQLite cache database to correspond to cache information indexes of the server side database; The starting module comprises an acquisition unit, a comparison unit, an initiating unit, a receiving unit and a writing unit, wherein the acquisition unit is used for acquiring a cache information index of a server database, the server database stores all medical information data, the comparison unit is used for comparing a local cache information index corresponding to cache data in a basic SQLite cache database with the cache information index to determine whether data updating is needed or not to obtain a data updating judgment result, the initiating unit is used for initiating a data updating request to the server when the data updating judgment result is that the data updating is needed, the data updating request comprises the data index to be updated, the receiving unit is used for receiving target cache data which is sent by the server and corresponds to the data index to be updated, the writing unit is used for writing the target cache data into the basic SQLite cache database, and the starting completion of the main program is indicated when the target cache data writing is completed; the receiving module is used for receiving a data acquisition instruction of a target client subsystem corresponding to the target medical account after the main program is started, wherein the data acquisition instruction accords with the authority of the target medical account; the searching module is used for searching first target SQLite cache data corresponding to the data acquisition instruction in the basic SQLite cache database to obtain a searching result; The judging module is used for judging whether the first target SQLite cache data is consistent with corresponding SQLite cache data in the server database according to the updating size and the updating time of the first target SQLite cache data when the searching result is that the first target SQLite cache data is searched, and obtaining a data consistency judging result; The determining module is used for determining target identification information of the SQLite cache data to be downloaded according to the data inconsistency part when the data consistency judging result is data inconsistency; The downloading module is used for downloading corresponding SQLite cache data from the server database according to the target identification information to obtain downloaded SQLite cache data; The first updating module is used for updating the first target SQLite cache data according to the downloaded SQLite cache data to obtain second target SQLite cache data; The second updating module is used for updating the basic SQLite cache database according to the second target SQLite cache data and updating the subsystem SQLite cache database corresponding to the target client subsystem according to the second target SQLite cache data; The apparatus further comprises: And the second downloading module is used for downloading corresponding SQLite cache data from the server database in a full amount according to the data acquisition instruction when the search result is that the first target SQLite cache data cannot be searched, and correspondingly updating the basic SQLite cache database and the subsystem SQLite cache database corresponding to the target client terminal system.
- 10. The medical information data caching system based on the SQLite comprises a local client and a server, and is characterized in that a cache database of the local client is divided into a basic SQLite cache database and a subsystem SQLite cache database, and the server is provided with a server database; The local client comprises the SQLite-based medical information data caching apparatus of claim 9.
Description
SQLite-based medical information data caching method, device and system Technical Field The invention relates to the technical field of data caching, in particular to a medical information data caching method, device and system based on SQLite. Background Medical information systems are an important component of modern hospital construction, which play an important role in the treatment and diagnosis of patients. The medical information system is used for storing information of aspects such as medical record information, examination results, medication and treatment information of a patient, and the information together form a large amount of medical data. As medical scales expand, medical data is increasing, and medical function modules that need to be added to hospital information systems are also increasing. At present, the hospital information system has a single caching means for medical data and can not cache and analyze comprehensive data as required, and the operation efficiency of the hospital information system can be reduced due to the addition of the medical data and the medical function module, so that the repeated use rate and the operation efficiency of the medical data are reduced, and the medical information system is not beneficial to medical staff to finish related work. Disclosure of Invention The invention provides a medical information data caching method, device and system based on SQLite, which solve the technical problems that the caching means of the medical information system for the medical data is single and the comprehensive data cannot be quickly cached and analyzed as required, and the operation efficiency of the medical information system is reduced when the medical data and medical function modules are increased, so that the reuse rate and the operation efficiency of the medical data are reduced. The first aspect of the present invention provides a medical information data caching method based on SQLite, which is applied to a local client, wherein a cache database of the local client is divided into a basic SQLite cache database and a subsystem SQLite cache database, and the method comprises: When the login state of the target medical account is detected to be in an on-line state, starting a main program to enable cache data in a basic SQLite cache database to correspond to cache information indexes of a server database, wherein the server database stores all medical information data; after the main program is started, receiving a data acquisition instruction of a target client subsystem corresponding to the target medical account, wherein the data acquisition instruction accords with the authority of the target medical account; searching first target SQLite cache data corresponding to the data acquisition instruction in the basic SQLite cache database to obtain a searching result; When the search result is that the first target SQLite cache data is searched, judging whether the first target SQLite cache data is consistent with corresponding SQLite cache data in the server database according to the update size and update time of the first target SQLite cache data, and obtaining a data consistency judgment result; When the data consistency judging result is that the data is inconsistent, determining target identification information of the SQLite cache data to be downloaded according to the data inconsistent part; downloading corresponding SQLite cache data from the server database according to the target identification information to obtain downloaded SQLite cache data; Updating the first target SQLite cache data according to the downloaded SQLite cache data to obtain second target SQLite cache data; And updating the basic SQLite cache database according to the second target SQLite cache data, and updating the subsystem SQLite cache database corresponding to the target client subsystem according to the second target SQLite cache data. According to one implementation manner of the first aspect of the present invention, the starting the main program to make the cache data in the basic SQLite cache database correspond to the cache information index of the server database includes: obtaining a cache information index of a server database, wherein the server database stores all medical information data; Comparing the local cache with the cache information index to determine whether data update is needed or not, and obtaining a data update judging result; when the data updating judging result is that the data updating is needed, a data updating request is initiated to a server side, wherein the data updating request comprises a data index to be updated; receiving target cache data corresponding to the data index to be updated, which is sent by the server; And writing the target cache data into the basic SQLite cache database, wherein when the target cache data is written, the starting of the main program is completed. According to one implementation manner of the first aspect of