Electronic health record automatic coding method and system
By segmenting, extracting, encoding and verifying the text of electronic health record, using a large language model and encoding rule library to generate accurate encoding results, the problems of low encoding efficiency and accuracy in the prior art are solved, and automatic encoding of electronic health record is realized.
Patent Information
- Application Number
- CN202510454922.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-08-08
AI Technical Summary
The prior art has problems with low encoding efficiency and low accuracy in electronic health records, and lacks an effective encoding verification mechanism, resulting in inaccurate encoding results.
By segmenting the electronic health record text into several text fragments, structured key medical information is extracted using a large language model, preliminary encoding results are generated based on the encoding rule library, and verification and review through the verification model and the audit model to generate the final encoding results.
Improve the accuracy of the encoding results and ensure the semantic consistency and accuracy of the encoding results with electronic health records.
Smart Images

Figure CN120452649A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical information processing, and in particular to a method and system for automatically encoding electronic health records. Background Art
[0002] Electronic health records (EHRs) are tools used to digitally record patient health information. They play a crucial role in patient care, healthcare operations, and medical research. With the explosion of medical data, conventional manual coding, such as low efficiency and accuracy, is impacting the reliability of EHRs in applications. Consequently, a variety of deep learning-based coding methods have emerged.
[0003] The deep learning-based coding methods commonly used in existing technologies currently have large differences in their ability to process medical concepts and understand semantics. Some deep learning-based coding methods can only understand accurate and specific numerical values, and are insufficient in understanding key text information in electronic health records. In addition, once a coding error occurs, the existing technology lacks an effective coding verification mechanism and needs to rely on manual repeated verification, resulting in inaccurate coding results. Summary of the Invention
[0004] In order to solve the above problems, the present invention proposes an automatic encoding method and system for electronic health records, which can encode key health information in unstructured text and verify the encoding results to improve the accuracy of the encoding results.
[0005] To achieve the above-mentioned purpose, an embodiment of the present invention provides a method for automatic encoding of electronic health records, including: dividing the electronic health record text into several text fragments to obtain several unstructured text contents; obtaining structured key medical information based on a preset large language model and several of the unstructured text contents; generating a preliminary encoding result based on a preset encoding rule library and the structured key medical information; obtaining a final encoding result based on a preset verification model, a preset audit model and the preliminary encoding result to complete the automatic encoding of the electronic health record.
[0006] An embodiment of the present invention proposes an automatic encoding method for electronic health records, which divides the electronic health record text into several segments, fragments the complex text content to facilitate the subsequent acquisition of key health information, and then uses a large language model to extract key medical information from each standard text content, obtains structured key medical information from unstructured data, and then uses a preset encoding rule library to encode the structured key medical information to generate a corresponding preliminary encoding result. Finally, the preliminary encoding result is verified and audited by the verification mechanism of the preset verification model and the preset audit model to generate the final encoding result; finally, after obtaining the key medical information content of the text content of the electronic health record, the key information is encoded, and the encoding result is verified by the verification and audit mechanism, thereby improving the accuracy of the encoding result.
[0007] Furthermore, the electronic health record text is segmented into several text fragments to obtain several unstructured text contents, including: obtaining the electronic health record text; determining the initial segmentation position of the electronic health record text based on a preset number of segmentation points; traversing the initial segmentation position and performing semantic boundary recognition based on a preset sliding window to obtain a final segmentation position; segmenting the electronic health record text based on the final segmentation position to obtain several text fragments; based on a preset deep learning algorithm, feature-labeling the several text fragments, and standardizing the several text fragments after medical annotation to obtain several unstructured text contents.
[0008] Through the above scheme, when segmenting the text content of electronic health records, the semantic boundaries of the text content are taken into consideration, and then the final segmentation points are determined to ensure that the segments obtained by text segmentation are semantically complete and understandable. Then, each text segment is standardized so that the text data is in a unified standard format, thereby providing an accurate data basis for subsequent extraction of key medical information to improve the accuracy of the coding results.
[0009] Furthermore, based on the preset deep learning algorithm, feature annotation is performed on several of the text fragments, and the medically annotated text fragments are standardized to obtain several unstructured text contents, including: based on the preset deep learning algorithm, context features of several of the text fragments are extracted to obtain feature sequences of several of the text fragments; based on the preset entity data table, entity annotation is performed on the feature sequences of several of the text fragments to extract entity sequences that meet preset requirements; based on the preset standard terminology data rules, the abbreviation vocabulary in the entity sequence is mapped and converted into complete terms, and the complete terms are replaced with standard terms that meet the similarity requirements to obtain a standard term sequence; based on the preset standard format data rules, the vocabulary in the standard term sequence that does not meet the preset edit distance is corrected, and the corrected standard term sequence is converted into a standard format to obtain several unstructured text contents.
[0010] Through the above scheme, context features are extracted from the segmented text fragments to obtain the feature sequence of the text fragments. By correspondingly annotating the feature sequence with the entity data, the entity sequence is obtained. The abbreviations in the entity sequence are then mapped to complete terms, and the complete terms are replaced with standard terms accordingly to ensure the semantic integrity of the text fragments and make the standardized text content more reliable. Finally, the standard term sequence is subjected to vocabulary correction and standard format conversion to unify the standards of each text fragment. By ensuring the accuracy of the text content fragments, the accuracy of the encoding results is improved.
[0011] Furthermore, the method of obtaining structured key medical information based on the preset large language model and the several unstructured text contents includes: extracting key medical knowledge contents of the several unstructured text contents based on the preset large language model; verifying the semantic relationship between entities in the key medical knowledge contents of the several unstructured text contents based on the preset entity relationship diagram; constructing attention connections between the text fragments of the key medical knowledge contents, and screening out key medical information that meets the first confidence requirement to obtain structured key medical information.
[0012] Through the above scheme, key medical information is identified and extracted from the standardized text content through a large language model, and the semantic relationships between entities in the key medical knowledge content are verified and connected accordingly to obtain the conditions for providing structured data. Finally, medical information that meets the confidence requirements is screened out, thereby obtaining structured key medical information from unstructured medical information. By fully understanding the semantic content of key medical information and converting the data state to facilitate subsequent automatic encoding, the accuracy of the encoding results can be improved.
[0013] Furthermore, the method generates a preliminary coding result based on the preset coding rule library and the structured key medical information, including: calculating the semantic similarity between the structured key medical information and the coding rules based on the preset coding rule library; matching the corresponding coding rules based on the semantic similarity; generating multi-level coding from top to bottom through a preset hierarchical classification algorithm based on the coding rules, and generating several coding combination schemes; making coding assumptions for several of the coding combination schemes, screening out coding combinations that meet the second confidence requirements, and obtaining preliminary coding results.
[0014] Through the above scheme, according to the preset coding rule library, coding rule matching is performed based on the semantic similarity between structured key medical information and coding rules. After matching the corresponding coding rules, multi-level coding is generated from top to bottom, and multiple coding combinations are obtained to ensure the reliability of the coding results. Finally, according to the coding hypothesis, the coding combinations that meet the confidence requirements are screened to obtain preliminary coding results, thereby improving the accuracy of the coding results.
[0015] Furthermore, the generation of preliminary coding results based on the preset coding rule library and the structured key medical information also includes: acquiring the coding rule data to be updated in real time, and converting the unstructured rule data of the coding rule data to be updated into structured rule data; performing version control, conflict detection and association analysis on the structured rule data to obtain a mapping relationship between rules; generating a coding rule index through the mapping relationship between the structured rule data and the rules; storing the coding rule index in the preset coding rule library; and encoding the structured key medical information through the corresponding coding rule index based on the preset coding rule library to obtain a preliminary coding result.
[0016] Through the above scheme, the coding rule data to be updated is converted from unstructured rule data to easy-to-understand structured rule data, and then the structured rule data is subjected to version control, conflict detection and association analysis, and potential conflicts between the rule data to be updated and the existing data are automatically detected. Then, a mapping relationship between the rules is established, and a corresponding coding rule search is generated. In this way, efficient coding can be achieved based on the coding search when applying the coding rule library. Finally, the coding rule search is updated to the pre-stored rule library to achieve real-time updating of the coding rules. By timely updating the coding rules, it is ensured that the coding rules are consistent with the latest coding rules, thereby improving the accuracy of the coding results.
[0017] Furthermore, the final coding result is obtained based on the preset verification model, the preset audit model and the preliminary coding result to complete the automatic coding of the electronic health record, including: based on the preset verification model, performing a rule consistency check on the preliminary coding result; if the preliminary coding result meets the rule consistency check requirements, performing a coding anomaly check on the preliminary coding result; if the preliminary coding result meets the coding anomaly check requirements, performing a historical knowledge consistency check on the preliminary coding result in combination with the patient's historical electronic health record; if the preliminary coding result meets the historical knowledge consistency check requirements, obtaining a consistency check result; based on the preset audit model and the consistency check result, the preliminary coding result is audited to obtain a final coding result to complete the automatic coding of the electronic health record.
[0018] Through the above scheme, the consistency of the coding results with the multimodal data in the electronic health record is guaranteed by performing consistency checks, anomaly checks and historical knowledge consistency checks on the preliminary coding results. After the coding is reviewed through the audit model, the final coding results are generated. Therefore, the accuracy of the coding results is improved by verifying and auditing the coding results.
[0019] Furthermore, based on the preset audit model and the consistency check result, the preliminary coding result is audited to obtain the final coding result to complete the automatic coding of the electronic health record, including: based on the preset audit model, the preliminary coding result is independently audited and the corresponding audit result is saved to obtain the coding audit result; by setting corresponding weights for the consistency check result and the coding audit result, the weight ratio is adjusted until the third confidence requirement is met to obtain the final coding result to complete the automatic coding of the electronic health record.
[0020] Through the above scheme, different weights are set for the consistency check results and coding review results of the coding results. The weight ratio can be dynamically adjusted to resolve potential conflicts between the consistency check results and the coding review results until the weight ratio meets the confidence requirements, and the final coding result is generated to complete the automatic coding of electronic health records. Therefore, under the premise of verifying and reviewing the coding results, the weight ratio of the consistency check results and the coding review results is adaptively adjusted, which effectively improves the coding quality and improves the accuracy of the coding results.
[0021] An embodiment of the present invention also provides an automatic coding system for electronic health records, including: a text segmentation module, a data extraction module, a preliminary coding module and a coding verification module; the text segmentation module is used to segment the electronic health record text into several text fragments to obtain several unstructured text contents; the data extraction module is used to obtain structured key medical information based on a preset large language model and several of the unstructured text contents; the preliminary coding module is used to generate a preliminary coding result based on a preset coding rule library and the structured key medical information; the coding verification module is used to obtain a final coding result based on a preset verification model, a preset audit model and the preliminary coding result to complete the automatic coding of electronic health records.
[0022] An embodiment of the present invention proposes an automatic coding system for electronic health records. The text segmentation module divides the electronic health record text into several segments, fragmenting the complex text content to facilitate the subsequent acquisition of key health information. The data extraction module then uses a large language model to extract key medical information from each standard text content, and obtains structured key medical information from unstructured data. The preliminary coding module then uses a preset coding rule library to encode the structured key medical information to generate a corresponding preliminary coding result. Finally, the coding verification module uses a preset verification model and a preset audit model to verify and audit the preliminary coding result to generate a final coding result. Finally, after obtaining the key medical information content of the text content of the electronic health record, the key information is encoded, and the coding result is verified through the verification and audit mechanism, thereby improving the accuracy of the coding result. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic flow chart of the steps of a method for automatic encoding of electronic health records provided in one embodiment of the present invention;
[0024] Figure 2 A schematic diagram of the module structure of an electronic health record automatic coding system provided by an embodiment of the present invention;
[0025] Figure 3 A schematic diagram of the module structure of a user interface structure system of an electronic health record automatic encoding method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0027] See also Figure 1 , Figure 1 A flowchart of a method for automatically encoding electronic health records is provided in accordance with an embodiment of the present invention. Figure 1 As shown, the embodiment of the present invention proposes an automatic coding method for electronic health records, including steps 101 to 104, each of which is specifically as follows:
[0028] Step 101: Segment the electronic health record text into a plurality of text segments to obtain a plurality of unstructured text contents;
[0029] Step 102: obtaining structured key medical information based on a preset large language model and the plurality of unstructured text contents;
[0030] Step 103: generating a preliminary coding result based on a preset coding rule library and the structured key medical information;
[0031] Step 104 , based on the preset verification model, the preset review model and the preliminary coding result, a final coding result is obtained to complete the automatic coding of the electronic health record.
[0032] In this embodiment, executing step 101 includes: obtaining an electronic health record text; determining an initial segmentation position of the electronic health record text based on a preset number of segmentation points; traversing the initial segmentation position based on a preset sliding window and performing semantic boundary recognition to obtain a final segmentation position; and segmenting the electronic health record text based on the final segmentation position to obtain a plurality of text segments;
[0033] When segmenting the text content of an electronic health record, the semantic boundaries of the text content are considered, and then the final segmentation points are determined to ensure that the segments obtained by the text segmentation are semantically complete and understandable. A specific implementation method is as follows: first, the electronic health record text is obtained, and then a text segmenter is used to segment the text. The text segmenter performs text segmentation based on a rule-based segmentation algorithm, determines the initial segmentation position according to a preset maximum number of tokens, such as 512 tokens, and then uses a sliding window technology to identify semantic boundaries before and after all initial segmentation positions, wherein the sliding window size is set to 128 tokens. The final segmentation position is determined under the premise of ensuring semantic integrity, thereby segmenting the electronic health record text into several text segments;
[0034] After completing the text segmentation, based on the preset deep learning algorithm, feature annotation is performed on several of the text fragments, and the several text fragments after medical annotation are standardized to obtain several unstructured text contents, including: based on the preset deep learning algorithm, context features of several of the text fragments are extracted to obtain feature sequences of several of the text fragments; based on the preset entity data table, entity annotation is performed on the feature sequences of several of the text fragments to extract entity sequences that meet preset requirements; based on the preset standard terminology data rules, the abbreviation vocabulary in the entity sequence is mapped and converted into complete terms, and the complete terms are replaced with standard terms that meet the similarity requirements to obtain a standard term sequence; based on the preset standard format data rules, the vocabulary in the standard term sequence that does not meet the preset edit distance is corrected, and the corrected standard term sequence is converted into a standard format to obtain several unstructured text contents.
[0035] By performing standardization processing on each text segment, context feature extraction is performed on the segmented text segment to obtain a feature sequence of the text segment, and the feature sequence is labeled with the entity data to obtain an entity sequence, and then the abbreviations in the entity sequence are mapped to complete terms, and the complete terms are replaced with standard terms accordingly to ensure the semantic integrity of the text segment and make the text content after standardization more reliable. Finally, the standard term sequence is subjected to vocabulary correction and standard format conversion to make the text data in a unified standard format, thereby providing an accurate data basis for subsequent key medical information extraction to improve the accuracy of the encoding results. A specific implementation method adopts a named entity tool. In this embodiment, a deep learning sequence labeling algorithm structure of a bidirectional long short-term memory network (Bi-LSTM) combined with a conditional random field (CRF) is adopted, which combines the feature extraction capability of Bi-LSTM and the sequence labeling capability of CRF to improve the accuracy of entity recognition. First, the segmented text is input into the Bi-LSTM network to extract the context feature representation of the text, and then the feature representation is input into the CRF layer to obtain the optimal The sequence annotation results (equivalent to the preset requirements) are obtained, and then medical-related entities including disease names, symptoms, drugs, examination items and treatment methods are extracted based on the annotation results; after obtaining the entity sequence that meets the preset requirements, it is matched through a pre-built medical abbreviation dictionary, and combined with a context-related expansion algorithm, the medical abbreviation mapping is converted into the corresponding complete term, and then a word vector model is established based on the pre-built medical ontology library, and the semantic similarity between the term to be replaced and the standard medical term (equivalent to the preset standard term data rule) is calculated, and the standard term with the highest similarity is selected for replacement. The edit distance algorithm is used to calculate the edit distance between the word to be corrected and the standard word in the dictionary (equivalent to the preset standard format data rule), and candidate words with a distance less than a preset threshold (equivalent to the preset edit distance) are screened out, and the probability of each candidate word in the current context is calculated in combination with a context-based language model, and the candidate word with the highest probability is selected as the correction result. Finally, through the pre-defined regular expression template and format rules, the date, numerical value and unit expression in the text are identified, the standard term sequence is converted into a standard format, and a number of unstructured text contents are obtained.
[0036] Before executing step 102, a large language model needs to be trained. In a specific implementation method, a pre-trained model of a large-scale language model based on the Transformer architecture is adopted. In this embodiment, it includes but is not limited to the GPT (Generative Pre-trained Transformer) series or the BERT (Bidirectional Encoder Representations from Transformers) series model. A number of unstructured text contents are input into the pre-trained model, and a preliminary semantic representation of the text is generated through a multi-layer self-attention mechanism and a feedforward neural network. Then, in order to improve the expression ability of the model's domain knowledge, the model's vocabulary is expanded through a medical terminology library and a domain-specific corpus to improve the model's coverage of medical professional vocabulary. A large-scale medical text dataset is used to fine-tune the pre-trained model, such as by designing comparative learning tasks and multi-task learning strategies, so that the model gradually adapts to the text characteristics and expressions in the medical field. Finally, through knowledge distillation technology, the structured information in the pre-constructed medical knowledge graph is converted into a form that the model can learn and input into the parameters of the language model to enhance the model's domain knowledge representation ability. At this point, the training of the large language model is completed.
[0037] Executing step 102 includes: extracting some key medical knowledge contents of the unstructured text contents based on a preset large language model; verifying the semantic relationship between entities in some key medical knowledge contents of the unstructured text contents based on a preset entity relationship diagram; constructing attention connections between the text fragments of the key medical knowledge contents, and screening out key medical information that meets the first confidence requirement to obtain structured key medical information.
[0038] In order to ensure the accuracy of text content fragments and improve the accuracy of encoding results, the standardized text content is identified and extracted by a large language model, and the semantic relationship between entities in the key medical knowledge content is verified and connected accordingly to obtain the conditions for providing structured data. Finally, medical information that meets the confidence requirements is screened out, thereby obtaining structured key medical information from unstructured medical information. By fully understanding the semantic content of key medical information and converting the data state to facilitate subsequent automatic encoding, a specific implementation method is to identify key medical information in the text, including but not limited to diagnosis, symptoms and treatment plans, through the sequence labeling structure based on the attention mechanism in the large language model. Then, the graph neural network (GNN) in the large language model is combined with the remote supervised learning method to construct a relationship graph between entities. Through the message passing mechanism of the graph structure, the semantic relationship between entities is extracted and verified, such as the association between symptoms and diseases, the relationship between drugs and treatment effects, etc. Then, the Transformer-based cross-document coreference resolution structure in the large language model is used to understand the contextual information and referential relationship in long texts by establishing attention connections between text fragments. Finally, by adopting the Monte Carlo dropout method and ensemble learning method, the reliability of the extracted information is probabilistically evaluated, and the reliability threshold (equivalent to the first confidence requirement) is set according to the actual application situation to screen out structured key medical information.
[0039] Executing step 103 includes: calculating the semantic similarity between the structured key medical information and the coding rules based on a preset coding rule library; matching the corresponding coding rules based on the semantic similarity; generating multi-level coding from top to bottom through a preset hierarchical classification algorithm based on the coding rules, and generating several coding combination schemes; making coding assumptions for several of the coding combination schemes, screening out coding combinations that meet the second confidence requirement, and obtaining preliminary coding results.
[0040] In order to ensure that the coding rules are consistent with the latest coding rules, first, the coding rule data to be updated is acquired in real time, and the unstructured rule data of the coding rule data to be updated is converted into structured rule data; version control, conflict detection and association analysis are performed on the structured rule data to obtain the mapping relationship between the rules; a coding rule index is generated through the mapping relationship between the structured rule data and the rules; the coding rule index is stored in the preset coding rule library; based on the preset coding rule library, the structured key medical information is encoded through the corresponding coding rule index to obtain a preliminary coding result;By timely updating the coding rules, the coding rule data to be updated is converted from unstructured rule data to structured rule data that is easy to understand, and then version control, conflict detection and association analysis are performed on the structured rule data, and potential conflicts between the rule data to be updated and the existing data are automatically detected. Then, a mapping relationship between the rules is established, and a coding rule search is generated accordingly. In this way, efficient coding can be achieved based on the coding search when applying the coding rule library. Finally, the coding rule search is updated to the pre-stored rule library to achieve real-time updating of the coding rules. A specific implementation method is to use a distributed graph database system (such as Neo4j or JanusGraph) to store and manage standardized medical coding rules, including but not limited to: International Classification of Diseases (ICD) coding rules, Classification of Medical Service Operations (ICD-9-CM Volume 3) coding rules, Standardized Nomenclature System for Symptoms and Signs (SNOMED CT) coding rules, the drug coding system (ATC) coding rules, and the laboratory examination coding system (LOINC) coding rules. On this basis, the latest coding rule updates (equivalent to the coding rules to be updated) are regularly obtained from the official medical coding organization website through web crawler technology. Then, natural language processing and machine learning technologies are used to convert the obtained unstructured rule text into structured data that can be processed by the system. Then, a timestamp-based incremental synchronization algorithm is used to achieve real-time updates of the coding rules. At the same time, a distributed consistency protocol (such as Raft or Paxos) is used to ensure data consistency of the rule base in a distributed environment. Then, a distributed version control strategy is used to manage and track the versions of the coding rules. Through a rule-based reasoning system, The system combines consistency checking algorithms to automatically detect and mark potential conflicts in the rule base. Finally, graph algorithms and association rule mining techniques are used to analyze the rule associations between different coding systems, establish mapping relationships between rules, generate coding rule indexes, and store them in the coding rule base. In addition, when rule indexes are needed, inverted indexing techniques (such as the Elasticsearch search engine) can be used to achieve fast full-text retrieval of coding rules. Knowledge graphs and natural language processing techniques can also be combined to achieve semantic-based fuzzy queries and reasoning. In addition, cross-modal coding rule retrieval can be supported by integrating feature representations of text, images, and structured data. By updating the coding rule base, real-time rule application in the coding process is supported.
[0041] After the coding rule library is updated, in order to ensure the accuracy of the coding results, the coding rule matching is performed based on the semantic similarity between the structured key medical information and the coding rules according to the preset coding rule library. After matching the corresponding coding rules, multi-level coding is generated from top to bottom, and multiple coding combinations are obtained to ensure the reliability of the coding results. Finally, the coding combinations that meet the confidence requirements are screened according to the coding hypothesis to obtain the preliminary coding results. A specific implementation method is to first receive and buffer the medical information stream (equivalent to structured key medical information) from the large language model, including but not limited to diagnostic information, symptom description, treatment process, drug use and examination results. In order to ensure the stability of data processing under high concurrency, the asynchronous processing mechanism in the existing technology (such as Apache Kafka or RabbitMQ) as a guarantee, after receiving the structured critical medical information, based on the preset coding rule library, use pre-trained word embedding technology (such as Word2Vec or BERT) to calculate the semantic similarity between the input information and the coding rule, and then use the rule priority algorithm based on the decision tree. When multiple matches occur, the most suitable rule is selected according to the preset priority strategy, and then the recurrent neural network or long short-term memory network is used to consider the contextual relationship of the structured critical medical information for rule matching. When the structured critical medical information matches the corresponding coding rule, a hierarchical classification algorithm is used to generate multi-level medical coding from top to bottom, and then through the combination optimization algorithm, multiple levels are optimized under the premise of ensuring coding accuracy. The combination scheme of related codes is based on rule engine technology to verify whether the logical relationship between the generated codes is consistent. For the multiple coding schemes generated initially, a reasoning system based on fuzzy set theory is used to deal with the uncertainty and ambiguity in structured key medical information. The Monte Carlo tree search algorithm (MCTS) is used to generate multiple possible coding hypotheses under uncertain conditions. Combining Bayesian networks and evidence theory, the generated coding results are evaluated for confidence. The preliminary coding results that meet the coding confidence threshold (equivalent to the second confidence requirement) are output. The confidence threshold can also be dynamically adjusted according to actual application conditions. Finally, the preliminary coding results including standardized medical codes, corresponding confidence levels and possible alternative coding options are obtained.
[0042] After obtaining the preliminary coding result, execute step 104, including: obtaining the final coding result based on the preset verification model, the preset audit model and the preliminary coding result to complete the automatic coding of the electronic health record, including: performing a rule consistency check on the preliminary coding result based on the preset verification model; if the preliminary coding result meets the rule consistency check requirements, performing a coding anomaly check on the preliminary coding result; if the preliminary coding result meets the coding anomaly check requirements, performing a historical knowledge consistency check on the preliminary coding result in combination with the patient's historical electronic health record; if the preliminary coding result meets the historical knowledge consistency check requirements, obtaining a consistency check result; based on the preset audit model, independently auditing the preliminary coding result and saving the corresponding audit result to obtain a coding audit result; by setting corresponding weights for the consistency check result and the coding audit result, adjusting the weight ratio until the third confidence requirement is met, obtaining the final coding result to complete the automatic coding of the electronic health record.
[0043] By performing consistency checks, anomaly checks and historical knowledge consistency checks on the preliminary coding results, the coding results are guaranteed to be consistent with the multimodal data in the electronic health record. After the coding is reviewed by the review model, different weights are set for the consistency check results and the coding review results of the coding results. The weight ratio can be dynamically adjusted to resolve potential conflicts between the consistency check results and the coding review results until the weight ratio meets the confidence requirements, and the final coding result is generated to complete the automatic coding of the electronic health record. Therefore, under the premise of verifying and reviewing the coding results, the weight ratio of the consistency check results and the coding review results is adaptively adjusted to generate the final coding result. A specific implementation method is to use formal verification technology (such as model checking) through a preset verification model to verify whether the preliminary coding results comply with predefined coding rules and constraints (equivalent to rule consistency check requirements), and adopt unsupervised learning algorithms (such as isolation forests). Forest or local anomaly factor LOF), identify possible coding anomalies and perform statistics. If the abnormal rate of the coding result is less than the coding anomaly threshold (equivalent to the coding anomaly inspection requirement), the graph neural network technology (GNN) is used to analyze the consistency of the preliminary coding result with the patient's historical record and related medical knowledge. When the consistency of the preliminary coding result with the patient's historical record and related medical knowledge is in the range of 80% to 90% (equivalent to the historical knowledge consistency inspection requirement), finally, computer vision and natural language processing technology are combined to compare the consistency of the coding result with multimodal data such as the original imaging report. At this point, the verification of the preliminary coding result is completed and the consistency inspection result is obtained. After the preliminary coding verification is completed, the preset audit model is trained so that it can replace the manual auditor to review the preliminary coding. Taking into account the professional field, workload and historical performance of the preset audit model, the preset audit model is supported to conduct multiple independent audits on the same coding result. Integration of audit and opinions, using case-based reasoning (CBR) technology to assist decision-making of the preset audit model through similar historical cases and recommended decisions, and finally completing the audit of the preliminary coding results. After completing the verification and audit of the preliminary coding results, an adaptive weight algorithm is used to dynamically adjust the weights of each part of the results according to the consistency check results and the credibility of the coding audit results (equivalent to the third confidence requirement). Multi-criteria decision analysis methods (such as game theory and multi-criteria decision analysis MCDA) can be used to resolve potential conflicts between automatic verification and audit results, so as to generate the final coding results and complete the automatic coding of electronic health records. In order to ensure the accuracy of the final coding results, statistical methods (such as the Kappa coefficient) can also be used to evaluate the consistency between verification results from different sources. Then, the verification results from different sources are input into a probabilistic graphical model (such as Markov random field MRF) to optimize the final coding results by integrating various information.It's worth noting that during the generation of the final coding results, active learning strategies can be used to collect key feedback from the verification and review processes. Incremental learning algorithms can also be employed to continuously update the system's knowledge base and coding rules. Transfer learning techniques can be used to fine-tune the large language model using consistency check and coding review results. A / B testing and multi-armed bandit algorithms can also be implemented to continuously evaluate and optimize the performance of each system module. This allows feedback from the entire verification process to be collected, system knowledge to be updated, and the performance of the large language model to be optimized, forming a closed-loop improvement mechanism to enhance the accuracy of the coding results.
[0044] An embodiment of the present invention proposes an automatic encoding method for electronic health records, which divides the electronic health record text into several segments, fragments the complex text content to facilitate the subsequent acquisition of key health information, and then uses a large language model to extract key medical information from each standard text content, obtains structured key medical information from unstructured data, and then uses a preset encoding rule library to encode the structured key medical information to generate a corresponding preliminary encoding result. Finally, the preliminary encoding result is verified and audited by the verification mechanism of the preset verification model and the preset audit model to generate the final encoding result; finally, after obtaining the key medical information content of the text content of the electronic health record, the key information is encoded, and the encoding result is verified by the verification and audit mechanism, thereby improving the accuracy of the encoding result.
[0045] Based on the above introduction to the principle of automatic coding of electronic health records, see Figure 2 , Figure 2 This is a schematic diagram of the module structure of an electronic health record automatic coding system provided by an embodiment of the present invention. Figure 2 As shown, an embodiment of the present invention also proposes an automatic coding system for electronic health records, including: a text segmentation module 201, a data extraction module 202, a preliminary coding module 203 and a coding verification module 204; the text segmentation module 201 is used to segment the electronic health record text into several text fragments to obtain several unstructured text contents; the data extraction module 202 is used to obtain structured key medical information based on a preset large language model and several of the unstructured text contents; the preliminary coding module 203 is used to generate a preliminary coding result based on a preset coding rule library and the structured key medical information; the coding verification module 204 is used to obtain a final coding result based on a preset verification model, a preset audit model and the preliminary coding result to complete the automatic coding of the electronic health record.
[0046] As an example of this embodiment, the preliminary coding module 203 is used to generate a preliminary coding result based on a preset coding rule library and the structured key medical information, including: a semantic similarity calculation unit 301, a coding rule matching unit 302, a coding combination generation unit 303 and a coding combination screening unit 304; the semantic similarity calculation unit 301 is used to calculate the semantic similarity between the structured key medical information and the coding rules based on the preset coding rule library; the coding rule matching unit 302 is used to match the corresponding coding rules based on the semantic similarity; the coding combination generation unit 303 is used to generate multi-level coding from top to bottom based on the coding rules through a preset hierarchical classification algorithm, and generate several coding combination schemes; the coding combination screening unit 304 is used to make coding assumptions on several of the coding combination schemes, screen out coding combinations that meet the second confidence requirements, and obtain preliminary coding results.
[0047] An embodiment of the present invention proposes an automatic coding system for electronic health records. The text segmentation module divides the electronic health record text into several segments, fragmenting the complex text content to facilitate the subsequent acquisition of key health information. The data extraction module then uses a large language model to extract key medical information from each standard text content, and obtains structured key medical information from unstructured data. The preliminary coding module then uses a preset coding rule library to encode the structured key medical information to generate a corresponding preliminary coding result. Finally, the coding verification module uses a preset verification model and a preset audit model to verify and audit the preliminary coding result to generate a final coding result. Finally, after obtaining the key medical information content of the text content of the electronic health record, the key information is encoded, and the coding result is verified through the verification and audit mechanism, thereby improving the accuracy of the coding result.
[0048] In this embodiment, a user interface structure system is also proposed. The user interface structure system can be used to perform steps 101 to 104, and can also display, edit and export the final encoding results. For details, see Figure 3 , Figure 3 A schematic diagram of the module structure of a user interface structure system for an electronic health record automatic encoding method provided in one embodiment of the present invention, wherein the user interface structure system includes: an input module 401, a status display module 402, a result display module 403, an editing module 404, and an export module 405;
[0049] The input module 401 includes: a multimodal input interface 501, an intelligent form generator 502, a real-time error correction system 503, and a history record intelligent filler 504. Among them, the multimodal input interface 501 supports electronic health record input in multiple formats such as text, voice, and images, and adopts deep learning models such as convolutional neural networks (CNN) and recurrent neural networks (RNN) for feature extraction and conversion; the intelligent form generator 502 uses natural language processing technology to dynamically generate structured input forms based on input content, thereby improving the accuracy and efficiency of data entry; the real-time error correction system 503 uses a context-sensitive spelling check algorithm and a medical terminology library to perform real-time error correction and completion on user input; the history record intelligent filler 504 uses collaborative filtering and sequence prediction models to automatically fill in relevant fields based on historical input records;
[0050] Status display module 402 includes: real-time progress tracker 601, performance monitoring dashboard 602, anomaly alert system 603, and explainability display 604. Among them, real-time progress tracker 601 uses distributed tracing systems such as Jaeger or Zipkin to display the various stages and progress of the coding process in real time. Performance monitoring dashboard 602 uses time series databases such as InfluxDB and visualization tools such as Grafana to display the performance indicators of each module of the system. Anomaly alert system 603 uses rule-based and machine learning anomaly detection algorithms to promptly detect and display anomalies in the processing process. Explainability display 604 uses explainable AI technologies such as SHAP (SHapley Additive exPlanations) to display the key factors of coding decisions.
[0051] The result display module 403 includes: a multi-dimensional visualization engine 701, an interactive exploration interface 702, a similar case recommendation system 703, and an adaptive layout manager 704. The multi-dimensional visualization engine 701 combines data visualization libraries such as D3.js to intuitively display coding results in various forms such as charts and tree structures. The interactive exploration interface 702 uses a graph database query language such as Cypher to support users in-depth exploration and correlation analysis of coding results. The similar case recommendation system 703 uses a hybrid recommendation algorithm based on content and collaborative filtering to display historical coding results similar to the current case. The adaptive layout manager 704 uses responsive design and grid layout algorithms to automatically adjust the result display layout based on the user's device and preferences.
[0052] Editing module 404 includes: intelligent editing assistant 801, version control system 802, collaborative editing platform 803, and editing impact analyzer 804. Intelligent editing assistant 801 integrates a large language model to provide context-sensitive editing suggestions and auto-completion functions. Version control system 802 uses distributed version control technologies such as Git to track and manage the modification history of coding results. Collaborative editing platform 803 supports multi-user real-time collaborative editing based on operational transformation algorithms or conflict-free replication data types (CRDTs). Editing impact analyzer 804 uses a causal reasoning model to analyze the potential impact of editing operations on other related codes in real time.
[0053] The export module 405 includes: a multi-format conversion engine 901, a secure encryption system 902, a batch processing scheduler 903 and an intelligent report generator 904; among them, the multi-format conversion engine 901 supports converting the encoding results into standard medical data formats such as HL7 CDA and FHIR, using XSLT or customized conversion algorithms; the secure encryption system 902 adopts the Advanced Encryption Standard (AES) and homomorphic encryption technology to ensure the security and privacy protection of the exported data; the batch processing scheduler 903 uses a distributed task queue system such as Celery to efficiently process large-scale export requests; the intelligent report generator 904 is based on natural language generation (NLG) technology to automatically generate structured reports containing encoding result analysis.
[0054] In this embodiment, steps 101 to 104 of the above-mentioned method for automatic encoding of electronic health records are executed through the structural system of the above-mentioned user interface. A specific implementation example is as follows:
[0055] The hospital's cardiology department used one of the aforementioned automatic electronic health record coding methods to code the electronic health record of a 68-year-old patient who was admitted to the hospital with chest tightness and shortness of breath for 3 days, worsening over 12 hours. Examinations upon admission showed abnormal electrocardiograms, elevated troponin I, and a history of type 2 diabetes and hypertension.
[0056] First, step 101 is executed to receive the patient's 4,500-word electronic health record text, which records information such as admission records, examination reports, medication records, and treatment processes. The long text is segmented into 12 semantically complete segments, and 98 medical entities are identified from each semantically complete segment, including symptoms ("chest tightness", "shortness of breath"), examination results ("troponin I: 1.89 ng / ml↑", "ST segment depression"), and medications ("aspirin", "clopidogrel"). The medical abbreviations "DM" are converted to "diabetes mellitus" and "HTN" are converted to "hypertension". The numerical format is then unified to obtain unstructured text content. The entire execution process takes 0.4 seconds and has a standardized accuracy rate of 96.8%.
[0057] After obtaining the unstructured text, step 102 is executed to process the unstructured text using a large language model. Based on the Transformer architecture, a preliminary representation of the text is first generated. Then, professional terms such as "NSTEMI" are identified as "non-ST-segment elevation myocardial infarction." Key medical information is then identified, including the primary diagnosis (acute non-ST-segment elevation myocardial infarction), comorbidities (hypertension and type 2 diabetes), and treatment options (percutaneous coronary intervention and dual antiplatelet therapy). The system then establishes a correlation between symptoms and diseases. For example, the confidence level for the correlation between chest tightness and myocardial infarction is 0.93, resulting in structured key medical information. The entire execution process takes 1.2 seconds with an accuracy rate of 94.5%.
[0058] Before executing step 103, first obtain the latest ICD-10 coding rules from the coding rule library. Use the Neo4j graph database to store more than 50,000 coding rules and ensure that the rules used are the latest version. Ensure that relevant rules can be retrieved based on structured key medical information. In addition, ensure that the rule library is synchronized with international standards. For example, the last update was completed 3 days ago.
[0059] Ensure that the coding rule library has been updated to the latest version, and then proceed to step 103 to receive the structured key medical information and the relevant coding rules retrieved from the coding rule library. Calculate the semantic similarity between the structured key medical information and the coding rules, determine the best matching rule, and generate preliminary codes, such as I21.4 (acute non-ST-segment elevation myocardial infarction), I10 (essential hypertension), E11.9 (type 2 diabetes without complications), and Z95.5 (coronary angioplasty status). Then, evaluate the coding confidence. The confidence of I21.4 is 0.95, which exceeds the system-set high confidence threshold of 0.9 (equivalent to the second confidence requirement). The entire execution process takes 0.8 seconds.
[0060] Next, step 104 is executed to verify the preliminary coding results. A rule consistency check confirms that the coding complies with ICD-10 rules, that no significant anomalies are found statistically, and that the coding is consistent with the patient's clinical presentation. This completes the preliminary coding verification and the review process. Due to the high confidence level of the I21.4 code, the review model performs a rapid review and confirms the coding is correct within 30 seconds, completing the review process. Finally, the consistency check results and the coding review results are integrated to generate the final code. This case is recorded for subsequent model optimization. The entire execution process takes 35 seconds, significantly less than the average review time of 5 minutes using traditional methods.
[0061] After the final code is generated, the final code is visualized in a tree structure, including the main diagnosis I21.4 and its related codes, and combined with the report generation template, a standardized report that meets the hospital HIS system and medical insurance requirements is generated; the entire coding process from input to final result generation takes a total of about 3 minutes, while the traditional manual coding method takes about 40 minutes. The generated code accuracy rate is 97.8%, which is higher than the average accuracy rate of 85% of traditional manual coding. After applying the electronic health record automatic coding method and system proposed in an embodiment of the present invention, the coding efficiency is improved by about 13 times, the average annual coding cost is saved by about 4.2 million yuan, and the medical insurance reimbursement rejection rate is reduced by 76%.
[0062] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
[0063] In the description of this specification, the reference terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" mean that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials, or characteristics described may be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and integrate different embodiments or examples described in this specification, as well as features of different embodiments or examples, unless they are mutually inconsistent.
[0064] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, features specified as "first" or "second" may explicitly or implicitly include at least one of such features. In the description of this application, "plurality" means two or more, unless otherwise specifically defined.
Claims
1. A method for automatic encoding of electronic health records, characterized in that: include: Segmenting the electronic health record text into several text segments to obtain several unstructured text contents; Obtaining structured key medical information based on a preset large language model and the plurality of unstructured text contents; Generate preliminary coding results based on a preset coding rule library and the structured key medical information; Based on the preset verification model, the preset review model and the preliminary coding results, a final coding result is obtained to complete the automatic coding of the electronic health record.
2. The method for automatic encoding of electronic health records according to claim 1, wherein: The electronic health record text is segmented into a plurality of text segments to obtain a plurality of unstructured text contents, including: access to electronic health record texts; Determining initial segmentation positions of the electronic health record text based on a preset number of segmentation points; Based on a preset sliding window, traverse the initial segmentation position and perform semantic boundary recognition to obtain a final segmentation position; Segmenting the electronic health record text based on the final segmentation position to obtain a plurality of text segments; Based on a preset deep learning algorithm, feature annotation is performed on the plurality of text fragments, and the plurality of medically annotated text fragments are standardized to obtain a plurality of unstructured text contents.
3. The method for automatic encoding of electronic health records according to claim 2, wherein: The method includes performing feature annotation on the plurality of text segments based on a preset deep learning algorithm, and performing standardization on the plurality of medically annotated text segments to obtain a plurality of unstructured text contents, including: Extracting context features of the plurality of text segments based on a preset deep learning algorithm to obtain feature sequences of the plurality of text segments; Based on a preset entity data table, entity annotation is performed on the feature sequences of the plurality of text fragments, and entity sequences that meet preset requirements are extracted; Based on preset standard terminology data rules, the abbreviation vocabulary in the entity sequence is converted into a complete term, and the complete term is replaced with a standard term that meets the similarity requirement to obtain a standard term sequence; Based on preset standard format data rules, the words in the standard term sequence that do not meet the preset edit distance are corrected, and the corrected standard term sequence is converted into a standard format to obtain a plurality of unstructured text contents.
4. The method for automatic encoding of electronic health records according to claim 1, wherein: The method of obtaining structured key medical information based on the preset large language model and the plurality of unstructured text contents includes: Extracting key medical knowledge content from the unstructured text content based on a preset large language model; Verifying the semantic relationships between entities in key medical knowledge content of the unstructured text content based on a preset entity relationship diagram; Attention connections are constructed between the text fragments of the key medical knowledge content, and key medical information that meets the first confidence requirement is screened out to obtain structured key medical information.
5. The method for automatic encoding of electronic health records according to claim 1, wherein: The generating of preliminary coding results based on the preset coding rule base and the structured key medical information includes: Based on a preset coding rule library, calculating the semantic similarity between the structured key medical information and the coding rules; Based on the semantic similarity, matching corresponding encoding rules; Based on the coding rules, a preset hierarchical classification algorithm is used to generate multi-level coding from top to bottom, and several coding combination schemes are generated; Coding hypotheses are made for the plurality of coding combination schemes, and coding combinations that meet the second confidence requirement are screened out to obtain preliminary coding results.
6. The method for automatic encoding of electronic health records according to claim 5, wherein: The generating of preliminary coding results based on the preset coding rule base and the structured key medical information further includes: Acquire the coding rule data to be updated in real time, and convert the unstructured rule data of the coding rule data to be updated into structured rule data; Performing version control, conflict detection, and association analysis on the structured rule data to obtain mapping relationships between rules; Generate a coding rule index through the mapping relationship between the structured rule data and the rules; Storing the encoding rule index in the preset encoding rule library; Based on a preset coding rule library, the structured key medical information is encoded through the corresponding coding rule index to obtain a preliminary coding result.
7. The method for automatic encoding of electronic health records according to claim 1, wherein: The method of obtaining a final coding result based on a preset verification model, a preset review model, and the preliminary coding result to complete the automatic coding of the electronic health record includes: Based on the preset verification model, performing a rule consistency check on the preliminary encoding result; If the preliminary coding result meets the rule consistency check requirement, performing a coding anomaly check on the preliminary coding result; If the preliminary coding result meets the coding anomaly check requirements, performing a historical knowledge consistency check on the preliminary coding result in combination with the patient's historical electronic health record; If the preliminary coding result meets the historical knowledge consistency check requirement, obtaining a consistency check result; Based on the preset audit model and the consistency check result, the preliminary coding result is audited to obtain the final coding result to complete the automatic coding of the electronic health record.
8. The method for automatic encoding of electronic health records according to claim 7, wherein: The step of reviewing the preliminary coding result based on the preset review model and the consistency check result to obtain a final coding result to complete the automatic coding of the electronic health record includes: Based on a preset audit model, independently audit the preliminary coding results and save the corresponding audit results to obtain coding audit results; By setting corresponding weights for the consistency check result and the coding review result, and adjusting the weight ratio until the third confidence requirement is met, the final coding result is obtained to complete the automatic coding of the electronic health record.
9. An automatic coding system for electronic health records, characterized in that include: Text segmentation module, data extraction module, preliminary coding module and coding verification module; The text segmentation module is used to segment the electronic health record text into a plurality of text segments to obtain a plurality of unstructured text contents; The data extraction module is used to obtain structured key medical information based on a preset large language model and the plurality of unstructured text contents; The preliminary coding module is used to generate preliminary coding results based on a preset coding rule library and the structured key medical information; The coding verification module is used to obtain a final coding result based on a preset verification model, a preset review model and the preliminary coding result to complete the automatic coding of the electronic health record.
10. An electronic health record automatic coding system according to claim 9, characterized in that: The preliminary coding module is used to generate preliminary coding results based on a preset coding rule library and the structured key medical information, including: Semantic similarity calculation unit, coding rule matching unit, coding combination generation unit and coding combination screening unit; The semantic similarity calculation unit is used to calculate the semantic similarity between the structured key medical information and the coding rules based on a preset coding rule library; The encoding rule matching unit is used to match the corresponding encoding rule based on the semantic similarity; The coding combination generating unit is used to generate multi-level coding from top to bottom based on the coding rules through a preset hierarchical classification algorithm, and generate a plurality of coding combination schemes; The coding combination screening unit is used to make coding assumptions on a number of the coding combination schemes, screen out coding combinations that meet the second confidence requirement, and obtain a preliminary coding result.
Citation Information
Cited By
Cross-system data integration method and device based on reproductive medical data model
CN120748600A
Cross-system data integration method and device based on reproductive medical data model
CN120748600B
Method and device for determining hydropower engineering cost data code
CN121638169A
A method and device for determining the cost data coding of a hydroelectric project
CN121638169B