Hospital medicine traceability management method and system based on block chain

Through the blockchain-based drug traceability management method, the problems of inaccurate quantity verification and insufficient security in traditional drug traceability management are solved, and the precise management of drug quantity and the security of the drug dispensing process are achieved, ensuring that drugs are used within the validity period and enhancing the immutability of data.

CN120612103AInactive Publication Date: 2025-09-09THE SECOND HOSPITAL OF SHANDONG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510780990.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-09-09
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In traditional hospital drug traceability management, drug quantity verification relies on manual comparison and lacks automation and strict equipment comparison, resulting in inaccurate inventory management, unsafe drug dispensing, lax management of expired drugs, and the risk of relying on traditional databases for information storage.

Method used

A blockchain-based drug traceability management method is adopted to scan the invoices of incoming drugs to identify attribute information, calculate the actual quantity, and compare it with the HIS system; detect unauthorized devices and abnormal scanning behaviors, dynamically adjust the expiration date of drugs, perform field verification and signature comparison, to ensure the accuracy of drug quantities, safety of drug distribution and non-tampering of information.

Benefits of technology

It improves the accuracy of drug quantity, ensures the compliance and safety of drug dispensing, reduces overdue drug dispensing, enhances the intelligence and transparency of drug management, and uses blockchain technology to ensure that data cannot be tampered with.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120612103A_ABST
    Figure CN120612103A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of informatization medical treatment, in particular to a hospital medicine traceability management method and system based on a block chain, and the method comprises the following steps: scanning medicine invoices, converting the number of packages, verifying a code scanning device and a serial number, comparing time cross records, detecting timeliness abnormality, and verifying the field specification consistency of a medicine dispensing behavior. And in combination with signature comparison and repeated identification of the code scanning behavior, acquiring write-in repeated identification information. According to the method, the accuracy of the number of the medicines is improved by adopting a supply quantity verification mechanism, inventory errors and dispensing errors are avoided, code scanning behavior monitoring and sequence consistency retrieval are combined, the compliance and safety of medicine dispensing are enhanced, the medicines are ensured to be used within the validity period through validity period duration prediction and use period comparison, and the efficiency of medicine dispensing is improved. The problem of overtime medicine distribution is reduced, uniqueness of medicine information and non-tampering of data evidence are ensured by using a block chain technology, and intelligence, transparency and reliability of hospital medicine management are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information-based medical technology, and in particular to a hospital drug traceability management method and system based on blockchain. Background Art

[0002] The field of information-based medical technology involves the deep integration of the medical industry and information science, and is committed to improving the quality and efficiency of medical services through information technology. The core content of this technology field includes the construction of hospital information systems, data standardization processing, digital management of medical business processes, and the interconnection and secure sharing of medical data. In the direction of drug management, information-based medical care establishes a drug management platform to achieve system linkage and data tracking in drug procurement, warehousing, inventory, prescription, and dispensing. Through barcode recognition, database docking, interface calls, etc., it breaks through the data barriers between the hospital's internal pharmacy, finance, information and other department systems and external medical insurance, drug supervision, and supplier platforms, realizing the full-process collection, management and use of drug circulation information, and supporting the construction of a refined and intelligent drug management system in the hospital.

[0003] Among them, the blockchain-based hospital drug traceability management method refers to a management method that collects data on key nodes in the hospital drug circulation and use process in units of drug traceability codes and writes them into the blockchain system. The method covers multiple technical matters such as drug code scanning for warehousing, drug dispensing, drug return, automatic identification and uploading of invoice information, drug and prescription matching verification, drug batch number and expiration date records, drug catalog and traceability code mapping, and upstream pharmaceutical company traceability information comparison. The specific methods include collecting drug traceability code information through a ring scanner or a code scanning dock, establishing a mapping relationship between the drug information in the invoice and accompanying document and the drug catalog of the hospital HIS system, using an intermediate conversion module to convert the quantity of the packaging unit and automatically generate a warehousing document, receiving the prescription information pushed by the HIS at the drug dispensing window and verifying whether the drug and prescription information are consistent through the interface scan code, uploading the traceability code to the medical insurance interface and establishing a mapping relationship with the medical insurance settlement information, and realizing the item-by-item uploading and evidence storage of information to the supervision platform through the program interface.

[0004] In traditional hospital drug traceability management technology, the drug quantity verification link relies on traditional manual comparison and system matching, and fails to fully utilize the conversion relationship between supply units and packaging units, resulting in inaccurate and incorrect inventory management. When there is a deviation between supplier delivery and inventory demand, it causes inconsistency in drug quantity, affecting the accuracy of drug dispensing. In the verification of code scanning behavior, there is a lack of strict sequential consistency check for the comparison of equipment, personnel and scanned code serial numbers, resulting in unauthorized equipment or operating behaviors not being discovered in time, affecting the safety and compliance of the drug dispensing process, failing to effectively monitor the timeliness of drug use, and the expiration management of drugs is relatively loose. There is a lack of automated warning functions, which leads to the use or circulation of expired drugs. In terms of information storage, it relies on traditional database storage and fails to fully utilize the tamper-proof characteristics of blockchain. There are certain risks in the storage and verification of drug data. Summary of the Invention

[0005] In order to solve the technical problems existing in the prior art, the present invention provides a blockchain-based hospital drug traceability management method and system. The technical solution is as follows:

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a blockchain-based hospital drug traceability management method, comprising the following steps:

[0007] S1: Scan incoming drug invoices, identify drug attribute information, identify conversion parameters between multiple packaging levels, calculate the actual quantity corresponding to the supply quantity in the invoice, and compare it with the demand quantity in the HIS system to detect abnormal drug quantities and obtain supply quantity verification records;

[0008] S2: Call the supply verification record, obtain the device code, personnel number, and scanning sequence number from the storage and dispensing scanning records, combine biometric information comparison and behavior analysis to detect unauthorized devices and abnormal scanning behavior, and perform sequential consistency search on the serial numbers of consecutive scanning records, and output the scanning behavior verification record;

[0009] S3: Extract the code scanning behavior verification records, use the drug storage conditions, drug type, and batch information to dynamically adjust the drug's expiration date, extract the drug dispensing code scanning behavior data, detect expired drugs, combine the quantity and type of drugs dispensed, detect abnormal drug dispensing behavior, and output usage time detection information;

[0010] S4: Based on the usage time detection information, multiple fields of the data of each drug dispensing behavior are called, and each field is checked for non-emptiness, field format rules, and mapping relationships between fields, and a traceability field verification record is output.

