Intelligent medication guidance sheet generation method and system based on multi-source heterogeneous medicine data

By fusing multi-source heterogeneous data, constructing graphs, and training models, and by incorporating feedback from pharmacists and patients, the issues of data consistency, accuracy, and personalization in the generation of medication guidance sheets were resolved, achieving efficient and accurate generation of medication guidance sheets.

CN120932936APending Publication Date: 2025-11-11JIANGSU WEIYAO INFORMATION TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511024893.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-24
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Existing medication guidance sheet generation technologies have significant shortcomings in multi-source heterogeneous data integration, personalized generation, dynamic updates, and closed-loop optimization, resulting in poor data consistency, inaccurate generated content, duplication, and difficulty in continuously improving quality.

Method used

By standardizing and integrating multi-source heterogeneous medical data in real time, constructing a dynamic medication rule knowledge graph, training a graph-assisted comparative learning model, and iteratively optimizing the model based on pharmacist and patient feedback, personalized medication guidance sheets are generated.

Benefits of technology

It achieves efficient integration of multi-source heterogeneous data, personalized generation, dynamic updating and closed-loop optimization. The generated medication guidance sheets are highly accurate and diverse, reducing the occurrence of similar errors and improving the quality of medication guidance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120932936A_ABST
    Figure CN120932936A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent generation method and system for a medication guidance sheet based on multi-source heterogeneous medicine data, and belongs to the field of intelligent generation of medication guidance sheets, and the method comprises the following steps: S1, carrying out the standardization and real-time fusion of the multi-source heterogeneous medicine data; s2, integrating the standardized multi-source heterogeneous data and multi-source clinical knowledge, and constructing a knowledge graph; s3, constructing a medication guidance sheet intelligent generation model, and training the medication guidance sheet intelligent generation model; s4, inputting the real-time data of the patient into the trained medication instruction sheet intelligent generation model and the knowledge graph, and generating a medication instruction sheet; and S5, iteratively optimizing the medication guidance sheet intelligent generation model and the knowledge graph. By the adoption of the intelligent generation method and system for the medication guidance list based on the multi-source heterogeneous medicine data, precise, personalized and real-time generation of the medication guidance list is achieved, and the defects of multi-source data integration, dynamic updating, personalization and content quality control in the prior art are overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent generation technology of medication instruction sheets, and in particular to a method and system for intelligent generation of medication instruction sheets based on multi-source heterogeneous medical data. Background Technology

[0002] With the rapid development of pharmaceutical information technology, the safety and accuracy of clinical medication are receiving increasing attention. Medication instructions, as a crucial link between healthcare professionals and patients, directly impact treatment outcomes and patient adherence due to their accuracy, personalization, and timeliness.

[0003] The existing methods for generating medication instruction sheets are as follows:

[0004] 1. Medication Instruction Form Generation Technology Based on Manual Rule Base: This technology constructs a static medication rule base (including dosage, contraindications, etc.) by manually compiling drug instructions, clinical guidelines, and other materials. When generating the instruction form, it outputs content by simply matching the patient's prescription with the rule base entries. For example, a hospital pharmacist retrieves the corresponding information from the locally maintained rule base based on the drug name in the prescription, manually or semi-automatically generating a paper instruction form. Its core principle is rule query based on keyword matching, relying on the completeness and timeliness of the manually maintained database.

[0005] 2. Generative techniques based on traditional machine learning: These techniques utilize structured patient data (age, diagnosis) and drug attributes (dosage, specifications) to train models and generate standardized guidance content. For example, a linear relationship model between patient weight and drug dosage can automatically calculate medication dosages for children. The principle behind this is based on statistically analyzing and mining correlational features within the data to achieve automated generation in limited scenarios.

[0006] 3. Direct Generation Technology Based on Large Language Models (LLM): With the development of natural language processing technology, some solutions use pre-trained LLMs (such as the GPT series) to directly input patient information and prescription text to generate instruction sheets. The principle is to utilize the LLM's ability to fit massive amounts of text to generate natural language content that conforms to grammar and common sense.

[0007] 4. Static knowledge graph-based assisted generation technology: Introduce knowledge graphs (KG) to integrate the relationships between drugs, diseases, and populations (e.g., "Drug A is contraindicated in pregnant women"), and supplement contraindication information by querying the graph during generation.

[0008] It is known that the existing technology still has the following shortcomings:

[0009] 1. Insufficient ability to integrate multi-source heterogeneous data: Existing technologies struggle to effectively handle the heterogeneity of multi-source data, such as hospital HIS systems, national drug databases, and electronic medical records (e.g., inconsistent formats and coding). For example, when there are differences between local drug names in hospitals and generic names in the national database, simple matching can easily lead to rule invocation errors; unstructured data (such as diagnostic descriptions like "allergic rhinitis with asthma") is difficult to convert into features that the model can understand, resulting in omissions of key information in guidance sheets.

