A method for constructing training data for large medical teaching models

By using predefined JSON templates and large language models (LLMs) to process medical teaching records, examination test reports, and ECG data, the problem of lack of structured data in medical records in medical teaching is solved, and the generation of training data for large medical teaching models in a highly simulated environment is realized.

CN120340734BActive Publication Date: 2025-09-16成都中教智汇信息技术有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510811473.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-09-16
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

Medical teaching records lack structured data and cannot be directly used for deep learning model training. Existing technologies make it difficult to extract effective and regular data from complex and tedious data for training large medical teaching models.

Method used

By pre-defining JSON templates for medical teaching cases, combined with OCR recognition, DFA algorithm desensitization processing, large language model (LLM) and ECG calculation engine, medical records, inspection test orders and ECG data are extracted and formatted, slot matching and verification are performed, and training data suitable for large medical teaching models is generated.

Benefits of technology

After data identification and inference, medical teaching case materials of various file types are used to generate prefabricated JSON data, which is suitable for the training of large medical teaching models in a high-simulation environment during the medical teaching process, filling the gap in data construction in the field of medical teaching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120340734B_ABST
    Figure CN120340734B_ABST
Patent Text Reader

Abstract

This application relates to the field of artificial intelligence technology, and specifically to a method for constructing training data for a large medical teaching model, comprising the following steps: S1. Predefining a JSON template for medical teaching cases; S2. Acquiring medical teaching case data; S3. Slot matching the medical teaching data acquired in step S2 to obtain training data for the large medical teaching model. This application identifies and extracts medical teaching case data from various file types, and after inference, format parsing, and combing based on a large language model, obtains prefabricated JSON data suitable for training large medical teaching models in the education and training environment of medical teaching products during the medical teaching process. This method fills the gap in the method for constructing training data for large medical teaching models that assist in teaching in a highly simulated medical environment in the field of medical teaching products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method for constructing training data for a large medical teaching model. Background Art

[0002] In the medical education industry, some medical case data is obtained through medical records provided by professional medical institutions such as hospitals and medical schools. This includes paper / electronic medical records, one or more examination and test reports, one or more electrocardiogram (ECG) data, one or more X-rays, and one or more ultrasound test reports.

[0003] Clinical medical records lack medical knowledge and skills, making them unsuitable for use as medical teaching cases. Furthermore, medical records contain various unstructured data, such as text, and cannot be directly incorporated into deep learning models for training large medical teaching models.

[0004] At present, there is a lack of case studies for medical teaching, and there is also a lack of effective and regular available data extracted from a variety of complex, tedious and redundant data information and provided to medical teaching large models for learning and training, so as to be used in medical teaching products. Summary of the Invention

[0005] In order to overcome the deficiencies in the prior art, the present application provides a method for constructing training data for a large medical teaching model, comprising the following steps:

[0006] S1. Predefined medical case JSON template;

[0007] S2. Acquiring medical case data for teaching purposes, including the following steps:

[0008] S2.1. Obtaining non-test laboratory test results and ECG data from medical teaching case files includes the following steps:

[0009] S2.1.1. Perform OCR on the medical records in paper and / or electronic files to obtain a BlockList array containing coordinate information and block information, and restore the position of each block in the BlockList array based on the coordinates.

[0010] S2.1.2. The BlockList array in step S2.1.1 is formatted and parsed in the large language model LLM by the prompt word project and the block information is output; and the basic information of the patient in the output block information is extracted;

[0011] The basic information includes: name (Name), age (Age), gender (Gender), birthplace (Birthplace), marital status (MaritalStatus), chief complaint (Complaint), current illness history (IllnessHistory), and past illness history (PastIllness) block information;

[0012] For example, the prompt word project is as follows: You are an assistant with strong semantic comprehension ability. Now your task is to input one or more pieces of case information and find the following information: Name, Age, Gender, Birthplace, Marital Status, Complaint, Illness History, Past Illness, and output it strictly in JSON format. The keys in this JSON are Name, Age, Gender, Birthplace, Marital Status, Complaint, Illness History, and Past Illness. Other information is put in "Others" and finally output complete JSON data.

[0013] Preferably, the basic information also includes: date of birth;

[0014] S2.1.3. Desensitize the basic information using the DFA algorithm, overwriting the processed result with the data output in step S2.1.2;

[0015] S2.1.4. Package the data from step S2.1.3 and input it into the large language model (LLM) to extract slot information.

[0016] S2.1.5. Slot verification includes the following steps:

[0017] When the match is successful, the basic information (BasicInfos) is matched into the corresponding slot;

[0018] When the match fails, it is filled into the Others slot;

[0019] S2.2. Obtaining the test data from the medical case file for teaching purposes includes the following steps:

[0020] Performing clarity calibration on the test reports in medical teaching cases through OCR includes the following steps:

[0021] When the recognition rate is greater than 0% and less than 100%, the identified examination items and corresponding examination results are obtained. After the prompt word project determines the department / category, the large language model (LLM) is used to infer, supplement, and trim the block information, maintaining the original file layout, and output.

[0022] When the recognition rate is equal to 100%, the block information of the recognized content is extracted and the original file layout is maintained and output;

[0023] When the recognition rate is equal to 0%, it is discarded;

[0024] S2.2.2. Output the block information obtained in step S2.2.1 to the large language model (LLM), perform numerical reasoning, and output the weights, including the following steps:

[0025] If the weight of the current data item is higher than the threshold, it is considered to be valid data and retained and output;

[0026] If the current data item weight is lower than the threshold, it will be discarded;

[0027] S2.3. Acquiring ECG data, including the following steps:

[0028] S2.3.1. Perform OCR on the ECG in the case and obtain the data set of the xy coordinate replot points of the waveform data within the time period ;

[0029] Where p refers to the waveform object; the waveform object is an array, and the elements in the array are the xy-axis coordinate information of each point of the waveform, from the first to the nth coordinate point; is the origin of the coordinate axis;

[0030] S2.3.2. Calculate the data set obtained in step S2.3.1 using a moving average filter algorithm and reinterpolate the calculated values ​​to obtain a low-noise ECG waveform data coordinate data set, comprising the following steps:

[0031] S2.3.2.1. Set a value range for the data set obtained in step S2.3.1;

[0032] S2.3.2.2. Re-interpolate the values ​​obtained in step S2.3.2.1 using the following formula:

[0033] ;

[0034] Among them, FV refers to the value at index i after filtering; n refers to the value range, n is an integer, and n represents the total number of coordinate positions of the points within the translation filter window; y refers to the coordinate; i refers to the number of bits of the point;

[0035] S2.3.3. The data set obtained from step S2.3.2 is sent to the ECG calculation engine to locate the waveform category; preferably, the ECG calculation engine is AI-ECG Platform or ECG_Nets;

