Virtual patient generation method, system and agent

By parsing medical record text using meta-feature vectors and combining general and specialized prompts, a virtual patient language model is generated. This solves the problems of redundant prompts and high maintenance costs in existing technologies, achieving high-quality virtual patient generation and improving teaching effectiveness.

CN122221900APending Publication Date: 2026-06-16联通数智医疗科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
联通数智医疗科技有限公司
Filing Date
2026-02-28
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing technologies for generating virtual patients suffer from redundant prompts, high maintenance costs, poor scalability, and a lack of dedicated intelligent agents for generating virtual patients. Consequently, the language of the generated virtual patients does not conform to the colloquial descriptions of real patients, thus affecting the teaching effect.

Method used

The medical record text is parsed using meta-feature vectors. Combined with a general prompt word base and a specialist prompt word plugin, highly targeted large language model prompt words are generated. The large language model is then used for spoken language conversion and consistency verification to form a virtual patient oral history file.

Benefits of technology

It reduces development and maintenance costs, improves the accuracy and depth of converting specialized terminology into spoken language, generates virtual patient language that is more closely aligned with real patient profiles, has flexible scalability, and fills the gap in intelligent agents specifically for generating virtual patients.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122221900A_ABST
    Figure CN122221900A_ABST
Patent Text Reader

Abstract

The application discloses a virtual patient generation method, system and agent. The virtual patient generation method comprises the steps of: parsing medical record text to obtain a plurality of fields, extracting corresponding keywords from the plurality of fields, and assembling the keywords into a meta feature vector; loading a preset general prompt word base based on a general rule; loading a preset special prompt word plug-in based on a special rule according to the corresponding keywords in the meta feature vector; assembling the general prompt word base and the special prompt word plug-in to generate a large language model prompt word containing the general prompt word base, the special prompt word plug-in and the medical record text; inputting the large language model prompt word into a corresponding large language model, and converting the medical record text into a colloquial form by the large language model, so as to output one or more virtual patient oral archives simulating original patients. The virtual patient generation method, system and agent have low maintenance cost and high expansibility in a multi-department scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of large language models (LLM) in artificial intelligence, and in particular to methods, systems and intelligent agents for generating virtual patients. Background Technology

[0002] In the field of medical education, using AI-powered large language model technology to simulate "Standardized Patients (SPs)," or virtual patients, for simulated consultation training has become an important means of improving medical students' clinical skills. This is achieved by having the AI ​​model simulate a patient engaging in dialogue with the trainee. Directly inputting professional, medical-oriented medical record text into the dialogue model results in generated "patient" language filled with medical jargon, such as "complaint of oppressive pain behind the sternum accompanied by dyspnea for 3 hours." This is severely inconsistent with the colloquial description of a real patient, such as "feeling as if a stone is pressing on my chest, making it difficult to breathe," thus undermining the realism of the simulation and the teaching effect. Therefore, a preprocessing step is needed before inputting medical record data into the dialogue model to convert the professional medical record into a colloquial self-narration that aligns with the patient's identity, knowledge level, and expression habits.

[0003] In existing technologies, there are two main types of implementations for the preprocessing steps before dialogue: (1) Develop a set of general prompts to process medical records from all departments. The prompts will ask the LLM to "convert the following medical records into a conversational description from the patient's perspective" and list the fields that need to be converted (such as chief complaint, present illness, etc.). However, this method applies a set of rules to all scenarios. At the same time, due to the excessive length of the prompts, it not only consumes a large number of tokens in the background computing power of the large language model system, but also easily leads to the large language model losing attention (Lost in the Middle) and causing hallucinations. For example, when processing orthopedic medical records, the general prompts may also check for "menstrual history", which is very likely to cause logical confusion in the large language model. (2) Each specialty (such as cardiology, obstetrics and gynecology, and pediatrics) should compile a set of dedicated prompts based on the key points of the consultation and the habit of terminology. For example, when processing obstetrics and gynecology medical records, the prompts will specifically emphasize "please extract and convert menstrual history and marital history in detail"; when processing pediatric medical records, it is required to "pay attention to describing the growth and development from the perspective of the parents"; however, this is costly to maintain. A hospital usually has dozens of clinical departments. If the general logic (such as privacy desensitization and terminology conversion) changes, dozens of prompt files need to be modified at the same time, resulting in complex code redundancy and poor scalability.