[0010] 2. Weak Personalization and Dynamic Update Capabilities: Traditional rule bases and models are mostly static, unable to synchronize with real-time updates to the national drug database (such as new drug interactions or dosage adjustments), resulting in outdated guidance content. Furthermore, the generation process does not fully incorporate individual patient characteristics (such as age, allergy history, and liver and kidney function), making it difficult to achieve precise personalized guidance. For example, generating standard dosages for patients with renal insufficiency poses a safety risk.

[0011] 3. Insufficient accuracy and diversity of generated content: When LLM is generated directly, it is prone to producing non-factual content due to a lack of domain knowledge constraints (such as recommending that pregnant women use prohibited drugs), and it ignores fine-grained relationships in multi-turn dialogues or data (such as the combined medication restrictions for patients with "30 weeks of pregnancy" and "hypertension"). At the same time, guidance sheets generated by traditional models have repetitive content (such as "avoid drinking alcohol" appearing multiple times) and rigid format (only supporting fixed templates), which affects patient readability.

[0012] 4. Lack of closed-loop optimization mechanism: Existing technologies have not established an effective feedback and iteration channel. Errors corrected manually by pharmacists (such as dosage calculation errors) and "ambiguous information" from patient feedback cannot be fed back into the model and rule base, resulting in the recurrence of similar errors and making it difficult to continuously improve the quality of instruction sheets.

[0013] In summary, existing technologies have significant shortcomings in multi-source data integration, personalized generation, dynamic updates, and closed-loop optimization. Summary of the Invention

[0014] The purpose of this invention is to provide a method and system for intelligently generating medication guidance sheets based on multi-source heterogeneous medical data, thereby solving the aforementioned technical problems.

[0015] To achieve the above objectives, this invention provides a method for intelligently generating medication guidance sheets based on multi-source heterogeneous pharmaceutical data, comprising the following steps:

[0016] S1. Standardization and Real-time Integration of Multi-Source Heterogeneous Medical Data: Standardized integration of multi-source heterogeneous data, consisting of hospital HIS systems, medical record systems, laboratory systems, and national drug databases, is achieved through unified coding and real-time interfaces.

[0017] S2. Construction of dynamic medication rule knowledge graph: Integrate standardized multi-source heterogeneous data and multi-source clinical knowledge to construct a knowledge graph, and realize real-time synchronization between the national drug database and hospital drug database through national standard code association;

[0018] S3. Construction of a Graph-Assisted Comparative Learning-Based Intelligent Generation Model for Medication Instructions: Construct an intelligent generation model for medication instructions and integrate the structured relationships of knowledge graphs with the semantic enhancement capabilities of comparative learning to train the intelligent generation model for medication instructions.

[0019] S4. Personalized Medication Guidance Form Generation: Input real-time patient data into the trained intelligent medication guidance form generation model and knowledge graph to generate a medication guidance form;

[0020] S5. Feedback-driven model and knowledge graph iterative optimization: Through pharmacist manual correction and patient feedback data, the intelligent generation model and knowledge graph of medication guidance sheets are iteratively optimized.

[0021] Preferably, step S1 specifically includes the following steps:

[0022] S11. Connect with the hospital's HIS system via a WebService interface to obtain patient medical history and medication data in real time. Simultaneously, collect data from the national drug database through web crawlers and API interfaces to obtain multi-source heterogeneous datasets. The patient data includes outpatient number, prescription number, name, gender, age, weight, department, date of visit, diagnosis code, drug name, specifications, manufacturer, national standard code, price, and medical insurance type. The national drug database data includes drug name images, specifications, dosage form, dosage, dosage unit, frequency, route of administration, manufacturer, medical insurance type, national standard code, national drug approval number, drug instructions, and dosage and frequency precautions.

[0023] S12. Data Cleaning and Anomaly Handling: Numerical fields are handled using a random forest-based imputation method; categorical missing fields are handled using a mode imputation method; outliers are identified using the Z-score method and corrected using clinical common sense.

[0024] S13. Establish a mapping relationship between hospital drugs and the national database, using the national standard code for drugs as the unique identifier:

[0025]

[0026] In the formula, Map(·) represents the standardized mapping function for drug descriptions; d i This represents the drug description in the hospital's HIS system; S represents the set of standard drug entries in the national database, s j Sim(d) represents the j-th element in S; i ,s j ) represents d based on Word2Veci With s j Semantic similarity between them;

