Interactive nosocomial infection risk early warning method and system based on large language model

CN122658703APending Publication Date: 2026-08-28SHAN DONG MSUN HEALTH TECH GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610819915.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-08
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

现有技术方案主要采用硬编码或基于配置表的规则引擎,其核心缺陷在于:临床专家的监测需求以自然语言描述(如“痰培养阳性且发热”),而计算机执行需要结构化查询代码,两者之间存在“语义鸿沟”,导致规则修改必须依赖IT人员编码实现,无法响应临床场景的动态调整需求,也难以保证生成规则在语法上的确定性和可执行性

Benefits of technology

[0014] Compared with existing technologies, this invention provides an interactive hospital infection risk early warning method and system based on a large language model. It acquires hospital infection diagnostic criteria data and constructs a factor function library and a rule expression library. It obtains user-input natural language rule descriptions, inputs these descriptions into the large language model, and performs semantic parsing using the factor function library to generate intermediate rule code. This code is then compiled into executable rule instructions, and finally, patient data is monitored and early warnings are triggered based on these instructions. This invention utilizes the semantic understanding capabilities of the large language model to automatically convert natural language into structured rules. Simultaneously, the pre-built function library and rule expression library ensure the accuracy of the conversion. This allows non-technical personnel (clinicians/infection control personnel) to directly configure and dynamically adjust infection early warning rules using natural language, without the need for IT intervention. This significantly shortens the rule response cycle and improves the efficiency of hospital infection management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122658703A_ABST
    Figure CN122658703A_ABST
Patent Text Reader

Abstract

The application provides an interactive hospital infection risk early warning method and system based on a large language model, relates to the technical field of intelligent medical treatment, and constructs a factor function library and a rule expression library by acquiring hospital infection diagnosis standard data, acquires user natural language rule description, performs semantic analysis by using a large language model in combination with the factor function library, and generates intermediate rule codes based on formal grammar constraint decoding, so that after the intermediate rule codes are compiled into executable rule instructions, real-time monitoring of patient medical data is performed to trigger early warning. The application realizes that non-technical personnel can directly dynamically configure infection early warning rules by using natural language, significantly shortens a rule response cycle, and improves hospital infection management response efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent medical technology, and in particular to an interactive hospital infection risk early warning method and system based on a large language model. Background Technology

[0002] Hospital-acquired infections are a crucial aspect of healthcare quality management. Hospitals typically deploy rule engines to monitor patient data in real time, triggering alerts when patients exhibit specific clinical characteristics (such as elevated body temperature and abnormal white blood cell counts 48 hours after admission). Existing solutions primarily employ hard-coded or configuration-table-based rule engines. Their core flaw lies in the fact that clinical experts describe their monitoring needs in natural language (e.g., "positive sputum culture and fever"), while computer execution requires structured query code. This "semantic gap" necessitates rule modifications relying on IT personnel for coding, failing to respond to dynamic adjustments required by clinical scenarios and struggling to guarantee the syntactic determinism and executability of generated rules. Summary of the Invention

[0003] To address the technical problems mentioned above, this invention provides an interactive hospital infection risk early warning method and system based on a large language model.

[0004] To achieve the above objectives, a first aspect of the present invention provides an interactive hospital infection risk early warning method based on a large language model, comprising: Acquire hospital infection diagnostic criteria data, classify and standardize the infection factors in the diagnostic criteria to obtain a standardized factor set, and construct a factor function library and a rule expression library based on the standardized factor set; Obtain the natural language rule description input by the user; The natural language rule description is input into a pre-trained large language model, and semantic parsing is performed in combination with the factor function library and rule expression library. The decoding process of the large language model is constrained word by word based on the preset formal grammar to generate intermediate rule code that conforms to the preset syntax. The intermediate rule code is compiled into executable rule instructions; The system monitors real-time patient medical data according to the executable rule instructions, and triggers corresponding infection warnings when the rule conditions are met.