[0036] S3. Slot matching of the medical teaching case data obtained in step S2 to obtain training data for the medical teaching model; comprising the following steps:

[0037] S3.1. The data obtained from step S2.2, the data obtained from step S2.3 and the data obtained from step S2.1 are verified. If, in addition to checking the test sheet and ECG, the slot block information is partially or zero matched, it is prompted that the data is not the same case and the block information content does not match; and the matching block information is extracted from the corresponding data obtained and matched until the match is successful;

[0038] If all the slot block information except the check test sheet and ECG matches, proceed as follows:

[0039] S3.2. After slot matching the data obtained in step S2.1, the data obtained in step S2.2, and the data obtained in step S2.3 according to the JSON template predefined in step S1, the training data for the large medical teaching model is obtained.

[0040] The present application also provides an application of a method for constructing training data for a large medical teaching model, and uses the training data for a large medical teaching model constructed by the method to construct training data for a large medical teaching model to construct medical teaching cases. Preferably, it also includes: S2.4. Obtaining medical teaching simulation data; the medical simulation data is the dynamic change logic data of vital signs under physiological drive and / or the dynamic change logic data of drug metabolism in the drug metabolism kinetic model; preferably, it also includes: S2.5. Obtaining a rule program for transferring knowledge and / or skills for medical teaching.

[0041] Preferably, the constructed medical teaching case includes: a medical record data module, a medical teaching simulation data module, and a rule program module for transferring knowledge and / or skills for medical teaching;

[0042] Among them, the medical record data module is used to provide clinical diagnosis and treatment basis for teaching, including: examination and test order files; electrocardiogram files; non-examination test orders and electrocardiogram files; the medical teaching simulation data module is used to provide dynamic simulation data of patient vital signs, including: dynamic change logic data of vital signs driven by physiological means and / or dynamic change logic data of drug metabolism in drug metabolism kinetics model; the rule program module for transferring knowledge and / or skills for medical teaching is used to provide teaching framework structure, teaching process interaction mode and teaching logic process control.

[0043] Beneficial Effects: This application identifies and extracts medical case data from various file types, and then uses a large language model to infer, parse, and organize the data into pre-fabricated JSON data. This data is suitable for training large medical teaching models in the education and training environment of medical teaching products during medical teaching. This fills the technical gap in the construction of training data for large medical teaching models to assist in teaching in highly simulated medical environments in the medical teaching field. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 This is a schematic diagram of a medical teaching case structure in one embodiment;

[0045] Figure 2 This is a simple schematic diagram of a method for constructing training data for a large medical teaching model according to an embodiment;

[0046] Figure 3 The present invention is a flowchart of an example of obtaining training data according to an embodiment. DETAILED DESCRIPTION

[0047] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0048] Those skilled in the art will understand that, unless otherwise stated, the terms used in this application have the following meanings:

[0049] (1) Medical records refer to the sum of text, symbols, charts, images, slices and other information generated by medical personnel in the course of medical activities, including outpatient (emergency) medical records and inpatient medical records.

[0050] (2) Cases, used for medical education, are different from medical records. They are data in a new format generated by structurally changing the structure and content of medical records for a certain teaching purpose, and integrating them with medical teaching simulation data. Preferably, the cases for medical education include: clinical medical record data, medical teaching simulation data, and rules and procedures for transferring knowledge and / or skills for medical education.

[0051] Furthermore, medical education products, such as software and equipment for training medical diagnostic and treatment thinking, need to incorporate basic medical theoretical knowledge, diagnostic and treatment thinking, and skill standards into product interactions during student operation. Therefore, medical teaching cases are particularly important and crucial, responsible for transferring all knowledge and skills through the product to the student's brain and body. Medical records alone cannot achieve this effect, as they only display the patient's condition and lack the knowledge and skills elements, let alone the function of transferring knowledge and skills to the student.

[0052] Furthermore, medical teaching simulation data can be physiologically driven simulation data and / or drug metabolism data of a drug metabolism kinetic model, or it can be an electrocardiogram, examination and test report, etc. that is individually designed according to case requirements.

[0053] Furthermore, medical teaching uses rules and procedures for transferring knowledge and / or skills to provide medical teaching products with a teaching framework structure, teaching process interaction methods, and teaching logic flow control.

[0054] (3) Information formatting and analysis:

[0055] 1) Information formatting: This refers to organizing data into a structured format according to predefined rules (such as JSON, XML, CSV, etc.) to ensure data readability and exchangeability;

[0056] 2) Parsing: Converting formatted data into structures (such as objects, dictionaries, and tree structures) that can be recognized and manipulated by the program;

[0057] Combination means: the process of reading, splitting, validating, and extracting the required content from information that follows a specific format.

[0058] (4) Slot verification is the final result of slot matching. The valid information matched in the JSON template is placed under the specified KEY, and other invalid information or supplementary information is placed in an Others slot.

[0059] The present application will be further described below with reference to the accompanying drawings.

[0060] like Figures 1 to 3 This embodiment provides a method for constructing training data for a large medical teaching model, comprising the following steps:

[0061] S1. Predefined medical case JSON template;

[0062] The JSON template structure of this embodiment, excluding the test report and ECG, is as follows:

[0063] {

[0064] "PatientInfos": [

[0065] {

[0066] "BasicInfos": {

[0067] "Name": "Name",

[0068] "Age": "Age",

[0069] "Gender": "Gender",

[0070] "Birthplace": "Birthplace",

[0071] "MaritalStatus": "MaritalStatus",

[0072] "Complaint": "Complaint",

[0073] "IllnessHistory": "IllnessHistory",

[0074] "PastIllness": "PastIllness",

[0075] "Others": "Others"

[0076] }

[0077] } ]

[0079] }

[0080] The JSON template structure of the test report in this embodiment is as follows:

[0081] {"LabReport":"[

[0082] {

[0083] "ReportName": the name of the inspection report,

[0084] "id": serial number,

[0085] "code": code,

[0086] "itemName": project name,

[0087] "itemResult": result,

[0088] "unit": unit,

[0089] "referenceValue": reference value,

[0090] "reportTime": report time

[0091] } ]

[0093] }

[0094] The JSON template structure of the ECG in this embodiment is as follows:

[0095] {"ecgWave":

[0096] {[{x: x coordinate, y: y coordinate}, {x: x coordinate, y: y coordinate}, {x: x coordinate, y: y coordinate}...]}}.

[0097] S2. Acquiring medical case data for teaching purposes, including the following steps:

[0098] S2.1. Obtaining non-test laboratory test results and ECG data from medical teaching case files includes the following steps:

[0099] S2.1.1. Perform OCR on the medical records in paper and / or electronic files to obtain a BlockList array containing coordinate information and block information, and restore the position of each block in the BlockList array based on the coordinates.

