A hospitalization medical record first page coding quality control method and system based on a large language model
Patent Information
- Application Number
- CN202610715344.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-22
- Publication Date
- 2026-10-13
AI Technical Summary
工作量巨大的压力下,单靠人工难以保障首页编码质量与效率
本发明针对电子病历系统中病案首页编码环节,能够自动分析电子住院病案,运用先进的大语言模型,准确高效地完成疾病诊断编码、手术编码及病理编码的质控工作,从而大大提升了编码的准确性和效率。
Smart Images

Figure CN122907215A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and system for quality control of coding on the front page of inpatient medical records based on a large language model, for quality control of coding on the front page of inpatient medical records. Background Technology
[0002] In the digital age, medical records have evolved from paper-based records into strategic resources driving improvements in medical quality, refined medical insurance management, medical innovation, and public health governance. Therefore, strengthening medical record quality control is paramount. The medical record cover sheet is a condensed summary of information from the entire patient's hospitalization process, containing rich and crucial data. In particular, the disease diagnosis code, surgical code, and pathology code on the cover sheet constitute the most important markers of the patient's hospitalization and are the core data most crucial for reconstructing the hospitalization situation and conducting statistical analysis. The coding process is typically complex and arduous. The coding system differs from clinical diagnosis and treatment rules, and clinicians often lack coding knowledge. Coders require a core set of specialized knowledge. Accurate coding requires integrating a large amount of clinical data (electronic medical records, laboratory reports, endoscopy, imaging, ultrasound, ECG, pathology reports, temperature charts, doctor's orders, various assessment forms, clinical pathway forms, etc.) and extensive clinical knowledge. Under immense workload pressure, manual work alone cannot guarantee the quality and efficiency of cover sheet coding. Intelligent coding tools are urgently needed to assist clinicians and coders in accurately and efficiently completing the cover sheet coding task.
[0003] Furthermore, with the full implementation of the DRGs-based medical insurance payment system, the accuracy of the homepage coding and the matching degree between diagnostic and surgical codes directly affect medical insurance coverage and payment. Therefore, it is even more necessary for coders and homepage quality control personnel to meticulously review homepage codes to ensure their accuracy, consistency, and completeness. By establishing an intelligent quality control tool for homepage coding, the quality of homepages can be guaranteed and improved, allowing for better utilization of inpatient homepage data to support medical statistics, hospital operations, performance, and medical insurance payments. Summary of the Invention
[0004] This invention addresses the problems and shortcomings of existing technologies by providing a method and system for quality control of inpatient medical record cover page coding based on a large language model.
[0005] The present invention solves the above-mentioned technical problems through the following technical solution: This invention provides a quality control method for coding the front page of inpatient medical records based on a large language model, characterized by the following steps: S1. The large language model obtains the electronic inpatient medical records after quality control and correction. The electronic inpatient medical records include the medical record cover page, diagnosis-related materials containing discharge summary, and / or surgery-related materials, and / or pathology-related materials. S2. The large language model determines whether there are Situation 1 and Situation 2 in the electronic inpatient medical record. Situation 1 is that the surgical fee information on the medical record front page is not zero and / or there is a surgical record in the surgical-related materials. Situation 2 is that the pathology fee information on the medical record front page is not zero and / or there is a pathology report in the pathology-related materials. If neither Situation 1 nor Situation 2 exists, proceed to S3. If only Situation 1 exists, proceed to S4. If both Situation 1 and Situation 2 exist, proceed to S5. S3. The large language model compiles the corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary. It then matches the compiled diagnostic codes with the diagnostic codes in the medical record cover page. If they match, the code quality control in the medical record cover page passes; otherwise, the code quality control in the medical record cover page fails, and a report indicating that the code in the medical record cover page is suspected of having an error is output. S4. The large language model compiles corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary and corresponding surgical codes based on the surgical records. The compiled diagnostic codes and surgical codes are matched with the diagnostic codes and surgical codes in the medical record cover page and logical corrections are performed between them. If the diagnostic codes and surgical codes match and the logical corrections are correct, the coding quality control in the medical record cover page passes. If the diagnostic codes and surgical codes match but the logical corrections are incorrect or the diagnostic codes and / or surgical codes do not match, the coding quality control in the medical record cover page fails, and a report indicating a suspected error in the coding in the medical record cover page is output. S5. The large language model generates corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary, corresponding surgical codes based on the surgical record, and corresponding pathology codes based on the pathology report. The generated diagnostic codes, surgical codes, and pathology codes are matched with the diagnostic codes, surgical codes, and pathology codes in the medical record cover page, and logical corrections are performed between them. If the diagnostic codes, surgical codes, and pathology codes are all matched and the logical corrections are correct, the coding quality control in the medical record cover page passes. If the diagnostic codes, surgical codes, and pathology codes are all matched but there are problems with the logical corrections, or if the diagnostic codes, surgical codes, and / or pathology codes are not matched, the coding quality control in the medical record cover page fails, and a report indicating that the coding in the medical record cover page is suspected of being incorrect is output.
[0006] Preferably, in S3, if the codes match perfectly, the coding quality control in the medical record cover page passes; if the codes do not match perfectly and the diagnostic codes in the medical record cover page are missing or extra compared to the compiled diagnostic codes, then the diagnostic codes in the medical record cover page are filled in or extra are deleted according to the compiled diagnostic codes, and the coding quality control in the medical record cover page passes; if the codes do not match perfectly and the diagnostic codes in the medical record cover page are incorrect compared to the compiled diagnostic codes, or if the codes do not match perfectly, the coding quality control in the medical record cover page fails, and a report indicating a suspected error in the coding in the medical record cover page is output.
[0007] Preferably, in S4, the large language model compiles corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary and corresponding surgical codes based on the surgical records. First, the compiled diagnostic codes and surgical codes are matched with the diagnostic codes and surgical codes in the medical record cover page, and then logical corrections are performed between them. If the diagnostic codes and surgical codes are completely matched and the logical corrections are correct, then the coding quality control in the medical record cover page passes. If the diagnostic codes do not match completely and the diagnostic codes in the medical record cover page are missing or extra compared to the compiled diagnostic codes, then the diagnostic codes in the medical record cover page are filled in or deleted based on the compiled diagnostic codes. And / or, if the surgical codes do not match completely and the surgical codes in the medical record cover page are missing or extra compared to the compiled surgical codes, then the surgical codes in the medical record cover page are filled in or deleted based on the compiled surgical codes. After that, the mutual logical correction is performed again. If the logical correction is not a problem, the code quality control of the medical record cover page passes. If the diagnostic code and surgical code are completely matched but there is a problem with logical correction, or if they are not completely matched and there is a problem with mutual logical correction after another attempt, or if they are not completely matched and the diagnostic code in the medical record cover is incorrect relative to the generated diagnostic code, and / or the surgical code in the medical record cover is incorrect relative to the generated surgical code, or if the diagnostic code and surgical code are completely mismatched, then the coding quality control in the medical record cover fails, and a report indicating that the coding in the medical record cover is suspected to be incorrect is output.
[0008] Preferably, in S5, the large language model compiles corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary, corresponding surgical codes based on the surgical record, and corresponding pathology codes based on the pathology report. First, the compiled diagnostic codes, surgical codes, and pathology codes are matched with the diagnostic codes, surgical codes, and pathology codes in the medical record cover page, and then logical corrections are performed between them. If the diagnostic codes, surgical codes, and pathology codes are completely matched and the logical corrections are correct, then the coding quality control in the medical record cover page passes. If the diagnostic codes do not match perfectly and the diagnostic codes on the medical record cover page are missing or extra compared to the compiled diagnostic codes, then the diagnostic codes on the medical record cover page are filled in or deleted based on the compiled diagnostic codes. Similarly, if the surgical codes do not match perfectly and the surgical codes on the medical record cover page are missing or extra compared to the compiled surgical codes, then the surgical codes on the medical record cover page are filled in or deleted based on the compiled surgical codes. And similarly, if the pathology codes do not match perfectly and the pathology codes on the medical record cover page are missing or extra compared to the compiled pathology codes, then the pathology codes on the medical record cover page are filled in or deleted based on the compiled pathology codes. Afterwards, a logical correction is performed between the codes. If the logical correction is successful, the coding quality control on the medical record cover page passes. If the diagnostic code, surgical code, and pathology code are all perfectly matched but there is a problem with logical correction, or if they are not perfectly matched and there is a problem with logical correction between them again, or if they are not perfectly matched and the diagnostic code in the medical record cover is incorrect relative to the generated diagnostic code, and / or, the surgical code in the medical record cover is incorrect relative to the generated surgical code, and / or, the pathology code in the medical record cover is incorrect relative to the generated pathology code, or if the diagnostic code, surgical code, and pathology code are completely mismatched, then the coding quality control in the medical record cover has failed, and a report indicating a suspected error in the coding in the medical record cover will be output.
[0009] Preferably, a medical coding domain-specific knowledge base is constructed, and a labeled sample dataset is built using a large number of correctly coded cases and a large number of incorrectly coded cases. The constructed medical coding domain-specific knowledge base and labeled sample dataset are used to train a large language model to obtain a well-trained large language model with medical coding logic knowledge.
[0010] Preferably, the base model of the large language model is the open-source model Qwen2.5 or Llama3.1. During the knowledge injection stage, secondary pre-training is performed using LoRA low-rank adaptation technology, freezing 90% of the core parameters of the base model and updating only the low-rank matrix related to medical coding knowledge. A coding guideline compliance penalty term is added to the model's fine-tuning loss function. When the model output deviates, the loss weight is automatically increased to force the model to learn compliant coding logic. For a knowledge base specifically for the medical coding field, the SimHash algorithm is first used to calculate the hash value of the knowledge base content, and duplicate data with a similarity of more than 90% is removed. Then, the coding format and terminology are standardized using regular expressions. For a large number of correctly coded cases and a large number of incorrectly coded cases, the coding cases are first labeled using a machine pre-labeling + manual review mode. Then, the cases are enhanced by replacing synonyms for diagnostic terms, surgical terms and pathological terms, and reconstructing the sentence structure of the case sentences, thus constructing a labeled sample dataset.
[0011] Preferably, between S1 and S2, the following steps are included: a large language model performs word segmentation and entity extraction on the electronic inpatient medical records; In S2, the large language model determines whether the extracted entities contain Case 1 and Case 2.
[0012] The present invention also provides a quality control system for coding the front page of inpatient medical records based on a large language model, characterized in that it includes an inpatient medical record acquisition module, a judgment module, a first coding quality control module, a second coding quality control module and a third coding quality control module; The inpatient medical record acquisition module is used to acquire the electronic inpatient medical record after quality control correction using a large language model. The electronic inpatient medical record includes a medical record cover page, diagnostic-related materials containing a discharge summary, and / or surgical-related materials, and / or pathology-related materials. The judgment module is used to use a large language model to determine whether there are two situations in the electronic inpatient medical record. Situation 1 is that the surgical fee information on the medical record homepage is not zero and / or there is a surgical record in the surgical-related materials. Situation 2 is that the pathology fee information on the medical record homepage is not zero and / or there is a pathology report in the pathology-related materials. When neither situation 1 nor situation 2 exists, the first coding quality control module is called. When only situation 1 exists, the second coding quality control module is called. When both situation 1 and situation 2 exist, the third coding quality control module is called. The first coding quality control module is used to use a large language model to compile corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary, and to match the compiled diagnostic codes with the diagnostic codes in the medical record front page. If they match, the coding quality control in the medical record front page passes; otherwise, the coding quality control in the medical record front page fails and a report indicating that the coding in the medical record front page is suspected of being incorrect is output. The second coding quality control module is used to generate corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary and corresponding surgical codes based on the surgical record using a large language model. The generated diagnostic codes and surgical codes are matched with the diagnostic codes and surgical codes in the medical record cover page and logical corrections are performed between them. If the diagnostic codes and surgical codes match and the logical corrections are correct, the coding quality control in the medical record cover page passes. If the diagnostic codes and surgical codes match but the logical corrections are incorrect or the diagnostic codes and / or surgical codes do not match, the coding quality control in the medical record cover page fails and a report indicating that the coding in the medical record cover page is suspected to be incorrect is output. The third coding quality control module is used to generate corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary, surgical codes based on the surgical record, and pathology codes based on the pathology report using a large language model. The generated diagnostic codes, surgical codes, and pathology codes are matched with the diagnostic codes, surgical codes, and pathology codes in the medical record cover page, and logical corrections are performed between them. If the diagnostic codes, surgical codes, and pathology codes are all matched and the logical corrections are correct, the coding quality control in the medical record cover page passes. If the diagnostic codes, surgical codes, and pathology codes are all matched but there are problems with the logical corrections, or if the diagnostic codes, surgical codes, and / or pathology codes are not matched, the coding quality control in the medical record cover page fails, and a report indicating that the coding in the medical record cover page is suspected to be incorrect is output.
[0013] The present invention also provides an electronic device, characterized in that it includes: Processor; memory for storing processor-executable instructions; wherein the processor is configured to invoke instructions stored in memory to execute the aforementioned inpatient medical record front page coding quality control method based on a large language model.
[0014] The present invention also provides a computer-readable storage medium storing computer program instructions thereon, characterized in that the computer program instructions, when executed by a processor, implement the above-mentioned inpatient medical record front page coding quality control method based on a large language model.
[0015] Based on common knowledge in the field, the above-mentioned preferred conditions can be combined arbitrarily to obtain various preferred embodiments of the present invention.
[0016] The positive and progressive effects of this invention are as follows: This invention targets the coding stage of the medical record front page in electronic medical record systems. It can automatically analyze electronic inpatient medical records and use advanced large language models to accurately and efficiently complete the quality control work of disease diagnosis coding, surgical coding, and pathology coding, thereby greatly improving the accuracy and efficiency of coding.
[0017] This invention achieves full coverage of multiple types of errors, and for the first time incorporates four core issues—omission, extra entries, incorrect entries, and logical conflicts—into a unified identification framework. Compared with traditional single-rule verification systems, the error identification coverage rate is increased by 60%, and the accuracy rate is increased by more than 40%. Attached Figure Description
[0018] Figure 1 This is a flowchart of a preferred embodiment of the inpatient medical record cover page coding quality control method of the present invention.
[0019] Figure 2 This is a structural block diagram of the inpatient medical record cover page coding quality control method according to a preferred embodiment of the present invention. Detailed Implementation
[0020] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] For ease of description, only the parts relevant to the present invention are shown in the accompanying drawings. The terms "first," "second," etc., used in this invention are merely for the convenience of describing the technical solutions of the invention and do not have a specific limiting effect; they are all general references and do not constitute a limitation on the technical solutions of the present invention.
[0023] This invention provides a method for quality control of inpatient medical record cover page coding based on a large language model, which utilizes a large language model to automatically control the coding of the inpatient medical record cover page. To train the large language model, a knowledge base and sample data need to be constructed for training and learning.
[0024] This includes constructing a dedicated knowledge base for the medical coding field, encompassing a medical dictionary, coding principles, coding guidelines, clinical guidelines, a real-time coding rule library, an international disease diagnosis coding library, and a surgical coding library. For this dedicated knowledge base, the SimHash algorithm is first used to calculate the hash value of the knowledge base content, eliminating duplicate data with a similarity exceeding 90% (such as duplicate coding rules in different versions of guidelines). Then, regular expressions are used to standardize the coding format (e.g., unifying "ICD-10 Diagnostic Coding Library I21.9" to "I21.9") and terminology (e.g., unifying "myocardial infarction" and "myocardial infarction" to "myocardial infarction").
[0025] A labeled sample dataset was constructed using a large number of correctly coded cases and a large number of incorrectly coded cases. First, machine pre-labeling combined with manual review was used to label the coded cases. Then, the cases were augmented by replacing synonyms in diagnostic, surgical, and pathological terms (e.g., rewriting "grade 3 hypertension" as "grade 3 hypertension") and reconstructing sentence structures in the coded cases (e.g., changing "patient underwent PCI due to chest pain" to "patient underwent percutaneous coronary intervention (PCI) due to chest pain"), thus constructing the labeled sample dataset.
[0026] For the large language model, the base model should preferably be an open-source model with balanced Chinese and English bilingual capabilities, such as Qwen2.5 (7B / 14B parameter version) or Llama3.1 (8B parameter version). These models offer better accuracy in medical text semantic understanding and professional terminology recognition, and support localized deployment. During the knowledge injection phase, a secondary pre-training process is performed using LoRA (Low-Rank Adaptation) technology. This freezes 90% of the core parameters of the base model, updating only the low-rank matrix related to medical coding knowledge. This keeps the training memory usage between 16GB and 32GB, while setting the learning rate to 1e. -5 ~3e -5 To avoid parameter oscillations, and to ensure model output compliance, a "coding guideline compliance penalty" is added to the fine-tuning loss function. When the model output deviates from the ICD coding principles and clinical guidelines, the loss weight is automatically increased, forcing the model to learn compliant coding logic. In this embodiment, a large language model is trained using a pre-constructed medical coding domain-specific knowledge base and labeled sample dataset to obtain a trained large language model with medical coding logic knowledge. This trained large language model can then be used for coding quality control of the inpatient medical record front page.
[0027] like Figure 1 As shown, the quality control method for coding the inpatient medical record front page based on a large language model includes the following steps: Step 101: The large language model acquires the quality-controlled and corrected electronic inpatient medical records to ensure the completeness, consistency, and timeliness of the information. The electronic inpatient medical records include the medical record cover sheet, diagnostic materials, and / or surgical materials, and / or pathology materials. Diagnostic materials include discharge summaries, surgical materials include surgical records, and pathology materials include pathology reports.
[0028] Step 102: The large language model performs word segmentation and entity extraction on the electronic inpatient medical records.
[0029] Step 103: The large language model determines whether there are two scenarios in the extracted entities. Scenario 1 is that the surgical fee information in the medical record homepage is not zero and / or there is a surgical record in the surgical-related materials. Scenario 2 is that the pathology fee information in the medical record homepage is not zero and / or there is a pathology report in the pathology-related materials. If neither scenario 1 nor scenario 2 exists, proceed to step 104. If only scenario 1 exists, proceed to step 105. If both scenario 1 and scenario 2 exist, proceed to step 106.
[0030] In this step, if neither situation one nor situation two exists, it means that the medical record cover page only contains diagnostic codes and will not contain surgical codes or pathology codes; only quality control of the diagnostic codes is required. If only situation one exists, it means that the medical record cover page contains diagnostic codes and surgical codes, but will not contain pathology codes; only quality control of the diagnostic codes and surgical codes is required. If both situations one and two exist, it means that the medical record cover page contains diagnostic codes, surgical codes, and pathology codes; only quality control of the diagnostic codes, surgical codes, and pathology codes is required.
[0031] Step 104: The large language model compiles the corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary. The compiled diagnostic codes are matched with the diagnostic codes in the medical record cover sheet. If they match, the quality control of the codes in the medical record cover sheet passes; otherwise, the quality control of the codes in the medical record cover sheet fails, and a report indicating that the codes in the medical record cover sheet are suspected to be incorrect is output. The error report provides the error type, error location and content, coding basis and / or correction suggestions.
[0032] For example, the error report format is as follows: [Error Type] Diagnosis missing; [Location] Line 2 of the diagnosis conclusion section in the discharge summary; [Content] The patient has symptoms of "persistent atrial fibrillation," but the corresponding ICD-10 code I48.x00x007 was not filled in; [Code Basis] ICD-10 Chapter 9 "Circulatory System Diseases"; [Correction Suggestion] Supplement code I48.x00x007.
[0033] Furthermore, the coding quality control in this step is optimized: if the codes match perfectly, the coding quality control in the medical record cover page passes; if the codes do not match perfectly and the diagnostic codes in the medical record cover page are missing or extra compared to the compiled diagnostic codes, then the diagnostic codes in the medical record cover page are filled in or extra codes are deleted based on the compiled diagnostic codes, and the coding quality control in the medical record cover page passes; if the codes do not match perfectly and the diagnostic codes in the medical record cover page are incorrect compared to the compiled diagnostic codes, or if the codes do not match perfectly, the coding quality control in the medical record cover page fails, and a report indicating a suspected error in the coding in the medical record cover page is output.
[0034] When only the diagnostic codes on the medical record cover sheet require quality control, there are two scenarios where the coding quality control on the medical record cover sheet passes: 1) The generated diagnostic codes completely match the diagnostic codes on the medical record cover sheet; 2) The generated diagnostic codes do not completely match the diagnostic codes on the medical record cover sheet, and the diagnostic codes on the medical record cover sheet are either missing or extra compared to the generated diagnostic codes. There are also two scenarios where the coding quality control on the medical record cover sheet fails: 1) The generated diagnostic codes do not completely match the diagnostic codes on the medical record cover sheet, and the diagnostic codes on the medical record cover sheet are either incorrectly filled in compared to the generated diagnostic codes; 2) The generated diagnostic codes do not completely match the diagnostic codes on the medical record cover sheet.
[0035] Step 105: The large language model compiles corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary and corresponding surgical codes based on the surgical records. The compiled diagnostic codes and surgical codes are matched with the diagnostic codes and surgical codes in the medical record cover sheet and logical corrections are performed between them (mainly logical corrections between the main diagnostic code and the main surgical code). If the diagnostic codes and surgical codes match and the logical corrections are correct, the coding quality control in the medical record cover sheet passes. If the diagnostic codes and surgical codes match but the logical corrections are incorrect, or if the diagnostic codes and / or surgical codes do not match, the coding quality control in the medical record cover sheet fails. An error report is output, which provides the error type, error location and content, coding basis and / or correction suggestions.
[0036] Furthermore, the coding quality control in this step is optimized: the large language model compiles corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary and corresponding surgical codes based on the surgical records. First, the compiled diagnostic codes and surgical codes are matched with the diagnostic codes and surgical codes in the medical record cover page, and then logical corrections are performed between them. If the diagnostic codes and surgical codes are completely matched and the logical corrections are correct, then the coding quality control in the medical record cover page passes.
[0037] If the diagnostic codes do not match perfectly and the diagnostic codes on the medical record cover page are missing or extra compared to the compiled diagnostic codes, then the diagnostic codes on the medical record cover page will be supplemented / deleted based on the compiled diagnostic codes. And / or, if the surgical codes do not match perfectly and the surgical codes on the medical record cover page are missing or extra compared to the compiled surgical codes, then the surgical codes on the medical record cover page will be supplemented / deleted based on the compiled surgical codes. After that, a logical correction between them will be performed again. If the logical correction is correct, then the code quality control on the medical record cover page will pass.
[0038] If the diagnostic code and surgical code are completely matched but there is a problem with logical correction, or if they are not completely matched and there is a problem with mutual logical correction after another attempt, or if they are not completely matched and the diagnostic code in the medical record cover is incorrect relative to the generated diagnostic code, and / or the surgical code in the medical record cover is incorrect relative to the generated surgical code, or if the diagnostic code and surgical code are completely mismatched, then the coding quality control in the medical record cover fails, and a report indicating that the coding in the medical record cover is suspected to be incorrect is output.
[0039] When there are diagnostic codes and surgical codes on the medical record cover sheet that require quality control, there are four types of codes that pass the quality control: 1) The generated diagnostic codes and surgical codes are completely consistent with the diagnostic codes and surgical codes on the medical record cover sheet, and there are no logical correction issues; 2) The diagnostic codes are not completely consistent, and the diagnostic codes on the medical record cover sheet are missing / excessive compared to the generated diagnostic codes, but there are no logical correction issues after filling in the missing / excessive codes; 3) The surgical codes are not completely consistent, and the surgical codes on the medical record cover sheet are missing / excessive compared to the generated surgical codes, but there are no logical correction issues after filling in the missing / excessive codes; 4) The diagnostic codes and surgical codes are not completely consistent, and the diagnostic codes on the medical record cover sheet are missing / excessive compared to the generated diagnostic codes, and the surgical codes on the medical record cover sheet are missing / excessive compared to the generated surgical codes, but there are no logical correction issues after filling in the missing / excessive codes.
[0040] There are six reasons why the coding quality control in the medical record cover sheet might fail: 1) The diagnosis code and surgical code are completely matched, but there are problems with logical correction; 2) They are not completely matched, and there are problems with logical correction between them; 3) They are not completely matched, and the diagnosis code in the medical record cover sheet is incorrect relative to the generated diagnosis code; 4) They are not completely matched, and the surgical code in the medical record cover sheet is incorrect relative to the generated surgical code; 5) They are not completely matched, and the diagnosis code in the medical record cover sheet is incorrect relative to the generated diagnosis code, and the surgical code in the medical record cover sheet is incorrect relative to the generated surgical code; 6) The diagnosis code and surgical code are completely mismatched.
[0041] For example, based on the medical record's cover page, the diagnosis is K35.905 acute suppurative appendicitis with periappendicitis, the primary surgery is laparoscopic appendectomy, and the secondary surgery is laparoscopic adhesiolysis. If the surgical record confirms the existence of these two surgeries, then according to the principle of matching diagnosis with surgical procedure, the original primary diagnosis is maintained, and a secondary diagnosis code is added: K66.002 intestinal adhesions, thus filling in any missed diagnoses.
[0042] Step 106: The large language model generates corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary, corresponding surgical codes based on the surgical record, and corresponding pathology codes based on the pathology report. The generated diagnostic codes, surgical codes, and pathology codes are matched with the diagnostic codes, surgical codes, and pathology codes in the medical record cover page, and logical corrections are performed between them. If the diagnostic codes, surgical codes, and pathology codes are all matched and the logical corrections are correct, the coding quality control in the medical record cover page passes. If the diagnostic codes, surgical codes, and pathology codes are all matched but there are problems with the logical corrections, or if the diagnostic codes, surgical codes, and / or pathology codes are not matched, the coding quality control in the medical record cover page fails, and a suspected error report is output. The error report provides the error type, error location and content, coding basis, and / or correction suggestions.
[0043] For example: If the colonoscopy report shows transverse colon polyp (EMR treatment) and the pathology report shows transverse colon adenomatous polyp, then the output diagnostic code is: D12.300 benign tumor of the transverse colon, the surgical code is: 45.4300*010 endoscopic resection of colonic mucosa (EMR), and the pathology code is: M82100 / 0 adenomatous polyp.
[0044] Furthermore, the coding quality control in this step is optimized: the large language model compiles corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary, corresponding surgical codes based on the surgical record, and corresponding pathology codes based on the pathology report. First, the compiled diagnostic codes, surgical codes, and pathology codes are matched with the diagnostic codes, surgical codes, and pathology codes in the medical record cover page, and then logical corrections are performed between them. If the diagnostic codes, surgical codes, and pathology codes are completely matched and the logical corrections are correct, then the coding quality control in the medical record cover page passes.
[0045] If the diagnostic codes do not match perfectly and the diagnostic codes on the medical record cover sheet are missing or extra compared to the compiled diagnostic codes, then the diagnostic codes on the medical record cover sheet will be corrected by filling in the missing codes or deleting the extra codes, and / or, if the surgical codes do not match perfectly and the surgical codes on the medical record cover sheet are missing or extra compared to the compiled surgical codes, then the surgical codes on the medical record cover sheet will be corrected by filling in the missing codes or deleting the extra codes, and / or, if the pathology codes do not match perfectly and the pathology codes on the medical record cover sheet are missing or extra compared to the compiled pathology codes, then the pathology codes on the medical record cover sheet will be corrected by filling in the missing codes or deleting the extra codes, and then a logical correction will be performed again. If the logical correction is successful, the coding quality control of the medical record cover sheet is passed.
[0046] If the diagnostic code, surgical code, and pathology code are all perfectly matched but there is a problem with logical correction, or if they are not perfectly matched and there is a problem with logical correction between them again, or if they are not perfectly matched and the diagnostic code in the medical record cover is incorrect relative to the generated diagnostic code, and / or, the surgical code in the medical record cover is incorrect relative to the generated surgical code, and / or, the pathology code in the medical record cover is incorrect relative to the generated pathology code, or if the diagnostic code, surgical code, and pathology code are completely mismatched, then the coding quality control in the medical record cover has failed, and a report indicating a suspected error in the coding in the medical record cover will be output.
[0047] When the medical record cover sheet contains diagnostic codes, surgical codes, and pathology codes that require quality control, there are eight types of codes that pass quality control: 1) The generated diagnostic codes, surgical codes, and pathology codes perfectly match the diagnostic codes, surgical codes, and pathology codes on the medical record cover sheet, and there are no logical correction issues; 2) The diagnostic codes do not perfectly match, and the diagnostic codes on the medical record cover sheet are missing / excessive compared to the generated diagnostic codes, but there are no logical correction issues after performing fill-in / delete operations; 3) The surgical codes do not perfectly match, and the medical record cover sheet contains omissions / excessive entries compared to the generated diagnostic codes; 4) The surgical codes on the homepage are missing / excessive compared to the generated surgical codes, and there are no logical problems after filling in the missing / excessive codes and deleting them; 5) The combination of type 2) and type 3); 6) The combination of type 2) and type 4); 7) The combination of type 3) and type 4); 8) The combination of type 2), type 3) and type 4).
[0048] There are 10 types of errors in the coding quality control of the medical record cover sheet: 1) The diagnosis code, surgical code, and pathology code are completely matched, but there are problems with logical correction; 2) They are not completely matched, and there are problems with logical correction between them again; 3) They are not completely matched, and the diagnosis code in the medical record cover sheet is incorrect relative to the generated diagnosis code; 4) They are not completely matched, and the surgical code in the medical record cover sheet is incorrect relative to the generated surgical code; 5) They are not completely matched, and the pathology code in the medical record cover sheet is incorrect relative to the generated pathology code; 6) A combination of type 3) and type 4); 7) A combination of type 3) and type 5); 8) A combination of type 4) and type 5); 9) A combination of type 3), type 4), and type 5); 10) The diagnosis code, surgical code, and pathology code are completely mismatched.
[0049] The feedback optimization mechanism for error reports consists of three steps: First, after manual review of the error report, the results of "confirming the error" and "excluding false alarms" are sent back to the model; second, the system automatically adds the "confirmed error" cases to the incremental training set; and third, the model incremental update is triggered every Sunday at 23:00, which only updates the LoRA parameters and keeps the time within 1 hour, forming a complete closed loop of "identification-verification-optimization".
[0050] like Figure 2 As shown, this embodiment of the invention also provides a quality control system for inpatient medical record front page coding based on a large language model, including an inpatient medical record acquisition module 1, a judgment module 2, a first coding quality control module 3, a second coding quality control module 4, and a third coding quality control module 5.
[0051] The inpatient medical record acquisition module 1 is used to acquire the electronic inpatient medical records that have been quality-controlled and corrected using a large language model. The electronic inpatient medical records include the medical record cover page, diagnostic-related materials containing a discharge summary, and / or surgical-related materials, and / or pathology-related materials.
[0052] The judgment module 2 is used to use a large language model to determine whether there are two situations in the electronic inpatient medical records. Situation 1 is that the surgical fee information on the medical record homepage is not zero and / or there is a surgical record in the surgical-related materials. Situation 2 is that the pathology fee information on the medical record homepage is not zero and / or there is a pathology report in the pathology-related materials. When neither situation 1 nor situation 2 exists, the first coding quality control module 3 is called. When only situation 1 exists, the second coding quality control module 4 is called. When both situation 1 and situation 2 exist, the third coding quality control module 5 is called.
[0053] The first coding quality control module 3 is used to generate corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary using a large language model. The generated diagnostic codes are then matched with the diagnostic codes in the medical record homepage. If they match, the coding quality control in the medical record homepage passes; otherwise, the coding quality control in the medical record homepage fails, and a report indicating that the coding in the medical record homepage is suspected of being incorrect is output.
[0054] The second coding quality control module 4 is used to generate corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary and corresponding surgical codes based on the surgical records using a large language model. The generated diagnostic codes and surgical codes are matched with the diagnostic codes and surgical codes in the medical record cover page and logical corrections are performed between them. If the diagnostic codes and surgical codes match and the logical corrections are correct, the coding quality control in the medical record cover page passes. If the diagnostic codes and surgical codes match but the logical corrections are incorrect or the diagnostic codes and / or surgical codes do not match, the coding quality control in the medical record cover page fails, and a report indicating that the coding in the medical record cover page is suspected of being incorrect is output.
[0055] The third coding quality control module 5 is used to generate corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary, surgical codes based on the surgical record, and pathology codes based on the pathology report using a large language model. The generated diagnostic codes, surgical codes, and pathology codes are matched with the diagnostic codes, surgical codes, and pathology codes in the medical record cover page, and mutual logical corrections are performed. If the diagnostic codes, surgical codes, and pathology codes are all matched and the logical corrections are correct, the coding quality control in the medical record cover page passes. If the diagnostic codes, surgical codes, and pathology codes are all matched but there are problems with the logical corrections, or if the diagnostic codes, surgical codes, and / or pathology codes are not matched, the coding quality control in the medical record cover page fails, and a report indicating that the coding in the medical record cover page is suspected of being incorrect is output.
[0056] This invention also provides an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the aforementioned inpatient medical record front page coding quality control method based on a large language model.
[0057] This invention also provides a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the aforementioned inpatient medical record front page coding quality control method based on a large language model.
[0058] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0059] While specific embodiments of the present invention have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of the present invention is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but all such changes and modifications fall within the scope of protection of the present invention.
[0060] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A quality control method for coding the front page of inpatient medical records based on a large language model, characterized in that, Includes the following steps: S1. The large language model obtains the electronic inpatient medical records after quality control and correction. The electronic inpatient medical records include the medical record cover page, diagnosis-related materials containing discharge summary, and / or surgery-related materials, and / or pathology-related materials. S2. The large language model determines whether there are Situation 1 and Situation 2 in the electronic inpatient medical record. Situation 1 is that the surgical fee information on the medical record front page is not zero and / or there is a surgical record in the surgical-related materials. Situation 2 is that the pathology fee information on the medical record front page is not zero and / or there is a pathology report in the pathology-related materials. If neither Situation 1 nor Situation 2 exists, proceed to S3. If only Situation 1 exists, proceed to S4. If both Situation 1 and Situation 2 exist, proceed to S5. S3. The large language model compiles the corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary. It then matches the compiled diagnostic codes with the diagnostic codes in the medical record cover page. If they match, the code quality control in the medical record cover page passes; otherwise, the code quality control in the medical record cover page fails, and a report indicating that the code in the medical record cover page is suspected of having an error is output. S4. The large language model compiles corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary and corresponding surgical codes based on the surgical records. The compiled diagnostic codes and surgical codes are matched with the diagnostic codes and surgical codes in the medical record cover page and logical corrections are performed between them. If the diagnostic codes and surgical codes match and the logical corrections are correct, the coding quality control in the medical record cover page passes. If the diagnostic codes and surgical codes match but the logical corrections are incorrect or the diagnostic codes and / or surgical codes do not match, the coding quality control in the medical record cover page fails, and a report indicating a suspected error in the coding in the medical record cover page is output. S5. The large language model generates corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary, corresponding surgical codes based on the surgical record, and corresponding pathology codes based on the pathology report. The generated diagnostic codes, surgical codes, and pathology codes are matched with the diagnostic codes, surgical codes, and pathology codes in the medical record cover page, and logical corrections are performed between them. If the diagnostic codes, surgical codes, and pathology codes are all matched and the logical corrections are correct, the coding quality control in the medical record cover page passes. If the diagnostic codes, surgical codes, and pathology codes are all matched but there are problems with the logical corrections, or if the diagnostic codes, surgical codes, and / or pathology codes are not matched, the coding quality control in the medical record cover page fails, and a report indicating that the coding in the medical record cover page is suspected of being incorrect is output.
2. The inpatient medical record cover sheet coding quality control method based on a large language model according to claim 1, characterized in that, In step S3, if the codes match perfectly, the coding quality control in the medical record cover page passes. If the codes do not match perfectly and the diagnostic codes in the medical record cover page are missing or extra compared to the compiled diagnostic codes, then the diagnostic codes in the medical record cover page are filled in or deleted based on the compiled diagnostic codes, and the coding quality control in the medical record cover page passes. If the codes do not match perfectly and the diagnostic codes in the medical record cover page are incorrect compared to the compiled diagnostic codes, or if the codes do not match perfectly, the coding quality control in the medical record cover page fails, and a report indicating a suspected error in the coding in the medical record cover page is output.
3. The inpatient medical record cover sheet coding quality control method based on a large language model as described in claim 1, characterized in that, In S4, the large language model compiles corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary and corresponding surgical codes based on the surgical records. First, the compiled diagnostic codes and surgical codes are matched with the diagnostic codes and surgical codes in the medical record homepage, and then the logical correction between them is performed. If the diagnostic codes and surgical codes are completely matched and the logical correction is correct, the coding quality control in the medical record homepage passes. If the diagnostic codes do not match completely and the diagnostic codes in the medical record cover page are missing or extra compared to the compiled diagnostic codes, then the diagnostic codes in the medical record cover page are filled in or deleted based on the compiled diagnostic codes. And / or, if the surgical codes do not match completely and the surgical codes in the medical record cover page are missing or extra compared to the compiled surgical codes, then the surgical codes in the medical record cover page are filled in or deleted based on the compiled surgical codes. After that, the mutual logical correction is performed again. If the logical correction is not a problem, the code quality control of the medical record cover page passes. If the diagnostic code and surgical code are completely matched but there is a problem with logical correction, or if they are not completely matched and there is a problem with mutual logical correction after another attempt, or if they are not completely matched and the diagnostic code in the medical record cover is incorrect relative to the generated diagnostic code, and / or the surgical code in the medical record cover is incorrect relative to the generated surgical code, or if the diagnostic code and surgical code are completely mismatched, then the coding quality control in the medical record cover fails, and a report indicating that the coding in the medical record cover is suspected to be incorrect is output.
4. The inpatient medical record cover sheet coding quality control method based on a large language model as described in claim 1, characterized in that, In S5, the large language model generates corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary, corresponding surgical codes based on the surgical record, and corresponding pathology codes based on the pathology report. First, the generated diagnostic codes, surgical codes, and pathology codes are matched with the diagnostic codes, surgical codes, and pathology codes in the medical record cover page, and then logical corrections are performed between them. If the diagnostic codes, surgical codes, and pathology codes are completely matched and the logical corrections are correct, then the coding quality control in the medical record cover page passes. If the diagnostic codes do not match perfectly and the diagnostic codes on the medical record cover page are missing or extra compared to the compiled diagnostic codes, then the diagnostic codes on the medical record cover page are filled in or deleted based on the compiled diagnostic codes. Similarly, if the surgical codes do not match perfectly and the surgical codes on the medical record cover page are missing or extra compared to the compiled surgical codes, then the surgical codes on the medical record cover page are filled in or deleted based on the compiled surgical codes. And similarly, if the pathology codes do not match perfectly and the pathology codes on the medical record cover page are missing or extra compared to the compiled pathology codes, then the pathology codes on the medical record cover page are filled in or deleted based on the compiled pathology codes. Afterwards, a logical correction is performed between the codes. If the logical correction is successful, the coding quality control on the medical record cover page passes. If the diagnostic code, surgical code, and pathology code are all perfectly matched but there is a problem with logical correction, or if they are not perfectly matched and there is a problem with logical correction between them again, or if they are not perfectly matched and the diagnostic code in the medical record cover is incorrect relative to the generated diagnostic code, and / or, the surgical code in the medical record cover is incorrect relative to the generated surgical code, and / or, the pathology code in the medical record cover is incorrect relative to the generated pathology code, or if the diagnostic code, surgical code, and pathology code are completely mismatched, then the coding quality control in the medical record cover has failed, and a report indicating a suspected error in the coding in the medical record cover will be output.
5. The inpatient medical record cover sheet coding quality control method based on a large language model as described in claim 1, characterized in that, A dedicated knowledge base for the medical coding domain is constructed. A labeled sample dataset is built using a large number of correctly coded and incorrectly coded cases. The large language model is then trained using the constructed dedicated knowledge base for the medical coding domain and the labeled sample dataset to obtain a well-trained large language model with medical coding logic knowledge.
6. The inpatient medical record cover sheet coding quality control method based on a large language model as described in claim 5, characterized in that, The base model of the large language model uses the open-source model Qwen2.5 or Llama3.
1. During the knowledge injection stage, secondary pre-training is performed using LoRA low-rank adaptation technology, freezing 90% of the core parameters of the base model and updating only the low-rank matrix related to medical coding knowledge. A coding guideline compliance penalty term is added to the model's fine-tuning loss function. When the model output deviates, the loss weight is automatically increased to force the model to learn compliant coding logic. For a knowledge base specifically for the medical coding field, the SimHash algorithm is first used to calculate the hash value of the knowledge base content, and duplicate data with a similarity of more than 90% is removed. Then, the coding format and terminology are standardized using regular expressions. For a large number of correctly coded cases and a large number of incorrectly coded cases, the coding cases are first labeled using a machine pre-labeling + manual review mode. Then, the cases are enhanced by replacing synonyms for diagnostic terms, surgical terms and pathological terms, and reconstructing the sentence structure of the case sentences, thus constructing a labeled sample dataset.
7. The inpatient medical record cover sheet coding quality control method based on a large language model as described in claim 1, characterized in that, Between S1 and S2, the following is included: the large language model performs word segmentation and entity extraction on electronic inpatient medical records; In S2, the large language model determines whether the extracted entities contain Case 1 and Case 2.
8. A quality control system for coding the front page of inpatient medical records based on a large language model, characterized in that, It includes an inpatient medical record acquisition module, a judgment module, a first coding quality control module, a second coding quality control module, and a third coding quality control module; The inpatient medical record acquisition module is used to acquire the electronic inpatient medical record after quality control correction using a large language model. The electronic inpatient medical record includes a medical record cover page, diagnostic-related materials containing a discharge summary, and / or surgical-related materials, and / or pathology-related materials. The judgment module is used to use a large language model to determine whether there are two situations in the electronic inpatient medical record. Situation 1 is that the surgical fee information on the medical record homepage is not zero and / or there is a surgical record in the surgical-related materials. Situation 2 is that the pathology fee information on the medical record homepage is not zero and / or there is a pathology report in the pathology-related materials. When neither situation 1 nor situation 2 exists, the first coding quality control module is called. When only situation 1 exists, the second coding quality control module is called. When both situation 1 and situation 2 exist, the third coding quality control module is called. The first coding quality control module is used to use a large language model to compile corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary, and to match the compiled diagnostic codes with the diagnostic codes in the medical record front page. If they match, the coding quality control in the medical record front page passes; otherwise, the coding quality control in the medical record front page fails and a report indicating that the coding in the medical record front page is suspected of being incorrect is output. The second coding quality control module is used to generate corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary and corresponding surgical codes based on the surgical record using a large language model. The generated diagnostic codes and surgical codes are matched with the diagnostic codes and surgical codes in the medical record cover page and logical corrections are performed between them. If the diagnostic codes and surgical codes match and the logical corrections are correct, the coding quality control in the medical record cover page passes. If the diagnostic codes and surgical codes match but the logical corrections are incorrect or the diagnostic codes and / or surgical codes do not match, the coding quality control in the medical record cover page fails and a report indicating that the coding in the medical record cover page is suspected to be incorrect is output. The third coding quality control module is used to generate corresponding diagnostic codes based on the discharge diagnosis information in the discharge summary, surgical codes based on the surgical record, and pathology codes based on the pathology report using a large language model. The generated diagnostic codes, surgical codes, and pathology codes are matched with the diagnostic codes, surgical codes, and pathology codes in the medical record cover page, and logical corrections are performed between them. If the diagnostic codes, surgical codes, and pathology codes are all matched and the logical corrections are correct, the coding quality control in the medical record cover page passes. If the diagnostic codes, surgical codes, and pathology codes are all matched but there are problems with the logical corrections, or if the diagnostic codes, surgical codes, and / or pathology codes are not matched, the coding quality control in the medical record cover page fails, and a report indicating that the coding in the medical record cover page is suspected to be incorrect is output.
9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in memory to execute the inpatient medical record front page coding quality control method based on a large language model as described in any one of claims 1-7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the inpatient medical record front page coding quality control method based on a large language model as described in any one of claims 1-7.