[0011] As a further solution of the present invention, the supply quantity verification record includes drug type information, demand quantity comparison results, and actual packaging quantity. The scanning behavior verification record specifically includes device code comparison results, personnel number verification information, and scanning serial number sequence consistency analysis results. The usage time detection information specifically includes drug entry time, prescription generation time, and usage cycle comparison results. The traceability field verification record includes field non-empty verification results, field format rule verification results, and field mapping relationship verification results.

[0012] As a further solution of the present invention, the steps of scanning incoming drug invoices, identifying drug attribute information, identifying conversion parameters between multiple packaging levels, calculating the actual quantity corresponding to the supply quantity in the invoice, and comparing it with the demand quantity in the HIS system to detect abnormal drug quantities and obtain supply quantity verification records are as follows:

[0013] S101: Scan the incoming drug invoice, identify the drug attribute information, obtain the drug type name, supplier name and corresponding quantity information, identify the conversion parameters between multiple packaging levels, calculate the actual packaging quantity corresponding to the supply quantity, and generate the packaging quantity conversion value;

[0014] S102: Based on the package quantity conversion value, extract the purchase requisition record of the corresponding drug in the HIS system, obtain the required quantity field and the drug type field, compare the package quantity conversion value with the HIS required quantity, identify and mark inconsistent drug items, and generate a demand comparison record;

[0015] S103: According to the demand comparison record, extract the drug name, converted quantity and demand quantity fields in the deviation record, call the supply source information field in the inventory record, establish a deviation list, record the supply record and quantity field content of the abnormal drug, and obtain the supply quantity verification record.

[0016] As a further solution of the present invention, the supply quantity verification record is called to obtain the device code, personnel number and scanning sequence number in the storage and dispensing scanning records. Unauthorized devices and abnormal scanning behaviors are detected by combining biometric information comparison and behavior analysis. Sequential consistency search is performed on the serial numbers of consecutive scanning records. The steps of outputting the scanning behavior verification record are as follows:

[0017] S201: Call the supply verification record to obtain the device code, personnel number, and scan sequence number in the storage and dispensing scan records, and compare them with the device code and personnel number in the current scan record field set to detect unauthorized devices and scan behaviors, and generate an authority comparison record;

[0018] S202: Based on the permission comparison record, using a biometric device to obtain the operator's biometric information, including fingerprint information and facial information, and extract information such as scanning speed, scanning time interval, and scanning frequency, calculate the abnormality score of the scanning behavior in real time, detect abnormal scanning behavior, and generate a behavior analysis result;

[0019] S203: Based on the behavior analysis results, extract the scanning sequence numbers in the continuous scanning records, perform sequential consistency retrieval, detect sequence number jumps and repetitions, verify the legitimacy of each scanning record, and generate a scanning behavior verification record.

[0020] As a further solution of the present invention, the specific formula for calculating the abnormality score of the scanning behavior in real time is:

[0021] ;

[0022] Calculate the abnormality score of the scanning behavior;

[0023] in, Representative The difference between the biometric information of the first scan and the reference biometric template, A biometric standard template representing this type of operator, Representative Real-time scanning speed of the code, Represents the operator's standard scanning speed, Representative The time interval between the current scan and the previous scan. represents the reference time, Representative The scanning frequency of the scanning behavior, Refers to the frequency of code scanning. is the abnormal score of the current scanning behavior, The index of the code scanning behavior.

[0024] As a further solution of the present invention, the steps of extracting the code scanning behavior verification record, dynamically adjusting the validity period of the drug using the drug storage conditions, drug type, and batch information, extracting the drug dispensing code scanning behavior data, detecting drugs that have exceeded their validity period, and detecting abnormal drug dispensing behavior based on the quantity and type of drugs dispensed, and outputting the usage time detection information are specifically as follows:

[0025] S301: Extract the code scanning behavior verification record, extract the storage timestamps of multiple drugs, and identify the storage conditions, drug types and batch information of the drugs, dynamically predict and adjust the expiration date of the drugs, and generate an expiration date adjustment record;

[0026] The specific formula for dynamically predicting and adjusting the validity period of a drug is:

[0027] ;

[0028] Calculate the validity period adjustment value;

[0029] in, Represents the adjustment value of the drug's validity period, Represents the initial validity period of the drug. The normalized value representing the difference between the storage temperature and the recommended storage temperature of the drug, Represents the weight coefficient of storage temperature deviation, A normalized value representing the stability differences between batches, represents the weight coefficient of batch stability deviation, represents the normalized value of the variation rate of drug types, The weight coefficient representing the variation rate of drug type;

[0030] S302: Based on the validity period adjustment record, the medication dispensing scanning behavior data is retrieved to predict the time sequence of the user's medication use, and the time sequence is compared with the validity period to obtain a time deviation value;

[0031] S303: Based on the time deviation value, detect expired medicines in real time, mark abnormal medicine dispensing behavior based on the quantity and type of medicines dispensed, and output usage time detection information.

[0032] As a further solution of the present invention, based on the usage time detection information, multiple fields of the data of each drug dispensing behavior are called, each field is checked for non-emptiness, field format rules, and mapping relationships between fields, and the steps of outputting the traceability field verification record are specifically as follows:

[0033] S401: Based on the usage time detection information, the traceability code, drug code, drug dispensing time, patient ID, prescription number, and medical insurance settlement number in each drug dispensing scan record are obtained to generate a field extraction set;

[0034] S402: Based on the field extraction set, perform non-empty check and field format rule check on each field to obtain a field validity check result;

[0035] S403: Analyze the mapping relationship between each field according to the field validity check result, and perform field mapping relationship check according to the logical relationship between the fields to generate a traceability field check record.

[0036] As a further embodiment of the present invention, the method further comprises:

[0037] S5: Verify the record based on the traceability field, and use the prescription number, traceability code, dispensing time, patient ID, device code, and pharmacist number fields in the scanned data to obtain the field combination signature. By comparing the signature with the signature set in the stored blockchain record, duplicate signatures are detected and marked, and duplicate identification information is output and written;

[0038] The written duplicate identification information specifically refers to the prescription number signature comparison result, the traceability code signature comparison result, and the duplicate signature marking information of the dispensing behavior.

[0039] As a further solution of the present invention, based on the traceability field verification record, the prescription number, traceability code, dispensing time, patient ID, device code, and pharmacist number fields in the scanned code data are used to obtain the field combination signature. By comparing the signature with the signature set in the stored blockchain record, duplicate signatures are detected and marked, and the steps of outputting and writing duplicate identification information are specifically as follows:

[0040] S501: Based on the traceability field verification record, obtain the prescription number, traceability code, dispensing time, patient ID, device code and pharmacist number in each scan data, establish a field combination signature, and generate a field signature combination;

[0041] S502: Compare the signature set in the stored blockchain record based on the field signature combination, perform duplication verification based on the timestamp and storage time fields, and generate a duplicate signature detection record;

[0042] S503: According to the duplicate signature detection record, mark the duplicate signature and extract the corresponding blockchain evidence record and duplicate identifier, and output and write duplicate identification information.

[0043] On the other hand, a hospital drug traceability management system based on blockchain is provided, which is applied to a hospital drug traceability management method based on blockchain, and the system includes:

[0044] The supply comparison module scans incoming drug invoices, identifies conversion parameters between multiple packaging levels, calculates the actual packaging quantity corresponding to the drug supply quantity on the invoice, extracts drug type information, and compares it with the drug demand quantity data in the hospital's HIS system to identify drug quantity discrepancies, detect abnormal supply situations, and generate supply quantity verification records;

[0045] Based on the supply quantity verification record, the authority review module extracts the device code, personnel number, and scan sequence number from the drug storage and dispensing scan records. Combined with biometric information comparison and behavior analysis, it detects unauthorized device participation and abnormal scanning behavior, and performs sequential consistency verification on the scan sequence numbers in the continuous scan records to obtain the scan behavior verification record;

[0046] The expiration tracking module dynamically adjusts the expiration date of drugs based on the scan code verification records, using drug storage conditions, drug type, and batch information. It extracts drug dispensing scan code behavior data to detect expired drugs. It also detects abnormal drug dispensing behavior based on the quantity and type of drugs dispensed and generates usage expiration detection information.

[0047] Based on the usage time detection information, the field verification module extracts the traceability code, drug code, dispensing time, patient ID, prescription number, and medical insurance settlement number in each drug dispensing data, performs non-empty verification, field format verification, and field mapping relationship verification, and generates a traceability field verification record;

[0048] The signature verification module verifies the records based on the traceability fields, extracts the prescription number, traceability code, dispensing time, patient ID, device code and pharmacist number fields in the scanned code data of each medication dispensing, constructs a field combination signature, and compares it with the signature set stored in the blockchain, identifies duplicate signatures and marks them, and obtains and writes duplicate identification information.

[0049] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0050] The supply quantity verification mechanism improves the accuracy of drug quantities, avoids inventory errors and drug dispensing errors, and combines code scanning behavior monitoring with sequence consistency retrieval to enhance the compliance and safety of drug dispensing. Through validity period prediction and usage cycle comparison, it ensures that drugs are used within the validity period, reducing the problem of overdue drug dispensing. The use of blockchain technology ensures the uniqueness of drug information and the non-tamperability of data storage, thereby enhancing the intelligence, transparency and reliability of hospital drug management. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0052] Figure 1 It is a schematic diagram of the workflow of the present invention;

[0053] Figure 2 It is a system flow chart of the present invention. DETAILED DESCRIPTION

[0054] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0055] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as an "exemplary" in the present invention should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner. Furthermore, in the embodiments of the present invention, "and / or" can mean both or either of the two.

[0056] In the embodiments of the present invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, when the distinction is not emphasized, the meanings they convey are the same. The terms "of," "corresponding," and "corresponding" may sometimes be used interchangeably. It should be noted that, when the distinction is not emphasized, the meanings they convey are the same.

[0057] In the embodiments of the present invention, sometimes a subscript such as W1 may be written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are the same.

[0058] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0059] See also Figure 1 The present invention provides a technical solution, a hospital drug traceability management method based on blockchain, comprising the following steps:

[0060] S1: Scan incoming drug invoices, identify drug attribute information, identify conversion parameters between multiple packaging levels, calculate the actual quantity corresponding to the supply quantity in the invoice, and compare it with the demand quantity in the HIS system to detect abnormal drug quantities and obtain supply quantity verification records;

[0061] S2: Call the supply verification record to obtain the device code, personnel number, and scan sequence number from the inventory and dispensing scan records. Combined with biometric information comparison and behavioral analysis, it detects unauthorized devices and abnormal scanning behavior, performs sequential consistency search on the serial numbers of consecutive scan records, and outputs the scan behavior verification record.

[0062] S3: Extracts code scanning behavior verification records and uses drug storage conditions, drug type, and batch information to dynamically adjust the drug's expiration date. It also extracts drug dispensing code scanning behavior data to detect expired drugs. Based on the quantity and type of drugs dispensed, it detects abnormal drug dispensing behavior and outputs usage time detection information.

[0063] S4: Based on the usage time detection information, multiple fields of the data of each drug dispensing behavior are called, and each field is checked for non-emptiness, field format rules, and mapping relationships, and a traceability field verification record is output;

[0064] S5: Verify the record based on the traceability field, and use the prescription number, traceability code, dispensing time, patient ID, device code, and pharmacist number fields in the scanned data to obtain the field combination signature. By comparing the signature with the signature set in the stored blockchain record, duplicate signatures are detected and marked, and duplicate identification information is output and written.

[0065] The supply quantity verification record includes information on drug types, demand quantity comparison results, and actual packaging quantity. The scanning behavior verification record specifically includes equipment code comparison results, personnel number verification information, and scanning serial number sequence consistency analysis results. The usage time detection information specifically includes drug entry time, prescription generation time, and usage cycle comparison results. The traceability field verification record includes field non-empty verification results, field format rule inspection results, and field mapping relationship verification results. The writing of duplicate identification information specifically refers to the prescription number signature comparison results, traceability code signature comparison results, and drug dispensing behavior duplicate signature marking information.

[0066] The steps for scanning incoming drug invoices, identifying drug attribute information, identifying conversion parameters between multiple packaging levels, calculating the actual quantity corresponding to the supply quantity in the invoice, and comparing it with the demand quantity in the HIS system to detect abnormal drug quantities and obtain supply quantity verification records are as follows:

[0067] S101: Scan the incoming drug invoice, identify the drug attribute information, obtain the drug type name, supplier name and corresponding quantity information, identify the conversion parameters between multiple packaging levels, calculate the actual packaging quantity corresponding to the supply quantity, and generate the packaging quantity conversion value;

