A method, device and equipment for assessing the risk of a drug used during pregnancy, and a storage medium

By using a gestational age-adaptive risk weight matrix and multi-hop reasoning based on heterogeneous knowledge graphs, combined with machine learning and SHAP technology, the problem of inaccurate identification and assessment of implicit risks in medication scenarios with multiple co-existing diseases during pregnancy is solved, achieving individualized and interpretable risk assessment with dynamic updates to the assessment results.

CN122337684APending Publication Date: 2026-07-03WUHAN THIRD HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUHAN THIRD HOSPITAL
Filing Date
2026-03-06
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing medication risk assessment technologies during pregnancy cannot accurately identify the hidden risks caused by the combined use of multiple drugs in scenarios with multiple coexisting diseases. They lack individualization, interpretability, and dynamism, and cannot reflect the latest drug safety information in a timely manner.

Method used

We employ a gestational age-adaptive risk weight matrix and heterogeneous knowledge graph for multi-hop reasoning, combined with machine learning models and SHAP technology, to generate personalized and interpretable risk assessment reports that dynamically integrate the latest evidence.

Benefits of technology

It improves the accuracy and comprehensiveness of medication risk assessment for patients with multiple coexisting diseases during pregnancy, provides reliable risk assessment basis, and enhances clinicians' trust and the interpretability of assessment results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122337684A_ABST
    Figure CN122337684A_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, device, and storage medium for medication risk assessment during pregnancy, relating to the interdisciplinary fields of medical information technology and clinical pharmacy. The method includes: receiving patient information and proposed medication regimen information, whereby the patient information includes gestational age and information on multiple comorbidities; calling the corresponding gestational age adaptive risk weight matrix based on gestational age, weighting the patient features to generate a weighted feature vector, and inputting this vector into a machine learning model to obtain an initial medication risk score; based on a constructed heterogeneous knowledge graph, using entities corresponding to multiple comorbidities and medication regimen information as query starting points, performing multi-hop reasoning to determine the existence and severity of conflicting paths; if a conflicting path is detected, revising the initial medication risk score according to the severity of the conflict to generate a final risk score. This application enables individualized, interpretable, and evidence-based intelligent risk assessment of proposed medication regimens for pregnant women with multiple comorbidities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the interdisciplinary field of medical information technology and clinical pharmacy, specifically to a method, device, equipment, and storage medium for assessing the risk of medication use during pregnancy. Background Technology

[0002] In the field of pregnancy healthcare management, the increasing proportion of patients with multiple coexisting conditions presents increasingly complex challenges to clinical medication safety assessment. Currently, some medication risk assessment tools and methods for specific diseases during pregnancy are available in clinical practice, but these solutions have significant limitations when dealing with complex scenarios involving multiple coexisting conditions and combined drug use.

[0003] In existing technologies, risk assessment systems for single pregnancy complications such as gestational hypertension and diabetes are relatively common. However, these systems only focus on medication safety under specific disease states and cannot handle the complex situations when patients have multiple diseases simultaneously (such as hypertension combined with diabetes, epilepsy, etc.). In such scenarios with multiple coexisting diseases, doctors need to comprehensively weigh multiple factors such as the risk of disease progression, drug interactions, and fetal safety. Single-disease-oriented assessment tools obviously cannot meet this clinical need.

[0004] Furthermore, while some medical institutions use general medical risk assessment frameworks for medication safety assessment during pregnancy, these frameworks have fundamental shortcomings when applied to the specific context of pregnancy. First, these frameworks primarily target disease risk identification for general hospitalized patients (such as infection risk warning), with their core objective being to determine whether a certain disease has occurred. However, the core of medication safety assessment during pregnancy lies in prospectively assessing the safety of the proposed medication regimen for the pregnant woman and fetus, involving entirely different risk dimensions such as drug teratogenicity and adaptation to physiological changes during pregnancy. Second, although existing general frameworks may incorporate knowledge graph technology, this is typically used only to verify the logical validity of pre-defined static rule combinations, lacking the ability to proactively discover unknown or indirect risk pathways. More critically, existing general frameworks generally lack targeted modeling for the specific physiological state of pregnancy, failing to consider the non-linear dynamic changes in baseline physiological parameters and risk factor weights as pregnancy progresses, leading to discrepancies between assessment results and actual clinical situations.

[0005] Existing technologies also have significant shortcomings in terms of the interpretability of assessment methods. While some systems can output risk scores, they do not reveal the specific mechanisms of the core risk assessment model. Clinicians cannot understand the specific sources of the risk scores (such as which comorbidity or drug interaction contributed the main risk), making the assessment results seem like a black box. This greatly reduces doctors' trust in the assessment results and their willingness to adopt them clinically.

[0006] Meanwhile, existing technologies are weak in conflict detection capabilities, lacking a systematic multi-dimensional conflict detection mechanism involving "drug-drug-disease". For example, for patients using the antihypertensive drug nifedipine and the tocolytic drug magnesium sulfate simultaneously, traditional assessment methods may only evaluate the risk of each drug alone, completely ignoring the "hidden risk" of a synergistic antihypertensive effect that may result from their combined use, thus triggering a hypotensive crisis. This insufficient ability to identify multi-hop, indirect risk pathways severely restricts the quality of safety assessment in complex medication scenarios.