[0027] S14. Encode the unstructured text using the BERT-BiLSTM model to generate the text structured feature vector Emb(t):

[0028] Emb(t) = BiLSTM(BERT(t));

[0029] In the formula, BERT(t) represents the word vector output of the pre-trained BERT model; BiLSTM represents a bidirectional long short-term memory network.

[0030] S15. Merge structured data with text structured feature vectors Emb(t) and associate them by patient ID to form a standardized fusion dataset.

[0031] Preferably, step S2 specifically includes the following steps:

[0032] S21. Define a knowledge graph;

[0033] Define entities: patient, drug, disease, rule;

[0034] Define the following entity relationships: Patient-Diagnosis, Drug-Disease, Drug-Drug, Drug-Population;

[0035] S22. Construct an initial graph using the Neo4j graph database and import triples;

[0036] S22. Real-time synchronization mechanism based on national standard codes: When the national drug database is updated, the corresponding entries in the hospital's local database are matched using the national standard codes, and the attributes and relationships are automatically updated. The update expression is as follows:

[0037] G(t) = G(t-1) ⊕ ΔG;

[0038] In the formula, G(t) and G(t-1) represent the triples at time t and time t-1, respectively; ΔG represents the set of triples for incremental update; and ⊕ represents the graph merging operation.

[0039] Preferably, step S3 specifically includes the following steps:

[0040] S31. Fusion of graph features and patient-drug features;

[0041] S311. Extracting features from a knowledge graph subgraph: For a single patient-drug pair, extract a local subgraph from the knowledge graph, and then learn the vector representation of the local subgraph using the GraphSAGE algorithm.

[0042] h u =mean({h v|v∈N(v)}∪{h u});

[0043] In the formula, h u represents node embedding; mean(·) represents the aggregation function of node feature mean; v represents the neighboring nodes of node u; N(u) represents the set of nodes v;

[0044] S312. Integrate subgraph features using the component fields of patient and drug characteristics:

[0045] P=[age,weight,allergy_vec,diagnosis_emb];

[0046] D = [ic] hash usage vec KG emb ];

[0047] In the formula, age, weight, allergy_vec, and diagnosis_emb represent the patient's age, weight, allergy history, diagnostic text, and semantic embedding vector, respectively; ic hash usage vec KG emb These represent the hash value of the national standard code for drugs, the encoding vector for usage and dosage, and the embedding vector of the drug in the knowledge graph, respectively.

[0048] S313. Utilizing attention mechanisms to fuse component fields of patient and drug characteristics:

[0049] F = Attention(P,D) = ∑α k ·[P k ;D k ];

[0050] In the formula, F represents the fused feature vector; Attention(·) represents the attention mechanism function; P represents the patient feature vector; D represents the drug feature vector; α k P represents attention weights; k D represents the k-th dimension of the patient feature vector; k Represents the k-dimensional features of the drug feature vector D; [;] represents the vector concatenation operation;

[0051] S32. Construct positive and negative sample pairs, where positive samples are effective drug combinations for the same patient; negative samples are contraindicated or ineffective combinations.

[0052] S33. Define the total loss function L:

[0053] L=ω CE L CE +ωCD L CD ;

[0054] in,

[0055]

[0056] In the formula, ω CE and ω CD Both represent weighting coefficients, and ω CE +ω CD =1; L CL and L CE These represent the contrast loss and the generation loss, respectively; N and M represent the number of positive and negative sample pairs, respectively. and These represent the fused feature vectors of the nth positive sample pair, respectively. Let represent the fused feature vector of the m-th negative sample; τ represents the temperature coefficient, and τ = 0.1; y t Represents real text; The model predicts the probability; T represents the total training period.

[0057] S34. Based on the total loss function, update the parameters of the intelligent medication instruction generation model through backpropagation, iterate the training until the loss converges, and output the trained intelligent medication instruction generation model.

[0058] Preferably, the allergy history in step S312 is represented by a binary tag.

[0059] Preferably, step S4 specifically includes the following steps:

[0060] S41. Input the patient's real-time data into the trained medication guidance intelligent generation model to generate the initial medication guidance sheet;

[0061] S42. Knowledge Graph Conflict Validation: Based on the knowledge graph, drug interactions and contraindications are retrieved, conflicting content is marked and corrected to obtain conflict-free guidance text.

[0062] S43. Employ a diversity comparison search algorithm to optimize conflict-free guide texts and reduce repetition:

[0063]

[0064] In the formula, maxTRR represents the text repetition rate, and maxTRR≤0.12; count(n t ) represents the single smallest semantic unit n in a single text. t The number of times it appears; len(N) t ) represents the single smallest semantic unit n in a single text. t Length; N tThis represents the smallest semantic unit n in a single text. t The total number.