[0005] Furthermore, hospital infection diagnostic criteria data are obtained, and the infection factors in the diagnostic criteria are classified and standardized to obtain a standardized factor set. A factor function library and a rule expression library are then constructed based on the standardized factor set, specifically including: The text description in the infection diagnostic criteria is broken down into multiple infection factors, and each infection factor is assigned a unique code, name, diagnostic classification and data source to form the standardized factor set. According to the data source, the factors in the standardized factor set are classified into similar categories, and a factor function with at least one configurable parameter is constructed for each category of factors. The parameter of the factor function includes at least one of duration threshold, numerical threshold, and post-admission time marker. Based on the logical combination relationship between the factor function and the infection factor, rule expressions corresponding to different infection sites are constructed to form the rule expression library.

[0006] Furthermore, the natural language rule description is input into a pre-trained large language model, and semantic parsing is performed using the factor function library and rule expression library. The decoding process of the large language model is then subjected to word-by-word constraints based on a preset formal grammar to generate intermediate rule code that conforms to the preset grammar. Specifically, this includes: The natural language rule description is input into the large language model, and the target infection site and infection factors to be adjusted are extracted from it through the large language model; The infection factors to be adjusted are matched in the factor function library. If the match is successful, the corresponding factor function is obtained. If the match fails, the factor function library is automatically expanded according to the data source of the infection factors and new factor functions are generated. Based on the target infection site, the corresponding rule expression is matched in the rule expression library, and the acquired or newly generated factor function is logically combined with the rule expression to generate a candidate rule expression; During the generation of the candidate rule expression, a finite state automaton is constructed based on a preset context-free grammar. At each decoding step, the set of legal lexical units is calculated according to the current grammar state, and the probabilities of lexical units that do not belong to the set of legal lexical units in the lexical probability distribution output by the large language model are set to zero, so as to force the generation of the grammatically correct intermediate rule code.

[0007] Furthermore, the intermediate rule code is compiled into executable rule instructions, specifically including: calling a rule compiler to convert the intermediate rule code into a query statement or rule engine script recognizable by the target execution platform, thereby obtaining the executable rule instructions.

[0008] Furthermore, the system monitors the real-time collected patient medical data according to the executable rule instructions, and triggers corresponding infection warnings when the rule conditions are met, specifically including: The system acquires patient medical data streams in real time, including at least one of vital sign data, test result data, medical record text data, and examination report data. The medical data stream is input into the rule execution engine, which loads the executable rule instructions and performs condition matching on the medical data stream. When the medical data stream meets the rule conditions defined by the executable rule instruction, an infection warning record containing the triggered infection site, the matched infection factor, and time information is generated and pushed to the user terminal.

[0009] Furthermore, it also includes: After generating the intermediate rule code, a historical medical dataset is obtained, and the intermediate rule code is run backtracking simulation on the historical medical dataset to obtain simulation evaluation results. Output a natural language explanation of the intermediate rule code and a confirmation request for the simulation evaluation results; After receiving the user's confirmation instruction for the confirmation request, the step of compiling the intermediate rule code into executable rule instructions is then executed.

[0010] A second aspect of the present invention provides an interactive hospital infection risk early warning system based on a large language model, comprising: The data standardization module is used to acquire hospital infection diagnostic criteria data, classify and standardize the infection factors in the diagnostic criteria to obtain a set of standardized factors, and construct a factor function library and a rule expression library based on the set of standardized factors. The interaction interface module is used to obtain the natural language rule descriptions input by the user; The semantic parsing and constraint decoding module is used to input the natural language rule description into a pre-trained large language model, perform semantic parsing in combination with the factor function library and rule expression library, and perform word-by-word constraint on the decoding process of the large language model based on a preset formal grammar to generate intermediate rule code that conforms to the preset syntax. The rule compilation module is used to compile the intermediate rule code into executable rule instructions; The infection early warning module is used to monitor the real-time collected patient medical data according to the executable rule instructions, and trigger the corresponding infection early warning when the rule conditions are met.

[0011] A third aspect of the present invention provides an electronic device including a memory, a processor, and a program stored in the memory and running on the processor, wherein the processor executes the program to implement the steps of the interactive hospital infection risk warning method based on a large language model as described in the first aspect of the present invention.

[0012] A fourth aspect of the present invention provides a computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the steps of the interactive hospital infection risk early warning method based on a large language model as described in the first aspect of the present invention.