[0100] S2.1.2. The BlockList array in step S2.1.1 is formatted and parsed in the large language model LLM by the prompt word project and the block information is output; and the basic information of the patient in the output block information is extracted;

[0101] The basic information includes: name (Name), age (Age), gender (Gender), birthplace (Birthplace), marital status (MaritalStatus), chief complaint (Complaint), current illness history (IllnessHistory), and past illness history (PastIllness) block information;

[0102] In this embodiment, the prompt word project is as follows: You are an assistant with strong semantic comprehension ability. Now your task is to input one or more pieces of case information and find the following information from them: Name, Age, Gender, Birthplace, Marital Status, Chief Complaint, Current Illness History, Past Illness, etc., and output them strictly in JSON format. The keys in this JSON are Name, Age, Gender, Birthplace, Marital Status, Complaint, Illness History, Past Illness, etc. Other information is put into "Others" and finally the complete JSON data is output.

[0103] In some other embodiments, the basic information further includes: date of birth;

[0104] The large language model in this embodiment is qwen2.5-72B-Instruct or Deepseek v3, etc.;

[0105] S2.1.3. Desensitize the basic information using the DFA algorithm, overwriting the processed result with the data output in step S2.1.2;

[0106] S2.1.4. Package the data from step S2.1.3 and input it into the large language model (LLM) to extract slot information.

[0107] S2.1.5. Slot verification includes the following steps:

[0108] When the match is successful, the basic information (BasicInfos) is matched into the corresponding slot;

[0109] When the match fails, it is filled into the Others slot;

[0110] Example of the entire process of step S2.1:

[0111] / **

[0112] * Process patient information and extract relevant content

[0113] * @param patientInfos patient information

[0114] * @return

[0115] * /

[0116] public String sendToLLMServer(String patientInfos) throws Exception{

[0117] if(StringUtil.isBlank(patientInfos)){

[0118] throw new Exception("ask param is null");

[0119] }

[0120] patientInfos = patientInfos.replace(" ", "").replace("\\n", "");

[0121] String systemContent = "You are a semantic analysis and information extraction assistant. You now need to retrieve basic patient information from case information entered by the user. The following are the rules you need to pay attention to:" +

[0122] "- 1. You need to retrieve the fields <patient name>, <gender>, <age>, <native place>, <marital status>, <current address>, <chief complaint>, and <past medical history> from the messy case information;" +

[0123] "- 2. You need to match the retrieved field information to the slot according to this JSON template {\"Name\": patient name,\"Age\": age, \"Gender\": Gender, \"Birthplace\": place of origin, \"MaritalStatus\": marital status, \"Address\": current address, \"Complaint\": chief complaint, \"IllnessHistory\": current medical history, \"PastIllness\": past medical history, \"Others\": others;" +

[0124] "- 3. You do not need to reflect your analysis and reasoning process in the JSON output of your conclusion. Please output the results directly in this JSON format;" +

[0125] "- 4. Please strictly match the case content in the slots that can be matched. If there is no match, please default it to empty and fill it in the Others slot;";

[0126] String systemPrompt = makeSystemPromptContent(systemContent);

[0127] String messagesPrompt = makeMessagesPromptContent(patientInfos);

[0128] String totalMessages = systemPrompt + messagesPrompt;

[0129] / / Call the large model to obtain the answer content

[0130] String str = "{\n" +

[0131] " \"model\": \"qwen2.5-72B-Instruct\",\n" +

[0132] " \"temperature\": 0.1,\n" +

[0133] " \"stream\": false,\n" +

[0134] " \"messages\": [" + totalMessages + "]\n" +

[0135] "}";

[0136] [[ID=|30]]String answer = "";

[0137] MediaType mediaType = MediaType.get("application / json; charset=utf-8");

[0138] okhttp3.RequestBody body = okhttp3.RequestBody.create(mediaType, str);

[0139] Request request = new Request.Builder()

[0140] .url(LLMUtil.INSTANCE.llmUrl)

[0141] .post(body)

[0142] .addHeader("Content-Type", "application / json")

[0143] .build();

[0144] try (Response response = client.newCall(request).execute()) {

[0145] if (!response.isSuccessful()) throw new IOException("Unexpected code" + response);

[0146] JSONObject object = new JSONObject(response.body().string());

[0147] JSONArray array = (JSONArray) object.get("choices");

[0148] JSONObject answerObj = (JSONObject) array.get(0);

[0149] JSONObject messageObj = answerObj.getJSONObject("message");

[0150] answer = (String) messageObj.get("content");

[0151] } catch (IOException e) {

[0152] e.printStackTrace();

[0153] } [[ID=--36]]

[0154] return answer;

[0155] }

[0156] Verification of output result:

[0157] {

[0158] "PatientInfos":

[0159] It should be noted that in the original text, there seems to be an incorrect line tag "ID=--36" which might be a typo. I have translated it as best as possible while maintaining the integrity of the original text structure.{

[0160] "BasicInfos": {

[0161] "Name": "Name",

[0162] "Age": "Age",

[0163] "Gender": "Gender",

[0164] "Birthplace": "Birthplace",

[0165] "MaritalStatus": "MaritalStatus",

[0166] "Complaint": "Complaint",

[0167] "IllnessHistory": "IllnessHistory",

[0168] "PastIllness": "PastIllness",

[0169] "Others": " Others "

[0170] }

[0171] } ]

[0173] }

[0174] S2.2. Obtaining the test data from the medical case file for teaching purposes includes the following steps:

[0175] Performing clarity calibration on the test reports in medical teaching cases through OCR includes the following steps:

[0176] When the recognition rate is greater than 0% and less than 100%, the identified examination items and corresponding examination results are obtained. After the prompt word project determines the department / category, the large language model (LLM) is used to infer, supplement, and trim the block information, maintaining the original file layout, and output.

[0177] When the recognition rate is equal to 100%, the block information of the recognized content is extracted and the original file layout is maintained and output;

[0178] When the recognition rate is equal to 0%, it is discarded;

[0179] S2.2.2. Output the block information obtained in step S2.2.1 to the large language model (LLM) for numerical reasoning and weight verification, including the following steps:

[0180] If the weight of the current data item is higher than the threshold, it is considered to be valid data and retained and output;

[0181] If the weight of the current data item is lower than the threshold, it will be discarded.

[0182] In this embodiment, the current examination test form is a routine blood test (i.e., the current examination item is a routine blood test). When capturing the standard data of each examination item, verification is performed according to the established specifications of the routine blood test, wherein the threshold values ​​of the data items (referring to the examination items in the routine blood test) and their weights are: item code, weight 10%; item name, weight 30%; examination result, weight 30%; reference range, weight 20%; unit, weight 10%; wherein, after weight verification is performed on each examination item (i.e., the data item), if normal data content that reaches its threshold value is captured, then the total weight value of the current examination item (i.e., the routine blood test) is deemed to be 100%, and then retained and output.