[0004] On the other hand, existing technologies have developed various agents for medical consultation applications, but these are all agents based on multi-turn dialogues between real patients and virtual doctors, lacking agents specifically trained to generate virtual patients. Summary of the Invention

[0005] To overcome one or more technical problems existing in the prior art, the present invention provides a virtual patient generation method, system and intelligent agent, which can take into account both the universality and specialization of prompt word generation, and adapt to the low maintenance cost and high scalability requirements in multi-department hospital scenarios.

[0006] In a first aspect, the present invention provides a method for generating a virtual patient, comprising the steps of: Parse the medical record text to obtain multiple fields, extract the corresponding keywords from the multiple fields, and assemble the keywords into a meta-feature vector; Load a pre-defined general prompt word base based on general rules; the general rules include privacy desensitization constraints and general terminology to colloquial language constraints; Based on the keywords in the meta-feature vector, load the preset specialty prompt word plugin based on specialty rules; the specialty rules include the constraint conditions for converting specialty terminology into spoken language. By assembling the general prompt word base and the specialist prompt word plugin, a large language model prompt word is generated, which includes the general prompt word base, the specialist prompt word plugin, and the medical record text. Input the prompt words of the large language model into the corresponding large language model, and the large language model will convert the medical record text into spoken language, thereby outputting one or more virtual patient oral accounts simulating the original patient.

[0007] Preferably, when the large language model performs spoken language conversion on the medical record text, it first outputs one or more virtual patient oral statements, then performs consistency verification on the output one or more virtual patient oral statements, and finally forms a virtual patient oral statement file simulating the original patient.

[0008] Preferably, the keywords corresponding to the meta-feature vector include specialty department, age, and gender.

[0009] Furthermore, based on the keywords corresponding to the meta-feature vector, a preset specialty prompt word plugin based on specialty rules is loaded. Specifically, by using the specialty department keywords in the meta-feature vector, a preset specialty prompt word plugin mapping table is searched, and then the preset specialty prompt word plugin is loaded from the template library.

[0010] Preferably, when assembling the general prompt word base and the specialist prompt word plugin, the large language model prompt word is assembled from the patient role, the general prompt word base, the specialist prompt word plugin, and the medical record text.

[0011] In a second aspect, the present invention provides a virtual patient generation system, including a medical record parsing module, a general prompting word module, a specialist prompting word module, an assembly module, and a large language model execution module; The medical record parsing module is used to parse medical record text to obtain multiple fields, extract corresponding keywords from multiple fields, and assemble the keywords into meta-feature vectors; The general prompt word module is used to load a preset general prompt word base based on general rules; the general rules include privacy desensitization constraints and general terminology to colloquial language constraints; The specialty prompt word module is used to load a preset specialty prompt word plugin based on specialty rules according to the keywords corresponding to the meta-feature vector; the specialty rules include the constraint condition of converting specialty terminology into colloquial language; The assembly module is used to assemble the general prompt word base and the specialist prompt word plugin to generate a large language model prompt word that includes the general prompt word base, the specialist prompt word plugin, and the medical record text; The large language model execution module is used to input the prompt words of the large language model into the corresponding large language model, and the large language model performs spoken language conversion on the medical record text, thereby outputting one or more virtual patient oral accounts simulating the original patient.

[0012] Thirdly, the present invention provides a virtual patient generation system, which is a computer program product; the computer program product includes a computer program, which, when executed by a processor, implements the virtual patient generation method described above.

[0013] Fourthly, the present invention provides a virtual patient generation system, which is an electronic device, the electronic device including at least one processor and a memory communicatively connected to at least one processor; The memory stores instructions that can be executed by at least one processor, such that the at least one processor is able to perform any of the aforementioned virtual patient generation methods.