[0007] Furthermore, while some systems mention integrating medical literature evidence for assessment, they generally lack mechanisms for accurately linking specific evidence-based medicine with individualized risk assessment results and enabling visual traceability. Physicians cannot intuitively understand which specific medical evidence corresponds to a risk assessment result, nor can they trace it back to the original literature or guidelines. Simultaneously, existing systems typically lack automatic fusion mechanisms for dynamic evidence such as the latest pharmacovigilance signals, resulting in assessment results that fail to reflect the latest drug safety information in a timely manner, posing a risk of assessment lag. Summary of the Invention

[0008] This application provides a method, device, equipment, and storage medium for risk assessment of medication use during pregnancy, which can perform individualized, interpretable, and evidence-based intelligent risk assessment of medication plans for pregnant patients with multiple coexisting diseases.

[0009] In a first aspect, embodiments of this application provide a method for assessing the risk of medication use during pregnancy, the method comprising: Receive patient information and proposed medication regimen information, wherein the patient information includes gestational age and information on multiple comorbidities; Based on the gestational week, the corresponding gestational week adaptive risk weight matrix is ​​invoked, and the features obtained from the conversion of the patient information and medication regimen information are weighted to generate a weighted feature vector. The weighted feature vector is then input into a pre-trained machine learning model to obtain an initial medication risk score. Based on the constructed heterogeneous knowledge graph: drug-disease-physiological parameters, taking the entities corresponding to the information on the multiple comorbidities and the medication regimen as the query starting point, multi-hop reasoning is performed to determine whether there is a drug-disease conflict path or a drug-drug-disease conflict path and the severity of the conflict. If a conflict path is detected, the initial medication risk score is revised according to the severity of the conflict to generate a final risk score.

[0010] In conjunction with the first aspect, in one implementation, the step of calling the corresponding gestational age adaptive risk weight matrix based on gestational age includes: Pregnancy is divided into the first trimester, the second trimester, and the third trimester. The gestational age is determined based on the gestational week, and the preset feature weight matrix for that gestational age is invoked. The feature weight matrix includes at least a teratogenic risk weight and a drug clearance rate change weight that are dynamically adjusted with gestational age.

[0011] In conjunction with the first aspect, in one implementation, the heterogeneous knowledge graph includes multiple types of entity nodes and relational edges defined between entity nodes; The entity types include drug entities, disease entities, physiological parameter entities, and metabolic enzyme entities; The types of the relation edges include at least two of the following: taboo, use with caution, influence, metabolic dependence, synergistic effect, and antagonistic effect.

[0012] In conjunction with the first aspect, in one implementation, the step of using the entities corresponding to the multiple comorbidity information and medication regimen information as the query starting point, performing multi-hop reasoning, and determining whether a drug-disease conflict path or a drug-drug-disease conflict path exists and the severity of the conflict includes: Starting with the entities in the graph corresponding to the multiple comorbidities and medication regimens, a graph traversal algorithm is used to explore paths along the relational edges for at least two hops to identify indirect medication risk conflict paths. For each identified conflict path, a conflict severity score is calculated based on the path length, the weight corresponding to the relationship edge type, and the level of associated evidence.

[0013] In conjunction with the first aspect, in one implementation, after generating the final risk score, an interpretability attribution step is further included, which includes: The SHAP technique is used to analyze the output of the machine learning model, calculate the contribution of each input feature to the final risk score, and identify features whose absolute contribution value is higher than a set threshold as key risk factors. The key risk factors are associated with pre-indexed evidence entries in the evidence-based knowledge base.

[0014] In conjunction with the first aspect, in one implementation, it further includes: After completing the interpretability attribution, a risk assessment report including interpretable information is generated based on the final risk score and the conflict path.

[0015] In conjunction with the first aspect, in one implementation, the method further includes a dynamic evidence fusion step, which includes: Access to external drug safety information databases via pre-defined interfaces; When a drug in the medication regimen information appears in a newly received safety alert message, the risk assessment parameters related to that drug are adjusted.

[0016] Secondly, embodiments of this application provide a pregnancy medication risk assessment device, the pregnancy medication risk assessment device comprising: The input module is used to receive patient information and proposed medication regimen information, including gestational age and information on multiple comorbidities. The assessment module calls the corresponding gestational week adaptive risk weight matrix according to the gestational week, performs weighted processing on the features converted from the patient information and medication regimen information, generates a weighted feature vector, and inputs the weighted feature vector into a pre-trained machine learning model to obtain an initial medication risk score; The reasoning module, based on the constructed heterogeneous knowledge graph: drug-disease-physiological parameters, uses the entities corresponding to the multiple comorbidity information and medication regimen information as the query starting point to perform multi-hop reasoning to determine whether there is a drug-disease conflict path or a drug-drug-disease conflict path and the severity of the conflict. The correction module is used to: if a conflict path is detected, correct the initial medication risk score according to the severity of the conflict, and generate a final risk score.