[0068] Scan incoming drug invoices to extract the drug type, supplier name, and corresponding quantity information. The drug type is identified using the product description and drug code on the invoice. The supply unit (e.g., "box," "bottle," or "pack") is extracted and the corresponding supply quantity is recorded. In practice, let's assume the invoice lists amoxicillin capsules for 200 bottles, each containing 20 capsules. The system then parses the invoice to identify the drug name and quantity. Next, it identifies conversion parameters between various packaging levels. For example, the conversion relationship between 20 capsules per bottle and 500 capsules per box means each box is equivalent to 25 bottles. This converts the invoice supply quantity (200 bottles) into an actual quantity of 10 boxes. The system then calculates the actual packaging quantity based on this conversion relationship and generates a converted packaging quantity value. For example, 200 bottles of drug yield 10 boxes based on the conversion parameters. This converted packaging quantity serves as the basis for subsequent inspection steps and is crucial for ensuring drug quantity accuracy and avoiding errors.

[0069] S102: Based on the package quantity conversion value, extract the purchase requisition record of the corresponding drug in the HIS system, obtain the required quantity field and the drug type field, compare the package quantity conversion value with the HIS required quantity, identify and mark inconsistent drug items, and generate a demand comparison record;

[0070] Based on the package quantity conversion value, the system extracts drug purchase requisition records from the HIS system, obtains the required quantity field and drug type field, and performs a numerical comparison between the package quantity conversion value and the HIS required quantity. The system compares the package quantity conversion value with the required quantity in the HIS system using a pre-defined numerical comparison formula to determine whether the two are consistent. For example, if the system records a demand of 10 boxes, but the actual supply of 9 boxes is 9, the system will detect a quantity discrepancy that exceeds the system's allowable error range. In this way, the system can automatically mark drug items with inconsistent quantities, ensuring a precise match between drug supply and demand. Next, a demand comparison record is generated, recording the difference between the drug name, actual supply quantity, and required quantity. These comparison records are critical data in drug management, helping companies identify potential problems in the supply chain and ensure the accuracy and timeliness of drug supply.

[0071] S103: Extract the drug name, converted quantity, and required quantity fields from the deviation record based on the demand comparison record, call the supply source information field from the incoming record, create a deviation list, record the supply record and quantity field content of the abnormal drug, and obtain the supply quantity verification record;

[0072] Based on the generated demand comparison records, the system extracts the drug name, converted quantity, and demand quantity fields from the deviation records. It also references the supply source information fields (such as supplier name and supply batch information) from the incoming records to create a deviation list, documenting the supply records and quantity fields for the abnormal drugs. In practice, if insufficient supply of a particular drug is detected, the system automatically references the supplier name and supply batch information from the incoming records, using the drug name and converted quantity fields. This creates a deviation list detailing the supply status of amoxicillin capsules from supplier XX Pharmaceutical Company, as well as the discrepancies between actual supply and demand. These detailed records enable companies to identify potential supply chain issues and make rapid adjustments to ensure the stability and accuracy of their ongoing drug supply. Ultimately, the resulting supply verification records will aid companies in further quality control and supply chain management, ensuring the efficient distribution and use of drugs.

[0073] Call the supply verification record to obtain the device code, personnel number, and scan sequence number from the inventory and drug dispensing scan records. Combined with biometric information comparison and behavior analysis, detect unauthorized devices and abnormal scanning behavior, and perform sequential consistency search on the serial numbers of consecutive scan records. The specific steps for outputting the scan behavior verification record are as follows:

[0074] S201: Call the supply verification record to obtain the device code, personnel number, and scan sequence number in the inventory and dispensing scan records, and compare them with the device code and personnel number in the current scan record field set to detect unauthorized devices and scan behaviors, and generate an authority comparison record;

[0075] The supply verification record is called to retrieve the device code, personnel number, and scan sequence number from the incoming and outgoing drug scan records. By comparing the device code and personnel number in the field set of the current scan record, the device authorization is confirmed. In a real-world scenario, for example, in a hospital's drug management system, a pharmacy is equipped with multiple devices, such as scanners and computer terminals. Each device has a unique device code, and each pharmacist is assigned a unique personnel number. When drugs are received or dispensed, the system generates a record containing the device code, personnel number, and scan sequence number. For example, suppose the device code is "DEV12345," the personnel number is "USER001," and the scan sequence number is "SEQ001." The system compares the currently scanned device code and personnel number with the authorized device and personnel information in the permission configuration table to ensure the legitimacy and security of the scan operation. If the device or personnel is unauthorized or inconsistent with the record, it is marked as an unauthorized device or abnormal scan behavior. This process ensures the legitimacy of each scan operation through rigorous comparison and testing. Finally, the system generates permission comparison records based on this information for subsequent auditing and problem tracking.

[0076] S202: Based on the permission comparison record, the biometric identification device is used to obtain the operator's biometric information, including fingerprint information and facial information, and extract the scanning speed, scanning time interval, and scanning frequency information. The abnormality score of the scanning behavior is calculated in real time, abnormal scanning behavior is detected, and behavioral analysis results are generated;

[0077] The specific formula for calculating the abnormality score of code scanning behavior in real time is:

[0078] ;

[0079] Calculate the abnormality score of the scanning behavior;

[0080] in, Representative The difference between the biometric information of the first scan and the reference biometric template, A biometric standard template representing this type of operator, Representative Real-time scanning speed of the code, Represents the operator's standard scanning speed, Representative The time interval between the current scan and the previous scan. represents the reference time, Representative The scanning frequency of the scanning behavior, Refers to the frequency of code scanning. is the abnormal score of the current scanning behavior, The index of the code scanning behavior.

[0081] formula:

[0082] ;

[0083] Detailed explanation of the formula and the process of formula calculation and derivation:

[0084] The formula is used to calculate the abnormality score of the scanning behavior. The result This value measures the deviation between a scan and normal operation. It helps identify abnormal scanning behavior, especially during medication dispensing. By calculating the scan anomaly score in real time, this value can be used for real-time monitoring.

[0085] Parameter meaning and setting value:

[0086] : Indicates the biometric difference score of the current code scanning operation. The score reflects the deviation between the operator's biometric information and the system preset template. , indicating that the difference score between the current scanning operator’s biometrics and the standard template is 12%;

[0087] : Indicates the standard biometric template score of this type of operator, set , indicating that the standard template completely matches the self-template;

[0088] : The current scanning speed of the code scanning operation. The scanning speed indicates the rate at which the operator scans the code. The unit is times / second. Times / second: indicates that the operator's current scanning rate is 1.5 times / second;

[0089] : The operator's standard scanning speed, set Times / second, indicating that the standard scanning speed is 1 time / second;

[0090] : The time interval between the current scan and the previous scan, set Seconds means the time difference between the current scan and the last scan is 0.8 seconds;

[0091] : Reference time, usually represents the average time interval of normal scanning operation. Seconds, indicating that the reference time interval is 1 second;

