A quality inspection method, device, storage medium and equipment for electronic medical records

By comparing the model built by the learning framework, identifying the feature vectors of each clause in the electronic medical record, combining the predictive model and the real diagnosis results to match, the accuracy of the existing quality inspection methods is solved and more efficient electronic medical record quality inspection is achieved.

CN114238558BActive Publication Date: 2025-08-05BEIJING HUIJI ZHIYI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111342558.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-12
Publication Date
2025-08-05
Estimated Expiration
2041-11-12

AI Technical Summary

Technical Problem

The existing electronic medical record quality inspection methods have problems such as poor scalability, low accuracy of subcategorized diseases, slow calculation speed and low disease prediction performance, resulting in inaccurate quality inspection results.

Method used

The model is constructed using a comparative learning framework, and the feature vectors of each clause in the target electronic medical record are identified, and the diagnostic result prediction model is used to predict the target diagnostic results that meet the preset preliminary selection conditions, and match them with the real diagnostic results to perform quality inspection.

Benefits of technology

It improves the accuracy of the quality inspection results of electronic medical records, can more accurately reflect the patient's actual condition, and reduces the risk of diagnosis and treatment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114238558B_ABST
    Figure CN114238558B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, storage medium, and device for quality inspection of electronic medical records. The method comprises: first, obtaining a target electronic medical record to be quality inspected, then inputting the target electronic medical record into a pre-constructed contrastive learning model to identify and obtain a feature vector corresponding to each clause in the target electronic medical record; wherein the contrastive learning model is trained using a contrastive learning framework based on relevant and irrelevant sentence pairs; then, inputting the feature vector corresponding to each clause into a pre-constructed diagnosis result prediction model to predict a target diagnosis result that meets preset preliminary selection conditions, and then matching the predicted result with the actual diagnosis result to perform quality inspection on the target electronic medical record based on the matching result. Thus, the more contrastive and discriminative feature vector corresponding to each clause in the target electronic medical record identified by the pre-constructed contrastive learning model can be used to obtain a more accurate predicted diagnosis result and quality inspection result of the electronic medical record.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent medical technology, and in particular to a quality inspection method, apparatus, storage medium and equipment for electronic medical records. Background Art

[0002] With the rapid development of information technology, electronic medical record systems have become increasingly common in hospitals at all levels. Compared to traditional paper-based medical records, electronic medical records are more convenient to write and more flexible to access, helping to improve medical staff's work efficiency. However, electronic medical records can also suffer from poor quality. For example, improper diagnoses due to physician errors can lead to a decline in the quality of electronic medical records, making them unable to accurately reflect the patient's actual condition and posing significant risks in diagnosis and treatment. Therefore, to improve the quality of electronic medical records and reduce these risks, timely and accurate quality inspection of electronic medical records is necessary.

[0003] At present, there are usually two quality inspection methods for electronic medical records: one is to follow the idea of classification, automatically predict the diagnosis based on the classification framework or automatically predict the diagnosis based on the pre-training framework, and perform quality inspection on the electronic medical records based on the diagnosis results. However, this method has disadvantages such as poor scalability, low accuracy of sub-classification of diseases, and slow calculation speed; the other commonly used quality inspection method is to automatically predict the diagnosis based on similarity calculation, and perform quality inspection on the electronic medical records based on the diagnosis results. Although this method overcomes the three main problems in the aforementioned classification method, it brings a new problem: low performance, that is, the prediction performance of disease diagnosis results is poor, and it cannot reflect the quality of electronic medical records in a timely and accurate manner, which in turn leads to inaccurate quality inspection results of electronic medical records. Summary of the Invention

[0004] The main purpose of the embodiments of the present application is to provide a method, apparatus, storage medium and equipment for quality inspection of electronic medical records, which can improve the accuracy of the quality inspection results of electronic medical records.

[0005] The present invention provides a method for quality inspection of electronic medical records, including:

[0006] Obtain the target electronic medical records for quality inspection;

[0007] Inputting the target electronic medical record into a pre-built contrastive learning model to identify and obtain a feature vector corresponding to each clause in the target electronic medical record; the contrastive learning model is trained using a contrastive learning framework based on relevant sentence pairs and irrelevant sentence pairs;

[0008] Inputting the feature vector corresponding to each clause in the target electronic medical record into a pre-built diagnosis result prediction model to predict a target diagnosis result corresponding to the target electronic medical record that meets the preset preliminary selection conditions;

[0009] The actual diagnosis result in the target electronic medical record is matched with the target predicted diagnosis result, and based on the matching result, the target electronic medical record is quality-checked to obtain the quality-check result of the target electronic medical record.

[0010] In one possible implementation, the contrastive learning model is constructed as follows:

[0011] Constructing sample sentence pairs, wherein the sample sentence pairs include sample related sentence pairs and sample non-related sentence pairs;

[0012] Inputting the sample sentence pair into an initial contrastive learning model, training the contrastive learning model by adjusting the first objective function, and outputting a sample feature vector corresponding to each clause in the sample sentence pair;

[0013] The first objective function is used to increase the similarity between sample feature vectors corresponding to each clause in sample related sentence pairs, and to reduce the similarity between sample feature vectors corresponding to each clause in sample unrelated sentence pairs.

[0014] In one possible implementation, constructing a sample sentence pair includes:

[0015] Obtain sample electronic medical records;

[0016] Using preset delimiters, split the clause contents corresponding to the chief complaint and present medical history fields in the sample electronic medical record into individual short sentences;

[0017] Extracting entities from each of the short sentences, and determining whether the type similarity and content similarity between the entities contained in each two clauses meet a preset threshold;

[0018] If so, the corresponding two clauses constitute a sample related sentence pair; if not, the corresponding two clauses constitute a sample non-related sentence pair, and the sample related sentence pair and the sample non-related sentence pair are used to constitute a sample sentence pair.

[0019] In a possible implementation, the method further includes:

[0020] Constructing test sentence pairs, wherein the test sentence pairs include test-related sentence pairs and test-irrelevant sentence pairs;

[0021] Scoring the test sentence pairs, and classifying all the test sentence pairs into test sentence pairs of preset levels according to the scoring results;

[0022] The contrastive learning model is tested using the test sentence pairs of the preset level, and parameters of the contrastive learning model are updated according to the test results.

[0023] In one possible implementation, inputting the feature vector corresponding to each clause in the target electronic medical record into a pre-built diagnosis result prediction model to predict a target diagnosis result corresponding to the target electronic medical record that meets preset preliminary selection conditions includes:

[0024] After inputting the feature vector corresponding to each clause in the target electronic medical record into a pre-built diagnosis result prediction model, preprocessing the feature vector corresponding to each clause in the target electronic medical record and the feature variables corresponding to each clause in each candidate electronic medical record so that the number of clauses contained in the target electronic medical record after preprocessing is the same as the number of clauses contained in each candidate electronic medical record;

[0025] Calculating the weight of each clause in the preprocessed target electronic medical record, and calculating the overall feature vector of the preprocessed target electronic medical record by weighted multiplication;

[0026] Calculating the weight of each clause in the pre-processed candidate electronic medical record, and calculating the overall feature vector of each pre-processed candidate electronic medical record by weighted multiplication;

[0027] Calculating the similarity between the preprocessed overall feature vector of the target electronic medical record and the preprocessed overall feature vector of each candidate electronic medical record;

[0028] The candidate electronic medical records whose similarity meets a preset threshold are taken as similar medical records, and the diagnosis results in the similar medical records that meet a preset preliminary selection condition are taken as target diagnosis results.

[0029] In one possible implementation, preprocessing the feature vector corresponding to each clause in the target electronic medical record and the feature variables corresponding to each clause in each candidate electronic medical record so that the number of clauses contained in the preprocessed target electronic medical record is the same as the number of clauses contained in each candidate electronic medical record includes:

[0030] The number of clauses in the target electronic medical record and each candidate electronic medical record is standardized to N; the clauses that are less than N are padded with random vectors, and the clauses that exceed N are deleted; so that the number of clauses contained in the preprocessed target electronic medical record is the same as the number of clauses contained in each candidate electronic medical record; N is a positive integer greater than 0.

[0031] In one possible implementation, calculating the weight of each clause in the preprocessed target electronic medical record and calculating the overall feature vector of the preprocessed target electronic medical record using weighted multiplication includes:

[0032] Using two fully connected layers to perform dimensionality reduction processing on the feature vector corresponding to each clause in the preprocessed target electronic medical record to obtain a one-dimensional scalar corresponding to each clause, and using the one-dimensional scalar as the weight of the corresponding clause;