[0017] Thirdly, embodiments of this application provide a pregnancy medication risk assessment device, which includes a processor, a memory, and a pregnancy medication risk assessment program stored in the memory and executable by the processor. When the pregnancy medication risk assessment program is executed by the processor, it implements the steps of the pregnancy medication risk assessment method described above.

[0018] Fourthly, embodiments of this application provide a computer-readable storage medium storing a pregnancy medication risk assessment program, wherein when the pregnancy medication risk assessment program is executed by a processor, it implements the steps of the pregnancy medication risk assessment method as described above.

[0019] The beneficial effects of the technical solutions provided in this application include: By receiving patient information and proposed medication regimen information, including gestational age and multiple comorbidities, the system retrieves the corresponding gestational age adaptive risk weight matrix. It then weights the features derived from the patient and medication regimen information to generate a weighted feature vector, which is input into a pre-trained machine learning model to obtain an initial medication risk score. Based on a constructed heterogeneous knowledge graph (drug-disease-physiological parameters), and using entities corresponding to multiple comorbidities and medication regimen information as query starting points, multi-hop reasoning is performed to determine the existence and severity of drug-disease or drug-drug-disease conflict paths. If a conflict path is detected, the initial medication risk score is revised based on the severity of the conflict to generate a final risk score.

[0020] Therefore, by applying the gestational age-adaptive risk weight matrix, risk assessment can accurately reflect the impact of physiological changes at different stages of pregnancy on drug risk. Simultaneously, the multi-hop reasoning mechanism based on a heterogeneous knowledge graph of "drug-disease-physiological parameters" can proactively discover hidden risk paths that traditional assessment methods cannot identify, including direct drug-disease conflict paths and more complex drug-drug-disease conflict paths. By dynamically correcting the initial risk score according to the severity of the conflict, this method significantly improves the accuracy and comprehensiveness of risk assessment for complex medication scenarios in pregnant women with multiple coexisting diseases. It effectively solves the medication safety risks caused by neglecting multi-hop indirect conflict paths in existing technologies, providing clinicians with a more reliable basis for risk assessment. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating an embodiment of the method for assessing the risk of medication use during pregnancy as described in this application; Figure 2 This is a schematic diagram of the functional modules of an embodiment of the pregnancy medication risk assessment device of this application; Figure 3 This is a schematic diagram of the hardware structure of the pregnancy medication risk assessment device involved in the embodiments of this application. Detailed Implementation

[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0023] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0024] In one aspect, embodiments of this application provide a method for assessing the risk of medication use during pregnancy.

[0025] In one embodiment, reference is made to Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the method for assessing the risk of medication use during pregnancy in this application. Figure 1 As shown, methods for assessing the risks of medication use during pregnancy include: S1. Receive patient information and proposed medication plan information, wherein the patient information includes gestational age and information on multiple comorbidities; S2. Based on the gestational week, call the corresponding gestational week adaptive risk weight matrix, perform weighted processing on the features obtained from the conversion of the patient information and medication regimen information, generate a weighted feature vector, and input the weighted feature vector into a pre-trained machine learning model to obtain an initial medication risk score; In step S1, patient information mainly involves entering the patient's age, gestational age, weight, and liver and kidney function indicators, and selecting comorbidities (such as chronic hypertension, gestational diabetes, asthma, etc.) from a preset list. Then, based on the medication regimen, the drugs to be used are added (common drugs can be quickly selected or customized).

[0026] This embodiment receives multidimensional feature data from the patient and automatically calls different basic risk weight matrices based on the current gestational week (divided into early, mid, and late pregnancy). These risk weight matrices are not fixed values, but rather model parameters obtained through training with historical data, reflecting the differences in the impact of physiological changes at different gestational weeks on drug risk. This solves the problem that general risk assessment models cannot capture dynamic risk changes during pregnancy.

[0027] Specifically, based on a retrospective pregnancy medication dataset, the samples were divided into three groups according to gestational week: early pregnancy (1-12 weeks), mid-pregnancy (13-27 weeks), and late pregnancy (28-42 weeks). Feature weight coefficients were trained or adjusted for each group separately. For example, the teratogenic risk weight was set to 1.5 in early pregnancy (the sensitive period for organogenesis), adjusted to 0.8 in mid-pregnancy, and adjusted to 0.6 in late pregnancy; the weight for changes in drug clearance rate increased with gestational week (0.8 in early pregnancy, 1.0 in mid-pregnancy, and 1.2 in late pregnancy) to reflect the physiological characteristic of a approximately 50% increase in glomerular filtration rate (GFR) during pregnancy. Understandably, by training or adjusting model parameters on training data from different gestational weeks, the model can internalize the differences in drug toxicity sensitivity at different pregnancy stages (such as the organogenesis period and the rapid fetal growth period), solving the problem that traditional static weights or single models cannot accurately reflect dynamic risk changes during pregnancy.