[0065] A system for intelligent generation of medication guidance sheets based on multi-source heterogeneous medical data includes:

[0066] The multi-source data acquisition and fusion module is used to achieve standardized integration of multi-source heterogeneous data from hospital HIS systems, medical record systems, laboratory systems, and national drug databases through unified coding and real-time interfaces.

[0067] The knowledge graph construction module is used to integrate standardized multi-source heterogeneous data and multi-source clinical knowledge to build a knowledge graph, and to achieve real-time synchronization between the national drug database and hospital drug databases through national standard codes.

[0068] The model building module is used to build an intelligent model for generating medication instructions, and integrates the structured relationships of knowledge graphs with the semantic enhancement capabilities of comparative learning to train the intelligent model for generating medication instructions.

[0069] The personalized medication guidance sheet generation module is used to input real-time patient data into the trained intelligent medication guidance sheet generation model and knowledge graph to generate a medication guidance sheet;

[0070] The iterative optimization module is used to iteratively optimize the intelligent generation model and knowledge graph of medication guidance sheets by combining data from pharmacists' manual corrections and patient feedback.

[0071] Therefore, the present invention employs the above-mentioned intelligent generation method and system for medication guidance sheets based on multi-source heterogeneous medical data, which has the following beneficial effects:

[0072] 1. Strong ability to integrate multi-source heterogeneous data: Through unified coding (such as national standard code mapping) and BERT-BiLSTM semantic coding, it effectively handles the format and coding differences of multi-source data such as hospital HIS system, national drug database, and electronic medical records, solves problems such as "different names for the same drug" and "difficulty in parsing unstructured text", and ensures data consistency;

[0073] 2. More precise personalized generation: Integrating patient characteristics (age, weight, allergy history, etc.) with drug characteristics (indications, contraindications, etc.), and focusing on key clinical correlations (such as children's weight-dosage adjustment, allergy history-contraindication matching) through attention mechanisms to generate guidance content that conforms to individual differences;

[0074] 3. Dynamic updates ensure timeliness: Based on the knowledge graph synchronization mechanism of national standard codes, the information in the national drug database can be automatically updated with new information (such as drug interactions and dosage adjustments) to avoid the content of the guidance sheet lagging behind clinical knowledge;

[0075] 4. Accurate and diverse generated content: The graph-assisted contrastive learning model is trained with positive and negative sample pairs (effective drug combinations vs. contraindicated combinations) to reduce non-factual content (such as recommendations for drugs that are contraindicated for pregnant women); at the same time, the diversity contrastive search algorithm controls the text repetition rate and improves readability.

[0076] 5. Closed-loop optimization to continuously improve quality: Through pharmacist corrections and patient feedback, the model and knowledge graph are iteratively optimized to reduce the recurrence of similar errors and continuously improve the quality of instruction sheets.

[0077] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0078] Figure 1 This is a flowchart of the intelligent generation method for medication guidance sheets based on multi-source heterogeneous medical data according to the present invention. Detailed Implementation

[0079] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of the present invention and are not intended to limit the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of this application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout.

[0080] It should be noted that the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, such as a process, method, system, product, or server that includes a series of steps or units, not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or device.

[0081] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0082] like Figure 1 As shown, the intelligent generation method for medication guidance sheets based on multi-source heterogeneous medical data includes the following steps:

[0083] S1. Standardization and Real-time Integration of Multi-Source Heterogeneous Medical Data: Standardized integration of multi-source heterogeneous data, consisting of hospital HIS systems, medical record systems, laboratory systems, and national drug databases, is achieved through unified coding and real-time interfaces.

[0084] Step S1 specifically includes the following steps:

[0085] S11. Connect with the hospital's HIS system via a WebService interface to obtain patient medical history and medication data in real time. Simultaneously, collect data from the national drug database through web crawlers and API interfaces to obtain multi-source heterogeneous datasets. The patient data includes outpatient number, prescription number, name, gender, age, weight, department, date of visit, diagnosis code, drug name, specifications, manufacturer, national standard code, price, and medical insurance type. The national drug database data includes drug name images, specifications, dosage form, dosage, dosage unit, frequency, route of administration, manufacturer, medical insurance type, national standard code, national drug approval number, drug instructions, and dosage and frequency precautions.

[0086] S12. Data Cleaning and Anomaly Handling: Numerical fields are handled using a random forest-based imputation method; categorical missing fields are handled using a mode imputation method; outliers are identified using the Z-score method and corrected using clinical common sense.

[0087] S13. Establish a mapping relationship between hospital drugs and the national database, using the national standard code for drugs as the unique identifier:

[0088]

[0089] In the formula, Map(·) represents the standardized mapping function for drug descriptions; d i This represents the drug description in the hospital's HIS system; S represents the set of standard drug entries in the national database, s j Sim(d) represents the j-th element in S; i ,s j ) represents d based on Word2Vec i With s j Semantic similarity between them;

[0090] S14. The BERT-BiLSTM model is used to encode unstructured text (such as diagnostic descriptions and medical orders) to generate a text structured feature vector Emb(t):

[0091] Emb(t) = BiLSTM(BERT(t));

[0092] In the formula, BERT(t) represents the word vector output of the pre-trained BERT model; BiLSTM represents a bidirectional long short-term memory network.

[0093] S15. Merge structured data (age, weight, national standard code, etc.) with text structured feature vectors Emb(t), and associate them by patient ID to form a standardized fusion dataset.

[0094] S2. Construction of dynamic medication rule knowledge graph: Integrate standardized multi-source heterogeneous data and multi-source clinical knowledge to construct a knowledge graph, and realize real-time synchronization between the national drug database and hospital drug database through national standard code association;

[0095] Step S2 specifically includes the following steps:

[0096] S21. Define a knowledge graph;

[0097] Define entities: Patient (name, gender, age, weight, mobile phone number, ID card number, outpatient number, prescription number, date of visit, department visited, diagnosis, doctor, pharmacist), Drug (drug name, brand name, specifications, dosage form, dosage, unit of dosage, frequency, price, quantity, unit of quantity, manufacturer, national standard code, national drug approval number, medical insurance type, OTC / prescription drug, currently in use / discontinued), Disease (ICD-10 code, symptoms, recommended medication), Rule (drug name, image, brand name, specifications, dosage form, dosage, unit of dosage, frequency, route of administration, manufacturer, national standard code, national drug approval number, medical insurance type, OTC / prescription drug, original drug instructions, simplified instructions (the simplified instructions contain indications, usage and dosage, interactions, adverse reactions, precautions, contraindications));

[0098] Define the following entity relationships: Patient-Diagnosis, Drug-Disease, Drug-Drug, Drug-Population;

[0099] S22. Construct an initial graph using the Neo4j graph database and import triples (e.g., (Patient A, suffers from, allergic rhinitis), (Loratadine, GB code XJ07ALI003B001, indication, allergic rhinitis), (Loratadine, contraindicated, pregnant women)).

[0100] S22. Real-time synchronization mechanism based on national standard codes: When the national drug database is updated, the corresponding entries in the hospital's local database are matched using the national standard codes, and attributes (such as "usage and dosage") and relationships (such as adding "interactions") are automatically updated. The update expression is as follows:

[0101] G(t) = G(t-1) ⊕ ΔG;

[0102] In the formula, G(t) and G(t-1) represent the triples at time t and time t-1, respectively; ΔG represents the set of triples for incremental update; and ⊕ represents the graph merging operation.

[0103] S3. Construction of a Graph-Assisted Comparative Learning-Based Intelligent Generation Model for Medication Instructions: Construct an intelligent generation model for medication instructions and integrate the structured relationships of knowledge graphs with the semantic enhancement capabilities of comparative learning to train the intelligent generation model for medication instructions.

[0104] Step S3 specifically includes the following steps:

[0105] S31. Fusion of graph features and patient-drug features;

[0106] S311. Extracting features from a knowledge graph subgraph: For a single patient-drug pair, extract a local subgraph from the knowledge graph, and then learn the vector representation of the local subgraph using the GraphSAGE algorithm.

[0107] h u =mean({h v |v∈N(v)}∪{h u});

[0108] In the formula, h u denoted as node embedding; mean(·) represents the aggregation function of the node feature mean; v represents the neighboring nodes of node u; N(u) represents the set of nodes v (such as patient diagnosis, drug indications);

[0109] S312. Integrate subgraph features using the component fields of patient and drug characteristics:

[0110] P=[age,weight,allergy_vec,diagnosis_emb];

[0111] D = [ic] hash usage vec KG emb ];

[0112] In the formula, age, weight, allergy_vec, and diagnosis_emb represent the patient's age, weight, allergy history, diagnostic text, and semantic embedding vector, respectively; ic hash usage vec KG emb These represent the hash value of the national standard code for drugs, the encoding vector for usage and dosage, and the embedding vector of the drug in the knowledge graph, respectively.

[0113] The allergy history in step S312 is marked with binary tags.

[0114] S313. Utilizing attention mechanisms to fuse component fields of patient and drug characteristics:

[0115] F = Attention(P,D) = ∑α k ·[P k ;D k ];

