A sub-library storage method and system for electronic medical record data
By dividing electronic medical record data into global business data and sharded business data, and obtaining the table name prefix of the real database table based on the visit time, the real table name used to store sharded business data is calculated, which solves the problem of inconcentrated storage of the same medical data in the prior art, and fast backup and recovery are realized, and the system maintainability is improved.
Patent Information
- Application Number
- CN202411848344.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-08
AI Technical Summary
The existing library separation method cannot meet the requirements of storing medical records and documents for the same medical visit in a database file, resulting in a long database backup time and a long recovery time, and a large space for backup of the business system.
A method of storing electronic medical record data is proposed, which divides electronic medical record data into global business data and sharded business data. By defining the table names and storage location identifiers of the database and real database tables used to store these data, configuring the mapping relationship between these identifiers and databases, obtaining the table name prefix of the real database table based on the visit time, calculating the real table name used to store sharded business data, and saving the data in the corresponding database.
The centralized storage of electronic medical record data for the same visit is achieved, which reduces the time for database backup and recovery, maintains the integrity of the medical record database, and improves the maintainability and operation and maintenance efficiency of the electronic medical record system.
Smart Images

Figure CN119785959A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of electronic medical record data application, and in particular relates to a sub-library storage method and system for electronic medical record data. Background Art
[0002] Electronic medical record data is organized by "visit". Each visit will generate electronic medical record document data such as "admission record", "medical progress record", "operation record", "informed consent form", "hospitalization medical record homepage", etc. This set of electronic medical record data organized by visit is a record of medical activities of a visit, reflecting the content of all medical activities of a visit.
[0003] There are two existing database partitioning methods:
[0004] (1) Formulate a strategy based on the number of records in the data table, and store the data with table IDs within a certain range in one data table. For multiple ID ranges, the corresponding data is stored in multiple data tables. For example, data IDs: 1 to 100000 are stored in table A, 100001 to 200000 are stored in table B, and so on. The data is stored in multiple data tables, and different tables belong to different databases, realizing the storage of data in separate databases and tables. This method is called "horizontal sub-database";
[0005] (2) Develop strategies based on different data types and store different types of data in separate tables. For example, admission records, medical records, discharge records, and hospital medical record homepages are different types of electronic medical record data, which are stored in "admission record data table", "medical record data table", etc. These data tables belong to different databases, realizing the storage of electronic medical records in separate databases and tables. This method is called "vertical sub-database";
[0006] Neither the "horizontal database partitioning" nor the "vertical database partitioning" methods can meet the requirement of "the medical record document data of the same visit is stored in one database file." This is because the current system stores the business data of the electronic medical record system in a unified database. This database is relatively large (T level), the business system backup time is long, and the backup occupies a large space, so it takes a long time to restore the database when a problem occurs. Summary of the invention
[0007] In view of the above-mentioned deficiencies in the prior art, the present application provides a method and system for storing electronic medical record data in a sub-library.
[0008] In a first aspect, the present application proposes a sub-library storage method for electronic medical record data, comprising the following steps:
[0009] The electronic medical record data is divided into global business data and fragmented business data, wherein the global business data includes the basic data, configuration data and medical record routing table data of the electronic medical record system, and the fragmented business data includes the electronic medical record document registration information data, the electronic medical record document instance data, and the electronic medical record document fragmented data;
[0010] Define a group of databases for storing global business data and shard business data, define the table names and storage location identifiers of real database tables for global business data and shard business data, and configure the mapping relationship between the storage location identifier of the real database table and the database;
[0011] Define the table name prefix of the real database table and the configuration data of its enablement and expiration time;
[0012] According to the consultation time of the patient's consultation record and the table name prefix, activation time and expiration time of the configured real database table, the table name prefix of the real database table is obtained;
[0013] The real table name for storing the sharded business data is obtained by performing a string calculation on the table name prefix of the obtained real database table and the logical data table name of the electronic medical record document registration information data, the electronic medical record document instance data, and the electronic medical record document scattered data;
[0014] The data is saved by using the real table name used to store the sharded business data: according to the mapping relationship between the storage location identifier of the real table name and the database, the saved data is stored in the corresponding database.
[0015] In some embodiments, the step of defining a group of databases for storing global business data and shard business data, defining the table names and storage location identifiers of real database tables for the global business data and shard business data, and configuring the mapping relationship between the storage location identifiers of the real database tables and the databases includes:
[0016] Define a first database for storing global business data and a plurality of second databases for storing sharded business data;
[0017] Define a table name of a real database table for storing global business data and a storage location identifier thereof, and configure a mapping relationship between the storage location identifier and a first database;
[0018] Define the table name of the real database table of the sharded business data and its storage location identifier, and configure the mapping relationship between the storage location identifier of the real database table and multiple second databases.
[0019] In some embodiments, the process of obtaining the table name prefix of the real database table according to the consultation time of the patient consultation record and the table name prefix and the activation and expiration time of the configured real database table includes:
[0020] The medical consultation routing data table is searched using the medical consultation ID as the search condition. When no data matching the medical consultation ID is found, it is determined that the sharded business data is stored for the first time. When data matching the medical consultation ID is found, it is determined that the sharded business data is not stored for the first time.
[0021] In some embodiments, when it is determined that the sharded business data is stored for the first time, the table name prefix of the real database table is obtained based on the consultation time of the patient's consultation record and the table name prefix of the defined real database table and its activation and expiration time.
[0022] In some embodiments, when it is determined that it is not the first time to store sharded business data, the data in the medical record routing table is retrieved according to the medical ID in the medical record. When the retrieval result contains a prefix that has been used for the medical ID, the prefix that has been used is directly obtained as the table name prefix of the real database table.
[0023] In some embodiments, the obtaining of the prefix of the table name of the real database table and the logical data table name of the electronic medical record document registration information data, the electronic medical record document instance data, and the electronic medical record document scattered data to obtain the real table name for storing the sharded business data includes:
[0024] The real table name is composed of the table name prefix of the real database table plus a character point and a logical data table name.
[0025] In a second aspect, the present application proposes an electronic medical record data sub-library storage system, including a data partitioning module, a mapping relationship definition module, a configuration module, a table name prefix acquisition module, a real table name acquisition module and a mapping storage module;
[0026] The data partitioning module is used to divide the electronic medical record data into global business data and fragmented business data, wherein the global business data includes basic data, configuration data and medical record routing table data of the electronic medical record system, and the fragmented business data includes electronic medical record document registration information data, electronic medical record document instance data, and electronic medical record document scattered data;
[0027] The configuration module is used to define a group of databases for storing global business data and shard business data, define the table names and storage location identifiers of real database tables for global business data and shard business data, and configure the mapping relationship between the storage location identifier of the real database table and the database;
[0028] The table name prefix acquisition module is used to define the table name prefix of the real database table and the configuration data of its activation and expiration time;
[0029] The table name prefix acquisition module is used to acquire the table name prefix of the real database table according to the consultation time of the patient's consultation record and the table name prefix and the activation and expiration time of the configured real database table;
[0030] The real table name acquisition module is used to obtain the real table name for storing the sharded business data by performing string calculation on the table name prefix of the acquired real database table and the logical data table name of the electronic medical record document registration information data, the electronic medical record document instance data, and the electronic medical record document scattered data;
[0031] The mapping storage module is used to save the data using the real table name used to store the sharded business data: according to the mapping relationship between the storage location identifier of the real table name and the database, the saved data is stored in the corresponding database.
[0032] In some embodiments, a real table data access object is also included, and the real table data access object is used to perform data operations on the real table of sharded business data, wherein each sharded business data table has a corresponding data access object, and the data access object operates data through the real table name.
[0033] In a third aspect, the present application proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0034] In a fourth aspect, the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0035] Beneficial effects of the present invention:
[0036] (1) Organize the electronic medical record data according to the medical information, store the data of the same medical visit in one database, centrally store the electronic medical record data of a single medical visit, and realize the storage of medical record data in different databases according to business logic.
[0037] (2) After the electronic medical records are stored in separate databases, the database backup will no longer back up the entire medical record database, which not only maintains the integrity of the medical record database for a single visit, but also reduces the time for database backup and recovery. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is the overall flow chart of the present invention.
[0039] Figure 2 A diagram of the program processing logic for creating, saving, and deleting data shards.
[0040] Figure 3 A diagram of the program processing logic during storage and query operations for data shard storage.
[0041] Figure 4 It is a system principle diagram of the present invention. DETAILED DESCRIPTION
[0042] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein; on the contrary, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0043] In the first aspect, the present application proposes a sub-library storage method based on an electronic medical record database, such as Figure 1 As shown, the following steps are included:
[0044] S100: The electronic medical record data is divided into global business data and fragmented business data, wherein the global business data includes basic data, configuration data and medical record routing table data of the electronic medical record system, and the fragmented business data includes electronic medical record document registration information data, electronic medical record document instance data, and electronic medical record document fragmented data;
[0045] S200: define a group of databases for storing global business data and shard business data, define the table names and storage location identifiers of real database tables for the global business data and shard business data, and configure the mapping relationship between the storage location identifier of the real database table and the database;
[0046] S300: defining the table name prefix of the real database table and configuration data of its activation and expiration time;
[0047] Among them, the electronic medical record data is divided into two parts: "global business data" and a group of "sliced business data". The global business data includes the basic data of the electronic medical record system (electronic medical record template data), configuration data (EMRmeta.NodeConfig...) and medical record routing table data (EMRinstance.Router). The sliced business data includes the electronic medical record document registration information data (EMRInstance.ECRecord), electronic medical record document instance data (EMRInstance.InstanceData), and electronic medical record document fragmented data (EMRInstance.ISectionDesc...).
[0048] S400: Obtaining the table name prefix of the real database table according to the consultation time of the patient's consultation record and the table name prefix and the activation and expiration time of the configured real database table;
[0049] In some embodiments, the process of obtaining the table name prefix of the real database table according to the consultation time of the patient consultation record and the table name prefix and the activation and expiration time of the configured real database table includes:
[0050] The medical consultation routing data table is searched using the medical consultation ID as the search condition. When no data matching the medical consultation ID is found, it is determined that the sharded business data is stored for the first time. When data matching the medical consultation ID is found, it is determined that the sharded business data is not stored for the first time.
[0051] When storing sharded business data for the first time, the name prefix of the real database table is obtained based on the patient's visit time and the table name prefix of the defined database table and its activation and expiration time. To determine whether it is "storing sharded business data for the first time", the data in the "visit record routing table" is retrieved based on the visit ID in the visit record, and whether it is "storing sharded business data for the first time" is determined based on the retrieved result.
[0052] When it is not the first time to store sharded business data, the data in the "Medical Record Routing Table" is retrieved according to the medical ID in the medical record. The search result data contains the "prefix" that has been used for the medical ID. Therefore, when it is not the first time to store sharded business data, there is no need to calculate the "prefix" based on the medical time of the medical record and the table name prefix of the defined database table and its activation and expiration time. The "prefix" in the "Medical Record Routing Table" can be used directly.
[0053] For example:
[0054] The prefix configuration information table EMRmeta.NodeConfig has data as shown in Table 1 below:
[0055] Table 1
[0056] ID start date End Date NodeID 1 2022-01-01 2022-12-31 DB1 2 2023-01-01 2023-12-31 DB2 3 2024-01-01 2024-12-31 DB3
[0057] The prefixes DB1, DB2, and DB3 are configured with the "start date and end date" respectively, and the user specifies the "prefix" to be used within a period of time;
[0058] The medical consultation routing data table EMRinstance.Router is a routing table that stores medical consultation IDs and prefixes. Its data is shown in Table 2 below:
[0059] Table 2
[0060]
[0061]
[0062] EMRinstance.Router is a "routing table". The meaning of "routing" is: according to the medical ID, get the prefix data, and then use this prefix to calculate the table name of the real table.
[0063] For example, a patient comes to the hospital for treatment on 2022-01-01, and a record of the treatment is generated in the system. The ID of the treatment record is the treatment ID. When the doctor writes the medical record of this treatment for the patient, when saving the completed medical record, the system will use the "treatment ID" to first go to the "treatment routing data table EMRinstance.Router" to retrieve the prefix information. If the prefix is not retrieved, it means that the electronic medical record has not been saved for this treatment, and this save operation is the first electronic medical record save operation for this treatment ID. At this time, the system will search from the "prefix configuration information table EMRmeta.NodeConfig" according to the "treatment date and time" recorded in the "treatment record" corresponding to the treatment ID. According to the data in the prefix configuration information table, the time point of the treatment on 2022-01-01 is between "2022-01-01" and "2022-12-31", so, according to the time judgment, the enabled prefix is "DB1", as shown in Table 3 below.
[0064] Table 3
[0065] ID start date End Date NodeID 1 2022-01-01 2022-12-31 DB1 2 2023-01-01 2023-12-31 DB2 3 2024-01-01 2024-12-31 DB3
[0066] After obtaining DB1, the system will save the visit ID, together with the DB1 obtained in the above steps, in the visit routing data table EMRinstance.Router. From then on, when the system saves other electronic medical records of this visit, it will first query the visit routing data table EMRinstance.Router to obtain the prefix, and then it can be "routed" to this prefix. When storing, all electronic medical records corresponding to this visit will be stored in the data table starting with the prefix DB1, as shown in Table 4 below.
[0067] Table 4
[0068] ID Creation Date Creation time Prefix Patient ID 1 2022-01-01 2022-12-31 DB1 1001 2 2023-01-01 2023-12-31 DB2 10001 3 2024-01-01 2024-12-31 DB3 100001
[0069] The configuration example of the prefix configuration information is shown in Table 5 below:
[0070] Table 5
[0071] ID start date End Date NodeID 1 2022-01-01 2022-12-31 DB1 2 2023-01-01 2023-12-31 DB2 3 2024-01-01 2024-12-31 DB3
[0072] Furthermore, the implementation method of the table name prefix of the real database table is:
[0073] The program that accesses data in the system first retrieves data from the "visit routing table". Based on the visit ID, it retrieves the data that meets the conditions in the visit routing table. Depending on whether the data can be retrieved, there are two processing methods:
[0074] In some embodiments, when it is determined that the sharded business data is stored for the first time, the table name prefix of the real database table is obtained based on the consultation time of the patient's consultation record and the table name prefix of the defined real database table and its activation and expiration time.
[0075] Furthermore, when no data is retrieved:
[0076] Based on the date of the consultation, the system obtains the "prefix" information configured in the system, and calculates the "consultation" date and the start and end dates of the prefix to obtain the prefix of the currently used sharded business data table name.
[0077] Take the time of consultation as an example to explain the calculation method: Patient A comes to the hospital for consultation on 2022-03-01, and a "consultation record" is generated in the system. The "consultation date" is recorded in the consultation record. The system obtains the consultation date based on the consultation record ID and calculates whether this date is between the start date and end date of the record in the above "prefix configuration information". If it is determined that a matching record can be found, the NodeID of the record is obtained. If no matching record is found, the NodeID of the record closest to the current date is obtained.
[0078] After obtaining the "prefix of the currently used sharded business data table name", the system immediately saves the consultation ID together with the obtained "prefix" in the "consultation routing table" and uses it as the table name prefix of the real database table.
[0079] In some embodiments, when it is determined that it is not the first time to store sharded business data, the data in the medical record routing table is retrieved according to the medical ID in the medical record. When the retrieval result contains a prefix that has been used for the medical ID, the prefix that has been used is directly obtained as the table name prefix of the real database table.
[0080] Furthermore, when data is retrieved:
[0081] The "prefix of the sharding business data table name" in the retrieved data is obtained as the table name prefix of the real database table.
[0082] S500: Obtain the real table name for storing the sharded business data by performing a string calculation on the table name prefix of the acquired real database table and the logical data table name of the electronic medical record document registration information data, the electronic medical record document instance data, and the electronic medical record document scattered data;
[0083] In some embodiments, the real table name is composed of the prefix of the real database table name plus a character point and the logical data table name. The basic numerical data defining the prefix of the real database table name and its activation and expiration time is to provide basic data for "calculating the prefix of the real data table name according to the consultation time". The activation and expiration time of the prefix of the real database table name can be configured according to the start and end date of the year, and the prefixes used in multiple future years can be pre-configured.
[0084] For example, the data access object of the medical record registration information table EMRInstance.ECRecord is "EMR.DAO.ECRecord". This object contains one attribute, which is used to define the "logical table name" of the data access object, and its value is "EMRinstance.ECRecord".
[0085] The real table name = the prefix of the real database table name + "." + the logical data table name. In different years, the electronic medical record document registration information data, electronic medical record document instance data, and electronic medical record document scattered data will use real table names with different prefixes. (The prefix is DB1 for the period from 2023-1-1 to 2023-12-31, and DB2 for the period from 2024-1-1 to 2024-12-31...)
[0086] For example, the data access object "EMR.DAO.ECRecord" obtains the prefix "DB1" based on the value of one of its attributes "EMRinstance.ECRecord" and before accessing the data, it executes the logic of obtaining the prefix, and performs string concatenation inside the data access object: DB1+".EMRinstance.ECRecord, thereby obtaining the real table name DB1.EMRinstance.ECRecord, and then performs data access.
[0087] The data access object is an object of the data access layer used to access the real table. Each logical table has a corresponding data access object. For example, the medical record registration information table EMRinstance.ECRecord has a corresponding data access object: EMR.DAO.ECRecord. This object contains one attribute, whose value is "EMRinstance.ECRecord". The data access object executes the logic of obtaining the prefix "DB1" based on the value of this attribute before accessing the data. The string concatenation is performed inside the data access object: DB1+"."+EMRinstance.ECRecord, thereby obtaining the real table name DB1.MRinstance.ECRecord, and then accessing the data.
[0088] Among them, the data shard storage program processing logic when designed for shard business data storage is as follows Figure 2 As shown:
[0089] Includes BL layer 2: business logic layer program, accessing data through data access objects DAO;
[0090] And DAO layer 2: data access object, with built-in data sharding logic, using the method of sharding data by "visit";
[0091] The execution process of creating, saving, and deleting data:
[0092] (1) Business logic layer program, which performs business logic processing of "create, save, and delete data" operations;
[0093] (2) When processing business logic, it is necessary to access business data and call the data access object of DAO layer 2 to access the data;
[0094] (3) When the data access object is called, it executes the logic of data shard storage;
[0095] (4) The logic program of data shard storage is executed according to EpisodeID (the ID of the patient's current visit) to obtain the NodeID configured in the system (the prefix of the real table, which can be configured in multiples);
[0096] (5) The logic program of data shard storage,calculates the currently available NodeID (prefix of the real table) according to certain business logic.
[0097] (6) The data access object uses NodeID and, after certain business logic, calculates the table name (TrueClassName) of the data table to be operated.
[0098] (7) The data access object uses the table name obtained in the previous step to perform the instantiation operation and obtain the instance object;
[0099] (8) The business logic layer program is the instantiated object obtained in the previous step, and performs data operations. (%Save: save, %Delete: delete);
[0100] Operations for storing and querying data are as follows: Figure 3 As shown:
[0101] The BL layer is the business logic layer, which accesses data through data access objects and has a built-in data sharding strategy. It uses a data sharding strategy based on the medical ID.
[0102] Furthermore, the data sharding strategy is implemented as follows:
[0103] (1) Establish routing information for data sharding storage based on medical ID: EMRinstance.Router;
[0104] (2) Establish data node configuration information for data shard storage: EMRmeta.NodeConfig
[0105] (3) Program logic for data routing by visit ID: Retrieve data from the visit record routing table based on the visit ID in the visit record. When the search result contains a prefix that has been used by the visit ID, directly obtain the prefix that has been used as the table name prefix of the real database table. If no result is retrieved, obtain the table name prefix of the real database table based on the visit time of the patient's visit record and the defined table name prefix of the real database table and its activation and expiration time, and then save it together with the visit ID in the visit data routing table.
[0106] (4) Configuration of prefix configuration information: According to the current time of the system, obtain the prefix (NodeID) of the real table of the data storage being used. If the prefix (NodeID) of the real table of the data storage cannot be obtained according to the time, then obtain the prefix (NodeID) of the real table configured with the prefix closest to the current time.
[0107] (5) The logic of obtaining the “real table” name based on the data storage node ID (NodeID): If the NodeID is “DB1”, then the “real table” name is DB1.EMRinstance.ECRecord.
[0108] (6) Provide a data access object (DAO class) for each shard business data table.
[0109] S600: performing a data saving operation using a real table name for storing sharded business data: storing the saved data in a corresponding database according to a mapping relationship between a storage location identifier of the real table name and the database.
[0110] After the real table name is obtained, the data is operated through the corresponding data access object. Each database table corresponds to a data access object of this data table.
[0111] For example, if the logical table name of the medical record registration information table is EMRinstance.ECRecord, its physical storage location identifier is DHCEMRI.ECRecordD. Add the shard data node ID "DB1" before the physical storage location identifier to get DB1.EMRinstance.ECRecordD;
[0112] Using the physical storage location identifier and database name of the sharded business data, a mapping relationship between the sharded storage business data and the database is obtained as shown in Table 6 below:
[0113] Table 6
[0114]
[0115]
[0116] Map the physical storage location identifier of the sharded business data table to multiple databases
[0117] When the system accesses data through the namespace, when storing data in the DB1.EMRinstance.ECRecord table, according to the mapping relationship between the physical storage location of DB1.EMRinstance.ECRecord and the database, the data is stored in the DHC-NODEA-EMRINSTANCEDATA database. When reading the data of DB1.EMRinstance.ECRecord, similarly, according to the mapping relationship, the data is obtained from DHC-NODEA-EMRINSTANCEDATA;
[0118] For example, the physical data storage location identifier of a table named DB1.EMRinstance.ECRecord is DB1.DHCEMRI.ECRecordD. By adding the corresponding relationship between the "storage location identifier" and the "database" in the namespace, DB1.DHCEMRI.ECRecordD corresponds to DHC-NODEA-EMRINSTANCEDATA, DB2.DHCEMRI.ECRecordD corresponds to DHC-NODEB-EMRINSTANCEDATA, and DB3.DHCEMRI.ECRecordD corresponds to DHC-NODEC-EMRINSTANCEDATA. When data is accessed through the namespace, data can be stored in multiple databases.
[0119] At this point, the configured data node starts to store data in the sharded database after the start time. The reason why this solution proposes the requirement of "storing the medical record document data of the same visit in one database file" is that if the electronic medical record database is stored in this way, the medical record database stored in the sub-database will continue to move forward with time. When the medical process ends, the electronic medical record data of this visit will not have any new or modified data operations. The early electronic medical record database will gradually become read-only, without any new or modified data. In this way, this database can no longer be backed up, and only a full backup is retained for recovery in response to serious system disasters. Daily backups do not need to include this database that is only read, thereby reducing the size of the backup data. The smaller the backup, the faster the recovery, and the less disk resources the backup occupies. Therefore, this method not only maintains the integrity of the medical record database of a visit, but also reduces the time for database backup and recovery. This is a method to improve the maintainability of the electronic medical record system and the efficiency of the operation and maintenance of the business data of the electronic medical record system. .
[0120] In the second aspect, the present application proposes an electronic medical record data sub-database storage system, such as Figure 2 As shown, it includes a data partitioning module, a mapping relationship definition module, a configuration module, a table name prefix acquisition module, a real table name acquisition module and a mapping storage module;
[0121] The data partitioning module is used to divide the electronic medical record data into global business data and fragmented business data, wherein the global business data includes basic data, configuration data and medical record routing table data of the electronic medical record system, and the fragmented business data includes electronic medical record document registration information data, electronic medical record document instance data, and electronic medical record document scattered data;
[0122] The configuration module is used to define a group of databases for storing global business data and shard business data, define the table names and storage location identifiers of real database tables for global business data and shard business data, and configure the mapping relationship between the storage location identifier of the real database table and the database;
[0123] The table name prefix acquisition module is used to define the table name prefix of the real database table and the configuration data of its activation and expiration time;
[0124] The table name prefix acquisition module is used to acquire the table name prefix of the real database table according to the consultation time of the patient's consultation record and the table name prefix and the activation and expiration time of the configured real database table;
[0125] The real table name acquisition module is used to obtain the real table name for storing the sharded business data by performing string calculation on the table name prefix of the acquired real database table and the logical data table name of the electronic medical record document registration information data, the electronic medical record document instance data, and the electronic medical record document scattered data;
[0126] The mapping storage module is used to save the data using the real table name used to store the sharded business data: according to the mapping relationship between the storage location identifier of the real table name and the database, the saved data is stored in the corresponding database.
[0127] In some embodiments, a real table data access object is also included, and the real table data access object is used to perform data operations on the real table of sharded business data, wherein each sharded business data table has a corresponding data access object, and the data access object operates data through the real table name.
[0128] In a third aspect, the present application proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0129] In a fourth aspect, the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0130] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0131] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0132] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.
[0133] In the embodiments provided in the present disclosure, it should be understood that the disclosed apparatus / computer equipment and methods can be implemented in other ways. For example, the apparatus / computer equipment embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. Multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection of the apparatus or unit, which may be electrical, mechanical or other forms.
[0134] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0135] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0136] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present disclosure implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0137] The above are only preferred implementations of the present invention. It should be pointed out that a number of modifications and improved technical solutions made by those skilled in the art without departing from the technical solution should also be deemed to fall within the scope of protection required by the claims.
Claims
1. A method for storing electronic medical record data in a sub-library, characterized in that: The following steps are involved: The electronic medical record data is divided into global business data and fragmented business data, wherein the global business data includes the basic data, configuration data and medical record routing table data of the electronic medical record system, and the fragmented business data includes the electronic medical record document registration information data, the electronic medical record document instance data, and the electronic medical record document fragmented data; Define a group of databases for storing global business data and shard business data, define the table names and storage location identifiers of real database tables for global business data and shard business data, and configure the mapping relationship between the storage location identifier of the real database table and the database; Define the table name prefix of the real database table and the configuration data of its enablement and expiration time; According to the consultation time of the patient's consultation record and the table name prefix, activation time and expiration time of the configured real database table, the table name prefix of the real database table is obtained; The real table name for storing the sharded business data is obtained by performing a string calculation on the table name prefix of the obtained real database table and the logical data table name of the electronic medical record document registration information data, the electronic medical record document instance data, and the electronic medical record document scattered data; The data is saved by using the real table name used to store the sharded business data: according to the mapping relationship between the storage location identifier of the real table name and the database, the saved data is stored in the corresponding database.
2. The method according to claim 1, characterized in that: The method of defining a group of databases for storing global business data and shard business data, defining the table names and storage location identifiers of real database tables for global business data and shard business data, and configuring the mapping relationship between the storage location identifiers of the real database tables and the databases includes: Define a first database for storing global business data and a plurality of second databases for storing sharded business data; Define a table name of a real database table for storing global business data and a storage location identifier thereof, and configure a mapping relationship between the storage location identifier and a first database; Define the table name of the real database table of the sharded business data and its storage location identifier, and configure the mapping relationship between the storage location identifier of the real database table and multiple second databases.
3. The method according to claim 2, characterized in that: The method of obtaining the table name prefix of the real database table according to the consultation time of the patient's consultation record and the table name prefix, activation time and expiration time of the configured real database table includes: The medical consultation routing data table is searched using the medical consultation ID as the search condition. When no data matching the medical consultation ID is found, it is determined that the sharded business data is stored for the first time. When data matching the medical consultation ID is found, it is determined that the sharded business data is not stored for the first time.
4. The method according to claim 3, characterized in that: When it is determined that the sharded business data is stored for the first time, the table name prefix of the real database table is obtained according to the consultation time of the patient's consultation record and the table name prefix of the defined real database table and its activation and expiration time.
5. The method according to claim 4, characterized in that: When it is determined that this is not the first time to store sharded business data, the data in the medical record routing table is retrieved according to the medical ID in the medical record. When the search result contains a prefix that has been used for the medical ID, the prefix that has been used is directly obtained as the table name prefix of the real database table.
6. The method according to claim 5, characterized in that: The method of performing string calculation on the table name prefix of the acquired real database table and the logical data table name of the electronic medical record document registration information data, the electronic medical record document instance data, and the electronic medical record document scattered data to obtain the real table name for storing the sharded business data includes: The real table name is composed of the table name prefix of the real database table plus a character point and a logical data table name.
7. An electronic medical record data sub-database storage system, characterized in that: It includes data partitioning module, mapping relationship definition module, configuration module, table name prefix acquisition module, real table name acquisition module and mapping storage module; The data partitioning module is used to divide the electronic medical record data into global business data and fragmented business data, wherein the global business data includes basic data, configuration data and medical record routing table data of the electronic medical record system, and the fragmented business data includes electronic medical record document registration information data, electronic medical record document instance data, and electronic medical record document scattered data; The configuration module is used to define a group of databases for storing global business data and shard business data, define the table names and storage location identifiers of real database tables for global business data and shard business data, and configure the mapping relationship between the storage location identifier of the real database table and the database; The table name prefix acquisition module is used to define the table name prefix of the real database table and the configuration data of its activation and expiration time; The table name prefix acquisition module is used to acquire the table name prefix of the real database table according to the consultation time of the patient's consultation record and the table name prefix and the activation and expiration time of the configured real database table; The real table name acquisition module is used to obtain the real table name for storing the sharded business data by performing string calculation on the table name prefix of the acquired real database table and the logical data table name of the electronic medical record document registration information data, the electronic medical record document instance data, and the electronic medical record document scattered data; The mapping storage module is used to save the data using the real table name used to store the sharded business data: according to the mapping relationship between the storage location identifier of the real table name and the database, the saved data is stored in the corresponding database.
8. The system according to claim 7, characterized in that: It also includes a real table data access object, which is used to perform data operations on the real table of sharded business data, wherein each sharded business data table has a corresponding data access object, and the data access object operates data through the real table name.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.