[0028] Subsequently, the entered structured data (patient information and medication regimen information) is converted into feature vectors. Based on the current gestational week (e.g., 24 weeks of gestation is the second trimester), risk weight coefficients corresponding to the second trimester are automatically loaded. The feature vectors are then input into the pre-trained XGBoost risk assessment model to obtain an initial medication risk score.

[0029] Specifically, this embodiment uses patient characteristics and proposed drug information, after gestational age adaptive processing, as input. A pre-trained XGBoost model is used for comprehensive risk assessment, outputting an initial risk score. This model can capture the nonlinear relationships and complex interactions between high-dimensional features. The input features of the XGBoost model include multiple feature dimensions, specifically: patient baseline characteristics (age, gestational age, weight, BMI), liver function indicators (ALT, AST, total bilirubin), kidney function indicators (eGFR, serum creatinine, blood urea nitrogen), comorbidity encoding vector, proposed drug encoding vector, number of drugs, high-risk drug markers, and previous adverse pregnancy outcomes. The model output is a risk probability value between 0 and 1, and is divided into four risk levels: low, medium, high, and contraindicated, based on thresholds (0.3 / 0.6 / 0.8).

[0030] S3. Based on the constructed heterogeneous knowledge graph: drug-disease-physiological parameters, using the entities corresponding to the information on the multiple comorbidities and the medication regimen as the query starting point, perform multi-hop reasoning to determine whether there is a drug-disease conflict path or a drug-drug-disease conflict path and the severity of the conflict. S4. If a conflict path is detected, the initial medication risk score is corrected according to the severity of the conflict to generate a final risk score.

[0031] In step S3, the constructed heterogeneous knowledge graph of "drug-disease-physiological parameter" will be called from the evidence-based knowledge base module. The construction method of the knowledge graph is as follows: (1) Entity extraction: Extract drug entities, disease entities, physiological parameter entities, metabolic enzyme entities, etc. from drug instructions, clinical guidelines (such as ACOG, SMFM), authoritative databases (such as LactMed, Reprotox, MotherToBaby, ACOG (American College of Obstetricians and Gynecologists) guidelines, SMFM (Society for Maternal-Fetal Medicine) guidelines, FDA Pregnancy and Lactation Label Database (PLLR), China Drug Instruction Manual Database); (2) Relationship definition: Define relationship types including contraindications, use with caution, influence, metabolic dependence, synergistic effect, antagonistic effect, etc.

[0032] For patients with multiple comorbidities and multiple drug regimens, an inference algorithm is executed on the graph to actively explore whether there are direct drug-disease contraindications or indirect, multi-hop conflict paths.

[0033] Unlike existing static graph queries that only verify predefined rule combinations, the inference algorithm of this application has the following features: (1) Dynamic generation of inference starting point: The actual comorbidities and medication list of the current patient are used as the query starting point, rather than a preset rule template; (2) Open exploration of inference path: Breadth-first or depth-first traversal is performed along multiple relation types in the knowledge graph, and the exploration depth can reach more than 3 hops; (3) Risk quantification of inference result: For each conflict path found, the conflict severity score is calculated according to the path length, relation strength, and evidence level, which is used to correct the final risk value. (For example: Drug A inhibits metabolic enzyme E → Drug B increases blood drug concentration due to slowed metabolism → The side effects of drug B aggravate disease C). If a conflict is detected, the initial risk score is corrected according to the conflict type and severity, and a specific conflict warning is generated. This step goes beyond the existing knowledge graph applications that are only used for rule verification, and realizes the proactive discovery of implicit risks.

[0034] It's important to clarify that for the heterogeneous knowledge graph of "drug-disease-physiological parameters," "drug" refers to various therapeutic drugs that pregnant women may use, especially commonly used and high-risk drugs during pregnancy. Drugs, as node entities in the knowledge graph, establish relationships with diseases and physiological parameters. "Disease" refers to various diseases or complications that pregnant women may suffer from, including pregnancy-specific diseases and other potentially coexisting chronic diseases. Diseases, as node entities in the knowledge graph, establish relationships with drugs and physiological parameters. Physiological parameters refer to various quantifiable indicators reflecting the current physiological state of a pregnant woman, including routine physiological indicators, organ function indicators, and drug metabolism-related parameters. These serve as an intermediary bridge connecting drugs and diseases, forming an indirect relationship chain of "drug-physiological parameters-disease." Only by constructing this complex network of relationships among these three elements can multi-hop reasoning be achieved, uncovering hidden risk paths that traditional methods cannot identify.

[0035] Furthermore, drug-disease conflict pathways refer to direct or indirect causal chains connecting a specific drug to a specific disease, indicating that the drug may have adverse effects or be contraindicated for patients with that disease. These pathways can be single-hop direct relationships or multi-hop indirect relationships. Drug-disease conflict pathways refer to complex causal chains in which two or more drugs interact to jointly affect a disease state. These pathways focus particularly on how drug interactions indirectly affect disease progression and are key in medication risk assessment for patients with multiple coexisting diseases.