[0183] After verifying each inspection item (i.e., the data item), if multiple captures in the inspection item (i.e., the data item) are blurred or lost, the total weight of the current inspection item (i.e., the blood routine examination test sheet data item) is less than 70%, and the total weight value of the inspection item (i.e., blood routine examination) data item is lower than the threshold, and the inspection item data item is discarded.

[0184] That is, when capturing the standard data of each data item in the inspection and test form, verification is performed according to the established specifications of the inspection and test form, wherein the threshold values ​​of the data items and their weights are: project code, weight 10%; project name, weight 30%; inspection result, weight 30%; reference range, weight 20%; unit, weight 10%; wherein, after weight verification of each data item, if all normal data content that meets its threshold is captured, the total weight value of the inspection and test form data item is determined to be 100%, and the data item is retained and output. If, after verification of each data item, multiple captures in the data item are blurred or missing, the total weight of the inspection and test form data item is less than 70%, the inspection and test form data item is below the threshold, and the inspection and test form data item is discarded.

[0185] That is, the weight range is The data items are retained and output.

[0186] The block information obtained from step S2.2.1 is messy data, which is packaged and then input into the large language model LLM;

[0187] Example of the entire process of step S2.2:

[0188] / **

[0189] * Process and check test data information

[0190] * @param reportInfos Check the test report information

[0191] * @return

[0192] * /

[0193] public String sendReportInfosToLLMServer(String reportInfos) throwsException{

[0194] if(StringUtils.isEmpty(reportInfos)){

[0195] throw new Exception("patientInfos param is null");

[0196] }

[0197] reportInfos = reportInfos.replace(" ", "").replace("\\n", "");

[0198] String systemContent = "You are an intelligent assistant with advanced medical skills. You need to perform OCR on the images of test reports uploaded by users and then make inferences and supplement the captured data. Here are the rules you need to pay attention to:" +

[0199] "- 1. You need to retrieve the fields <Inspection and Test Form Name>, <Serial Number>, <Code>, <Project Name>, <Result>, <Unit>, <Reference Value>, and <Report Time> from the inspection and test form data information;" +

[0200] "- 2. You need to match the retrieved field information to the slot {\"LabReport\":" +

[0201] " {[{\"ReportName\": Inspection report name, \"id\": Serial number, \"code\": Code, "+

[0202] "\"itemName\": item name, \"itemResult\": result, \"unit\": unit, " +

[0203] "\"referenceValue\": reference value, \"reportTime\": report time}]}};" +

[0204] "- 3. The example given to you is a JSON array. Whenever there is a type of inspection and test report, please keep the elements in the array filled independently;" +

[0205] "- 4. You do not need to reflect your analysis and reasoning process in the JSON output of your conclusion. Please output the results directly in this JSON format;" +

[0206] "- 5. Please strictly match the case content for the slots that can be matched. If there is no match, please default to empty;";

[0207] String systemPrompt = makeSystemPromptContent(systemContent);

[0208] String messagesPrompt = makeMessagesPromptContent(reportInfos);

[0209] String totalMessages = systemPrompt+messagesPrompt;

[0210] / / Call the big model to get the answer content

[0211] String str = "{\n" +

[0212] " \"model\": \"qwen2.5-72B-Instruct\",\n" +

[0213] " \"temperature\": 0.1,\n" +

[0214] " \"stream\": false,\n" +

[0215] " \"messages\": [" + totalMessages + "]\n" +

[0216] "}";

[0217] String answer = "";

[0218] MediaType mediaType = MediaType.get("application / json; charset=utf-8");

[0219] okhttp3.RequestBody body = okhttp3.RequestBody.create(mediaType,str);

[0220] Request request = new Request.Builder()

[0221] .url(LLMUtil.INSTANCE.llmUrl)

[0222] .post(body)

[0223] .addHeader("Content-Type", "application / json")

[0224] .build();

[0225] try (Response response = client.newCall(request).execute()) {

[0226] if (!response.isSuccessful()) throw new IOException("Unexpected code" + response);

[0227] JSONObject object = new JSONObject(response.body().string());

[0228] JSONArray array = (JSONArray) object.get("choices");

[0229] JSONObject answerObj = (JSONObject) array.get(0);

[0230] JSONObject messageObj = answerObj.getJSONObject("message");

[0231] answer = (String) messageObj.get("content");

[0232] } catch (IOException e) {

[0233] e.printStackTrace();

[0234] }

[0235] return answer;

[0236] }

[0237] Output result verification:

[0238] {

[0239] "PatientInfos": [{

[0240] "BasicInfos": {

[0241] "Name": "Name",

[0242] "Age": "Age", [[ID=�5]]

[0243] "Gender": "Gender",

[0244] "Birthplace": "Birthplace",

[0245] "MaritalStatus": "MaritalStatus",

[0246] "Complaint": "Complaint",

[0247] "IllnessHistory": "IllnessHistory",

[0248] "PastIllness": "PastIllness"

[0249] }

[0250] }, {

[0251] "LabReport": {

[0252] "ReportName": "Blood routine",

[0253] "ReportData": {

[0254] "PatientInfos": [{

[0255] "BasicInfos": {

[0256] "Name": "Name",

[0257] "Age": "Age",

[0258] "Gender": "Gender",

[0259] "Birthplace": "Birthplace",

[0260] "MaritalStatus": "MaritalStatus",

[0261] "Complaint": "Complaint",

[0262] "IllnessHistory": "IllnessHistory",

[0263] "PastIllness": "PastIllness"

[0264] }

[0265] }, {

[0266] "LabReport": {

[0267] [{

[0268] "ReportName": "Hematology Routine",

[0269] "ReportData": {

[0270] "RowInfo": {

[0271] "RowDetails": [{

[0272] "RowContent": "Northwest XXXXXX Hospital",

[0273] "RowId": 1,

[0274] "BlockList": [0]

[0275] }, {

[0276] "RowContent": "Laboratory biochemistry report sample number:",

[0277] "RowId": 2,

[0278] "BlockList": [1, 2]

[0279] }, {

[0280] "RowContent": "Name: Zhang San Gender: Female",

[0281] "RowId": 3,

[0282] "BlockList": [3, 4, 5, 6]

[0283] }, {

[0284] "RowContent": "Age: 19 months Patient ID: 0002145999",

[0285] "RowId": 4,

[0286] "BlockList": [7, 8, 9, 10]

[0287] }, {

[0288] "RowContent": "Department: Children's Health Department Bed Number: 1000",

[0289] "RowId": 5,

[0290] "BlockList": [11, 12, 13, 14]

[0291] }, {

[0292] "RowContent": "Specimen type: 000 Submitting doctor: Clinical diagnosis:",

[0293] "RowId": 6,

[0294] "BlockList": [15, 16, 17, 18]

[0295] }, {

[0296] "RowContent": "1000 Note: 10001",

[0297] "RowId": 7,

[0298] "BlockList": [19, 20, 21]

[0299] }, {

[0300] "RowContent": "Project result unit reference value",

[0301] "RowId": 8,

[0302] "BlockList": [22, 23, 24, 25]

[0303] }, {

[0304] "RowContent": "Total white blood cell count: 11.4 10^9 / L4-10",

[0305] "RowId": 9,

[0306] "BlockList": [26, 27, 28, 29, 30]

[0307] }, {

[0308] "RowContent": "Neutrophil ratio 34.40",

[0309] "RowId": 10,

[0310] "BlockList": [31, 32]

[0311] }, {

[0312] "RowContent": "51-75",

[0313] "RowId": 11,

[0314] "BlockList":

[33]

[0315] }, {

[0316] "RowContent": "Lymphocyte ratio 59.10",

[0317] "RowId": 12,

[0318] "BlockList": [34, 35, 36]

[0319] }, {

[0320] "RowContent": "20-40",

[0321] "RowId": 13,

[0322] "BlockList":

[37]

[0323] }, {

[0324] "RowContent": "Monocyte ratio 4.5 z",

[0325] "RowId": 14,

[0326] "BlockList": [38, 39]

[0327] }, {

[0328] "RowContent": "3-8",

[0329] "RowId": 15,

[0330] "BlockList":

[40]

[0331] }, {

[0332] "RowContent": "Eosinophil ratio 1.6 z",

[0333] "RowId": 16,

[0334] "BlockList": [41, 42]

[0335] }, {

[0336] "RowContent": "0.5-5",

[0337] "RowId": 17,

[0338] "BlockList":

[43]

[0339] }, {

[0340] "RowContent": "Basophil ratio 0.4 z",

[0341] "RowId": 18,

[0342] "BlockList": [44, 45]

[0343] }, {

[0344] "RowContent": "0-1",

[0345] "RowId": 19,

[0346] "BlockList":

[46]

[0347] }, {

[0348] "RowContent": "Neutrophil count 3.92 z10^9 / L 1.8-6.4",

[0349] "RowId": 20,

[0350] "BlockList": [47, 48, 49, 50]

[0351] }, {

[0352] "RowContent": "Lymphocyte count 6.72 10^9 / L0.8-4",

[0353] "RowId": 21,

[0354] "BlockList": [51, 52, 53, 54, 55]

[0355] }, {

[0356] "RowContent": "Monocyte count 0.51 z10^9 / L0.3-8",

[0357] "RowId": 22,

[0358] "BlockList": [56, 57, 58, 59]

[0359] }, {

[0360] "RowContent": "Eosinophil count 0.18 z10^9 / L 0.05-0.5",

[0361] "RowId": 23,

[0362] "BlockList": [60, 61, 62, 63]

[0363] }, {

[0364] "RowContent": "Basophil count 0.04 z10^9 / L0-0.1",

[0365] "RowId": 24,

[0366] "BlockList": [64, 65, 66, 67]

[0367] }, {

[0368] "RowContent": "Hemoglobin 129 zg / L 110-160",

[0369] "RowId": 25,

[0370] "BlockList": [68, 69, 70, 71]

[0371] }, {

[0372] "RowContent": "Red blood cell count 5.06 z10^12 / L 3.5-5.5",

[0373] "RowId": 26,

[0374] "BlockList": [72, 73, 74, 75]

[0375] }, {

[0376] "RowContent": "Hematocrit 41.10 zL / L36-50",

[0377] "RowId": 27,

[0378] "BlockList": [76, 77, 78, 79]

[0379] }, {

[0380] "RowContent": "Mean corpuscular volume 81.2 z",

[0381] "RowId": 28,

[0382] "BlockList": [80, 81]

[0383] }, {

[0384] "RowContent": "80-100",

[0385] "RowId": 29,

[0386] "BlockList":

[82]

[0387] }, {

[0388] "RowContent": "Average hemoglobin content 25.5",

[0389] "RowId": 30,

[0390] "BlockList": [83, 84]

[0391] }, {

[0392] "RowContent": "27-31",

[0393] "RowId": 31,

[0394] "BlockList":

[85]

[0395] }, {

[0396] "RowContent": "Average hemoglobin concentration 314g / L 320-360",

[0397] "RowId": 32,

[0398] "BlockList": [86, 87, 88, 89, 90]

[0399] }, {

[0400] "RowContent": "Red blood cell distribution width 12.8 z%0-15",

[0401] "RowId": 33,

[0402] "BlockList": [91, 92, 93, 94]

[0403] }, {

[0404] "RowContent": "Platelet count 46610^9 / L100-300",

[0405] "RowId": 34,

[0406] "BlockList": [95, 96, 97, 98]

[0407] }, {

[0408] "RowContent": "Platelet distribution width 9.9",

[0409] "RowId": 35,

[0410] "BlockList": [99, 100]

[0411] }, {

[0412] "RowContent": "Average platelet volume 9.6 z",

[0413] "RowId": 36,

[0414] "BlockList": [101, 102]

[0415] }, {

[0416] "RowContent": "% ceremony",

[0417] "RowId": 37,

[0418] "BlockList":

[103]

[0419] }, {

[0420] "RowContent": "15-18",

[0421] "RowId": 38,

[0422] "BlockList":

[104]

[0423] }, {

[0424] "RowContent": "9-13",

[0425] "RowId": 39,

[0426] "BlockList":

[105]

[0427] }, {

[0428] "RowContent": "Plateletcrit 0.45% 0.114",

[0429] "RowId": 40,

[0430] "BlockList": [106, 107, 108, 109, 110]

[0431] }, {

[0432] "RowContent": "0.282",

[0433] "RowId": 41,

[0434] "BlockList":

[111]

[0435] }, {

[0436] It should be noted that the translation of "血小板比积" as "Plateletcrit" is a common medical term translation, and for the term "%礼", it seems rather unclear in the context, and the translation here is a speculation based on the overall situation. You may need to double-check according to the specific background knowledge."RowContent": "Large platelet ratio 20.60 z%13-43",

[0437] "RowId": 42,

[0438] "BlockList": [112, 113, 114, 115]

[0439] }, {

[0440] "RowContent": "Inspection time: 2017 / 8 / 29 Report time: 2017-08-29",

[0441] "RowId": 43,

[0442] "BlockList": [116, 117, 118, 119]

[0443] }, {

[0444] "RowContent": "Inspector: Dong Er Reviewer: Yu San",

[0445] "RowId": 44,

[0446] "BlockList": [120, 121, 122, 123]

[0447] }],

[0448] "RowCount": 44

[0449] }

[0450] }

[0451] }]

[0452] }

[0453] }]

[0454] }

[0455] }

[0456] }]

[0457] }