[0014] Fifthly, the present invention provides a virtual patient generation system, which is a computer-readable storage medium storing computer instructions; the computer instructions are used to cause a computer device to execute the virtual patient generation method according to any of the preceding claims.

[0015] In a sixth aspect, the present invention provides a virtual patient generation agent for performing the virtual patient generation method of any of the foregoing claims, comprising: The input module is used to receive input information, which is the prompt word of the large language model of any of the aforementioned items; The processing module is used to determine the target task based on the input information received by the input module, execute the target task to obtain output information, and the output information is a virtual patient oral history file of any of the aforementioned items; The output module is used to output the information obtained by the processing module.

[0016] Compared with existing technologies, the virtual patient generation method, system, and intelligent agent of the present invention have the following advantages: To reduce development and maintenance costs, only one general prompt word base and several independent specialty prompt word plugins need to be maintained. When adding a new department, there is no need to write and update the entire set of prompt words from scratch. When the general rules need to be updated, only one modification to the general prompt word base is needed to automatically apply the changes to all specialty departments, thus significantly improving maintenance efficiency. Improve the accuracy and depth of converting specialist terminology into spoken language: By loading specialist prompt word plugins, targeted instructions can be provided to the large language model, enabling it to accurately capture and convert key information unique to that specialty, avoiding the "interdisciplinary illusion," and making the spoken language style of the generated virtual patients more consistent with the real patient profile; Flexible scalability: With the addition of departments or updates to medical knowledge, prompt word templates can be easily added or updated without affecting overall operation; It fills the gap in existing technology where there is a lack of intelligent agents specifically designed to generate virtual patients. Attached Figure Description

[0017] Figure 1 This is a flowchart of one of the virtual patient generation methods of the present invention.

[0018] Figure 2 This is a structural framework diagram of one of the virtual patient generation systems of the present invention.

[0019] Figure 3 This is a structural framework diagram of one of the virtual patient generation intelligent agents of the present invention. Detailed Implementation

[0020] Referring to the illustrations, the principles of the invention are illustrated by way of example implementation in a suitable operating environment. The following description is based on the illustrative specific embodiments of the invention and should not be construed as limiting the invention to other specific embodiments not detailed herein.

[0021] Furthermore, the term "preferred" as used herein is intended to refer to an example, illustration, or illustration. Any aspect or design described herein as "preferred" need not be construed as being more advantageous than other aspects or designs. Rather, the use of the term "preferred" is intended to present the concept in a concrete manner. The term "or" as used in this application is intended to mean an inclusive "or" rather than an exclusionary "or." That is, unless otherwise specified or clear from the context, "X uses A or B" naturally includes either of the permutations. Specifically, if X uses A; X uses B; or X uses both A and B, then "X uses A or B" is satisfied in any of the foregoing examples.

[0022] Furthermore, although this disclosure has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art based on a reading and understanding of this specification and drawings. This disclosure includes all such modifications and variations and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the aforementioned components (e.g., elements, resources, etc.), the terminology used to describe such components is intended to correspond to any component (unless otherwise indicated) that performs the specified function of said component (e.g., is functionally equivalent to it), even if structurally not equivalent to the disclosed structure that performs the function in the exemplary implementation of this disclosure shown herein. Moreover, although a particular feature of this disclosure has been disclosed with respect to only one of several implementations, such feature may be combined with one or more other features of other implementations that may be desirable and advantageous for a given or particular application. Furthermore, with regard to the use of the terms “comprising,” “having,” “containing,” or variations thereof in the Detailed Description or claims, such terms are intended to be included in a manner similar to the term “including.”

[0023] The first embodiment of the present invention is described below.

[0024] Please refer to Figure 1 The virtual patient generation method of this embodiment includes the following steps: S1. Parse the medical record text to obtain multiple fields in the medical record, extract the corresponding keywords from the multiple fields, and then assemble the keywords into a meta-feature vector.