[0036] In step S4, if no conflict is found in step 3, the initial score of XGBoost is used. If a conflict is found, the initial score is adjusted upwards according to the severity of the conflict (e.g., absolutely forbidden, relatively cautious).

[0037] Subsequently, the SHAP (SHapley Additive exPlanations) interpreter is invoked to calculate the SHAP value for each input feature for the final risk score. Features with high absolute SHAP values ​​(such as "sodium valproate," "multiple drug combinations," and "early pregnancy") are identified as key risk factors. SHAP technology, based on game theory, fairly allocates the contribution of each feature to the model's predicted output. This contribution is then linked to indexed evidence entries in the knowledge base, transforming the model from a black-box model output to a white-box representation of the contribution magnitude and medical basis of each risk factor. This addresses the core bottleneck of AI medical models being difficult to trust and adopt clinically due to their lack of interpretability.

[0038] Specifically, this embodiment utilizes SHAP technology to interpret the risk prediction results of the XGBoost model. The contribution (SHAP value) of each input feature (such as a specific drug, specific comorbidity, liver and kidney function status, etc.) to the final risk score is calculated. Simultaneously, features with high contributions are associated with specific evidence entries in the evidence-based knowledge base (such as literature PMIDs and guideline sections), achieving a one-to-one mapping between "risk points and evidence sources." This association mapping is achieved as follows: each evidence entry in the evidence-based knowledge base is pre-indexed with relevant metadata such as drug ID, disease ID, and risk type. When SHAP analysis identifies a feature as a high-contribution factor, the system uses the entity I corresponding to that feature as the search key to query all associated evidence entries in the knowledge base, sorts them by evidence level (Ia / Ib / IIa / IIb / III / IV), and returns the Top-N as the source tracing basis.

[0039] Preferably, the system can also periodically or in real-time access external pharmacovigilance databases or the latest clinical research abstracts via an interface. When a new high-risk warning appears for a drug under evaluation, the system can automatically adjust the risk coefficient of the relevant drug and prominently display a notification in the evaluation report. Different levels of alerts are dynamically triggered by combining risk scores with linkage factors (such as risk score trends and conflict severity). By establishing standardized interfaces with authoritative external databases, the system can automatically capture and structurally integrate newly published studies and safety warnings from drug regulatory agencies, ensuring that the system's knowledge base and risk assessment logic are up-to-date and solving the problem of traditional systems lagging behind in updates and failing to reflect the latest medical understanding.

[0040] Finally, the generated report integrates all the above results: displaying the final risk level (low / medium / high / contraindicated); visualizing key risk contributing factors and their SHAP values ​​in the form of a waterfall chart or force-directed graph; listing in detail the specific drug-disease or drug-drug conflict detected and their explanations; and providing a summary of specific evidence (source literature, level of evidence) with direct links to the evidence-based knowledge base for each key risk point (such as "teratogenic risk of sodium valproate"). In addition, it checks whether the assessed drug is on the recent pharmacovigilance list, and if so, adds a special reminder.

[0041] The following two specific examples will further illustrate the steps described above: Example 1: Patient: 32 years old, 24 weeks pregnant, diagnosed with gestational hypertension and mild renal insufficiency (eGFR 72 mL / min), currently receiving magnesium sulfate for pregnancy maintenance treatment.

[0042] The doctor prescribed: Nifedipine sustained-release tablets.

[0043] The system evaluation process for this application is as follows: 1. Enter patient information and medication plan.

[0044] 2. The XGBoost model provides a baseline risk score based on patient characteristics (24 weeks of pregnancy, renal insufficiency, etc.) and the drug "nifedipine".

[0045] 3. Conflict Graph Reasoning Initiation: The knowledge graph contains the following relationships: "Nifedipine" → "Pharmacological effect: vasodilation"; "Magnesium sulfate" → "Pharmacological effect: vasodilation"; "Vasodilation" → "May lead to" → "Hypotension"; "Hypotension" → "High risk" → "Patients with renal insufficiency". The system identifies the combined use of "nifedipine + magnesium sulfate" and, through the path of "synergistic vasodilation", ultimately links it to the conflict chain of "increased risk in patients with renal insufficiency". This conflict path spans three related nodes and cannot be identified by simple pairwise rule matching. The system calculates the conflict severity using the path weight formula: Conflict severity = Sum (edge ​​weight × relationship strength coefficient). In this example, the calculated conflict severity score is 0.72 (out of 1.0), corresponding to a moderate risk level, triggering an upward adjustment of the risk score: Final risk score = Initial score × (1 + 0.3 × Conflict severity) = 0.65 × 1.216, approximately equal to 0.79.

[0046] 4. The system marked this conflict as "moderate risk" and increased the overall risk score. SHAP analysis showed that "drug interaction (nifedipine-magnesium sulfate)" and "renal insufficiency" were the main contributing factors to this risk score.