[0033] The weight corresponding to each clause in the target electronic medical record is weighted and multiplied by the feature vector corresponding to each clause to obtain the overall feature vector corresponding to the target electronic medical record.

[0034] In one possible implementation, after predicting and obtaining a target diagnosis result corresponding to the target electronic medical record that meets a preset preliminary selection condition, the method further includes:

[0035] All the target diagnosis results are verified using preset standard dimension values, and based on the verification results, the target diagnosis results that match the actual diagnosis results in the target electronic medical record are screened out.

[0036] In one possible implementation, the diagnosis result prediction model is trained using a second objective function, and the second objective function is used to improve the similarity between the target diagnosis result and the actual diagnosis result in the target electronic medical record.

[0037] The present application also provides an electronic medical record quality inspection device, including:

[0038] An acquisition unit, used to acquire target electronic medical records to be inspected;

[0039] an identification unit, configured to input the target electronic medical record into a pre-built contrastive learning model to identify and obtain a feature vector corresponding to each clause in the target electronic medical record; the contrastive learning model is trained using a contrastive learning framework based on relevant sentence pairs and irrelevant sentence pairs;

[0040] A prediction unit, configured to input the feature vector corresponding to each clause in the target electronic medical record into a pre-built diagnosis result prediction model, and predict a target diagnosis result corresponding to the target electronic medical record that meets a preset preliminary selection condition;

[0041] The quality inspection unit is used to match the actual diagnosis result in the target electronic medical record with the target predicted diagnosis result, and perform quality inspection on the target electronic medical record based on the matching result to obtain the quality inspection result of the target electronic medical record.

[0042] In a possible implementation, the apparatus further includes:

[0043] A first construction unit is configured to construct sample sentence pairs, wherein the sample sentence pairs include sample related sentence pairs and sample unrelated sentence pairs;

[0044] a training unit, configured to input the sample sentence pair into an initial contrastive learning model, train the contrastive learning model by adjusting a first objective function, and output a sample feature vector corresponding to each clause in the sample sentence pair;

[0045] The first objective function is used to increase the similarity between sample feature vectors corresponding to each clause in sample related sentence pairs, and to reduce the similarity between sample feature vectors corresponding to each clause in sample unrelated sentence pairs.

[0046] In a possible implementation, the first construction unit includes:

[0047] an acquisition subunit for acquiring sample electronic medical records;

[0048] A splitting subunit is used to split the clause contents corresponding to the chief complaint and current medical history fields in the sample electronic medical record into individual short sentences using a preset delimiter;

[0049] An extraction subunit, configured to extract entities from each of the short sentences and determine whether the type similarity and content similarity between the entities contained in each two clauses meet a preset threshold;

[0050] The sub-unit is used to form a sample related sentence pair with the corresponding two clauses if it is determined that the type similarity and content similarity between the entities contained in each two clauses meet the preset threshold; if it is determined that the type similarity and content similarity between the entities contained in each two clauses do not meet the preset threshold, the corresponding two clauses are formed into a sample non-related sentence pair, and the sample related sentence pair and the sample non-related sentence pair are used to form a sample sentence pair.

[0051] In a possible implementation, the apparatus further includes:

[0052] A second construction unit is used to construct a test sentence pair, wherein the test sentence pair includes a test-related sentence pair and a test-irrelevant sentence pair;

[0053] a classification unit, configured to score the test sentence pairs and classify all the test sentence pairs into test sentence pairs of preset levels according to the scoring results;

[0054] The testing unit is used to test the contrastive learning model using the test sentence pairs of the preset level, and update the parameters of the contrastive learning model according to the test results.

[0055] In a possible implementation, the prediction unit includes:

[0056] a preprocessing subunit, configured to input the feature vector corresponding to each clause in the target electronic medical record into a pre-built diagnosis result prediction model, and then preprocess the feature vector corresponding to each clause in the target electronic medical record and the feature variables corresponding to each clause in each candidate electronic medical record, so that the number of clauses contained in the target electronic medical record after preprocessing is the same as the number of clauses contained in each candidate electronic medical record;

[0057] a first calculation subunit, configured to calculate the weight of each clause in the preprocessed target electronic medical record, and calculate an overall feature vector of the preprocessed target electronic medical record by using weighted multiplication;

[0058] a second calculation subunit, configured to calculate the weight of each clause in the pre-processed candidate electronic medical record, and calculate an overall feature vector of each pre-processed candidate electronic medical record by using weighted multiplication;

[0059] a third calculation subunit, configured to calculate the similarity between the preprocessed overall feature vector of the target electronic medical record and the preprocessed overall feature vector of each candidate electronic medical record;

[0060] The determination subunit is configured to take the candidate electronic medical records whose similarity meets a preset threshold as similar medical records, and take the diagnosis results in the similar medical records that meet a preset preliminary selection condition as target diagnosis results.

[0061] In a possible implementation, the preprocessing subunit is specifically configured to:

[0062] The number of clauses in the target electronic medical record and each candidate electronic medical record is standardized to N; the clauses that are less than N are padded with random vectors, and the clauses that exceed N are deleted; so that the number of clauses contained in the preprocessed target electronic medical record is the same as the number of clauses contained in each candidate electronic medical record; N is a positive integer greater than 0.

[0063] In a possible implementation, the first computing subunit includes:

[0064] a dimensionality reduction subunit, configured to perform dimensionality reduction processing on the feature vector corresponding to each clause in the preprocessed target electronic medical record using two fully connected layers to obtain a one-dimensional scalar corresponding to each clause, and use the one-dimensional scalar as the weight of the corresponding clause;

[0065] The obtaining subunit is used to perform weighted multiplication on the weight corresponding to each clause in the target electronic medical record and the feature vector corresponding to each clause to obtain the overall feature vector corresponding to the target electronic medical record.

[0066] In a possible implementation, the apparatus further includes:

[0067] The verification unit is used to verify all the target diagnosis results corresponding to the target electronic medical record and meeting the preset preliminary selection conditions using the preset standard dimension value, and screen out the target diagnosis results that match the actual diagnosis results in the target electronic medical record based on the verification results.

[0068] In one possible implementation, the diagnosis result prediction model is trained using a second objective function, and the second objective function is used to improve the similarity between the target diagnosis result and the actual diagnosis result in the target electronic medical record.

[0069] The embodiment of the present application also provides a quality inspection device for electronic medical records, including: a processor, a memory, and a system bus;

[0070] The processor and the memory are connected via the system bus;

[0071] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes any one of the implementation methods of the above-mentioned electronic medical record quality inspection method.

[0072] An embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a terminal device, the terminal device executes any one of the implementation methods of the above-mentioned electronic medical record quality inspection method.

[0073] An embodiment of the present application further provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute any one of the above-mentioned methods for quality inspection of electronic medical records.

[0074] The embodiments of the present application provide a method, apparatus, storage medium and device for quality inspection of electronic medical records, which first obtain a target electronic medical record to be quality inspected, and then input the target electronic medical record into a pre-constructed contrastive learning model to identify and obtain a feature vector corresponding to each clause in the target electronic medical record; wherein the contrastive learning model is trained using a contrastive learning framework based on relevant sentence pairs and non-relevant sentence pairs; then, the feature vector corresponding to each clause in the target electronic medical record is input into a pre-constructed diagnosis result prediction model to predict a target diagnosis result corresponding to the target electronic medical record that meets preset preliminary selection conditions, and then the actual diagnosis result in the target electronic medical record can be matched with the target predicted diagnosis result, and based on the matching result, the target electronic medical record can be quality inspected to obtain the quality inspection result of the target electronic medical record. It can be seen that since the embodiment of the present application uses a pre-built contrastive learning model to identify more contrastive and discriminative feature vectors corresponding to each clause in the target electronic medical record, which is used to predict subsequent diagnostic results, it is possible to obtain more accurate predicted diagnostic results. After matching the predicted diagnostic results with the actual diagnostic results in the target electronic medical record, the electronic medical record can be quality-checked more accurately based on the matching results, thereby improving the accuracy of the electronic medical record quality inspection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0076] Figure 1 A flowchart of a quality inspection method for electronic medical records provided in an embodiment of the present application;

[0077] Figure 2 An example diagram of constructing sample sentence pairs provided in an embodiment of the present application;

[0078] Figure 3 A schematic diagram of a process for calculating the similarity between a target electronic medical record and a candidate electronic medical record according to an embodiment of the present application;

[0079] Figure 4 An example diagram of quality inspection of electronic medical records provided in an embodiment of the present application;

