Medical record summary generation method and device of electronic medical record system, electronic equipment and storage medium
By constructing a medical knowledge graph and similar diagnostic cases, and dynamically adjusting the prompt words of the large language model, the accuracy problem of medical record summaries in different medical scenarios of electronic medical record systems has been solved, and more accurate medical record summary generation has been achieved.
Patent Information
- Application Number
- CN202511441666.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2026-03-06
AI Technical Summary
Existing electronic medical record systems rely on third-party general-purpose large language models, which cannot adapt to different medical scenarios and document complexity, resulting in low accuracy of medical record summaries.
By combining multiple medical documents and dialogue texts uploaded by users, the prompt words of the large language model are dynamically adjusted, and a medical knowledge graph and similar diagnostic cases are constructed to generate a medical record summary.
It improves the accuracy of medical record summaries, meets user needs, adapts to the current patient's condition, and generates more accurate medical record summaries.
Smart Images

Figure CN121617528A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of medical data processing application technology, and in particular to a method, apparatus, electronic device and storage medium for generating medical record summaries based on a large language model. Background Technology
[0002] Against the backdrop of digital transformation in healthcare, medical institutions generate a massive amount of medical documents daily, including medical records, examination reports, prescriptions, and diagnostic certificates. Existing electronic medical record (EMR) systems primarily rely on third-party general-purpose language models, employing static prompt word templates. When faced with complex medical documents and clinical application needs, these fixed static prompt word templates cannot adapt to different medical scenarios and document complexity. This results in lower accuracy of medical record summaries generated by EMR systems based on third-party general-purpose language models when handling marginal cases and complex medical situations. Summary of the Invention
[0003] Therefore, it is necessary to address the aforementioned technical problems by providing a method, apparatus, electronic device, and storage medium for generating medical record summaries in an electronic medical record system based on a large language model. This method can dynamically adjust the prompt words of the large language model of the electronic medical record system by combining multiple medical documents uploaded by the user and / or the dialogue text entered by the user, thereby making the medical record summaries generated by the electronic medical record system based on the large language model more accurate.
[0004] According to a first aspect of certain exemplary embodiments of this disclosure, a method for generating a medical record summary in an electronic medical record system based on a large language model is provided, comprising: receiving multiple medical documents of a patient uploaded by a user and / or dialogue text input by the user; extracting the patient's medical record content from the multiple medical documents and / or dialogue text; retrieving similar diagnostic cases from a case library based on the medical record content, and constructing a medical knowledge graph based on the medical record content; constructing prompt words based on the medical knowledge graph, similar diagnostic cases, and a preset prompt word template, wherein the prompt word template reserves positions for the medical knowledge graph and similar diagnostic cases; and inputting the prompt words into a trained large language model of the electronic medical record system to obtain a patient's medical record summary output by the trained large language model.
[0005] In one example, a method for generating medical record summaries in an electronic medical record system based on a large language model further includes: determining a base model of the large language model; configuring a first parameter on the base model; pre-training the base model with the first parameter configured based on a general corpus and a basic medical corpus to obtain a first-stage training model; configuring a second parameter on the first-stage training model; training the first-stage training model with the second parameter configured based on medical textbook corpus and medical journal literature to obtain a second-stage training model; configuring a third parameter on the second-stage training model; training the second-stage training model with the third parameter configured based on multiple specialized professional knowledge to obtain a third training model; configuring a fourth parameter on the third-stage training model; obtaining standard medical question-answer pairs; and performing supervised fine-tuning training on the third-stage training model with the fourth parameter configured based on the standard medical question-answer pairs to obtain a trained large language model.
[0006] In one example, the learning rate in the first, second, third, and fourth parameters decreases sequentially; the batch size in the first parameter is greater than the batch size in the second parameter, and the number of training epochs in the first parameter is less than the number of training epochs in the second parameter; the third parameter contains configuration information for training in batches according to specialties and configuration information for the number of training epochs for each specialty; the batch size in the fourth parameter is configured based on the size of the base model, the gradient accumulation steps in the fourth parameter are set based on the memory requirements of the base model, and the number of training epochs in the fourth parameter is configured based on the convergence of the base model.
[0007] In one example, extracting patient medical record content from multiple medical documents and / or conversation texts includes: if any medical document is an image document, performing one or more of the following processing on the image document: denoising, geometric correction, light equalization, handwritten character enhancement, table line enhancement, and stamp removal, to obtain an enhanced medical document image; performing text recognition on the medical document image using optical recognition technology to obtain the document content; and extracting medical terminology from the medical record content.
[0008] In one example, extracting a patient's medical record content from multiple medical documents and / or conversation texts includes: upon receiving multiple medical documents uploaded by a user, constructing a time series based on the medical timeline and the multiple medical documents, with the time series containing the time, document type, and document content summary of each medical document; obtaining key information summaries of each medical document; wherein, the medical record content includes the time series and key information summaries of each medical document.
[0009] In one example, similar diagnostic cases are retrieved from a case library based on medical record content. This includes: extracting patient features, examination features, and symptom features from the key information summaries of each medical document, and constructing feature vectors based on these features; calculating the similarity between the feature vectors and the vectors of each diagnostic case in the case library to obtain multiple preliminary similar cases and the vector similarity between each preliminary similar case and the medical record content; obtaining the patient feature similarity, examination feature similarity, and symptom feature similarity between each preliminary similar case and the medical record content; determining the overall similarity between each preliminary similar case and the medical record content based on the vector similarity, patient feature similarity, examination feature similarity, and symptom feature similarity corresponding to each preliminary similar case; and selecting similar diagnostic cases from the multiple preliminary similar cases based on the overall similarity between each preliminary similar case and the medical record content.
[0010] In one example, a medical knowledge graph is constructed based on medical record content, including: extracting multiple medical entities and the relationships between them from the medical record content; constructing a hierarchical medical knowledge graph based on the medical entities and their relationships; and constructing prompts based on the medical knowledge graph, similar diagnostic cases, and a preset prompt template, including: identifying the locations of similar diagnostic cases in the prompt template and filling them into those locations; identifying the locations of the medical knowledge graph within the prompt template; and filling each medical entity and its relationships into those locations within the medical knowledge graph.
[0011] According to a second aspect of certain exemplary embodiments of this disclosure, an apparatus for generating a medical record summary for an electronic medical record system includes: a receiving module for receiving multiple medical documents of a patient uploaded by a user and / or dialogue text input by the user; an extraction module for extracting the patient's medical record content from the multiple medical documents and / or dialogue text; a retrieval module for retrieving similar diagnostic cases from a case library based on the medical record content; a first construction module for constructing a medical knowledge graph based on the medical record content; a second construction module for constructing prompt words based on the medical knowledge graph, similar diagnostic cases, and a preset prompt word template, wherein the prompt word template reserves positions for the medical knowledge graph and similar diagnostic cases; and a medical record summary generation module for inputting the prompt words into a trained large language model of the electronic medical record system to obtain a patient's medical record summary output by the trained large language model.
[0012] According to a third aspect of certain exemplary embodiments of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above methods.
[0013] According to a fourth aspect of certain exemplary embodiments of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0014] The aforementioned method, apparatus, electronic device, and storage medium for generating medical record summaries in an electronic medical record system based on a large language model include: receiving multiple medical documents uploaded by a user and / or user-inputted dialogue text; extracting the patient's medical record content from the medical documents and / or dialogue text; retrieving similar diagnostic cases from a case database based on the medical record content; constructing a medical knowledge graph based on the medical record content; constructing prompt words based on the medical knowledge graph, similar diagnostic cases, and a preset prompt word template, wherein the prompt word template reserves positions for the medical knowledge graph and similar diagnostic cases; and inputting the prompt words into a trained large language model to obtain the patient's medical record summary output by the trained large language model. Therefore, it is possible to retrieve similar diagnostic cases based on the patient's medical record content, construct a medical knowledge graph based on the patient's medical record content, and dynamically construct prompt words that meet the user's question-and-answer needs and are adapted to the current patient's condition based on similar diagnostic cases, the medical knowledge graph, and the preset prompt word template. Inputting the prompt words into the large language model of the electronic medical record system results in a medical record summary that better meets user needs and is more accurate. Attached Figure Description
[0015] Figure 1 This is a schematic diagram illustrating an application scenario of a method for generating medical record summaries in an electronic medical record system based on a large language model, as shown in some exemplary embodiments of this disclosure. Figure 2 This is a flowchart illustrating a method for generating medical record summaries in an electronic medical record system based on a large language model, as shown in some exemplary embodiments of this disclosure. Figure 3 This is a structural block diagram of a medical record summary generation apparatus for an electronic medical record system based on a large language model, as shown in some other exemplary embodiments of this disclosure. Figure 4 This is a diagram illustrating the internal structure of an electronic device in some other exemplary embodiments of this disclosure. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0017] The following detailed descriptions are provided to aid the reader in gaining a comprehensive understanding of the methods, apparatus, electronic devices, storage media, and / or computer program products described herein. However, upon understanding the disclosure of this disclosure, various changes, modifications, and equivalents of the methods, apparatus, storage media, and / or computer program products described herein will become apparent. For example, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein, but may be changed as will become clear upon understanding the disclosure of this disclosure, except for operations that must occur in a specific order. Furthermore, for clarity and conciseness, descriptions of features known in the art may be omitted.
[0018] The features described herein may be implemented in different forms and should not be construed as limited to the examples described herein. Rather, the examples described herein are provided only to illustrate some of the many feasible ways of implementing the methods, electronic devices, and / or storage media described herein, many of which will become clear upon understanding this disclosure.
[0019] The terminology used herein is for the purpose of describing various examples only and is not intended to limit disclosure. Unless the context clearly indicates otherwise, the singular form is intended to include the plural form as well. The terms “comprising,” “including,” and “having” indicate the presence of the described features, quantities, operations, components, elements, and / or combinations thereof, but do not exclude the presence or addition of one or more other features, quantities, operations, components, elements, and / or combinations thereof. Unless otherwise stated, “ / ” means “or,” for example, A / B can mean A or B; “and / or” in the text is merely a description of the relationship between related objects, indicating that three relationships can exist, for example, A and / or B can mean: A alone, A and B simultaneously, and B alone. Furthermore, in the description of embodiments of the invention, “multiple” means two or more.
[0020] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains upon understanding this disclosure. Unless expressly defined herein, terms (such as those defined in a general dictionary) shall be interpreted as having a meaning consistent with their meaning in the context of the relevant field and in this disclosure, and shall not be interpreted in an idealized or overly formalistic manner.
[0021] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in some of the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0022] Furthermore, in the description of the examples, detailed descriptions of well-known related structures or functions will be omitted when it is believed that such detailed descriptions would lead to a vague interpretation of this disclosure.
[0023] In the following description, embodiments will be described in detail with reference to the accompanying drawings. However, embodiments may be implemented in various forms and are not limited to the examples described herein.
[0024] In some exemplary embodiments of this disclosure, the application scenarios of a method for generating medical record summaries in an electronic medical record system are as follows: Figure 1 As shown. The user can be a doctor. The doctor uploads multiple medical documents of the patient to the electronic medical record system and can also input dialogue text simultaneously. The electronic medical record system is configured with an interaction module. The interaction module is configured with a large language model and dynamic prompt words. The electronic medical record system extracts the patient's medical record content from multiple medical documents and / or dialogue text; retrieves similar diagnostic cases from the case library based on the medical record content, and constructs a medical knowledge graph based on the medical record content. Then, based on the medical knowledge graph, similar diagnostic cases, and preset prompt word templates, prompt words are constructed, where the prompt word templates reserve positions for the medical knowledge graph and similar diagnostic cases. The prompt words are input into the trained large language model of the electronic medical record system to obtain the patient's medical record summary output by the trained large language model.
[0025] In some exemplary embodiments of this disclosure, such as Figure 2 As shown, a method for generating medical record summaries in an electronic medical record system is provided, including the following steps: Step 201: Receive multiple medical documents of the patient uploaded by the user and / or dialogue text entered by the user.
[0026] In this embodiment, the user can be a doctor. The patient's multiple medical documents include admission records, CT scan reports, pathology reports, surgical records, discharge summaries, and other documents related to the patient's admission, examinations, and treatments. These medical documents can be in editable PDF format, non-editable image-based PDF format, image format, or Word format, etc. The user-input dialogue text describes the patient's medical records and personal information.
[0027] Step 202: Extract the patient's medical record content from multiple medical documents and / or conversation texts.
[0028] In this embodiment, the electronic medical record system provides two entry points. One is the document upload entry point, and the other is the user input dialogue text entry point. Users can provide patient medical record content by uploading multiple medical documents, and / or by inputting dialogue text.
[0029] In one example, the electronic medical record system is configured with a multimodal medical document processing module, which is used to process medical documents in various file formats. This includes extracting patient medical record content from multiple medical documents, such as: if any medical document is an image document, performing noise reduction, geometric correction, light equalization, and one or more of the following processing methods: handwritten character enhancement, table line enhancement, and stamp removal, to obtain an enhanced medical document image; performing text recognition on the medical document image using optical character recognition technology to obtain the document content; and extracting medical terminology from the document content to obtain the medical record content.
[0030] Specifically, the multimodal medical document processing module is equipped with medical image enhancement technologies, such as denoising algorithms tailored to the characteristics of medical documents, optimization of handwritten content recognition, and medical chart and table structure recognition.
[0031] For example, the input scanned medical record image has problems such as blurriness, tilt, and uneven lighting. The original image parameters of the medical record image are: resolution 1200×1600, tilt angle 5°, and moderate blur. The processing flow is as follows: 1. Image denoising: - Using a noise reduction algorithm specifically designed for medical documents - Parameter configuration: kernel_size=3, sigma=1.2; - The signal-to-noise ratio is improved by 15dB after processing; 2. Geometric correction: - Tilt detection: Detecting the angle of text lines based on Hough transform; - Angle correction: Rotate the angle by -5° to restore normal operation; - Perspective correction: Four-point correction algorithm to handle scan distortion; 3. Balanced lighting: - Histogram equalization: Improves contrast between light and dark areas; - Adaptive threshold: threshold_value=adaptive_threshold(image, block_size=11); - Enhanced contrast: contrast_factor=1.3; 4. Medical Specialization Optimization: - Handwritten character enhancement: A dedicated filter for doctors' handwriting; - Enhanced table lines: Improves the clarity of table border lines; - Stamp Removal: Automatically detects and handles red stamp interference; Finally, the multimodal medical document processing module outputs high-quality enhanced medical document images, thereby increasing the OCR (Optical Character Recognition) accuracy from 78% to 96%.
[0032] High-precision medical OCR recognition process: Input: The above high-quality enhanced medical document image. Processing configuration is as follows: - OCR Model: Basic OCR + Medical Terminology-Specific Model; - Language recognition: Mixed Chinese and English; - Table recognition: Enable table structure recognition; - Layout analysis: Intelligent partition recognition.
[0033] Specific processing steps: 1. Page layout analysis: - Text region detection: Identify continuous text regions; - Table region recognition: Detects table boundaries and cells; - Image region separation: Separate image and text content.
[0034] 2. Text recognition: text_regions = detect_text_regions(enhanced_image); for region in text_regions: text = medical_ocr_model.recognize(region); confidence = calculate_confidence(text, medical_dict).
[0035] 3. Medical terminology verification: recognized_text = "myocardial infarction, hypertension, diabetes"; corrected_text = medical_term_validator(recognized_text).
[0036] # Output: "myocardial infarction, hypertension, diabetes".
[0037] 4. Structured output generation: output_format = { "markdown_text": formatted_text, "structured_data": extracted_fields, "confidence_scores": region_confidences, "table_data": structured_tables;
[0038] }
[0039] Finally, the multimodal medical document processing module outputs: structured text in Markdown format + data in JSON format + confidence information.
[0040] In one example, step 202 above, extracting patient medical record content from multiple medical documents, includes: constructing a time series based on the medical timeline and multiple medical documents, the time series containing the time, document type, and document content summary of each medical document; obtaining key information summaries of each medical document; wherein, the medical record content includes the time series and key information summaries of each medical document.
[0041] Specifically, for example, inputting five medical documents of patient Zhang, including: - Admission record (2024-01-10); - CT scan report (2024-01-12); - Pathology report (2024-01-15); - Surgical record (2024-01-18); - Discharge summary (2024-01-25).
[0042] Integration and processing: 1. Time series construction: timeline = [ {"date": "2024-01-10", "type": "admission", "content": "admitted due to chest pain"}, {"date": "2024-01-12", "type": "examination", "content": "CT scan revealed lung nodules"}, {"date": "2024-01-15", "type": "diagnosis", "content": "pathologically confirmed lung adenocarcinoma"}, {"date": "2024-01-18", "type": "treatment", "content": "lobectomy"}, {"date": "2024-01-25", "type": "Discharged", "content": "Good postoperative recovery"} ].
[0043] 2. Extraction and merging of key information summaries: patient_summary = { "basic_info": extract_patient_info(documents), "chief_complaint": "Chest pain for 3 days", "diagnosis_evolution": ["lung nodules", "lung adenocarcinoma"], "treatment_process": ["drug treatment", "surgical treatment"], Outcome: "Post-operative recovery is going well" }
[0044] 3. Duplicate information removal: # Multiple mentions of the same check are merged into the latest result; # Different records for the same drug are merged into a medication history.
[0045] Output: A consolidated, complete patient medical timeline and a summary of key information.
[0046] Step 203: Retrieve similar diagnostic cases from the case database based on the medical record content, and construct a medical knowledge graph based on the medical record content.
[0047] In this embodiment, the electronic medical record system is configured with an intelligent case retrieval mechanism. This mechanism specifically configures similar case matching algorithms, such as case retrieval based on semantic similarity, and considers weight adjustments based on medical professional relevance. For example, given a current medical document to be processed, the extracted medical record content is: "Patient Zhang, male, 45 years old, chief complaint of chest pain for 3 days, CT scan shows lung shadows." Based on this case content, similar diagnostic cases are retrieved from the case database. Furthermore, based on this case content, medical entities and the relationships between these entities can be extracted, thereby constructing a medical knowledge graph.
[0048] In a further example, step 203 above, retrieving similar diagnostic cases from the case library based on medical record content, includes: extracting patient features, examination features, and symptom features from the key information summaries of each medical document, and constructing feature vectors based on these features; calculating the similarity between the feature vectors and the vectors of each diagnostic case in the case library to obtain multiple preliminary similar cases and the vector similarity between each preliminary similar case and the medical record content; obtaining the patient feature similarity, examination feature similarity, and symptom feature similarity between each preliminary similar case and the medical record content; determining the overall similarity between each preliminary similar case and the medical record content based on the vector similarity, patient feature similarity, examination feature similarity, and symptom feature similarity corresponding to each preliminary similar case; and selecting similar diagnostic cases from the multiple preliminary similar cases based on the overall similarity between each preliminary similar case and the medical record content.
[0049] Specifically, the following features are extracted from the key information summaries of each medical document in the medical record content: - Symptom characteristics: "chest pain"; - Examination findings: "CT scan", "lung shadow"; - Patient characteristics: "Male", "45 years old".
[0050] Then, the similarity is calculated using the embedding model: similarity_score=cosine_similarity(current_doc_embedding, case_embedding).
[0051] Furthermore, weights can be adjusted based on relevance to medical specialties. For example: Same disease type: weight × 1.5; Same inspection type: weight × 1.2; Similar age groups: weight × 1.1.
[0052] Output: A list of diagnostic cases sorted by similarity, as follows: Case 1: "Lung Cancer Diagnosis Case", overall similarity 0.87; Case 2: "Pneumonia Diagnosis Case", overall similarity 0.75; Case 3: "Case for Differentiation of Chest Pain", with an overall similarity of 0.68.
[0053] Therefore, similar diagnostic cases can be selected based on the overall similarity of Case 1, Case 2, and Case 3.
[0054] Step 204: Construct prompts based on the medical knowledge graph, similar diagnostic cases, and preset prompt templates. The prompt templates reserve space for the medical knowledge graph and similar diagnostic cases.
[0055] In this embodiment, a prompt word template is pre-configured. The prompt word template reserves space for a medical knowledge graph and space for similar diagnostic cases. When constructing prompt words based on the medical knowledge graph, similar diagnostic cases, and the pre-configured prompt word template, the medical knowledge graph is filled into the space for the medical knowledge graph in the prompt word template, and the similar diagnostic cases are filled into the space for the similar diagnostic cases in the prompt word template, thereby constructing the prompt words.
[0056] In one example, step 203 above, constructing a medical knowledge graph based on medical record content, includes: extracting multiple medical entities and the relationships between them from the medical record content; constructing a hierarchical medical knowledge graph based on the medical entities and their relationships; and in step 204 above, constructing prompts based on the medical knowledge graph, similar diagnostic cases, and a preset prompt template, including: identifying the location of similar diagnostic cases in the prompt template and filling them into those locations; identifying the location of the medical knowledge graph in the prompt template; and filling each medical entity and its relationships into the locations within the medical knowledge graph.
[0057] In this example, entity relationships are extracted from medical record content to construct a medical knowledge graph: entities such as diseases, symptoms, and drugs are extracted from medical documents; semantic relationships between entities are established; a hierarchical medical concept system is constructed; and then a medical knowledge graph is built.
[0058] Specifically, the entity relationship extraction process is as follows: Input the medical document text after OCR recognition, and extract the medical record content: "The patient was admitted to the hospital due to chest pain. A CT scan revealed lung nodules, and it is recommended to undergo further PET-CT examination to rule out the possibility of malignancy."
[0059] 1. Medical Entity Recognition: Entities are identified using a medically specific NER model, as follows: - Symptom entity: "Chest pain" (SYMPTOM); - Entity examined: "CT scan" (EXAMINATION); - Entity found: "Lung nodule" (FINDING); - Disease entity: "Malignant tumor" (DISEASE).
[0060] 2. Relation extraction: Relationships between entities are extracted based on a medical knowledge graph template, as follows: - ("Patient", "has_symptom", "chest pain"); - ("CT scan", "reveals", "lung nodules"); - ("pulmonary nodules", "suspected_as", "malignant tumors"); - ("PET-CT scan", "for_diagnosis", "malignant tumor").
[0061] 3. Construction of Medical Knowledge Graph: knowledge_graph = { "entities": [ {"id": "E001", "name": "chest pain", "type": "SYMPTOM"}, {"id": "E002", "name": "pulmonary nodule", "type": "FINDING"}, {"id": "E003", "name": "malignant tumor", "type": "DISEASE"} ], "relations": [ {"source": "E001", "relation": "may_indicate", "target": "E003"}, {"source": "E002", "relation": "suspected_as", "target": "E003"} ] }
[0062] Output: A structured medical knowledge graph to support subsequent reasoning and analysis.
[0063] Furthermore, dynamic prompts are constructed based on medical knowledge graphs: prompt = f""" The summary format is based on the following similar cases: {successful_case_examples} Please generate professional medical record summaries for the following patients: Patient basic information: {patient_basic_info}; Treatment process: {treatment_timeline}; Key checks: {key_examinations}; """
[0064] Among them, the patient's basic information, the diagnosis and treatment process, and the key examinations are the medical entities extracted from the medical knowledge graph and the relationships between the medical entities.
[0065] Furthermore, the positions of similar diagnostic cases in the prompt word template are identified, and similar diagnostic cases are filled into the positions of similar diagnostic cases. The specific process is as follows: Input: The current document is a chest CT report. The retrieved similar cases are 3 lung disease diagnosis cases. Historical processing success rates: Case 1, similarity 95%; Case 2, similarity 88%; Case 3, similarity 92%.
[0066] Dynamic prompt word construction based on similar diagnostic cases: 1. Configure case selection strategy: - Select cases with a success rate >90% as a small sample example for the system; - Sort by similarity × success rate; - Select a maximum of 3 cases to avoid context overflow.
[0067] 2. Prompt word template generation: prompt_template = f""" You are a professional medical imaging diagnostic expert. Below is an example of handling a similar case: Case 1: {successful_case1_input} → {successful_case1_output}; Case 2: {successful_case2_input} → {successful_case2_output}.
[0068] Please now process the following medical documents using the same format and standards: {current_document}; Please output according to the following structure: 1. Key findings; 2. Diagnostic opinion; 3. Further examination is recommended.
[0069] As shown in the example above, the similar diagnostic cases are Case 1 and Case 2. By filling Case 1 and Case 2 into the prompt word template, the final prompt words are generated.
[0070] Step 205: Input the prompt words into the trained large language model of the electronic medical record system to obtain the patient's medical record summary output by the trained large language model.
[0071] In this embodiment, the constructed prompt words are input into the trained large language model of the electronic medical record system, and the trained large language model generates a summary of the patient's medical record based on the prompt words.
[0072] In one example, the medical-specific inference implemented by the trained large language model is as follows: Generate medical record summaries using a pre-trained large language model: summary = medical_model.generate( prompt=dynamic_prompt, max_length=1500, temperature=0.3, # Reduce randomness, increase professionalism medical_terminology=True ).
[0073] Further, perform quality control verification: - Medical terminology accuracy check: verified using a medical dictionary; - Clinical logical consistency verification: based on medical knowledge graph; - Integrity check: Assessment of the integrity of necessary information.
[0074] Output: Professional and structured intelligent medical record summaries.
[0075] The aforementioned method for generating medical record summaries in an electronic medical record system based on a large language model includes: receiving multiple medical documents uploaded by a user and / or user-inputted dialogue text; extracting the patient's medical record content from the medical documents and / or dialogue text; retrieving similar diagnostic cases from a case library based on the medical record content; constructing a medical knowledge graph based on the medical record content; constructing prompt words based on the medical knowledge graph, similar diagnostic cases, and a preset prompt word template, wherein the prompt word template reserves positions for the medical knowledge graph and similar diagnostic cases; and inputting the prompt words into a trained large language model to obtain the patient's medical record summary output by the trained large language model. Therefore, it can retrieve similar diagnostic cases based on the patient's medical record content, construct a medical knowledge graph based on the patient's medical record content, and dynamically construct prompt words that meet the user's question-and-answer needs and are adapted to the current patient's condition based on similar diagnostic cases, the medical knowledge graph, and the preset prompt word template. Inputting the prompt words into the large language model of the electronic medical record system results in a medical record summary that better meets user needs and is more accurate.
[0076] In one example, a method for generating medical record summaries in an electronic medical record system based on a large language model also includes a training step for the large language model. Specifically, this includes: determining a base model for the large language model; configuring a first parameter on the base model; pre-training the base model with the first parameter configured based on a general corpus and a basic medical corpus to obtain a first-stage training model; configuring a second parameter on the first-stage training model; training the first-stage training model with the second parameter configured based on medical textbook corpus and medical journal literature to obtain a second-stage training model; configuring a third parameter on the second-stage training model; training the second-stage training model with the third parameter configured based on multiple specialized professional knowledge to obtain a third-stage training model; configuring a fourth parameter on the third-stage training model; obtaining standard medical question-answer pairs; and performing supervised fine-tuning training on the third-stage training model with the fourth parameter configured based on the standard medical question-answer pairs to obtain a trained large language model.
[0077] Among them, the learning rate in the first, second, third and fourth parameters decreases in that order; the number of batches in the first parameter is greater than the number of batches in the second parameter, and the number of training epochs in the first parameter is less than the number of training epochs in the second parameter; the third parameter contains configuration information for training in batches according to specialties and configuration information for the number of training epochs for each specialty; the number of batches in the fourth parameter is configured based on the size of the base model, the gradient accumulation steps in the fourth parameter are set based on the memory requirements of the base model, and the number of training epochs in the fourth parameter is configured based on the convergence of the base model.
[0078] This example demonstrates the construction and training of a large, medically specialized language model. Details are as follows: 1. Medical pre-training data collection and processing: -1.1 Medical Treatment Guideline Data Collection: This involves collecting authoritative medical data, including domestic and international medical treatment guidelines, clinical standards, and disease diagnosis and treatment criteria, such as: Treatment guidelines for various departments (internal medicine, surgery, gynecology, pediatrics, etc.); Drug usage guidelines and pharmacopoeia information; Medical examination standards and normal ranges; Disease classification standards and coding specifications; Medical Terminology Database: Constructing a dictionary containing 500,000 standardized medical terms such as "myocardial infarction (MI)," "hypertension (HTN)," "diabetes mellitus (DM)," and "acute appendicitis." Medical textbook documents: PDF versions of classic textbooks such as "Internal Medicine" and "Surgery" published by People's Medical Publishing House.
[0079] -1.2 OCR Enhanced Medical Text Extraction: High-precision OCR processing of collected medical e-books and PDF documents: Using professional OCR technology to process medical books and journals; The recognition accuracy of medical terms, formulas, and tables has been specifically optimized. Establish a medical-specific character recognition model to support medical symbols and special formats; Quality control: Manually verify the accuracy of OCR for key medical concepts.
[0080] The specific process of OCR text extraction is illustrated below: Input: PDF document of "Guidelines for the Diagnosis and Treatment of Internal Medicine", for example, 1024 pages.
[0081] Processing steps: 1. PDF Page Image Conversion: Convert PDF to 300DPI PNG images; 2. Medical OCR-specific model recognition: Using an optimized OCR model, the recognition rate of medical terms reaches 96%; 3. Text post-processing: - Terminology standardization: "myocardial infarction" → "myocardial infarction (MI)"; - Standardized format: Unifying the representation of drug dosage units; - Error correction: Spell check based on a medical dictionary; Output: 500GB of high-quality medical text corpus, including standardized medical terminology and clinical expressions.
[0082] -1.3 Construction of Medical Pre-training Corpus: Data cleaning: Remove low-quality content and retain high-value medical knowledge; Standardization of format: unifying the expression and formatting of medical terminology; Domain Labeling: Add domain tags to content related to different medical specialties; Quality assessment: Establish a quality evaluation system for medical content.
[0083] 2. Medical Large Language Model Pre-training (PT) Process: - 2.1 Basic Model Selection and Optimization: We selected qwen2.5-72b-instruct as the base model.
[0084] Vocabulary expansion: Add 10,000 medical terms to the existing vocabulary; Location encoding optimization: Supports a maximum token length of 32,768, adapting to long medical documents; It adopts a decoder-only architecture to optimize medical text generation capabilities.
[0085] The multi-stage pre-training of the base model is specifically implemented as follows: Phase 1: General knowledge pre-training (input → processing → output).
[0086] Input: 100GB general corpus + 50GB basic medical corpus; Configure the base model with the following parameters: based on qwen2.5-72b-instruct, learning rate 1e-5, batch size 128, and 3 training epochs.
[0087] Processing procedure: - Causal language model training: Autoregressive generative training using a decoder-only architecture; - Medical text continuation task: generating text based on the context of a medical document; - Enhanced medical terminology: Increases the weight of medical terminology tokens by 1.5 times to improve understanding of medical concepts; - Long document adaptation: Handles complete medical documents using a 32,768-token window.
[0088] Output: A pre-trained model with basic medical concept understanding and long document processing capabilities, i.e., the first-stage training model.
[0089] Phase 2: Basic Medical Knowledge Training (Input → Processing → Output).
[0090] Input: 200GB of medical textbook corpus + 300GB of medical journal articles; Configure the second parameter for the first-stage training model: based on the pre-trained model obtained in stage 1, with a learning rate of 5e-6, a batch size of 64, and 8 training rounds.
[0091] Processing procedure: - Adaptive generation in the medical field: training conditional text generation based on medical documents; - Medical entity link generation: Training the model to generate textual descriptions of the relationships between entities; - Clinical reasoning chain generation: Training the complete reasoning process of symptoms → examination → diagnosis → treatment; - Understanding lengthy medical documents: Processing complete medical records and treatment guidelines using a 32,768-token window; Control targets: Achieve an accuracy rate of over 90% in understanding medical terminology and improve long document comprehension ability by 40%.
[0092] Output: A domain model with medical expertise and the ability to process long documents, i.e., the second-stage training model.
[0093] Phase 3: Refined training in specialized knowledge (input → processing → output).
[0094] Input: corpus of diagnostic and treatment guidelines for various specialties, categorized by department; - Internal Medicine Guidelines Corpus: 50GB (cardiovascular, respiratory, digestive, etc.); - Surgical Guidelines Corpus: 40GB (General Surgery, Orthopedics, Neurosurgery, etc.); - Gynecological Guidelines Corpus: 20GB (Obstetrics, Gynecologic Oncology, etc.); - Pediatric Guidelines Corpus: 15GB (Neonatal, Child Health Care, etc.)
[0095] Configure a third parameter for the second-stage training model: based on the stage 2 model, with a learning rate of 2e-6, subject-specific batch training, and 5 rounds of training for each subject.
[0096] Processing procedure: - Specialty condition generation: Training for conditional text generation using department tags; - Generation of disease diagnosis reasoning chain: Training complete text of the symptom → examination → diagnosis reasoning process; - Treatment plan generation optimization: Generate treatment plans that conform to specialist guidelines based on diagnostic results; - Long document specialist knowledge integration: Utilize a 32,768-token window to process complete specialist treatment guidelines; Control targets: The diagnostic accuracy rate of each specialty should reach over 85%, and the understanding of specialty knowledge in long documents should be improved by 50%.
[0097] Output: A large-scale medical specialization model with multidisciplinary expertise and long document processing capabilities, i.e., the third training model.
[0098] 3. Surveillance-Fine-Tune (SFT) Training: - 3.1 Construction of Medical Question-and-Answer Data: Invite senior medical experts to construct standardized doctor-patient Q&A pairs; It covers scenarios such as diagnosis, treatment plans, and medication guidance for common diseases; Establish a question-and-answer dataset with multiple departments and difficulty levels; Quality control: Cross-validation by multiple experts ensures accuracy.
[0099] Specific strategies for SFT training: Training data: 100,000 standard medical question-and-answer pairs; Training configuration: Configure the fourth parameter for the third stage of model training. - Learning rate: 1e-6 (based on qwen2.5-72b-instruct optimization); - Batch size: 16 (fits 72B model size, prevents catastrophic omissions); - Gradient accumulation: Update parameters after 8 steps of accumulation (adapts to the memory requirements of large models); - Number of training rounds: 2 rounds (large models converge quickly to prevent overfitting).
[0100] Training process control: 1. Instruction fine-tuning: Enhance the model's ability to understand medical instructions; 2. Reasoning Chain Training: The complete reasoning process from symptoms to examination, diagnosis, and treatment; 3. Reward Model Optimization: Establish a reward function based on expert ratings; - Medical accuracy weight: 0.4; - Weighting for adherence to diagnostic and treatment standards: 0.3; - Security weight: 0.3.
[0101] Output: Medical-specialized fine-tuned model, i.e., a trained large language model, with a medical question-answering accuracy of 92%.
[0102] Among them, the trained large language model can perform knowledge reasoning and verification based on the medical knowledge graph in the prompt words. For example: (1) Medical logical reasoning: 1. Disease diagnosis reasoning based on medical knowledge graphs; 2. Drug interaction testing; 3. Verification of the rationality of the treatment plan.
[0103] (2) Specific implementation of reasoning verification: Input: A knowledge graph of multiple patient documents + a medical reasoning rule base; Reasoning process: 1. Symptom-Disease Inference: Rule 1: Chest pain + lung nodules + age > 50 → 60% chance of lung cancer; Rule 2: Chest pain + abnormal ECG + chest tightness → 80% chance of myocardial infarction; patient_symptoms = ["chest pain", "shortness of breath"]; patient_findings = ["pulmonary nodules"]; patient_age = 55; inference_result =medical_reasoner.infer(symptoms, findings, age); # Output: 65% chance of lung cancer; further investigation recommended.
[0104] 2. Drug interaction testing: current_medications = ["Aspirin", "Warfarin"]; interaction_check=drug_interaction_validator(current_medications); if interaction_check.has_risk: Warning = "There is a risk of bleeding when aspirin is used in combination with warfarin. It is recommended to monitor coagulation function."
[0105] 3. Verification of the rationality of the treatment plan: diagnosis = "acute myocardial infarction"; treatment_plan = ["Aspirin", "Clopidogrel", "Atorvastatin"]; validation_result = treatment_validator(diagnosis, treatment_plan) # Output: The treatment plan meets the guidelines and has a rationality score of 90%.
[0106] The final large language model outputs, based on a medical knowledge graph, the following: reasoning results, risk alerts, and rationality assessments.
[0107] In summary, the above embodiments provide a method for generating medical record summaries in an electronic medical record system based on a large language model: 1. Using OCR texts from medical treatment guidelines as pre-training corpus, and combining them with supervised fine-tuning of standard question-and-answer data constructed by medical experts, a medically specialized large language model is constructed. This significantly improves the professionalism and accuracy of medical terminology recognition, disease diagnosis reasoning, and treatment plan analysis, and solves the technical problems of insufficient professionalism and comprehension bias in the medical field of general large models.
[0108] 2. By using a similar case matching algorithm and a case quality assessment system, intelligent case retrieval in medical scenarios is achieved. Combined with context-aware prompt generation and adaptive optimization mechanisms, the optimal few-sample examples are dynamically constructed, solving the technical problems of poor adaptability of static prompt word templates and poor processing effect in complex medical scenarios.
[0109] 3. Construct a unified representation learning framework for medical multimodal information to achieve semantic alignment and deep fusion of medical information of different modalities such as text, images, and tables, and establish a multimodal information association mechanism to solve the technical problems of incomplete information processing in single modality and inaccurate cross-modal association analysis.
[0110] 4. By automatically extracting medical entities and relationships, a hierarchical medical knowledge graph is constructed. Combined with medical logical reasoning and knowledge verification mechanisms, it enables disease diagnosis reasoning, drug interaction examination, and treatment plan verification, solving the technical problems of insufficient reasoning ability and incomplete knowledge coverage in traditional rule systems.
[0111] 5. Enables incremental updates of medical knowledge and online optimization of models, establishes a continuous learning mechanism based on clinical feedback, supports the rapid integration of the latest medical guidelines and treatment standards, and solves the technical problems of lagging medical knowledge updates and insufficient system adaptability.
[0112] 6. By combining specialized medical language and models, dynamic few-sample learning, and medical knowledge graphs, professional intelligent medical record summaries are generated. Through medical terminology accuracy checks, clinical logic consistency verification, and cross-validation with expert knowledge bases, the professionalism and reliability of the summaries are ensured, solving the technical problems of insufficient professionalism and imperfect quality control in traditional systems medicine.
[0113] It should be understood that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order constraint on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0114] In some exemplary embodiments of this disclosure, such as Figure 3 As shown, a medical record summary generation device for an electronic medical record system is provided. The device includes a receiving module 301, an extraction module 302, a retrieval module 303, a first construction module 304, a second construction module 305, and a medical record summary generation module 306. The receiving module 301 receives multiple medical documents uploaded by a user and / or user-inputted dialogue text; the extraction module 302 extracts the patient's medical record content from the multiple medical documents and / or dialogue text; the retrieval module 303 retrieves similar diagnostic cases from a case database based on the medical record content; the first construction module 304 constructs a medical knowledge graph based on the medical record content; the second construction module 305 constructs prompt words based on the medical knowledge graph, similar diagnostic cases, and a preset prompt word template, wherein the prompt word template reserves positions for the medical knowledge graph and similar diagnostic cases; the medical record summary generation module 306 inputs the prompt words into a trained large language model of the electronic medical record system to obtain the patient's medical record summary output by the trained large language model.
[0115] In one example of this disclosure, a medical record summary generation device for an electronic medical record system further includes a model training module for determining a base model of a large language model, configuring first parameters on the base model, and pre-training the base model with the first parameters based on a general corpus and a basic medical corpus to obtain a first-stage training model; configuring second parameters on the first-stage training model, and training the first-stage training model with the second parameters based on medical textbook corpus and medical journal literature to obtain a second-stage training model; configuring third parameters on the second-stage training model, and training the second-stage training model with the third parameters based on multiple specialty knowledge to obtain a third training model; configuring fourth parameters on the third-stage training model, obtaining standard medical question-answer pairs, and performing supervised fine-tuning training on the third-stage training model with the fourth parameters based on the standard medical question-answer pairs to obtain a trained large language model.
[0116] In one example disclosed herein, the learning rates in the first, second, third, and fourth parameters decrease sequentially; the batch size in the first parameter is greater than the batch size in the second parameter, and the number of training epochs in the first parameter is less than the number of training epochs in the second parameter; the third parameter includes configuration information for training in batches according to specialties and configuration information for the number of training epochs for each specialty; the batch size in the fourth parameter is configured based on the size of the base model, the gradient accumulation steps in the fourth parameter are set based on the memory requirements of the base model, and the number of training epochs in the fourth parameter is configured based on the convergence of the base model.
[0117] In one example of this disclosure, extracting patient medical record content from multiple medical documents and / or dialogue texts includes: if any medical document is an image document, performing one or more of the following processing on the image document: denoising, geometric correction, light equalization, handwritten character enhancement, table line enhancement, and stamp removal, to obtain an enhanced medical document image; performing text recognition on the medical document image using optical recognition technology to obtain the document content; and extracting medical terms from the medical record content.
[0118] In one example of this disclosure, extracting a patient's medical record content from multiple medical documents and / or conversation text includes: upon receiving multiple medical documents uploaded by a user, constructing a time series based on the medical timeline and the multiple medical documents, wherein the time series includes the time, document type, and document content summary of each medical document; obtaining a key information summary of each medical document; wherein the medical record content includes the time series and the key information summary of each medical document.
[0119] In one example of this disclosure, similar diagnostic cases are retrieved from a case database based on medical record content. This includes: extracting patient features, examination features, and symptom features from the key information summaries of each medical document, and constructing feature vectors based on these features; calculating the similarity between the feature vectors and the vectors of each diagnostic case in the case database to obtain multiple preliminary similar cases and the vector similarity between each preliminary similar case and the medical record content; obtaining the patient feature similarity, examination feature similarity, and symptom feature similarity between each preliminary similar case and the medical record content; determining the overall similarity between each preliminary similar case and the medical record content based on the vector similarity, patient feature similarity, examination feature similarity, and symptom feature similarity corresponding to each preliminary similar case; and selecting similar diagnostic cases from the multiple preliminary similar cases based on the overall similarity between each preliminary similar case and the medical record content.
[0120] In one example of this disclosure, a medical knowledge graph is constructed based on medical record content, including: extracting multiple medical entities and the relationships between them from the medical record content; constructing a hierarchical medical knowledge graph based on the medical entities and their relationships; and constructing prompts based on the medical knowledge graph, similar diagnostic cases, and a preset prompt template, including: identifying the positions of similar diagnostic cases in the prompt template and filling them into those positions; identifying the positions of the medical knowledge graph in the prompt template; and filling each medical entity and its relationships into those positions in the medical knowledge graph.
[0121] For specific limitations regarding the medical record summary generation device of an electronic medical record system, please refer to the limitations of the medical record summary generation method of an electronic medical record system mentioned above, which will not be repeated here. Each module in the aforementioned medical record summary generation device of an electronic medical record system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the electronic device in hardware form, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each module.
[0122] In some exemplary embodiments of this disclosure, an electronic device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the electronic device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores business data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for generating medical record summaries for an electronic medical record system.
[0123] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0124] In some exemplary embodiments of this disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of a method for generating a medical record summary of an electronic medical record system as described in any of the exemplary embodiments above.
[0125] In some exemplary embodiments of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of a method for generating a medical record summary in an electronic medical record system as described in any of the exemplary embodiments above.
[0126] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0127] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0128] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A medical record summary generation method of an electronic medical record system, characterized by, The method comprises: receiving multiple medical documents of a patient uploaded by a user and / or conversation text input by the user; extracting medical record content of the patient from the multiple medical documents and / or the conversation text; retrieving similar diagnosis cases from a case library according to the medical record content, and constructing a medical knowledge graph according to the medical record content; constructing a prompt word according to the medical knowledge graph, the similar diagnosis cases, and a preset prompt word template, wherein the medical knowledge graph and the similar diagnosis cases are reserved in the prompt word template; inputting the prompt word into a trained large language model of an electronic medical record system to obtain a medical record summary of the patient output by the trained large language model.
2. The method of claim 1, wherein, The method further comprises: determining a base model of the large language model, configuring a first parameter for the base model, pre-training the base model configured with the first parameter according to a general corpus and a medical basic corpus to obtain a first-stage training model; configuring a second parameter for the first-stage training model, training the first-stage training model configured with the second parameter according to a medical textbook corpus and a medical journal literature to obtain a second-stage training model; configuring a third parameter for the second-stage training model, training the second-stage training model configured with the third parameter according to multiple professional knowledge to obtain a third training model; configuring a fourth parameter for the third-stage training model, obtaining a standard medical question and answer pair, and performing supervised fine-tuning training on the third-stage training model configured with the fourth parameter according to the standard medical question and answer pair to obtain the trained large language model.
3. The method of claim 2, wherein, The learning rate in the first parameter, the second parameter, the third parameter, and the fourth parameter decreases in turn; The batch number in the first parameter is greater than the batch number in the second parameter, and the training round number in the first parameter is less than the training round number in the second parameter; The third parameter includes configuration information for batch training according to specialties and configuration information for the number of training rounds for each specialty; The batch number in the fourth parameter is configured based on the size of the base model, the gradient accumulation step number in the fourth parameter is set based on the memory requirement of the base model, and the training round number in the fourth parameter is configured based on the convergence of the base model.
4. The method of claim 1, wherein, The extraction of the medical record content of the patient from the multiple medical documents and / or the conversation text comprises: if any medical document is an image document, performing one or more of denoising processing, geometric correction processing, light balance processing, handwritten character enhancement processing, table line strengthening processing, and seal removal on the image document to obtain an enhanced medical document image; performing optical character recognition on the medical document image to obtain document content; extracting medical terms in the medical record content from the document content.
5. The method of claim 1, wherein, The extraction of the medical record content of the patient from the multiple medical documents and / or the conversation text comprises: In response to receiving a plurality of medical documents of a patient uploaded by a user, a time sequence is constructed according to a medical timeline and based on the plurality of medical documents, the time sequence including time, document type, and document content summary of each medical document; Key information summaries of each medical document are obtained; The medical record content includes the time sequence and the key information summaries of each medical document.
6. The method of claim 5, wherein, The retrieving of the similar diagnosis case from the case library based on the medical record content includes: Patient features, examination features, and symptom features are extracted from the key information summaries of each medical document, and a feature vector is constructed based on the patient features, examination features, and symptom features; Based on similarity calculation of the feature vector and the vector of each diagnosis case in the case library, a plurality of preliminary similar cases and the vector similarity of each preliminary similar case to the medical record content are obtained; Patient feature similarity, examination feature similarity, and symptom feature similarity of each preliminary similar case to the medical record content are obtained respectively; The overall similarity of each preliminary similar case to the medical record content is determined based on the vector similarity, patient feature similarity, examination feature similarity, and symptom feature similarity corresponding to each preliminary similar case; The similar diagnosis case is selected from the plurality of preliminary similar cases based on the overall similarity of each preliminary similar case to the medical record content.
7. The method of claim 1, wherein, The construction of the medical knowledge graph based on the medical record content includes: A plurality of medical entities and relationships between each medical entity are extracted from the medical record content; A hierarchical medical knowledge graph is constructed based on each medical entity and the relationships between each medical entity; The construction of the prompt word based on the medical knowledge graph, the similar diagnosis case, and a preset prompt word template includes: The position of the similar diagnosis case in the prompt word template is identified, and the similar diagnosis case is filled into the position of the similar diagnosis case; The position of the medical knowledge graph in the prompt word template is identified; Each medical entity and the relationships between each medical entity are respectively filled into the position of the medical knowledge graph.
8. An electronic medical record system medical record summary generation apparatus characterized by comprising: The device includes: A receiving module for receiving a plurality of medical documents of a patient uploaded by a user and / or a conversation text input by the user; An extracting module for extracting medical record content of the patient from the plurality of medical documents and / or the conversation text; A retrieving module for retrieving a similar diagnosis case from a case library based on the medical record content; A first constructing module for constructing a medical knowledge graph based on the medical record content; A second constructing module for constructing a prompt word based on the medical knowledge graph, the similar diagnosis case, and a preset prompt word template, wherein the prompt word template reserves a position of the medical knowledge graph and a position of the similar diagnosis case; A medical record summary generation module for inputting the prompt word into a trained large language model of the electronic medical record system to obtain a medical record summary of the patient output by the trained large language model.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 7. The processor executes the computer program to implement the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, which is executed by a processor, implements the steps of the method according to any one of claims 1 to 7.