[0047] 5. Report Output: Generates a "Medium Risk" report, explicitly stating that "nifedipine and magnesium sulfate have a synergistic antihypertensive effect, which may lead to hypotension and placental insufficiency risks in patients with renal insufficiency." A SHAP graph clearly illustrates the two risk contributing factors. The report links to supporting literature evidence (such as relevant drug interaction studies and medication guidelines for patients with renal insufficiency). Simultaneously, based on a knowledge graph, the system proactively recommends the safer alternative drug "labetrol" and provides links to its safety evidence.

[0048] As can be seen from this embodiment, this application not only identifies the risks of single-drug therapy, but more importantly, it discovers the easily overlooked synergistic risks caused by multi-drug combination therapy (nifedipine + magnesium sulfate) in a specific patient context (with renal insufficiency), and presents them in an interpretable manner, directly guiding the optimization of clinical medication regimens.

[0049] Example 2: The patient is 28 years old, 12 weeks pregnant, with a history of epilepsy, and has been taking sodium valproate, carbamazepine, and lamotrigine (a combination of drugs) for a long time.

[0050] Limitations of existing technology: Existing systems may evaluate each antiepileptic drug separately and simply add up the risks, or only give a vague warning of "high risk of multiple drugs in combination", without being able to quantify or explain the specific mechanisms, let alone guide how to optimize.

[0051] This application proposal: 1. The XGBoost model outputs a high-risk baseline score based on high-risk characteristics such as "early pregnancy", "multiple drug use", and "sodium valproate".

[0052] 2. The graph reasoning engine activates nodes such as "sodium valproate", "carbamazepine", "lamotrigine", and "epilepsy". After risk propagation calculation, multiple high-weight paths are identified, such as: "sodium valproate" - (high teratogenicity) -> "fetal neural tube defects"; "sodium valproate + carbamazepine" - (enzyme-induced interaction) -> "lamotrigine blood concentration instability"; "multi-drug combination" - (known clinical evidence) -> "synergistic increase in teratogenicity".

[0053] 3. The system has determined the risk to be "extremely high". The report visually displays the above path.

[0054] 4. Key Innovations: The system not only provides alerts but also offers precise optimization directions based on graph analysis. The graph shows relatively good evidence for the safety of lamotrigine monotherapy during pregnancy, with fewer risk pathways formed with other nodes. Therefore, the system can explicitly state in its recommendations: "Prioritize switching to lamotrigine monotherapy, and provide pregnancy safety data and blood drug concentration monitoring protocols for lamotrigine monotherapy for epilepsy based on graph links." Simultaneously, the linked evidence shows that high-dose folic acid supplementation in early pregnancy can partially mitigate the risk of neural tube defects, and the system also provides corresponding supplementary recommendations.

[0055] 5. Results: This example demonstrates how this application transforms existing solutions that merely issue "high-risk" alerts into a comprehensive clinical decision support solution that includes specific attributions (why the risk is high), precise targets (the location of the risk concentration point), in-depth conflict analysis, optimization strategies (how to make targeted adjustments), and a complete set of evidence (the basis for each step of the recommendation). This effectively addresses the shortcomings of existing technologies where general frameworks are directly applied to pregnancy medication scenarios, namely "domain mismatch" and "lack of deep reasoning ability." In contrast, existing knowledge graphs are only used to verify predefined rules and cannot reveal which specific drug combination generates the risk, through what mechanism, or provide a precise optimization direction like prioritizing lamotrigine. This application, through multi-hop reasoning, not only identifies risks but also pinpoints the specific transmission path of those risks, thereby supporting precise intervention decisions.

[0056] Therefore, the pregnancy medication risk assessment method in this application, through a dual mechanism of gestational age-weighted adaptive assessment and multi-disease conflict mapping reasoning, can not only assess the risk of single drugs, but also discover and quantify complex, indirect risk chains resulting from the coupling of multiple drugs and specific physiological states (such as renal insufficiency), providing an assessment depth far exceeding traditional pairwise contraindication review. Through the dual mechanisms of SHAP value attribution and evidence-based tracing, it not only provides risk levels but also clearly displays the key factors leading to high risk and their sources of medical evidence, greatly enhancing clinicians' acceptance and trust in AI-assisted decision-making. Through gestational age-weighted adaptive assessment and dynamic evidence fusion, the risk assessment can adapt to the physiological changes at different stages of pregnancy and respond promptly to the latest drug safety information, achieving more precise dynamic risk management. The final structured report includes risk grading, attribution analysis, conflict warnings, evidence links, and alternative recommendations, which can directly support clinical pharmacy consultations and doctor-patient communication, forming a closed loop of intelligent decision support.

[0057] Secondly, embodiments of this application also provide a device for assessing the risk of medication use during pregnancy.