[0013] A fifth aspect of the present invention provides a computer program product comprising software code, wherein the program in the software code performs the steps of the interactive hospital infection risk early warning method based on a large language model as described in the first aspect of the present invention.

[0014] Compared with existing technologies, this invention provides an interactive hospital infection risk early warning method and system based on a large language model. It acquires hospital infection diagnostic criteria data and constructs a factor function library and a rule expression library. It obtains user-input natural language rule descriptions, inputs these descriptions into the large language model, and performs semantic parsing using the factor function library to generate intermediate rule code. This code is then compiled into executable rule instructions, and finally, patient data is monitored and early warnings are triggered based on these instructions. This invention utilizes the semantic understanding capabilities of the large language model to automatically convert natural language into structured rules. Simultaneously, the pre-built function library and rule expression library ensure the accuracy of the conversion. This allows non-technical personnel (clinicians / infection control personnel) to directly configure and dynamically adjust infection early warning rules using natural language, without the need for IT intervention. This significantly shortens the rule response cycle and improves the efficiency of hospital infection management. Attached Figure Description

[0015] The accompanying drawings, which form part of this disclosure, are used to provide a further understanding of this disclosure. The illustrative embodiments of this disclosure and their descriptions are used to explain this disclosure and do not constitute an undue limitation of this disclosure.

[0016] Figure 1 The flowchart shows the interactive hospital infection risk early warning method based on a large language model provided in Embodiment 1 of the present invention.

[0017] Figure 2 This is a flowchart illustrating the rule confirmation and disassembly steps provided in Embodiment 1 of the present invention.

[0018] Figure 3 This is an architecture diagram of an interactive hospital infection risk early warning system based on a large language model, provided in Embodiment 2 of the present invention. Detailed Implementation

[0019] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0020] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form as well. Furthermore, it should be understood that the terms "comprising," "having," and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0021] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0022] All data acquisition in this embodiment is carried out in accordance with laws and regulations and with user consent, and the data is used legally.

[0023] Example 1 like Figure 1 This embodiment provides an interactive hospital infection risk early warning method based on a large language model, including: S1. Obtain hospital infection diagnostic criteria data, classify and standardize the infection factors in the diagnostic criteria to obtain a standardized factor set, and construct a factor function library and a rule expression library based on the standardized factor set.

[0024] This step is explained in detail below: S1.1 Classification of Factors in Hospital Infection Diagnostic Criteria: A unified source classification is applied to both structured and unstructured factors in the hospital infection diagnostic criteria. The textual descriptions of infection diagnostic criteria are broken down into infection factors, including codes, names, diagnostic classifications, and data sources. For example, the diagnostic description for "upper respiratory tract infection" is: "Clinical diagnosis: Fever (≥38.0℃ for more than 2 days), with acute inflammation of the upper respiratory tract, including the nasopharynx, paranasal sinuses, and tonsils. Etiological diagnosis: Based on the clinical diagnosis, significant pathogenic microorganisms can be found in smears or cultures of secretions." This is broken down into three factors: Code SHXDGR-1: "Fever (≥38.0℃ for more than 2 days)", diagnosis category: "clinical diagnosis", data source: "physical signs"; Code SHXDGR-2: "Shows signs of acute upper respiratory tract inflammation, including nasopharynx, paranasal sinuses and tonsils", diagnosis category: "clinical diagnosis", data source: "medical records"; Code SHXDGR-3: "Significant pathogenic microorganisms can be found in smears or cultures of secretions", diagnostic classification is "etiological diagnosis", data source is "laboratory testing".

[0025] S1.2 Standardized Data: Based on the "Basic Dataset for Infection Surveillance in Medical Institutions," the data source for testing is further subdivided into standardized "specimen type," "culture method," and "positive criterion." For example, the specimen type for SHXDGR-3 is "upper respiratory tract swab, nasal swab, nasopharyngeal swab," the culture method is "smear, culture," and the positive criterion is "detected bacteria." An example of the above subdivision process is shown in Table 1. Table 1. Example of Decomposition of Diagnostic Criteria for Hospital Infections

