A medication safety warning method based on federated learning

By using federated learning to calculate the Q-values ​​of diagnoses and drugs locally in each medical institution and perform hierarchical bias adjustments, a global Q-value model is generated. This solves the problems of low accuracy and vigilance fatigue in existing drug safety monitoring technologies, and achieves privacy protection and improved model accuracy in cross-border data sharing.

CN122201600APending Publication Date: 2026-06-12BEILUN DISTRICT PEOPLES HOSPITAL OF NINGBO CITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEILUN DISTRICT PEOPLES HOSPITAL OF NINGBO CITY
Filing Date
2026-03-05
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing clinical decision support systems suffer from low accuracy in medication safety monitoring, severe vigilance fatigue, difficulties in cross-border data migration, and insufficient data privacy protection.

Method used

Using a federated learning approach, Q-values ​​between diagnoses and medications are calculated locally in each medical institution through unsupervised association rule mining, and hierarchical bias adjustments are performed. The cloud server then fuses the models to generate a global Q-value model, which is embedded into the hospital system in real time for medication safety alerts.

🎯Benefits of technology

It improved the accuracy of medication safety warnings, reduced vigilance fatigue, achieved privacy protection in cross-institutional data sharing, and enhanced the cross-border applicability and accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122201600A_ABST
    Figure CN122201600A_ABST
Patent Text Reader

Abstract

The application discloses a medication safety warning method based on federated learning, and relates to the technical field of federated learning, comprising: obtaining multi-institutional de-identified prescription data and extracting diagnosis and drug items; using an unsupervised association rule mining algorithm locally to calculate Q values for quantifying clinical association strength, and performing stratified bias adjustment according to demographic dimensions to obtain a local stratified Q value model; a cloud server receives each institution model and identifies shared associations, selects the highest Q value in all institutions for each shared association for fusion, and generates a global Q value model; the global model is used to judge real-time prescriptions, and if there is a diagnosis or drug item associated with a drug Q value below a preset threshold, it is determined that there is a medication safety risk and a real-time warning is generated. The federated learning strategy of fusing multi-institutional prescription data and selecting the highest Q value improves the accuracy and cross-institutional applicability of the medication safety warning, and protects data privacy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of federated learning technology, and specifically to a medication safety warning method based on federated learning. Background Technology

[0002] In current clinical practice, medication errors have become one of the core challenges threatening patient safety, and preventable adverse drug events have created a heavy healthcare burden globally. To address this issue, clinical decision support systems (CMS) have been widely researched and applied. These systems are typically embedded in hospital information systems or computerized physician order entry systems, using pre-defined logical rules to monitor prescriptions in real time to detect potential drug interactions or dosage errors. However, existing rule-based CMS systems have significant limitations. Their rule bases are usually statically defined by expert experience or drug instructions, making it difficult to cover complex and ever-changing clinical variations. This results in generally low accuracy in identifying abnormal prescriptions and a high false alarm rate. Frequent invalid alerts can lead to "vigilance fatigue" among physicians, causing many alerts that should be addressed to be ignored, thus weakening the system's clinical practical value. To improve the accuracy and generalization ability of models, researchers have attempted to introduce artificial intelligence technology, using machine learning models to analyze historical prescription data for medication risk prediction. However, the training of such supervised or unsupervised models highly depends on large-scale, diverse data samples. The amount of data from a single medical institution is often limited and significantly heterogeneous due to geographical and population characteristics. Cross-border or cross-institutional model migration therefore faces enormous challenges. For example, there are significant differences in clinical prescribing habits between China and the United States, and the effectiveness of a model trained on data from a single country will be greatly reduced when directly applied to another country. More importantly, medical data is highly sensitive privacy information, subject to strict constraints under laws and regulations such as China's Personal Information Protection Law, the EU's General Data Protection Regulation (GDPR), and the US Health Insurance Portability and Accountability Act. Physically centralizing data scattered across different institutions to train a global model is no longer feasible, and the data silo effect severely hinders the in-depth application and promotion of artificial intelligence models in the medical field. Summary of the Invention