[0116] In the formula, F represents the fused feature vector; Attention(·) represents the attention mechanism function; P represents the patient feature vector; D represents the drug feature vector; α kP represents attention weights; k D represents the k-th dimension of the patient feature vector; k Represents the k-dimensional features of the drug feature vector D; [;] represents the vector concatenation operation;

[0117] S32. Construct positive and negative sample pairs, where positive samples are effective drug combinations for the same patient (e.g., "allergic rhinitis + loratadine"); negative samples are contraindicated combinations (e.g., "pregnant woman + loratadine") or ineffective combinations (e.g., "hypertension + loratadine").

[0118] S33. Define the total loss function L:

[0119] L=ω CE L CE +ω CD L CD ;

[0120] in,

[0121]

[0122] In the formula, ω CE and ω CD Both represent weighting coefficients, and ω CE +ω CD =1; L CL and L CE These represent the contrast loss and the generation loss, respectively; N and M represent the number of positive and negative sample pairs, respectively. and These represent the fused feature vectors of the nth positive sample pair, respectively. Let represent the fused feature vector of the m-th negative sample; τ represents the temperature coefficient, and τ = 0.1; y t Represents real text; The model predicts the probability; T represents the total training period.

[0123] S34. Based on the total loss function, update the parameters of the intelligent medication instruction generation model through backpropagation, iterate the training until the loss converges, and output the trained intelligent medication instruction generation model.

[0124] S4. Personalized Medication Guidance Form Generation: Input real-time patient data into the trained intelligent medication guidance form generation model and knowledge graph to generate a medication guidance form;

[0125] Step S4 specifically includes the following steps:

[0126] S41. Input the patient's real-time data into the trained medication guidance intelligent generation model to generate the initial medication guidance sheet;

[0127] S42. Knowledge Graph Conflict Validation: Based on the knowledge graph, drug interactions (such as "loratadine + ketoconazole" increases blood drug concentration) and contraindications (such as "reducing dosage in patients with liver dysfunction") are retrieved, conflicting content is marked and corrected, and a conflict-free guidance document text is obtained.

[0128] S43. Employ a diversity comparison search algorithm to optimize conflict-free guide texts and reduce repetition:

[0129]

[0130] In the formula, maxTRR represents the text repetition rate, and maxTRR≤0.12; count(n t ) represents the single smallest semantic unit n in a single text. t The number of times it appears; len(N) t ) represents the single smallest semantic unit n in a single text. t Length; N t This represents the smallest semantic unit n in a single text. t The total number.

[0131] S5. Feedback-driven model and knowledge graph iterative optimization: Through pharmacist manual correction and patient feedback data, the intelligent generation model and knowledge graph of medication guidance sheets are iteratively optimized.

[0132] A system for intelligent generation of medication guidance sheets based on multi-source heterogeneous medical data includes:

[0133] The multi-source data acquisition and fusion module is used to achieve standardized integration of multi-source heterogeneous data from hospital HIS systems, medical record systems, laboratory systems, and national drug databases through unified coding and real-time interfaces.

[0134] The knowledge graph construction module is used to integrate standardized multi-source heterogeneous data and multi-source clinical knowledge to build a knowledge graph, and to achieve real-time synchronization between the national drug database and hospital drug databases through national standard codes.

[0135] The model building module is used to build an intelligent model for generating medication instructions, and integrates the structured relationships of knowledge graphs with the semantic enhancement capabilities of comparative learning to train the intelligent model for generating medication instructions.

[0136] The personalized medication guidance sheet generation module is used to input real-time patient data into the trained intelligent medication guidance sheet generation model and knowledge graph to generate a medication guidance sheet;

[0137] The iterative optimization module is used to iteratively optimize the intelligent generation model and knowledge graph of medication guidance sheets by combining data from pharmacists' manual corrections and patient feedback.

[0138] Simulation Experiment

[0139] Collect 100,000 outpatient prescriptions from a top-tier hospital (including patient age, weight, diagnosis, drug name, etc.), a national drug database (including 50,000 drug national standard codes, specifications, contraindications, etc.), and 3,000 unstructured diagnostic texts from electronic medical records (such as "allergic rhinitis with asthma").

[0140] Comparison methods: traditional manual rule base methods; traditional machine learning; direct generation methods using LLM (such as GPT-3.5); static knowledge graph-assisted generation methods;

[0141] Evaluation indicators: accuracy (match rate between the instruction sheet and clinical guidelines / drug instructions); personalization (match between the instruction sheet and patient characteristics, such as the appropriateness of dosage and weight for children); timeliness (accuracy rate of synchronization of instruction sheet content after knowledge updates); diversity (maximum TRR of text duplication rate).