[0026] S1.3 Constructing Factor Functions and Rule Expressions: Categorize similar factors in the standardized factor set according to their data sources, and construct a factor function with configurable parameters for each category. Specifically: The vital signs related factors function is defined as a "body temperature abnormality judgment function". This function has three parameters: duration (an integer in days), body temperature threshold (a floating-point number with one decimal place), and a Boolean flag indicating whether it occurs 48 hours after admission.

[0027] The relevant factor test function is defined as the "positive result judgment function for etiological test". This function has three parameters: the standard sample name, the duration (an integer in days), and a Boolean flag indicating whether it appears 48 hours after admission.

[0028] Medical record related factors function: defined as "symptom record judgment function", which has three parameters: the symptom text in the medical record, the duration (an integer in days), and a Boolean flag indicating whether it appeared 48 hours after admission.

[0029] The relevant factors function is defined as the "examination report judgment function". This function has three parameters: the name of the examination item, the duration (an integer in days), and a Boolean flag indicating whether it appears 48 hours after admission.

[0030] Based on the above factor functions, a rule expression for the site of infection is constructed. For example, the basic rule expression for upper respiratory tract infection is described as follows: (abnormal body temperature lasting for 2 days and exceeding 38 degrees Celsius and occurring 48 hours after admission, or acute inflammation of the upper respiratory tract such as nasopharynx, paranasal sinuses, and tonsils) and (pathogens are detected in upper respiratory tract swabs, nasal swabs, or nasopharyngeal swabs in etiological testing, and the test occurs 48 hours after admission).

[0031] Through the above steps, a standardized set of factors, a factor function library, and a rule expression library are formed.

[0032] S2. Obtain the natural language rule description input by the user.

[0033] For example, obtain user input such as "alert for upper respiratory tract infection whenever a patient has a fever".

[0034] S3. Input the natural language rule description into the pre-trained large language model, perform semantic parsing by combining the factor function library and the rule expression library, and perform word-by-word constraints on the decoding process of the large language model based on the preset formal grammar to generate intermediate rule code that conforms to the preset syntax.

[0035] S3.1 Rule Confirmation and Decomposition: The user-inputted rule "Always warn of upper respiratory tract infection for patients with fever" is decomposed into a function that needs to be added to the "upper respiratory tract infection" rule after the large language model learns the hospital infection diagnostic criteria and infection diagnostic factor functions. For example... Figure 2 As shown, it specifically includes: (1) Extracting the infection site: The system receives the user input "Always warn of upper respiratory tract infection for patients with fever", and extracts the target infection site as "upper respiratory tract infection".

[0036] (2) Confirm whether the infection site is standard: The system will compare the extracted "upper respiratory tract infection" with 38 preset standard infection sites to confirm whether the site belongs to the standard infection site. If it does not belong to the standard infection site and the similarity is lower than the set threshold (e.g., 0.7), the rule adjustment will stop; if it belongs to the standard infection site or the similarity reaches the threshold, the subsequent steps will continue.

[0037] (3) Identify the logical relationship of user rules: The system identifies the type of logical relationship in the rule description entered by the user. For example, in the rule “Always warn of upper respiratory tract infection for patients with fever”, the user wants to add “fever” as a single affirmative condition to the existing rule, and its logical relationship is “single affirmative”.

[0038] (4) Break down specific infection factors: The system breaks down specific infection factors from the user description. For example, "as long as there is fever" is further broken down into the specific factor "fever for two consecutive days".

[0039] (5) Determine if the function library contains the factor: The system queries the factor function library to determine if the factor function corresponding to "fever for two consecutive days" already exists. If it exists, the corresponding function is directly obtained (e.g., "abnormal body temperature judgment function" and the corresponding parameters are set); if it does not exist, the function library is automatically expanded according to the data source of the infection factor (e.g., physical signs) and the corresponding factor function is added.

[0040] (6) Output user-defined rule expression: After the above steps, the system outputs the user-defined rule expression. For the condition "as long as there is fever", the output expression is described as: "abnormal body temperature lasting for 1 day and body temperature exceeding 38 degrees, regardless of whether it is 48 hours after admission".