[0458] S2.3. Acquiring ECG data, including the following steps:

[0459] S2.3.1. Perform OCR on the ECG in the case and obtain the data set of the xy coordinate replot points of the waveform data within the time period ;

[0460] Where p refers to the waveform object; the waveform object is an array, and the elements in the array are the xy-axis coordinate information of each point of the waveform, from the first to the nth coordinate point; is the origin of the coordinate axis;

[0461] S2.3.2. Calculate the data set obtained in step S2.3.1 using a moving average filter algorithm and reinterpolate the calculated values ​​to obtain a low-noise ECG waveform data coordinate data set, comprising the following steps:

[0462] S2.3.2.1. Set a value range for the data set obtained in step S2.3.1;

[0463] S2.3.2.2. Re-interpolate the values ​​obtained in step S2.3.2.1 using the following formula:

[0464] ;

[0465] Among them, FV refers to the value at index i after filtering; n refers to the value range, n is an integer, and n represents the total number of coordinate positions of the points within the translation filter window; y refers to the coordinate; i refers to the number of bits of the point;

[0466] S2.3.3. The data set obtained from step S2.3.2 is sent to the ECG calculation engine to locate the waveform category; preferably, in this embodiment, the ECG calculation engine is AI-ECG Platform or ECG_Nets;

[0467] Preferably, in this embodiment, the data set obtained from step S2.3.2 is messy data, which is packaged and sent to the ECG calculation engine to locate the waveform category;

[0468] Example of the entire process of step S2.3:

[0469] / **

[0470] * Process ECG wave data information

[0471] * @param ecgWaveInfos ECG wave data information

[0472] * @return

[0473] * /