[0080] Figure 5 A schematic diagram of the composition of an electronic medical record quality inspection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0081] With the rapid development of information technology, electronic medical record systems have become increasingly common in hospitals at all levels. Electronic Medical Records (EMRs), also known as computerized medical record systems or computer-based patient records (CPRs), digitally store, manage, transmit, and reproduce patient medical records using electronic devices such as computers, replacing traditional handwritten paper records. The higher the quality of the electronic medical record and the more comprehensive the information it covers, the greater its value for medical research.

[0082] However, current electronic medical records (EMRs) suffer from low quality. This is because both outpatient and inpatient records require doctors to provide one or more disease diagnoses in a timely and phased manner. During this time, errors and other errors can lead to irrational diagnoses, which in turn degrade the quality of EMRs. This inability to accurately reflect the patient's actual condition poses significant diagnostic and treatment risks. Therefore, timely and accurate EMR quality inspections are necessary to improve the quality of EMRs, reduce diagnostic and treatment risks, and accurately measure doctors' diagnostic proficiency.

[0083] Currently, the quality inspection methods for electronic medical records usually include the following two methods:

[0084] The first is a quality inspection method based on text classification technology, which can be divided into two types of quality inspection methods: automatic diagnosis and prediction based on a classification framework and automatic diagnosis and prediction based on a pre-training framework.

[0085] Among them, the process of automatic diagnosis and prediction based on the classification framework includes first determining the supported diseases, then determining the data corresponding to each disease, and then performing feature learning based on some mainstream deep learning frameworks, such as Gate Recurrent Unit (GRU), Long-Short Term Memory Artificial Neural Network (LSTM), Recurrent Neural Networks (RNN), etc., and finally representing each medical record as a vector, and the dimension of the vector is equal to the number of diseases. The value of each dimension represents the probability of belonging to each disease, and then the disease with the highest probability is selected as the predicted disease for subsequent quality inspection. The difference between the automatic diagnosis and prediction methods based on the pre-training framework and the quality inspection process is that this type of method will pre-train the complex model of the transformer architecture based on a large-scale corpus in advance, and then fine-tune it according to the specific task. Through this pre-training combined with fine-tuning mode, the model can learn both global features and local features well, thereby obtaining better quality inspection performance than traditional classification models.

[0086] As can be seen, the above classification methods require pre-determining the supported diseases, which is not conducive to rapid expansion. If the prediction of a new disease is to be supported, the model must be retrained from scratch, which is very time-consuming. Furthermore, there may be more than one diagnostic result for a disease, that is, multiple disease diagnoses may exist simultaneously. Classification models use probability as the final result, so there will always be one high probability and others with low probabilities, which is not conducive to analyzing the possibility of multiple diseases. In addition, classification models are significantly affected by data distribution. If the training set contains a large number of samples of a certain disease, the classification will be more inclined to that disease type; similarly, if the training set contains very few samples of a certain disease, the classification will be less likely to be that disease type. Therefore, the labeling performance of small sample data is generally poor, which makes it impossible to achieve more accurate quality control of electronic medical records later.

[0087] In order to solve the problems existing in quality inspection based on text classification technology, a second quality inspection method has emerged, that is, a quality inspection method based on automatic diagnosis prediction results calculated based on similarity.

[0088] While this method overcomes the three main issues of the first quality inspection method, it also introduces a new problem: low performance. Specifically, it suffers from poor disease prediction performance and fails to accurately and timely reflect the quality of electronic medical records, leading to inaccurate quality inspection results. This is because similarity calculations are mostly sentence-based, and there is currently no reliable method for obtaining sentence vectors. Existing methods primarily average, maximize, or directly concatenate the tokens (i.e., characters, words, entities, etc.) contained in a sentence, but these methods do not accurately represent the characteristics of a sentence. Furthermore, an observation of BERT word representations reveals a cone-shaped distribution, with high-frequency words clustered at the beginning of the cone and low-frequency words dispersed at the end. Because high-frequency words are inherently high-frequency, they occupy a larger proportion of the sentence representation, resulting in high overall similarity across sentences. This results in poor disease prediction performance using similarity calculations and low-accuracy quality inspection results for electronic medical records.

[0089] To address the above-mentioned defects, the present application provides a quality inspection method for electronic medical records. First, the target electronic medical record to be quality inspected is obtained, and then the target electronic medical record is input into a pre-constructed contrastive learning model to identify and obtain the feature vector corresponding to each clause in the target electronic medical record; wherein the contrastive learning model is trained using a contrastive learning framework based on relevant sentence pairs and non-relevant sentence pairs; then, the feature vector corresponding to each clause in the target electronic medical record is input into a pre-constructed diagnosis result prediction model to predict the target diagnosis result corresponding to the target electronic medical record that meets the preset preliminary selection conditions, and then the actual diagnosis result in the target electronic medical record can be matched with the target predicted diagnosis result, and based on the matching result, the target electronic medical record can be quality inspected to obtain the quality inspection result of the target electronic medical record. It can be seen that since the embodiment of the present application uses a pre-built contrastive learning model to identify more contrastive and discriminative feature vectors corresponding to each clause in the target electronic medical record, which is used to predict subsequent diagnostic results, it is possible to obtain more accurate predicted diagnostic results. After matching the predicted diagnostic results with the actual diagnostic results in the target electronic medical record, the electronic medical record can be quality-checked more accurately based on the matching results, thereby improving the accuracy of the electronic medical record quality inspection results.

[0090] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0091] First embodiment

[0092] See also Figure 1 , is a flow chart of a quality inspection method for electronic medical records provided in this embodiment, the method comprising the following steps:

[0093] S101: Obtain the target electronic medical record to be quality inspected.

[0094] In this embodiment, any electronic medical record that undergoes quality inspection using this embodiment is defined as a target electronic medical record. It should be noted that this embodiment does not restrict the language type of the target electronic medical record; for example, the target electronic medical record can be a Chinese electronic medical record or an English electronic medical record. This embodiment also does not restrict the length of the target electronic medical record; for example, the target electronic medical record can be a sentence or a paragraph. This embodiment also does not restrict the disease type of the electronic medical record; for example, the target electronic medical record can be an electronic medical record with a diagnosis of asthma or an electronic medical record with a diagnosis of tibial fracture.

[0095] S102: Input the target electronic medical record into a pre-built contrastive learning model to identify the feature vector corresponding to each clause in the target electronic medical record; wherein the contrastive learning model is trained using a contrastive learning framework based on related sentence pairs and non-related sentence pairs.

[0096] In this embodiment, after obtaining the target electronic medical record for quality inspection in step S101, in order to quickly and accurately determine the quality inspection results of the electronic medical record, the target electronic medical record can be further input into a pre-built contrastive learning model to identify and obtain the feature vector corresponding to each clause in the target electronic medical record, which is used to execute the subsequent step S103. It should be noted that the specific format of the feature vector corresponding to each clause in the target electronic medical record can be set according to actual circumstances (such as the architecture of the selected contrastive learning model, etc.), and this embodiment does not limit this. For example, the feature vector corresponding to each clause in the target electronic medical record can be a 1×768-dimensional vector.

[0097] Among them, the contrastive learning model is a network model trained using a contrastive learning framework based on related sentence pairs and irrelevant sentence pairs. Through this model, the representation distance of related sentences can be shortened, and the representation distance of irrelevant sentences can be increased. In this way, a feature vector that can more accurately represent the characteristics of each sentence in the target electronic medical record can be obtained, which serves as the basis for subsequent quality inspection of the target electronic medical record to improve the accuracy of the quality inspection results.

[0098] Next, this embodiment will introduce the construction process of the contrastive learning model, which specifically includes the following steps A1-A2:

[0099] Step A1: Construct sample sentence pairs, wherein the sample sentence pairs include sample related sentence pairs and sample unrelated sentence pairs.

[0100] In this embodiment, in order to construct a comparative learning model, a lot of preparatory work needs to be done in advance. First, a large number of electronic medical records belonging to different disease diagnosis result categories need to be obtained as sample electronic medical records, and relevant sentence pairs and irrelevant sentence pairs need to be screened out from them as sample relevant sentence pairs and sample irrelevant sentence pairs to form sample sentence pairs, which are used to obtain a comparative learning model by executing the subsequent step A2 training.