[0025] In this preferred embodiment, the three fields "specialty department", "age" and "gender" are set as keywords, and the three keywords are assembled into a meta-feature vector V={specialty department, age, gender}.

[0026] In this embodiment, the medical record text is an electronic medical record. If the original medical record text is a paper document, it is converted into an electronic medical record through OCR technology and / or multimodal large model. The source of the medical record text is mainly the original outpatient medical record and inpatient medical record of the medical institution, or it can be a virtual medical record generated by manual setting and / or AI.

[0027] In this embodiment, the fields in the medical record mainly include the patient's role, privacy information, gender, age, chief complaint, present illness, past medical history, personal history, marital and reproductive history, family history, department, specialty, auxiliary examinations, physical examination, preliminary diagnosis, diagnostic basis, differential diagnosis, treatment plan, etc. In this embodiment, when parsing the medical record text to extract fields, the text content in the medical record text is set to whether to perform Chinese-English translation and parsing according to the medical terminology conventions, that is, the text content that widely uses English in terms of terminology is not translated and parsed.

[0028] S2. Load the preset universal prompt word base based on universal rules.

[0029] In this embodiment, the general rules include two categories: privacy desensitization constraints and general terminology-to-colloquial constraints. The privacy desensitization constraints and general terminology-to-colloquial constraints are set manually and / or intelligently set using a medical knowledge base. The general prompt word base is stored in the instruction library.

[0030] In this embodiment, the general prompt word base includes dialogue instructions for a large language model. These dialogue instructions are required for all specialized department tasks, and the content of the instructions is a structured text fragment. The core instruction content of one of the general prompt word bases in this embodiment is shown below: #You are a professional data rewriting assistant, and your task is to convert medical record text into patients' spoken language; #Remove private information such as names; #Transform common medical terms into plain language according to the following common terminology-to-colloquial constraints (e.g., retrosternal squeezing pain -> chest feels like a heavy stone is pressing down). #Constraint 1: XXX; Constraint 2: XXX; Constraint 3: XXX; ...; # Output a virtual patient narration file in standard JSON format.

[0031] S3. Based on the corresponding specialty department keywords in the meta-feature vector, load the preset specialty prompt word plugin based on the corresponding specialty rules.