[0092] : Current scanning frequency, which means the number of times the code is scanned per unit time. , indicating that the operator has scanned the code 3 times in the current unit time;

[0093] :Refer to the scanning frequency, indicating the standard operation frequency, setting , indicating that the standard scanning frequency is 2 times;

[0094] Substitute the parameters into the formula for calculation:

[0095] ;

[0096] ;

[0097] ;

[0098] ;

[0099] ;

[0100] ;

[0101] ;

[0102] ;

[0103] This result indicates , that is, the abnormality score of the current scanning behavior is 0.053. This means that the current scanning operation has a slight deviation from the standard operation behavior. Specifically, the higher the abnormality score, the greater the abnormality of the scanning behavior. The current value indicates that the scanning operation is close to normal operation. In actual applications, the abnormality score Used to assist in determining whether the scanning operation is as expected. If the score exceeds the predetermined threshold, it indicates that there may be problems with the operator's scanning behavior and further monitoring or intervention is required.

[0104] S203: Based on the behavior analysis results, extract the scan sequence numbers from the continuous scan records, perform sequence consistency search, detect sequence number jumps and duplications, verify the legitimacy of each scan record, and generate a scan behavior verification record;

[0105] Based on the behavioral analysis results, the scan sequence numbers in consecutive scan records are extracted and searched for sequence consistency to detect any sequence number jumps or duplications. For example, if the scan sequence numbers in consecutive scan records are "SEQ001" to "SEQ004," the system will flag any sequence number jumps (e.g., scanning "SEQ006" but missing "SEQ005") as abnormal. Furthermore, duplicate scan sequence numbers (e.g., scanning "SEQ003" twice) will also be considered abnormal behavior. The system verifies the sequence number of each scan record to ensure the order and uniqueness of the scan operations. This allows the system to accurately identify abnormal operations such as repeated scans and skipped scans, further enhancing security and data accuracy during the drug dispensing process. Finally, the system generates a scan behavior verification record for subsequent review and reporting.

[0106] Extract code scanning behavior verification records, use drug storage conditions, drug type, and batch information to dynamically adjust the drug's expiration date, extract drug dispensing code scanning behavior data, detect expired drugs, and detect abnormal drug dispensing behavior based on the quantity and type of drugs dispensed. The specific steps for outputting usage time detection information are as follows:

[0107] S301: Extract the code scanning behavior verification record, extract the storage timestamps of multiple drugs, and identify the drug storage conditions, drug type and batch information, dynamically predict and adjust the drug's expiration date, and generate an expiration date adjustment record;

[0108] The specific formula for dynamically predicting and adjusting the validity period of a drug is:

[0109] ;

[0110] Calculate the validity period adjustment value;

[0111] in, Represents the adjustment value of the drug's validity period, Represents the initial validity period of the drug. The normalized value representing the difference between the storage temperature and the recommended storage temperature of the drug, Represents the weight coefficient of storage temperature deviation, A normalized value representing the stability differences between batches, represents the weight coefficient of batch stability deviation, represents the normalized value of the variation rate of drug types, The weight coefficient representing the variation rate of drug type;

[0112] formula:

[0113] ;

[0114] Detailed explanation of the formula and the process of formula calculation and derivation:

[0115] This formula is used to calculate the expiration date adjustment value of a drug. It dynamically adjusts the expiration date of a drug by taking into account the impact of storage temperature deviation, batch stability differences, and drug type variation on the expiration date of the drug.

[0116] Parameter meaning and setting value:

[0117] : The initial expiration date of the drug is set to 365 days, which means that the drug is valid for one year under standard storage conditions;

[0118] : The normalized value of the difference between the storage temperature and the recommended storage temperature of the drug is set to 0.05, indicating that the difference between the actual storage temperature and the recommended storage temperature accounts for 5% of the recommended storage temperature;

[0119] : Weight coefficient for storage temperature deviation. Based on the sensitivity of drugs to temperature changes, it is set to 0.8, indicating that the storage temperature has an 80% impact on the drug's shelf life;

[0120] : The normalized value of batch stability difference is set to 0.02, indicating that the stability difference between batches accounts for 2% of the standard stability;

[0121] : Weight coefficient of batch stability deviation. Based on the impact of batch stability on the shelf life of the drug, it is set to 0.1, indicating that the impact of batch stability on the shelf life of the drug accounts for 10%;

[0122] : The normalized value of the drug type variation rate is set to 0.03, indicating that the difference in variation rate between drug types accounts for 3% of the standard variation rate;

[0123] : The weight coefficient of drug type variation rate is set to 0.1, which means that the influence of drug type variation rate on drug shelf life is 10%;

[0124] Substitute the parameters into the formula for calculation:

[0125] ;

[0126] ;

[0127] ;

[0128] ;

[0129] The result 364.955 days indicates that the shelf life of the drug under the current storage conditions is 364.955 days, which is 0.045 days shorter than the initially set shelf life.

[0130] S302: Based on the expiration date adjustment record, the medication dispensing scanning behavior data is retrieved to predict the time sequence of the user's medication use, and the time sequence is compared with the expiration date to obtain a time deviation value;

[0131] Based on expiration date adjustment records, the system retrieves prescription information such as prescription date and drug type from medication dispensing scan data to predict the time series of drug use. For example, suppose the system extracts a prescription for amoxicillin capsules from the dispensing record, with a prescription date of May 1, 2023, for an oral medication. Based on the patient's treatment cycle, the system predicts the patient's likely medication use time series. The system calculates a 30-day usage cycle for the patient, with the medication taken every two days. Based on this predicted time series, the system compares the drug's actual remaining expiration date with the predicted use time series. If the drug's actual remaining expiration date is less than the predicted use time series, meaning the remaining expiration date doesn't cover the patient's medication cycle, the system calculates a time deviation: Time deviation = predicted use time - remaining expiration date. If the time deviation is negative, the drug will expire before the patient needs it. In this case, the drug is marked as expired and a corresponding time deviation record is generated.

[0132] S303: Based on the time deviation value, detect expired drugs in real time, mark abnormal drug dispensing behavior based on the quantity and type of drugs dispensed, and output usage time detection information;

[0133] Based on the time deviation value, the system detects in real time whether medications have exceeded their expiration dates. It also performs anomaly detection on each medication dispensing record, taking into account the quantity and type of medication dispensed. For example, if the system discovers a batch of medication with five boxes dispensed but insufficient remaining expiration date to cover the entire medication cycle, the system will detect the medication as expired based on the time deviation value (for example, -5 days). Combined with the number of medications dispensed, the system automatically marks this dispensing record as an anomaly and outputs usage aging detection information. The system not only flags expired medications but also logs this data for subsequent review and traceability. Through this process, the medication management system can promptly detect and prevent the dispensing of expired medications, ensuring patient medication safety. The resulting usage aging detection information includes detailed information such as the drug name, batch information, time deviation value, and quantity dispensed, supporting medication management and review.