[0101] Related sentence pairs refer to two sentences that have no significant differences in their wording, expression, or use of key words, or are essentially related, have similar meanings, or are even identical. For example, "A man is lifting weights in the garage" and "A man is lifting weights" are a related sentence pair, as are "A woman is spreading flour on a piece of meat" and "A woman is sprinkling flour on the meat." Unrelated sentence pairs refer to two sentences that have significant differences in their wording, expression, or use of key words, and express essentially unrelated, inconsistent, or contradictory meanings. For example, "A man is seasoning carrots" and "A woman is chopping garlic" are an unrelated sentence pair, as are "A cat is walking around the house" and "A woman is peeling potatoes."

[0102] In an optional implementation, the implementation process of step A1 may specifically include the following steps A11-A14:

[0103] Step A11: Obtain sample electronic medical records.

[0104] In this implementation, it should be noted that although there are some general data sets that meet the requirements in the field of natural language that can support the training of comparative learning models, since this application is for the quality inspection of electronic medical records, there are currently only a large number of original electronic medical records, and sample sentence pairs need to be constructed based on these existing electronic medical record data.

[0105] To construct sample sentence pairs, we first need to obtain original electronic medical records corresponding to the same disease diagnosis and different diagnosis results as sample electronic medical records. For example, we can select two original electronic medical records with the diagnosis result of "asthma" and two original electronic medical records with the diagnosis results of "eczema" and "anemia" as sample electronic medical records for subsequent step A12.

[0106] Step A12: Using the preset delimiters, split the clause contents corresponding to the chief complaint and current medical history fields in the sample electronic medical record into individual short sentences.

[0107] In this implementation, after obtaining the sample electronic medical record in step A11, the clause contents corresponding to the chief complaint and history of present illness fields in the sample electronic medical record can be further split into individual short sentences using a preset delimiter. The specific value of the preset delimiter can be set according to actual circumstances and is not limited in this application. For example, the preset delimiter can be set to a comma, a semicolon, or a period, so that the clause contents corresponding to the chief complaint and history of present illness fields in the sample electronic medical record can be split into individual short sentences using the comma, semicolon, or period as delimiters.

[0108] For example: Figure 2As shown in the figure, two original clauses are extracted from the sample electronic medical record and divided by commas, semicolons and periods as delimiters. After obtaining the short sentences, the two processed clauses are obtained: "The patient had dizziness and headaches three days ago, and painkillers were ineffective." and "The patient had dizziness and headaches for three days, and painkillers were ineffective." The short sentences contained in these two clauses are "The patient had dizziness three days ago", "headache", "painkillers were ineffective" and "The patient had dizziness", "headaches for three days", and "painkillers were ineffective".

[0109] Step A13: extracting entities from each short sentence, and determining whether the type similarity and content similarity between the entities contained in each two clauses meet a preset threshold.

[0110] In this implementation, after obtaining the short sentences contained in each clause corresponding to the chief complaint and current medical history fields in the sample electronic medical record through step A12, the entity extraction method that exists or will appear in the future can be further used to extract the entity information in each short sentence in advance. For example, a model trained based on a medical entity extraction method that combines BERT, LSTM and a sequence labeling algorithm (CRF) can be used to extract the entities in each short sentence, and then determine whether the type similarity between the entities contained in each two clauses is greater than a preset threshold (such as 60%), and whether the proportion of entity types whose content similarity of entities of the same type is greater than a preset threshold (such as 70%) is greater than a preset threshold (such as 60%), so as to execute the subsequent step A14.

[0111] Among them, the specific value of the preset threshold can be set according to actual conditions, and the embodiments of the present application do not limit this.

[0112] For example: Figure 2 As shown in the figure, five entities, namely, “start time”, “symptoms”, “symptoms”, “drug”, and “treatment effect”, can be extracted from the short sentences “the patient experienced dizziness three days ago”, “headache”, and “painkillers are ineffective”, and the corresponding words for each entity are “three days ago”, “dizziness”, “headache”, “painkillers”, and “ineffective”. Similarly, five entities, namely, “symptoms”, “symptoms”, “duration”, “drug”, and “treatment effect”, can be extracted from the short sentences “the patient experienced dizziness”, “headache lasted for three days”, and “painkillers are ineffective”, and the corresponding words for each entity are “dizziness”, “headache”, “three days”, “painkillers”, and “ineffective”.

[0113] Step A14: If yes, the corresponding two clauses constitute a sample related sentence pair; if no, the corresponding two clauses constitute a sample non-related sentence pair, and the sample related sentence pair and the sample non-related sentence pair are used to constitute a sample sentence pair.

[0114] In this implementation, if step A13 determines that the type similarity and content similarity between the entities included in the two clauses both meet the preset threshold, then the two clauses can be used to form a set of sample related sentence pairs. Conversely, if step A13 determines that the type similarity and content similarity between the entities included in the two clauses do not meet the preset threshold, then the two clauses can be used to form a set of sample non-related sentence pairs. All the obtained sample related sentence pairs and sample non-related sentence pairs can then be combined to form sample sentence pairs for executing the subsequent step A2.

[0115] Example: Based on the above example, Figure 2 As shown, the five entities "start time," "symptoms," "symptoms," "drug," and "treatment effect" extracted from the short sentences "The patient experienced dizziness three days ago," "headache," and "painkillers were ineffective" can be calculated to have a type similarity of 80% with the five entities "symptoms," "symptoms," "duration," "drug," and "treatment effect" extracted from the short sentences "The patient experienced dizziness," "headache lasted for three days," and "painkillers were ineffective." In other words, "symptoms," "symptoms," "drug," and "treatment effect" are identical. Then, from left to right, the similarities of the same entity types "dizziness and dizziness," "headache and headache," "painkillers and painkillers," and "ineffective and ineffective" are calculated to be 0.83, 0.95, 0.81, and 1.0, respectively.

[0116] At this time, if the preset threshold of entity type similarity is 60%, the preset threshold of content similarity is 70%, and the preset threshold of the proportion of entity types with content similarity higher than the preset threshold is 60%, then it can be determined that Figure 2 The two clauses "The patient experienced dizziness and headache three days ago, and painkillers were ineffective." and "The patient had dizziness and headaches for three days, and painkillers were ineffective." can constitute a group of sample-related sentence pairs. This is because the entity type similarity of the two is 80%, which is greater than the preset threshold of 60%, and the entity content similarities of 0.83, 0.95, 0.81 and 1.0 are also greater than the preset threshold of 70%. In addition, the proportion of entity types with entity content similarity greater than the preset threshold of 70% is 100%, which is also greater than the preset threshold of 60%.

[0117] Similarly, when it is determined that the entity type similarity between two clauses is no greater than a preset threshold, or that the entity content similarity of the same entity is no greater than a preset threshold, or that the proportion of entities greater than the preset threshold is less than a preset threshold, the corresponding two clauses can be combined to form a set of sample non-related sentence pairs. Similarly, after traversing all clauses in the sample electronic medical records, sample sentence pairs consisting of sample related sentence pairs and sample non-related sentence pairs can be constructed to train the contrastive learning model in the subsequent step A2.

[0118] It should be noted that in this embodiment, in order to facilitate comparative calculations, the similarity calculation formula uses the normalized cosine similarity value, i.e., 0.5+0.5*cosine_similarity. Since the value range of cosine similarity is from -1 to 1, the similarity result can be limited to between 0 and 1 by the above formula. In addition, when calculating the content similarity of the same entity, the value with higher similarity is selected as the content similarity corresponding to the entity. For example, when calculating the content similarity of the entity "symptoms", for "dizziness", the similarity between it and "vertigo" is selected as the content similarity of the entity "symptoms" to which "dizziness" belongs, rather than the similarity between it and "headache". This is because the similarity between "dizziness" and "vertigo" is greater than the similarity between "dizziness" and "headache".

[0119] Step A2: Input the sample sentence pair into the initial contrastive learning model, train the contrastive learning model by adjusting the first objective function, and output the sample feature vector corresponding to each clause in the sample sentence pair.

[0120] In this embodiment, the initial contrastive learning model used is a BERT-based model architecture. For example, a transformer architecture can be used as the initial contrastive learning model. The architecture includes an encoder and a decoder, and each encoder is composed of N (such as N = 6) identical layers. Each layer contains two parts: a multi-head attention mechanism and a fully connected feedforward neural network. Reusing the transformer's own architecture to add a pre-training mechanism can obtain a better global feature. This application chooses to connect two fully connected layers on this basis and perform fine-tuning so that the model can pay more attention to the local features and contextual information of each clause.