[0003] To further apply and promote artificial intelligence models in the medical field, this invention proposes a medication safety alert method based on federated learning, including the following steps: S1: Obtain de-identified historical prescription data from multiple medical institutions and extract a transaction list containing diagnostic and medication items from the historical prescription data; S2: At each medical institution, an unsupervised association rule mining algorithm is used to mine frequent itemsets from the transaction list and generate association rules. S3: Calculate the Q value based on the association rules to quantify the clinical association strength between diagnosis and drug or between drugs, and perform stratified bias adjustment on the Q value according to the preset demographic dimensions to obtain the local stratified Q value model of the medical institution. S4: In the cloud server, a federated learning mechanism is used to receive hierarchical Q-value models from various medical institutions and identify the shared associations between the models of different medical institutions. S5: For each shared association, select the highest Q value corresponding to that shared association among all medical institutions and fuse them to generate a global Q value model; S6: Obtain real-time prescription data and input the real-time prescription data into the global Q-value model to determine whether there are any diagnostic items or drug items associated with each drug in the real-time prescription whose Q-value is lower than the preset threshold. S7: If it exists, determine that the prescription has a medication safety risk and generate corresponding real-time warning information; if it does not exist, return to step S6.

[0004] This invention significantly improves the accuracy and cross-institutional applicability of medication safety alerts by fusing prescription data from multiple institutions and selecting the federated learning strategy with the highest Q value. While protecting data privacy, it effectively reduces the risk of vigilance fatigue and adverse drug events.

[0005] Furthermore, in step S2, the unsupervised association rule mining algorithm is either the Apriori algorithm or the FP-Growth algorithm, with a minimum support threshold of 0.001 for frequent itemset mining and a minimum confidence threshold of 0.1 for association rule generation.

[0006] Furthermore, in step S3, the formula for calculating the Q value is: In the formula, A and B are the diagnostic or drug items in the transaction list. P(A) and P(B) represent the joint probability of A and B appearing simultaneously in historical prescription data; P(A) and P(B) represent the marginal probabilities of A and B appearing independently in the dataset, respectively; and Q is a statistical measure of the specificity of the association between a diagnosis and a drug, or between drugs.

[0007] Furthermore, in step S3, the preset demographic dimensions include one or more of age, gender, and region. Stratified bias adjustment involves dividing the data into different subsets according to the dimensions and calculating the Q value in each subset.

[0008] Furthermore, in step S4, the federated learning mechanism further includes adding differential privacy noise to the received hierarchical Q-value model on a cloud server, with the noise standard deviation... Privacy budget is 0.1. It is 1.0.

[0009] Furthermore, in step S5, after generating the global Q-value model, the steps further include: distributing the global Q-value model to each medical institution and updating the local hierarchical Q-value model of each medical institution.

[0010] Furthermore, in step S6, the range of the preset threshold value is dynamically adjusted according to the sensitivity or specificity requirements of clinical needs.

[0011] Furthermore, in step S7, generating corresponding real-time alert information further includes: pushing the alert information to the hospital's HIS system or the physician's EPIC CPOE system via RESTful API or FHIR interface, and providing a real-time pop-up reminder when the physician issues a prescription.

[0012] Furthermore, the step S7 is followed by the following step: Collect physician feedback logs on real-time alert information and use these logs as training data for the next iteration to optimize the global Q-value model.

[0013] Compared with the prior art, the present invention has at least the following beneficial effects: (1) The present invention proposes a medication safety warning method based on federated learning, which calculates the Q value between diagnosis and drug by using an unsupervised association rule mining algorithm in each medical institution, and performs hierarchical bias adjustment according to demographic dimensions such as age, gender, and region, effectively eliminating model bias caused by population heterogeneity. (2) By using the federated learning mechanism, the local Q-value models of various institutions are aggregated in the cloud. For each shared association, the highest Q-value among all participating institutions is selected for fusion. Under the premise of ensuring that the original prescription data does not leave the local area and strictly complying with data privacy regulations, the effective integration and knowledge transfer of clinical prescription experience from different countries are realized, which improves the accuracy of the model in judging the appropriateness of prescriptions. (3) The global model is embedded into the hospital’s HIS or EPIC CPOE system in real time through API or FHIR interface. When doctors prescribe medications, they can accurately identify and warn of drugs with medication safety risks, thereby improving the model accuracy, reducing warning coverage, reducing clinical vigilance fatigue, and ultimately reducing the probability of serious adverse drug events. Attached Figure Description