[0134] Based on the usage time detection information, multiple fields of each drug dispensing behavior data are called, and each field is checked for non-emptiness, field format rules, and mapping relationships. The specific steps for outputting the traceability field verification record are as follows:

[0135] S401: Based on the usage time detection information, the traceability code, drug code, dispensing time, patient ID, prescription number, and medical insurance settlement number in each drug dispensing scan record are obtained to generate a field extraction set;

[0136] Extract scan code verification records and extract the drug's traceability code, drug code, dispensing date, patient ID, prescription number, and medical insurance settlement number from each record. These fields are then combined into a field extraction set. For example, during a drug dispensing process, suppose the system reads the following scanned dispensing data: traceability code: AMX12345, drug code: A123, dispensing date: August 1, 2023, patient ID: P001, prescription number: RX1001, and medical insurance settlement number: M12345. These data items are combined into a field extraction set, providing essential field data for subsequent verification. This data not only helps trace the source of the drug but also provides a foundation for subsequent verification. For example, by comparing the drug code with fields such as the prescription number and medical insurance settlement number, the legitimacy of each dispensing record can be ensured. The resulting field extraction set provides the data foundation for subsequent validity verification, ensuring transparency and compliance in the drug dispensing and settlement processes.

[0137] S402: Based on the field extraction set, perform non-empty check and field format rule check on each field to obtain the field validity check result;

[0138] Based on the field extraction set, each field is checked for nullity and formatting rules. First, the system verifies that each field contains a value, confirming whether fields such as the traceability code, drug code, dispensing time, patient ID, prescription number, and medical insurance settlement number contain a value. If a field is empty, it is flagged as abnormal data. For example, if the dispensing time in a record is empty, the system automatically marks the record as invalid and rejects further processing. Next, the system verifies the formatting rules for each field. For example, the dispensing time must conform to the "YYYY-MM-DD" format, and the medical insurance settlement number must conform to the specified numbering rules. Suppose the system requires that medical insurance settlement numbers must begin with the letter "M" and be followed by five digits. If a record in the data contains a medical insurance settlement number such as "M12345," the formatting rule check is passed. However, if a record contains "X12345" or another format, it is flagged as a formatting error and rejected for further processing. This process ensures that all fields meet formatting and data integrity requirements, preventing system errors caused by formatting irregularities.

[0139] S403: Analyze the mapping relationship between each field based on the field validity check result, and perform field mapping relationship verification based on the logical relationship between the fields to generate a traceability field verification record;

[0140] Based on the field validity check results, the mapping relationship between each field is analyzed and verified based on the logical relationships between the fields. For example, the traceability code must correspond to the drug code, the patient ID and prescription number must have a one-to-one mapping in the system, and the medical insurance settlement number and patient ID must correspond to a specific settlement record. If the traceability code and drug code in a record do not match, the system will automatically mark it as an anomaly. For example, during a medication dispensing process, the system discovers that traceability code AMX12345 corresponds to drug A123, but no corresponding record for this drug is found in the system. This record will be marked as an anomaly and cannot be processed further. Another example is that if the patient ID and prescription number do not find a valid match in the system, the system will mark the record as invalid and prompt the operator to check the data accuracy. By verifying the mapping relationship between fields, the system ensures the consistency and accuracy of each field throughout the entire medication dispensing process, avoiding issues caused by data inconsistencies or incorrect mappings, and generating a final traceability field verification record.

[0141] Verify the record based on the traceability field, use the prescription number, traceability code, dispensing time, patient ID, device code, and pharmacist number fields in the scanned data to obtain the field combination signature. By comparing the signature with the signature set in the stored blockchain record, duplicate signatures are detected and marked. The specific steps for outputting and writing duplicate identification information are as follows:

[0142] S501: Based on the traceability field verification record, obtain the prescription number, traceability code, dispensing time, patient ID, device code and pharmacist number in each scan data, establish a field combination signature, and generate a field signature combination;

[0143] Based on the traceability field verification record, the system extracts the prescription number, traceability code, dispensing time, patient ID, device code, and pharmacist number from each dispensing scan record and combines these fields into a field signature combination. For example, for a dispensing scan record in the system, the following data items are recorded: Prescription Number: RX123456, Traceability Code: AMX12345, Dispensing Time: August 1, 2023, 14:30:00, Patient ID: P001, Device Code: DEV12345, Pharmacist Number: USER001. These data items are extracted and combined into a set of field signatures to ensure the uniqueness and traceability of each dispensing record. For example, the system uses the traceability code and prescription number combined with the dispensing time to uniquely identify a dispensing action, generating a comprehensive field signature that serves as the basis for subsequent comparison and verification. This field signature combination provides the foundational data for subsequent duplication verification, ensuring that every dispensing record can be uniquely identified and verified on the blockchain.

[0144] S502: Compare the signature set in the stored blockchain record based on the field signature combination, and perform duplication verification based on the timestamp and storage time fields to generate a duplicate signature detection record;

[0145] Based on the field signature combination, the system compares the signature set in the existing blockchain record and performs a duplicate check based on the timestamp and storage time fields. First, the system extracts all medication dispensing records stored on the blockchain and obtains the field signature combination for each record. Suppose there is already a signature combination on the blockchain with "AMX12345_RX123456_2023-08-01 14:30:00," and the signature of the new medication dispensing record is "AMX12345_RX123456_2023-08-01 14:30:01." The system compares the timestamp and storage time fields to check for duplicate records. If two records have the same field signature and the timestamps differ by only milliseconds, the system considers them to be duplicate dispensing records. This comparison method can promptly detect duplicate records and generate a duplicate signature detection record. For example, in practice, if the system discovers two medication dispensing records that occurred at approximately the same time but refer to the same prescription, it will mark one of them as a duplicate to avoid unnecessary duplication of operations.

[0146] S503: Based on the duplicate signature detection record, mark the duplicate signature and extract the corresponding blockchain evidence record and duplicate identifier, and output and write the duplicate identification information;