[0121] On this basis, after constructing the sample sentence pairs including sample-related sentence pairs and sample-unrelated sentence pairs through step A1, each sample sentence pair can be further initialized with a random vector. For example, the two clauses in the sample sentence pair can be initialized as two 1×500 vectors, and then the initialization vectors corresponding to the two clauses in each sample sentence pair are input one by one into the initial contrastive learning model for training, so that the model can output the sample feature vectors corresponding to the two clauses in each sample sentence pair as a whole. Through multiple rounds of model training until the training end conditions are met, at this time, the contrastive learning model is trained.

[0122] During each round of model training, a given objective function (herein defined as the first objective function) is used for model training, and this first objective function is used to increase the similarity between the sample feature vectors corresponding to each clause in the sample related sentence pairs, and to reduce the similarity between the sample feature vectors corresponding to each clause in the sample unrelated sentence pairs. By adjusting the first objective function, the relevance of each sample sentence pair can be constrained, making the feature vectors of the two clauses in the sample related sentence pairs increasingly similar, and the feature vectors of the two clauses in the sample unrelated sentence pairs increasingly different.

[0123] Specifically, in order to train a contrastive learning model with better recognition effect, during the training process, the first objective function used in this embodiment is as follows:

[0124]

[0125] in, It represents the cosine similarity between the two clauses in the i-th sample sentence pair of the input. The closer the value is to 1, the more similar the two clauses are. τ represents a hyperparameter, and its specific value can be determined according to the model structure. N represents the number of sample sentence pairs used in this round of model training.

[0126] It can be seen from the above formula (1) that when the vector representations of the two clauses in the sample sentence pair input by the model are more correlated, the first objective function l i On the contrary, when the vector representations of the two clauses in the sample sentence pair input by the model are less relevant, the first objective function l i The larger the value of . Through multiple rounds of training, the first objective function l is continuously adjusted i The value of the first objective function l i When the value of converges, for example, the first objective function l i When the value of reaches the minimum and remains basically unchanged, the training can be stopped, and the contrastive learning model obtained at this time is used as the trained contrastive learning model.

[0127] Through the above steps A1-A2, a contrastive learning model can be generated based on sample sentence pairs. Furthermore, the generated contrastive learning model can be tested and verified using test sentence pairs. The specific verification process may include the following steps B1-B3:

[0128] Step B1: Constructing test sentence pairs, wherein the test sentence pairs include test-related sentence pairs and test-irrelevant sentence pairs.

[0129] In this embodiment, in order to test and verify the contrastive learning model, it is first necessary to construct a test sentence pair. For example, a similar method to constructing a sample sentence pair can be used to construct a test sentence pair using the existing original electronic medical record text. That is, the "sample" in the above steps A11-A14 can be replaced with "test". The specific implementation process will not be repeated here.

[0130] Step B2: Score the test sentence pairs, and classify all the test sentence pairs into test sentence pairs of preset levels according to the scoring results.

[0131] After constructing the test sentence pairs including the test-related sentence pairs and the test-irrelevant sentence pairs through step B1, further, the two clauses in each test sentence pair can be scored for relevance to test the accuracy of the sentence pairs, and then all the test sentence pairs can be divided into test sentence pairs of preset levels based on the relevance scoring results to execute the subsequent step B3.

[0132] Specifically, the calculation formula for the relevance score of the two clauses in each test sentence pair is as follows:

[0133] α i,j =0.5t i,j +0.5c i,j (2)

[0134] Among them, t i,j Indicates the entity type similarity between clause i and clause j; c i,j represents the average cosine similarity score between all entities of the same type in clause i and clause j; α i,j It represents the correlation score between clause i and clause j, and its value ranges from 0 to 1.

[0135] It should be noted that, in the process of testing the model, this application uses a correlation score of 0.2 as a step size and divides all test sentence pairs into five levels, that is, α i,j The test sentence pairs with values between 0 and 0.2 are scored as 1 and classified as level 1; i,j The test sentence pairs with values between 0.2 and 0.4 are scored as 2 and classified as the second level; i,j The test sentence pairs with values between 0.4 and 0.6 are scored as 3 and classified as the third level; i,j The test sentence pairs with values between 0.6 and 0.8 are scored as 4 and classified as the fourth level; i,j The test sentence pairs with a value between 0.8 and 1.0 are scored as 5 and classified as level 5. In this way, five levels of test sentence pairs can be constructed as the test data set.

[0136] Step B3: Use test sentence pairs of preset levels to test the contrastive learning model, and update the parameters of the contrastive learning model based on the test results.

[0137] After obtaining the preset level test sentence pairs through step B2, the preset level test sentence pairs can be further used to test the contrastive learning model. Theoretically, the test result should be that the higher the level of the test sentence pairs, the better the first objective function l i The smaller the value of , conversely, the lower the level of the test sentence pair, the larger the value of the first objective function li. If the actual test results are inconsistent with the theoretical test results, the test sentence pair can be used as a sample sentence pair again to update the parameters of the contrastive learning model.

[0138] Through the above embodiments, the contrastive learning model can be effectively tested and verified using test sentences, and the contrastive learning model can be adjusted and updated in a timely manner, thereby helping to improve the recognition accuracy and precision of the model. The model parameters corresponding to the best test results can then be saved to form the final contrastive learning model.

[0139] At the same time, the present application may also use sample electronic medical records and / or test electronic medical records as candidate electronic medical records, and use sample sentence pairs and / or test sentence pairs constructed based on the candidate electronic medical records as candidate sentence pairs to execute subsequent step S103.

[0140] S103: Inputting the feature vector corresponding to each clause in the target electronic medical record into a pre-built diagnosis result prediction model to predict a target diagnosis result corresponding to the target electronic medical record that meets preset preliminary selection conditions.

[0141] In this embodiment, after obtaining the feature vector corresponding to each clause in the target electronic medical record through step S102, the feature vector corresponding to each clause in the target electronic medical record can be further input into a pre-built diagnosis result prediction model. The model is used for layer-by-layer processing, and the similarity between the target electronic medical record and each candidate electronic medical record is calculated. Based on the calculation results, similar electronic medical records that are closer to the target electronic medical record are determined, and then the diagnosis results of similar electronic medical records that meet the preset preliminary selection conditions are used as the predicted diagnosis results of the target electronic medical record, and are defined as the target diagnosis results for executing the subsequent step S104.

[0142] In a possible implementation of the embodiment of the present application, the implementation process of step S103 may specifically include the following steps C1-C5:

[0143] Step C1: After inputting the feature vector corresponding to each clause in the target electronic medical record into the pre-built diagnosis result prediction model, the feature vector corresponding to each clause in the target electronic medical record and the feature variables corresponding to each clause in each candidate electronic medical record are preprocessed so that the number of clauses contained in the preprocessed target electronic medical record is the same as the number of clauses contained in each candidate electronic medical record.

[0144] In this implementation method, in order to accurately predict the diagnosis result of the target electronic medical record and realize accurate quality inspection of the target electronic medical record, the feature vector corresponding to each clause in the target electronic medical record can be first input into the pre-built diagnosis result prediction model to calculate the similarity between the target electronic medical record and each candidate electronic medical record. Specifically, the feature vector corresponding to each clause in the target electronic medical record and the feature variables corresponding to each clause in each candidate electronic medical record can be preprocessed so that the number of clauses contained in the preprocessed target electronic medical record is the same as the number of clauses contained in each candidate electronic medical record.

[0145] Specifically, when calculating the similarity between a target electronic medical record and a candidate electronic medical record, the number of clauses in the target electronic medical record and the candidate electronic medical record can first be normalized to N. Clauses less than N are then padded with random vectors, and clauses in excess of N are deleted to ensure that no information is missed and that the number of clauses in the preprocessed target electronic medical record is the same as that in the candidate electronic medical record. Where N is a positive integer greater than 0, and the specific value can be set according to actual circumstances and is not limited in this embodiment of the application. For example, N can be set to 30.

[0146] Step C2: Calculate the weight of each clause in the preprocessed target electronic medical record, and use weighted multiplication to calculate the overall feature vector of the preprocessed target electronic medical record.

[0147] In this implementation, it should be noted that for each electronic medical record (whether it is a target electronic medical record or a candidate electronic medical record), the contribution information of the N clauses it contains to its final disease diagnosis result is different, so it is necessary to calculate the weight of each clause in the preprocessed target electronic medical record.

[0148] Specifically, if Figure 3 As shown, an optional implementation method is to use two fully connected layers to reduce the dimensionality of the feature vector corresponding to each clause in the preprocessed target electronic medical record to obtain a one-dimensional scalar corresponding to each clause, and use this one-dimensional scalar as the weight of the corresponding clause. The weight corresponding to each clause in the target electronic medical record is then multiplied by the feature vector corresponding to each clause to obtain the overall feature vector corresponding to the target electronic medical record, which is used to execute the subsequent step C4.