[0014] Figure 1 This is a flowchart illustrating the steps of a medication safety alert method based on federated learning. Detailed Implementation

[0015] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings. To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention provided in the accompanying drawings are described in detail below. The described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0016] This invention provides a medication safety alert method based on federated learning, aiming to address the technical problems of existing clinical decision support systems, such as low accuracy, severe vigilance fatigue, insufficient data privacy protection, and difficulties in cross-border data migration. This method utilizes a series of techniques, including unsupervised association rule mining, hierarchical bias adjustment, federated learning fusion based on the highest Q-value selection, and real-time clinical system embedding, to construct a privacy-compliant, scalable medication safety alert system with clinical translation potential. Figure 1 As shown, the method mainly includes the following steps: S1: Obtain de-identified historical prescription data from multiple medical institutions and extract a transaction list containing diagnostic and medication items from the historical prescription data; S2: At each medical institution, an unsupervised association rule mining algorithm is used to mine frequent itemsets from the transaction list and generate association rules. S3: Calculate the Q value based on the association rules to quantify the clinical association strength between diagnosis and drug or between drugs, and perform stratified bias adjustment on the Q value according to the preset demographic dimensions to obtain the local stratified Q value model of the medical institution. S4: In the cloud server, a federated learning mechanism is used to receive hierarchical Q-value models from various medical institutions and identify the shared associations between the models of different medical institutions. S5: For each shared association, select the highest Q value corresponding to that shared association among all medical institutions and fuse them to generate a global Q value model; S6: Obtain real-time prescription data and input the real-time prescription data into the global Q-value model to determine whether there are any diagnostic items or drug items associated with the Q-value of each drug in the real-time prescription that are lower than the preset threshold. S7: If it exists, determine that the prescription has a medication safety risk and generate corresponding real-time warning information; if it does not exist, return to step S6.

[0017] Overall, the core of this invention lies in constructing a distributed, privacy-preserving closed loop for model training and application. At the data layer, the alert system connects to the hospital information systems or electronic medical record systems of multiple medical institutions to obtain de-identified historical prescription data. This data remains local and is used solely for model training within the hospital. At the model layer, each medical institution uses an unsupervised association rule mining algorithm to calculate a Q-value that quantifies the clinical association strength between diagnosis and drug, and between drugs, based on its own historical data. This Q-value is then adjusted through demographic stratification to obtain a local stratified Q-value model. At the fusion layer, the cloud server employs a federated learning mechanism, receiving model parameters (i.e., stratified Q-value models) uploaded by each medical institution, rather than the raw data. The cloud server identifies shared associations in the models of different institutions (e.g., the same "diagnosis_hypertension-drug_amidipine" combination) and, for each shared association, selects the highest Q-value corresponding to that association across all institutions for fusion, generating a global Q-value model that aggregates the best clinical evidence from multiple centers. At the application layer, this global model is used to evaluate newly issued prescriptions in real time. When doctors prescribe medications through the computerized physician order entry system, the system calculates in real time the correlation between each drug in the prescription and the patient's diagnosis or other medications. If any drug cannot be reasonably explained, a real-time alert is triggered, reminding the doctor of potential medication risks. Furthermore, the doctor's feedback logs can be collected and used for iterative optimization of the model, forming a continuously self-improving closed-loop system.

[0018] Specifically, this method first requires data collection and preprocessing. The system needs to obtain historical prescription data from multiple participating medical institutions. These institutions can be hospitals in different regions and countries. Data sources include, but are not limited to, hospital information systems in China and electronic health record systems in the United States. To ensure data privacy and comply with regulatory requirements, all acquired data must be de-identified. Specifically, before data export and transmission, the system removes all direct identifiers, such as patient names, ID numbers, detailed addresses, and personal information of the prescribing physician, and may use hashing techniques to process indirect identifiers. For the transmission process, this invention preferably uses the AES-256 advanced encryption standard to encrypt the data, ensuring the confidentiality and integrity of the data during transmission.