[0474] public String sendECGWaveInfosToLLMServer(String ecgWaveInfos) throwsException{

[0475] if(StringUtils.isEmpty(ecgWaveInfos)){

[0476] throw new Exception("ecgWaveInfos param is null");

[0477] }

[0478] String systemContent = "You are an intelligent assistant specializing in ECG data analysis. All the data I provide is digital data simulated based on the coordinates of real ECG signals." +

[0479] "Now you need to restore this section of ECG data based on the information of all the coordinate points provided and make an analysis. The following are the rules you need to pay attention to:" +

[0480] 1. This is a real ECG data set processed with a translation filter to obtain the noise reduction result. Therefore, some coordinates are not precise enough. You need to determine whether they are valid based on the previous and next coordinate positions.

[0481] "- 2. You need to match the retrieved field information to the slot according to this JSON template {\"ecgWave\":{[{x: x coordinate, y: y coordinate}, {x: x coordinate, y: y coordinate}, {x: x coordinate, y: y coordinate}...]}};" +

[0482] "- 3. The example given to you is a JSON object, but the innermost part is in array form, and the elements are the xy-axis coordinate values ​​of each point of the ECG waveform data;" +

[0483] "- 4. You do not need to reflect your analysis and reasoning process in the JSON output of your conclusion. Please output the results directly in this JSON format;";

[0484] String systemPrompt = makeSystemPromptContent(systemContent);

[0485] String messagesPrompt = makeMessagesPromptContent(ecgWaveInfos);

[0486] String totalMessages = systemPrompt+messagesPrompt;

[0487] / / Call the capabilities of the large model to obtain the answer content

[0488] String str = "{\n" +

[0489] " \"model\": \"qwen2.5-72B-Instruct\",\n" +

[0490] " \"temperature\": 0.1,\n" +

[0491] " \"stream\": false,\n" +

[0492] " \"messages\": [" + totalMessages + "]\n" +

[0493] [[ID=18"]"}";

[0494] String answer = "";

[0495] MediaType mediaType = MediaType.get("application / json; charset=utf-8");

[0496] okhttp3.RequestBody body = okhttp3.RequestBody.create(mediaType,str);

[0497] Request request = new Request.Builder()

[0498] .url(LLMUtil.INSTANCE.llmUrl)

[0499] .post(body)

[0500] .addHeader("Content-Type", "application / json")

[0501] .build();

[0502] try (Response response = client.newCall(request).execute()) {

[0503] if (!response.isSuccessful()) throw new IOException("Unexpected code" + response);

[0504] JSONObject object = new JSONObject(response.body().string());

[0505] JSONArray array = (JSONArray) object.get("choices");

[0506] JSONObject answerObj = (JSONObject) array.get(0);

[0507] JSONObject messageObj = answerObj.getJSONObject("message");

[0508] answer = (String) messageObj.get("content");

[0509] } catch (IOException e) {

[0510] e.printStackTrace();

[0511] }

[0512] return answer;

[0513] }

[0514] Output result verification:

[0515] {

[0516] "PatientInfos": [{

[0517] "BasicInfos": {

[0518] "Name": "Name",

[0519] "Age": "Age",

[0520] "Gender": "Gender",

[0521] "Birthplace": "Birthplace",

[0522] "MaritalStatus": "MaritalStatus",

[0523] "Complaint": "Complaint",

[0524] "IllnessHistory": "IllnessHistory",

[0525] "PastIllness": "PastIllness"

[0526] }

[0527] }, {

[0528] "ecgWave": {

[0529] "ecg_data": [{

[0530] "x": 0.0,

[0531] "y": 0.0

[0532] },

[0533] {

[0534] "x": 0.0033333333333333335,

[0535] "y": -0.0016948237154534444

[0536] },

[0537] {

[0538] "x": 0.006666666666666667,

[0539] "y": -0.003361599791697647

[0540] },

[0541] {

[0542] "x": 0.01,

[0543] "y": -0.004968599066819798

[0544] },

[0545] {

[0546] "x": 0.013333333333333334,

[0547] "y": -0.006484301869726548

[0548] },

[0549] {

[0550] "x": 0.016666666666666666,

[0551] "y": -0.007876808133455077

[0552] },

[0553] {

[0554] "x": 0.02,

[0555] "y": -0.009114608595955716

[0556] },

[0557] {

[0558] "x": 0.023333333333333334,

[0559] "y": -0.010167582986796075

[0560] },

[0561] {

[0562] "x": 0.026666666666666668,

[0563] "y": -0.01100691047831769

[0564] },

[0565] {

[0566] "x": 0.03,

[0567] "y": -0.01160616741919958

[0568] },

[0569] {

[0570] "x": 0.033333333333333333,

[0571] "y": -0.01194256907856501

[0572] },

[0573] {

[0574] "x": 0.0366666666666667,

[0575] "y": -0.012007037689655172

[0576] },

[0577] {

[0578] "x": 0.04,

[0579] "y": -0.011794489952554875

[0580] },

[0581] {

[0582] "x": 0.0433333333333333335,

[0583] "y": -0.011304033233968987

[0584] },

[0585] {

[0586] "x": 0.04666666666666667,

[0587] "y": -0.010540987487198764

[0588] },

[0589] {

[0590] "x": 0.05,

[0591] "y": -0.009514899940988785

[0592] },

[0593] {

[0594] "x": 0.053333333333333333,

[0595] "y": -0.008240783428645758

[0596] },

[0597] {

[0598] "x": 0.05666666666666667,

[0599] "y": -0.006740856950199369

[0600] },

[0601] {

[0602] "x": 0.06,

[0603] "y": -0.005040336746496748

[0604] },

[0605] {

[0606] "x": 0.063333333333333333,

[0607] "y": -0.003176651138005918

[0608] },

[0609] {

[0610] "x": 0.06666666666666667,

[0611] "y": -0.0011895737766694745

[0612] },

[0613] {

[0614] "x": 0.07,

[0615] "y": 0.0008671976387839686

[0616] },

[0617] {

[0618] "x": 0.073333333333333333,

[0619] "y": 0.002936785714285714

[0620] },

[0621] {

[0622] "x": 0.07666666666666667,

[0623] "y": 0.004957746478873239

[0624] },

[0625] {

[0626] "x": 0.08,

[0627] "y": 0.006870542635658915

[0628] },

[0629] {

[0630] "x": 0.083333333333333333,

[0631] "y": 0.00861763005780347

[0632] },

[0633] {

[0634] "x": 0.08666666666666667,

[0635] "y": 0.010143766233766234

[0636] },

[0637] {

[0638] "x": 0.09,

[0639] "y": 0.011397777777777778

[0640] },

[0641] {

[0642] "x": 0.09333333333333334,

[0643] "y": 0.012333333333333334

[0644] },

[0645] {

[0646] "x": 0.09666666666666667,

[0647] "y": 0.012917127071823205

[0648] },

[0649] {

[0650] "x": 0.1,

[0651] "y": 0.01312037037037037

[0652] },

[0653] {

[0654] "x": 0.10333333333333334,

[0655] "y": 0.01292543352601156

[0656] },

[0657] {

[0658] "x": 0.10666666666666667,

[0659] "y": 0.012328467153284672

[0660] },

[0661] {

[0662] "x": 0.11,

[0663] "y": 0.011330985915492957

[0664] },

[0665] {

[0666] "x": 0.11333333333333333,

[0667] "y": 0.009939682539682539

[0668] },

[0669] {

[0670] "x": 0.11666666666666667,

[0671] "y": 0.008166666666666666

[0672] },

[0673] {

[0674] "x": 0.12,

[0675] "y": 0.006038095238095238

[0676] },

[0677] {

[0678] "x": 0.12333333333333333,

[0679] "y": 0.0035746268656716416

[0680] },

[0681] {

[0682] "x": 0.12666666666666667,

[0683] "y": 0.0008163265306122448

[0684] },

[0685] {

[0686] "x": 0.13,

[0687] "y": -0.0022857142857142856

[0688] },

[0689] {

[0690] "x": 0.133333333333333333,

[0691] "y": -0.005666666666666666

[0692] },

[0693] {

[0694] "x": 0.13666666666666667,

[0695] "y": -0.009285714285714286

[0696] },

[0697] {

[0698] "x": 0.14,

[0699] "y": -0.013071428571428571

[0700] },

[0701] {

[0702] "x": 0.14333333333333334,

[0703] "y": -0.016942857142857142

[0704] },

[0705] {

[0706] "x": 0.14666666666666667,

[0707] "y": -0.020842857142857143

[0708] },

[0709] {

[0710] "x": 0.15,

[0711] "y": -0.024714285714285715

[0712] },

[0713] {

[0714] "x": 0.15333333333333335,

[0715] "y": -0.028485714285714286

[0716] },

[0717] {

[0718] "x": 0.15666666666666667,

[0719] "y": -0.03207142857142857

[0720] },

[0721] {

[0722] "x": 0.16,

[0723] "y": -0.03542857142857143

[0724] },

[0725] {

[0726] "x": 0.16333333333333333,

[0727] "y": -0.038514285714285716

[0728] },

[0729] {

[0730] "x": 0.16666666666666669,

[0731] "y": -0.04131428571428571

[0732] },

[0733] {

[0734] "x": 0.17,

[0735] "y": -0.04377142857142857

[0736] },

[0737] {

[0738] "x": 0.17333333333333334,

[0739] "y": -0.04585714285714286

[0740] },

[0741] {

[0742] "x": 0.1766666666666667,

[0743] "y": -0.04754285714285714

[0744] },

[0745] {

[0746] "x": 0.18,

[0747] "y": -0.04877142857142857

[0748] },

[0749] {

[0750] "x": 0.18333333333333335,

[0751] "y": -0.04951428571428571

[0752] },

[0753] {

[0754] "x": 0.18666666666666667,

[0755] "y": -0.04977142857142857

[0756] },

[0757] {

[0758] "x": 0.19,

[0759] "y": -0.04951428571428571

[0760] },

[0761] {

[0762] "x": 0.19333333333333336,

[0763] "y": -0.04877142857142857

[0764] },

[0765] {

[0766] "x": 0.19666666666666668,

[0767] "y": -0.04754285714285714

[0768] },

[0769] {

[0770] "x": 0.2,

[0771] "y": -0.04585714285714286

[0772] },

[0773] {

[0774] "x": 0.20333333333333334,

[0775] "y": -0.04377142857142857

[0776] },

[0777] {

[0778] "x": 0.2066666666666667,

[0779] "y": -0.04131428571428571

[0780] },

[0781] {

[0782] "x": 0.21,

[0783] "y": -0.038514285714285716

[0784] },

[0785] {

[0786] "x": 0.21333333333333337,

[0787] "y": -0.03542857142857143

[0788] },

[0789] {

[0790] "x": 0.216666666666666667,

[0791] "y": -0.03207142857142857

[0792] },

[0793] {

[0794] "x": 0.22,

[0795] "y": -0.028485714285714

[0796] }

[0797] }

[0798] }]

[0799] }

[0800] }

[0801] }]

[0802] }

[0803] S3. Slot matching is performed on the medical teaching case data obtained in step S2 to obtain training data for the medical teaching large model, including the following steps:

[0804] S3.1. The data obtained from step S2.2, the data obtained from step S2.3 and the data obtained from step S2.1 are verified. If, in addition to checking the test sheet and ECG, the slot block information is partially or zero matched, it is prompted that the data is not the same case and the block information content does not match; and the matching block information is extracted from the corresponding data obtained and matched until the match is successful;

[0805] If all the slot block information except the check test sheet and ECG matches, proceed as follows:

[0806] S3.2. After slot matching the data obtained in step S2.1, the data obtained in step S2.2, and the data obtained in step S2.3 according to the JSON template predefined in step S1, the training data for the large medical teaching model is obtained.