[0041] S3.2 Rule Adjustment Confirmation: Based on the user's new upper respiratory tract infection rule (i.e., the "abnormal body temperature judgment function" parameter is 1 day, body temperature 38 degrees Celsius, and not 48 hours after hospitalization), combined with the existing rule expressions, the model assembles the rule expressions and outputs the final adjusted upper respiratory tract infection rule expression. This expression is described as follows: ((Abnormal body temperature lasting for 2 days and exceeding 38 degrees Celsius and occurring 48 hours after admission, or with signs of acute upper respiratory tract inflammation such as nasopharynx, paranasal sinuses and tonsils) and (pathogens are detected in upper respiratory tract swabs, nasal swabs or nasopharyngeal swabs in etiological examination, and the examination occurs 48 hours after admission)) or (abnormal body temperature lasting for 1 day and exceeding 38 degrees Celsius, regardless of whether it occurs 48 hours after admission).

[0042] Then the model is translated into user-understandable language: "Please confirm the upper respiratory tract infection warning rule: patients who have been admitted to the hospital for two consecutive days with fever or have acute inflammation of the upper respiratory tract such as nasopharynx, paranasal sinuses and tonsils, and whose etiological diagnosis shows that bacteria are detected in upper respiratory tract swabs, nasal swabs, and nasopharyngeal swabs, or any patient with fever." S3.3 Rule Generation Based on Syntax Constraint Decoding: During the generation of the candidate rule expressions, a constraint decoding algorithm based on formal grammar is introduced to eliminate syntax errors and "illusion" problems when generating code for large models. Specifically, this includes: (1) Define a library of atomic operators for a domain-specific language (DSL). Each operator corresponds to a validated underlying data query logic. For example, the body temperature detection operator is defined as:

[0043] in For time window parameters (e.g., 48 hours). This is a threshold parameter (e.g., 38.0℃).

[0044] The configuration example for this operator is described in key-value pair format: the function name is "vital signs check", and the parameters include type (body temperature), operator (greater than, less than, equal to), threshold (floating-point number), and duration (hour integer).

[0045] (2) Define the context-free grammar of the DSL, which consists of a set of non-terminal symbols, a set of terminal symbols, a set of production rules, and a start symbol. Among them, non-terminal symbols include expressions, conditions, operators, etc.; terminal symbols include all keywords, function names, and punctuation marks allowed by the DSL, such as "AND", "OR", "abnormal body temperature judgment function", "left parenthesis", "right parenthesis", etc.; production rules define how to generate a valid expression structure from non-terminal symbols.

[0046] (3) When generating the t-th lexical unit, the system maintains a parser state based on grammar G. Define the set of valid lexical units. Let G be the set of all legal subsequent words that conform to grammar G in the current context. ; Where V_vocab is the full vocabulary of the large model. This indicates sequence concatenation.

[0047] Introduce the mask function M(v): ; The final output logits vector of the large model Revised to The corrected probability distribution is: ; Using the above formula, the generation probability of any lexical unit that does not conform to the DSL syntax is forcibly set to 0, thus mathematically guaranteeing that the generated intermediate rule code is 100% syntactically correct and executable. After the above constraint decoding process, intermediate rule code conforming to the preset syntax is generated.

[0048] S4. Compile the intermediate rule code into executable rule instructions.

[0049] The rule compiler is invoked to convert the intermediate rule code into a query statement (such as Structured Query Language SQL) or rule engine script (such as Drools rule language) that can be recognized by the target execution platform, thereby obtaining the executable rule instructions.

[0050] Optionally, a backtracking simulation verification step can be included before S4: after generating intermediate rule code, a historical medical dataset is obtained. Each of them It contains complete time-series diagnostic data. The newly generated intermediate rule code is compiled into a discriminant function. And perform backtracking simulations based on historical data. Calculate the following metrics: (1) Changes in early warning trigger rate:

[0051] (2) Set difference analysis: Calculation and The difference set is used to output a natural language description, such as "The new rule will add 15 new warnings and reduce 3 warnings. The characteristics of the new cases are mainly concentrated in...".

[0052] Output a natural language interpretation containing intermediate rule codes and a confirmation request for simulation evaluation results. After receiving the user's confirmation instruction for the confirmation request, proceed to step S4.

[0053] S5. Monitor the real-time collected patient medical data according to the executable rule instructions, and trigger the corresponding infection warning when the rule conditions are met.