[0142] Table 1

[0143]

[0144] As shown in Table 1, this invention reduces non-factual content through knowledge graph conflict verification (S42) and contrastive learning constraints (S3), resulting in the highest clinical rule compliance rate (94.5%); the individual feature matching rate is significantly better than other methods (92.3%); the synchronization delay is only 5 minutes; and the text duplication rate is the lowest (8.1%), thus demonstrating the advancement of this invention.

[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can still be further explored.

[0146] Modifications or equivalent substitutions are made, but these modifications or equivalent substitutions cannot improve the modified technology.

[0147] The proposed solution deviates from the spirit and scope of the technical solution of this invention.

Claims

1. A method for intelligently generating medication guidance sheets based on multi-source heterogeneous medical data, characterized in that: Includes the following steps: S1. Standardization and Real-time Integration of Multi-Source Heterogeneous Medical Data: Standardized integration of multi-source heterogeneous data, consisting of hospital HIS systems, medical record systems, laboratory systems, and national drug databases, is achieved through unified coding and real-time interfaces. S2. Construction of dynamic medication rule knowledge graph: Integrate standardized multi-source heterogeneous data and multi-source clinical knowledge to construct a knowledge graph, and realize real-time synchronization between the national drug database and hospital drug database through national standard code association; S3. Construction of a Graph-Assisted Comparative Learning-Based Intelligent Generation Model for Medication Instructions: Construct an intelligent generation model for medication instructions and integrate the structured relationships of knowledge graphs with the semantic enhancement capabilities of comparative learning to train the intelligent generation model for medication instructions. S4. Personalized Medication Guidance Form Generation: Input real-time patient data into the trained intelligent medication guidance form generation model and knowledge graph to generate a medication guidance form; S5. Feedback-driven model and knowledge graph iterative optimization: Through pharmacist manual correction and patient feedback data, the intelligent generation model and knowledge graph of medication guidance sheets are iteratively optimized.

2. The intelligent generation method for medication guidance sheets based on multi-source heterogeneous medical data according to claim 1, characterized in that: Step S1 specifically includes the following steps: S11. Connect with the hospital's HIS system via a WebService interface to obtain patient medical history and medication data in real time. Simultaneously, collect data from the national drug database through web crawlers and API interfaces to obtain multi-source heterogeneous datasets. The patient data includes outpatient number, prescription number, name, gender, age, weight, department, date of visit, diagnosis code, drug name, specifications, manufacturer, national standard code, price, and medical insurance type. The national drug database data includes drug name images, specifications, dosage form, dosage, dosage unit, frequency, route of administration, manufacturer, medical insurance type, national standard code, national drug approval number, drug instructions, and dosage and frequency precautions. S12. Data Cleaning and Anomaly Handling: Numerical fields are handled using a random forest-based imputation method; categorical missing fields are handled using a mode imputation method; outliers are identified using the Z-score method and corrected using clinical common sense. S13. Establish a mapping relationship between hospital drugs and the national database, using the national standard code for drugs as the unique identifier: In the formula, Map(·) represents the standardized mapping function for drug descriptions; d i This represents the drug description in the hospital's HIS system; S represents the set of standard drug entries in the national database, s j Sim(d) represents the j-th element in S; i ,s j ) represents d based on Word2Vec i With s j Semantic similarity between them; S14. Encode the unstructured text using the BERT-BiLSTM model to generate the text structured feature vector Emb(t): Emb(t) = BiLSTM(BERT(t)); In the formula, BERT(t) represents the word vector output of the pre-trained BERT model; BiLSTM represents a bidirectional long short-term memory network. S15. Merge structured data with text structured feature vectors Emb(t) and associate them by patient ID to form a standardized fusion dataset.

3. The intelligent generation method for medication guidance sheets based on multi-source heterogeneous medical data according to claim 2, characterized in that: Step S2 specifically includes the following steps: S21. Define a knowledge graph; Define entities: patient, drug, disease, rule; Define the following entity relationships: Patient-Diagnosis, Drug-Disease, Drug-Drug, Drug-Population; S22. Construct an initial graph using the Neo4j graph database and import triples; S22. Real-time synchronization mechanism based on national standard codes: When the national drug database is updated, the corresponding entries in the hospital's local database are matched using the national standard codes, and the attributes and relationships are automatically updated. The update expression is as follows: In the formula, G(t) and G(t-1) represent the triples at time t and time t-1, respectively; ΔG represents the set of triples updated incrementally. This indicates a graph merging operation.