[0019] After obtaining the raw data, it needs to be transformed into a format that can be processed by the algorithm, and a transaction list containing diagnostic and medication items needs to be extracted from historical prescription data. Here, each prescription record is considered a "transaction," and the "items" in the transaction include diagnostic codes and medication codes. To unify data standards across different countries and hospitals, code mapping and standardization are required. For example, Chinese diagnostic names are mapped to ICD-10 International Classification of Diseases codes, and medication names are mapped to RxNorm or ATC Anatomical Therapeutic Chemistry Classification codes. After preprocessing, a typical transaction list can be represented as: Transaction 1: {"Diagnosis_E11.9" (Type 2 diabetes, without complications), "Medication_Metformin", "Medication_Sitagliptin"}; Transaction 2: {"Diagnosis_I10" (Primary hypertension), "Diagnosis_E78.5" (Hyperlipidemia), "Medication_Amodipine", "Medication_Atorvastatin"}. These structured transaction lists are stored on local servers in each medical institution and do not leave the hospital's internal network.

[0020] After obtaining the list data, an unsupervised association rule mining algorithm can be used to mine frequent itemsets from the transaction list and generate association rules. This invention chooses unsupervised learning because in a real clinical environment, there is no absolute "correct prescription" label to train a supervised model, and the massive historical prescription data itself contains rich, clinically proven medication patterns. This invention preferably uses the Apriori algorithm or the FP-Growth algorithm, both classic algorithms in the field of association rule mining, which can efficiently discover frequently occurring itemset combinations from large datasets.

[0021] Taking the Apriori algorithm as an example, its working principle is as follows: First, the entire transaction list is scanned, the frequency of each individual item (such as a specific diagnosis or drug) is counted, and its support (i.e., the proportion of transactions containing that item to the total number of transactions) is calculated. Items with support greater than a preset minimum support threshold are retained, resulting in frequent 1-itemsets. Then, candidate 2-itemsets are generated based on the frequent 1-itemsets, and their support is calculated again by scanning the database, retaining the frequent 2-itemsets. This process is iterated until no new frequent itemsets can be generated. In a specific embodiment of the present invention, in order to mine statistically significant and clinically valuable patterns while avoiding the generation of a large number of noisy rules due to overly sparse data, the minimum support threshold for frequent itemset mining is set to 0.001. This means that an itemset combination must appear in at least 0.1% of prescriptions to be considered "frequent" and enter the subsequent analysis process.

[0022] After obtaining frequent itemsets, the algorithm generates association rules from them. For example, from the frequent itemset {“Diagnosis_E11.9”, “Drug_Metformin”}, the rule “Diagnosis_E11.9->Drug_Metformin” can be generated. To measure the reliability of the rules, the confidence level of the rules needs to be calculated, which is the probability P(consequent|antecedent) that the consequent (e.g., drug_metformin) also occurs given that the antecedent (e.g., diagnosis_E11.9) has occurred. This invention sets the minimum confidence threshold for generating association rules to 0.1, which means that when a diagnosis occurs, there is at least a 10% probability that the related drug will be prescribed at the same time, and only then will the rule be retained for subsequent Q-value calculation. These two thresholds (min_support=0.001, min_confidence=0.1) are empirical values ​​obtained through extensive experimental verification, which can effectively filter out invalid rules generated by random noise or extremely low probability events while ensuring that enough meaningful patterns are mined.

[0023] Considering that the rules generated by association rule mining only indicate the existence of an "association," but cannot effectively quantify the "strength" or "specificity" of the association—for example, a very common drug (such as acetaminophen) may appear alongside many diagnoses, but this association may be accidental rather than specific—this invention uses lift as an indicator to measure the strength of the association, termed the Q-value. The formula for calculating the Q-value is: , Here, A and B represent items in the transaction list, which can be diagnostic items or drug items. It is the probability that A and B occur at the same time. It is the probability of A occurring. Q represents the probability of A and B occurring. Statistically, the Q-value measures the ratio of the probability of A and B occurring simultaneously to their expected probability under the assumption of statistical independence. If the Q-value is greater than 1, it indicates a positive correlation between A and B, meaning the occurrence of A increases the likelihood of B occurring. Clinically, this usually means that A (such as a diagnosis) is a reasonable reason to prescribe B (such as a drug), or that drugs B1 and B2 have a synergistic effect and are often used together. If the Q-value equals 1, it indicates that A and B are independent. If the Q-value is less than 1, it indicates a negative correlation between A and B, meaning the occurrence of A inhibits the occurrence of B. This may suggest a contraindication to medication or a clinical substitution relationship.