[0058] In one embodiment, reference is made to Figure 2 , Figure 2 This is a schematic diagram of the functional modules of an embodiment of the pregnancy medication risk assessment device of this application. Figure 2As shown, the pregnancy medication risk assessment device includes: The input module is used to receive patient information and proposed medication regimen information, including gestational age and information on multiple comorbidities. The assessment module calls the corresponding gestational week adaptive risk weight matrix according to the gestational week, performs weighted processing on the features converted from the patient information and medication regimen information, generates a weighted feature vector, and inputs the weighted feature vector into a pre-trained machine learning model to obtain an initial medication risk score; The reasoning module, based on the constructed heterogeneous knowledge graph: drug-disease-physiological parameters, uses the entities corresponding to the multiple comorbidity information and medication regimen information as the query starting point to perform multi-hop reasoning to determine whether there is a drug-disease conflict path or a drug-drug-disease conflict path and the severity of the conflict. The correction module is used to: if a conflict path is detected, correct the initial medication risk score according to the severity of the conflict, and generate a final risk score.

[0059] Further, in one embodiment, the assessment module invokes the corresponding gestational age adaptive risk weight matrix based on gestational age, including: Pregnancy is divided into the first trimester, the second trimester, and the third trimester. The gestational age is determined based on the gestational week, and the preset feature weight matrix for that gestational age is invoked. The feature weight matrix includes at least a teratogenic risk weight and a drug clearance rate change weight that are dynamically adjusted with gestational age.

[0060] Furthermore, in one embodiment, the heterogeneous knowledge graph includes multiple types of entity nodes and relational edges defined between entity nodes; The entity types include drug entities, disease entities, physiological parameter entities, and metabolic enzyme entities; The types of the relation edges include at least two of the following: taboo, use with caution, influence, metabolic dependence, synergistic effect, and antagonistic effect.

[0061] Further, in one embodiment, the reasoning module uses the entities corresponding to the multiple comorbidity information and medication regimen information as the query starting point, performs multi-hop reasoning, and determines whether there is a drug-disease conflict path or a drug-drug-disease conflict path and the severity of the conflict, including: Starting with the entities in the graph corresponding to the multiple comorbidities and medication regimens, a graph traversal algorithm is used to explore paths along the relational edges for at least two hops to identify indirect medication risk conflict paths. For each identified conflict path, a conflict severity score is calculated based on the path length, the weight corresponding to the relationship edge type, and the level of associated evidence.

[0062] Furthermore, in one embodiment, the system further includes an evidence-based knowledge base module, which is used to perform interpretability attribution after the final risk score is generated. This module includes: The SHAP technique is used to analyze the output of the machine learning model, calculate the contribution of each input feature to the final risk score, and identify features whose absolute contribution value is higher than a set threshold as key risk factors. The key risk factors are associated with pre-indexed evidence entries in the evidence-based knowledge base.

[0063] Preferably, in a specific embodiment, the set threshold can be dynamically determined based on the mean or median of the absolute values ​​of all feature SHAP values, for example, set to 1.5 times the mean of the absolute values ​​of all feature SHAP values, or set to a fixed value of 0.05.

[0064] Furthermore, in one embodiment, a report generation module is also included, the report generation module being used for: After completing the interpretability attribution, a risk assessment report including interpretable information is generated based on the final risk score and the conflict path.

[0065] Furthermore, in one embodiment, a fusion module is also included, the fusion module being used for: Access to external drug safety information databases via pre-defined interfaces; When a drug in the medication regimen information appears in a newly received safety alert message, the risk assessment parameters related to that drug are adjusted.

[0066] The functions of each module in the above-mentioned pregnancy medication risk assessment device correspond to the steps in the above-mentioned pregnancy medication risk assessment method embodiment, and their functions and implementation processes will not be described in detail here.

[0067] Thirdly, embodiments of this application provide a pregnancy medication risk assessment device, which can be a personal computer (PC), laptop computer, server, or other device with data processing capabilities.

[0068] Reference Figure 3 , Figure 3 This is a schematic diagram of the hardware structure of the pregnancy medication risk assessment device involved in the embodiments of this application. In the embodiments of this application, the pregnancy medication risk assessment device may include a processor, a memory, a communication interface, and a communication bus.

[0069] The communication bus can be of any type and is used to interconnect the processor, memory, and communication interface.

[0070] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces used for interconnecting internal components of the pregnancy medication risk assessment device, as well as interfaces used for interconnecting the pregnancy medication risk assessment device with other devices (such as other computing devices or user devices). Physical interfaces can be Ethernet interfaces, fiber optic interfaces, ATM interfaces, etc.; user devices can be displays, keyboards, etc.

[0071] Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0072] The processor can be a general-purpose processor, which can call the pregnancy medication risk assessment program stored in the memory and execute the pregnancy medication risk assessment method provided in the embodiments of this application. For example, the general-purpose processor can be a central processing unit (CPU). The method executed when the pregnancy medication risk assessment program is called can refer to the various embodiments of the pregnancy medication risk assessment method of this application, and will not be repeated here.

[0073] Those skilled in the art will understand that Figure 3 The hardware structure shown does not constitute a limitation of this application and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0074] Fourthly, embodiments of this application also provide a computer-readable storage medium.

[0075] The present application has a computer-readable storage medium storing a pregnancy medication risk assessment program, wherein when the pregnancy medication risk assessment program is executed by a processor, it implements the steps of the pregnancy medication risk assessment method as described above.