[0032] In this embodiment, the specialty rules include constraints on the conversion of specialty terminology to colloquial language. These constraints are set manually and / or intelligently by the medical knowledge base. The specialty prompt word plugin is stored in the instruction library. Examples of these constraints in this embodiment include: for obstetrics and gynecology, the constraints must include descriptions of menstrual history and reproductive history; for pediatrics, the constraints must include a shift in perspective (parent's viewpoint) and a description of growth and development history; and for orthopedics, the constraints must include descriptions of injury mechanisms (car accident, fall) and limitations in activity. The constraints for converting psychiatric terminology to spoken language must include the retention of irrational descriptive content (i.e., no logical correction is made to hallucinations and delusions). Examples of the constraints for converting psychiatric terminology to spoken language in several specialty prompt word plugins in this embodiment are as follows: For obstetrics and gynecology, the last menstrual period time must be extracted and the language must be subtle or anxious; for pediatrics, "infant" and "child" must be converted to the first-person pronoun "my child" or "baby" and the focus must be on describing symptoms, crying, and the child's behavior; for psychiatry, the original descriptions of "talking to oneself" and "persecution delusions" must be retained and cannot be processed.

[0033] In this embodiment, the specialist department keyword in the meta-feature vector V={specialty department, age, gender} is used to search a preset specialist prompt word plugin mapping table, and then a preset specialist prompt word plugin is loaded from the instruction library. If the specialist department in the meta-feature vector is blank, or if no corresponding specialist prompt word plugin is found after searching the preset specialist prompt word plugin mapping table, the specialist prompt word plugin for the corresponding internal medicine department is loaded by default.

[0034] In this embodiment, the specialist prompt word plugin includes dialogue instructions for the large language model. These instructions are only required for tasks within the corresponding specialist department. The content of the instructions is a structured text fragment. One type of text fragment's structure can mimic the core instruction content text fragment of the general prompt word base in step S2. The core instruction content of the specialist prompt word plugin is as follows: #You are a professional data rewriting assistant, and your task is to convert medical record text into patients' spoken language; # Convert the medical terminology of this specialty (the corresponding specialty department name) into plain language according to the following specialist terminology-to-colloquial language constraints; #Constraint a: XXX; Constraint b: XXX; Constraint c: XXX; ...; # Output a virtual patient narration file in standard JSON format.

[0035] S4. Assemble the general prompt word base and the specialist prompt word plugin to generate a large language model prompt word that includes patient roles, general prompt word base, specialist prompt word plugin, and medical record text.

[0036] In this embodiment, the patient role refers to social role types such as infants, children, adolescents, adults, the elderly, and occupations corresponding to specific occupational diseases. When assembling the medical record text, the placeholder positions reserved in the general prompt word base or the specialist prompt word plugin are filled with the medical record text. During assembly, the tasks and constraints in the general prompt word base and the specialist prompt word plugin need to be merged, and the instructions in the specialist prompt word plugin can be inserted into the corresponding positions of the instructions in the general prompt word base.

[0037] In other embodiments, the patient may not participate in the assembly process.

[0038] S5. Input the prompt words from the large language model into the corresponding large language model, and the large language model will convert the medical record text into spoken language, thereby outputting one or more virtual patient oral statements.

[0039] In this embodiment, the large language model can be GPT-4, Wenxin Yiyan, deepseek, Gemini, etc.

[0040] S6. Perform consistency verification on one or more output virtual patient statement files to ultimately form a virtual patient statement file simulating the original patient.

[0041] In this embodiment, the consistency check includes: checking whether the output JSON fields are complete, and post-processing checks on the prompt word template, i.e., whether the output virtual patient narration file conforms to general rules and specialty rules. For example, if a pediatric prompt word template is used, then check whether the subject of the "chief complaint" field in the JSON field has been changed to the third person.

[0042] In this embodiment, the content of the virtual patient dictation profile is text. In other embodiments, the content of the virtual patient dictation profile can be set to be audio and video content output by the large language model. In other embodiments, step S6 can be omitted, and the virtual patient dictation profile can be directly output in step S5.

[0043] Compared to existing technologies, the virtual patient generation method in this embodiment has the following advantages: (1) Reduce development and maintenance costs: Only one general prompt word base and several independent specialty prompt word plugins need to be maintained. When adding a new department for code development, only one lightweight prompt word template needs to be developed. There is no need to write and update the entire set of prompt words from scratch. When the general rules need to be updated, only one place of the general prompt word base needs to be modified to automatically take effect on all specialty departments, and the maintenance efficiency is significantly improved. (2) Improve the quality and realism of virtual patient generation, and significantly improve the accuracy and depth of converting specialist terms into spoken language: By loading specialist prompt word plugins, targeted instructions can be provided to the large language model, enabling it to accurately capture and convert key information unique to the specialty, such as the injury mechanism in orthopedics and the marital and reproductive history in obstetrics and gynecology, avoiding the AI ​​from generating "cross-departmental illusions". The spoken language style of the generated virtual patients is more in line with the real patient profile, such as distinguishing the anxious tone of pediatric family members from the bland tone of elderly patients with chronic diseases. In terms of professionalism, it far exceeds the general solution and has high teaching value. (3) Flexible scalability: When departments are added or medical knowledge is updated, prompt word templates can be easily added or updated without affecting the overall operation.

[0044] The second embodiment of the present invention is described below.

[0045] Please refer to Figure 2 The virtual patient generation system in this embodiment includes a medical record database, a medical record parsing module, a general prompt word module, a specialist prompt word module, an assembly module, a large language model execution module, a verification module, an instruction library, and a rule library.

[0046] The medical record database is connected to the medical record parsing module and the assembly module respectively; the medical record parsing module is connected to the specialty prompting word module; the general prompting word module and the specialty prompting word module are connected to the assembly module respectively; the assembly module is connected to the large language model execution module; the large language model execution module is connected to the validation module; the instruction library is connected to the general prompting word module and the specialty prompting word module respectively; and the rule library is connected to the instruction library.

[0047] The medical record database stores medical record text. The instruction library stores the general prompt word base and specialist prompt word plugins, and modifies the general prompt word base and specialist prompt word plugins according to general rules and specialist rules. The rule library stores and updates general rules and specialist rules.

[0048] The medical record parsing module is used to parse medical record text to obtain multiple fields in the medical record, extract corresponding keywords from multiple fields, and then assemble the keywords into a meta-feature vector.

[0049] In this preferred embodiment, the three fields "specialty department", "age" and "gender" are set as keywords, and the three keywords are assembled into a meta-feature vector V={specialty department, age, gender}.

[0050] The general prompt word module is used to load a preset general prompt word base based on general rules.

[0051] In this embodiment, the general rules include two categories: privacy desensitization constraints and general terminology-to-colloquial constraints. The privacy desensitization constraints and general terminology-to-colloquial constraints are set manually and / or intelligently set using a medical knowledge base. The general prompt word base is stored in the instruction library.

[0052] In this embodiment, the general prompt word base includes dialogue instructions for a large language model. These dialogue instructions are required for all specialized department tasks, and the content of the instructions is a structured text fragment. The core instruction content of one of the general prompt word bases in this embodiment is shown below: #You are a professional data rewriting assistant, and your task is to convert medical record text into patients' spoken language; #Remove private information such as names; #Transform common medical terms into plain language according to the following common terminology-to-colloquial constraints (e.g., retrosternal squeezing pain -> chest feels like a heavy stone is pressing down). #Constraint 1: XXX; Constraint 2: XXX; Constraint 3: XXX; ...; # Output a virtual patient narration file in standard JSON format.

[0053] The specialty suggestion word module is used to load preset specialty suggestion word plugins based on corresponding specialty rules, according to the specialty department keywords in the meta-feature vector.

[0054] In this embodiment, the specialty rules include the constraint condition for converting specialty terms to colloquial language. The constraint condition for converting specialty terms to colloquial language is set manually and / or intelligently set using a medical knowledge base. The specialty prompt word plugin is stored in the instruction library.

[0055] In this embodiment, the specialist prompt word module uses the specialist department keyword in the meta-feature vector V={specialty department, age, gender} to search a preset specialist prompt word plugin mapping table, and then loads a preset specialist prompt word plugin from the instruction library. If the specialist department in the meta-feature vector is blank, or if no corresponding specialist prompt word plugin is found after searching the preset specialist prompt word plugin mapping table, the specialist prompt word plugin for the corresponding internal medicine department is loaded by default.

[0056] In this embodiment, the specialist prompt word plugin includes dialogue instructions for a large language model. These instructions are only required for tasks within the corresponding specialist department. The content of the instructions is a structured text fragment. One type of text fragment structure is shown below. The core instruction content of the specialist prompt word plugin is as follows: #You are a professional data rewriting assistant, and your task is to convert medical record text into patients' spoken language; # Convert the medical terminology of this specialty (the corresponding specialty department name) into plain language according to the following specialist terminology-to-colloquial language constraints; #Constraint a: XXX; Constraint b: XXX; Constraint c: XXX; ...; # Output a virtual patient narration file in standard JSON format.

[0057] The assembly module is used to assemble the general prompt word base and the specialist prompt word plugin to generate a large language model prompt word that includes patient roles, general prompt word base, specialist prompt word plugin, and medical record text.

[0058] In this embodiment, when assembling medical record text, the placeholder positions reserved in the general prompt word base or the specialist prompt word plugin are filled with medical record text; during assembly, the tasks and constraints in the general prompt word base and the specialist prompt word plugin need to be merged, and the instructions in the specialist prompt word plugin can be inserted into the corresponding positions of the instructions in the general prompt word base.

[0059] The large language model execution module is used to input the prompt words of the large language model into the corresponding large language model, and the large language model performs spoken language conversion on the medical record text, thereby outputting one or more virtual patient oral statements.

[0060] In this embodiment, the large language model can be GPT-4, Wenxin Yiyan, deepseek, Gemini, etc.

[0061] The verification module is used to perform consistency verification on one or more output virtual patient statement files, ultimately forming a virtual patient statement file that simulates the original patient.

[0062] In this embodiment, the consistency check includes: checking whether the output JSON fields are complete, and post-processing checks on the prompt word template, i.e., whether the output virtual patient dictation file conforms to general rules and specialty rules.

[0063] In this embodiment, the content of the virtual patient dictation profile is text. In other embodiments, the content of the virtual patient dictation profile can be set to be audio and video content output by the large language model. In other embodiments, the verification module can also be removed, and the virtual patient dictation profile can be directly output by the large language model execution module.

[0064] Compared to existing technologies, the virtual patient generation system of this embodiment has the following advantages: (1) Reduce development and maintenance costs: Only one general prompt word base and several independent specialty prompt word plugins need to be maintained. When adding a new department for code development, only one lightweight prompt word template needs to be developed. There is no need to write and update the entire set of prompt words from scratch. When the general rules need to be updated, only one place of the general prompt word base needs to be modified to automatically take effect on all specialty departments, and the maintenance efficiency is significantly improved. (2) Improve the quality and realism of virtual patient generation, and significantly improve the accuracy and depth of converting specialist terms into spoken language: By loading specialist prompt word plugins, targeted instructions can be provided to the large language model, enabling it to accurately capture and convert key information unique to the specialty, such as the injury mechanism in orthopedics and the marital and reproductive history in obstetrics and gynecology, avoiding the AI ​​from generating "cross-departmental illusions". The spoken language style of the generated virtual patients is more in line with the real patient profile, such as distinguishing the anxious tone of pediatric family members from the bland tone of elderly patients with chronic diseases. In terms of professionalism, it far exceeds the general solution and has high teaching value. (3) Flexible scalability: When departments are added or medical knowledge is updated, prompt word templates can be easily added or updated without affecting the overall operation.

[0065] The third embodiment of the present invention is described below.

[0066] This embodiment provides a virtual patient generation system, specifically a computer program product; the computer program product includes a computer program, which, when executed by a processor, implements the virtual patient generation method in the first embodiment.

[0067] The fourth embodiment of the present invention is described below.

[0068] This embodiment provides a virtual patient generation system, specifically an electronic device, which includes at least one processor and a memory communicatively connected to the at least one processor.

[0069] The memory stores instructions that can be executed by at least one processor to enable the at least one processor to perform the virtual patient generation method in the first embodiment.

[0070] The fifth embodiment of the present invention is described below.

[0071] This embodiment provides a virtual patient generation system, specifically a computer-readable storage medium storing computer instructions. The computer instructions are used to cause a computer device to execute the virtual patient generation method according to the first embodiment.

[0072] The sixth embodiment of the present invention is described below.

[0073] Reference Figure 3 This embodiment provides a virtual patient generation agent for executing the virtual patient generation method in the first embodiment, including: an input module, a processing module, and an output module. The input module receives input information, which is a large language model prompt word from the first embodiment. The processing module determines a target task based on the input information received by the input module, executes the target task to obtain output information, which is the virtual patient oral history file from the first embodiment. The output module outputs the output information obtained by the processing module.

[0074] Compared with existing technologies, the virtual patient generation agent in this embodiment has the advantage of filling the gap in existing technologies that lack specially trained agents for generating virtual patients.

[0075] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input system, and at least one output system, and transferring data and instructions to the storage system, at least one input system, and at least one output system.

[0076] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing system, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0077] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, system, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0078] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display system for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing system (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of systems can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including voice input, speech input, or tactile input).