[0024] Simply calculating the global Q-score is insufficient because medical practices and patient populations exhibit significant heterogeneity. For example, the usage patterns of a drug may differ drastically across different age groups; the spectrum of common diseases differs between men and women; and prescribing habits vary significantly between China and the United States due to differences in race, lifestyle, and medical guidelines. Ignoring these differences can lead to systematic biases in the model, resulting in poor performance in certain subgroups and even raising the risk of discrimination. Therefore, this invention proposes a hierarchical bias adjustment mechanism. Specifically, before calculating the Q-score, the system divides the data into different subsets according to preset demographic dimensions. These dimensions include, but are not limited to, age, gender, and region, where: Age stratification: The age group can be divided into 5-year or 10-year segments, such as 0-5 years, 6-10 years, ..., 70 years and above, and the Q value can be calculated independently within each age group; Gender stratification: Divide the data into subsets such as male, female and others (if any), and calculate the Q-value for each subset; Regional stratification: For cross-border applications, data can be divided by country or region, such as China group, United States group; for domestic applications, it can be divided by province or city, such as eastern region, western region, urban and rural areas, etc.

[0025] This hierarchical processing ultimately yields a "hierarchical Q-value model." For example, to associate "diagnosis of hypertension" with "medication amodipine," the model might store multiple entries such as {age group: 40-45 years, gender: male, region: China, Q-value: 3.5} and {age group: 40-45 years, gender: male, region: United States, Q-value: 2.8}. This refined model provides the foundation for subsequent federated fusion and accurate judgment, reducing demographic bias and minimizing performance differences across different subgroups in subsequent statistical analysis.

[0026] At this point, each medical institution has completed the training of its local model and possesses a hierarchical Q-value model that reflects the characteristics of its own clinical practice. These model parameters (essentially a data structure containing correlation terms and their Q-values ​​at different levels) will be used in the next step of federated fusion.

[0027] In practical applications, the cloud server receives local hierarchical Q-value models uploaded by various medical institutions through a federated learning mechanism. Importantly, throughout the entire process, the original prescription data remains within the hospital and never leaves the hospital network, fundamentally meeting the stringent privacy regulations such as China's Personal Information Protection Law, the EU's GDPR, and the US HIPAA. To further enhance privacy protection and prevent malicious attackers from deducing original data information from model parameters, in a preferred embodiment, the cloud server instructs each medical institution to add differential privacy noise to their local model parameters before receiving the model. For example, standard deviation can be added. Privacy budget of 0.1 The noise level is 1.0, which is either Laplace's noise or Gaussian noise. This makes it impossible for attackers to accurately determine whether a specific correlation and its Q value originate from a particular organization, thus providing stronger privacy protection.

[0028] After receiving models from different institutions, the cloud server begins the fusion process. The first step in fusion is identifying "shared associations" between the models from different institutions. Shared associations refer to entries describing the same clinical relationship that appear simultaneously in models from different institutions. For example, both the models of Hospital A in China and Hospital B in the United States may contain an association where the antecedent is "diagnosis_I10" (hypertension) and the consequent is "drug_amidipine." Although their Q values ​​may differ (e.g., Hospital A's Q value is 3.2, while Hospital B's is 2.9), they describe the same clinical concept and are therefore considered a shared association.

[0029] For each identified shared association, the highest Q-value corresponding to that shared association across all participating institutions is selected and fused to generate a global Q-value model. Continuing the example above, for the association between hypertension and amodipine, the Q-value of the global model will be set to... The technical logic behind this "highest value" fusion strategy is that the ultimate goal of medication safety is to protect patient safety. When a clinical association (such as the use of a certain drug) is proven to be highly reasonable and effective in any rigorous medical practice (i.e., a high Q-value), then this "best practice" should be adopted into the global standard to warn those medical behaviors that have not yet followed this best practice. This is fundamentally different from the classic federated average algorithm (which weights the parameters). The federated average aims to obtain an "average" model, while this invention aims to obtain a "best evidence" model. This strategy is particularly suitable for cross-national and cross-institutional scenarios, as it can effectively transfer high-level clinical experience from one region to another, thereby improving the overall accuracy and clinical value of the system's warnings.

