Electronic medical record automatic quality control system and method based on large language model
Through the electronic medical record automation quality control system based on large language models, combined with NLP and knowledge graph technology, the existing quality control methods are solved, and efficient and accurate quality control of electronic medical record is achieved.
Patent Information
- Application Number
- CN202510206662.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-03-25
AI Technical Summary
The existing electronic medical record quality control methods are inefficient, insufficient accuracy, and inconsistent rules implementation, making it difficult to meet the needs of modern medical care for efficient and precise quality control.
An electronic medical record automation quality control system based on large language models is adopted, combined with natural language processing (NLP), knowledge graph and deep learning technology, to achieve intelligent analysis of electronic medical records, automatic execution of quality control rules and efficient matching of ICD encoding.
It significantly improves the efficiency and accuracy of quality control, ensures the consistency and standardization of quality control results, and meets the needs of the development of modern medical informationization.
Smart Images

Figure CN119692879A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of medical information technology, and in particular relates to an electronic medical record automatic quality control system and method based on a large language model. Background Art
[0002] With the rapid development of medical information technology, Electronic Medical Records (EMR) has become an important tool for hospital management, clinical diagnosis and treatment, and medical data analysis. Especially under the Diagnosis-Related Groups (DRG) payment model, the integrity, accuracy, and standardization of medical record data have a significant impact on hospital performance and medical insurance payment.
[0003] Nowadays, the quality control of electronic medical records mostly relies on manual review or rule engine technology. However, these traditional quality control methods have the following major technical problems: low efficiency of manual review. In the process of hospital medical record management, quality control work is usually completed manually by medical record personnel. This process is not only time-consuming, but also inefficient, and it is difficult to meet the needs of large-scale medical data management and rapidly changing clinical needs. The implementation of quality control rules is inconsistent. The manual review process is easily affected by subjective factors. Different reviewers may make different judgments on the same medical record based on their personal experience, resulting in instability and inconsistency in quality control results.
[0004] In recent years, the rise of Large Language Model (LLM) has provided technical possibilities for intelligent quality control of electronic medical records. LLM combines natural language processing (NLP) and deep learning technology to efficiently parse complex medical texts, extract key semantic information and execute predefined rules. However, medical data has the characteristics of complex semantics, strong professionalism and data imbalance, and direct application of existing language models still faces challenges. Summary of the invention
[0005] The present invention aims to solve a number of difficult problems in medical record quality control by constructing an automated quality control system and method for electronic medical records based on a large language model, combining knowledge graphs and deep learning technologies, including: insufficient semantic understanding, the existing rule engine is difficult to accurately parse medical terms and complex sentence structures; low coding matching efficiency, traditional ICD coding matching relies on manual experience and is prone to omissions and errors; non-standard application of quality control rules, lack of unified standards in manual review, and difficulty in ensuring the accuracy and consistency of quality control results.
[0006] To achieve the above objectives, the present invention provides an automated quality control system and method for electronic medical records based on a large language model, which realizes intelligent analysis of electronic medical records, automatic execution of quality control rules and efficient matching of ICD codes by combining natural language processing (NLP), knowledge graphs and deep learning technology.
[0007] Among them, an electronic medical record automatic quality control system based on a large language model includes:
[0008] The data collection and preprocessing module is used to extract medical record data from the medical information system and perform preprocessing operations such as de-privacy, cleaning and word segmentation on the medical record data;
[0009] A semantic parsing module, connected to the data acquisition and preprocessing module, is used to perform deep semantic parsing of the medical text in the medical record data using a large language Transformer model to extract key diagnosis and operation information; and to perform semantic representation of medical terms by fine-tuning the pre-trained language model and combining a multi-layer attention mechanism;
[0010] A knowledge graph matching module, connected to the semantic parsing module, is used to construct a knowledge graph of ICD coding, and calculates the semantic similarity between the diagnostic terms in the electronic medical record and the International Classification of Diseases coding terms by using the semantic information about the medical terms of diseases and surgeries in the knowledge graph, and automatically matches the diagnostic terms in the electronic medical record with the International Classification of Diseases coding terminology standards by using the embedded vector technology;
[0011] A quality control rule engine module is connected to the knowledge graph matching module, and is used to automatically review the electronic medical records according to predefined quality control rules, formalize the quality control rules into executable logical expressions, and verify the integrity, logical consistency and standardization of the medical record data item by item in combination with the electronic medical record data, and generate quality control reports and improvement suggestions;
[0012] The visualization and result output module is connected to the quality control rule engine module, and is used to display quality control and coding results, output quality control reports, and support statistics and analysis of quality control data.
[0013] Preferably, the data collection and preprocessing module includes a privacy processing unit, a word segmentation processing unit, and a text cleaning unit;
[0014] The privacy processing unit is used to remove personal sensitive information using regular expressions and replace the patient identification with a meaningless ID code;
[0015] The word segmentation processing unit is used to divide the medical record text into word sequences using the Chinese word segmentation tool Jieba, and remove meaningless words by constructing a stop word list;
[0016] The text cleaning unit is used to process format errors and redundant information and unify field formats based on a text cleaning algorithm.
[0017] Preferably, the process of fine-tuning the pre-trained language model includes:
[0018] The loss function is divided into a traditional loss function and a correction term for medical record quality control, and a quality scoring function is defined (x), the quality scoring function (x) used to score the quality of medical record data;
[0019] The quality scoring function (x) The return value is [0, 1], which represents the quality of the data; (x) = 1 means the best quality, (x) = 0 means the worst quality;
[0020] Then the expression of the new loss function is:
[0021]
[0022] Among them, L is the final loss function; N is a positive integer, and λ is a hyperparameter that adjusts the strength of the quality control correction term, controlling the degree of influence of the quality correction; is a quality control correction item, which improves the performance of the overall model by reducing the impact of samples of poor quality; x1 represents data integrity; x2 represents data consistency; x3 represents diagnostic accuracy; x4 represents the rationality of the clinical pathway; y i Indicates that under condition x i The prediction results are as follows: represents the conditional probability parameter, (x) represents the probability density function;
[0023]
[0024] Where w1, w2, w3, w4 are the weight coefficients introduced for each evaluation item.
[0025] Preferably, in combination with a multi-layer attention mechanism, the process of semantically representing medical terms includes:
[0026] The input medical text is converted into a sequence representation after word segmentation:
[0027] , where xi represents the word after the i-th word segmentation;
[0028] Through the word embedding layer, the word x i Mapping to vector space:
[0029]
[0030] in, Represents the vector expression of word xi in word space;
[0031] Get the embedding matrix:
[0032]
[0033] The input embedding matrix E is linearly transformed to obtain query, key, and value vectors:
[0034] Q=EW Q , K=EW K , V=EW V ,
[0035] Where W Q , W K , W V is the learning parameter matrix;
[0036] Calculate the attention weights:
[0037]
[0038] Among them, d k is the dimension of the key vector, softmax ensures weight normalization, t represents matrix transpose, represents the quality control correction factor;
[0039] To capture different semantic relationships, the attention calculation is expanded to multiple heads:
[0040]
[0041] The calculation for each head is:
[0042]
[0043] To output the transformation matrix, multi-head attention is used to focus on multiple different contextual patterns in the text in parallel; The query vector representing the i-th attention represents a feature of the input data or the query information, which is used to decide which value vector is most relevant. The key vector representing the i-th attention represents the features of the input data and is used to compare with the query vector to calculate the similarity. Represents the value vector of the i-th attention. The value vector carries the actual information and is used as the final output after weight calculation.
[0044] When constructing the semantic embedding vector, the embedding representation of the output layer passes through a multi-layer Transformer encoder to obtain the context-dependent embedding representation of each word:
[0045]
[0046] in, Represents the semantic embedding of the i-th word in the current text context;
[0047] Task-specific embedding combines the needs of medical tasks and further processes the embedding vectors:
[0048] Extraction of key diagnostic terms:
[0049]
[0050] in, Represents each diagnostic term Embedding vector of ; DiagnosisTerms is a medical terminology list; Embedding vector representing the entire set of diagnostic terms; () represents the extraction function of the term;
[0051] Extraction of key terms for operations:
[0052]
[0053] in, Represents the extracted term variable.
[0054] Preferably, the formula for calculating the semantic similarity is:
[0055]
[0056] in, Obtained through diagnostic term embedding calculations; ICD encoding embedding vector for the knowledge graph; represents the norm operation, Represents the quality control correction factor.
[0057] Preferably, the knowledge graph matching module includes a graph construction unit, a term extraction unit, a similarity calculation unit, and an automatic matching unit;
[0058] The atlas construction unit is used to extract relevant disease, symptom and treatment plan information from the International Classification of Diseases coding terminology standard, and organize and store it in the form of an atlas;
[0059] The term extraction unit is used to extract diagnostic terms, surgical terms and other related medical terms from the electronic medical record data;
[0060] The similarity calculation unit is used to convert the terms into vectors using word embedding technology and calculate the semantic similarity between the medical record terms and the International Classification of Diseases coding terms;
[0061] The automatic matching unit is used to match the terms in the electronic medical record with the corresponding categories in the International Classification of Diseases coding terminology standard according to the semantic similarity, and automatically mark or suggest matching results.
[0062] Preferably, the quality control rules are constraints on the electronic medical record data, used to detect errors or anomalies in the data;
[0063] The process of formalizing the quality control rules into executable logical expressions and verifying the integrity, logical consistency and standardization of medical record data item by item in combination with electronic medical record data includes:
[0064] Formalizing the quality control rules into logical expressions or mathematical constraints;
[0065] Among them, the integrity rule is a mandatory check to ensure that the key fields are not empty:
[0066]
[0067] Logical consistency rules are used to verify whether the logical relationship between related fields is reasonable and to determine the logical relationship of the time sequence:
[0068]
[0069] in, is the date of admission, Indicates discharge date, rules ensure Earlier than ;
[0070] Standards rules are used to check whether data conforms to standard formats or encoding rules:
[0071]
[0072] Where c is the ICD code, is the sum of legal ICD codes, and the rule requires that c must be in the set;
[0073] Organizing the quality control rules into a logical tree structure;
[0074] Wherein, the logic tree includes a root node and child nodes;
[0075] The root node represents the quality control task type of integrity, logical consistency, and standardization;
[0076] The sub-nodes represent specific rule conditions.
[0077] Preferably, the process of generating quality control reports and improvement suggestions includes:
[0078] The failed rules are classified into error types, including missing errors with empty fields, logical errors with unreasonable field relationships, and specification errors with field values that do not meet standards:
[0079] Locate the fields that fail the rules and record the cause and location of the error;
[0080] Generates quality control reports including error type, location, and suggested corrective actions.
[0081] Preferably, the visualization and result output module includes a visualization display unit and a result output unit;
[0082] The visual display unit is used to display the error type, error distribution trend, error field and overall pass rate through graphics and data tables;
[0083] The result output unit is used to output the overall results, error distribution, and trend analysis results according to the quality control report module, and supports the export of reports in formats including CSV, PDF, and JSON; it is also used to dynamically display the results through Web front-end technology and update data charts in real time.
[0084] The present invention also provides an automated quality control method for electronic medical records based on a large language model, comprising:
[0085] Extract medical record data based on the medical information system, and perform pre-processing operations such as de-privacy, cleaning and word segmentation on the medical record data;
[0086] Using the large language Transformer model, the medical text in the medical record data is deeply semantically analyzed to extract key diagnosis and operation information; by fine-tuning the pre-trained language model and combining it with a multi-layer attention mechanism, the medical terms are semantically represented;
[0087] Constructing a knowledge graph of ICD coding, using the semantic information of medical terms about diseases and surgeries in the knowledge graph, using the embedding vector technology to calculate the semantic similarity between the diagnostic terms in the electronic medical record and the International Classification of Diseases coding terms, and automatically matching the diagnostic terms in the electronic medical record with the International Classification of Diseases coding terminology standards;
[0088] Automatically review the electronic medical records according to predefined quality control rules, formalize the quality control rules into executable logical expressions, and verify the integrity, logical consistency and standardization of the medical record data item by item in combination with the electronic medical record data, and generate quality control reports and improvement suggestions;
[0089] Visualize the quality control and coding results, output quality control reports, and support statistics and analysis of quality control data.
[0090] Compared with the prior art, the present invention has the following advantages and technical effects:
[0091] The electronic medical record automated quality control system and method based on a large language model provided by the present invention can improve the coding quality, realize intelligent analysis and standardized coding of medical record information, and ensure compliance with the requirements of medical insurance DRG payment. Reduce work intensity, reduce quality control workload and improve efficiency through automated tools. Support precision medicine and provide a high-quality medical record data foundation for hospital data management and clinical decision support systems.
[0092] The present invention promotes the intelligent, standardized and efficient development of hospital medical record management and medical quality control by combining medical information technology with intelligent algorithms, and provides a new solution for medical informatization construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0093] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0094] Figure 1 A schematic diagram of the system structure of an embodiment of the present invention;
[0095] Figure 2 This is a diagram of the overall quality control results of an embodiment of the present invention;
[0096] Figure 3 is a distribution diagram of error types in an embodiment of the present invention;
[0097] Figure 4 is an error trend analysis diagram of an embodiment of the present invention;
[0098] Figure 5 This is a heat map of error fields according to an embodiment of the present invention. DETAILED DESCRIPTION
[0099] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0100] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0101] The existing manual quality control methods are inefficient and easily affected by subjective factors, making it difficult to meet the needs of modern medicine for efficient and accurate quality control. In view of this, the purpose of the present invention is to provide an electronic medical record automated quality control system and method based on a large language model, aiming to combine natural language processing (NLP) and knowledge graph technology to achieve accurate semantic analysis of medical texts and solve the problem of insufficient text parsing capabilities in traditional methods. At the same time, it provides intelligent analysis and visualization solutions to support intelligent analysis and visualization of quality control results, help hospitals identify potential problems in data, optimize medical record management processes, and improve performance appraisal results, helping hospitals to comprehensively improve medical management efficiency.
[0102] like Figure 1-5 As shown, this embodiment provides an electronic medical record automated quality control system based on a large language model, including: a data acquisition and preprocessing module, a semantic parsing module, a knowledge graph matching module, a quality control rule engine module and a visualization and result output module. Each module is logically connected to achieve full process automation.
[0103] The data collection and preprocessing module is used to extract medical record data from the medical information system, including the medical record homepage, discharge records, medical records, etc., and perform preprocessing operations such as de-privacy, cleaning and word segmentation on the medical record data;
[0104] The semantic parsing module is connected to the data acquisition and preprocessing module. It uses the large language Transformer model to perform deep semantic parsing of medical text in medical record data and extract key diagnosis and operation information. It also performs semantic representation of medical terms by fine-tuning the pre-trained language model and combining it with a multi-layer attention mechanism.
[0105] The knowledge graph matching module is connected to the semantic parsing module and is used to construct the knowledge graph of ICD coding. Through the semantic information of diseases and surgical medical terms in the knowledge graph, the semantic similarity between the diagnostic terms in the electronic medical record and the International Classification of Diseases coding terms is calculated using the embedding vector technology, and the diagnostic terms in the electronic medical record are automatically matched with the International Classification of Diseases coding terminology standards.
[0106] The quality control rule engine module is connected to the knowledge graph matching module to automatically review the electronic medical records according to predefined quality control rules, formalize the quality control rules into executable logical expressions, and verify the integrity, logical consistency and standardization of the medical record data item by item in combination with the electronic medical record data, and generate quality control reports and improvement suggestions;
[0107] The visualization and result output module is connected to the quality control rule engine module to display quality control and coding results, output quality control reports, and support statistics and analysis of quality control data.
[0108] Furthermore, the data collection and preprocessing module includes a privacy processing unit, a word segmentation processing unit, and a text cleaning unit;
[0109] The privacy processing unit is used to remove personal sensitive information using regular expressions and replace the patient identifier with a meaningless ID code;
[0110] The word segmentation processing unit is used to divide the medical record text into word sequences using the Chinese word segmentation tool Jieba, and remove meaningless words by constructing a stop word list;
[0111] The text cleaning unit is used to process format errors and redundant information and unify field formats based on the text cleaning algorithm.
[0112] Furthermore, the semantic parsing module uses large language models (such as Transformer-based models) to perform deep semantic parsing of medical texts (such as medical records, diagnosis texts, etc.) to extract key diagnosis and operation information. By fine-tuning the pre-trained model and combining it with a multi-layer attention mechanism, accurate semantic representation of medical terms is achieved, providing high-quality embedding vectors (Word Embeddings) for subsequent quality control and matching tasks.
[0113] Specifically, the model chooses a pre-trained language model with a Transformer architecture (such as BERT or GPT) because of its excellent performance in natural language processing (NLP) tasks. BERT (Bidirectional Encoder Representations from Transformers) specializes in bidirectional context modeling, while GPT focuses on generation tasks.
[0114] Adapting pre-trained models to medical data:
[0115] Initialize model: load general BERT or GPT model parameters.
[0116] In order to adapt to the particularity of medical data and optimize model performance, the loss function is divided into traditional loss and correction items for medical record quality control. The following is the specific loss function construction process:
[0117] Traditional loss function:
[0118] The traditional loss function is generally the cross-entropy loss, which measures the difference between the model prediction and the true label.
[0119]
[0120] where y i For the correct label, Predict probabilities for the model.
[0121] When making quality control corrections, consider that quality control issues in medical data usually involve the following aspects:
[0122] Data integrity: whether the medical record data is missing, redundant or contains erroneous information.
[0123] Data consistency: Whether different data fields are consistent (e.g., patient age, diagnosis date, etc.).
[0124] Diagnostic accuracy: whether the model can correctly predict the diagnostic results and avoid misdiagnosis.
[0125] Rationality of clinical pathway: whether the treatment plan complies with the standard clinical pathway.
[0126] The process of fine-tuning a pre-trained language model includes:
[0127] The loss function is divided into a traditional loss function and a correction term for medical record quality control, and a quality scoring function is defined (x), quality scoring function (x) used to score the quality of medical record data;
[0128] The quality scoring function (x) The return value is [0, 1], which represents the quality of the data; (x) = 1 means the best quality, (x)=0 indicates the worst quality. In order to correct the loss function, this embodiment introduces a weight coefficient into the loss to impose a higher penalty on data with poor quality:
[0129] Then the expression of the new loss function is:
[0130]
[0131] Among them, L is the final loss function; N is a positive integer, and λ is a hyperparameter that adjusts the strength of the quality control correction term, controlling the degree of influence of the quality correction; is a quality control correction item, which improves the performance of the overall model by reducing the impact of samples of poor quality; x1 represents data integrity; x2 represents data consistency; x3 represents diagnostic accuracy; x4 represents the rationality of the clinical pathway; y i Indicates that under condition x i The prediction results are as follows: represents the conditional probability parameter, (x) represents the probability density function;
[0132] Data integrity explanation: In medical data, if there is a large amount of missing case data, it may lead to inaccurate predictions. For this reason, the quality control items increase the penalty for missing data and increase the priority for complete data.
[0133] Data consistency explanation: Is the patient's diagnosis and treatment information consistent, especially if there are multiple visits, whether there are information contradictions. If the data consistency is poor, the predictive performance of the model will be affected, so the correction term will increase the penalty for such data.
[0134] Diagnostic accuracy explanation: If the diagnostic information in the medical record is inaccurate or there is an obvious misdiagnosis, it may cause the model to learn the wrong pattern. After introducing the correction term, poor quality cases (such as misdiagnosis) will receive a larger loss value, so that the model will focus more on high-quality data.
[0135] Reasonable explanation of clinical pathways: Some treatment options may not meet the clinical pathway standards, so we hope that the model can penalize these unreasonable pathways during training to ensure that the predictions are more in line with clinical reality.
[0136] The quality evaluation function quality(x) has a value range in the interval [0, 1], and the independent variables include data integrity, data consistency, diagnostic accuracy and rationality of the clinical pathway. The quality function is constructed through the total probability formula.
[0137] Data completeness x1: We use the probability of missing data to represent it. Let P(complete) be the probability of data completeness, reflecting the probability that there is no missing information, redundancy or error in the data. Score x1=P(complete), x1∈[0,1], x1=1 means the data is complete, x1=0 means the data is severely missing or redundant.
[0138] Data consistency x2: The consistency probability between different fields indicates whether different data items (such as age, diagnosis date) are consistent. Let P(consistent) be the probability of data consistency, x2∈[0,1], x2=1 indicates consistent data, and x2=0 indicates inconsistent data.
[0139] Diagnostic accuracy x3: The accuracy of the model’s prediction of the diagnosis. Let P(accurate) be the probability of diagnostic accuracy, that is, the probability of a correct prediction. x3∈[0,1], x3=1 indicates an accurate diagnosis, and x3=0 indicates a misdiagnosis.
[0140] Clinical pathway rationality x4: The probability of whether the treatment plan conforms to the standard clinical pathway. Let P(path_valid) be the probability that the treatment plan conforms to the standard clinical pathway. x4∈[0,1], x4=1 means that the clinical pathway is reasonable, and x4=0 means that the pathway is unreasonable;
[0141] In order to consider the importance of different evaluation items, weight coefficients w1, w2, w3, and w4 are introduced for each evaluation item so that the contributions of these items in the comprehensive score are different;
[0142]
[0143] Where w1, w2, w3, w4 are the weight coefficients introduced for each evaluation item.
[0144] Weight adjustment: By adjusting w1, w2, w3, w4, you can ensure that important items (such as data consistency or diagnostic accuracy) have a greater impact on the final score.
[0145] Scoring range: The final quality score quality(x) value is still in the range of [0, 1], where quality(x) = 1 means that all data items perfectly meet the standards, and quality(x) = 0 means that all data items do not meet the standards.
[0146] Furthermore, combined with the multi-layer attention mechanism, the process of semantically representing medical terms includes:
[0147] The input medical text is converted into a sequence representation after word segmentation:
[0148] , where x i Represents the word after the i-th word segmentation;
[0149] Through the word embedding layer, the word x i Mapping to vector space:
[0150]
[0151] in, Represents x i The vector representation of a word in word space;
[0152] Get the embedding matrix:
[0153]
[0154] The multi-layer attention mechanism is the core of the Transformer model and is used to capture the global contextual relationships in the input text.
[0155] The input embedding matrix E is linearly transformed to obtain query, key, and value vectors:
[0156] Q=EWQ, K=EWK, V=EWV,
[0157] Where WQ, WK, WV are learning parameter matrices;
[0158] Calculate the attention weights:
[0159]
[0160] Among them, d k is the dimension of the key vector, softmax ensures weight normalization, t represents matrix transpose, represents the quality control correction factor;
[0161] To capture different semantic relationships, the attention calculation is expanded to multiple heads:
[0162]
[0163] The calculation for each head is:
[0164]
[0165] To output the transformation matrix, multi-head attention is used to focus on multiple different contextual patterns in the text in parallel; The query vector representing the i-th attention represents a feature of the input data or the query information, which is used to decide which value vector is most relevant. The key vector representing the i-th attention represents the features of the input data and is used to compare with the query vector to calculate the similarity. Represents the value vector of the i-th attention. The value vector carries the actual information and is used as the final output after weight calculation.
[0166] When constructing the semantic embedding vector, the embedding representation of the output layer passes through a multi-layer Transformer encoder to obtain the context-dependent embedding representation of each word:
[0167]
[0168]
[0169] Task-specific embedding combines the needs of medical tasks and further processes the embedding vectors:
[0170] Extraction of key diagnostic terms:
[0171]
[0172] in, Represents each diagnostic term Embedding vector of ; DiagnosisTerms is a medical terminology list; Embedding vector representing the entire set of diagnostic terms; () represents the extraction function of the term;
[0173] Extraction of key terms for operations:
[0174]
[0175] in, Represents the extracted term variable.
[0176] Furthermore, the formula for calculating semantic similarity is:
[0177]
[0178] in, Obtained through diagnostic term embedding calculations; ICD encoding embedding vector for the knowledge graph; represents the norm operation, Represents the quality control correction factor.
[0179] The pre-trained model fine-tuning utilizes large-scale medical corpus to adapt the general language model to specific fields, ensuring the model's ability to understand medical terminology and medical record texts; the multi-layer attention mechanism captures long-distance dependencies and complex semantic relationships in the text, and extracts important diagnostic and operational information implicit in the medical record text; the constructed semantic embedding vector realizes the standardization of medical terminology through mathematical expression, providing a unified and accurate representation for subsequent quality control and matching.
[0180] Furthermore, the knowledge graph matching module includes a graph construction unit, a term extraction unit, a similarity calculation unit, and an automatic matching unit;
[0181] The atlas construction unit is used to extract relevant disease, symptom and treatment plan information from the International Classification of Diseases coding terminology standard, and organize and store it in the form of an atlas;
[0182] The term extraction unit is used to extract diagnostic terms, surgical terms and other related medical terms from electronic medical record data;
[0183] The similarity calculation unit is used to convert terms into vectors using word embedding technology, such as Word2Vec, GloVe, or Transformer-based models, and calculate the semantic similarity between medical record terms and International Classification of Disease coding terms;
[0184] The automatic matching unit is used to match the terms in the electronic medical record with the corresponding categories in the International Classification of Disease Coding Terminology Standard based on semantic similarity, and automatically annotate or suggest matching results.
[0185] Furthermore, quality control rules are constraints on the electronic medical record data and are used to detect errors or anomalies in the data;
[0186] The rule categories include:
[0187] Data integrity check: Ensure that key fields are not empty (mandatory field check). For example: Check whether the fields such as "patient name" and "diagnosis information" on the first page of the medical record are filled in.
[0188] Logical consistency check: Verify whether the logical relationship between related fields is reasonable. For example: Check whether the "discharge date" is later than the "admission date".
[0189] Data standardization check: Check whether the data conforms to the standard format or coding rules. For example, whether the ICD code matches the legal code list.
[0190] The process of formalizing quality control rules into executable logical expressions and combining them with electronic medical record data to verify the integrity, logical consistency and standardization of medical record data item by item includes:
[0191] Formalize quality control rules into logical expressions or mathematical constraints;
[0192] Among them, the integrity rule is a mandatory check to ensure that the key fields are not empty:
[0193]
[0194] Logical consistency rules are used to verify whether the logical relationship between related fields is reasonable and to determine the logical relationship of the time sequence:
[0195]
[0196] in, is the date of admission, Indicates discharge date, rules ensure Earlier than ;
[0197] Standards rules are used to check whether data conforms to standard formats or encoding rules:
[0198]
[0199] Where c is the ICD code, is the sum of legal ICD codes, and the rule requires that c must be in the set;
[0200] To achieve efficient execution, quality control rules are organized into a logical tree structure;
[0201] Wherein, the logical tree includes a root node and child nodes;
[0202] The root node represents the quality control task type of integrity, logical consistency, and standardization;
[0203] Subnodes represent specific rule conditions.
[0204] Logical tree example:
[0205] Integrity Check
[0206] ├── Patient name cannot be empty
[0207] ├── Discharge date cannot be empty
[0208] Logical consistency check
[0209] ├── Discharge date > Admission date
[0210] ├── Medical Record Status = "Completed"
[0211] Compliance Check
[0212] └── ICD code∈ Legal code list
[0213] Furthermore, the process of generating quality control reports and improvement suggestions includes:
[0214] The failed rules are classified into error types, including missing errors with empty fields, logical errors with unreasonable field relationships, and specification errors with field values that do not meet standards:
[0215] Locate the fields that fail the rules and record the cause and location of the error;
[0216] Generates quality control reports including error type, location, and suggested corrective actions.
[0217] Furthermore, the visualization and result output module includes a visualization display unit and a result output unit;
[0218] The visual display unit is used to display error types, error distribution trends, error fields, and overall pass rates through graphics and data tables, helping users quickly identify problems and optimize the electronic medical record management process;
[0219] The result output unit is used to output the overall results, error distribution, and trend analysis results according to the quality control report module, and supports the export of reports in formats including CSV, PDF, and JSON. It is also used to dynamically display results through Web front-end technology and update data charts in real time.
[0220] The error type distribution shows the proportion of different error types using a pie chart or a stacked bar chart.
[0221] Error trend analysis uses a line graph to show error trends over time.
[0222] Heatmap Display Error Fields constructs a two-dimensional heatmap using fields and rules to show the frequency of errors.
[0223] Overall results: pass rate, error rate.
[0224] Error distribution: Error statistics by type, field, and rule.
[0225] Trend analysis: Error rate trends over time.
[0226] Data export supports report export in multiple formats:
[0227] CSV: Stores structured data for later analysis.
[0228] PDF: Generates a quality control report with both text and images for management personnel to review.
[0229] JSON: Provides data exchange between systems.
[0230] The present invention combines natural language processing (NLP), knowledge graphs and deep learning technologies, and is widely used in the fields of medical data quality control, disease coding, medical record management and clinical decision support, providing advanced technical support for the intelligent processing and management of medical information.
[0231] Through the implementation of the present invention, medical institutions can greatly improve the accuracy, efficiency and standardization of electronic medical record quality control, meet the needs of modern medical information development, promote the development of precision medicine and smart medicine, and lay a solid foundation for achieving more efficient and intelligent medical management.
[0232] Embodiment 2
[0233] Based on the same inventive concept, this embodiment also provides an automated quality control method for electronic medical records based on a large language model, comprising the following steps:
[0234] Extract medical record data based on the medical information system and perform pre-processing operations such as de-privacy, cleaning and word segmentation on the medical record data;
[0235] Using the large language Transformer model, we can perform deep semantic analysis on medical texts in medical record data and extract key diagnostic and operational information. We can also perform semantic representation of medical terms by fine-tuning the pre-trained language model and combining it with a multi-layer attention mechanism.
[0236] Construct a knowledge graph of ICD coding, and use the semantic information of medical terms about diseases and surgeries in the knowledge graph to calculate the semantic similarity between diagnostic terms in electronic medical records and ICD coding terms using embedded vector technology, and automatically match diagnostic terms in electronic medical records with ICD coding terminology standards;
[0237] Automatically review electronic medical records according to predefined quality control rules, formalize the quality control rules into executable logical expressions, and verify the integrity, logical consistency and standardization of medical record data item by item in combination with electronic medical record data, and generate quality control reports and improvement suggestions;
[0238] Visualize the quality control and coding results, output quality control reports, and support statistics and analysis of quality control data.
[0239] The electronic medical record automated quality control method based on a large language model provided in this embodiment has all the advantages of the electronic medical record automated quality control system based on a large language model provided in the first embodiment.
[0240] In view of the problems of low efficiency, insufficient accuracy, inconsistent rule execution, etc. in the quality control of electronic medical records, this invention proposes an electronic medical record automated quality control system and method based on a large language model. Through scientific technical solutions and implementation, this invention has achieved significant technical effects, which are specifically reflected in the following aspects:
[0241] (1) Quality control efficiency is greatly improved;
[0242] Through automated processing, the system can quickly complete the quality control of large-scale medical record data. Experiments on the inpatient case data of Sichuan Provincial People's Hospital from 2018 to 2022 showed that the system can process 50 medical records per second, and the average processing time for a single medical record is less than 2 seconds. Compared with the traditional manual review method (an average of 5-10 minutes per medical record), the quality control efficiency has increased by more than 150 times.
[0243] (2) Quality control accuracy is significantly improved;
[0244] This paper adopts large language model and knowledge graph matching technology to deeply analyze medical texts and accurately identify diagnostic information and logical errors in medical records. The evaluation results on the experimental data set are as follows:
[0245] Quality control accuracy: reached more than 95%, an increase of 15 percentage points compared to the traditional rule engine (about 80%). ICD code matching accuracy: reached 93%, significantly higher than the industry average (about 75%-80%).
[0246] (3) Enhanced consistency of quality control rules;
[0247] Based on the automated rule engine, the present invention solves the problem of inconsistent rule execution in manual review. The system ensures that all medical record quality control links are executed according to standards through a predefined rule logic tree, thus ensuring the stability and consistency of the review results.
[0248] (4) Seamless integration of coding and quality control;
[0249] This system deeply combines electronic medical record quality control with ICD coding matching, realizes the automation of the entire process, and avoids data loss and errors in manual intervention. In the experiment, the accuracy rate of the linkage processing of medical record quality control and coding reached more than 90%, which greatly reduced the rework caused by the separation of quality control and coding.
[0250] Scientific analysis and test results:
[0251] (1) Model evaluation results;
[0252] The model evaluation indicators on the real medical record dataset are as follows:
[0253] Accuracy: 95.2%
[0254] Recall: 91.8%
[0255] F1 score: 93.5%
[0256] (2) Quality control and coding performance test results;
[0257] Experimental environment: inpatient case data of Sichuan Provincial People's Hospital from 2018 to 2022, server configuration: Intel XeonE5-2670 dual processor, 32GB memory, NVIDIA Tesla V100 graphics card.
[0258] Single medical record processing time: 1.8 seconds;
[0259] Daily medical records processed: approximately 250,000;
[0260] System stability: continuous operation for 48 hours without failure;
[0261] (3) Visual feedback examples;
[0262] The quality control report generated by the system shows that the main problem categories in the medical records are clearly distributed (such as missing fields accounting for 35% and logical errors accounting for 25%), which helps managers quickly locate problem areas and improve decision-making efficiency.
[0263] Embodiment 3
[0264] This embodiment further discloses a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described in the first embodiment.
[0265] Embodiment 4
[0266] This embodiment further discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the first embodiment are implemented.
[0267] Embodiment 5
[0268] This embodiment also discloses a computer program product, including a computer program, which implements the steps of the method described in the first embodiment when executed by a processor.
[0269] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An automated quality control system for electronic medical records based on a large language model, characterized in that: include: The data collection and preprocessing module is used to extract medical record data from the medical information system and perform preprocessing operations such as de-privacy, cleaning and word segmentation on the medical record data; A semantic parsing module, connected to the data acquisition and preprocessing module, is used to perform deep semantic parsing of the medical text in the medical record data using a large language Transformer model to extract key diagnosis and operation information; and to perform semantic representation of medical terms by fine-tuning the pre-trained language model and combining a multi-layer attention mechanism; A knowledge graph matching module, connected to the semantic parsing module, is used to construct a knowledge graph of ICD coding, and calculates the semantic similarity between the diagnostic terms in the electronic medical record and the International Classification of Diseases coding terms by using the semantic information about the medical terms of diseases and surgeries in the knowledge graph, and automatically matches the diagnostic terms in the electronic medical record with the International Classification of Diseases coding terminology standards by using the embedded vector technology; A quality control rule engine module is connected to the knowledge graph matching module, and is used to automatically review the electronic medical records according to predefined quality control rules, formalize the quality control rules into executable logical expressions, and verify the integrity, logical consistency and standardization of the medical record data item by item in combination with the electronic medical record data, and generate quality control reports and improvement suggestions; The visualization and result output module is connected to the quality control rule engine module, and is used to display quality control and coding results, output quality control reports, and support statistics and analysis of quality control data.
2. The system according to claim 1, characterized in that The data collection and preprocessing module includes a privacy processing unit, a word segmentation processing unit, and a text cleaning unit; The privacy processing unit is used to remove personal sensitive information using regular expressions and replace the patient identification with a meaningless ID code; The word segmentation processing unit is used to divide the medical record text into word sequences using the Chinese word segmentation tool Jieba, and remove meaningless words by constructing a stop word list; The text cleaning unit is used to process format errors and redundant information and unify field formats based on a text cleaning algorithm.
3. The system according to claim 1, characterized in that The process of fine-tuning the pre-trained language model includes: The loss function is divided into a traditional loss function and a correction term for medical record quality control, and a quality scoring function is defined (x), the quality scoring function (x) used to score the quality of medical record data; The quality scoring function (x) The return value is [0, 1], which represents the quality of the data; (x) = 1 means the best quality, (x) = 0 means the worst quality; Then the expression of the new loss function is: Among them, L is the final loss function; N is a positive integer, and λ is a hyperparameter that adjusts the strength of the quality control correction term, controlling the degree of influence of the quality correction; is a quality control correction item, which improves the performance of the overall model by reducing the impact of samples of poor quality; x1 represents data integrity; x2 represents data consistency; x3 represents diagnostic accuracy; x4 represents the rationality of the clinical pathway; y i Indicates that under condition x i The prediction results are as follows: represents the conditional probability parameter, (x) represents the probability density function; Where w1, w2, w3, w4 are the weight coefficients introduced for each evaluation item.
4. The system according to claim 1, characterized in that Combined with the multi-layer attention mechanism, the process of semantically representing medical terms includes: The input medical text is converted into a sequence representation after word segmentation: , where x i Represents the word after the i-th word segmentation; Through the word embedding layer, the word x i Mapping to vector space: in, Represents x i The vector representation of a word in word space; Get the embedding matrix: The input embedding matrix E is linearly transformed to obtain query, key, and value vectors: Q=HE Q , K=EW K , V=EW V , Where W Q , W K , W V is the learning parameter matrix; Calculate the attention weights: Among them, d k is the dimension of the key vector, softmax ensures weight normalization, t represents matrix transpose, represents the quality control correction factor; To capture different semantic relationships, the attention calculation is expanded to multiple heads: The calculation for each head is: To output the transformation matrix, multi-head attention is used to focus on multiple different contextual patterns in the text in parallel; The query vector representing the i-th attention represents a feature of the input data or the query information, which is used to decide which value vector is most relevant. The key vector representing the i-th attention represents the features of the input data and is used to compare with the query vector to calculate the similarity. Represents the value vector of the i-th attention. The value vector carries the actual information and is used as the final output after weight calculation. When constructing the semantic embedding vector, the embedding representation of the output layer passes through a multi-layer Transformer encoder to obtain the context-dependent embedding representation of each word: in, Represents the semantic embedding of the i-th word in the current text context; Task-specific embedding combines the needs of medical tasks and further processes the embedding vectors: Extraction of key diagnostic terms: in, Represents each diagnostic term Embedding vector of ; DiagnosisTerms is a medical terminology list; Embedding vector representing the entire set of diagnostic terms; () represents the extraction function of the term; Extraction of key terms for operations: in, Represents the extracted term variable.
5. The system according to claim 1, characterized in that The formula for calculating the semantic similarity is: in, Obtained through diagnostic term embedding calculations; ICD encoding embedding vector for the knowledge graph; represents the norm operation, Represents the quality control correction factor.
6. The system according to claim 1, characterized in that The knowledge graph matching module includes a graph construction unit, a term extraction unit, a similarity calculation unit, and an automatic matching unit; The atlas construction unit is used to extract relevant disease, symptom and treatment plan information from the International Classification of Diseases coding terminology standard, and organize and store it in the form of an atlas; The term extraction unit is used to extract diagnostic terms, surgical terms and other related medical terms from the electronic medical record data; The similarity calculation unit is used to convert the terms into vectors using word embedding technology and calculate the semantic similarity between the medical record terms and the International Classification of Diseases coding terms; The automatic matching unit is used to match the terms in the electronic medical record with the corresponding categories in the International Classification of Diseases coding terminology standard according to the semantic similarity, and automatically mark or suggest matching results.
7. The system according to claim 1, characterized in that The quality control rules are constraints on electronic medical record data and are used to detect errors or anomalies in the data; The process of formalizing the quality control rules into executable logical expressions and verifying the integrity, logical consistency and standardization of medical record data item by item in combination with electronic medical record data includes: Formalizing the quality control rules into logical expressions or mathematical constraints; Among them, the integrity rule is a mandatory check to ensure that the key fields are not empty: Logical consistency rules are used to verify whether the logical relationship between related fields is reasonable and to determine the logical relationship of the time sequence: in, is the date of admission, Indicates discharge date, rules ensure Earlier than ; Standards rules are used to check whether data conforms to standard formats or encoding rules: Where c is the ICD code, is the sum of legal ICD codes, and the rule requires that c must be in the set; Organizing the quality control rules into a logical tree structure; Wherein, the logic tree includes a root node and child nodes; The root node represents the quality control task type of integrity, logical consistency, and standardization; The sub-nodes represent specific rule conditions.
8. The system according to claim 1, characterized in that The process of generating quality control reports and improvement suggestions includes: The failed rules are classified into error types, including missing errors with empty fields, logical errors with unreasonable field relationships, and specification errors with field values that do not meet standards: Locate the fields that fail the rules and record the cause and location of the error; Generates quality control reports including error type, location, and suggested corrective actions.
9. The system according to claim 1, characterized in that The visualization and result output module includes a visualization display unit and a result output unit; The visual display unit is used to display the error type, error distribution trend, error field and overall pass rate through graphics and data tables; The result output unit is used to output the overall results, error distribution, and trend analysis results according to the quality control report module, and supports the export of reports in formats including CSV, PDF, and JSON; it is also used to dynamically display the results through Web front-end technology and update data charts in real time.
10. An automated quality control method for electronic medical records based on a large language model, characterized in that: include: Extract medical record data based on the medical information system, and perform pre-processing operations such as de-privacy, cleaning and word segmentation on the medical record data; Using the large language Transformer model, the medical text in the medical record data is deeply semantically analyzed to extract key diagnosis and operation information; by fine-tuning the pre-trained language model and combining it with a multi-layer attention mechanism, the medical terms are semantically represented; Constructing a knowledge graph of ICD coding, using the semantic information of medical terms about diseases and surgeries in the knowledge graph, using the embedding vector technology to calculate the semantic similarity between the diagnostic terms in the electronic medical record and the International Classification of Diseases coding terms, and automatically matching the diagnostic terms in the electronic medical record with the International Classification of Diseases coding terminology standards; Automatically review the electronic medical records according to predefined quality control rules, formalize the quality control rules into executable logical expressions, and verify the integrity, logical consistency and standardization of the medical record data item by item in combination with the electronic medical record data, and generate quality control reports and improvement suggestions; Visualize the quality control and coding results, output quality control reports, and support statistics and analysis of quality control data.
Citation Information
Patent Citations
Hospital medical record writing quality control system and method thereof
CN106372455A
Artificial intelligence auditing quality control mode and system based on medical insurance disease category payment system ICD coding
CN112992366A
ICD coding prediction method based on knowledge subgraph fusion
CN116705221A
Medical text automatic ICD coding method and system based on graph attention
CN117594246A
Automatic ICD coding method and system based on fusion of various label information
CN119323209A
Cited By
Construction method of composite trauma medical record intelligent quality control system
CN120088806A
A method for constructing a composite intelligent quality control system for trauma medical records
CN120088806B
Eye vision light diagnosis and treatment service platform based on cloud computing and service method thereof
CN120565088A
Personalized medical document oriented large language model agent construction method and system
CN121096508A
Method and system for constructing large language model agent for personalized medical document
CN121096508B