[0147] Based on duplicate signature detection records, duplicate signatures are flagged and the corresponding blockchain-stored records and duplicate identifiers are extracted. For example, if during the comparison process, the system identifies duplicate signatures, such as "AMX12345_RX123456_2023-08-01 14:30:00" and "AMX12345_RX123456_2023-08-01 14:30:01," the similarity is too high. The system will deem these records duplicates and assign them a tag ID based on the duplicate identifier. The system will then automatically extract the duplicate records' evidence from the blockchain, including detailed information such as their blockchain ID, date of creation, and drug type, for further review and processing. Records marked as duplicates are frozen, preventing further on-chain operations until further verification, either manually or by the system, is resumed. By comparing and extracting the evidence records, the system ensures data uniqueness and prevents the misprocessing of duplicate dispensing records.

[0148] See also Figure 2 The hospital drug traceability management system based on blockchain is used to implement the above-mentioned hospital drug traceability management method based on blockchain. The system includes:

[0149] The supply comparison module scans incoming drug invoices, identifies conversion parameters between multiple packaging levels, calculates the actual packaging quantity corresponding to the drug supply quantity on the invoice, extracts drug type information, and compares it with the drug demand quantity data in the hospital's HIS system to identify drug quantity discrepancies, detect abnormal supply situations, and generate supply quantity verification records;

[0150] The permission review module extracts the device code, personnel number, and scan sequence number from the drug storage and dispensing scan records based on supply verification records. Combining biometric information comparison and behavioral analysis, it detects unauthorized device participation and abnormal scanning behavior. It also performs sequential consistency verification on the scan sequence numbers in the continuous scan records to obtain scan behavior verification records.

[0151] The expiration tracking module dynamically adjusts the expiration date of medications based on scan code verification records, utilizing drug storage conditions, drug type, and batch information. It also extracts scan code dispensing behavior data to detect expired medications. Furthermore, it detects abnormal dispensing behavior based on the quantity and type of medication dispensed, generating usage expiration date detection information.

[0152] The field verification module extracts fields such as the traceability code, drug code, dispensing time, patient ID, prescription number, and medical insurance settlement number from each dispensing data based on the usage time detection information. It then performs non-empty verification, field format verification, and field mapping relationship verification to generate traceability field verification records.

[0153] The signature verification module verifies the records based on the traceability fields, extracts the prescription number, traceability code, dispensing time, patient ID, device code and pharmacist number fields from the scanned code data of each medication dispensing, constructs a field combination signature, and compares it with the signature set stored in the blockchain, identifies duplicate signatures and marks them, and obtains and writes duplicate identification information.

[0154] The above embodiments can be implemented in whole or in part via software, hardware (e.g., circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. When loaded or executed on a computer, the processes or functions described in accordance with the embodiments of the present invention are fully or partially performed. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired means (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media. The semiconductor media can be a solid-state drive.

[0155] It should be understood that the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. A and B can be singular or plural. Furthermore, the character " / " as used herein generally indicates an "or" relationship between the associated objects, but it may also indicate an "and / or" relationship. For specific understanding, please refer to the context.

[0156] In this disclosure, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, "at least one of a, b, or c" can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.

[0157] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0158] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0159] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0160] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of the device or unit, which can be electrical, mechanical or other forms.

[0161] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0162] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0163] If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or the portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media that can store program code, such as USB flash drives, mobile hard drives, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical disks.

[0164] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A hospital drug traceability management method based on blockchain, characterized in that: The method comprises: S1: Scan incoming drug invoices, identify drug attribute information, identify conversion parameters between multiple packaging levels, calculate the actual quantity corresponding to the supply quantity in the invoice, and compare it with the demand quantity in the HIS system to detect abnormal drug quantities and obtain supply quantity verification records; S2: Call the supply verification record, obtain the device code, personnel number, and scanning sequence number from the storage and dispensing scanning records, combine biometric information comparison and behavior analysis to detect unauthorized devices and abnormal scanning behavior, and perform sequential consistency search on the serial numbers of consecutive scanning records, and output the scanning behavior verification record; S3: Extract the code scanning behavior verification records, use the drug storage conditions, drug type, and batch information to dynamically adjust the drug's expiration date, extract the drug dispensing code scanning behavior data, detect expired drugs, combine the quantity and type of drugs dispensed, detect abnormal drug dispensing behavior, and output usage time detection information; S4: Based on the usage time detection information, multiple fields of the data of each drug dispensing behavior are called, and each field is checked for non-emptiness, field format rules, and mapping relationships between fields, and a traceability field verification record is output.

2. The hospital drug traceability management method based on blockchain according to claim 1 is characterized in that: The supply quantity verification record includes drug type information, demand quantity comparison results, and actual packaging quantity. The scanning behavior verification record specifically includes device code comparison results, personnel number verification information, and scanning serial number sequence consistency analysis results. The usage time detection information specifically includes drug entry time, prescription generation time, and usage cycle comparison results. The traceability field verification record includes field non-empty verification results, field format rule inspection results, and field mapping relationship verification results.

3. The hospital drug traceability management method based on blockchain according to claim 1 is characterized in that: The steps for scanning incoming drug invoices, identifying drug attribute information, identifying conversion parameters between multiple packaging levels, calculating the actual quantity corresponding to the supply quantity in the invoice, and comparing it with the demand quantity in the HIS system to detect abnormal drug quantities and obtain supply quantity verification records are as follows: S101: Scan the incoming drug invoice, identify the drug attribute information, obtain the drug type name, supplier name and corresponding quantity information, identify the conversion parameters between multiple packaging levels, calculate the actual packaging quantity corresponding to the supply quantity, and generate the packaging quantity conversion value; S102: Based on the package quantity conversion value, extract the purchase requisition record of the corresponding drug in the HIS system, obtain the required quantity field and the drug type field, compare the package quantity conversion value with the HIS required quantity, identify and mark inconsistent drug items, and generate a demand comparison record; S103: According to the demand comparison record, extract the drug name, converted quantity and demand quantity fields in the deviation record, call the supply source information field in the inventory record, establish a deviation list, record the supply record and quantity field content of the abnormal drug, and obtain the supply quantity verification record.

4. The hospital drug traceability management method based on blockchain according to claim 3 is characterized in that: The supply verification record is called to obtain the device code, personnel number, and scanning sequence number from the storage and dispensing scanning records. Unauthorized devices and abnormal scanning behaviors are detected by combining biometric information comparison and behavioral analysis. Sequential consistency search is performed on the serial numbers of consecutive scanning records. The specific steps for outputting the scanning behavior verification record are as follows: S201: Call the supply verification record to obtain the device code, personnel number, and scan sequence number in the storage and dispensing scan records, and compare them with the device code and personnel number in the current scan record field set to detect unauthorized devices and scan behaviors, and generate an authority comparison record; S202: Based on the permission comparison record, using a biometric device to obtain the operator's biometric information, including fingerprint information and facial information, and extract information such as scanning speed, scanning time interval, and scanning frequency, calculate the abnormality score of the scanning behavior in real time, detect abnormal scanning behavior, and generate a behavior analysis result; S203: Based on the behavior analysis results, extract the scanning sequence numbers in the continuous scanning records, perform sequential consistency retrieval, detect sequence number jumps and repetitions, verify the legitimacy of each scanning record, and generate a scanning behavior verification record.