[0030] After generating the global Q-value model, in a preferred embodiment, the cloud server distributes the global model to each participating healthcare institution to update their local hierarchical Q-value models. This allows each institution's local model to incorporate "best evidence" from other centers for routine prescription evaluation, enabling bidirectional knowledge flow and continuous optimization.

[0031] When a doctor issues a prescription at any hospital that has deployed this system, the alert system intervenes in real time. First, it acquires the real-time prescription data being entered by the doctor, such as the diagnosis included in the prescription (e.g., "hypertension," "hyperlipidemia") and the medication to be prescribed (e.g., "amodipine," "atorvastatin"). Then, this data is input into the global Q-value model deployed within the hospital (or an updated local hierarchical Q-value model).

[0032] The model's judgment logic is as follows: For each drug in the prescription, the system searches the model for any associations that can reasonably explain the use of that drug. Explanations can come from two aspects: first, a strong association exists between the drug and a patient's diagnosis (diagnosis-drug association, Q value ≥ preset threshold); second, a strong association exists between the drug and another drug in the prescription (drug-drug association, Q value ≥ preset threshold). The system iterates through all drugs in the prescription, checking them one by one.

[0033] The "preset threshold" here is a crucial clinical parameter for tuning. In the basic embodiment of this invention, the threshold can be set to 1.0, meaning that an association is considered meaningful and positive only when the Q value is greater than or equal to 1. However, the threshold can be dynamically adjusted according to clinical needs. If a more sensitive system is desired, to detect no potential risks, the threshold can be lowered to 0.8 or 0.9. Conversely, if less interference is desired and the specificity of alerts is improved, the threshold can be raised to 1.2 or 1.5. This flexibility allows hospitals to personalize the system based on their own vigilance fatigue levels and clinical culture.

[0034] If the model determines that a prescription contains one or more drugs without diagnostic or other drug support (i.e., all possible associated Q values ​​are below a preset threshold), the system classifies the prescription as posing a medication safety risk. Once this risk assessment is triggered, the system immediately generates a corresponding real-time alert. In a preferred embodiment designed for seamless integration into clinical workflows, the generation and delivery of alerts are achieved through a standard medical information interaction interface. Specifically, the alert output module is deeply integrated with the hospital's HIS system (or EHR system, e-medical record system, etc.) or the physician's EPIC CPOE system via a RESTful API or FHIR standard interface. When a doctor issues a prescription and prepares to submit it, the alert appears as a pop-up on the doctor's computer screen. The pop-up window clearly lists "unexplained medications" and may provide supplementary information, such as: "Based on clinical data from our hospital and multiple centers, the association strength between the drug 'amodipine' and the current diagnosis (none) or concomitant medication (none) is low (Q value = 0.6). Please confirm whether there is a risk associated with its use?" This immediate and clear feedback can effectively serve as a reminder and warning without interrupting the doctor's normal work. Through this real-time alert, low-value, high-frequency invalid alerts can be effectively reduced, lowering the alert coverage rate and alleviating alert fatigue.

[0035] Finally, this invention also includes a closed-loop optimization step: collecting feedback logs from physicians regarding real-time alerts. Upon seeing a pop-up alert, physicians can choose to "ignore" and continue prescribing, or they can choose to "accept" and modify the prescription. The system records these feedback behaviors, along with the current prescription and alert information, forming a feedback log. These logs are valuable real-world data, reflecting the discrepancies between model predictions and clinical decisions. In the next iteration, this log data can be used as new training data for retraining and federated fusion, continuously optimizing and updating the global Q-value model. This physician feedback loop enables the system to continuously learn and self-improve, dynamically adapting to changes in clinical practice and maintaining the model's advancement and accuracy.

[0036] In summary, the medication safety warning method proposed in this invention uses an unsupervised association rule mining algorithm to calculate the Q-value between diagnosis and medication in each medical institution, and performs hierarchical bias adjustment according to demographic dimensions such as age, gender, and region, effectively eliminating model bias caused by population heterogeneity.

