Quality control method and system for automatic coding of electronic medical record
By combining a large language model with a manually verified electronic medical record automatic encoding method, the problem of low efficiency in electronic medical record quality control was solved, the generation of high-quality data sets and medical research support was achieved, and an end-to-end medical data production line was built.
Patent Information
- Application Number
- CN202511176695.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-10-17
AI Technical Summary
Existing technologies are unable to effectively handle the writing standardization, information integrity and structured conversion of unstructured texts in electronic medical records, resulting in low quality control efficiency and subjective results, making it impossible to achieve high-quality medical research applications.
By adopting an intelligent quality control system and a full-cycle governance framework based on a large language model, combined with manual verification, an end-to-end medical data production line is built through scoring modules, extraction modules, splitting modules and fusion modules to achieve intelligent scoring, fine-grained variable extraction and standardized coding of medical records.
Ensure the high quality and traceability of electronic medical record data, provide high-quality, analyzable scientific research data sets, and support the in-depth application of medical research.
Smart Images

Figure CN120809045A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of medical system informatization technology, in particular to a quality control method and system for automatic coding of electronic medical records. BACKGROUND
[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute prior art.
[0003] In the current era of rapid development of medical informatization, electronic medical records have become the core carrier of carrying massive medical big data and supporting medical research and clinical decision-making. The data quality and standardization directly determine the depth of scientific research output, the accuracy of medical insurance audit, and even the optimization potential of clinical pathways.
[0004] However, for a long time, electronic medical records have faced many challenges in terms of writing standardization, information integrity, structured transformation of unstructured text, and consistency of cross-system data, which has seriously restricted their application in high-quality medical research.
[0005] Traditional quality control systems that rely on manual or rule-based engines cannot cope with the challenges of complex expression and semantic reasoning, resulting in low efficiency and subjective results. Moreover, electronic medical record systems generally only perform formal quality control and cannot perform high-quality diagnosis and treatment quality control on unstructured data such as medical records and examinations. SUMMARY
[0006] To solve the above problems, the present application provides a quality control method and system for automatic coding of electronic medical records, which constructs an end-to-end, intelligent and manual verification combined medical data production line, and through a systematic, intelligent and multi-artificial verification process, aims to produce high-quality, traceable scientific data sets.
[0007] To achieve the above purpose, the present application adopts the following technical solutions: In a first aspect, the present application provides a quality control method for automatic coding of electronic medical records, comprising: Obtaining medical records of a single visit process of a patient, assigning a corresponding LLM score template according to the type of the medical records, and scoring the medical records based on the LLM score template to generate a structured score report, and modifying the medical records based on the structured score report to obtain high-quality medical records; Using Python regularization scripts to extract fine-grained variables from high-quality medical records, and associating the fine-grained variables with patient ID and corresponding medical record ID to form a clinical detail data set; Obtaining all medical records of a patient's entire cycle of medical records, performing entity splitting on all medical records, mapping the split medical entities to a standard coding system, and obtaining structured medical entity data; Integrating high-quality medical record documents, clinical detail data sets, and structured medical entity data into structured scientific research data sets.
[0008] As an optional implementation, the LLM scoring template includes role setting, scoring rules, mandatory item checks, and output format requirements; wherein the scoring rules include various scoring standards for medical record document writing, score allocation, and specific deduction details; the mandatory item checks include basic information, chief complaint, present illness history, past medical history, specialist situation, and preliminary diagnosis; and the output format requirements include output JSON format, matching predefined Pydantic data structure.
[0009] As an optional implementation, a dedicated scoring task chain is constructed for each medical record document, and each scoring task chain is bound to the Prompt template of the corresponding medical record document, the expected output data structure definition, and the selected LLM model instance.
[0010] As an optional implementation, the fine-grained variable is a variable with regularity, fixed format, or standardized expression, including specific examination values, explicit measurement units, dates, and numerical parts of standardized diagnosis codes.
[0011] As an optional implementation, all medical records are horizontally associated by patient ID, and data in different business tables are cross-table associated through JOIN operation and sorted in chronological order; all medical records include diagnosis records, drug records, surgery records, and test records.
[0012] As an optional implementation, the entity splitting process includes using comma, colon, semicolon, and line break as explicit boundary markers, and combining context attention mechanism to determine the association strength between different words in medical record text, thereby determining the separation point between entities; each split entity corresponds to a row of records, including: original field, split field, field category, field origin position, and field end position.
[0013] As an optional implementation, the process of mapping to the standard coding system includes: for the tree structure of the standard coding, the similarity between terms is calculated according to the hierarchical relationship of the standard coding, and the similarity is used as a continuous value for model training, and the label classification method used during training is: for the same standard coding, the similarity is 1; for different categories under the same major category, the similarity is 0.9; for the same system but different diseases, the similarity is 0.7; for different systems or completely unrelated diseases, the similarity is 0.3 or less.
[0014] As an alternative implementation, during training, the positive sample pairs are constructed by using the Dropout mechanism. For the same input term, two different but semantically identical vector representations of the term are generated by two different Dropout operations, and are used as a pair of positive samples; at the same time, term synonyms and common variants are introduced as additional positive sample pairs.
[0015] In a second aspect, the present application provides a quality control system for automatic coding of electronic medical records, comprising: The scoring module is configured to obtain medical records of a single visit process of a patient, assign a corresponding LLM scoring template according to the type of the medical records, score the medical records based on the LLM scoring template, generate a structured scoring report, modify the medical records based on the structured scoring report, and obtain high-quality medical records; The extraction module is configured to extract fine-grained variables from the high-quality medical records by using a Python regularization script, associate the fine-grained variables with patient IDs and corresponding medical record IDs, and construct a clinical detail dataset; The splitting module is configured to obtain all medical records of a patient's full-cycle medical record, perform entity splitting on all medical records, map the split medical entities to a standard coding system, and obtain structured medical entity data. The fusion module is configured to integrate the high-quality medical records, the clinical detail dataset, and the structured medical entity data into a structured scientific research dataset.
[0016] In a third aspect, the present application provides an electronic device, comprising a memory and a processor, and computer instructions stored in the memory and running on the processor, when the computer instructions are executed by the processor, the method of the first aspect is completed.
[0017] In a fourth aspect, the present application provides a computer-readable storage medium for storing computer instructions, when the computer instructions are executed by a processor, the method of the first aspect is completed.
[0018] In a fifth aspect, the present application provides a computer program product comprising a computer program, when the computer program is executed by a processor, the method of the first aspect is completed.
[0019] Compared with the prior art, the present application has the following advantages: This innovative approach integrates an intelligent quality control system for electronic medical records (EMRs) based on a large language model with a full-cycle governance framework, aiming to build an end-to-end medical data production line that combines intelligent driving and manual verification. Initially, raw medical records undergo rigorous intelligent scoring, followed by manual review by clinical experts to ensure the high quality and authority of the original data entered into the database. Next, a Python regularization script is used to accurately extract fine-grained variables from high-quality records, supplementing the clinical details lacking in coarse-grained data such as the medical record homepage. Manual spot checks are also used to strictly control the extraction quality. Furthermore, with the patient's unique ID as the core, all relevant medical records (such as diagnoses, medications, surgeries, and tests) throughout the entire treatment cycle are efficiently linked and integrated, and intelligent entity segmentation and standardized coding are performed on the diverse data. The entire process prioritizes multi-dimensional manual intervention and traceability mechanisms to ensure the accuracy and credibility of the intelligent processing results. Through a systematic, intelligent process that incorporates multiple manual verifications, the goal is to produce high-quality, traceable research datasets.
[0020] This invention combines intelligent technology with rigorous processes: medical record quality control uses a scoring mechanism to identify document defects, establishing a quality benchmark for data governance; and data governance leverages standardized processes to transform unstructured data into analyzable structured resources. Together, these two technologies form a complete technical chain of "quality assessment - standardized processing - in-depth application." This provides a key driver for the shift from "quantity" to "quality" in medical research based on large-scale electronic medical record data (such as long-term outcome analysis for patients with cholelithiasis and studies linking medication patterns to efficacy). This provides a solid data foundation for the continued development of smart healthcare and in-depth research in precision medicine.
[0021] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention 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 merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0023] Figure 1 Flowchart of the quality control method for automatic coding of electronic medical records provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0024] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0025] It should be noted that the following detailed description is exemplary in nature and is intended to provide further description of the application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0026] It is also to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting, as the scope of the application will be limited only by the appended claims. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof.
[0027] The embodiments in the application and the features in the embodiments can be combined with each other without conflict.
[0028] Embodiment 1 The embodiment provides a quality control method for automatic coding of electronic medical records, and comprises the following steps: Obtaining medical record documents in a single visit process of a patient, assigning a corresponding LLM score template according to the type of the medical record documents, scoring the medical record documents according to the LLM score template, and generating a structured score report; and modifying the medical record documents according to the structured score report to obtain high-quality medical record documents; Extracting fine-grained variables from the high-quality medical record documents by using a Python regularization script, and associating the fine-grained variables with a patient ID and a corresponding medical record document ID to form a clinical detail data set; Obtaining all medical record documents of a patient in a whole cycle of medical records, performing entity splitting on all the medical record documents, and mapping the split medical entities to a standard coding system to obtain structured medical entity data; Integrating the high-quality medical record documents, the clinical detail data set and the structured medical entity data into a structured scientific research data set.
[0029] The following will be described in detail Figure 1 The embodiment method will be described in detail.
[0030] First stage: high-quality medical record document source quality control and fine-grained variable extraction
[0031] This stage focuses on front-end quality control and in-depth information mining of original medical record documents generated within a medical institution, to ensure that the text content entering the subsequent data governance process is of high quality and contains more rich clinical details.
[0032] Step 1: Raw medical record document input and preliminary structuring.
[0033] The sources of raw medical record document data include hospital HIS systems (Hospital Information System), LIS systems (Laboratory Information System), PACS systems (picture archiving and communication system), etc. According to the patient (taking cholelithiasis surgery patients as an example) visit dimension, raw data is extracted, and with visit ID as the index, outpatient medical records and inpatient medical records are obtained respectively. For outpatient medical records, outpatient records are obtained, and for inpatient medical records, various medical documents (such as admission records, operation records, discharge summaries, examination reports, etc.) are obtained. Each raw record contains a unique visit ID, which serves as the basic index unit for subsequent quality control and scoring.
[0034] The purpose of this step is to merge all medical records generated during the same visit according to visit_id, and assemble them into a standard structured input format, which is transmitted to the next step of the quality control model for processing and scoring through a unified API interface. Detailed description: 1. Data entry design: The system front end exposes services through a unified API interface (provided by the main service interface module). This API interface is the only window for the entire system to interact with external medical record systems or data sources, ensuring the standardization and security of data transmission.
[0035] 2. Pydantic model mandatory structure: The data received uses the VisitInput and DocumentInput Pydantic data models. Pydantic is a data validation, settings management and serialization library based on Python type hints.
[0036] 3. Data verification: Before the data is processed, Pydantic will strictly verify the type and format of all incoming fields. For example, patient_id must be a string, type must be a predefined enumeration value (such as "inpatient medical record", "outpatient medical record"), content must exist and be a string, etc. Any input that does not conform to the preset structure will be rejected, thereby ensuring the quality and consistency of the data from the source.
[0037] 4. Type hints: Pydantic combines Python's type hinting feature, making the input data structure clear, easy to understand and maintain, reducing the complexity of subsequent development and debugging.
[0038] 5. Data Serialization / Deserialization: Pydantic enables easy conversion of data in formats like JSON, dictionaries, etc., to strongly typed Python objects and vice versa, greatly simplifying data flow and processing within the system.
[0039] 6. Top-level encapsulation of VisitInput: The VisitInput model represents a complete visit record. It contains patient_id (a unique identifier for the patient, ensuring global uniqueness of patient data), visit_id (a unique number for this visit, used to distinguish the patient's visit records at different time points), type (clearly indicating the type of this visit, such as "hospitalization", "outpatient", or "emergency"), and a documents list. The documents list allows multiple medical records to be submitted at once during a visit, such as admission records, surgical records, discharge records, etc., which is crucial for batch processing and maintaining the integrity of the visit.
[0040] 7. Detailed information of DocumentInput: The DocumentInput model focuses on the detailed information of a single medical record. It includes category (the category name of the document, such as "admission record", "preoperative record", etc., for manual identification and classification), category_id (a standardized string identifier within the document, used for internal logic mapping to specific scoring modules), and content (the core text content of the document, which is the main input for semantic analysis by large models). In addition, the content_add field provides flexibility, allowing the inclusion of some auxiliary, non-core but possibly relevant supplementary notes.
[0041] 8. Support for concurrent processing: This structural design (especially the documents list and module decoupling) supports asynchronous I / O (asyncio). The main service module can receive multiple documents and use asyncio to implement concurrent processing, i.e., simultaneously distributing multiple documents to different scoring task chains for parallel scoring, thereby greatly improving the throughput and efficiency of the system in processing large-scale medical record data.
[0042] Work output: After Pydantic model verification and initial structuring, the internal unified format of the document object stream, which contains the original text content and necessary metadata (such as patient_id, visit_id, category_id), will serve as the input for the next step of intelligent quality control.
[0043] Step 2: Large model-driven medical record intelligent quality control and scoring.
[0044] According to the pre-established scoring standard version, such as the scoring standard version for inpatient and outpatient medical records of patients with gallbladder stone surgery, the specific scoring module is encapsulated with a Prompt template using the LangChain framework. By constructing a large model inference module (medical_record_scoring.py, the core driving force of the entire intelligent quality control), a large language model (Qwen3-32B) is called to analyze and judge different types of medical documents (such as admission records, discharge records, surgical records, and medical records) in depth and give scores and deduction reasons. The scoring results are output according to the pre-designed Prompt template.
[0045] The core goal of this step is to judge the completeness, standardization, and clinical logic of each medical record document and output a highly transparent structured scoring report.
[0046] Details: 1. Module cooperation and scheduling: When the main service interface module receives one or a batch of medical record documents, it will dynamically route them to the corresponding specific scoring module (such as admission_score.py) according to the category_id of each document (for example, category_id identified as "admission record"). This decoupled design makes the system easy to expand and allows for easy addition of new document types and corresponding scoring logic.
[0047] 2. Core engine: Large model inference module (medical_record_scoring.py), which is the core driving force of the entire intelligent quality control. It is responsible for building an "intelligent scoring engine" by calling a large language model (LLM), which in this study is Qwen3-32B, to analyze different types of medical documents (such as admission records, discharge records, surgical records, and medical records) in depth.
[0048] 3. Encapsulate pre-designed Prompt template: The specific scoring module encapsulates a pre-designed Prompt template, which guides the LLM to analyze and score from the perspective of "doctor / quality control expert".
[0049] Taking the "admission record Prompt" as an example, its design includes: (1) Role setting: implicitly requires LLM to make judgments based on professional medical knowledge and clinical thinking.
[0050] (2) Detailed Scoring Rules: Clearly lists each scoring criterion for medical record writing, score allocation (e.g., "Complaint" 15 points, of which "Main symptoms or signs" 10 points, "Duration" 5 points), and specific deduction rules (e.g., "Lack of cause description" deduction). Ensure that the scoring logic of the LLM is highly consistent with the artificial quality control standards.
[0051] (3) Mandatory Item Check: Clearly indicate which items are mandatory (such as basic information, chief complaint, history of present illness, past history, specialist situation, preliminary diagnosis), and if missing, must be listed in the missing_required field, which is crucial for ensuring the integrity of the core information of the medical record.
[0052] (4) Strict Output Format Requirements: The Prompt clearly states that the LLM output must be in complete JSON format and strictly match the pre-defined Pydantic data structure (such as AdmissionScoringResult). This ensures that the free-text output of the LLM can be stably parsed and processed by subsequent programs. Emphasize that the score must be an integer and cannot fabricate medical records.
[0053] 4. Intelligent Scoring Execution and Asynchronous Scheduling: (1) LLMChain Construction: The large model inference module uses the LangChain framework to build a dedicated "scoring task chain" (LLMChain) for each medical record document. Each chain is bound to the corresponding document Prompt template, expected output data structure definition (parsed by PydanticOutputParser to force the LLM's JSON output), and selected LLM model instance.
[0054] (2) Concurrency and Robustness: After receiving multiple documents, the system can automatically distribute them to the corresponding scoring chains and execute scoring tasks through asyncio, significantly improving processing efficiency, especially suitable for large-scale medical record batch scoring scenarios. Each task has built-in result recording, exception handling and failure retry mechanisms to ensure system stability and data processing reliability.
[0055] 5. Extraction of Structured Scoring Results and Missing Item Recording: The output of the LLM is converted into structured scoring results, including the specific score of each scoring item, detailed deduction reasons (such as "No duration description"), and the document category and Chinese name to which it belongs.
[0056] Automatically determine whether there are missing mandatory fields or necessary document types, and clearly output the missing prompts. These information will serve as direct feedback for doctors to improve medical record writing.
[0057] For complex documents like "progress notes", support sub-class scoring (such as preoperative rounds, postoperative records), each sub-class record scoring is independent, only the highest score is retained, and the total score is calculated by weighting according to the sub-class standard limit, avoiding repeated scoring, ensuring the fairness and consistency of scoring.
[0058] Work output: detailed, transparent, structured medical record document scoring report for model training, and upload visual artificial review platform.
[0059] Step 3: Intelligent scoring quality control of original medical record documents: artificial review by clinical experts.
[0060] This link is the key point of artificial intervention to ensure the quality of medical record documents and the authority of scoring results. After the completion of automatic scoring, professional clinical experts are introduced to manually review the automatic scoring report generated by the system, and modify the scoring results or original medical record content accordingly. This makes up for the potential shortcomings of the automated system in complex semantic understanding and clinical logical judgment, and can be used to supervise the performance of the scoring system, feedback and update the scoring rules or Prompt templates.
[0061] Detailed description: 1. Review object and interface function: the intelligent scoring of all medical record documents is reviewed by clinical experts on the visual review platform. Clinical experts review the original medical record document content, the detailed results of the system's automatic scoring (including the score of each scoring item, the reason for deduction, and the missing item prompt), and compare them with the actual clinical situation and the original writing specifications of the medical record document to determine whether the intelligent scoring is correct.
[0062] 2. Artificial review and modification: experts can manually adjust any item in the automatic scoring based on their clinical experience and professional judgment, and input the final artificial score.
[0063] 3. Modification reason record: for any manual scoring adjustment or modification of the original medical record document content (such as correcting typos, supplementing missing information, etc., which needs to be operated carefully to ensure compliance), the expert must record the modification reason in detail. The reason can be selected from pre-set categories (such as "model misjudgment", "semantic ambiguity", "standard understanding difference", "supplement missing") or customized text, providing a basis for subsequent data audit and model optimization.
[0064] 4. Audit state marking: experts need to mark the audit state of each reviewed medical record (such as "audit passed", "modified passed", "rejected"), and clearly indicate its quality state.
[0065] 5. Audit Records and Traceability: All expert review operations, including who reviewed the records, when, which medical records were modified, which scoring items were modified, the content modified, the values before and after the modification, and the reasons for the modification, will be accurately recorded by the system to form a detailed audit log. These logs ensure the traceability and clear accountability of data quality decisions.
[0066] 6. Strengthened Quality Control: Only after manual review and final confirmation of compliance by clinical experts, will the original text of the medical record, along with the final confirmed scoring results, be marked as "high quality" and allowed to enter the subsequent fine-grained variable extraction and full-cycle data governance process. This step is a critical barrier to ensure the highest quality and clinical credibility of source data throughout the entire data pipeline.
[0067] Work outputs: A structured medical record scoring report containing the final confirmation score from clinical experts, as well as high-quality original medical record texts selected based on manual review results.
[0068] Step 4: Extract fine-grained variables from high-quality medical records.
[0069] After review by clinical experts, medical records entering this step are considered high-quality, accurate, and relatively complete. The core goal of this step is to go beyond the coarse-grained information provided by traditional structured data such as the medical record cover page. Deeper mining and extraction of more detailed, clinically significant variables from these high-quality, unstructured medical records can reveal, for example, the specific size, number, location, morphology, and severity of gallstones, as well as other microscopic features associated with specific diseases. These variables are invaluable for precision research and clinical decision-making.
[0070] Details: 1. Python regular expression variable extraction: For fine-grained variables with high regularity, relatively fixed format, or relatively standardized expression (such as specific examination values, clear units of measurement, dates, the numeric portion of standardized diagnosis codes, etc.), these variables will be accurately associated with the patient's unique ID and the corresponding medical record document ID, forming a high-quality clinical detail dataset that can be used for disease characteristic analysis, risk prediction, etc.
[0071] 2. Manual sampling of extracted variables: To ensure the accuracy and quality of fine-grained variable extraction, this phase involves systematic manual sampling of the extracted results. For example, this phase focuses on extracting variables that are significantly relevant to the research objectives (e.g., number of stones, presence of lesions), or those with high rule matching ambiguity. A random sampling of a certain percentage of medical records is also performed to thoroughly verify all extracted fine-grained variables.
[0072] The details are as follows: (1) Sampling scale: The "100x100 variable table" sampling mode is adopted, that is, 100 medical record documents are randomly selected from the data set, and for each document, all the fine-grained variables extracted by it are manually checked (assuming that each medical record extracts X variables on average, then 100*X variable instances are checked). This matrix sampling can effectively cover different medical records and different variable types.
[0073] (2) Quality evaluation index: After manual sampling, accuracy, recall rate, F1-Score and other indicators are calculated to evaluate the quality of variable extraction.
[0074] (3) Feedback and optimization: Errors found during the sampling process (including extraction errors, omissions, and false positives) will be recorded in detail and used as direct evidence for iterative optimization of the regularization script. For example, if it is found that a regular expression frequently misses a certain format of stone size, the regular expression needs to be revised.
[0075] (4) Audit record: All manual sampling records (sampler, sampling time, sampling results, problems found and suggestions) will be included in the audit log to ensure the transparency and traceability of the data quality evaluation process.
[0076] Work output: Fine-grained variables are extracted from high-quality medical record original documents, and the extraction quality evaluation report is obtained, which includes high-quality structured table data containing stone size, number, location, shape, etc., laying the foundation for subsequent research.
[0077] Second stage: Integration and standardization of patient's whole cycle medical records.
[0078] The core task of this stage is to break through the limitations of single medical record documents, take the patient as the center, gather all related records in the whole cycle of medical activities, and intelligently split and standardize the coding of these original data from different systems and formats. This lays the foundation for building a real patient longitudinal panoramic data view.
[0079] Step 5: Integration and extraction of patient's whole cycle medical records.
[0080] Based on the unique patient ID obtained through the first stage of quality control and fine-grained variable extraction, all relevant medical records of the patient before and after are comprehensively and systematically extracted from the electronic medical record database. Including but not limited to diagnostic information, drug use, surgical operation records and various test results, aiming to build a complete and panoramic medical health portrait of the patient in the time dimension.
[0081] Details: 1. Data source and complexity: The electronic medical record database is a large and complex integrated system that brings together heterogeneous data from medical institutions at all levels. These data may be scattered in different relational database tables (such as diagnosis tables, drug tables, surgery tables, test tables, outpatient prescription details, inpatient drug orders, inpatient non-drug orders, and case history home pages, etc.), and the recording methods of the data may differ (such as free text, semi-structured text, or coded form).
[0082] 2. Patient unique ID link: Using ID as the unique and consistent primary key, the transverse correlation of all patient medical records is realized.
[0083] 3. Cross-table association query: Through JOIN operation, the data scattered in different business tables (such as diagnosis table, drug order table, surgery table, expense detail table, etc.) are organically integrated to ensure that all relevant information of the patient in each medical link is obtained.
[0084] 4. Time sequence integration: In the extraction process, the records are sorted in chronological order to analyze the evolution of the patient's course of disease.
[0085] 5. Comprehensive extraction range: (1) Diagnosis records: Cover all diagnosis information of the patient under different types of medical treatment (outpatient, emergency, inpatient), including admission diagnosis, main diagnosis, secondary diagnosis, case history home page diagnosis, and outpatient / emergency diagnosis, which are usually recorded in free text form.
[0086] (2) Drug records: Extract all medication details of the patient during inpatient period (inpatient drug orders) and outpatient period (outpatient prescription details), including drug name, dosage, frequency, and administration route. These information may exist in various forms such as trade name, generic name, and abbreviation.
[0087] (3) Surgery records: Extract all surgical operation information of the patient from the surgery table in the case history home page or the special surgery record table, including surgery name, surgery date, and surgery method, which are often described in free text.
[0088] (4) Test records: Integrate various test information from outpatient expense details, inpatient expense details, and inpatient non-drug orders, such as blood routine, liver function, kidney function, and imaging examination (X-ray, CT, MRI), including item name and result.
[0089] Work output: The collection of all original diagnosis, drug, surgery, and test medical records of the patient throughout the cycle is gathered, which usually exists in the form of free text or semi-structured form, and is the direct input for subsequent entity splitting and standardized coding.
[0090] Step 6: Medical entity intelligent splitting.
[0091] This step is the key first step to realize the conversion of unstructured medical text to structured data. The fields such as diagnosis, drugs, surgery, and tests containing a large amount of free text extracted in step 5 are first split into entities using a Chinese named entity recognition (NER) model based on the BERT (Bidirectional Encoder Representations from Transformers) architecture. Through multi-task learning, the model can not only split multiple terms but also classify them into categories (diagnosis, drugs, surgery, tests, misdiagnosis, TCM diagnosis, pathology), thereby breaking down continuous text streams into independent, standardizable basic semantic units.
[0092] Details: 1. NER model under BERT architecture: Based on the powerful pre-trained language model BERT (Bidirectional Encoder Representations from Transformers) architecture. BERT learns rich language representation capabilities through bidirectional training on large amounts of unlabeled text (i.e., considering both left and right context information for a word). Specifically: (1) Domain fine-tuning: To enable accurate recognition of medical field professional terms, the BERT model is fine-tuned on a large amount of medical annotation data. This means that the model not only understands general language, but also understands medical vocabulary, terminology, abbreviations, and their meanings in specific clinical contexts.
[0093] (2) Bidirectional context understanding: Traditional NER models may only consider one-way context, while the bidirectional nature of BERT allows it to more accurately understand complex sentence structures and ambiguous words. For example, "sickness" can refer to "disease" or "lesion" in different contexts, and BERT can accurately determine it based on the context. It can also handle professional abbreviations such as "AMI" (acute myocardial infarction) and make correct identification.
[0094] (3) Robustness and scalability: The model supports dynamic expansion of medical field-specific vocabulary library and word embedding enhancement, which is crucial for constantly updated medical knowledge and newly emerging clinical terms. At the same time, it has strong compatibility for common noise data in medical text, such as mixed English and Chinese writing, unstructured spelling errors, or colloquial expressions, which are very common in actual clinical data.
[0095] 2. Entity splitting logic: Entity splitting takes commas, colons, line breaks, etc. as potential boundary markers, and uses context attention mechanisms to determine the reasonableness of separation. Specifically: (1) Boundary marker: The explicit boundary markers in the text (such as comma, colon, semicolon, line break) and the implicit contextual semantic information are comprehensively utilized to determine the separation points between entities.
[0096] (2) Contextual attention mechanism: Through self-attention mechanism, the correlation strength between different words in the text is determined. For example, in the original diagnosis field "chronic cholecystitis with gallbladder stones, fatty liver, and diabetes history", the model will identify and split out "chronic cholecystitis with gallbladder stones", "fatty liver", and "diabetes history" as three independent disease entities, even though they are only separated by commas, but are independent disease concepts in terms of semantics.
[0097] 3. Output structured data table: The model output is not a simple text list, but a structured table containing rich meta-information. Each split entity corresponds to a row record, including: Original field: Where does this entity come from? The original, unsplit text field.
[0098] Split field: The actual recognized and extracted entity text itself.
[0099] Field category: Clearly, the entity belongs to diagnosis, drug, surgery, or test, etc. predefined category.
[0100] Field origin position and field end position: The exact character index of the entity in the original text, which is very useful for subsequent tracing and text visualization.
[0101] Work output: Output the list of medical entities after intelligent splitting and preliminary classification. These entities are highly standardized basic semantic units, providing clean and regular input for the next step of standard coding, and are the key foundation for realizing the structured and standard coding of electronic medical record data.
[0102] Step 7: Medical entity standard coding and recoding.
[0103] This step aims to build a system for automatic mapping of medical terms to standardized codes, addressing the problem of mapping various types of unstructured terms such as diagnoses, tests, surgeries, and medications to a unified standard code. Traditional term standardization work heavily relies on manual or rule-based maintenance, which is inefficient and inconsistent. Especially when faced with differences in hospital terminology and free writing, manual standardization is costly and has poor scalability. Therefore, an automatic coding scheme based on contrastive learning is proposed, combining deep semantic modeling and structured standard systems to achieve fast, accurate, and high-throughput medical term coding capabilities. This step further processes the medical entities split in Step 6 with deep semantic processing and accurately maps them to the provincial unified standard coding system. The core innovation lies in the integration of deep semantic modeling based on contrastive learning and structured standard systems, building a multi-level and highly accurate automated standard coding system.
[0104] Details: 1. SimCSE-based contrastive learning model: The core of this coding model is the SimCSE (Simple Contrastive Learning of Sentence Embeddings) architecture. SimCSE is a method that optimizes sentence vector representations through contrastive learning. The core idea is to let semantically similar phrases (such as medical terms) be close to each other in the vector space, while semantically unrelated phrases are far apart. Specifically as follows: (1) Encoder: The bottom encoder chooses the general pre-trained language model BERT. BERT learns rich language representation capabilities through bidirectional training on large amounts of unlabeled text. To adapt to medical field professional terms, this BERT model is fine-tuned on a large amount of medical annotated data, enabling it to accurately capture medical vocabulary, terminology, abbreviations, and their meanings in specific clinical contexts.
[0105] (2) Positive sample construction: In the training phase, SimCSE cleverly uses the Dropout mechanism to construct positive sample pairs. For the same input term, two different Dropout operations (i.e., randomly "dropping" some neurons in the model inference path) can generate two slightly different but semantically identical vector representations of the term, which are considered as a pair of positive samples.
[0106] (3) Training strategy: During model training, synonym terms, common variants, and other additional positive sample pairs are introduced for training. This greatly enhances the model's generalization ability and robustness, enabling it to handle hospital terminology differences and free writing variants. Even if the expressions are different but the meanings are similar, the entities will be close to each other in the vector space, thus overcoming the limitations of traditional keyword matching.
[0107] (4) Semantic vector optimization: The output term vector is optimized through contrastive learning in the training stage, which allows similar terms to be aggregated and irrelevant terms to be separated, ensuring that the encoder can generate high-quality semantic embeddings.
[0108] 2. Standard encoding and "soft label": For the tree structure of standard encoding (such as the chapter, category, and subclass hierarchy of ICD encoding), the similarity between terms is calculated based on the hierarchical relationship of standard encoding, and the similarity is used as a continuous value for model training. Instead of using traditional 0 / 1 label classification, the training is done as a continuous value. Wherein, for the same standard encoding, the similarity is 1; for different categories under the same major category (such as the same chapter of ICD encoding), the similarity is 0.9; for different diseases in the same system (such as two different diseases in the digestive system), the similarity is 0.7; for different systems or completely unrelated diseases, the similarity is 0.3 or less.
[0109] This soft label strategy significantly improves the model's ability to recognize and robustness to boundary samples (i.e., terms with semantic between matching and non-matching), allowing the model to learn more refined semantic gradients.
[0110] 3. Faiss vector database in prediction phase: Faiss (Facebook AI Similarity Search) is a high-efficiency similarity search library designed specifically for fast retrieval of large-scale vector sets.
[0111] Specifically as follows: (1) Pre-encoding and storage: In the prediction phase, all standard terms and their corresponding standard encodings (e.g., each disease name from ICD-10, each laboratory test item name from CNAS, each surgery name from ICD10-CM3, and each drug name from YPID) are pre-encoded into high-dimensional semantic vectors by the model and stored in a Faiss vector database.
[0112] (2) Fast matching: When encoding an input term, only the vector of the input term needs to be sent to Faiss, and the Top-1 or Top-K standard encodings with the most similar semantics can be retrieved within milliseconds as the matching result. This method realizes "one-time encoding and high-speed retrieval", greatly improving the coding efficiency.
[0113] 4. Support of four core dictionary libraries: The standardization encoding process of the model relies on the following unified and strictly verified authoritative dictionary libraries to ensure accurate classification and industry consistency, as follows: (1) Disease coding system: Covers the main diagnosis coding of diseases, and more detailed classification codes for concurrent and combined clinical scenarios, providing an authoritative basis for fine coding of clinical diagnosis. For example, it can accurately distinguish between "essential hypertension" and "hypertensive nephropathy".
[0114] (2) Drug coding dimension: Covers a multi-dimensional network of drug information such as generic name, trade name, specification, and dosage form. Ensures that different forms of drug names (such as "amoxicillin capsules" and "Amoxicillin") can accurately correspond to a unique standard code, effectively solving the common name confusion problem in clinical medication data.
[0115] (3) Surgery coding system: Based on ICD10-CM3, it contains specific classification codes for surgical operations (such as specific codes for "cholecystectomy"), and innovatively introduces surgical level classification (such as I, II, III, and IV level surgeries), which provides important data support for medical quality assessment, surgical difficulty classification, and medical cost accounting management needs.
[0116] (4) Examination item coding: Achieves full-dimensional standardization of test items and examination methods, from basic blood tests (such as "blood routine") to high-end imaging examinations (such as "CT scan"), all can be accurately located in the unified coding system, ensuring the interoperability of test results.
[0117] 5. "Intelligent model + authoritative dictionary" dual-engine architecture: This architecture is the core advantage of this step, as follows: (1) Technical guarantee: SimCSE model provides strong semantic analysis capability, while authoritative dictionary provides solid specification constraints. This combination ensures consistency (differences in the expression of the same entity field in different data sources are eliminated by standard coding), completeness (dictionary library covers more than 98% of common entity types in clinical practice, and edge cases are reasonably classified through semantic vector matching mechanism), and standardization (all coding results meet the provincial medical information exchange specifications), laying a solid foundation for regional medical data sharing.
[0118] (2) Overcome limitations: This system avoids the coding bias that may occur when relying solely on statistical models (for example, the model may incorrectly code uncommon expressions without rule constraints), and breaks through the limitations of traditional rule or dictionary matching technology in semantic understanding (for example, traditional methods have difficulty identifying that "A type hemophilia" and "factor VIII deficiency" are different expressions of the same disease).
[0119] 6. Bridge for cross-institutional information exchange: This deep fusion coding mechanism not only improves the standardization and usability of medical data, but also builds a bridge for cross-institutional and cross-system information exchange. When regional medical platforms access this coding system, electronic medical records, test reports, and prescription information from different hospitals can be seamlessly integrated under a unified standard, providing high-quality data support for complex application scenarios such as hierarchical diagnosis and treatment, clinical pathway management, and medical insurance cost control. It promotes the transition of medical information governance from data integration to knowledge discovery.
[0120] Work output: Structured medical entity data with standardized coding, including original entity text, standardized name, corresponding standard code, coding type (disease, drug, surgery, test, etc.), and possible coding level details.
[0121] Third stage: Multi-dimensional manual review, correction, and result output.
[0122] This stage is the final quality assurance of the entire fusion process. By introducing the concept of "human-machine collaboration," the results of the previous two stages of automated processing are strictly audited by multi-dimensional manual review. All error records will be corrected or rejected, and all operations will be detailed, ensuring that the final output of scientific data sets has the highest credibility and traceability.
[0123] Step 8: Overall manual review, correction, and traceability.
[0124] Establish a multi-dimensional, full-process manual review and intervention mechanism to systematically verify the model output results from all automated processing links such as medical record document intelligent scoring, fine-grained variable extraction, original name splitting, and standard coding. The core goal is to ensure the accuracy, consistency, and credibility of all data, and to record detailed logs for each audit and modification operation to achieve traceability of operations.
[0125] Detailed explanation: 1. Risk identification: Not all data is subjected to indiscriminate manual review, but first, intelligent algorithms are used for risk identification. For example, items with a confidence level below a predetermined threshold (e.g., model output confidence level below 80%) are given priority for manual review.
[0126] 2. Human focus: Reviewers will prioritize manual review of low-confidence data, and the "human-machine collaboration" model greatly improves the efficiency and input-output ratio of manual review, focusing limited human resources on complex scenarios that truly require human judgment.
[0127] 3. Audit interface and dictionary support: Reviewers operate through a friendly graphical user interface (GUI). The interface clearly displays split names, standard names, and corresponding standard codes and confidence levels.
[0128] 4. Instant correction: If the reviewer finds that the disease diagnosis code output by the model does not match the original name (e.g., the "pneumonia" is incorrectly matched to a digestive system disease code), the modification can be made directly on the review interface.
[0129] 5. Authority dictionary library support: Built-in and integrated standardized dictionary library of health field coding system of all categories (including ICD-10 disease code, operation code, drug classification code, etc., and supports real-time synchronization of industry standard updates) provides strong technical support for review and correction, which can quickly locate the correct standard name and replace it through keyword search, hierarchical directory browsing, etc.
[0130] For example, when the model incorrectly associates "amoxicillin capsules" with "amoxicillin sodium for injection" code, the reviewer can search the drug generic name in the dictionary library, select the corresponding oral immediate-release dosage form name, and the system will automatically correspond to the correct standard code. This correction process can be completed within 20 seconds, significantly improving efficiency.
[0131] 6. Modification and rejection: Reviewers can correct incorrect records and automatically match the correct standard code. For records that cannot be corrected or have poor quality (e.g., the original text is severely missing or ambiguous), they can be marked as "rejected," indicating that the data is not suitable for high-quality scientific research. Modified or rejected entries will be marked as "manual" and enter a separate review process.
[0132] 7. Data modification traceability mechanism ensures traceability: These records form an independent audit log, which can be flexibly searched and exported according to time period, operator, data type, modification content, etc. This provides empirical evidence for data quality backtracking, responsibility definition, model performance evaluation and optimization. For example, when subsequent data application links find that the accuracy rate of a certain type of chronic disease code is abnormal, the modification records of this batch of data can be quickly located through the log to analyze whether the modification reason is concentrated in the model training data missing, etc., thereby guiding the iterative optimization of the model.
[0133] Work output: After manual verification and correction, high-accuracy medical record quality control score results, fine-grained variable data, entity splitting results, and standardized coding data. All modifications are recorded in detail to ensure the reliability of the data.
[0134] Step 9: High-quality structured scientific data set output and application.
[0135] This is the final goal of the entire integration process, which is to integrate and output the data that has undergone all intelligent quality control, fine variable extraction, full-cycle data integration, standardized coding, and multi-dimensional manual review, forming a high-credibility, easy-to-analyze structured scientific research data set. This data set will be directly used in actual medical research to support deeper clinical insights and scientific discoveries.
[0136] Details: 1. Data final integration: In this step, the data processed in the previous stages is unified and logically integrated. This includes: (2) Fine-grained variable data: Accurately extracted from high-quality medical records and confirmed by manual review, these clinical details such as stone size, number, location, and shape are accurately associated with patient ID and corresponding visit / document ID.
[0137] (3) Standardized full-cycle medical records: The full-cycle medical records (diagnosis, drugs, surgery, tests, etc.) processed by standardized coding and manually reviewed in Step 7 are also associated with the unique patient ID and sorted by time axis.
[0138] (4) Unified structured table: The data after coding and review will be uniformly exported to a standard structured table format (such as CSV file, Excel file, or directly written into relational database table). This ensures that the data can be easily loaded and processed by various data analysis tools (such as R, Python, SAS, SPSS, etc.) and statistical software.
[0139] 2. Core application value: The data set that has undergone intelligent quality control, fine extraction, comprehensive standardization, and multi-dimensional manual verification can effectively reduce data noise, bias, and errors, thereby significantly improving the reliability, accuracy, and reproducibility of medical research (such as clinical cohort study, epidemiological investigation, and prognosis prediction model construction) based on these data. Researchers can more confidently perform hypothesis testing and conclusion derivation.
[0140] Work output: The final, comprehensive, accurate, traceable, standardized structured scientific research data set is directly used for medical research, data modeling, and clinical decision support.
[0141] This implementation innovatively integrates an intelligent quality control system for electronic medical records (EMRs) based on a large language model with a full-cycle governance framework. The goal is to build an end-to-end medical data production line that combines intelligent driving and manual verification. First, original medical records undergo rigorous intelligent scoring, followed by manual review by clinical experts to ensure the high quality and authority of the source data entered into the database. Next, these high-quality records are accurately extracted using Python regularization scripts to supplement the clinical details lacking in coarse-grained data such as the medical record homepage. Manual spot checks are also performed to strictly control the extraction quality. Furthermore, with the patient's unique ID as the core, all relevant medical records (such as diagnoses, medications, surgeries, and tests) throughout the entire treatment cycle are efficiently linked and integrated. This diverse data set is then intelligently segmented and standardized into entities. The entire process prioritizes multi-dimensional manual intervention and traceability mechanisms to ensure the accuracy and credibility of the intelligent processing results. Through a systematic, intelligent process that incorporates multiple manual verifications, the goal is to produce high-quality, traceable research datasets.
[0142] The above solution in this embodiment combines intelligent technology with rigorous processes: Medical record quality control uses a scoring mechanism to identify document defects, establishing a quality benchmark for data governance; while data governance utilizes standardized processes to transform unstructured data into analyzable structured resources. Together, these two elements form a complete technical chain of "quality assessment - standardized processing - in-depth application." This provides a key driver for the shift from "quantity" to "quality" in medical research based on large-scale electronic medical record data (such as long-term outcome analysis of cholelithiasis patients and studies on the correlation between medication patterns and efficacy), laying a solid data foundation for the sustainable development of smart healthcare and in-depth research in precision medicine.
[0143] It should be noted that all data is obtained in compliance with laws and regulations and with user consent, and the data is used legally.
[0144] Example 2 This embodiment provides a quality control system for automatic coding of electronic medical records, including: The scoring module is configured to obtain the medical records of a single patient visit, assign a corresponding LLM scoring template according to the type of medical record, score the medical record using the template, generate a structured scoring report, and modify the medical record based on the structured scoring report to obtain a high-quality medical record; The extraction module is configured to extract fine-grained variables from high-quality medical records using a Python regularization script and associate the fine-grained variables with the patient ID and the corresponding medical record ID to form a clinical detail dataset; The splitting module is configured to obtain all medical record documents of a patient's whole-cycle medical record, perform entity splitting on all the medical record documents, map the split medical entities to a standard coding system, and obtain structured medical entity data. The fusion module is configured to integrate the high-quality medical record documents, the clinical detail data set, and the structured medical entity data into a structured scientific research data set.
[0145] It should be noted that the above modules correspond to the steps described in Embodiment 1, and the above modules have the same examples and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules can be executed in a computer system such as a set of computer executable instructions as part of the system.
[0146] In more embodiments, there are also provided: An electronic device includes a memory and a processor, and computer instructions stored on the memory and running on the processor, when the computer instructions are run by the processor, the method described in Embodiment 1 is completed. For brevity, it will not be described here.
[0147] It should be understood that in the present embodiment, the processor can be a central processing unit CPU, and the processor can also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, ready-to-program gate arrays FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0148] The memory can include read-only memory and random access memory, and provide instructions and data to the processor, and a part of the memory can also include non-volatile random access memory. For example, the memory can also store device type information.
[0149] A computer readable storage medium for storing computer instructions, when the computer instructions are executed by a processor, the method described in Embodiment 1 is completed.
[0150] The method in Embodiment 1 can be directly embodied as a hardware processor to complete, or a combination of hardware and software modules in the processor to complete. The software module can be located in a mature storage medium in the art such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.
[0151] A computer program product comprising a computer program which, when executed by a processor, implements the method described in embodiment 1.
[0152] The present application also provides at least one computer program product tangibly stored on a non-transitory computer readable storage medium. The computer program product includes computer executable instructions, for example, instructions included in program modules, executed by devices on a target real or virtual processor to perform processes / methods as described above. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform particular tasks or implement particular abstract data types. In various embodiments, the functionality of program modules can be combined or split between program modules as desired. Machine executable instructions for program modules can be executed within a local or distributed device. In a distributed device, program modules can be located in local and remote memory storage devices.
[0153] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages. The computer program code can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program code, when executed by the computer or other programmable data processing apparatus, causes the machine to perform the functions / acts specified in the flowcharts and / or block diagrams. The computer program code can also be loaded onto a computer, a processor or other programmable data processing apparatus to cause a series of operations to be performed on the computer, processor or other programmable data processing apparatus to produce a computer implemented process such that the computer program code which executes on the computer or other programmable data processing apparatus provides processes for implementing the functions / acts specified in the flowcharts and / or block diagrams.
[0154] In the context of the present application, the computer program code or related data can be carried by any suitable carrier, to enable the device, apparatus or processor to perform the various processes and operations described above. Examples of carriers include signals, computer readable media, and the like. Examples of signals can include electrical, optical, radio, sound or other forms of propagated signals, such as carrier waves, infrared signals, and the like.
[0155] Those skilled in the art can realize that the units and algorithm steps of each example described in connection with the present embodiments can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solutions. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0156] The above describes the specific embodiments of the present application in combination with the drawings, but is not a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications or variations made by those skilled in the art on the basis of the technical solutions of the present application without creative labor are still within the protection scope of the present application.
Claims
1. A quality control method for automatic coding of electronic medical records, characterized in that: include: Obtain the medical records of a patient's single visit, assign the corresponding LLM scoring template according to the type of medical record, and use it to score the medical record, generate a structured scoring report, and modify the medical record based on the structured scoring report to obtain high-quality medical records; We used Python regularization scripts to extract fine-grained variables from high-quality medical records and associated the fine-grained variables with patient IDs and corresponding medical record IDs to form a clinical detail dataset. Obtain all medical records of the patient's full-cycle medical records, split all medical records into entities, and map the split medical entities to the standard coding system to obtain structured medical entity data; Integrate high-quality medical records, clinical detail datasets, and structured medical entity data into structured scientific research datasets.
2. A quality control method for automatic coding of electronic medical records as claimed in claim 1, characterized in that: The LLM scoring template includes role settings, scoring rules, mandatory item checks, and output format requirements. The scoring rules include the scoring criteria, score allocation, and specific deduction rules for medical record writing. Mandatory item checks include basic information, chief complaint, current medical history, past medical history, specialty status, and preliminary diagnosis. Output format requirements include output in JSON format, matching the predefined Pydantic data structure.
3. A quality control method for automatic coding of electronic medical records as claimed in claim 2, characterized in that: A dedicated scoring task chain is constructed for each medical record document. Each scoring task chain is bound to the prompt template of the corresponding medical record document, the expected output data structure definition, and the selected LLM model instance.
4. The quality control method for automatic coding of electronic medical records according to claim 1, characterized in that: Fine-grained variables are those with regularity, fixed format, or standardized expression, including specific examination values, clear units of measurement, dates, and the numeric part of standardized diagnostic codes; All medical records are horizontally linked using the patient ID, and data from different business tables are linked across tables using JOIN operations and sorted in chronological order; All medical records include: diagnosis records, medication records, operation records and laboratory test records; The entity splitting process includes using commas, colons, semicolons, and line breaks as explicit boundary markers, and combining the contextual attention mechanism to judge the association strength between different words in the medical record text, thereby determining the separation points between entities; each split entity corresponds to a row of records, including: original field, split field, field category, field origin position, and field end position.
5. The quality control method for automatic coding of electronic medical records according to claim 1, characterized in that: The process of mapping to the standard coding system includes: for the tree structure of the standard coding, the similarity between terms is calculated according to the hierarchical relationship of the standard coding, and the model is trained as a continuous value. The label classification method used during training is: for exactly the same standard coding, the similarity is 1; for different categories under the same category, the similarity is 0.9; for different diseases in the same system, the similarity is 0.7; for different systems or completely unrelated diseases, the similarity is below 0.
3.
6. A quality control method for automatic coding of electronic medical records as claimed in claim 5, characterized in that: During training, the Dropout mechanism is used to construct positive sample pairs. For the same input term, two different Dropout operations are performed to generate two different but semantically identical vector representations of the term, which serve as a pair of positive samples. Synonyms and common variants of the term are also introduced as additional positive sample pairs.
7. A quality control system for automatic coding of electronic medical records, characterized in that: include: The scoring module is configured to obtain the medical records of a single patient visit, assign a corresponding LLM scoring template according to the type of medical record, score the medical record using the template, generate a structured scoring report, and modify the medical record based on the structured scoring report to obtain a high-quality medical record; The extraction module is configured to extract fine-grained variables from high-quality medical records using a Python regularization script and associate the fine-grained variables with the patient ID and the corresponding medical record ID to form a clinical detail dataset; A splitting module is configured to obtain all medical records of a patient's full-cycle medical records, split all medical records into entities, and map the split medical entities to a standard coding system to obtain structured medical entity data; The fusion module is configured to integrate high-quality medical records, clinical detail datasets, and structured medical entity data into structured scientific research datasets.
8. An electronic device, characterized in that: The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 6 is completed.
9. A computer-readable storage medium, characterized in that Used to store computer instructions, which, when executed by a processor, complete the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The invention comprises a computer program, which is used to implement the method according to any one of claims 1 to 6 when the computer program is executed by a processor.
Citation Information
Cited By
Intelligent medical record classification method and system
CN121545658A
Medical record home page quality management and control system and method based on big data analysis
CN121565358A