[0149] Step C3: Calculate the weight of each clause in the pre-processed candidate electronic medical record, and calculate the overall feature vector of each pre-processed candidate electronic medical record by weighted multiplication.

[0150] In this implementation, for each candidate electronic medical record, the contribution information of the N clauses it contains to its final disease diagnosis result is also different, so it is also necessary to calculate the weight of each clause in each preprocessed candidate electronic medical record.

[0151] Specifically, if Figure 3 As shown, an optional implementation method is to use two fully connected layers to reduce the dimensionality of the feature vector corresponding to each clause in the preprocessed candidate electronic medical records to obtain a one-dimensional scalar corresponding to each clause, and use this one-dimensional scalar as the weight of the corresponding clause. The weight corresponding to each clause in each preprocessed candidate electronic medical record can then be weighted and multiplied with the feature vector corresponding to each clause to obtain the overall feature vector of each preprocessed candidate electronic medical record, which is used to execute the subsequent step C4.

[0152] Step C4: Calculate the similarity between the pre-processed overall feature vector of the target electronic medical record and the pre-processed overall feature vector of each candidate electronic medical record.

[0153] In this implementation, after calculating the overall feature vector of the pre-processed target electronic medical record in step C2 and calculating the overall feature vector of each pre-processed candidate electronic medical record in step C3, further, as shown in FIG. Figure 3 As shown, existing or future similarity calculation methods can be used to calculate the similarity between the overall feature vector of the preprocessed target electronic medical record and the overall feature vector of each preprocessed candidate electronic medical record. For example, the cosine similarity between the overall feature vector of the preprocessed target electronic medical record and the overall feature vector of each preprocessed candidate electronic medical record can be calculated to perform the subsequent step C5.

[0154] Step C5: The candidate electronic medical records whose similarity meets the preset threshold are regarded as similar medical records, and the diagnosis results that meet the preset preliminary selection conditions in the similar medical records are regarded as target diagnosis results.

[0155] In this implementation method, after calculating the similarity between the target electronic medical record and each candidate electronic medical record through step C4, the candidate electronic medical records whose similarity meets the preset threshold (the specific value can be set according to actual conditions, for example, the preset threshold can be set to 0.75, etc.) can be further regarded as similar medical records, and the diagnosis results in the similar medical records that meet the preset preliminary selection conditions can be used as the target diagnosis results.

[0156] The specific content of the preset preliminary selection conditions can be set according to actual circumstances and is not limited in the embodiments of the present application. For example, the preset preliminary selection conditions can be set to select the first five candidate electronic medical records corresponding to similarities higher than a preset threshold as similar medical records to the target electronic medical record, and use the diagnosis results in the similar medical records as the target diagnosis results. Alternatively, the preset preliminary selection conditions can be set to select the candidate electronic medical record corresponding to the highest similarity as the most similar medical record to the target electronic medical record, and use the diagnosis results in the most similar medical record as the only target diagnosis results.

[0157] It should be noted that an optional implementation method is that the diagnosis result prediction model mentioned in the above step S103 can be trained using sample electronic medical records and an objective function (defined here as a second objective function). Specifically, during each round of model training, the diagnosis result prediction model is trained using a given second objective function, and the second objective function is used to improve the similarity between the target diagnosis result and the actual diagnosis result in the target electronic medical record. By adjusting the second objective function, the similarity between the candidate electronic medical record and the target electronic medical record can be constrained, and candidate electronic medical records that are increasingly similar to the overall feature vector of the target electronic medical record can be found.

[0158] Specifically, in order to train a diagnostic result prediction model with more accurate prediction results, during the training process, the second objective function used in this embodiment is calculated using the cross entropy formula, as shown below:

[0159]

[0160] It can be seen from the above formula (3) that when the overall feature vectors of the candidate electronic medical record and the target electronic medical record are more similar, the value of the second objective function L is smaller; conversely, when the overall feature vectors of the candidate electronic medical record and the target electronic medical record are less similar, the value of the second objective function L is larger. Then, through multiple rounds of training, the model is trained using supervised training, and the value of the second objective function L is continuously adjusted. When the value of the second objective function L converges, for example, when the value of the second objective function L reaches the minimum and remains basically unchanged, the training can be stopped, and the diagnosis result prediction model obtained at this time is used as the trained diagnosis result prediction model.

[0161] Furthermore, the generated diagnostic result prediction model can be tested and verified using the test electronic medical records. The specific verification process can be implemented by referring to the testing process of the comparative learning model, which will not be described in detail here.

[0162] S104: Match the actual diagnosis result in the target electronic medical record with the target predicted diagnosis result, and perform quality inspection on the target electronic medical record based on the matching result to obtain the quality inspection result of the target electronic medical record.

[0163] It should be noted that after predicting the target diagnosis result corresponding to the target electronic medical record in step S103, it is further necessary to verify all target diagnosis results using the preset standard dimension values, and based on the verification results, select the target diagnosis result that matches the actual diagnosis result in the target electronic medical record. The specific value of the preset standard dimension value can be set according to actual circumstances and is not limited in this application. For example, the preset standard dimension value can be set to gender, age, department, etc.

[0164] For example, suppose five target diagnosis results corresponding to a target electronic medical record that meet the pre-selected criteria have been obtained, and the pre-selected standard dimensions are set to gender, age, and department. In this case, the five target diagnosis results can be verified using these three standard dimensions. This is because the target electronic medical record already contains information such as the patient's gender, age, and department. Based on the content of each target diagnosis result, the patient's gender, age group, and department information can be predicted, allowing for matching verification. For example, if the five target diagnosis results include "uterine fibroids," it can be predicted that the patient's gender is likely female, the patient's age is likely over 8 years old, and the department is gynecology. If the target electronic medical record already contains a patient with a gender other than female, an age of less than 8 years old, or a department other than gynecology, the target diagnosis "uterine fibroids" is considered unreasonable and can be removed from the five target diagnosis results that meet the pre-selected criteria. By analogy, the target diagnosis results that can be matched with the actual diagnosis results in the target electronic medical record can be screened out, thereby improving the matching efficiency and accuracy.

[0165] Furthermore, the actual diagnosis result in the target electronic medical record can be matched with the target diagnosis result obtained by screening, and based on the matching result, the target electronic medical record can be quality-checked to obtain the quality-check result of the target electronic medical record.

[0166] Specifically, if there is only one target diagnosis result, it is necessary to determine whether the unique target diagnosis result is consistent with the actual diagnosis result in the target electronic medical record. If so, it means that the diagnosis result of the target electronic medical record is correct, that is, the content corresponding to the chief complaint and current medical history fields of the target electronic medical record is self-consistent with the final diagnosis result given by the doctor and can be explained by each other, thereby indicating that the quality of the target electronic medical record meets the requirements and the doctor's professional level is relatively high. On the contrary, if not, it means that the diagnosis result of the target electronic medical record is wrong, or the diagnosis result may be correct, but the content corresponding to the chief complaint and current medical history fields of the target electronic medical record is wrong, that is, the content corresponding to the chief complaint and current medical history fields of the target electronic medical record is inconsistent with the final diagnosis result given by the doctor and cannot be explained by each other, thereby indicating that the quality of the target electronic medical record is poor and does not meet the requirements, and the doctor needs to conduct further inspection.

[0167] If there are multiple target diagnostic results, it is necessary to determine whether the actual diagnostic result in the target electronic medical record is included in these multiple target diagnostic results. If so, it means that the diagnostic result of the target electronic medical record is correct, that is, the content corresponding to the chief complaint and current medical history fields of the target electronic medical record is self-consistent with the final diagnosis result given by the doctor and can explain each other, thus indicating that the quality of the target electronic medical record meets the requirements and the doctor's professional level is also relatively high. On the contrary, if not, it means that the diagnostic result of the target electronic medical record is wrong, or the diagnostic result may be correct, but the content corresponding to the chief complaint and current medical history fields of the target electronic medical record is wrong, that is, the content corresponding to the chief complaint and current medical history fields of the target electronic medical record is inconsistent with the final diagnosis result given by the doctor and cannot explain each other, thus indicating that the quality of the target electronic medical record is poor and does not meet the requirements, and further examination by the doctor is required.