[0054] This step specifically includes: acquiring the patient's medical data stream in real time, the medical data stream including at least one of vital sign data, test result data, medical record text data, and examination report data; inputting the medical data stream into a rule execution engine, the rule execution engine loading the executable rule instructions and performing condition matching on the medical data stream; when the medical data stream meets the rule conditions defined by the executable rule instructions, generating an infection warning record containing the triggered infection site, the matched infection factor, and time information, and pushing it to the user terminal.

[0055] Example 2 like Figure 3 As shown, this embodiment provides an interactive hospital infection risk early warning system based on a large language model, including: The data standardization module is used to acquire hospital infection diagnostic criteria data, classify and standardize the infection factors in the diagnostic criteria to obtain a set of standardized factors, and construct a factor function library and a rule expression library based on the set of standardized factors. The interaction interface module is used to obtain the natural language rule descriptions input by the user; The semantic parsing and constraint decoding module is used to input the natural language rule description into a pre-trained large language model, perform semantic parsing in combination with the factor function library and rule expression library, and perform word-by-word constraint on the decoding process of the large language model based on a preset formal grammar to generate intermediate rule code that conforms to the preset syntax. The rule compilation module is used to compile the intermediate rule code into executable rule instructions; The infection early warning module is used to monitor the real-time collected patient medical data according to the executable rule instructions, and trigger the corresponding infection early warning when the rule conditions are met.

[0056] Example 3 Embodiment 3 of the present invention provides an electronic device.

[0057] An electronic device includes a memory, a processor, and a program stored in the memory and running on the processor. The processor includes, but is not limited to, at least one of a central processing unit (CPU), a graphics processing unit (GPU), a neural network processor (NPU), a tensor processor (TPU), or an artificial intelligence acceleration chip. The program is used to implement the steps in the interactive hospital infection risk warning method based on a large language model as described in Embodiment 1 of the present invention when executing the program.

[0058] The detailed steps are the same as those of the interactive hospital infection risk early warning method based on a large language model provided in Example 1, and will not be repeated here.

[0059] Example 4 Embodiment 4 of the present invention provides a computer-readable storage medium.

[0060] A computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of the interactive hospital infection risk early warning method based on a large language model as described in Embodiment 1 of the present invention.

[0061] The detailed steps are the same as those of the interactive hospital infection risk early warning method based on a large language model provided in Example 1, and will not be repeated here.

[0062] Example 5 Embodiment 5 of the present invention provides a computer program product.

[0063] A computer program product includes software code, wherein the program in the software code performs the steps of the interactive hospital infection risk early warning method based on a large language model as described in Embodiment 1 of the present invention.

[0064] The detailed steps are the same as those of the interactive hospital infection risk early warning method based on a large language model provided in Example 1, and will not be repeated here.

[0065] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention can be implemented using various computer languages. For example, in one implementation, the methods and systems can be developed based on deep learning frameworks (such as TensorFlow, PyTorch, etc.) and using the Python language. Those skilled in the art will understand that other suitable programming languages ​​or tools can also be used for implementation without departing from the core ideas of the present invention.

[0066] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0067] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0068] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0069] The above description is merely a preferred embodiment of this practice and is not intended to limit the scope of this practice. Various modifications and variations can be made to this practice by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this practice should be included within the protection scope of this practice.

Claims

1. An interactive hospital infection risk early warning method based on a large language model, characterized in that, include: Acquire hospital infection diagnostic criteria data, classify and standardize the infection factors in the diagnostic criteria to obtain a standardized factor set, and construct a factor function library and a rule expression library based on the standardized factor set; Obtain the natural language rule description input by the user; The natural language rule description is input into a pre-trained large language model, and semantic parsing is performed in combination with the factor function library and rule expression library. The decoding process of the large language model is constrained word by word based on the preset formal grammar to generate intermediate rule code that conforms to the preset syntax. The intermediate rule code is compiled into executable rule instructions; The system monitors real-time patient medical data according to the executable rule instructions, and triggers corresponding infection warnings when the rule conditions are met.