[0037] By leveraging a federated learning mechanism, local Q-value models from various institutions are aggregated in the cloud. For each shared association, the highest Q-value among all participating institutions is selected for fusion. Under the premise of ensuring that the original prescription data does not leave the local area and strictly complying with data privacy regulations, the effective integration and knowledge transfer of clinical prescription experience from different countries are achieved, thereby improving the accuracy of the model in judging the appropriateness of prescriptions.

[0038] By embedding the global model into the hospital's HIS or EPIC CPOE system in real time through API or FHIR interface, the model can accurately identify and warn of drugs with medication safety risks when doctors prescribe medications, thereby improving model accuracy, reducing warning coverage, reducing clinical vigilance fatigue, and ultimately reducing the probability of serious adverse drug events.

[0039] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.

[0040] Furthermore, in this invention, descriptions involving terms such as "first," "second," and "a" are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0041] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0042] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are feasible for those skilled in the art. If the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

Claims

1. A medication safety alert method based on federated learning, characterized in that, Including the following steps: S1: Obtain de-identified historical prescription data from multiple medical institutions and extract a transaction list containing diagnostic and medication items from the historical prescription data; S2: At each medical institution, an unsupervised association rule mining algorithm is used to mine frequent itemsets from the transaction list and generate association rules. S3: Calculate the Q value based on the association rules to quantify the clinical association strength between diagnosis and drug or between drugs, and perform stratified bias adjustment on the Q value according to the preset demographic dimensions to obtain the local stratified Q value model of the medical institution. S4: In the cloud server, a federated learning mechanism is used to receive hierarchical Q-value models from various medical institutions and identify the shared associations between the models of different medical institutions. S5: For each shared association, select the highest Q value corresponding to that shared association among all medical institutions and fuse them to generate a global Q value model; S6: Obtain real-time prescription data and input the real-time prescription data into the global Q-value model to determine whether there are any diagnostic items or drug items associated with the Q-value of each drug in the real-time prescription that are lower than the preset threshold. S7: If it exists, determine that the prescription has a medication safety risk and generate corresponding real-time warning information; if it does not exist, return to step S6.

2. The medication safety alert method based on federated learning as described in claim 1, characterized in that, In step S2, the unsupervised association rule mining algorithm is either the Apriori algorithm or the FP-Growth algorithm, with a minimum support threshold of 0.001 for frequent itemset mining and a minimum confidence threshold of 0.1 for association rule generation.

3. The medication safety alert method based on federated learning as described in claim 1, characterized in that, In step S3, the formula for calculating the Q value is: In the formula, A and B are the diagnostic or drug items in the transaction list. P(A) and P(B) represent the joint probability of A and B appearing simultaneously in historical prescription data; P(A) and P(B) represent the marginal probabilities of A and B appearing independently in the dataset, respectively; and Q is a statistical measure of the specificity of the association between a diagnosis and a drug, or between drugs.

4. The medication safety alert method based on federated learning as described in claim 1, characterized in that, In step S3, the preset demographic dimensions include one or more of age, gender, and region. Stratified bias adjustment involves dividing the data into different subsets according to the dimensions and calculating the Q value in each subset.

5. The medication safety alert method based on federated learning as described in claim 1, characterized in that, In step S4, the federated learning mechanism further includes adding differential privacy noise to the received hierarchical Q-value model on a cloud server, with the noise standard deviation... Privacy budget is 0.

1. It is 1.

0.

6. The medication safety alert method based on federated learning as described in claim 1, characterized in that, In step S5, after generating the global Q-value model, the steps also include: distributing the global Q-value model to each medical institution and updating the local hierarchical Q-value model of each medical institution.

7. The medication safety alert method based on federated learning as described in claim 1, characterized in that, In step S6, the range of the preset threshold value is dynamically adjusted according to the sensitivity or specificity requirements of clinical needs.

8. The medication safety alert method based on federated learning as described in claim 1, characterized in that, In step S7, generating corresponding real-time alert information further includes: pushing the alert information to the hospital's HIS system or the physician's EPIC CPOE system via a RESTful API or FHIR interface, and providing a real-time pop-up reminder when the physician issues a prescription.

9. A medication safety alert method based on federated learning as described in claim 1, characterized in that, The step S7 is followed by the following step: Collect physician feedback logs on real-time alert information and use these logs as training data for the next iteration to optimize the global Q-value model.