[0168] For example: Figure 4As shown in the figure, there are 5 target diagnosis results, namely "lung infection", "respiratory tract infection", "bronchitis", "chronic bronchitis" and "pneumonia", and the actual diagnosis result in the target electronic medical record is "asthma". It can be judged that the actual diagnosis result "asthma" in the target electronic medical record is not included in the 5 target diagnosis results of "lung infection", "respiratory tract infection", "bronchitis", "chronic bronchitis" and "pneumonia", which further indicates that the diagnosis result of the target electronic medical record is wrong, or the diagnosis result may be correct, but the content corresponding to the chief complaint and current medical history fields of the target electronic medical record is wrong, that is, the content corresponding to the chief complaint and current medical history fields of the target electronic medical record is inconsistent with the final diagnosis result given by the doctor and cannot explain each other, indicating that the quality of the target electronic medical record is poor and does not meet the requirements, and the doctor needs to conduct further examination. If further examination by the doctor determines that "lung infection" is the correct diagnosis, and the diagnosis of "asthma" given by the original doctor in the target electronic medical record is not in the recommended list of the above five target diagnostic results, it is considered that there is an unreasonable diagnosis, resulting in poor quality of the electronic medical record, which cannot accurately reflect the patient's actual condition and may bring risks to diagnosis and treatment.

[0169] In summary, the present embodiment provides a method for quality inspection of electronic medical records, which first obtains the target electronic medical record to be quality inspected, and then inputs the target electronic medical record into a pre-constructed contrastive learning model to identify and obtain the feature vector corresponding to each clause in the target electronic medical record; wherein the contrastive learning model is trained using a contrastive learning framework based on relevant sentence pairs and non-relevant sentence pairs; then, the feature vector corresponding to each clause in the target electronic medical record is input into a pre-constructed diagnosis result prediction model to predict the target diagnosis result corresponding to the target electronic medical record that meets the preset preliminary selection conditions, and then the actual diagnosis result in the target electronic medical record can be matched with the target predicted diagnosis result, and based on the matching result, the target electronic medical record can be quality inspected to obtain the quality inspection result of the target electronic medical record. It can be seen that since the embodiment of the present application uses a pre-built contrastive learning model to identify more contrastive and discriminative feature vectors corresponding to each clause in the target electronic medical record, which is used to predict subsequent diagnostic results, it is possible to obtain more accurate predicted diagnostic results. After matching the predicted diagnostic results with the actual diagnostic results in the target electronic medical record, the electronic medical record can be quality-checked more accurately based on the matching results, thereby improving the accuracy of the electronic medical record quality inspection results.

[0170] Second embodiment

[0171] This embodiment will introduce a quality inspection device for electronic medical records. For related content, please refer to the above method embodiment.

[0172] See also Figure 5 , is a schematic diagram of the composition of an electronic medical record quality inspection device provided in this embodiment, the device 500 includes:

[0173] An acquisition unit 501 is used to acquire a target electronic medical record to be quality inspected;

[0174] The recognition unit 502 is configured to input the target electronic medical record into a pre-built contrastive learning model to identify and obtain a feature vector corresponding to each clause in the target electronic medical record; the contrastive learning model is trained using a contrastive learning framework based on related sentence pairs and non-related sentence pairs;

[0175] The prediction unit 503 is configured to input the feature vector corresponding to each clause in the target electronic medical record into a pre-built diagnosis result prediction model to predict a target diagnosis result corresponding to the target electronic medical record that meets a preset preliminary selection condition;

[0176] The quality inspection unit 504 is used to match the actual diagnosis result in the target electronic medical record with the target predicted diagnosis result, and perform quality inspection on the target electronic medical record based on the matching result to obtain the quality inspection result of the target electronic medical record.

[0177] In one implementation of this embodiment, the apparatus further includes:

[0178] A first construction unit is configured to construct sample sentence pairs, wherein the sample sentence pairs include sample related sentence pairs and sample unrelated sentence pairs;

[0179] a training unit, configured to input the sample sentence pair into an initial contrastive learning model, train the contrastive learning model by adjusting a first objective function, and output a sample feature vector corresponding to each clause in the sample sentence pair;

[0180] The first objective function is used to increase the similarity between sample feature vectors corresponding to each clause in sample related sentence pairs, and to reduce the similarity between sample feature vectors corresponding to each clause in sample unrelated sentence pairs.

[0181] In one implementation of this embodiment, the first construction unit includes:

[0182] an acquisition subunit for acquiring sample electronic medical records;

[0183] A splitting subunit is used to split the clause contents corresponding to the chief complaint and current medical history fields in the sample electronic medical record into individual short sentences using a preset delimiter;

[0184] An extraction subunit, configured to extract entities from each of the short sentences and determine whether the type similarity and content similarity between the entities contained in each two clauses meet a preset threshold;

[0185] The sub-unit is used to form a sample related sentence pair with the corresponding two clauses if it is determined that the type similarity and content similarity between the entities contained in each two clauses meet the preset threshold; if it is determined that the type similarity and content similarity between the entities contained in each two clauses do not meet the preset threshold, the corresponding two clauses are formed into a sample non-related sentence pair, and the sample related sentence pair and the sample non-related sentence pair are used to form a sample sentence pair.

[0186] In one implementation of this embodiment, the apparatus further includes:

[0187] A second construction unit is used to construct a test sentence pair, wherein the test sentence pair includes a test-related sentence pair and a test-irrelevant sentence pair;

[0188] a classification unit, configured to score the test sentence pairs and classify all the test sentence pairs into test sentence pairs of preset levels according to the scoring results;

[0189] The testing unit is used to test the contrastive learning model using the test sentence pairs of the preset level, and update the parameters of the contrastive learning model according to the test results.

[0190] In one implementation of this embodiment, the prediction unit 503 includes:

[0191] a preprocessing subunit, configured to input the feature vector corresponding to each clause in the target electronic medical record into a pre-built diagnosis result prediction model, and then preprocess the feature vector corresponding to each clause in the target electronic medical record and the feature variables corresponding to each clause in each candidate electronic medical record, so that the number of clauses contained in the target electronic medical record after preprocessing is the same as the number of clauses contained in each candidate electronic medical record;

[0192] a first calculation subunit, configured to calculate the weight of each clause in the preprocessed target electronic medical record, and calculate an overall feature vector of the preprocessed target electronic medical record by using weighted multiplication;

[0193] a second calculation subunit, configured to calculate the weight of each clause in the pre-processed candidate electronic medical record, and calculate an overall feature vector of each pre-processed candidate electronic medical record by using weighted multiplication;

[0194] a third calculation subunit, configured to calculate the similarity between the preprocessed overall feature vector of the target electronic medical record and the preprocessed overall feature vector of each candidate electronic medical record;

[0195] The determination subunit is configured to take the candidate electronic medical records whose similarity meets a preset threshold as similar medical records, and take the diagnosis results in the similar medical records that meet a preset preliminary selection condition as target diagnosis results.

[0196] In one implementation of this embodiment, the preprocessing subunit is specifically configured to:

[0197] The number of clauses in the target electronic medical record and each candidate electronic medical record is standardized to N; the clauses that are less than N are padded with random vectors, and the clauses that exceed N are deleted; so that the number of clauses contained in the preprocessed target electronic medical record is the same as the number of clauses contained in each candidate electronic medical record; N is a positive integer greater than 0.

[0198] In one implementation of this embodiment, the first computing subunit includes:

[0199] a dimensionality reduction subunit, configured to perform dimensionality reduction processing on the feature vector corresponding to each clause in the preprocessed target electronic medical record using two fully connected layers to obtain a one-dimensional scalar corresponding to each clause, and use the one-dimensional scalar as the weight of the corresponding clause;

[0200] The obtaining subunit is used to perform weighted multiplication on the weight corresponding to each clause in the target electronic medical record and the feature vector corresponding to each clause to obtain the overall feature vector corresponding to the target electronic medical record.

[0201] In one implementation of this embodiment, the apparatus further includes:

[0202] The verification unit is used to verify all the target diagnosis results corresponding to the target electronic medical record and meeting the preset preliminary selection conditions using the preset standard dimension value, and screen out the target diagnosis results that match the actual diagnosis results in the target electronic medical record based on the verification results.

[0203] In one implementation of this embodiment, the diagnosis result prediction model is trained using a second objective function, and the second objective function is used to improve the similarity between the target diagnosis result and the actual diagnosis result in the target electronic medical record.

[0204] Furthermore, an embodiment of the present application also provides a quality inspection device for electronic medical records, comprising: a processor, a memory, and a system bus;

[0205] The processor and the memory are connected via the system bus;

[0206] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes any one of the implementation methods of the above-mentioned electronic medical record quality inspection method.