[0079] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0080] Computer systems can include clients and servers. Clients and servers typically interact via communication networks, but there are also interaction architectures using local data transmission links. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, distributed system servers, or servers incorporating blockchain technology.

[0081] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0082] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for generating a virtual patient, characterized in that, Including the following steps: Parse the medical record text to obtain multiple fields, extract corresponding keywords from the multiple fields, and assemble the keywords into a meta-feature vector; Load a preset general prompt word base based on general rules; the general rules include privacy desensitization constraints and general terminology to colloquial language constraints; Based on the keywords corresponding to the meta-feature vector, a preset specialty prompt word plugin based on specialty rules is loaded; the specialty rules include constraints on the conversion of specialty terminology into spoken language. The general prompt word base and the specialist prompt word plugin are assembled to generate a large language model prompt word that includes the general prompt word base, the specialist prompt word plugin, and the medical record text; Input the prompt words of the large language model into the corresponding large language model, and the large language model will convert the medical record text into spoken language, thereby outputting one or more virtual patient oral accounts simulating the original patient.

2. The virtual patient generation method according to claim 1, characterized in that, When converting medical record text into spoken language using a large language model, one or more virtual patient narration files are first output. Then, the consistency of the output virtual patient narration files is checked, and finally, a virtual patient narration file simulating the original patient is formed.