4. The intelligent generation method for medication guidance sheets based on multi-source heterogeneous medical data according to claim 3, characterized in that: Step S3 specifically includes the following steps: S31. Fusion of graph features and patient-drug features; S311. Extracting features from a knowledge graph subgraph: For a single patient-drug pair, extract a local subgraph from the knowledge graph, and then learn the vector representation of the local subgraph using the GraphSAGE algorithm. h u =mean({h v |v∈N(v)}∪{h u }); In the formula, h u represents node embedding; mean(·) represents the aggregation function of node feature mean; v represents the neighboring nodes of node u; N(u) represents the set of nodes v; S312. Integrate subgraph features using the component fields of patient and drug characteristics: P=[age,weight,allergy_vec,diagnosis_emb]; D=[ic hash ,usage vec ,KG emb ]; In the formula, age, weight, allergy_vec, and diagnosis_emb represent the patient's age, weight, allergy history, diagnostic text, and semantic embedding vector, respectively; ic hash usage vec KG emb These represent the hash value of the national standard code for drugs, the encoding vector for usage and dosage, and the embedding vector of the drug in the knowledge graph, respectively. S313. Utilizing attention mechanisms to fuse component fields of patient and drug characteristics: F=Attention(P,D)=∑α k ·[P k ;D k ]; In the formula, F represents the fused feature vector; Attention(·) represents the attention mechanism function; P represents the patient feature vector; D represents the drug feature vector; α k P represents attention weights; k D represents the k-th dimension of the patient feature vector; k Represents the k-dimensional features of the drug feature vector D; [;] represents the vector concatenation operation; S32. Construct positive and negative sample pairs, where positive samples are effective drug combinations for the same patient; negative samples are contraindicated or ineffective combinations. S33. Define the total loss function L: L=ω CE L CE +oh CD L CD ; in, In the formula, ω CE and ω CD Both represent weighting coefficients, and ω CE +ω CD =1; L CL and L CE These represent the contrast loss and the generation loss, respectively; N and M represent the number of positive and negative sample pairs, respectively. and These represent the fused feature vectors of the nth positive sample pair, respectively. Let represent the fused feature vector of the m-th negative sample; τ represents the temperature coefficient, and τ = 0.1; y t Represents real text; The model predicts the probability; T represents the total training period. S34. Based on the total loss function, update the parameters of the intelligent medication instruction generation model through backpropagation, iterate the training until the loss converges, and output the trained intelligent medication instruction generation model.

5. The intelligent generation method for medication guidance sheets based on multi-source heterogeneous medical data according to claim 4, characterized in that: The allergy history in step S312 is marked with binary tags.

6. The intelligent generation method for medication guidance sheets based on multi-source heterogeneous medical data according to claim 4, characterized in that: Step S4 Specifically, the following steps are included: S41. Input the patient's real-time data into the trained medication guidance intelligent generation model to generate the initial medication guidance sheet; S42. Knowledge Graph Conflict Validation: Based on the knowledge graph, drug interactions and contraindications are retrieved, conflicting content is marked and corrected to obtain conflict-free guidance text. S43. Employ a diversity comparison search algorithm to optimize conflict-free guide texts and reduce repetition: In the formula, maxTRR represents the text repetition rate, and maxTRR≤0.12; count(n t ) represents the single smallest semantic unit n in a single text. t The number of times it appears; len(N) t ) represents the single smallest semantic unit n in a single text. t Length; N t This represents the smallest semantic unit n in a single text. t The total number.

7. A system for executing the intelligent generation method of medication instruction sheets based on multi-source heterogeneous pharmaceutical data as described in any one of claims 1-6, characterized in that: include: The multi-source data acquisition and fusion module is used to achieve standardized integration of multi-source heterogeneous data from hospital HIS systems, medical record systems, laboratory systems, and national drug databases through unified coding and real-time interfaces. The knowledge graph construction module is used to integrate standardized multi-source heterogeneous data and multi-source clinical knowledge to build a knowledge graph, and to achieve real-time synchronization between the national drug database and hospital drug databases through national standard codes. The model building module is used to build an intelligent model for generating medication instructions, and integrates the structured relationships of knowledge graphs with the semantic enhancement capabilities of comparative learning to train the intelligent model for generating medication instructions. The personalized medication guidance sheet generation module is used to input real-time patient data into the trained intelligent medication guidance sheet generation model and knowledge graph to generate a medication guidance sheet; The iterative optimization module is used to iteratively optimize the intelligent generation model and knowledge graph of medication guidance sheets by combining data from pharmacists' manual corrections and patient feedback.

Citation Information

Cited By

  • Precise medication guidance generation method based on drug knowledge graph and user portrait

    CN121215160A

  • Remote medication guidance scheme pushing method and system based on AI multi-model fusion

    CN121662330A