System and method applied to uploading medicine minimum package traceability code information
The drug traceability code information uploading system utilizes machine vision technology to automatically identify and upload traceability code information, solving the problem of time-consuming and labor-intensive traceability information collection in existing technologies, and achieving efficient and low-cost drug traceability management.
Patent Information
- Application Number
- CN202511070040.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-12-30
AI Technical Summary
Current technologies for collecting traceability code information from the smallest packaging of pharmaceuticals are time-consuming and inefficient. They cannot meet the needs of large-scale pharmaceutical distribution scenarios, have high labor costs, and are difficult to achieve efficient traceability information collection.
Design a traceability code information uploading system for the smallest packaging of medicines, including an encoding generation module, an encoding printing module, a traceability relationship database, an image acquisition device, an identification processing module, and a data uploading module. The system uses machine vision technology to identify the character encoding information on the medicine packaging and establish a traceability relationship database to achieve automated information collection and uploading.
It simplifies the process of collecting drug traceability information, improves collection efficiency, reduces labor costs, adapts to the needs of large-scale drug distribution scenarios, and ensures the accuracy and completeness of traceability information.
Smart Images

Figure CN121234968A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of information synthesis, and in particular to a system and method for uploading information of a minimum packaging traceability code of a medicine. BACKGROUND
[0002] With the implementation of the medicine traceability management policy, the medicine industry has an increasingly urgent need for collecting information of a minimum packaging traceability code of a medicine. In view of this situation, in the prior art, information collection is mainly completed by manually scanning the traceability code on the packaging of a medicine one by one using a code scanning gun, and a dedicated person needs to be arranged to operate.
[0003] However, this method has obvious defects: the packaging of the medicine on which the traceability code is printed needs to be accurately turned to the direction of the code scanning gun during scanning, and the operation is tedious; since the traceability code of each minimum packaging is unique, the correspondence between the traceability code and the batch number cannot be recorded to simplify the multiple scanning process; and unpacked medicines cannot be scanned due to incomplete packaging. This results in time-consuming and labor-consuming information collection, low efficiency, high labor cost, and difficulty in adapting to large-scale medicine circulation scenarios.
[0004] Therefore, the problems of time-consuming and labor-consuming information collection, low efficiency, high labor cost, and difficulty in adapting to large-scale medicine circulation scenarios in the prior art need to be solved urgently. SUMMARY
[0005] The main purpose of the present application is to provide a system and method for uploading information of a minimum packaging traceability code of a medicine, aiming to solve the technical problems of time-consuming and labor-consuming information collection, low efficiency, high labor cost, and difficulty in adapting to large-scale medicine circulation scenarios in the prior art.
[0006] In order to achieve the above-mentioned purpose of the application, a system for uploading information of a minimum packaging traceability code of a medicine is provided, and the system comprises:
[0007] An encoding generation module is configured to generate character encoding information associated with a medicine traceability barcode based on medicine production information;
[0008] An encoding printing module is configured to print the character encoding information on 2 to 4 outer surfaces of the minimum packaging of the medicine;
[0009] A traceability relationship database is configured to store the correspondence between the traceability codes of various levels of packaging and the character encoding information;
[0010] An image acquisition device is configured to acquire an image of the packaging of the medicine containing the character encoding information;
[0011] An identification processing module is configured to perform asynchronous background processing on the image and identify the character encoding information;
[0012] The association module is used to associate the drug traceability code with the prescription information based on the character encoding information and the correspondence.
[0013] The data upload module is used to upload the associated drug traceability information to the regulatory system.
[0014] Furthermore, the character encoding information structure generated by the encoding generation module includes:
[0015] The first part of the characters represents the logo of the pharmaceutical manufacturing company;
[0016] The second part of the characters represents the identifier of the generic name of the drug;
[0017] The third part of the characters uses a specific encoding rule and contains production date and batch information.
[0018] Furthermore, the encoding and printing module prints the character encoding information in a preset color font on 2 to 4 outer surfaces of the smallest pharmaceutical packaging, and the background of each outer surface is a non-reflective material.
[0019] Furthermore, the identification processing module includes:
[0020] A color segmentation unit is used to segment a preset color region from the image;
[0021] The morphological processing unit is used for noise reduction and enhancement of the segmented regions;
[0022] The character recognition unit is used to recognize characters in the processed area;
[0023] The format verification unit is used to verify whether the recognition result conforms to the encoding format using regular expressions.
[0024] Furthermore, the system also includes a drug splitting management module, which is used to scan and record the traceability code and splitting information of the smallest package when drugs are split, establish a drug splitting database, and obtain the corresponding traceability code information from the drug splitting database when a prescription contains drugs split.
[0025] This application also proposes a method for uploading traceability code information for the smallest packaging of a drug, the method comprising:
[0026] Generate character encoding information associated with the drug traceability barcode, wherein the character encoding information includes the company identifier, the generic name of the drug identifier, and the production batch identifier;
[0027] The character encoding information is printed on 2 to 4 outer surfaces of the smallest pharmaceutical package;
[0028] Establish a database that maps traceability codes for each level of packaging to the character encoding information;
[0029] Obtain a drug packaging image containing the character encoding information;
[0030] The image is processed asynchronously in the background using machine vision technology, and the character encoding information is identified.
[0031] Based on the character encoding information and the corresponding relationship, associate the drug traceability code with the prescription information;
[0032] The associated drug traceability information will be uploaded to the regulatory system.
[0033] Furthermore, the character encoding information generated and associated with the drug traceability barcode includes:
[0034] The first part of the characters is set as an identifier representing the pharmaceutical manufacturing company;
[0035] The second part of the characters is set as an identifier representing the generic name of the drug;
[0036] The third part of the character is set to use a specific encoding rule, which includes production date and batch information.
[0037] Furthermore, printing the character encoding information on 2 to 4 outer surfaces of the smallest pharmaceutical package includes:
[0038] The character encoding information is printed in a preset color font on 2 to 4 outer surfaces of the smallest pharmaceutical package;
[0039] A background area made of non-reflective material is set on each outer surface for printing the character encoding information.
[0040] Furthermore, the asynchronous background processing of the image using machine vision technology and the recognition of the character encoding information includes:
[0041] Color segmentation and morphological processing are performed on the acquired images;
[0042] Use OCR technology to recognize short code characters;
[0043] Validate the validity of character encoding information format using regular expressions.
[0044] Furthermore, the method also includes:
[0045] When dispensing medicines into smaller quantities, scan and record the traceability code and dispensing information of the smallest package.
[0046] Establish a database of drugs sold in smaller quantities, storing the relationship between the traceability codes of these drugs and prescription information;
[0047] When a prescription contains medications sold in smaller quantities, the corresponding traceability code information is obtained from the medication database and uploaded to the regulatory system.
[0048] This application's encoding generation module generates character encoding information for associated traceability codes, which, combined with the encoding printing module, is printed on 2 to 4 outer surfaces of the smallest drug packaging. Information can be collected without manually flipping the packaging, simplifying the operation. The traceability relationship database stores the corresponding relationships, avoiding the hassle of multiple scans required due to the uniqueness of the traceability code. The image acquisition device and recognition processing module recognize the character encoding information through images, enabling batch processing and improving efficiency. The association module associates the traceability code with prescription information, and the data upload module uploads it to the regulatory system, achieving efficient information integration and uploading. At the same time, it provides a foundation for the management of discontinued drugs, comprehensively improving the convenience and efficiency of drug traceability information collection, reducing labor costs, and adapting to large-scale drug distribution scenarios. Attached Figure Description
[0049] Figure 1 This is a schematic block diagram of a system for uploading traceability code information of the smallest packaging of medicines, according to an embodiment of this application.
[0050] Figure 2 This is a flowchart illustrating a method for uploading traceability code information of the smallest packaging of a drug according to an embodiment of this application;
[0051] Figure 3 This is a schematic diagram of the drug storage process in a pharmacy according to an embodiment of this application;
[0052] Figure 4 This is a schematic diagram of a pharmacy dispensing process according to an embodiment of this application;
[0053] Figure 5 This is a schematic block diagram of the structure of a computer device according to an embodiment of this application.
[0054] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0056] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when an element is referred to as “connected” or “coupled” to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein may include wireless connections or wireless coupling. The term “and or” as used herein includes all or any modules and all combinations of one or more associated listed items.
[0057] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0058] Reference Figure 1 This invention provides a system for uploading traceability code information for the smallest packaging of pharmaceuticals. The system includes:
[0059] The encoding generation module 100 is used to generate character encoding information associated with the drug traceability barcode based on drug production information;
[0060] The coding printing module 200 is used to print the character coding information on 2 to 4 outer surfaces of the smallest pharmaceutical packaging;
[0061] The traceability database 300 is used to store the correspondence between the traceability codes of each level of packaging and the character encoding information;
[0062] Image acquisition device 400 is used to acquire images of drug packaging containing the character encoding information;
[0063] The recognition processing module 500 is used to perform asynchronous background processing on the image and recognize the character encoding information;
[0064] The association module 600 is used to associate the drug traceability code with the prescription information based on the character encoding information and the correspondence relationship;
[0065] The data upload module 700 is used to upload the associated drug traceability information to the regulatory system.
[0066] As described in this embodiment, the encoding generation module 100 generates character encoding information associated with the traceability barcode based on the drug production information. The encoding generation module 100 generates 8-bit character encoding information, and the "8-bit character encoding information" can also be referred to as "short code" or "character encoding information". For example, for the "Ibuprofen Tablets" produced by a certain pharmaceutical factory, the 3692nd box of drugs produced on May 15th, the module will generate "Jianbu - EB3%0" (the first character "Jian" represents the pharmaceutical factory, the second and third characters "Bu -" represent Ibuprofen Tablets, the fourth character "E" corresponds to May 15th, and the last four characters "B3%0" are a 40 -进制 sequence code). Among them, it is made by combining numbers, letters, Chinese characters, and symbols. From left to right, the first character is a Chinese character corresponding to the company (such as "Yue" representing Guangdong Province), the second and third characters are Chinese characters corresponding to the generic name of the drug, and the fourth to eighth characters are 0 - 9A - Z!?, #% in base 40. The 4th character represents the 31st day of a month, and the last 4 characters represent the sequence code of the produced drugs. This sequence code can accommodate 4 to the power of 4 combinations, and the sequence code can correspond to the traceability code on each box of the daily output packaging. The encoding printing module 200 prints this encoding in red font (the first preset color) on the front, back, left, and right four outer surfaces of the smallest package of the drug, and each surface uses a white non - reflective background (the second preset color). For example, the four sides of the small box of Ibuprofen Tablets are all printed with the red "Jianbu - EB3%0", avoiding the trouble of flipping the package when scanning the code. The traceability relationship database 300 is pre - established by the pharmaceutical factory and sent to the hospital, storing the corresponding relationship between the traceability codes of each level of packaging and the encoding. For example, the box code "BLF20250515001" of this box of Ibuprofen corresponds to the box codes "BLF20250515001 - 001" to "-500", and each box code corresponds to the encoding "Jianbu - E0000" to "E%%%%". The pharmacy can write these corresponding relationships into the database by scanning the box code. The image acquisition device 400 uses a high - definition camera to take pictures of the prescription drugs when dispensing in the pharmacy. For example, if the prescription contains 3 boxes of the above - mentioned Ibuprofen, the staff places them in the photographing area, and the camera automatically takes pictures of the image containing the encoding and saves it with the name "20250728 - Prescription001.jpg". The recognition processing module 500 calls OpenCV for color segmentation, extracts the red encoding area, and after morphological processing to reduce noise, recognizes the encoding such as "Jianbu - EB3%0" through TesseractOCR, and then uses regular expressions to verify whether the format conforms to the rule of "Chinese character + Chinese character + base 40". The association module 600 queries the traceability relationship database 300 according to the recognized encoding, obtains the corresponding traceability code "BLF20250515001 - 123", and associates it with the patient information and drug information of Prescription001. The data upload module 700 uploads the associated information such as "Prescription001 + Patient Zhang San + Ibuprofen Traceability Code BLF20250515001 - 123" to the social security supervision system.In this process, multi-sided printing of codes eliminates the need to flip the packaging, batch image recognition improves efficiency, and database association avoids repeated scanning. For example, a single photograph of three boxes of medicine can simultaneously identify the codes and complete the association, significantly reducing labor costs and laying the foundation for the management of disassembled medicines. For instance, when disassembling ibuprofen, the system can quickly match traceability information through the codes.
[0067] In one embodiment, the character encoding information structure generated by the encoding generation module 100 includes: a first part of characters representing the identifier of the pharmaceutical manufacturing company; a second part of characters representing the identifier of the generic name of the drug; and a third part of characters, which adopts a specific encoding rule and includes production date and batch information.
[0068] In this embodiment, the character encoding information structure is designed to closely align with the needs of pharmaceutical production and distribution. For example, the character encoding information for "Ambroxol Hydrochloride Oral Solution" produced by a pharmaceutical factory in Beijing can be designed as "DuMuShu 0305A". The first part, "Du", is the Chinese character identifier representing the manufacturing company, directly linking to the enterprise information of the Beijing pharmaceutical factory; the second part, "MuShu" (a common abbreviation for the generic name of a drug), clearly points to the generic name of the drug, facilitating rapid identification of the drug type; the third part uses a specific encoding rule, where "0" represents the tenth day of the current month, and "305A" is the serial number within the batch, containing both production date information and distinguishing different smallest packages within the same batch. This structure ensures the simplicity of the encoding while achieving precise association between the production entity, drug type, and production batch through hierarchical identification, solving the problems of lengthy and difficult-to-identify traditional traceability codes. It also provides a clear format basis for machine vision recognition; for example, in image recognition, the information of each part can be quickly located through character positions, improving recognition efficiency.
[0069] In one embodiment, the encoding printing module 200 prints the character encoding information in a preset color font on 2 to 4 outer surfaces of the smallest pharmaceutical packaging, and the background of each outer surface is a non-reflective material.
[0070] In this embodiment, the design focus of the encoding and printing module 200 solves the problem of recognition accuracy during image acquisition. The preset color font usually selects high-contrast red, and the background uses white non-reflective cardboard material. For example, for the smallest package (aluminum-plastic board box) of a certain antibiotic drug, the four outer surfaces of the front, back, left, and right are all printed with the red code "Xiaobao Six 057#4", and the white background of each surface is matte-treated to avoid the generation of reflective light spots when illuminated by light. The advantage of this design is that when the image acquisition device 400 (such as a high-definition camera) takes pictures of the drug, the red font and the white non-reflective background form a strong visual contrast, which is convenient for the color segmentation unit in the machine vision recognition module to quickly locate the coding area. For example, when dispensing drugs in a pharmacy, the staff does not need to deliberately turn the drug, and the camera can clearly capture the code from any angle. Even if the drugs are stacked, the codes on each package can be distinguished through color differences, effectively solving the problem that traditional barcode scanning requires precise alignment with the direction of the two-dimensional code, and improving the batch acquisition efficiency.
[0071] In one embodiment, the recognition and processing module 500 includes: a color segmentation unit for segmenting a preset color area from the image; a morphological processing unit for denoising and enhancing the segmented area; a character recognition unit for recognizing characters in the processed area; and a format verification unit for verifying whether the recognition result conforms to the coding format through a regular expression.
[0072] In this embodiment, the recognition and processing module 500 achieves accurate recognition of the code through multi-step cooperation. For example, when the image acquisition device 400 captures an image of a drug package containing the red code "Xieganmao 2307C", the color segmentation unit first uses the color threshold function of OpenCV to segment the red area (preset color area) from the image, excluding the interference of other color patterns on the package; the morphological processing unit removes the noise points in the area (such as the shadows generated by package wrinkles) through operations such as erosion and dilation, and enhances the character edges to make the blurred character contours of "2", "3", etc. clearer; the character recognition unit calls the Tesseract OCR tool to recognize the processed area and outputs the character sequence "Xieganmao 2307C"; the format verification unit then verifies whether this sequence conforms to the format of "Chinese character + specific code" through a preset regular expression, and determines that the recognition is valid after confirmation. The advantage of this step-by-step processing is that each step targets and solves the recognition obstacles - color segmentation excludes irrelevant information, morphological processing improves the image quality, OCR recognition converts characters, and regular verification ensures the correct format. For example, when the recognition result is "Xieganmao 2307" (one digit less), the verification unit will directly determine it as invalid, preventing incorrect information from entering the subsequent process.
[0073] In one embodiment, the system further includes a drug splitting management module, used to scan and record the traceability code and splitting information of the smallest package when drugs are split; to establish a drug splitting database to store the association between the traceability code of the drug splitting and the prescription information; and to obtain the corresponding traceability code information from the drug splitting database when the prescription contains the drug splitting.
[0074] In this embodiment, the repackaged medication management module specifically addresses the issue of collecting traceability information for repackaged medications. For example, when a pharmacy repackages "nifedipine tablets" into smaller units, staff first scan the traceability code "SN20230601001" of the smallest package of the entire box of medication with a barcode scanner, and enter information such as the quantity repackaged (e.g., 30 tablets) and the repackaged date (June 10, 2023) into the system. The repackaged medication management module stores this information in the repackaged medication database, forming a linked record of "traceability code SN20230601001 - quantity repackaged 30 - repackaged date 20230610". When a patient's prescription includes "2 nifedipine tablets" (repackaged medication), the system automatically queries the repackaged medication database, retrieves the traceability information corresponding to the earliest repackaged "SN20230601001" according to the first-in-first-out principle, and associates it with the prescription information. The advantage of this module is that it solves the problem of traditional medicines sold in smaller quantities being unable to be scanned due to damaged packaging. By recording the traceability code of the entire box in advance and linking it with the information on the smaller quantities, the traceability chain of medicines sold in smaller quantities is ensured to be complete. For example, when it is necessary to trace the source of a patient's smaller quantities of nifedipine tablets, the original packaging traceability code can be quickly located through the prescription information, which meets regulatory requirements.
[0075] Reference Figure 2 In one embodiment, this application proposes a method for uploading traceability code information for the smallest packaging of a drug, the method comprising:
[0076] S1. Generate character encoding information associated with the drug traceability barcode, wherein the character encoding information includes the company identifier, the generic name identifier of the drug, and the production batch identifier;
[0077] S2. Print the character encoding information on 2 to 4 outer surfaces of the smallest drug packaging;
[0078] S3. Establish a database of the correspondence between the traceability codes of each level of packaging and the character encoding information;
[0079] S4. Obtain a drug packaging image containing the character encoding information;
[0080] S5. The image is processed asynchronously in the background using machine vision technology, and the character encoding information is identified.
[0081] S6. Based on the character encoding information and the corresponding relationship, associate the drug traceability code with the prescription information;
[0082] S7. Upload the associated drug traceability information to the supervision system.
[0083] In this embodiment, S1 is the character encoding information generation step, the core of which is to encode and integrate key information such as the drug production company, generic name, and production batch. This step lays the foundation for subsequent traceability work. Through specific encoding rules, the originally scattered information is condensed into a short code that is convenient for identification and management. For example, for the "Ganmaoling Granules" produced by a certain pharmaceutical factory, the company identifier is "Zhu", the generic name identifier is "Ganling", and the production batch is the 123rd batch on the 5th day of the current month. According to the rules, the encoding "ZhuGanling50123" is generated and associated with the drug traceability barcode, thus establishing the corresponding relationship between the short code and the unique traceability identifier.
[0084] S2 is the encoding printing step, aiming to make the encoding clearly presented on the drug packaging for subsequent acquisition by image acquisition devices. Selecting 2 to 4 outer surfaces for printing is to increase the possibility of recognition. Even if one surface is blocked, there are other surfaces available for recognition. At the same time, using a preset color font and a non-reflective background material is to improve the accuracy of machine vision recognition. For example, printing the encoding in red font on white non-reflective cardboard. During image acquisition, the red font forms a strong contrast with the white background, reducing the interference of factors such as ambient light on recognition and making it easier for the machine to accurately recognize the encoding content.
[0085] S3 is to establish a corresponding relationship database, which is the key to realizing the association of traceability information. Store the traceability codes of each level of packaging corresponding to the generated character encoding information, so that in subsequent processing, the corresponding traceability code can be quickly found through the encoding. Just like an index directory, the encoding is the keyword, and through this keyword, the corresponding traceability code information can be found. For example, the case code, box code, and minimum packaging traceability code of a certain drug are all associated and stored in the database with the encoding "ZhuGanling50123". When querying the traceability information of this drug, as long as the encoding is recognized, all relevant traceability codes can be found through the database.
[0086] S4 is the image acquisition step, which collects the drug packaging image containing the encoding through devices such as high-definition cameras, providing the original data for subsequent machine vision recognition. This step requires the image to be clear and complete, accurately reflecting the character encoding information on the drug packaging for subsequent processing.
[0087] S5 is the machine vision processing and recognition stage, which processes and recognizes the collected images with the help of machine vision technology. First, color segmentation is carried out to extract the area where the code is located from the complex image background; then morphological processing is carried out to optimize the extracted area, remove noise points, enhance the character edges, and make the code clearer; then the OCR technology is used to recognize the characters, converting the code in the image into text information; finally, the format of the recognition result is verified through regular expressions to ensure the accuracy of the recognition. For example, after collecting an image containing the code "Zhuganling 50123", through a series of processing and verification, the code content is accurately recognized.
[0088] S6 is the information association stage. According to the recognized character code information, the relevant traceability code is searched in the corresponding relationship database, and then the traceability code is associated with the prescription information. This step realizes the binding of the drug entity and the prescription information, providing detailed information on the drug flow for the regulatory department. For example, when a patient goes to pick up the medicine with a prescription containing this drug, the system finds the corresponding traceability code by recognizing the code and associates the traceability code with the patient's prescription information.
[0089] S7 is the information upload stage, which uploads the associated drug traceability information to the regulatory system. This is the ultimate goal of the whole method. By uploading the information, the regulatory department can timely master the flow and usage of drugs, realize the whole-process supervision of drugs, and ensure the safety of drug use.
[0090] Referring to Figure 3, specifically, in the actual usage scenario, taking a certain hospital's handling of "Amoxicillin Capsules" as an example, the implementation process of this method is as follows:
[0091] Referring Figures 3-4 , taking a certain hospital's handling of "Amoxicillin Capsules" as an example, the implementation process of this method is as follows:
[0092] In the link of drug warehousing in the pharmacy, the process starts with importing the drug data of the pharmaceutical company, which is the basic data source for all subsequent operations. Subsequently, the "box code" is scanned to complete the drug warehousing. During this process, the pharmaceutical factory generates the code "Su阿莫 G3KL#" ("Su" represents a pharmaceutical factory in Jiangsu, "阿莫" corresponds to the generic name of the drug, "G" indicates production on the 17th of the current month, and "3KL#" is a 40 -进制 sequence code), and associates the unique traceability barcode of the drug; at the same time, the hospital pharmacy synchronously establishes the corresponding relationship database between the box code, box code, and the traceability code of the smallest package of this drug and the code "Su阿莫 G3KL#", and writes the short code and traceability code of the warehoused drug into the database to ensure the integrity and accuracy of the data.
[0093] Upon entering the pharmacy dispensing process, a dispensing slip is first printed, converting the prescription information into an operational document. After scanning the dispensing slip, the prescription information is transferred to the "Dispensing in Progress" list for easy subsequent dispensing operations. After the pharmacist dispenses the medication, a high-definition camera captures an image of the drug packaging containing the code. Machine vision technology then processes the image: first, the red coded area is segmented, then morphological processing is used to reduce noise and enhance character edges, then OCR is used to identify "Su-Amo G3KL#", and finally, regular expressions are used to verify the validity of the encoding format.
[0094] Next, the system queries the corresponding relational database based on the identified code to obtain the associated minimum packaging traceability code "AML202405011234", and associates it with prescription information (such as prescription number 20250810004 and patient Li). Then, the system generates a prescription dispensing list from the drug information parsed by the AI recognition module, and determines whether this list matches one of the prescriptions in the "Dispensing in Progress" list. If no match is found, an error message is displayed; if a match is found, the system continues to check if there are other identical prescriptions in the "Dispensing in Progress" list. If so, a selection interface is displayed; otherwise, the prescription is removed from the "Dispensing in Progress" list and a number is called.
[0095] When a patient picks up their medication, the system uploads the associated drug traceability information to the regulatory system during the dispensing process, completing the entire procedure.
[0096] This process, through coding association and machine vision recognition, enables the collection of traceability information across the entire chain from drug warehouse entry to pharmacy dispensing, solving the problem of low efficiency caused by the need to scan each traditional traceability code individually, and improving the accuracy and efficiency of drug traceability.
[0097] In one embodiment, the generation of character encoding information associated with the drug traceability barcode includes:
[0098] S10. Set the first part of the characters to represent the identifier of the pharmaceutical manufacturing company;
[0099] S11. Set the second part of the characters to an identifier representing the generic name of the drug;
[0100] S12. Set the third part of the characters to use a specific encoding rule, which includes the production date and batch information.
[0101] In this embodiment, taking the "Ganmaoling Granules" produced by a certain pharmaceutical factory as an example, character coding information starts to be generated at the stage of importing drug data of the pharmaceutical company into the warehouse. First, the first part of the characters is set as "Note", representing that the drug manufacturer is a certain pharmaceutical factory in Guangdong; then the second part of the characters is set as "Ganling", as the identifier of the drug generic name "Ganmaoling Granules"; finally, the third part of the characters adopts a 40 -进制 coding rule, such as "50123", where "5" represents the production date as the 5th day of the current month, and "0123" represents the production batch information of the 123rd batch of that month. And this code "Note Ganling 50123" is associated with the unique traceability barcode of the drug. In the subsequent pharmacy dispensing link, operations such as scanning the dispensing list, dispensing drugs, and taking pictures of drugs for verification are all carried out based on this character coding information. The code is recognized through machine vision technology, and then the traceability code is associated with the prescription information according to the corresponding relationship database, and finally uploaded to the supervision system. The whole process is closely linked to ensure the accurate upload of drug traceability information.
[0102] In one embodiment, the coding printing module 200 prints the character coding information on 2 to 4 outer surfaces of the minimum drug package in a preset color font, and the background of each outer surface is a non - reflective material.
[0103] In this embodiment, taking the drug package of "Ganmaoling Granules" as an example, before the drug enters the warehouse, the pharmaceutical factory prints the generated code "Note Ganling 50123" on four outer surfaces of the minimum drug package in a preset color font (such as red, blue, etc.), and the background of each outer surface uses white non - reflective cardboard material. In the pharmacy dispensing link, when taking pictures of drugs for verification, the high - definition camera takes pictures of the drug package image containing this code. Since the red font forms a strong contrast with the white non - reflective background, machine vision technology can more accurately perform color segmentation, extract the coding area, and then accurately recognize the character coding information through steps such as morphological processing and OCR recognition, providing a reliable basis for subsequent associating the drug traceability code with the prescription information and uploading it to the supervision system, ensuring the accuracy and efficiency of drug traceability information collection in the whole process.
[0104] In one embodiment, printing the character coding information on 2 to 4 outer surfaces of the minimum drug package includes: printing the character coding information on 2 to 4 outer surfaces of the minimum drug package in a preset color font; and the background of each outer surface is a non - reflective material.
[0105] In this embodiment, taking the drug packaging of "Ganmaoling Granules" as an example, before the drugs are warehoused in the pharmacy, the pharmaceutical factory prints the generated code "Zhuganling 50123" in red font (preset color font) on the three outer surfaces of the smallest drug package, and the background of each outer surface is made of white non-reflective cardboard material. In the process of drug dispensing in the pharmacy, when taking pictures of the drugs for verification, a high-definition camera captures the drug package image containing this code. Since the red font forms a strong contrast with the white non-reflective background, machine vision technology can perform color segmentation more accurately, extract the coding area, and then accurately identify the character coding information through steps such as morphological processing and OCR recognition, providing a reliable basis for subsequently associating the drug traceability code with the prescription information and uploading it to the supervision system, ensuring the accuracy and efficiency of drug traceability information collection throughout the process.
[0106] In one embodiment, the asynchronous background processing of the image by machine vision technology and the identification of the character coding information include:
[0107] S20. Perform color segmentation and morphological processing on the captured image;
[0108] S21. Use OCR technology to identify short code characters; verify the validity of the character coding information format through regular expressions.
[0109] In this embodiment, taking the drug dispensing of "Ganmaoling Granules" in the pharmacy as an example, after a high-definition camera captures the drug package image containing the code "Zhuganling 50123" during the drug picture verification process, color segmentation is first performed to extract the red coding area and exclude the interference of other color patterns on the package; then morphological processing is carried out, and noise points in the area, such as shadows generated by package wrinkles, are removed through operations such as erosion and dilation, while enhancing the character edges to make the blurred character contours clearer; then OCR technology is used to identify the coding characters "Zhuganling 50123"; finally, it is verified through regular expressions whether the code conforms to the preset format, such as whether it contains correct company identification, generic name identification, production batch identification and other rules. After confirmation, it is determined that the identification is valid. This series of operations ensures the accuracy of the character coding information in subsequent processes such as uploading the photo to the AI recognition module and judging the prescription dispensing list, laying a solid foundation for associating the drug traceability code with the prescription information and uploading it to the supervision system.
[0110] In one embodiment, the method further includes:
[0111] S30. Scan and record the traceability code and dispensing information of the smallest package when the drug is dispensed;
[0112] S31. Establish a database for dispensed drugs to store the association relationship between the traceability code of the dispensed drugs and the prescription information;
[0113] S32. When a prescription contains medications sold in smaller quantities, the corresponding traceability code information is obtained from the medications sold in smaller quantities database and uploaded to the regulatory system.
[0114] In this embodiment, taking the dispensing of "Cold Relief Granules" in smaller quantities at a pharmacy as an example, when dispensing medicine in smaller quantities, staff first scan and record the traceability code "AML20240601123" of the smallest package of the medicine, as well as the dispensing information, such as the dispensing date being June 10, 2024, and the quantity being 10 packets. Then, a database of dispensed medicines is established, linking the traceability code with the dispensing information and subsequent related prescription information. When a prescription contains this dispensed medicine, the system retrieves the corresponding traceability code "AML20240601123" from the database, associates it with the prescription information, and finally uploads it to the regulatory system. Throughout the entire process, whether it's the medicine entering the pharmacy warehouse, the printing and scanning of dispensing slips at the pharmacy, or the subsequent photo verification of the medicine, all steps are interconnected with the traceability information management of dispensed medicines, ensuring the integrity and traceability of the traceability information of dispensed medicines throughout the entire circulation process, meeting regulatory requirements.
[0115] Reference Figure 5 This application also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores usage data used in the process of uploading traceability code information for the smallest packaging of pharmaceuticals. The network interface allows communication with external terminals via a network connection. Furthermore, the computer device may also include input devices and a display screen. When the aforementioned computer program is executed by a processor to implement a method for uploading traceability code information for the smallest packaging of pharmaceuticals, the method includes the following steps: generating character encoding information associated with the pharmaceutical traceability barcode, wherein the character encoding information includes a company identifier, a generic name identifier for the pharmaceutical product, and a production batch identifier; printing the character encoding information on 2 to 4 outer surfaces of the smallest packaging of the pharmaceutical product; establishing a database of correspondences between traceability codes for each level of packaging and the character encoding information; acquiring an image of the pharmaceutical packaging containing the character encoding information; asynchronously processing the image in the background using machine vision technology and recognizing the character encoding information; associating the pharmaceutical traceability code with prescription information based on the character encoding information and the correspondence; and uploading the associated pharmaceutical traceability information to the regulatory system. Those skilled in the art will understand that...Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer equipment on which the present application is applied.
[0116] One embodiment of this application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements a method for uploading traceability code information for the smallest packaging of a drug, comprising the following steps: generating character encoding information associated with the drug traceability barcode, the character encoding information including a company identifier, a generic drug name identifier, and a production batch identifier; printing the character encoding information on two to four outer surfaces of the smallest packaging of the drug; establishing a database of correspondences between traceability codes for each level of packaging and the character encoding information; acquiring an image of the drug packaging containing the character encoding information; asynchronously processing the image in the background using machine vision technology and recognizing the character encoding information; associating the drug traceability code with prescription information based on the character encoding information and the correspondence; and uploading the associated drug traceability information to a regulatory system. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0117] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media provided in this application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0118] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0119] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A system for uploading information of a trace code of a smallest package of a pharmaceutical product, characterized in that, The system comprises: An encoding generation module for generating character encoding information associated with a drug traceability barcode based on drug production information; An encoding printing module for printing the character encoding information on 2-4 outer surfaces of a drug smallest package; A traceability relationship database for storing a correspondence relationship between traceability codes of various levels of packages and the character encoding information; An image acquisition device for acquiring a drug package image containing the character encoding information; An identification processing module for asynchronously processing the image in the background and identifying the character encoding information; An association module for associating a drug traceability code with prescription information according to the character encoding information and the correspondence relationship; A data uploading module for uploading the associated drug traceability information to a regulatory system.
2. The system of claim 1, wherein, The character encoding information structure generated by the encoding generation module comprises: A first part of characters representing the identification of a drug production company; A second part of characters representing the identification of a drug generic name; A third part of characters adopting a specific encoding rule, which contains production date and batch information.
3. The system of claim 1, wherein, The encoding printing module prints the character encoding information on 2-4 outer surfaces of a drug smallest package in a preset color font, and the background of each outer surface is a non-reflective material.
4. The system of claim 1, wherein, The identification processing module comprises: A color segmentation unit for segmenting a preset color area from the image; A morphological processing unit for noise reduction and enhancement processing of the segmented area; A character recognition unit for character recognition of the processed area; A format verification unit for verifying whether the recognition result conforms to the encoding format through a regular expression.
5. The system of claim 1, wherein, The system further comprises a broken drug management module for scanning and recording the traceability code and broken information of the smallest package when the drug is broken, establishing a broken drug database, and obtaining the corresponding traceability code information from the broken drug database when the prescription contains broken drugs.
6. A method for uploading information of a drug product minimum package traceability code, characterized by, The method comprises: Generating character encoding information associated with a drug traceability barcode, which contains company identification, drug generic name identification, and production batch identification; Printing the character encoding information on 2-4 outer surfaces of a drug smallest package; Establishing a correspondence relationship database between traceability codes of various levels of packages and the character encoding information; Acquiring a drug package image containing the character encoding information; Asynchronously processing the image in the background and identifying the character encoding information through machine vision technology; Associating a drug traceability code with prescription information according to the character encoding information and the correspondence relationship; Uploading the associated drug traceability information to a regulatory system.
7. The method of claim 6, wherein, The generation of character encoding information associated with a drug traceability barcode comprises: Setting the first part of characters as the identification of a drug production company; Setting the second part of characters as the identification of a drug generic name; Setting the third part of characters to adopt a specific encoding rule, which contains production date and batch information.
8. The method of claim 6, wherein, The printing of the character encoding information on 2-4 outer surfaces of a drug smallest package comprises: Printing the character encoding information on 2-4 outer surfaces of a drug smallest package in a preset color font; A background area with non-reflective material is arranged on each outer surface for printing the character coding information.
9. The method of claim 6, wherein, The asynchronous background processing of the image and the recognition of the character coding information by the machine vision technology comprises: color segmentation and morphological processing of the collected image; identification of short code characters by OCR technology; verification of the validity of the format of the character coding information by regular expression.
10. The method of claim 6, wherein, The method further comprises: scanning and recording the traceability code and the unpacking information of the minimum package when the medicine is unpacked; establishing a database of unpacked medicines to store the association between the traceability code and the prescription information of the unpacked medicines; when the prescription contains unpacked medicines, obtaining the corresponding traceability code information from the database of unpacked medicines and uploading it to the supervision system.