3. The virtual patient generation method according to claim 1, characterized in that, The keywords corresponding to the meta-feature vector include specialty department, age, and gender.

4. The virtual patient generation method according to claim 3, characterized in that, The step of loading a preset specialty suggestion word plugin based on specialty rules according to the keywords corresponding to the meta-feature vector is as follows: by using the specialty department keywords in the meta-feature vector, the preset specialty suggestion word plugin mapping table is searched, and then the preset specialty suggestion word plugin is loaded from the template library.

5. The virtual patient generation method according to claim 1, characterized in that, When assembling the general prompt word base with the specialized prompt word plugin, a large language model prompt word is assembled from the patient role, the general prompt word base, the specialized prompt word plugin, and the medical record text.

6. A virtual patient generation system, characterized in that, It includes a medical record parsing module, a general prompting word module, a specialist prompting word module, an assembly module, and a large language model execution module; The medical record parsing module is used to parse medical record text to obtain multiple fields, extract corresponding keywords from multiple fields, and assemble the keywords into a meta-feature vector. The general prompt word module is used to load a preset general prompt word base based on general rules; the general rules include privacy desensitization constraints and general terminology to colloquial language constraints; The specialty prompt word module is used to load a preset specialty prompt word plugin based on specialty rules according to the keywords corresponding to the meta-feature vector; Specialty rules include constraints on the conversion of specialty terminology into spoken language; The assembly module is used to assemble the general prompt word base and the specialist prompt word plugin to generate a large language model prompt word that includes the general prompt word base, the specialist prompt word plugin, and the medical record text. The large language model execution module is used to input the large language model prompts into the corresponding large language model, and the large language model performs colloquialization conversion on the medical record text, thereby outputting one or more virtual patient oral accounts simulating the original patient.

7. A virtual patient generation system, characterized in that, The computer program product comprises a computer program that, when executed by a processor, implements the virtual patient generation method according to any one of claims 1-5.

8. A virtual patient generation system, characterized in that, The electronic device includes at least one processor and a memory communicatively connected to the at least one processor; The memory stores instructions executable by at least one processor, which, when executed by at least one processor, enables the at least one processor to perform the virtual patient generation method according to any one of claims 1-5.

9. A virtual patient generation system, characterized in that, The device is a computer-readable storage medium storing computer instructions; the computer instructions are used to cause a computer device to perform the virtual patient generation method according to any one of claims 1-5.

10. A virtual patient generation agent, used to execute the virtual patient generation method according to any one of claims 1-5, characterized in that, include: An input module is configured to receive input information, wherein the input information is a large language model prompt word as described in any one of claims 1-5; The processing module is used to determine a target task based on the input information received by the input module, execute the target task to obtain output information, wherein the output information is the virtual patient oral history file as described in any one of claims 1-5; An output module is used to output the output information obtained by the processing module.