[0207] Furthermore, an embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a terminal device, the terminal device executes any implementation method of the above-mentioned electronic medical record quality inspection method.

[0208] Furthermore, an embodiment of the present application also provides a computer program product, which, when running on a terminal device, enables the terminal device to execute any one of the implementation methods of the above-mentioned electronic medical record quality inspection method.

[0209] Through the description of the above embodiments, it can be seen that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in each embodiment of the present application or certain parts of the embodiments.

[0210] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the methods.

[0211] It should also be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0212] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A quality inspection method for electronic medical records, characterized in that: include: Obtain the target electronic medical records for quality inspection; Inputting the target electronic medical record into a pre-built contrastive learning model to identify and obtain a feature vector corresponding to each clause in the target electronic medical record; the contrastive learning model is trained using a contrastive learning framework based on sample related sentence pairs and sample non-related sentence pairs; Inputting the feature vector corresponding to each clause in the target electronic medical record into a pre-built diagnosis result prediction model to predict a target diagnosis result corresponding to the target electronic medical record that meets the preset preliminary selection conditions; Matching the actual diagnosis result in the target electronic medical record with the target predicted diagnosis result, and performing a quality inspection on the target electronic medical record based on the matching result to obtain a quality inspection result of the target electronic medical record; The method for obtaining the sample related sentence pairs and non-related sentence pairs includes: Obtain sample electronic medical records; Using preset delimiters, split the clause contents corresponding to the chief complaint and present medical history fields in the sample electronic medical record into individual short sentences; Extracting entities from each of the short sentences, and determining whether the type similarity and content similarity between the entities contained in each two clauses meet a preset threshold; If yes, the corresponding two clauses constitute a sample related sentence pair; if no, the corresponding two clauses constitute a sample unrelated sentence pair; In each round of training of the contrastive learning model, each sample sentence pair is first initialized with a random vector, and then the initialization vectors corresponding to the two clauses in each sample sentence pair are input into the initial contrastive learning model one by one for training, so that the model outputs the sample feature vectors corresponding to the two clauses in each sample sentence pair as a whole, and the contrastive learning model is obtained by adjusting the first objective function through multiple rounds of model training. The first objective function is as follows: , in, It represents the cosine similarity of the two clauses in the i-th sample sentence pair of the input model. The closer the value is to 1, the more similar the two clauses are. Represents a hyperparameter; N represents the number of sample sentence pairs used in this round of model training, and its value is a positive integer greater than 0; the value of i is a positive integer greater than 0 and not greater than N; the value of j is a positive integer greater than 0 and not greater than N.

2. The method according to claim 1, characterized in that The method further comprises: Constructing test sentence pairs, wherein the test sentence pairs include test-related sentence pairs and test-irrelevant sentence pairs; Scoring the test sentence pairs, and classifying all the test sentence pairs into test sentence pairs of preset levels according to the scoring results; The contrastive learning model is tested using the test sentence pairs of the preset level, and parameters of the contrastive learning model are updated according to the test results.

3. The method according to claim 1, characterized in that Inputting the feature vector corresponding to each clause in the target electronic medical record into a pre-built diagnosis result prediction model to predict a target diagnosis result corresponding to the target electronic medical record that meets a preset preliminary selection condition includes: After inputting the feature vector corresponding to each clause in the target electronic medical record into a pre-built diagnosis result prediction model, preprocessing the feature vector corresponding to each clause in the target electronic medical record and the feature variables corresponding to each clause in each candidate electronic medical record so that the number of clauses contained in the target electronic medical record after preprocessing is the same as the number of clauses contained in each candidate electronic medical record; Calculating the weight of each clause in the preprocessed target electronic medical record, and calculating the overall feature vector of the preprocessed target electronic medical record by weighted multiplication; Calculating the weight of each clause in the pre-processed candidate electronic medical record, and calculating the overall feature vector of each pre-processed candidate electronic medical record by weighted multiplication; Calculating the similarity between the preprocessed overall feature vector of the target electronic medical record and the preprocessed overall feature vector of each candidate electronic medical record; The candidate electronic medical records whose similarity meets a preset threshold are taken as similar medical records, and the diagnosis results in the similar medical records that meet a preset preliminary selection condition are taken as target diagnosis results.

4. The method according to claim 3, characterized in that The preprocessing of the feature vector corresponding to each clause in the target electronic medical record and the feature variables corresponding to each clause in each candidate electronic medical record so that the number of clauses contained in the target electronic medical record after preprocessing is the same as the number of clauses contained in each candidate electronic medical record includes: The number of clauses in the target electronic medical record and each candidate electronic medical record is standardized to N; the clauses that are less than N are padded with random vectors, and the clauses that exceed N are deleted; so that the number of clauses contained in the preprocessed target electronic medical record is the same as the number of clauses contained in each candidate electronic medical record; N is a positive integer greater than 0.

5. The method according to claim 3, characterized in that The step of calculating the weight of each clause in the preprocessed target electronic medical record and calculating the overall feature vector of the preprocessed target electronic medical record by weighted multiplication includes: Using two fully connected layers to perform dimensionality reduction processing on the feature vector corresponding to each clause in the preprocessed target electronic medical record to obtain a one-dimensional scalar corresponding to each clause, and using the one-dimensional scalar as the weight of the corresponding clause; The weight corresponding to each clause in the target electronic medical record is weighted and multiplied by the feature vector corresponding to each clause to obtain the overall feature vector corresponding to the target electronic medical record.

6. The method according to claim 1, characterized in that After predicting and obtaining a target diagnosis result corresponding to the target electronic medical record and meeting a preset preliminary selection condition, the method further includes: All the target diagnosis results are verified using preset standard dimension values, and based on the verification results, the target diagnosis results that match the actual diagnosis results in the target electronic medical record are screened out.

7. According to the method according to any one of claims 1 to 6, the diagnosis result prediction model is trained using a second objective function, and the second objective function is used to improve the similarity between the target diagnosis result and the actual diagnosis result in the target electronic medical record.

8. A quality inspection device for electronic medical records, characterized in that: include: An acquisition unit, used to acquire target electronic medical records to be inspected; The recognition unit is used to input the target electronic medical record into a pre-built contrastive learning model to identify and obtain a feature vector corresponding to each clause in the target electronic medical record; the contrastive learning model is trained using a contrastive learning framework based on sample related sentence pairs and sample non-related sentence pairs; the method for obtaining the sample related sentence pairs and non-related sentence pairs includes: obtaining a sample electronic medical record; using a preset delimiter, splitting the clause contents corresponding to the chief complaint and current medical history fields in the sample electronic medical record into individual short sentences; extracting entities from each short sentence, and determining whether the type similarity and content similarity between the entities contained in each two clauses meet a preset threshold; if so, forming the corresponding two clauses into a sample related sentence pair; if not, forming the corresponding two clauses into a sample non-related sentence pair; A prediction unit, configured to input the feature vector corresponding to each clause in the target electronic medical record into a pre-built diagnosis result prediction model, and predict a target diagnosis result corresponding to the target electronic medical record that meets a preset preliminary selection condition; a quality inspection unit, configured to match the actual diagnosis result in the target electronic medical record with the target predicted diagnosis result, and perform a quality inspection on the target electronic medical record based on the matching result to obtain a quality inspection result of the target electronic medical record; In each round of training of the contrastive learning model, each sample sentence pair is first initialized with a random vector, and then the initialization vectors corresponding to the two clauses in each sample sentence pair are input into the initial contrastive learning model one by one for training, so that the model outputs the sample feature vectors corresponding to the two clauses in each sample sentence pair as a whole, and the contrastive learning model is obtained by adjusting the first objective function through multiple rounds of model training. The first objective function is as follows: , in, It represents the cosine similarity of the two clauses in the i-th sample sentence pair of the input model. The closer the value is to 1, the more similar the two clauses are. Represents a hyperparameter; N represents the number of sample sentence pairs used in this round of model training, and its value is a positive integer greater than 0; the value of i is a positive integer greater than 0 and not greater than N; the value of j is a positive integer greater than 0 and not greater than N.

9. A quality inspection device for electronic medical records, characterized in that: include: Processor, memory, system bus; The processor and the memory are connected via the system bus; The memory is configured to store one or more programs, wherein the one or more programs include instructions, and when the instructions are executed by the processor, the processor is enabled to perform the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Diagnosis and treatment scheme prediction method and device

    CN110297908A

  • Medical record information verification method and device, computer equipment and storage medium

    CN112820367A

  • Sentence semantic matching method and system, storage medium and electronic equipment

    CN112906398A