2. The method according to claim 1, characterized in that, Acquire hospital infection diagnostic criteria data, classify and standardize the infection factors in the diagnostic criteria to obtain a standardized factor set, and construct a factor function library and a rule expression library based on the standardized factor set, specifically including: The text description in the infection diagnostic criteria is broken down into multiple infection factors, and each infection factor is assigned a unique code, name, diagnostic classification and data source to form the standardized factor set. According to the data source, the factors in the standardized factor set are classified into similar categories, and a factor function with at least one configurable parameter is constructed for each category of factors. The parameter of the factor function includes at least one of duration threshold, numerical threshold, and post-admission time marker. Based on the logical combination relationship between the factor function and the infection factor, rule expressions corresponding to different infection sites are constructed to form the rule expression library.

3. The method according to claim 1, characterized in that, The natural language rule description is input into a pre-trained large language model, and semantic parsing is performed using the factor function library and rule expression library. The decoding process of the large language model is then subjected to word-by-word constraints based on a preset formal grammar to generate intermediate rule code that conforms to the preset grammar. Specifically, this includes: The natural language rule description is input into the large language model, and the target infection site and infection factors to be adjusted are extracted from it through the large language model; The infection factors to be adjusted are matched in the factor function library. If the match is successful, the corresponding factor function is obtained. If the match fails, the factor function library is automatically expanded according to the data source of the infection factors and new factor functions are generated. Based on the target infection site, the corresponding rule expression is matched in the rule expression library, and the acquired or newly generated factor function is logically combined with the rule expression to generate a candidate rule expression; During the generation of the candidate rule expression, a finite state automaton is constructed based on a preset context-free grammar. At each decoding step, the set of legal lexical units is calculated according to the current grammar state, and the probabilities of lexical units that do not belong to the set of legal lexical units in the lexical probability distribution output by the large language model are set to zero, so as to force the generation of the grammatically correct intermediate rule code.

4. The method according to claim 1, characterized in that, The intermediate rule code is compiled into executable rule instructions, which specifically includes: calling a rule compiler to convert the intermediate rule code into a query statement or rule engine script that can be recognized by the target execution platform, thereby obtaining the executable rule instructions.

5. The method according to claim 1, characterized in that, The executable rule instructions are used to monitor real-time collected patient medical data, and when the rule conditions are met, a corresponding infection warning is triggered, specifically including: The system acquires patient medical data streams in real time, including at least one of vital sign data, test result data, medical record text data, and examination report data. The medical data stream is input into the rule execution engine, which loads the executable rule instructions and performs condition matching on the medical data stream. When the medical data stream meets the rule conditions defined by the executable rule instruction, an infection warning record containing the triggered infection site, the matched infection factor, and time information is generated and pushed to the user terminal.

6. The method according to claim 1, characterized in that, Also includes: After generating the intermediate rule code, a historical medical dataset is obtained, and the intermediate rule code is run backtracking simulation on the historical medical dataset to obtain simulation evaluation results. Output a natural language explanation of the intermediate rule code and a confirmation request for the simulation evaluation results; After receiving the user's confirmation instruction for the confirmation request, the step of compiling the intermediate rule code into executable rule instructions is then executed.

7. An interactive hospital infection risk early warning system based on a large language model, characterized in that, include: The data standardization module is used to acquire hospital infection diagnostic criteria data, classify and standardize the infection factors in the diagnostic criteria to obtain a set of standardized factors, and construct a factor function library and a rule expression library based on the set of standardized factors. The interaction interface module is used to obtain the natural language rule descriptions input by the user; The semantic parsing and constraint decoding module is used to input the natural language rule description into a pre-trained large language model, perform semantic parsing in combination with the factor function library and rule expression library, and perform word-by-word constraint on the decoding process of the large language model based on a preset formal grammar to generate intermediate rule code that conforms to the preset syntax. The rule compilation module is used to compile the intermediate rule code into executable rule instructions; The infection early warning module is used to monitor the real-time collected patient medical data according to the executable rule instructions, and trigger the corresponding infection early warning when the rule conditions are met.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the program, it implements the steps of the interactive hospital infection risk early warning method based on a large language model as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the interactive hospital infection risk early warning method based on a large language model as described in any one of claims 1 to 6.

10. A computer program product, comprising software code, characterized in that, The program in the software code performs the steps of the interactive hospital infection risk early warning method based on a large language model as described in any one of claims 1 to 6.