5. The hospital drug traceability management method based on blockchain according to claim 4 is characterized in that: The specific formula for calculating the abnormality score of the scanning behavior in real time is: ; Calculate the abnormality score of the scanning behavior; in, Representative The difference between the biometric information of the first scan and the reference biometric template, A biometric standard template representing this type of operator, Representative Real-time scanning speed of the code, Represents the operator's standard scanning speed, Representative The time interval between the current scan and the previous scan. represents the reference time, Representative The scanning frequency of the scanning behavior, Refers to the frequency of code scanning. is the abnormal score of the current scanning behavior, The index of the code scanning behavior.

6. The hospital drug traceability management method based on blockchain according to claim 4 is characterized in that: The steps of extracting the code scanning behavior verification record, dynamically adjusting the drug's expiration date using drug storage conditions, drug type, and batch information, extracting drug dispensing code scanning behavior data, detecting expired drugs, and detecting abnormal drug dispensing behavior based on the quantity and type of drugs dispensed, and outputting the usage time detection information are as follows: S301: Extract the code scanning behavior verification record, extract the storage timestamps of multiple drugs, and identify the storage conditions, drug types and batch information of the drugs, dynamically predict and adjust the expiration date of the drugs, and generate an expiration date adjustment record; The specific formula for dynamically predicting and adjusting the validity period of a drug is: ; Calculate the validity period adjustment value; in, Represents the adjustment value of the drug's validity period, Represents the initial validity period of the drug. The normalized value representing the difference between the storage temperature and the recommended storage temperature of the drug, Represents the weight coefficient of storage temperature deviation, A normalized value representing the stability differences between batches, represents the weight coefficient of batch stability deviation, represents the normalized value of the variation rate of drug type, The weight coefficient representing the variation rate of drug type; S302: Based on the validity period adjustment record, the medication dispensing scanning behavior data is retrieved to predict the time sequence of the user's medication use, and the time sequence is compared with the validity period to obtain a time deviation value; S303: Based on the time deviation value, detect expired medicines in real time, mark abnormal medicine dispensing behavior based on the quantity and type of medicines dispensed, and output usage time detection information.

7. The hospital drug traceability management method based on blockchain according to claim 6 is characterized in that: Based on the usage time detection information, multiple fields of each drug dispensing behavior data are called, and each field is checked for non-emptiness, field format rules, and mapping relationships. The steps of outputting the traceability field verification record are as follows: S401: Based on the usage time detection information, the traceability code, drug code, drug dispensing time, patient ID, prescription number, and medical insurance settlement number in each drug dispensing scan record are obtained to generate a field extraction set; S402: Based on the field extraction set, perform non-empty check and field format rule check on each field to obtain a field validity check result; S403: Analyze the mapping relationship between each field according to the field validity check result, and perform field mapping relationship check according to the logical relationship between the fields to generate a traceability field check record.

8. The hospital drug traceability management method based on blockchain according to claim 1 is characterized in that: The method further comprises: S5: Verify the record based on the traceability field, and use the prescription number, traceability code, dispensing time, patient ID, device code, and pharmacist number fields in the scanned data to obtain the field combination signature. By comparing the signature with the signature set in the stored blockchain record, duplicate signatures are detected and marked, and duplicate identification information is output and written; The written duplicate identification information specifically refers to the prescription number signature comparison result, the traceability code signature comparison result, and the duplicate signature marking information of the dispensing behavior.

9. The hospital drug traceability management method based on blockchain according to claim 8 is characterized in that: According to the traceability field verification record, the prescription number, traceability code, dispensing time, patient ID, device code, and pharmacist number fields in the scanned data are used to obtain the field combination signature. By comparing the signature with the signature set in the stored blockchain record, duplicate signatures are detected and marked. The specific steps of outputting and writing duplicate identification information are as follows: S501: Based on the traceability field verification record, obtain the prescription number, traceability code, dispensing time, patient ID, device code and pharmacist number in each scan data, establish a field combination signature, and generate a field signature combination; S502: Compare the signature set in the stored blockchain record based on the field signature combination, perform duplication verification based on the timestamp and storage time fields, and generate a duplicate signature detection record; S503: According to the duplicate signature detection record, mark the duplicate signature and extract the corresponding blockchain evidence record and duplicate identifier, and output and write duplicate identification information.

10. The hospital drug traceability management system based on blockchain is characterized by: The system is used to implement the blockchain-based hospital drug traceability management method according to any one of claims 1 to 9, and the system includes: The supply comparison module scans incoming drug invoices, identifies conversion parameters between multiple packaging levels, calculates the actual packaging quantity corresponding to the drug supply quantity on the invoice, extracts drug type information, and compares it with the drug demand quantity data in the hospital's HIS system to identify drug quantity discrepancies, detect abnormal supply situations, and generate supply quantity verification records; Based on the supply quantity verification record, the authority review module extracts the device code, personnel number, and scan sequence number from the drug storage and dispensing scan records. Combined with biometric information comparison and behavior analysis, it detects unauthorized device participation and abnormal scanning behavior, and performs sequential consistency verification on the scan sequence numbers in the continuous scan records to obtain the scan behavior verification record; The expiration tracking module dynamically adjusts the expiration date of drugs based on the scan code verification records, using drug storage conditions, drug type, and batch information. It extracts drug dispensing scan code behavior data to detect expired drugs. It also detects abnormal drug dispensing behavior based on the quantity and type of drugs dispensed and generates usage expiration detection information. Based on the usage time detection information, the field verification module extracts the traceability code, drug code, dispensing time, patient ID, prescription number, and medical insurance settlement number in each drug dispensing data, performs non-empty verification, field format verification, and field mapping relationship verification, and generates a traceability field verification record; The signature verification module verifies the records based on the traceability fields, extracts the prescription number, traceability code, dispensing time, patient ID, device code and pharmacist number fields in the scanned code data of each medication dispensing, constructs a field combination signature, and compares it with the signature set stored in the blockchain, identifies duplicate signatures and marks them, and obtains and writes duplicate identification information.

Citation Information

Cited By

  • Drug traceability data acquisition and association method based on electronic supervision code

    CN121616297A