A drug management method and system based on traceability codes
By splitting the drug traceability code into traceability code and batch code, building a mapping database to achieve rapid matching and review of drug information, the problems of low efficiency and poor accuracy in traditional scanning mode are solved, and are suitable for drug management in high-load medical scenarios.
Patent Information
- Application Number
- CN202510549784.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-04-29
AI Technical Summary
The traditional drug traceability code scanning mode has led to an increase in the time spent on issuing drugs. Pharmacists need to switch frequently, making it difficult to achieve accurate comparisons, and there is a problem of false code scanning and incomplete information mapping.
Split the drug trace code into the first 7-digit trace code and the last 13-digit batch code, build a resource code-spec mapping database, and achieve fast matching by scanning the trace code, and trigger the full code review process when the match fails.
It improves the efficiency of drug delivery, reduces operational errors, ensures accurate comparison of drug information, meets the efficiency and accuracy needs of high-load medical scenarios, and supports drug traceability and quality supervision.
Smart Images

Figure CN120072239B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of medical systems, and particularly to a drug management method and system based on traceability codes. Background Art
[0002] As the "electronic ID card" of each box of drugs, the uniqueness and full-process traceability of drug traceability codes have been incorporated into the core link of the safety supervision of medical insurance funds. However, the daily outpatient volume of medical institutions is relatively large. The traditional full-code scanning mode increases the time-consuming of single-dose dispensing. Pharmacists need to frequently switch between drug review and scanning operations, which is prone to operation errors; for some drugs, due to incomplete code assignment or lack of in-warehouse scanning function, the validity of traceability codes cannot be verified in the dispensing link, resulting in management loopholes of "false scanning and no recheck"; the mapping relationship between the existing HIS system and the traceability code database has not been standardized, and the association between the first 7-digit resource codes of some drugs and the prescription specification information is loose, making it difficult to achieve accurate comparison;
[0003] In view of the above problems, there is an urgent need for a drug management method and system based on traceability codes, which split the 20-digit traceability code into the first 7-digit traceability code and the last 13-digit batch code, construct a resource code-specification mapping database, and achieve rapid matching in the dispensing link; only the first 7-digit traceability code needs to be scanned during dispensing to compare the prescription drug specification information in real time; if the matching fails, a full-code recheck process is triggered, taking into account both efficiency and accuracy; through the technical path of "lightweight scanning-intelligent comparison-hierarchical handling", it not only meets the rigid requirements of "should be collected as much as possible and settle with codes", but also adapts to the efficiency and fault tolerance requirements in high-load medical scenarios. Summary of the Invention
[0004] This application aims at the problems that the traditional full-code scanning mode in current medical institutions increases the time-consuming of single-dose dispensing, pharmacists need to frequently switch between drug review and scanning operations, which is prone to operation errors, and it is difficult to achieve accurate comparison between prescription information and drugs. A method is provided to split the 20-digit traceability code into the first 7-digit traceability code and the last 13-digit batch code, construct a resource code-specification mapping database, and achieve rapid matching in the dispensing link. By only scanning the first 7-digit traceability code during dispensing to compare the prescription drug specification information in real time; if the matching fails, a full-code recheck process is triggered, taking into account both efficiency and accuracy. The specific technical solutions are as follows:
[0005] In the first aspect of this application, a drug management method based on traceability codes is provided, including:
[0006] By splitting the first 7 digits of the drug traceability code as the traceability code and binding it with the drug specification information, a traceability code database is formed. The mapping relationship between the first 7-digit traceability code of the drug and the HIS system prescription information is entered and maintained manually or semi-automatically;
[0007] In the medicine dispensing process, the first 7 digits of the traceability code are extracted by scanning the medicine traceability code and automatically compared with the prescription information; if the traceability code matches successfully, the medicine dispensing is completed, and the complete medicine dispensing process and the complete medicine traceability code are recorded in the database; if the match fails, an alarm is triggered and the medicine dispensing process is paused.
[0008] In an embodiment of the present application, the medicine dispensing process specifically includes:
[0009] Synchronously collect images of the appearances of multiple medicines in the scanning area through an image recognition device, and locate and segment the traceability code area based on an image recognition algorithm;
[0010] After extracting the first 7 digits of each medicine traceability code, merge multiple traceability codes into a single data stream and synchronously transmit it to the HIS system;
[0011] The HIS system performs batch comparison on multiple traceability codes according to the types and quantities of medicines in the prescription. If there is a failed match item, an alarm is triggered and the medicine dispensing process is paused.
[0012] In an embodiment of the present application, when extracting the first 7 digits of each medicine traceability code, it further includes:
[0013] Perform contour detection and material analysis on the appearance of the medicine in the scanning area through an image recognition device. If the appearance of the medicine is recognized but the traceability code identification area is not detected, trigger the following processing process:
[0014] Generate a visual positioning frame based on the appearance characteristics of the medicine, and display the position and appearance image of the medicine with the missing traceability code through the HIS terminal interface;
[0015] Prompt the operator to perform manual verification through an audible and visual signal; when the traceability code is normally recognized after the operator adjusts the position of the medicine during manual verification, resume the medicine dispensing process.
[0016] In an embodiment of the present application, when extracting the first 7 digits of each medicine traceability code, it further includes:
[0017] If it is recognized that the traceability code identification area of the medicine has situations such as foreign object coverage, appearance displacement, or damage, generate a visual positioning frame based on the appearance characteristics of the medicine, and display the position and appearance image of the medicine with an unclear traceability code through the HIS terminal interface;
[0018] Prompt the operator to perform manual verification through an audible and visual signal; when the abnormality of the medicine traceability code area is repaired and the traceability code is normally recognized after manual verification, resume the medicine dispensing process; when it is confirmed through manual verification that the traceability code cannot be repaired, pause the medicine dispensing process for this medicine and trigger the medicine recall protocol.
[0019] In an embodiment of the present application, before the medicine dispensing process, it further includes:
[0020] Establish a drug feature library, where the feature library includes name features and appearance features, and the appearance features include text layout, appearance color, shape, and the position information of the traceability code identifier;
[0021] Use an image recognition device to collect the appearance image of the drug to be dispensed in real time, and extract its outer contour, color distribution, and text area features;
[0022] Based on the feature similarity algorithm, calculate the name similarity and appearance similarity between the current drug and all drugs in the feature library. If there is any drug with a similarity exceeding the preset threshold, display the comparison images and drug names of the drugs with high similarity through the HIS terminal interface, and mark the different areas; generate a review reminder instruction, including audible and visual alarms and manual review operation guidelines;
[0023] If the manual review confirms that the drug is correctly matched, record the review result and continue the drug dispensing process; if the review finds a matching error, suspend the drug dispensing and start the drug traceability verification by associating the traceability code.
[0024] In an embodiment of the present application, after the operator completes the drug dispensing and discovers an incorrect drug dispensing through the complete drug dispensing process and the complete drug traceability code, it further includes:
[0025] Based on the position of the traceability code identifier, the appearance color distribution, and the text layout features of the prescribed drug and the incorrect drug, calculate the name similarity and appearance similarity between the two;
[0026] If the name similarity exceeds the first threshold and the appearance similarity is lower than the second threshold, it is determined that the drug dispensing error is caused by drug name confusion; if the appearance similarity exceeds the second threshold and the name similarity is lower than the first threshold, it is determined that the drug dispensing error is caused by appearance confusion;
[0027] Generate a targeted training reminder instruction according to the error type and associate the operator information. The instruction includes at least one of the following:
[0028] Push the drug name pronunciation comparison training and the generic name - trade name mapping relationship database to the operator with name confusion; push the difference area marking atlas of highly similar appearance drugs and the three-dimensional rotation view training module to the operator with appearance confusion;
[0029] The targeted training reminder instruction is automatically sent through the built-in learning platform of the HIS system, and the training completion status and assessment results are recorded.
[0030] In an embodiment of the present application, after calculating the name similarity and appearance similarity between the current drug and all drugs in the feature library based on the feature similarity algorithm, it further includes:
[0031] If there is an incorrect drug dispensing due to confusion of drug names in the historical drug dispensing by the operator corresponding to the current drug, the preset threshold of name similarity is reduced. The more times of incorrect drug dispensing caused by name confusion, the more the preset threshold of name similarity is reduced;
[0032] If there is an incorrect drug dispensing due to confusion of drug appearances in the historical drug dispensing by the operator corresponding to the current drug, the preset threshold of appearance similarity is reduced. The more times of incorrect drug dispensing caused by appearance confusion, the more the preset threshold of appearance similarity is reduced.
[0033] In an embodiment of the present application, when extracting the first 7 digits of each drug traceability code, the edge computing device performs the following steps:
[0034] The traceability code area on the drug appearance is captured in real time through an image sensor, and based on the preset physical position characteristics of the first 7 digits of the drug traceability code, the first 7 - digit character area is directly located and segmented;
[0035] A lightweight image recognition algorithm is used to independently decode the first 7 digits of the characters to generate a drug resource code string;
[0036] The drug resource code string is matched with the local drug feature library through the edge computing node. If the match is successful, the drug basic information is directly returned to the HIS system; if the match fails, the full - code recognition process is triggered.
[0037] In an embodiment of the present application, it further includes:
[0038] When it is detected that the number of people queuing at the drug - taking window exceeds the preset threshold or it is judged by the historical data prediction model that there will be a peak in drug - taking in the future period, a dynamic speed - regulation mechanism is started:
[0039] Peak - period processing mode: Only the first 7 - digit traceability code of the drug traceability code is recognized through the edge computing device, and the drug basic information is quickly matched based on the traceability code. The full - code image is temporarily stored in the local cache queue;
[0040] Idle - time completion mode: In non - peak periods, the full - code image is called to perform complete traceability code parsing, and the drug batch and expiration date information are supplemented and recorded in the database; an error - correction algorithm is started for the full - code images that have not been matched in the cache queue, including occlusion repair and blurred character enhancement processing;
[0041] Data synchronization mechanism: The traceability code matching records generated during the peak period and the complete traceability code data completed during the idle time are synchronously uploaded to the database after being associated by the time stamp.
[0042] In the second aspect of the present application, a drug management system based on the traceability code is further provided, including:
[0043] The splitting module splits by using the first 7 digits of the drug traceability code as the traceability code, binds it with the drug specification information to form a traceability code database, and enters and maintains the mapping relationship between the first 7-digit traceability code of the drug and the prescription information in the HIS system manually or semi-automatically;
[0044] The matching module, in the drug dispensing link, extracts the first 7-digit traceability code by scanning the drug traceability code and automatically compares it with the prescription information; if the traceability code matches successfully, the drug dispensing is completed, and the complete drug dispensing process and the complete drug traceability code are recorded in the database; if the match fails, an alarm is triggered and the drug dispensing process is paused.
[0045] In an embodiment of the present application, the matching module includes:
[0046] The image acquisition sub-module synchronously acquires images of the appearances of multiple drugs in the scanning area through an image recognition device, and locates and segments the traceability code area based on an image recognition algorithm;
[0047] The traceability code merging sub-module extracts the first 7 digits of each drug traceability code, merges multiple traceability codes into a single data stream and synchronously transmits it to the HIS system;
[0048] The comparison sub-module, the HIS system batch-compares multiple traceability codes according to the types and quantities of drugs in the prescription, and if there is a failed match item, an alarm is triggered and the drug dispensing process is paused.
[0049] In an embodiment of the present application, when the matching module extracts the first 7 digits of each drug traceability code, it further includes:
[0050] The packaging recognition sub-module detects the contour and analyzes the material of the appearance of the drug in the scanning area through an image recognition device. If the appearance of the drug is recognized but the traceability code identification area is not detected, the following processing flow is triggered:
[0051] The visual positioning sub-module generates a visual positioning frame based on the appearance characteristics of the drug, and displays the position and appearance image of the drug with the missing traceability code through the HIS terminal interface;
[0052] The prompt for review sub-module prompts the operator for manual review through sound and light signals; when the traceability code is normally recognized after the operator manually reviews and adjusts the position of the drug, the drug dispensing process is resumed.
[0053] In an embodiment of the present application, when the matching module extracts the first 7 digits of each drug traceability code, it further includes:
[0054] The foreign object recognition sub-module, if it is recognized that there are situations such as foreign object coverage, appearance displacement or damage in the traceability code identification area of the drug, generates a visual positioning frame based on the appearance characteristics of the drug, and displays the position and appearance image of the drug with an unclear traceability code through the HIS terminal interface;
[0055] The repair sub-module uses acoustic and optical signals to prompt the operator for manual verification. When the manual verification repairs the abnormality in the drug traceability code area and the traceability code is normally recognized, the drug dispensing process is resumed. When the manual verification confirms that the traceability code cannot be repaired, the drug dispensing process for this drug is suspended and a drug recall protocol is triggered.
[0056] In an embodiment of the present application, before the dispensing link of the matching module, it further includes:
[0057] The feature library sub-module establishes a drug feature library, which includes name features and appearance features. The appearance features include text layout, appearance color, shape, and traceability code identification position information;
[0058] The feature acquisition sub-module uses an image recognition device to collect the appearance image of the drug to be dispensed in real time, and extracts its outer contour, color distribution, and text area features;
[0059] The recognition difference sub-module calculates the name similarity and appearance similarity between the current drug and all drugs in the feature library based on the feature similarity algorithm. If there is any drug with a similarity exceeding the preset threshold, the comparison image and drug name of the drug with high similarity are displayed through the HIS terminal interface, and the difference area is marked; a review reminder instruction is generated, including acoustic and optical alarms and manual review operation guidelines;
[0060] The process recovery sub-module, if the manual verification confirms that the drug is correctly matched, records the verification result and continues the drug dispensing process; if the verification finds a matching error, the drug dispensing is suspended and the drug traceability verification is started by associating the traceability code.
[0061] In an embodiment of the present application, after the operator of the matching module completes the drug dispensing and there is an incorrect drug dispensing found through the complete drug dispensing process and the complete drug traceability code, it further includes an error review module:
[0062] Based on the traceability code identification position, appearance color distribution, and text layout features of the prescribed drug and the incorrect drug, calculate the name similarity and appearance similarity between the two;
[0063] If the name similarity exceeds the first threshold and the appearance similarity is lower than the second threshold, it is determined that the drug dispensing error is caused by drug name confusion; if the appearance similarity exceeds the second threshold and the name similarity is lower than the first threshold, it is determined that the drug dispensing error is caused by appearance confusion;
[0064] Generate a targeted training reminder instruction according to the error type and associate the operator information. The instruction includes at least one of the following:
[0065] Push the pronunciation comparison training of drug names and the general name - trade name mapping relationship database to the operators with name confusion; push the atlas of marked difference areas of drugs with highly similar appearances and the 3D rotation view training module to the operators with appearance confusion;
[0066] The targeted training reminder instruction is automatically issued through the built - in learning platform of the HIS system, and the training completion status and assessment results are recorded.
[0067] In an embodiment of the present application, after the error review module calculates the name similarity and appearance similarity between the current drug and all drugs in the feature library based on the feature similarity algorithm, it further includes a threshold adjustment module:
[0068] If the operator corresponding to the current drug has made a wrong drug delivery due to name confusion in historical drug deliveries, the preset threshold of name similarity is reduced. The more times of wrong drug deliveries caused by name confusion, the more the preset threshold of name similarity is reduced;
[0069] If the operator corresponding to the current drug has made a wrong drug delivery due to appearance confusion in historical drug deliveries, the preset threshold of appearance similarity is reduced. The more times of wrong drug deliveries caused by appearance confusion, the more the preset threshold of appearance similarity is reduced.
[0070] In an embodiment of the present application, when the matching module extracts the first 7 digits of each drug traceability code, the edge computing device is used to perform the following steps:
[0071] The traceability code area on the drug appearance is captured in real - time through an image sensor, and based on the preset physical position characteristics of the first 7 digits of the drug traceability code, the first 7 - digit character area is directly located and segmented;
[0072] A lightweight image recognition algorithm is used to independently decode the first 7 digits of the characters to generate a drug resource code string;
[0073] The drug resource code string is matched with the local drug feature library through the edge computing node. If the match is successful, the drug basic information is directly returned to the HIS system; if the match fails, the full - code recognition process is triggered.
[0074] In an embodiment of the present application, the matching module further includes a peak - period dynamic speed - regulation sub - module:
[0075] When it is detected that the number of people queuing at the drug - taking window exceeds the preset threshold or it is judged by the historical data prediction model that there will be a drug - taking peak in the future period, the dynamic speed - regulation mechanism is started:
[0076] During the peak - period processing mode, the edge computing device only recognizes the first 7 - digit traceability code of the drug traceability code, quickly matches the drug basic information based on the traceability code, and the full - code image is temporarily stored in the local cache queue;
[0077] Idle-time completion mode: During off-peak hours, full-code images are called to perform complete traceability code parsing, and drug batch and expiration date information are supplemented and recorded in the database. An error correction algorithm is initiated for the full-code images that are not matched in the cache queue, including occlusion repair and blurred character enhancement processing.
[0078] Data synchronization mechanism: The traceability code matching records generated during peak hours and the complete traceability code data completed during idle time are synchronously uploaded to the database after being associated by timestamps.
[0079] The present application has the following beneficial effects:
[0080] 1. After scanning the drug traceability code, the first 7 digits are intercepted as the traceability code. By splitting the first 7 digits as the key index, the problems of low efficiency and data redundancy in traditional full-code scanning are solved. The establishment of the mapping database enables the HIS system to directly call the basic drug information without repeatedly parsing the full code, reducing the system operation load. Query the mapping database to obtain the HIS code of the corresponding drug, and perform consistency verification with the HIS code of the drug in the current prescription. If they match, record the complete traceability code (including batch and expiration date) in the database. If they do not match (such as the drug does not match the prescription or the mapping library is missing), the system locks the drug dispensing process and pushes a warning to the operator's terminal, and at the same time records the error type (such as "specification does not match", "manufacturer error"). The present application solves the problem of easy omission in traditional manual verification through double verification (traceability code mapping + prescription information). For example, when a pharmacist accidentally takes drugs with the same generic name but different specifications (such as 0.25g and 0.5g amoxicillin), the system can accurately intercept and avoid medication errors. In addition, the recording of the complete traceability code supports subsequent quality traceability. For example, when recalling problems, patients in the affected batches can be quickly located through the database. At the same time, by only comparing the first 7 digits of the traceability code for prescriptions, the data parsing process is simplified, and the full-code information is saved, which not only meets the requirements of the entire drug supervision process for traceability but also adapts to the lightweight operation needs of HIS, especially suitable for the outpatient pharmacy scenario with a high flow of people.
[0081] 2. Through the multi-drug parallel acquisition + batch comparison technology, the efficiency bottleneck of traditional single-by-one scanning of drug boxes by the barcode scanner is solved, breaking through the limitation of a single scanning device, and realizing "one scan for multiple codes" using image recognition, reducing the hardware deployment cost; especially suitable for the outpatient peak hour scenario. At the same time, after the HIS system performs hash verification on the received list of traceability codes, a difference set operation is performed with the set of HIS codes of the drugs in the current prescription. If the difference set is not empty (that is, there are unmatched items), a hierarchical alarm is triggered:
[0082] Level 1 Alarm (Critical Mismatch), Trigger Condition: The traceability code of essential drugs in the prescription (such as antibiotics, emergency drugs) fails to match successfully, or there are discrepancies in the specifications / manufacturers of high-risk drugs (such as drugs with concentration differences that may cause serious adverse reactions). Handling Measures: Immediately suspend the drug dispensing process and lock the current operation interface; Push the alarm to the pharmacist terminal, pharmacy management large screen, and supervision platform, triggering audible and visual alarms; Mandatorily require manual review, and the alarm can only be lifted after double confirmation by two pharmacists.
[0083] Level 2 Alarm (Auxiliary Mismatch) Trigger Condition: The quantity of auxiliary drugs (such as vitamins, nutritional supplements) is excessive or insufficient; The substitution of similar drugs (such as drugs with the same generic name from different manufacturers) fails to pass the clinical equivalence verification. Handling Measures: Pop up a window to prompt the pharmacist to manually confirm, allowing "forced release" or "re-dispensing"; Record the operation log and mark it as "low-risk anomaly" for subsequent quality traceability analysis; If the same type of Level 2 alarm is continuously triggered (such as a certain drug frequently exceeding the limit), it will be automatically upgraded to a Level 1 alarm. Introduce a confidence threshold (such as similarity ≥ 95% for substitutability), and dynamically adjust the judgment criteria in combination with historical medication data.
[0084] Level 3 Alarm (Mapping Library Missing) Trigger Condition: The scanned traceability code is not bound to the HIS code, or the mapping relationship becomes invalid due to changes in packaging specifications or supplier updates. Handling Measures: Automatically initiate a mapping relationship creation request and push it to the pharmacy warehouse administrator terminal; Allow temporary binding of emergency codes (to be synchronized to the main database after manual review); If not processed within 30 minutes, trigger a Level 2 alarm and notify the superior supervision node. Adopt a fault-tolerant queue mechanism to temporarily store unrecognized traceability codes in a temporary database and retry the matching at regular intervals through asynchronous tasks.
[0085] Reduce unnecessary process interruptions through a hierarchical strategy. The proportion of Level 1 alarms is relatively low, effectively reducing the average time-consuming for manual processing of Level 2 alarms; Combine hierarchical interception based on clinical importance to intercept high-risk operations.
[0086] 3. When a drug fails to scan its traceability code, an alarm reminder is issued. Further identify whether it is due to the drug packaging position or damage to the traceability code area that causes the failure to recognize. Adjust the drug packaging or clean the traceability code area. If the traceability code is missing and cannot be repaired, suspend the drug dispensing process for this drug and trigger the drug recall protocol to prevent drugs without traceability codes from entering the market. At the same time, integrate material analysis and contour detection to identify damaged packaging and counterfeit packaging (such as fake drugs using compliant materials but with inconsistent printing processes); Further, the abnormal type can be directly distinguished by the color of the RGB LED light strip (red for missing code, yellow for code defacement), the buzzer frequency indicates the urgency, and the HIS interface automatically pops up standardized review steps (such as "rotate the medicine box so that the label faces up" "wipe the barcode area").
[0087] 4. Through multi-dimensional similarity calculation: Name similarity: Based on the BERT-ED semantic model, calculate the edit distance and semantic correlation degree of drug names (e.g., the similarity between "Ceftriaxone Sodium" and "Cefotaxime Sodium" reaches 85%); Appearance similarity: Compare the color histogram (weight 40%), shape parameters (weight 30%), and text area matching degree (weight 30%) through cosine similarity, and the comprehensive threshold is set at 90%; The HIS interface highlights the difference area in the form of AR overlay (such as the traceability code position deviation > 5mm or the main color deviation > 10%), and generates a three-dimensional comparison view; The hierarchical alarm strategy includes: Level 1 alarm (similarity ≥ 95%): Audible and visual yellow warning, requiring double-person review; Level 2 alarm (80% ≤ similarity < 95%): Pop-up window prompts to focus on checking the difference items; Level 3 alarm (similarity < 80%): Directly intercept and initiate traceability verification; By establishing a drug feature library in advance, during the drug dispensing process, if there is a drug with a similarity exceeding the threshold among the drugs to be dispensed (relatively high risk of mis-taking), the operator is reminded to conduct a verification to further avoid mis-dispensing of drugs.
[0088] 5. Considering that different operators have different habits and attention biases, and thus the error-prone directions are also different. If an operator has drug confusion due to similar drug names, the system automatically reduces its name similarity threshold, forcibly triggers a Level 2 alarm, and adds a review step; At the same time, according to the operator's historical error data (such as the number of name confusion times), adaptively reduce the name similarity threshold and / or appearance similarity threshold (such as from 90% to 85%) to reduce the misjudgment risk of easily confused drugs such as "Omeprazole Enteric Capsules" and "Omeprazole Magnesium Enteric Tablets"; This solution converts error data into training resources and threshold adjustment basis through machine learning, constructs a continuous optimization chain of "error discovery - analysis - improvement", and provides a two-way empowerment model of "intelligent error correction - ability improvement".
[0089] 6. Automatically switch the processing mode based on the queuing prediction model, only parse the first 7 digits of the drug identification code, and quickly match through the local drug feature library (storing the drug generic name, dosage form, and specification); The full-code image is named with a timestamp (such as 20250416143000_001.jpg) and temporarily stored in the edge node SSD hard disk; Call the enhanced version of Tesseract-OCR to parse the complete 20-digit traceability code, supplement the production batch and expiration date to the database, and associate with the peak period resource code record through the timestamp; By deeply coupling the edge computing efficiency with the drug traceability rules, only process the key identification fields (the first 7 digits) during the peak period, and supplement the auxiliary information (production batch, expiration date) during idle time, which conforms to the supervision logic of "verify the identity first and then trace the details" in drug circulation; This solution breaks through the efficiency bottleneck under the premise of ensuring compliance through a hierarchical strategy of quick matching of the first 7 digits + supplementing during idle time. Description of the Drawings
[0090] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.
[0091] Figure 1 It is a schematic structural diagram of an electronic device for the hardware operating environment related to the embodiments of the present application.
[0092] Figure 2 It is a flowchart of a drug management method provided by the embodiments of the present application.
[0093] Figure 3 It is an implementation manner of review reminder in a drug management method provided by the embodiments of the present application.
[0094] Figure 4 It is an implementation manner of quick identification of traceability codes in a drug management method provided by the embodiments of the present application.
[0095] Figure 5 It is a schematic diagram of functional modules of a drug management system provided by the embodiments of the present application.
[0096] Reference numerals in the figure: 1001 - processor, 1002 - communication bus, 1003 - user interface, 1004 - network interface, 1005 - memory. Detailed implementation manners
[0097] To make the above objects, features, and advantages of the present application more apparent and understandable, the present application will be further described in detail below with reference to the accompanying drawings and specific implementation manners. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0098] The solution of the present application will be further described below with reference to the accompanying drawings.
[0099] Such as Figure 1As shown in the figure, the electronic device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to implement connection communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wireless-Fidelity (WI-FI) interface). The memory 1005 may be a high-speed Random Access Memory (RAM) or a stable Non-Volatile Memory (NVM), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0100] Those skilled in the art can understand that Figure 1 the structure shown in the figure does not constitute a limitation on the electronic device, and it may include more or fewer components than shown in the figure, or combine certain components, or have a different component layout.
[0101] As Figure 1 shown, the memory 1005, as a storage medium, may include an operating system, a network communication module, a user interface module, and a data storage module.
[0102] In Figure 1 the electronic device shown in the figure, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with users; the processor 1001 and the memory 1005 in the electronic device of the present invention may be provided in the electronic device. The electronic device calls a drug management method based on a traceability code stored in the data storage module of the memory 1005 through the processor 1001 and executes the liquid output monitoring system of the present application.
[0103] Based on the foregoing hardware operating environment and system architecture, in the first aspect of the present application, referring to Figure 2 the figure shown, a drug management method based on a traceability code is provided, including:
[0104] By splitting the first 7 digits of the drug traceability code as the traceability code and binding it with the drug specification information, a traceability code database is formed, and the mapping relationship between the first 7-digit traceability code of the drug and the HIS system prescription information is entered and maintained manually or semi-automatically;
[0105] It should be noted that the first 7 digits of the drug traceability code are used as the core identification part to uniquely identify the basic information of the drug, including: marketing authorization holder / manufacturer: registration information of the associated drug manufacturer; generic name of the drug: standardized names such as "Amoxicillin Capsules"; dosage form and specifications: such as tablets, injections, and the amount of each box / bottle (such as 10 tablets / box, 0.5g / stick); approval number and packaging specifications: for example, "National Medicine Standard H20230001" and different packaging specifications (such as 24 tablets / box or 36 tablets / box). Take the traceability code xxxxxxxyyyyyyyyyzzzz as an example: the first 7 digits (xxxxxxx): identify the basic information of the drug (such as a certain specification of aspirin tablets produced by a certain company); the 8th to 16th digits (yyyyyyyyyy): production identification code, including production batch number, expiration date, single product serial number, etc.; the last 4 digits (zzzz): check digit, the validity of the traceability code is verified by the algorithm.
[0106] It should be noted that the construction of the mapping relationship includes: manual entry. For newly launched drugs, pharmacists manually enter the traceability code through the HIS system interface and associate it with the specification parameters in the drug instructions (such as tablet specifications, injection volume); semi-automatic entry: through the National Drug Traceability System API interface, batch capture of the traceability codes and specification correspondences of coded drugs, and automatic updating of the database every morning; or based on the traceability codes and specifications of the drugs in the hospital's drug procurement list.
[0107] During the drug dispensing process, the first 7 digits of the traceability code are extracted by scanning the drug traceability code and automatically compared with the prescription information; if the traceability code matches successfully, the drug dispensing is completed, and the complete drug dispensing process and the complete drug traceability code are recorded in the database; if the match fails, an alarm is triggered and the drug dispensing process is suspended.
[0108] In this embodiment, after scanning the drug traceability code, the first 7 digits are intercepted as the traceability code. By splitting the first 7 digits as the key index, the problems of low efficiency and data redundancy in traditional full-code scanning are solved. The establishment of the mapping database enables the HIS system to directly call the basic drug information without repeatedly parsing the full code, reducing the system operation load; querying the mapping database to obtain the HIS code of the corresponding drug, and performing consistency verification with the HIS code of the drug in the current prescription. If they match, the complete traceability code (including batch number and expiration date) is recorded in the database. If they do not match (such as the drug does not match the prescription or the mapping library is missing), the system locks the drug dispensing process and pushes an alarm to the operator's terminal, and at the same time records the error type (such as "specification does not match", "manufacturer error"); this application solves the problem of easy omission in traditional manual verification through double verification (traceability code mapping + prescription information). For example, when a pharmacist accidentally takes drugs with the same generic name but different specifications (such as 0.25g and 0.5g amoxicillin), the system can accurately intercept and avoid medication errors. In addition, the recording of the complete traceability code supports subsequent quality traceability. For example, when recalling problems, patients in the affected batches can be quickly located through the database; at the same time, by only comparing the first 7 digits of the traceability code for prescriptions, the data parsing process is simplified, and the full-code information is saved, which not only meets the requirements of the full-process traceability of drug supervision but also adapts to the lightweight operation needs of HIS, especially suitable for the outpatient pharmacy scenario with a high flow of people.
[0109] In an embodiment of the present application, the drug dispensing link specifically includes:
[0110] Synchronously collect images of the appearances of multiple drugs in the scanning area through an image recognition device, and locate and segment the traceability code area based on an image recognition algorithm;
[0111] After extracting the first 7 digits of each drug traceability code, merge multiple traceability codes into a single data stream and synchronously transmit it to the HIS system;
[0112] The HIS system performs batch comparison on multiple traceability codes according to the types and quantities of drugs in the prescription. If there are items that fail to match, an alarm is triggered and the drug dispensing process is paused.
[0113] It should be noted that the image recognition algorithm uses an improved YOLOv8 model to perform parallel detection on multiple boxes of drugs in the scanning area (such as a medicine basket or a drug dispensing table), and combines the U-Net network to segment the traceability code area. The model realizes accurate positioning through a pre-trained drug packaging feature library (such as barcode position, medicine box size ratio), and supports processing complex scenarios such as distortion, reflection, and occlusion; encapsulate multiple traceability codes into a JSON array in the prescription order, and attach a SHA-256 hash check value to prevent tampering;
[0114] In this embodiment, through the multi-drug parallel acquisition + batch comparison technology, the efficiency bottleneck of the traditional scanning gun scanning each box one by one is solved, the limitation of a single scanning device is broken through, and "one scan for multiple codes" is realized by using image recognition, reducing the hardware deployment cost; it is especially applicable to the outpatient peak period scenario; at the same time, after the HIS system performs a hash check on the received list of traceability codes, a difference set operation is performed with the set of HIS codes of the drugs in the current prescription. If the difference set is not empty (that is, there are unmatched items), a hierarchical alarm is triggered:
[0115] Level 1 alarm (critical mismatch), triggering conditions: the traceability code of the essential drugs (such as antibiotics, emergency drugs) in the prescription fails to match successfully, or there are discrepancies in the specifications / manufacturers of high-risk drugs (such as drugs with concentration differences that may cause serious adverse reactions). Handling measures: Immediately suspend the drug dispensing process and lock the current operation interface; push the alarm to the pharmacist terminal, the pharmacy management large screen and the supervision platform, triggering an audible and visual alarm; force manual review, and the alarm can only be lifted after two pharmacists confirm it.
[0116] Level 2 alarm (auxiliary mismatch) triggering conditions: The quantity of adjuvant drugs (such as vitamins, nutritional supplements) is excessive or insufficient; the substitution of similar drugs (such as drugs with the same generic name from different manufacturers) fails to pass the clinical equivalence check. Handling measures: Pop up a window to prompt the pharmacist to manually confirm, allowing "forced release" or "re-dispensing"; record the operation log and mark it as "low-risk anomaly" for subsequent quality traceability analysis; if the same type of level 2 alarm is continuously triggered (such as a certain drug frequently exceeding the limit), it will be automatically upgraded to a level 1 alarm. Introduce a confidence threshold (such as similarity ≥ 95% is substitutable), and dynamically adjust the judgment criteria in combination with historical medication data.
[0117] Level 3 alarm (missing mapping library) triggering conditions: The scanned traceability code is not bound to the HIS code, or the mapping relationship fails due to changes in packaging specifications or supplier updates. Handling measures: Automatically initiate a mapping relationship creation request and push it to the pharmacy administrator terminal; allow temporary binding of emergency codes (which need to be manually reviewed and synchronized to the main database); if it is not processed within 30 minutes, trigger a level 2 alarm and notify the superior supervision node. Adopt a fault-tolerant queue mechanism to temporarily store the unrecognized traceability codes in a temporary database and retry the matching at regular intervals through asynchronous tasks.
[0118] By reducing unnecessary process interruptions through the hierarchical strategy, the proportion of level 1 alarms is relatively low, effectively reducing the average manual processing time of level 2 alarms; combined with the interception of the clinical importance level, high-risk operations are intercepted.
[0119] In an embodiment of the present application, when extracting the first 7 digits of each drug traceability code, it further includes:
[0120] Through the image recognition device, the contour of the drug appearance in the scanning area is detected and the material is analyzed. If the drug appearance is recognized but the traceability code identification area is not detected, the following processing flow is triggered:
[0121] Generate a visual positioning frame based on the appearance characteristics of the medicine, and display the position and appearance image of the medicine without a traceability code through the HIS terminal interface;
[0122] Prompt the operator to conduct manual verification through sound and light signals; when the traceability code is normally recognized after the operator manually verifies and adjusts the position of the medicine, the medicine dispensing process resumes.
[0123] It should be noted that by adopting a multi-task deep learning model improved based on YOLOv8, medicine contour detection, material analysis, and traceability code positioning are synchronously executed to confirm that the recognized item is a medicine. If the traceability code area is not detected in 3 consecutive frames of images (with an interval of 0.2 seconds), it is determined as a "missing code" event. For example, if the side of the medicine package printed with the traceability code is not aligned with the scanning area, the system generates a visual positioning frame with an AR overlay effect on the HIS terminal, marks the three-dimensional coordinates (X / Y / Z axes) of the abnormal medicine in the scanning area, and enlarges and displays the appearance image; this facilitates the operator to find the position of the medicine without a traceability code and make corresponding adjustments;
[0124] In an embodiment of the present application, when extracting the first 7 digits of each medicine traceability code, it further includes:
[0125] If it is recognized that there are situations such as foreign object coverage, appearance displacement, or damage in the traceability code identification area of the medicine, a visual positioning frame is generated based on the appearance characteristics of the medicine, and the position and appearance image of the medicine with an unclear traceability code are displayed through the HIS terminal interface;
[0126] Prompt the operator to conduct manual verification through sound and light signals; when the abnormal situation in the traceability code area of the medicine is repaired by manual verification and the traceability code is normally recognized, the medicine dispensing process resumes; when the operator manually verifies and confirms that the traceability code cannot be repaired, the medicine dispensing process for this medicine is suspended and a medicine recall protocol is triggered.
[0127] In this embodiment, when a medicine fails to scan the traceability code, an alarm reminder is given, and it is further identified whether it is due to the position of the medicine package or damage to the traceability code area that the recognition fails. The medicine package is adjusted or the traceability code area is cleaned. If the traceability code is missing and cannot be repaired, the medicine dispensing process for this medicine is suspended and a medicine recall protocol is triggered to prevent medicines without traceability codes from entering the market. At the same time, by integrating material analysis and contour detection, damaged packages and high imitation packages can be identified; furthermore, the abnormal type can be directly distinguished by the color of the RGB LED light strip (red for missing code, yellow for code smudging), the frequency of the buzzer indicates the urgency level, and a standardized verification step (such as "rotate the medicine box so that the label side faces up" "wipe the barcode area") automatically pops up on the HIS interface.
[0128] In an embodiment of the present application, referring to Figure 3 as shown, before the medicine dispensing link, it further includes:
[0129] Establish a drug feature library, where the feature library includes name features and appearance features, and the appearance features include text layout, appearance color, shape, and the position information of the traceability code identifier;
[0130] Real-time collect the appearance image of the drug to be dispensed through an image recognition device, and extract its outer contour, color distribution, and text area features;
[0131] Based on the feature similarity algorithm, calculate the name similarity and appearance similarity between the current drug and all drugs in the feature library. If there is any drug with a similarity exceeding the preset threshold, display the comparison image and drug name of the drug with high similarity through the HIS terminal interface, and mark the difference area; generate a review reminder instruction, including audible and visual alarms and manual review operation guidelines;
[0132] If the manual review confirms that the drug is correctly matched, record the review result and continue the drug dispensing process; if the review finds a matching error, suspend the drug dispensing and start the drug traceability verification by associating the traceability code.
[0133] It should be noted that the name features integrate semantic information such as the generic name, trade name, and alias of the drug (such as the mapping between "aspirin" and "acetylsalicylic acid"). The appearance features generate a standardized template by parsing the drug packaging image library, including text layout (such as font size, logo position), color distribution (HSV histogram), shape parameters (aspect ratio, edge curvature), and the coordinate of the traceability code area (positioned based on the YOLOv8 pre-trained model);
[0134] In this embodiment, through multi-dimensional similarity calculation: Name similarity: Based on the BERT-ED semantic model, calculate the edit distance and semantic correlation degree of the drug name (such as the similarity between "ceftriaxone sodium" and "cefotaxime sodium" reaches 85%); Appearance similarity: Compare the color histogram (weight 40%), shape parameters (weight 30%), and text area matching degree (weight 30%) through cosine similarity. The comprehensive threshold is set to 90%; The HIS interface highlights the difference area in the form of AR overlay (such as the traceability code position deviation > 5mm or the main color deviation > 10%), and generates a three-dimensional comparison view; The hierarchical alarm strategy includes: Level 1 alarm (similarity ≥ 95%): Audible and visual prompt for yellow warning, requiring double review; Level 2 alarm (80% ≤ similarity < 95%): Pop-up prompt to focus on checking the difference items; Level 3 alarm (similarity < 80%): Directly intercept and start the traceability verification; By establishing the drug feature library in advance, during the drug dispensing process, if there is a drug with a similarity exceeding the threshold among the drugs to be dispensed (relatively high probability of misappropriation risk), remind the operator to conduct a verification to further avoid the misdispensing of drugs.
[0135] In an embodiment of the present application, after the operator completes drug dispensing and discovers an incorrect drug dispensing through the complete drug dispensing process and the complete drug traceability code, the following steps are further included:
[0136] Based on the traceability code identification positions, appearance color distributions, and text layout features of the prescribed drug and the incorrect drug, calculate the name similarity and appearance similarity between the two.
[0137] If the name similarity exceeds the first threshold and the appearance similarity is lower than the second threshold, it is determined that the incorrect drug dispensing is caused by drug name confusion; if the appearance similarity exceeds the second threshold and the name similarity is lower than the first threshold, it is determined that the incorrect drug dispensing is caused by appearance confusion.
[0138] Generate a targeted training reminder instruction according to the error type and associate the operator information. The instruction includes at least one of the following:
[0139] Push the drug name pronunciation comparison training and the generic name - trade name mapping relationship database to the operator with name confusion; push the atlas of marked difference areas of highly similar appearance drugs and the 3D rotation view training module to the operator with appearance confusion.
[0140] The targeted training reminder instruction is automatically issued through the built-in learning platform of the HIS system, and the training completion status and assessment results are recorded.
[0141] In an embodiment of the present application, after calculating the name similarity and appearance similarity between the current drug and all drugs in the feature library based on the feature similarity algorithm, the following steps are further included:
[0142] If the operator corresponding to the current drug has made an incorrect drug dispensing due to drug name confusion in historical drug dispensing, then reduce the preset threshold of name similarity. The more times of incorrect drug dispensing caused by drug name confusion, the more the preset threshold of name similarity is reduced.
[0143] If the operator corresponding to the current drug has made an incorrect drug dispensing due to drug appearance confusion in historical drug dispensing, then reduce the preset threshold of appearance similarity. The more times of incorrect drug dispensing caused by drug appearance confusion, the more the preset threshold of appearance similarity is reduced.
[0144] It should be noted that for the name confusion training module: pronunciation comparison training: for "medication-sounding drugs" (such as "nicotinamide for injection" and "hydrochloric acid for injection"), the audio comparison is used to strengthen the recognition of voice differences; mapping database: integrating the mapping relationship between generic names and trade names (such as "azithromycin" corresponding to "Zithromax" and "Tilit"), supporting semantic retrieval and visualization of association graphs; appearance confusion training module: difference annotation atlas: highlighting the difference areas of highly similar drugs (such as the main packaging color deviation > 10% or the LOGO position deviation > 5mm); 3D rotation view: generating a 360° comparison model of the medicine box based on AR technology, supporting zooming in to observe details (such as differences in font printing technology).
[0145] In this embodiment, considering that different operators have different habits and attention biases, the directions prone to errors are also different. If an operator makes a drug confusion due to similar drug names, the system automatically reduces its name similarity threshold, forcibly triggers a secondary alarm and adds a review step; at the same time, according to the operator's historical error data (such as the number of name confusion times), the name similarity threshold and / or appearance similarity threshold are adaptively reduced (such as from 90% to 85%) to reduce the misjudgment risk of easily confused drugs such as "omeprazole enteric-coated capsules" and "omeprazole magnesium enteric-coated tablets"; this solution converts error data into training resources and threshold adjustment basis through machine learning, constructs a continuous optimization chain of "error discovery - analysis - improvement", and provides a two-way empowerment model of "intelligent error correction - ability improvement".
[0146] In an embodiment of the present application, referring to Figure 4 as shown, when extracting the first 7 digits of each drug traceability code, the edge computing device performs the following steps:
[0147] The traceability code area on the drug appearance is captured in real time through an image sensor, and based on the preset physical position characteristics of the first 7 digits of the drug traceability code, the first 7-digit character area is directly located and segmented;
[0148] A lightweight image recognition algorithm is used to independently decode the first 7 digits of the characters to generate a drug resource code string;
[0149] The drug resource code string is matched with the local drug feature library through the edge computing node. If the match is successful, the drug basic information is directly returned to the HIS system; if the match fails, the full code recognition process is triggered.
[0150] In an embodiment of the present application, it further includes:
[0151] When it is detected that the number of people queuing at the dispensing window exceeds the preset threshold or it is predicted by the historical data prediction model that there will be a dispensing peak in the future period, a dynamic speed regulation mechanism is started:
[0152] Peak - period processing mode: Only the first 7 - digit traceability code of the drug traceability code is recognized by the edge - computing device. Based on the traceability code, the basic drug information is quickly matched, and the full - code image is temporarily stored in the local cache queue.
[0153] Off - peak completion mode: During off - peak periods, the full - code image is called to perform complete traceability code parsing, and the drug batch and expiration date information are supplemented and recorded in the database. An error - correction algorithm is launched for the full - code images that have not been matched in the cache queue, including occlusion repair and blurred character enhancement processing.
[0154] Data synchronization mechanism: The traceability code matching records generated during peak periods and the complete traceability code data supplemented during off - peak periods are synchronously uploaded to the database after being associated by timestamps.
[0155] It should be noted that the queuing prediction model analyzes historical prescription - taking data (such as time periods, prescription volumes) based on the LSTM algorithm to predict the prescription - taking demand in the future 30 - minute window period. The trigger threshold is set as the queuing number > 8 people or the predicted prescription volume > 200 sheets / hour. Only the traceability code area is recognized through the edge algorithm, and at the same time, in a way including the text direction, the first 7 - digit traceability code is directly recognized, which is different from the way of first recognizing the full code and then splitting the first 7 digits. The amount of data processed is smaller and the recognition speed is faster.
[0156] In this embodiment, the processing mode is automatically switched based on the queuing prediction model. Only the first 7 - digit drug identification code is parsed and quickly matched through the local drug feature library (storing the drug generic name, dosage form, and specification). The full - code image is named with a timestamp (such as 20250416143000_001.jpg) and temporarily stored in the SSD hard disk of the edge node. The enhanced version of Tesseract - OCR is called to parse the complete 20 - digit traceability code, and the production batch and expiration date are supplemented and recorded in the database, which are associated with the peak - period resource code records through timestamps. By deeply coupling the edge - computing efficiency with the drug traceability rules, only the key identification fields (the first 7 digits) are processed during peak periods, and the auxiliary information (production batch, expiration date) is supplemented during off - peak periods. Through the regulatory logic of "first identify the identity and then trace the details" and the hierarchical strategy of quick matching of the first 7 digits + off - peak completion, the efficiency bottleneck is broken through while ensuring compliance.
[0157] In the second aspect of the present application, a drug management system based on the traceability code is provided. Referring to Figure 5 as shown, it includes:
[0158] A splitting module: The first 7 digits of the drug traceability code are used as the traceability code for splitting and are bound to the drug specification information to form a traceability code database. The mapping relationship between the first 7 - digit traceability code of the drug and the HIS system prescription information is entered and maintained manually or semi - automatically.
[0159] A matching module, during the medicine dispensing process, extracts the first 7 digits of the traceability code by scanning the medicine traceability code and automatically compares it with the prescription information; if the traceability code matches successfully, the medicine dispensing is completed, and the complete medicine dispensing process and the complete medicine traceability code are recorded in the database; if the match fails, an alarm is triggered and the medicine dispensing process is paused.
[0160] It should be noted that the specific implementation of a medicine management method based on the traceability code in this embodiment of the present application refers to the specific implementation of a medicine management method based on the traceability code proposed in the first aspect of the foregoing embodiment of the present application, and will not be repeated here.
[0161] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that an article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such article or device. Without further limitation, the elements defined by the statement "including..." do not exclude the existence of additional identical elements in the article or device including the elements.
[0162] The above provides a detailed introduction to a medicine management method based on the traceability code. In this article, specific examples are used to elaborate on the principle and implementation of the present application. The description of the above embodiments is only used to help understand a medicine management method based on the traceability code of the present application and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A drug management method based on traceability codes, characterized in that, Including: By splitting the first 7 digits of the drug traceability code as the traceability code and binding it with the drug specification information, a traceability code database is formed, and the mapping relationship between the first 7-digit traceability code of the drug and the prescription information in the HIS system is entered and maintained manually or semi-automatically; In the drug dispensing link, the first 7-digit traceability code is extracted by scanning the drug traceability code and automatically compared with the prescription information; if the traceability code matches successfully, the drug dispensing is completed, and the complete drug dispensing process and the complete drug traceability code are recorded in the database; If the match fails, an alarm is triggered and the drug dispensing process is paused; The specific drug dispensing link includes: Synchronously collect images of the appearances of multiple drugs in the scanning area through an image recognition device, and locate and segment the traceability code area based on an image recognition algorithm; After extracting the first 7 digits of each drug traceability code, merge multiple traceability codes into a single data stream and synchronously transmit it to the HIS system; The HIS system batch-compares multiple traceability codes according to the types and quantities of drugs in the prescription. If there is a failed match item, an alarm is triggered and the drug dispensing process is paused; When extracting the first 7 digits of each drug traceability code, it also includes: Perform contour detection and material analysis on the appearance of the drug in the scanning area through an image recognition device. If the appearance of the drug is recognized but the traceability code identification area is not detected, the following processing flow is triggered: Generate a visual positioning frame based on the appearance characteristics of the drug, and display the position and appearance image of the drug lacking the traceability code through the HIS terminal interface; Prompt the operator for manual review through an audible and visual signal; when the traceability code is normally recognized after the operator manually reviews and adjusts the position of the drug, the drug dispensing process is resumed.
2. The pharmaceutical management method based on a traceability code according to claim 1, wherein, When extracting the first 7 digits of each drug traceability code, it also includes: If it is recognized that the traceability code identification area of the drug has situations such as foreign object coverage, appearance displacement, or damage, generate a visual positioning frame based on the appearance characteristics of the drug, and display the position and appearance image of the drug with an unclear traceability code through the HIS terminal interface; Prompt the operator for manual review through an audible and visual signal; when the abnormality of the drug traceability code area is repaired by manual review and the traceability code is normally recognized, the drug dispensing process is resumed; when the operator manually reviews and confirms that the traceability code cannot be repaired, the drug dispensing process of this drug is paused and a drug recall protocol is triggered.
3. A drug management method based on a traceability code according to claim 1, characterized in that Before the drug dispensing link, it also includes: Establish a drug feature library, which includes name features and appearance features, and the appearance features include text layout, appearance color, shape, and traceability code identification position information; Real-time collect the appearance image of the drug to be dispensed through an image recognition device, and extract its outer contour, color distribution, and text area features; Based on the feature similarity algorithm, calculate the name similarity and appearance similarity between the current drug and all drugs in the feature library. If there is any drug with a similarity exceeding the preset threshold, display the comparison image and drug name of the drug with a high similarity through the HIS terminal interface, and mark the difference area; generate a review reminder instruction, including audible and visual alarms and manual review operation guides; If the operator manually reviews and confirms that the drug matches correctly, record the review result and continue the drug dispensing process; if it is found during the review that the match is incorrect, pause the drug dispensing and initiate a drug traceability verification by associating the traceability code.
4. The pharmaceutical management method based on a traceability code according to claim 3, wherein, After the operator completes drug dispensing and discovers an incorrect drug dispensing through the complete drug dispensing process and the complete drug traceability code, the following steps are also included: Based on the traceability code identification positions, appearance color distributions, and text layout features of the prescribed drug and the incorrect drug, calculate the name similarity and appearance similarity between the two; If the name similarity exceeds the first threshold and the appearance similarity is lower than the second threshold, it is determined that the incorrect drug dispensing is caused by drug name confusion; if the appearance similarity exceeds the second threshold and the name similarity is lower than the first threshold, it is determined that the incorrect drug dispensing is caused by appearance confusion; Generate a targeted training reminder instruction according to the error type and associate the operator information. The instruction includes at least one of the following: Push the drug name pronunciation comparison training and the generic name - trade name mapping relationship database to the operator with name confusion; push the difference area annotation atlas of drugs with highly similar appearances and the 3D rotation view training module to the operator with appearance confusion; The targeted training reminder instruction is automatically issued through the built-in learning platform of the HIS system, and the training completion status and assessment results are recorded.
5. The pharmaceutical management method based on a traceability code according to claim 4, characterized in that, After calculating the name similarity and appearance similarity between the current drug and all drugs in the feature library based on the feature similarity algorithm, the following steps are also included: If the operator corresponding to the current drug has made incorrect drug dispensing due to drug name confusion in historical drug dispensing, reduce the preset threshold of name similarity. The more times of incorrect drug dispensing caused by drug name confusion, the more the preset threshold of name similarity is reduced; If the operator corresponding to the current drug has made incorrect drug dispensing due to drug appearance confusion in historical drug dispensing, reduce the preset threshold of appearance similarity. The more times of incorrect drug dispensing caused by appearance confusion, the more the preset threshold of appearance similarity is reduced.
6. The method for managing medicines based on traceability codes according to claim 1 or 2, characterized in that, When extracting the first 7 digits of each drug traceability code, the edge computing device performs the following steps: Real-time capture the traceability code area on the drug appearance through an image sensor, and directly locate and segment the first 7-digit character area based on the preset physical position characteristics of the first 7 digits of the drug traceability code; Use a lightweight image recognition algorithm to independently decode the first 7 digits of the characters and generate a drug resource code string; Match the drug resource code string with the local drug feature library through the edge computing node. If the match is successful, directly return the drug basic information to the HIS system; if the match fails, trigger the full code recognition process.
7. The pharmaceutical management method based on a traceability code according to claim 6, wherein, It also includes: When it is detected that the number of people queuing at the drug collection window exceeds the preset threshold or it is judged by the historical data prediction model that there will be a peak in drug collection in the future period, start the dynamic speed regulation mechanism: Peak period processing mode, only identify the first 7 digits of the traceability code of the drug through the edge computing device to quickly match the drug basic information, and temporarily store the full code image in the local cache queue; Idle time completion mode, call the full code image for complete traceability code parsing during non-peak periods, and supplement the drug batch and expiration date information to the database; start the error correction algorithm for the full code images that have not been matched in the cache queue, including occlusion repair and blurred character enhancement processing; Data synchronization mechanism, the traceability code matching records generated during the peak period and the complete traceability code data completed during the idle time are synchronously uploaded to the database after being associated by the time stamp.
8. A drug management system based on traceability codes, characterized in that, It includes: The splitting module splits by using the first 7 digits of the drug traceability code as the traceability code, binds it with the drug specification information to form a traceability code database, and enters and maintains the mapping relationship between the first 7 - digit traceability code of the drug and the prescription information in the HIS system manually or semi - automatically; The matching module, in the drug dispensing link, extracts the first 7 - digit traceability code by scanning the drug traceability code and automatically compares it with the prescription information; if the traceability code matches successfully, the drug dispensing is completed, and the complete drug dispensing process and the complete drug traceability code are recorded in the database; If the match fails, an alarm is triggered and the drug dispensing process is paused; The said matching module includes: The image acquisition sub - module synchronously acquires images of the appearances of multiple drugs in the scanning area through an image recognition device, and locates and segments the traceability code area based on an image recognition algorithm; The traceability code merging sub - module, after extracting the first 7 digits of each drug traceability code, merges multiple traceability codes into a single data stream and synchronously transmits it to the HIS system; The comparison sub - module, the HIS system batch - compares multiple traceability codes according to the types and quantities of drugs in the prescription. If there are items with failed matches, an alarm is triggered and the drug dispensing process is paused; When the matching module extracts the first 7 digits of each drug traceability code, it also includes: The packaging recognition sub - module detects the contour and analyzes the material of the drug appearance in the scanning area through an image recognition device. If the drug appearance is recognized but the traceability code identification area is not detected, the following processing flow is triggered: The visual positioning sub - module generates a visual positioning frame based on the drug appearance characteristics, and displays the position and appearance image of the drug with the missing traceability code through the HIS terminal interface; The prompt for re - verification sub - module prompts the operator for manual re - verification through sound and light signals; when the traceability code is normally recognized after the operator manually re - verifies and adjusts the drug position, the drug dispensing process resumes.
Citation Information
Patent Citations
Drug traceability code acquisition method, system and device based on image recognition and medium
CN119647502A