Intelligent pharmacy prescription automatic inspection system and method integrated with deep learning
The intelligent pharmacy prescription auto-checking system, which integrates deep learning, solves the problem of existing technologies not taking into account individual patient differences, achieves accurate identification of individualized medication risks, and improves medication safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-04-03
AI Technical Summary
Existing pharmacy prescription examination technology does not fully consider individual patient differences, resulting in insufficient accuracy in identifying medication risks and failing to meet the needs for personalized medication safety assurance.
The intelligent pharmacy prescription automatic inspection system, which integrates deep learning, includes a prescription multi-dimensional data acquisition module, a patient individualized feature modeling module, a deep learning fusion reasoning module, and a dynamic compliance verification module. Through multi-dimensional data acquisition, feature extraction and modeling, deep learning fusion reasoning, and dynamic compliance verification, it achieves individualized medication risk identification.
It enables precise identification of individualized medication risks, improves the targeting and reliability of prescription checks, and provides strong protection for medication safety.
Smart Images

Figure CN121789883A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and assisted medical technology, and in particular relates to an intelligent pharmacy prescription automatic inspection system and method that integrates deep learning. Background Technology
[0002] Current pharmacy prescription review technologies largely rely on deep learning models to identify general rules regarding drug contraindications and combinations, failing to adequately consider the impact of individual patient differences on medication risks. Different patients exhibit significant variations in their physiological conditions, pathological characteristics, medication history, and allergies, meaning the same prescription may pose drastically different risks to different patients. Traditional approaches rely solely on general information about drugs and diagnoses for risk assessment, neglecting the correlation between individual patient characteristics and medication risk. This results in insufficient accuracy in identifying medication risks in specific populations, making it difficult to uncover potential individual medication risks and failing to meet the needs for personalized medication safety assurance.
[0003] Based on the above problems, there is an urgent need for a technical solution that can combine individual patient characteristics to achieve precise identification of medication risks. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing an intelligent pharmacy prescription automatic inspection system that integrates deep learning. This system includes a multi-dimensional prescription data acquisition module, a patient individualized feature modeling module, a deep learning fusion inference module, a dynamic compliance verification module, and a result output module. The multi-dimensional prescription data acquisition module acquires basic patient information, medication information, diagnostic information, and historical medication records from the prescription. The patient individualized feature modeling module extracts and models features from the acquired basic patient information and historical medication records. The deep learning fusion inference module receives the medication information and diagnostic information output from the multi-dimensional prescription data acquisition module and the feature model output from the patient individualized feature modeling module, and performs preliminary medication risk identification based on the trained deep learning network. The dynamic compliance verification module constructs a dynamic compliance database based on pharmacopoeia standards and clinical medication guidelines, and performs secondary verification on the preliminary identification results output by the deep learning fusion inference module. The result output module receives the final verification results output by the dynamic compliance verification module and generates an inspection report and risk warning information.
[0005] Preferred: The prescription multi-dimensional data collection module collects basic patient information including age, gender, weight, liver and kidney function indicators, allergy history, medication information including drug name, dosage form, dosage, frequency of use, and course of treatment, diagnostic information including the name of the primary diagnosis, the name of the complication, and the severity level of the disease, and the patient's historical medication records including a list of drugs used in the past 12 months, duration of use, and records of adverse drug reactions.
[0006] Further optimization: The features extracted by the patient individualized feature modeling module include physiological feature dimension, pathological feature dimension, medication history feature dimension, and allergy feature dimension. Among them, the physiological feature dimension is constructed based on age, gender, weight, and liver and kidney function indicators; the pathological feature dimension is constructed based on the primary diagnosis, complications, and disease severity classification; the medication history feature dimension is constructed based on the types of medications used in the past, the frequency of medication, and the course of medication; and the allergy feature dimension is constructed based on the history of allergies and the records of adverse drug reactions in the past.
[0007] Further optimized: The deep learning network used in the deep learning fusion reasoning module includes a feature fusion layer, an attention mechanism layer, and a multi-classification reasoning layer. The feature fusion layer is used to fuse medication information features, diagnostic information features, and patient individualization features. The attention mechanism layer is used to strengthen the weights of features related to drug contraindications, dosage abnormalities, drug incompatibilities, duplicate medication, and inconsistencies with indications. The multi-classification reasoning layer is used to output the preliminary identification results of various medication risks.
[0008] Further optimization: The patient individualized characteristic modeling module calculates the patient's baseline medication risk value using the patient medication risk baseline scoring formula, which is:
[0009] ;
[0010] The above formula is the basic scoring formula for patient medication risk, where This represents the baseline risk level for patient medication use. Indicates the risk coefficient of physiological characteristics. Indicates the risk coefficient of pathological characteristics. Indicates the risk coefficient of allergy characteristics. This indicates the risk coefficient of adverse drug reactions in historical medication use. , , , These are the weighting coefficients of each characteristic risk coefficient, and Each weight coefficient is obtained by training a logistic regression algorithm based on massive historical prescription data.
[0011] Further optimization: The deep learning fusion inference module calculates the risk of medication timing conflicts using a formula for the timing medication conflict warning coefficient. The formula for the timing medication conflict warning coefficient is:
[0012] ;;
[0013] The above formula is the formula for the early warning coefficient of time-series medication conflict, where This indicates the early warning coefficient for time-series medication conflicts. This indicates the types and quantities of drugs in the prescription. Indicates the first The drug and the first The dosing interval for this type of drug. This indicates the maximum safe dosing interval for this type of drug combination. Indicates the first The drug and the first Temporal conflict weights for drugs This indicates the actual frequency of medication use in the prescription. This indicates the upper limit of the safe frequency of medication use for this drug. , These are the weighting coefficients for medication interval conflict and medication frequency conflict, respectively. .
[0014] Further optimization: The dynamic compliance verification module calculates the final medication risk of the prescription using the dynamic compliance verification final risk value formula. The dynamic compliance verification final risk value formula is:
[0015] ;
[0016] The above formula is the final risk value formula for dynamic compliance verification, where This indicates the risk value of the final prescription. This represents the credibility coefficient of the deep learning inference result. This represents the standard risk coefficient in the dynamic compliance database. Indicates the number of risk types for compliance verification. Indicates the first The verification result value for risk categories is 0 if they conform to the standard, and 1 if they do not conform to the standard. Indicates the first The severity weight of risk class, This represents the compliance verification weight coefficient.
[0017] Further optimization: The inspection report generated by the result output module includes basic prescription information, medication risk identification results, compliance verification results, detailed description of risk points, and risk warning information including risk level, risk type, and rectification suggestions. The risk level is divided into three levels: low risk, medium risk, and high risk based on the final risk value of dynamic compliance verification.
[0018] A method for automatically checking prescriptions in a smart pharmacy by incorporating deep learning includes the following steps:
[0019] S1. Prescription Multi-Dimensional Data Collection: Acquire patient basic information, medication information, diagnostic information, and patient historical medication records from prescriptions through data collection devices;
[0020] S2. Patient Individualized Feature Modeling: Feature extraction is performed on the basic patient information and historical medication records collected in S1 to construct physiological feature dimensions, pathological feature dimensions, medication history feature dimensions, and allergy feature dimensions. The patient medication risk baseline value is calculated using the patient medication risk baseline scoring formula.
[0021] S3. Deep Learning Fusion Inference: Input the medication information and diagnostic information collected in S1 and the patient individualized feature model constructed in S2 into the trained deep learning network;
[0022] S4. Calculation of time-series medication conflict: Based on the baseline value of patient medication risk obtained in S2, the time-series medication conflict warning coefficient of the prescription drugs is calculated using the formula for the time-series medication conflict warning coefficient.
[0023] S5. Dynamic Compliance Verification: Construct a dynamic compliance database that includes pharmacopoeia standards and clinical medication guidelines. Combine the time-series medication conflict warning coefficient obtained in S4, calculate the final medication risk value of the prescription through the final risk value formula of dynamic compliance verification, and perform secondary verification on the preliminary identification results output by S3.
[0024] S6. Output Results: Based on the final medication risk value and secondary verification results obtained in S5, generate an inspection report that includes basic prescription information, medication risk identification results, compliance verification results, detailed descriptions of risk points, and risk warning information that includes risk level, risk type, and rectification suggestions. It supports manual review and abnormal prescription interception.
[0025] Further optimization: The training process of the deep learning network in S3 includes the following steps: collecting massive historical prescription data and corresponding medication risk labeling results. The historical prescription data includes patient basic information, medication information, diagnostic information, and historical medication records. The medication risk labeling results include labels for drug contraindications, abnormal dosage, drug incompatibility, duplicate medication, and inconsistencies with indications. The historical prescription data is preprocessed, including data cleaning, missing value imputation, and feature standardization. The preprocessed data is divided into training set, validation set, and test set in a 7:2:1 ratio. A deep learning network containing a feature fusion layer, an attention mechanism layer, and a multi-classification inference layer is constructed. The network is trained using the training set, the network hyperparameters are adjusted using the validation set, and the network performance is verified using the test set until the network's risk identification accuracy reaches a preset threshold.
[0026] The technical advantages of this invention are as follows: By adding a patient-specific feature modeling module, this invention constructs a baseline risk value by combining patient physiological, pathological, medication history, allergy, and other characteristics. Then, through deep learning fusion reasoning and dynamic compliance verification, it creatively achieves accurate identification of individualized medication risks. This solution addresses the core problem of insufficient accuracy in risk identification caused by neglecting individual patient differences in existing technologies, improves the targeting and reliability of prescription checks, and provides strong protection for medication safety. Attached Figure Description
[0027] Figure 1 This is a connection block diagram of the intelligent pharmacy prescription automatic checking system integrating deep learning, as described in this application.
[0028] Figure 2 This is a connection diagram of the intelligent pharmacy prescription automatic checking method integrating deep learning, as described in this application. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0030] Traditional technical solutions have the following technical problems: existing intelligent prescription examination systems mostly focus on the general contraindication rules of drugs and the matching relationship with diagnoses, without establishing a correlation model between individual patient characteristics and medication risks, the data collection dimensions are limited and no structured processing flow is formed, the deep learning model only processes drug and diagnostic information alone and does not integrate individual characteristics, and the dynamic compliance standards are not updated in real time, resulting in insufficient identification of potential risks for patients with special physiological conditions, pathological characteristics or special medication history, and failing to achieve precise medication risk warning.
[0031] Based on this, please refer to Figure 1 and Figure 2 This embodiment provides an intelligent pharmacy prescription automatic inspection system integrating deep learning, including: a prescription multi-dimensional data acquisition module, a patient individualized feature modeling module, a deep learning fusion inference module, a dynamic compliance verification module, and a result output module. The prescription multi-dimensional data acquisition module is used to acquire basic patient information, medication information, diagnostic information, and patient historical medication records from the prescription. This module achieves data acquisition through multiple interface interfaces, specifically including establishing real-time data transmission channels with hospital HIS systems, electronic prescription systems, and patient health record systems. Structured data is extracted through standardized data interface protocols. For paper prescriptions, high-definition scanning equipment is used to convert them into electronic images, key information is extracted using OCR text recognition technology, and then structured parsing is performed using natural language processing technology to ensure the integrity and accuracy of the collected data.
[0032] The patient-specific feature modeling module extracts and models features from collected patient basic information and historical medication records. This module first preprocesses the raw data, including normalizing numerical data, performing one-hot encoding or label encoding on categorical data, and word embedding on textual data. Then, it uses a feature selection algorithm to filter features highly correlated with medication risk, constructing a four-dimensional feature system encompassing physiological, pathological, medication history, and allergy dimensions, forming a structured patient-specific feature model. The deep learning fusion inference module receives medication information and diagnostic information from the multi-dimensional prescription data acquisition module and the feature model from the patient-specific feature modeling module. Based on the trained deep learning network, it performs preliminary identification of medication risk. This deep learning network adopts an end-to-end training mode. The input layer receives the fused multi-dimensional feature vector. The feature fusion layer uses a combination of concatenation fusion and weighted fusion to transform the medication information feature vector, diagnostic information feature vector, and patient individualized feature vector into a unified fused feature vector. The attention mechanism layer adopts a multi-head attention mechanism with 8 attention heads. It dynamically adjusts the feature weights by calculating the correlation score between each feature and five types of risks: drug contraindications, dosage abnormalities, drug incompatibility, duplicate medication, and incompatibility with indications, thereby strengthening the role of key risk features. The multi-classification inference layer adopts a fully connected network structure with 3 hidden layers and 256, 128, and 64 neurons, respectively. The activation function is the ReLU function. The output layer uses the Softmax function to output the probability values of various medication risks as preliminary identification results. The dynamic compliance verification module is used to construct a dynamic compliance database by combining pharmacopoeia standards and clinical drug use guidelines. This database regularly crawls the latest pharmacopoeia standards issued by the National Medical Products Administration and clinical drug use guidelines issued by the National Health Commission using web crawling technology. It also integrates drug guideline update notifications from authoritative industry institutions to achieve real-time dynamic updates. During the verification process, a combination of rule matching and similarity calculation is used to perform secondary verification on the preliminary identification results output by the deep learning fusion inference module, ensuring the authority and accuracy of the verification results. The results output module receives the final verification results output by the dynamic compliance verification module and generates inspection reports and risk warning information. This module supports multiple output formats, including PDF documents, Excel spreadsheets, and system pop-up prompts. Inspection reports and risk warning information are transmitted via network to pharmacy management terminals, doctor workstations, and patient mobile devices, achieving multi-terminal synchronous push.
[0033] In the implementation of the deep learning fusion reasoning module, a reasoning basis generation submodule is added to the supplementary model output layer. This submodule uses an attention mechanism to perform weighted parsing of input features, including patient weight, liver and kidney function indicators, and drug timing intervals. While outputting risk probability values, it generates traceable reasoning basis vectors. For example, a dose abnormality risk is flagged as a patient's weight being 75% of their standard weight, indicating a dose exceeding the safe range by 15% based on weight, or a patient's alanine aminotransferase (ALT) level being in the moderately abnormal range, requiring a 20% dose reduction. A timing conflict risk is flagged as a drug combination with a 3-hour dosing interval, which is lower than the maximum safe dosing interval of 5 hours in the dynamic compliance database, ensuring the root cause of the risk is traceable. In the implementation of the result output module, the supplementary risk level report must include the specific reasoning basis for each risk, linking it to corresponding patient individual characteristics (such as weight, liver and kidney function), drug characteristics (such as dosage and frequency), and timing characteristics (such as dosing intervals). This forms a structured presentation of risk type, reasoning basis, and associated features, facilitating clinical pharmacists' verification and decision-making.
[0034] Traditional technical solutions have the following technical problems: the existing prescription data collection process does not cover all data dimensions comprehensively, the collection method is singular, and there is a lack of standardized data analysis process. Some key information, such as disease severity classification and historical adverse drug reaction records, is easily missing, resulting in blind spots in subsequent risk identification and affecting the completeness and accuracy of risk assessment.
[0035] Based on this, the prescription multi-dimensional data collection module collects basic patient information including age, gender, weight, liver and kidney function indicators, and allergy history. Age is collected precisely in years; gender is divided into male and female categories; weight is measured in kilograms to one decimal place; liver and kidney function indicators include four core indicators: alanine aminotransferase (ALT), aspartate aminotransferase (AST), creatinine, and blood urea nitrogen, using clinically standardized values; allergy history includes three categories: drug allergies, food allergies, and contact allergies, clearly recording the names of allergens and the type of allergic reaction. Medication information includes drug name, dosage form, dosage, frequency of use, and course of treatment. Drug names use the national generic drug names; dosage forms include standard dosage forms such as tablets, capsules, injections, and aerosols; dosages are based on the commonly used dosage units specified in the drug instructions; frequency of use is expressed as once daily, twice daily, or three times daily; and the course of treatment is clearly recorded in days. Diagnostic information includes the name of the primary diagnosed disease, the name of the complication, and the severity grade of the disease. The names of the primary diagnosed disease and the complication use the standard names corresponding to the ICD-10 disease codes. The severity grade is divided into three levels: mild, moderate, and severe, determined according to the clinical disease severity assessment criteria. The patient's medication history includes a list of medications used in the past 12 months, the duration of use, and records of adverse drug reactions. The medication list records the generic names of all medications used. The duration of use records the actual usage cycle of each medication in days. The records of adverse drug reactions include the time of occurrence, symptoms, treatment methods, and prognosis.
[0036] During the data collection process, structured data is directly extracted through the interface, while unstructured data, such as doctors' handwritten diagnostic notes, is transformed into structured information through keyword extraction and semantic parsing using natural language processing technology, ensuring that all collected data meets the requirements of subsequent feature modeling and risk identification.
[0037] Traditional technical solutions have the following technical problems: even if existing technologies collect multi-dimensional patient data, they do not effectively segment and construct dimensions of the data. The feature extraction methods are simple and do not consider the correlation and redundancy between features, resulting in messy data that cannot form valuable individualized features, which affects the inference effect of subsequent deep learning models.
[0038] Based on this, the features extracted by the patient individualized feature modeling module include physiological feature dimension, pathological feature dimension, medication history feature dimension, and allergy feature dimension. Among them, the physiological feature dimension is constructed based on age, gender, weight, and liver and kidney function indicators.
[0039] The quantitative thresholds for abnormal levels of various liver and kidney function indicators are as follows: Alanine aminotransferase (ALT): mild abnormality 40-80 U / L, moderate abnormality 81-120 U / L, severe abnormality >120 U / L; Aspartate aminotransferase (AST): mild abnormality 40-80 U / L, moderate abnormality 81-120 U / L, severe abnormality >120 U / L; Creatinine (Cr): males: mild abnormality 106-132 μmol / L, moderate abnormality 133-177 μmol / L, severe abnormality >177 μmol / L; females: mild abnormality 88-107 μmol / L, moderate abnormality 108-141 μmol / L, severe abnormality >141 μmol / L; Blood urea nitrogen (BUN): mild abnormality 7.1-14.2 mmol / L, moderate abnormality 14.3-21.4 mmol / L, severe abnormality >21.4 mmol / L.
[0040] Age characteristics are divided into four ranges: under 18 years old, 18-45 years old, 46-60 years old, and over 60 years old, coded as 0, 1, 2, and 3 respectively. Gender characteristics are coded as 1 for males and 0 for females. Weight characteristics are converted to BMI index using the BMI calculation formula and then categorized into four levels: underweight, normal, overweight, and obese, coded as 0, 1, 2, and 3 respectively. Liver and kidney function indicators are compared with clinical normal reference ranges: 0 for indicators within the normal range, 1 for mild abnormalities, 2 for moderate abnormalities, and 3 for severe abnormalities. Finally, age, gender, BMI level, and abnormality level of liver and kidney function indicators are concatenated to form the physiological characteristic dimension vector. The pathological characteristic dimension is constructed based on the primary diagnosis, complications, and disease severity grading. The primary diagnosis and complications are converted into corresponding numerical codes according to ICD-10 encoding. In the disease severity grading, mild is coded as 1, moderate as 2, and severe as 3. One-Hot encoding is used to convert the disease codes into binary feature vectors, which are then concatenated with the disease severity grading values to form the pathological characteristic dimension vector. The medication history feature dimension is constructed based on historical medication types, frequency, and duration of treatment. Medication types are calculated by counting the number of drug categories used within the past 12 months. Medication frequency is calculated as the average frequency of all drugs used. Duration of treatment is calculated as the average duration of all drugs used. These three values are normalized and then concatenated to form the medication history feature dimension vector. The allergy feature dimension is constructed based on allergy history and historical adverse drug reaction records. No allergy record is coded as 0, and an allergy record is coded as 1. No adverse reaction record is coded as 0, a mild adverse reaction as 1, a moderate adverse reaction as 2, and a severe adverse reaction as 3. These two codes are combined to form the allergy feature dimension vector. During feature extraction, Pearson correlation coefficient is used to analyze the correlation between features, redundant features are eliminated, and principal component analysis is used to reduce feature dimensionality, ensuring that the constructed feature vector is both concise and fully reflects the individual differences of patients.
[0041] Traditional technical solutions have the following technical problems: existing deep learning models applied to prescription examination are mostly single-structured, which can only process single-type features and cannot effectively integrate multi-dimensional heterogeneous features. Furthermore, they do not specifically strengthen key risk-related features. Gradient vanishing or overfitting problems are prone to occur during model training, resulting in insufficient accuracy and relevance of inference results.
[0042] Based on this, the deep learning network used in the deep learning fusion inference module includes a feature fusion layer, an attention mechanism layer, and a multi-classification inference layer. The feature fusion layer is used to fuse medication information features, diagnostic information features, and patient individualization features. Medication information features are formed into feature vectors with a dimension of 64 by converting drug name, dosage form, dosage, frequency of use, and course of treatment into numerical codes. Diagnostic information features are converted into 128-dimensional feature vectors through One-Hot encoding. Patient individualization feature vectors have a dimension of 32. The feature fusion layer uses a concatenation fusion method to concatenate the three types of feature vectors into a 224-dimensional fused feature vector, and then maps the dimension to 128 dimensions through a fully connected layer. The ReLU function is used as the activation function to avoid the gradient vanishing problem. The attention mechanism layer is used to strengthen the weights of features related to drug contraindications, dosage abnormalities, drug incompatibilities, duplicate medication, and inconsistencies in indications. It employs a multi-head attention mechanism with eight attention heads, each with 16 dimensions. The similarity between the fused feature vector and the query vectors for the five risk categories is calculated to obtain the attention weight matrix. This weight matrix is then multiplied with the fused feature vector using weighted summation to obtain the strengthened feature vector, highlighting the role of key risk features. The multi-classification inference layer outputs preliminary identification results for various medication risks. It uses a fully connected network structure with three hidden layers: 256 neurons in the first layer, 128 in the second, and 64 in the third, all using the ReLU activation function. The output layer has five neurons, corresponding to the five medication risk categories, and uses the Softmax activation function. It outputs the probability value of each risk category; a probability value greater than 0.5 indicates the presence of that risk category, otherwise, it indicates the absence of that risk category. During the training of the deep learning network, the cross-entropy loss function is used to calculate the loss value. The Adam optimizer is used. The learning rate is initially set to 0.001, and it decays to 0.9 every 10 epochs. The number of training iterations is 100 epochs, and the batch size is set to 32. The early stopping mechanism is used to avoid model overfitting and ensure the generalization performance of the model.
[0043] Traditional technical solutions have the following technical problems: existing technologies cannot quantitatively assess the individualized medication risks of patients, but can only make qualitative judgments, resulting in a lack of accuracy in risk assessment, an inability to distinguish the risk levels of different patients, and a lack of clear calculation logic and parameter determination methods for risk assessment, which affects the reliability and reproducibility of assessment results.
[0044] Based on this, the patient individualized characteristic modeling module calculates the baseline patient medication risk value using the patient medication risk baseline scoring formula, which is as follows:
[0045] ;
[0046] The above formula is the basic scoring formula for patient medication risk, where This represents the baseline risk level for a patient's medication use, ranging from 0 to 10 points. A higher score indicates a higher baseline risk level for the patient's medication use. This represents the physiological characteristic risk coefficient, ranging from 0 to 2 points. It is calculated as a weighted sum of the encoded values of each feature in the physiological characteristic dimension vector, with weights of 0.3 for age, 0.1 for gender, 0.2 for BMI level, and 0.4 for the level of abnormality in liver and kidney function indicators. For example, if a patient's age is coded as 3, gender as 1, BMI level as 2, and the level of abnormality in liver and kidney function indicators as 1, then... point. This represents the risk coefficient for pathological characteristics, ranging from 0 to 3 points. It is calculated by summing the risk weights of the primary diagnosis and complications, then multiplying by the disease severity grading coefficient. The risk weight for the primary diagnosis is determined based on the disease type, such as 0.8 for hypertension, 0.9 for diabetes, and 0.7 for pneumonia. The risk weight for complications is the number of complications multiplied by 0.3. The disease severity grading coefficient is 1.0 for mild, 1.5 for moderate, and 2.0 for severe. For example, if a patient's primary diagnosis is diabetes (weight 0.9), with one complication (weight 0.3) and a disease severity of moderate (coefficient 1.5), then... point. The risk coefficient for allergy characteristics ranges from 0 to 3 points. 0 points represents no allergy record and no adverse reactions, 1 point represents allergy record but no adverse reactions, 1 point represents no allergy record but mild adverse reactions, 2 points represents allergy record and mild adverse reactions, and 3 points represents moderate or severe adverse reactions. The historical adverse drug reaction risk coefficient is represented by a value ranging from 0 to 2 points. No adverse reaction is 0 points, one mild adverse reaction is 0.5 points, two mild adverse reactions or one moderate adverse reaction is 1 point, and three or more mild adverse reactions, two or more moderate adverse reactions or one or more severe adverse reactions are 2 points. , , , These are the weighting coefficients of each characteristic risk coefficient, and The weight coefficients were obtained through logistic regression training based on 100,000 historical prescription data points. The specific training process involved using the presence or absence of adverse drug reactions in historical prescriptions as a label, and... , , , Using the characteristic variables, a logistic regression model is constructed, and the model parameters are solved using the maximum likelihood estimation method. , , , The combination of weighting coefficients has been validated on the validation set, and the model prediction accuracy has reached over 92%, ensuring the reliability of the formula calculation results.
[0047] , , , The training data covers 20 institutions; , The training data covers 50,000 time-series prescriptions with medication conflicts from 15 medical institutions; The training data covers 80,000 compliant verification prescriptions from 18 institutions;
[0048] In the above embodiment, the training data is defined as 100,000 valid historical prescriptions covering 20 medical institutions of different levels, including 10 tertiary hospitals, 6 secondary hospitals, and 4 retail pharmacies. The data includes different age groups, disease types, and medication scenarios. The training logic steps are as follows:
[0049] The classification label is based on whether adverse drug reactions occurred with historical prescriptions: occurrence = 1, no occurrence = 0.
[0050] by , , , For the characteristic variables, perform data standardization;
[0051] A logistic regression model was constructed, and the weight coefficients were solved using the maximum likelihood estimation method. The parameters were then optimized using 5-fold cross-validation.
[0052] The evaluation metrics for model training are defined as AUC ≥ 0.9 and accuracy ≥ 92% to ensure the reliability of training results.
[0053] Traditional technical solutions have the following technical problems: When assessing medication risks, existing technologies do not fully consider the timing of drug use, ignore the impact of dosing intervals and frequency on medication safety, and do not clearly define the quantitative calculation logic for timing risks, resulting in the inability to effectively identify time-related medication risks and affecting the comprehensiveness of medication risk assessment.
[0054] Based on this, the deep learning fusion inference module calculates the risk of medication timing conflicts using the formula for the timing medication conflict warning coefficient. The formula for the timing medication conflict warning coefficient is as follows:
[0055] ;
[0056] The above formula is the formula for the early warning coefficient of time-series medication conflict, where This represents the early warning coefficient for time-series medication conflicts, with a value ranging from 0 to 20. The larger the coefficient, the higher the risk of time-series medication conflicts. The baseline risk score for patient medication use ranges from 0 to 10 and is calculated using the patient medication risk baseline score formula. This indicates the number of different types of drugs in the prescription, and its value is a positive integer. For example, if the prescription contains 3 types of drugs, then... . Indicates the first The drug and the first The dosing interval for a drug, measured in hours, is calculated based on the frequency and timing of administration in the prescription. For example, if drug 1 is taken twice daily at 8:00 and 20:00, and drug 2 is taken three times daily at 6:00, 14:00, and 22:00, then the minimum dosing interval, i.e., the interval between 8:00 and 6:00, is 2 hours. .
[0057] This indicates the maximum safe dosing interval for this type of drug combination, measured in hours, and determined based on pharmacopoeia standards and clinical medication guidelines. Drug combinations are classified into eight major categories according to their mechanism of action, including anti-infectives, cardiovascular drugs, and digestive system drugs. Each major category is further subdivided into subcategories; for example, the cardiovascular category includes antihypertensive drugs and lipid-lowering drugs. Based on drug category, combinations of drugs of the same class are adjusted according to their mechanism of action and synergistic effect—synergistic drugs. 80% of the normal interval, antagonistic drugs This is 120% of the normal interval. For example, a combination of antibiotics and antihypertensive drugs... Hours; a combination of two antihypertensive drugs, Hours; antibiotics and synergistic combinations of antibiotics, Hour. Indicates the first The drug and the first The time conflict weight of each drug is determined according to the conflict grading criteria in the guidelines for drug interactions, with a value ranging from 0 to 1. No time conflict is 0, mild time conflict is 0.3, moderate time conflict is 0.7, and severe time conflict is 1.0. For example, the time conflict weight of warfarin and aspirin is 0.9. This represents the combined value of time interval conflicts for all drug combinations, ranging from 0 to... . This indicates the actual frequency of medication use in a prescription, measured in times per day. For example, a certain medication may be taken four times daily. . This indicates the upper limit of the safe frequency of medication for that drug, measured in times per day. It directly refers to the maximum range of approved frequency of medication as stated in the drug's instructions. For example, the upper limit of the safe frequency of amoxicillin is 4 times per day. . This represents the drug use frequency exceeding the limit coefficient, with a value range of 0 to 2. When the actual drug use frequency does not exceed the safety limit, the coefficient is less than or equal to 1; when it exceeds the limit, the coefficient is greater than 1. These are the weighting coefficients for medication interval conflict and medication frequency conflict, respectively. It was trained using 50,000 historical prescriptions containing time-series medication conflicts. , This weighting can balance the impact of medication interval and medication frequency on time-series risk.
[0058] The sufficiency of sample size is determined by the formula verify, , , The calculated minimum sample size was 9604 entries, and the actual sample sizes all met and exceeded the minimum sample size by more than five times. The formula's logical derivation is based on the core assumption that the higher the patient's baseline risk, the more pronounced the risk amplification effect caused by time-series factors. By multiplying the baseline risk value by the comprehensive value of time-series conflicts, individualized time-series risk assessment is achieved. Testing showed that this formula achieved an accuracy rate of over 89% in identifying time-series medication conflicts; among which... For the safe maximum dosing interval, please refer to the corresponding drug combination chapter and relevant regulations in the 2020 edition of the Pharmacopoeia of the People's Republic of China on Clinical Drug Use.
[0059] Traditional technical solutions have the following technical problems: the compliance verification of existing technologies is mostly based on single-dimensional rule matching, which is not effectively combined with the results of deep learning inference and the results of time-series conflict risk assessment. The verification standards are fixed and lack quantitative indicators, resulting in insufficient accuracy and comprehensiveness of the verification results, and failing to provide reliable quantitative basis for prescription risk judgment.
[0060] Based on this, the dynamic compliance verification module calculates the final medication risk of the prescription using the dynamic compliance verification final risk value formula, which is:
[0061] ;
[0062] The above formula is the final risk value formula for dynamic compliance verification, where This represents the final risk score of the prescription, ranging from 0 to 100. A higher score indicates a higher risk of prescription medication. This represents the early warning coefficient for time-series drug use conflicts, with a value ranging from 0 to 20, and is calculated using the formula for the early warning coefficient of time-series drug use conflicts. This represents the confidence coefficient of the deep learning inference result, ranging from 0.8 to 1.0. It is determined based on the historical inference accuracy of the deep learning model in this type of prescription; the higher the inference accuracy, the closer the coefficient is to 1.0. For example, if the model's inference accuracy for prescriptions for hypertensive patients is 95%, then... . This represents the standard risk coefficient in the dynamic compliance database, ranging from 1.0 to 3.0. It is determined based on the risk level of the drug combination in the prescription, with 1.0 for low-risk combinations, 2.0 for medium-risk combinations, and 3.0 for high-risk combinations. The risk level is based on the pharmacopoeia standards and clinical drug use guidelines. This represents the risk value of combining temporal conflicts with deep learning inference, ranging from 0 to 60 points. This represents the compliance verification weight coefficient, ranging from 0.5 to 1.0, and is determined through training with historical data. . This indicates the number of risk types for compliance verification, with a value of 5, corresponding to five risk categories: drug contraindications, dosage abnormalities, drug incompatibilities, duplicate medication, and inconsistencies with indications. Indicates the first The verification result value for risk categories is 0 for compliance and 1 for non-compliance. This is obtained by precisely matching prescription information with rules in the dynamic compliance database. For example, if the drug dosage in a prescription exceeds the safe dosage range, the corresponding dosage abnormality value will be... .
[0063] The risk characteristic determination rules are as follows: Drug contraindications: If the prescription drug does not match the patient's disease / allergy history according to the database contraindication rules, it is determined that the drug does not meet the requirements. Dosage abnormality: Actual dose > 120% of the upper limit of safe dose or < 80% of the lower limit of safe dose is considered non-compliant; Drug incompatibility: Drug combination matching the incompatibility list in the database is considered non-compliant; Duplicate medication: Prescribing drugs with the same generic name or drugs with completely identical pharmacological effects at the same time is considered non-compliant; Inappropriate indication: Drug indications that do not include the patient's primary diagnosis or complication are considered non-compliant; Quantitative calculation method for feature correlation: Pearson correlation coefficient is used to calculate the correlation between different risk features. The threshold is set as |r| ≥ 0.7 for strong correlation, 0.3 ≤ |r| < 0.7 for moderate correlation, and |r| < 0.3 for weak correlation; Strongly correlated features are merged for verification, moderately correlated features are independently verified and then weighted and fused, and weakly correlated features are verified separately.
[0064] Indicates the first The severity weight of each risk category ranges from 1 to 10, with drug contraindications at 10, drug incompatibilities at 9, duplicate medication at 8, dosage abnormalities at 7, and inconsistencies with indications at 6. This weight is determined based on the degree of impact of the risk on medication safety and has been approved by clinical experts. This represents the comprehensive risk score for compliance verification, ranging from 0 to 40 points. The formula's logical derivation is based on the core idea that "the final risk of a prescription is a comprehensive reflection of the risks of temporal conflict, deep learning inference, and compliance rule matching." It achieves the quantitative integration of multi-dimensional risks through weighted summation. Testing has shown that the final risk value calculated by this formula is more than 91% consistent with the clinical expert assessment results, providing a reliable quantitative basis for prescription risk judgment.
[0065] Quantitative evaluation indicators: , , , The corresponding logistic regression model evaluation metrics are AUC=0.93, precision=92.5%, and recall=91.8%. , The corresponding evaluation metrics for the training model are AUC=0.91, precision=89.2%, and recall=88.7%. The corresponding evaluation metrics for the training model are AUC=0.92, precision=90.5%, and recall=89.9%.
[0066] The classification criteria are as follows: Low-risk drug combinations: no clear interactions, high safety profile in clinical use. Refer to the list of low-risk drug combinations in the "Guidelines for Rational Drug Use in Clinical Practice"; medium-risk drug combinations: those with minor interactions that can be avoided by adjusting medication. Please refer to the risk combination list in the above guidelines; high-risk drug combinations: These combinations may have serious interactions that could lead to severe adverse reactions. Refer to the high-risk combination list in the guidelines; all classifications must be marked with the specific clause number of the referenced standard to ensure standard consistency.
[0067] Traditional technical solutions have the following technical problems: the inspection results and early warning information output by existing technologies are too brief, lack detailed explanations of risk points and targeted rectification suggestions, the output format is uniform and cannot meet the needs of different users, resulting in low efficiency of manual review and a lack of clear guidance on the rectification of abnormal prescriptions.
[0068] Based on this, the inspection report generated by the results output module includes basic prescription information, medication risk identification results, compliance verification results, detailed descriptions of risk points, and risk warning information including risk level, risk type, and rectification suggestions. The risk level is divided into three levels: low risk, medium risk, and high risk based on the final risk value of the dynamic compliance verification.
[0069] The clinical pilot program was conducted for six months in three tertiary hospitals, a general hospital, a specialized hospital, a traditional Chinese medicine hospital, two secondary hospitals, and two retail pharmacies, with a total of 50,000 prescriptions verified.
[0070] The clinical significance of the threshold is supported by:
[0071] Low risk (0-30 points): The incidence of adverse reactions to prescriptions in this range was 0.3% in the pilot program, which is not significantly different from the incidence rate after routine manual review, and can be passed directly;
[0072] Medium risk (31-60 points): The incidence of adverse reactions was 8.7%, which decreased to 1.2% after manual review and adjustment.
[0073] High risk (61-100 points): The incidence of adverse reactions was 32.5%, which was reduced to 1.5% after immediate intervention and adjustment by the doctor;
[0074] The threshold determination method is as follows: based on pilot data, ROC curve analysis is used, and the value corresponding to the maximum point of Youden's index is taken as the grading threshold to ensure clinical applicability.
[0075] Basic prescription information includes prescription number, patient name, gender, age, department, prescribing physician, and date of prescription. All information is consistent with the collected prescription data to ensure the uniqueness of the prescription. Medication risk identification results include preliminary identification results of five categories of medication risks output by the deep learning fusion inference module, clearly indicating the type of risk and its corresponding probability value. Compliance verification results include the final risk value output by the dynamic compliance verification module and the verification results of various compliance risks, clearly indicating the type of risk that does not comply with regulations. Detailed risk point descriptions: For each identified risk point, a detailed explanation of the cause of the risk is provided. For example, for drug contraindication risks, the specific drug, disease, or other drug is explained, along with the cited pharmacopoeia standard or clinical practice reference clause number, and the individual patient characteristics involved; for dosage abnormality risks, the actual dosage, safe dosage range, and the impact of patient physiological characteristics on the dosage are explained. Risk level classification thresholds are: low risk (0-30 points), medium risk (31-60 points), and high risk (61-100 points). Different risk levels correspond to different processing priorities: high-risk prescriptions must be immediately intercepted, medium-risk prescriptions require manual review before processing, and low-risk prescriptions can be directly approved. The risk types clearly label all identified risk categories, facilitating staff classification and handling. Rectification suggestions provide specific and actionable adjustment plans for each risk point. For example, for drug contraindication risks, it is recommended to replace with a certain type of alternative drug, providing at least three compliant alternative drug names; for dosage abnormality risks, it is recommended to adjust to a specific safe dosage value, explaining the basis for the dosage adjustment; for drug incompatibility risks, it is recommended to adjust the medication order or replace one of the drugs; for duplicate medication risks, it is recommended to discontinue one of the duplicate drugs; for incompatible indication risks, it is recommended to replace with a specific drug for the diagnosis. The results output module supports exporting examination reports in PDF, Excel, and Word formats. It also supports sending risk warning information via system pop-ups, SMS, and APP push notifications. Pharmacy staff can view detailed examination reports through the management terminal, doctors can receive risk warning information and adjust prescriptions through the workstation, and patients can view medication risk warnings and precautions through mobile devices.
[0076] Traditional technical solutions have the following technical problems: the existing prescription automatic examination method has an imperfect process, the logical connection between each link is not tight, there is a lack of standardized implementation steps and clear execution entities, and the specific operations of data processing and model reasoning are unclear, resulting in insufficient operability and stability of the method, making it difficult to effectively implement in practical applications.
[0077] Based on this, a method for automatically checking prescriptions in smart pharmacies that integrates deep learning includes the following steps:
[0078] S1. Multi-dimensional Prescription Data Collection: The server connects to the hospital's HIS system, electronic prescription system, and patient health record system through a standardized data interface to extract basic patient information, medication information, diagnostic information, and patient medication history from prescriptions in real time. For paper prescriptions, pharmacy staff use high-definition scanning equipment to convert them into electronic images, which are then uploaded to the server. The server uses an OCR text recognition engine to extract text from the electronic images and then performs structured parsing using a natural language processing model, converting the extracted information into a standardized data format. Basic patient information includes age, gender, weight, liver and kidney function indicators, allergy history, and medication information packages. The data includes drug name, dosage form, dosage, frequency of use, and duration of treatment. Diagnostic information includes the name of the primary diagnosed disease, the name of the complication, and the severity level of the disease. The patient's historical medication records include a list of drugs used in the past 12 months, the duration of use, and records of adverse drug reactions. All collected data is stored in a distributed database to ensure data security and accessibility. The S1 input feature dimensions include: a 64-dimensional feature vector for medication information (16 dimensions for drug name, 8 dimensions for dosage form, 12 dimensions for dosage, 10 dimensions for frequency of use, and 18 dimensions for duration of treatment); and a 128-dimensional feature vector for diagnostic information (32 dimensions for primary diagnosed disease, 64 dimensions for complications, and 32 dimensions for disease severity level).
[0079] S2. Patient Individualized Feature Modeling: The data processing server calls a feature extraction algorithm to extract features from the patient's basic information and historical medication records collected in S1. First, numerical data is normalized using Z-score standardization to transform it into standard data with a mean of 0 and a standard deviation of 1. Categorical data is encoded using One-Hot encoding or label encoding to convert it into numerical features. Textual data is word-embedded to transform it into a low-dimensional dense vector. Then, physiological feature dimensions, pathological feature dimensions, medication history feature dimensions, and allergy feature dimensions are constructed. The correlation between features is analyzed using Pearson correlation coefficient to remove redundant features. Principal component analysis is then used to reduce the feature dimensions. Finally, the patient's medication risk baseline value is calculated using the patient medication risk baseline scoring formula. The feature model and risk baseline value are stored in the feature database. The output feature dimensions of S2 are: 32-dimensional patient individualized feature vector, 8-dimensional physiological feature dimension, 10-dimensional pathological feature dimension, 8-dimensional medication history feature dimension, and 6-dimensional allergy feature dimension.
[0080] S3. Deep Learning Fusion Inference: The AI inference server calls the trained deep learning network, inputting the medication information and diagnostic information collected in S1 and the patient-specific feature model constructed in S2 into the network. The medication information and diagnostic information are converted into feature vectors after feature encoding, and are input into the feature fusion layer along with the patient-specific feature vector. The feature fusion layer generates a fused feature vector by combining concatenation fusion and weighted fusion. The attention mechanism layer strengthens the weight of key risk features through a multi-head attention mechanism. The multi-classification inference layer outputs the probability values of various medication risks through a fully connected network. If the probability value is greater than 0.5, it is determined that such a risk exists, generating a preliminary identification result and storing it in the inference result database.
[0081] The feature fusion layer first concatenates the 32-dimensional individualized feature vector, the 64-dimensional medication information feature vector, and the 128-dimensional diagnostic information feature vector into a 224-dimensional vector. Then, it performs dimension mapping through a fully connected layer (224-dimensional input, 128-dimensional output). The activation function is ReLU to ensure that the mapped feature dimensions are completely matched with the input dimensions (128-dimensional) of the attention mechanism layer.
[0082] S4. Time-series medication conflict calculation: The AI inference server calls the time-series conflict calculation algorithm. Based on the patient medication risk baseline value obtained in S2, it calculates the time-series medication conflict warning coefficient of the drugs in the prescription through the time-series medication conflict warning coefficient formula. First, it extracts the medication frequency and medication time arrangement of each drug in the prescription, calculates the medication interval of the drug combination, queries the dynamic compliance database to obtain the safe maximum medication interval and time-series conflict weight of the drug combination, queries the drug instructions to obtain the upper limit of safe medication frequency, substitutes them into the formula to calculate the time-series medication conflict warning coefficient, and stores it in the time-series conflict result database.
[0083] S5. Dynamic Compliance Verification: The compliance verification server calls the verification algorithm to build a dynamic compliance database containing pharmacopoeia standards and clinical medication guidelines. It is regularly updated monthly using web crawling technology to retrieve the latest standards and guidelines, synchronizing with the latest standards issued by the National Medical Products Administration and the National Health Commission. Updates are triggered immediately when new national medication guidelines are issued, pharmacopoeias are revised, or authoritative institutions issue updated medication guidelines. Combining the time-series medication conflict warning coefficient obtained in S4, the final medication risk value of the prescription is calculated using the dynamic compliance verification final risk value formula. First, the prescription information is precisely matched against the rules in the database. The system obtains the verification results of various compliance risks, queries the risk severity weights, calculates the comprehensive compliance verification risk value, and then combines the time-series drug use conflict warning coefficient, the credibility coefficient of deep learning inference results, and the standard risk coefficient. The final risk value is calculated by substituting these factors into the formula. The preliminary identification results output by S3 are then verified a second time to generate compliance verification results and store them in the verification result database. Conflict handling follows these principles: the basic principle of following local regulations and complying with national regulations; if local regulations have special provisions for specific diseases or regional populations, they must be jointly reviewed by 3 or more clinical pharmacy experts. After the review is passed, the regulations can be included in the database, and the scope of application of the local regulations and the review opinions are marked.
[0084] S6. Result Output: The application server calls the result generation algorithm to generate an inspection report and risk warning information based on the final medication risk value and secondary verification results obtained in S5. The inspection report includes basic prescription information, medication risk identification results, compliance verification results, and detailed descriptions of risk points. The risk warning information includes risk level, risk type, and rectification suggestions. The application server pushes the inspection report to the pharmacy management terminal and doctor's workstation via the network, and pushes the risk warning information to the patient's mobile terminal via SMS and APP. It supports manual review and abnormal prescription interception operations, and stores all results in the result database to form a complete data closed loop.
[0085] Traditional technical solutions have the following technical problems: existing technologies do not clearly define the training process and standards for deep learning networks, training data lacks standardized processing, network structure parameters are set irrationally, and model evaluation indicators are singular, resulting in unstable network model performance, inability to effectively guarantee inference accuracy, and affecting the reliability of the entire prescription examination system.
[0086] Based on this, the training process of the deep learning network in S3 includes the following steps: First, 100,000 historical prescription data and corresponding medication risk labeling results are collected. The historical prescription data includes basic patient information, medication information, diagnostic information, and historical medication records. The data comes from multiple tertiary hospitals, secondary hospitals, and retail pharmacies, covering different age groups, different disease types, and different medication scenarios. The medication risk labeling results are labeled by more than three clinical pharmacists according to pharmacopoeia standards, clinical medication guidelines, and actual medication situations. The labeling content includes five types of risks: drug contraindications, dosage abnormalities, drug incompatibilities, duplicate medication, and inconsistencies with indications. When the labeling results are inconsistent, the final labeling is determined through expert review. Then, the historical prescription data is preprocessed. Data cleaning uses an outlier detection algorithm to identify and remove outlier data. The outlier judgment standard is data that deviates from the mean by 3 times the standard deviation. Missing value imputation uses the mean imputation method to fill missing values in numerical data and the mode imputation method to fill missing values in categorical data. Feature standardization uses the Z-score standardization method to transform all feature data into standard data with a mean of 0 and a standard deviation of 1, ensuring data consistency and comparability. Next, the preprocessed data is divided into training, validation, and test sets in a 7:2:1 ratio. The training set is used for model parameter learning, the validation set is used for hyperparameter tuning, and the test set is used to evaluate the model's generalization performance. Then, a deep learning network is constructed, including a feature fusion layer, an attention mechanism layer, and a multi-class inference layer. The feature fusion layer has a 128-dimensional output vector, the attention mechanism layer has 8 attention heads, each with a 16-dimensional dimension, and the multi-class inference layer has 3 hidden layers with 256, 128, and 64 neurons respectively, all using the ReLU activation function. The output layer has 5 neurons, using the Softmax activation function. The network was trained using a training set, with the cross-entropy loss function used to calculate the loss value. The Adam optimizer was employed, with an initial learning rate of 0.001, which decreased to 0.9 every 10 epochs. The batch size was set to 32, and the training iterations lasted for 100 epochs. During training, the model performance was evaluated using a validation set every epoch, employing four metrics: accuracy, precision, recall, and F1 score. An early stopping mechanism was triggered when the validation set accuracy failed to improve for five consecutive epochs to prevent overfitting. Finally, the network performance was validated using a test set, calculating accuracy, precision, recall, and F1 score until the network's risk identification accuracy reached over 90%, precision over 88%, recall over 89%, and F1 score over 88%. The trained model was stored in a model database, and incremental training was performed periodically using newly added historical data to continuously optimize model performance.
[0087] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. An intelligent pharmacy prescription automatic inspection system integrating deep learning, comprising a prescription multi-dimensional data acquisition module, a patient individualized feature modeling module, a deep learning fusion inference module, a dynamic compliance verification module, and a result output module, characterized in that: The prescription multi-dimensional data acquisition module is used to obtain basic patient information, medication information, diagnostic information, and patient history medication records from the prescription; the patient individualized feature modeling module is used to extract and model features from the collected basic patient information and history medication records. The deep learning fusion inference module receives medication information and diagnostic information from the prescription multi-dimensional data acquisition module and the feature model output from the patient individualized feature modeling module. Based on the trained deep learning network, it performs preliminary identification of medication risks. The dynamic compliance verification module combines pharmacopoeia standards and clinical medication guidelines to build a dynamic compliance database and performs secondary verification on the preliminary identification results output by the deep learning fusion inference module. The result output module receives the final verification results output by the dynamic compliance verification module and generates inspection reports and risk warning information.
2. The intelligent pharmacy prescription automatic inspection system integrating deep learning according to claim 1, characterized in that: The prescription multi-dimensional data collection module collects basic patient information including age, gender, weight, liver and kidney function indicators, allergy history, medication information including drug name, dosage form, dosage, frequency of use, and course of treatment, diagnostic information including the name of the primary diagnosis, the name of the complication, and the severity level of the disease, and the patient's historical medication records including a list of drugs used in the past 12 months, duration of use, and records of adverse drug reactions.
3. The intelligent pharmacy prescription automatic inspection system integrating deep learning according to claim 1, characterized in that: The features extracted by the patient individualized feature modeling module include physiological feature dimension, pathological feature dimension, medication history feature dimension, and allergy feature dimension. Among them, the physiological feature dimension is constructed based on age, gender, weight, and liver and kidney function indicators; the pathological feature dimension is constructed based on the primary diagnosis, complications, and disease severity classification; the medication history feature dimension is constructed based on the types of medications used in the past, the frequency of medication, and the course of medication; and the allergy feature dimension is constructed based on the history of allergies and the records of adverse drug reactions in the past.
4. The intelligent pharmacy prescription automatic inspection system integrating deep learning according to claim 1, characterized in that: The deep learning fusion reasoning module uses a deep learning network that includes a feature fusion layer, an attention mechanism layer, and a multi-classification reasoning layer. The feature fusion layer is used to fuse medication information features, diagnostic information features, and individualized patient features. The attention mechanism layer is used to strengthen the weights of features related to drug contraindications, dosage abnormalities, drug incompatibilities, duplicate medication, and inconsistencies with indications. The multi-classification reasoning layer is used to output preliminary identification results of various medication risks.
5. The intelligent pharmacy prescription automatic inspection system integrating deep learning according to claim 1, characterized in that: The patient individualized characteristic modeling module calculates the baseline patient medication risk value using the patient medication risk baseline scoring formula, which is as follows: ; The above formula is the basic scoring formula for patient medication risk, where This represents the baseline risk level for patient medication use. Indicates the risk coefficient of physiological characteristics. Indicates the risk coefficient of pathological characteristics. Indicates the risk coefficient of allergy characteristics. This indicates the risk coefficient of adverse drug reactions in historical medication use. , , , These are the weighting coefficients of each characteristic risk coefficient, and Each weight coefficient is obtained by training a logistic regression algorithm based on historical prescription data.
6. The intelligent pharmacy prescription automatic inspection system integrating deep learning according to claim 5, characterized in that: The deep learning fusion inference module calculates the risk of medication timing conflicts using a formula for a medication timing conflict warning coefficient. The formula for the medication timing conflict warning coefficient is as follows: ;; The above formula is the formula for the early warning coefficient of time-series medication conflict, where This indicates the early warning coefficient for time-series medication conflicts. This indicates the types and quantities of drugs in the prescription. Indicates the first The drug and the first The dosing interval for this type of drug. This indicates the maximum safe dosing interval for this type of drug combination. Indicates the first The drug and the first Temporal conflict weights for drugs This indicates the actual frequency of medication use in the prescription. This indicates the upper limit of the safe frequency of medication use for this drug. , These are the weighting coefficients for medication interval conflict and medication frequency conflict, respectively. .
7. The intelligent pharmacy prescription automatic inspection system integrating deep learning according to claim 6, characterized in that: The dynamic compliance verification module calculates the final medication risk of a prescription using the dynamic compliance verification final risk value formula. The dynamic compliance verification final risk value formula is as follows: ; The above formula is the final risk value formula for dynamic compliance verification, where This indicates the risk value of the final prescription. This represents the credibility coefficient of the deep learning inference result. This represents the standard risk coefficient in the dynamic compliance database. Indicates the number of risk types for compliance verification. Indicates the first The verification result value for risk categories is 0 if they conform to the standard, and 1 if they do not conform to the standard. Indicates the first The severity weight of risk class, This represents the compliance verification weight coefficient.
8. The intelligent pharmacy prescription automatic inspection system integrating deep learning according to claim 1, characterized in that: The inspection report generated by the results output module includes basic prescription information, medication risk identification results, compliance verification results, detailed descriptions of risk points, and risk warning information including risk level, risk type, and rectification suggestions. The risk level is divided into three levels: low risk, medium risk, and high risk based on the final risk value of the dynamic compliance verification.
9. A method for automatically checking prescriptions in intelligent pharmacies by integrating deep learning, characterized in that, Includes the following steps: S1. Prescription Multi-Dimensional Data Collection: Acquire patient basic information, medication information, diagnostic information, and patient historical medication records from prescriptions through data collection devices; S2. Patient Individualized Feature Modeling: Feature extraction is performed on the basic patient information and historical medication records collected in S1 to construct physiological feature dimensions, pathological feature dimensions, medication history feature dimensions, and allergy feature dimensions. The patient medication risk baseline value is calculated using the patient medication risk baseline scoring formula. S3. Deep Learning Fusion Inference: Input the medication information and diagnostic information collected in S1 and the patient individualized feature model constructed in S2 into the trained deep learning network; S4. Calculation of time-series medication conflict: Based on the baseline value of patient medication risk obtained in S2, the time-series medication conflict warning coefficient of the prescription drugs is calculated using the formula for the time-series medication conflict warning coefficient. S5. Dynamic Compliance Verification: Construct a dynamic compliance database that includes pharmacopoeia standards and clinical medication guidelines. Combine the time-series medication conflict warning coefficient obtained in S4, calculate the final medication risk value of the prescription through the final risk value formula of dynamic compliance verification, and perform secondary verification on the preliminary identification results output by S3. S6. Output Results: Based on the final medication risk value and secondary verification results obtained in S5, generate an inspection report that includes basic prescription information, medication risk identification results, compliance verification results, detailed descriptions of risk points, and risk warning information that includes risk level, risk type, and rectification suggestions. It supports manual review and abnormal prescription interception.
10. The method for automatic prescription checking in intelligent pharmacies by incorporating deep learning according to claim 9, characterized in that: The training process of the deep learning network in S3 includes the following steps: collecting historical prescription data and corresponding medication risk labeling results. Historical prescription data includes patient basic information, medication information, diagnostic information, and historical medication records. Medication risk labeling results include labels for drug contraindications, dosage abnormalities, drug incompatibilities, duplicate medication, and inconsistencies with indications. The historical prescription data is preprocessed, including data cleaning, missing value imputation, and feature standardization. The preprocessed data is divided into training set, validation set, and test set in a 7:2:1 ratio. A deep learning network containing a feature fusion layer, an attention mechanism layer, and a multi-classification inference layer is constructed. The network is trained using the training set, the network hyperparameters are adjusted using the validation set, and the network performance is verified using the test set until the network's risk identification accuracy reaches a preset threshold.