[0076] The method used when performing the pregnancy medication risk assessment procedure can be referred to in the various embodiments of the pregnancy medication risk assessment method of this application, and will not be repeated here.

[0077] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0078] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.

[0079] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.

[0080] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.

[0081] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.

[0082] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.

[0083] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for assessing the risk of medication use during pregnancy, characterized in that, The methods for assessing the risk of medication use during pregnancy include: Receive patient information and proposed medication regimen information, wherein the patient information includes gestational age and information on multiple comorbidities; Based on the gestational week, the corresponding gestational week adaptive risk weight matrix is ​​invoked, and the features obtained from the conversion of the patient information and medication regimen information are weighted to generate a weighted feature vector. The weighted feature vector is then input into a pre-trained machine learning model to obtain an initial medication risk score. Based on the constructed heterogeneous knowledge graph: drug-disease-physiological parameters, taking the entities corresponding to the information on the multiple comorbidities and the medication regimen as the query starting point, multi-hop reasoning is performed to determine whether there is a drug-disease conflict path or a drug-drug-disease conflict path and the severity of the conflict. If a conflict path is detected, the initial medication risk score is revised according to the severity of the conflict to generate a final risk score.

2. The method for assessing the risk of medication use during pregnancy as described in claim 1, characterized in that, The step of calling the corresponding gestational age adaptive risk weight matrix based on gestational age includes: Pregnancy is divided into the first trimester, the second trimester, and the third trimester. The gestational age is determined based on the gestational week, and the preset feature weight matrix for that gestational age is invoked. The feature weight matrix includes at least a teratogenic risk weight and a drug clearance rate change weight that are dynamically adjusted with gestational age.

3. The method for assessing the risk of medication use during pregnancy as described in claim 1, characterized in that: The heterogeneous knowledge graph includes various types of entity nodes and relation edges defined between entity nodes; The entity types include drug entities, disease entities, physiological parameter entities, and metabolic enzyme entities; The types of the relation edges include at least two of the following: taboo, use with caution, influence, metabolic dependence, synergistic effect, and antagonistic effect.

4. The method for assessing the risk of medication use during pregnancy as described in claim 3, characterized in that, The process of using the entities corresponding to the multiple comorbidity information and medication regimen information as the starting point for querying, performing multi-hop reasoning, and determining whether a drug-disease conflict path or a drug-drug-disease conflict path exists and the severity of the conflict includes: Starting with the entities in the graph corresponding to the multiple comorbidities and medication regimens, a graph traversal algorithm is used to explore paths along the relational edges for at least two hops to identify indirect medication risk conflict paths. For each identified conflict path, a conflict severity score is calculated based on the path length, the weight corresponding to the relationship edge type, and the level of associated evidence.

5. The method for assessing the risk of medication use during pregnancy as described in claim 1, characterized in that, After generating the final risk score, an interpretability attribution step is also included, which includes: The SHAP technique is used to analyze the output of the machine learning model, calculate the contribution of each input feature to the final risk score, and identify features whose absolute contribution value is higher than a set threshold as key risk factors. The key risk factors are associated with pre-indexed evidence entries in the evidence-based knowledge base.

6. The method for assessing the risk of medication use during pregnancy as described in claim 5, characterized in that, Also includes: After completing the interpretability attribution, a risk assessment report including interpretable information is generated based on the final risk score and the conflict path.

7. The method for assessing the risk of medication use during pregnancy as described in claim 1, characterized in that, The method further includes a dynamic evidence fusion step, which includes: Access to external drug safety information databases via pre-defined interfaces; When a drug in the medication regimen information appears in a newly received safety alert message, the risk assessment parameters related to that drug are adjusted.

8. A device for assessing the risk of medication use during pregnancy, characterized in that, The pregnancy medication risk assessment device includes: The input module is used to receive patient information and proposed medication regimen information, including gestational age and information on multiple comorbidities. The assessment module calls the corresponding gestational week adaptive risk weight matrix according to the gestational week, performs weighted processing on the features converted from the patient information and medication regimen information, generates a weighted feature vector, and inputs the weighted feature vector into a pre-trained machine learning model to obtain an initial medication risk score; The reasoning module, based on the constructed heterogeneous knowledge graph: drug-disease-physiological parameters, uses the entities corresponding to the multiple comorbidity information and medication regimen information as the query starting point to perform multi-hop reasoning to determine whether there is a drug-disease conflict path or a drug-drug-disease conflict path and the severity of the conflict. The correction module is used to: if a conflict path is detected, correct the initial medication risk score according to the severity of the conflict, and generate a final risk score.

9. A pregnancy medication risk assessment device, characterized in that, The pregnancy medication risk assessment device includes a processor, a memory, and a pregnancy medication risk assessment program stored in the memory and executable by the processor, wherein when the pregnancy medication risk assessment program is executed by the processor, it implements the steps of the pregnancy medication risk assessment method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a pregnancy medication risk assessment program, wherein when the pregnancy medication risk assessment program is executed by a processor, it implements the steps of the pregnancy medication risk assessment method as described in any one of claims 1 to 7.