[0807] This embodiment further provides a method for constructing training data for a large medical teaching model using training data for a large medical teaching model to construct a medical teaching case, preferably further comprising: S2.4. Acquiring medical teaching simulation data;

[0808] The medical simulation data is the dynamic change logic data of vital signs driven by physiological factors and / or the dynamic change logic data of drug metabolism in the drug metabolism kinetic model;

[0809] Preferably, it also includes: S2.5. Obtaining regular procedures for transferring knowledge and / or skills for medical teaching.

[0810] Preferably, the medical teaching case includes: a medical record data module, a medical teaching simulation data module, and a rule program module for transferring knowledge and / or skills for medical teaching;

[0811] Among them, the medical record data module is used to provide clinical diagnosis and treatment basis for teaching, including: examination and test order files; electrocardiogram files; non-examination test orders and electrocardiogram files; the medical teaching simulation data module is used to provide dynamic simulation data of patient vital signs, including: dynamic change logic data of vital signs driven by physiological means and / or dynamic change logic data of drug metabolism in drug metabolism kinetics model; the rule program module for transferring knowledge and / or skills for medical teaching is used to provide teaching framework structure, teaching process interaction mode and teaching logic process control.

[0812] The above preferred embodiments are merely intended to help illustrate the present application. The preferred embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Therefore, all equivalent modifications or variations that do not depart from the spirit and technical concepts disclosed in the present application are intended to be within the scope of protection of the present application.

Claims

1. A method for constructing training data for a large medical teaching model, characterized in that: The following steps are involved: S1. Predefined medical case JSON template; S2. Acquiring medical case data for teaching purposes, including the following steps: S2.

1. Obtain non-test test results and ECG data from medical case files for teaching purposes; S2.

2. Obtaining test data from medical case files for teaching purposes; S2.

3. Obtain ECG data; S3 will be obtained from step S2 of the medical teaching case data slot matching, to obtain training data for the medical teaching model; The step S2.1 includes the following steps: S2.1.

1. Perform OCR on the medical records in paper and / or electronic files to obtain a BlockList array containing coordinate information and block information, and restore the position of each block in the BlockList array based on the coordinates. S2.1.

2. The BlockList array in step S2.1.1 is formatted and parsed in a large language model by prompting the project word and outputting block information; and the basic information of the patient in the output block information is extracted; The basic information includes: name, age, gender, place of birth, marital status, chief complaint, current medical history, and past medical history information; S2.1.

3. Desensitize the basic information using the DFA algorithm, overwriting the processed result with the data output in step S2.1.2; S2.1.

4. Package the data from step S2.1.3 and input it into the large language model to extract slot information; S2.1.

5. Slot verification includes the following steps: When the match is successful, the basic information is matched into the corresponding slot; When the match fails, it is filled into other slots; The step S2.2 comprises the following steps: Performing clarity calibration on the test reports in medical teaching cases through OCR includes the following steps: When the recognition rate is greater than 0% and less than 100%, the identified examination items and corresponding examination results are obtained. After the prompt word project determines the department / category, the block information is inferred, supplemented, and trimmed based on the large language model, maintaining the original file layout and output; When the recognition rate is equal to 100%, the block information of the recognized content is extracted and the original file layout is maintained and output; When the recognition rate is equal to 0%, it is discarded; S2.2.

2. Output the block information obtained in step S2.2.1 to the large language model, perform numerical reasoning and inference, and output the weights, including the following steps: If the weight of the current data item is higher than the threshold, it is considered to be valid data and retained and output; If the current data item weight is lower than the threshold, it will be discarded; The step S2.3 comprises the following steps: S2.3.

1. Perform OCR on the ECG in the case and obtain the data set of the xy coordinate replot points of the waveform data within the time period ; Where p refers to the waveform object; the waveform object is an array, and the elements in the array are the xy-axis coordinate information of each point of the waveform, from the first to the nth coordinate point; is the origin of the coordinate axis; S2.3.

2. Calculate the data set obtained in step S2.3.1 using a moving average filter algorithm and reinterpolate the calculated values ​​to obtain a low-noise ECG waveform data coordinate data set, comprising the following steps: S2.3.2.

1. Set a value range for the data set obtained in step S2.3.1; S2.3.2.

2. Re-interpolate the values ​​obtained in step S2.3.2.1 using the following formula: ; Among them, FV refers to the value at index i after filtering; n refers to the value range, n is an integer, and n represents the total number of coordinate positions of the points within the translation filter window; y refers to the coordinate; i refers to the number of bits of the point; S2.3.

3. Send the data set obtained from step S2.3.2 to the ECG calculation engine to locate the waveform category.

2. A method for constructing training data for a large medical teaching model according to claim 1, characterized in that: When capturing the standard data of each data item in the inspection and test form, verification is performed according to the established specifications of the inspection and test form, wherein the threshold values ​​of the data items and their weights are: project code, weight 10%; project name, weight 30%; inspection result, weight 30%; reference range, weight 20%; unit, weight 10%; wherein, after verification of each data item, if normal data content reaching its threshold is captured, it is determined that the total weight value of the inspection and test form data item is 100%, and it is retained and output; when after verification of each data item, if multiple captures in the data item are blurred or lost, the total weight of the inspection and test form data item is less than 70%, the inspection and test form data item is lower than the threshold, and the inspection and test form data item is discarded.

3. A method for constructing training data for a large medical teaching model according to claim 1, characterized in that: The ECG computing engine is AI-ECG Platform or ECG_Nets.

4. A method for constructing training data for a large medical teaching model according to claim 3, characterized in that: The data set obtained from step S2.3.2 is messy data. After data packaging, it is sent to the ECG calculation engine to locate the waveform category.

5. A method for constructing training data for a large medical teaching model according to any one of claims 1 to 4, characterized in that: The step S3 comprises the following steps: S3.

1. Verify the data obtained in step S2.2 and step S2.3 with the data obtained in step S2.

1. If the slot block information, excluding the test report and ECG, partially or completely matches, a message is displayed indicating that the data is not from the same case and the block information content does not match. Then, extract matching block information from the corresponding data obtained and match them until a match is successful. If all slot block information, excluding the test report and ECG, matches, proceed to the following steps: S3.

2. After slot matching the data obtained in step S2.1, the data obtained in step S2.2, and the data obtained in step S2.3 according to the JSON template predefined in step S1, the training data for the large medical teaching model is obtained.

6. A method for constructing training data for a large medical teaching model according to any one of claims 1 to 4, characterized in that: The large language model is qwen2.5-72B-Instruct or Deepseek v3.

Citation Information

Patent Citations

  • Electronic medical record management method and system based on AI calculation

    CN119724463A

  • Configuring a generative machine learning model using a syntactic interface

    US12211598B1