1. Introduction
Healthcare systems continuously seek for innovative treatments to overcome the unmet health needs as well as the unforeseeable issues, such as COVID-19, that appear without prediction. Medicines are becoming more crucial in the global health coverage and, due to the high complexity and cost of their development and manufacturing, the pharmaceutical price is increasing, which is reflected in the life quality of the end user [
1,
2]. According to the World Health Organization (WHO), the counterfeit medicines are problematic, which is evidenced by their entry in the pharmaceutical supply chain, has been negatively affecting the worldwide health. In low and middle income countries, in the time period between 2007 and 2016, approximately 10.5% of the pharmaceutical products were substandard or falsified [
3]. Worldwide, between 2013 and 2017, 42% of all the reported counterfeit medicines were from Africa whilst 21% were from America and 21% from Europe [
4]. The accounting firm PwC states that 1–30% of drugs in circulation are fake and a high number of people die annually from toxic counterfeit pharmaceuticals [
5]. Actually, in 2015, a study related with substandard drugs to fight the malaria in sub-Saharan Africa estimated more than 122,000 deaths per year of children under the age of five [
6]. The profitable business associated with a large number of stakeholders belonging to the distribution network (illustrated in
Figure 1) increases the difficulty of controlling the market of fraudulently mislabeled medicines [
7].
The legislation applied in the Directive 2011/62/EU of the European Parliament and of the Council, and by the Commission Delegated Regulation (EU) 2016/161, looks forward to eradicate the counterfeit medicines by implementing a unique identifier which guarantees medication packaging authenticity. The regulation is set for the usage of a two-dimensional (2D) barcode—a machine-readable Data Matrix, which follows the format defined by the International Organization for Standardisation/International Electrotechnical Commission standard (‘ISO/IEC’) 16022:2006 [
8,
9,
10]. The National Medicine Verification Organization is the entity which allows the trace of medicine from the production to the patient, ensuring its integrity [
11], and holds the national repository where the data of the medicine packages circulating in the Portuguese territory resides. The national stakeholders will establish a connection with the repository to perform the verification and deactivation operations of the unique identifier of the Data Matrix. To evaluate the authenticity of the medicine, a comparison is performed between the information in the unique identifier registered by the entity responsible for uploading data to the European Medicines Verification System and the one in the medicine package [
12]. This procedure is required in Portugal since the 9th of February 2019, according to the Decree-Law n.º 128/2013 [
13].
Regarding the supply chain, at the pharmacy level, the medicine products are commonly packaged in three different levels: tertiary for logistics purposes (from the wholesaler to the pharmacy), secondary for inventory (performed within the pharmacy) and primary level, where the operator has direct contact with the product (e.g., vials or pills) as illustrated in
Figure 2. The medicines can be traced through a bar-code which identifies the product when electronically scanned [
14]. To ensure the interoperability of the pharmaceutical products verification repositories, it is mandatory to adopt a harmonized coding approach. The GS1 (Global Standards One) Data Matrix is embraced as the recommended standard, consisting in a unique identifier (product code—Global Trade Item Number (GTIN), serial number, batch number, expire date and, if required, the national registration number) and an anti-tampering device [
15].
There are actually several mathematical approaches to detect matrix-type markers, such as [
17,
18]. Some of the approaches are based on deep learning theory to solve the problem of barcode detection [
19]. These algorithms are useful to detect the required patterns in image. The description of the markers generation can be found in [
20].
Currently, some commercial solutions can achieve pharmaceutical product traceability through the Data Matrix reading. Funcode technology developed a QR Code/Data Matrix (2D Barcode) reader whose features comprise the scanning, with a Raspberry Pi, of tiny, moving and multiple barcodes using multiple cameras. The algorithm is robust to conditions such as non-uniform lighting or blurred and distorted codes. Its main applications include industrial automation, pharmaceutical products and consumer goods labels, intelligent logistics center, package tracking, automated tracking of product, among others [
21]. Scandit presents a mobile barcode scanning application robust to different 1D or 2D symbologies such as Data Matrix. MatrixScan allows to locate, track and decode multiple barcodes, while displaying feedback in the device’s screen as an Augmented Reality-overlay, to identify which have already been scanned. The software is able to handle barcodes in challenging conditions such as glare and metal reflections, low light and shadows, damaged, torn, and blurry barcodes, or skewed angles. Some applications in the healthcare sector emcompass shelf management, search-and-find packages, patient verification and medication tracking [
22]. In the pharmaceutical/medical industry, Cognex resorts to image-based fixed-mount barcode readers (including Data Matrix symbology) to ensure the simultaneous track-and-trace of multiple medical devices on high-speed production lines, multiples sides, and even extreme angles. The algorithm is able to efficiently scan blurred, damaged or low contrast barcodes. Additional applications include the automation of inspection and distribution of primary (e.g., vials or pre-filled syringes) and secondary (e.g., vaccine boxes) packages. Cognex supplies guidance to other markets such as logistics, life sciences and aerospace [
23].
To the best of the authors’ knowledge, there is still not a established solution to be applied at the national hospital pharmacies. In this work, a hospital pharmacy scenario is focused, more precisely the pharmacy department of the Centro Hospitalar de Vila Nova de Gaia/Espinho, E.P.E., Portugal, where, on average, more than 27,000 medicine packages are handled per month. Due to the lack of human resources, the action of having each medicine be manually validated at the secondary level by an operator by means of a scanner is burdensome, time-consuming and not the foremost task for the operator. To prioritize some medicine packages, criteria such as their medical significance or cost might be applied. Moreover, the aforementioned action is monotonous, tedious, frequent and highly repetitive, due to the recurrent lifting and transferring of packages, and repeated hand/wrist motions to place the scan in the correct position and press the button to detect the Data Matrix code [
24]. The addressed cases are common physical work-related risk factors that can cause upper limb musculoskeletal disorders to the operator [
25], and therefore should be avoided. To include all the information of medicine products in a pharmaceutical system, hence enabling their traceability, as well as to contribute to the operator’s ergonomy, a low cost solution for automating the simultaneous scanning of multiple medicine packages based on Data Matrix codes is proposed in this work. One important requirement was that the system should be easily integrated in the infrastructure of the Hospital Pharmacy.
The remainder of this paper is organized as follows.
Section 2 presents the proposed Methodology addressing the hardware, the system architecture and the Software employed.
Section 3 stresses the experimental results performed in hospital pharmacy facilities. Finally,
Section 4 outlines the work with conclusions, comprising functionalities that may be interesting to incorporate in the system in the near future.
3. Experiments and Results
The developed prototype was installed and tested at the Hospital Pharmacy of the Centro Hospitalar de Vila Nova de Gaia/Espinho, E.P.E., by technicians which perform the medicine packages registration. The proposed prototype is a stand-alone system that can be placed alongside with the conventional scanner, replacing it. A space of 300 mm × 300 mm in a table is enough to accommodate the developed reader (with a height of 400 mm). It requires to be supplied by 110 V or 230 V and it owns all the required hardware and software to introduce by USB the decodes matrix codes present on the boxes into the hospital system. The developed prototype was connected, by a USB link, to the same computer to which the original Data Matrix scanner is connected. The computer is used to send the verification codes to the central database. Instead of using the original Data Matrix scanner, the proposed system was assessed by reading the codes, decoding, and introducing them in the database by USB.
Figure 9 shows the prototype installed and tested at the hospital pharmaceutical facilities. The right monitor shows the developed application and the Data Matrix identified. The left one shows the hospital computer receiving the codes to validate.
The system is launched when the user presses the button and the lighting system is turned on for two seconds to stabilize the camera and capture the image. The LED turns red and the is used to extract and decode each Data Matrix. Each code is introduced into the hospital computer (as a keyboard) using the same settings and protocol as the original scanner was programmed. The acquired image and its Data Matrix codes identified and delimited by green squares, allow the user to visually validate the task.
Preliminary tests were executed in order to analyze the time and the robustness of the Data Matrix code detection system. According to the commonly performed process, a technician takes between half a second and one second to scan each medicine box. In contrast, the proposed system takes about two seconds to stabilize the image and an average of one second per box. Meanwhile, while the scanning is being performed, the technician can be redirected to do another task. The proposed system has the advantage to scan multiple codes at the same time. To assess the system robustness, the scanning process was performed on boxes covered by reflector plastic as well as rounded bottles, having achieved successful results, as demonstrated by
Figure 10.
The integration with the hospital software was tested and validated. Instead of using the original scanner to shoot Data Matrix codes one by one, the proposed system acquires one image and introduces several Data matrix codes sequentially without the intervention of the technician. The obtained feedback from four technicians (from different shifts) that used the prototype was very positive since they mentioned that the system allows them to do other tasks while introducing the codes increasing the productivity. Moreover, they pointed out some future work possibilities, such as using a conveyor belt to move the boxes in front of the camera in a FIFO (First In, First Out) cue type. Moreover, increasing the detection area was also pointed. As a statistical result, detection robustness was done with real medicine boxes. In total, about two hundred medicine boxes were placed in front of the camera (within 15 images) and 90% of Data Matrix codes were correctly identified, using the proposed system. The remaining codes had slight defects, such as being torn (as illustrated in
Figure 11) or their color being too grey.
In order to evaluate the illumination interference, a test was performed with different light conditions. The first test was executed turning the embedded illumination off. In this case (with a natural illuminance of 150 Lux), the extracting capacity was decreased to 18%, as presented in
Figure 12 where from eleven matrix codes, only two of them were extracted.
More tests were executed to evaluate the interference of the lighting.
Table 1 summarizes the obtained ratios for data matrix extractions with different lightings. The first three tests were evaluated with both LEDS panels off for an Illuminance of 5, 90 and 150 Lux. The proposed system is very dependent on the illumination conditions. As it can be observed, one LED panel is enough but brings some reflexes that are reduced with two LED panels assembled as previously addressed. In these cases (one and two LED panels on), the ratio of detection for six image samples were 100% even when changing the external illumination from 0 to 1000 Lux.
In order to improve the work, there are two main points that might be pointed out (to solve a limitation of the prototype), namely increasing the size of the acquired image, and a more powerful computational performance could be included to speed up the detection of matrix codes.
4. Conclusions and Future Work
The counterfeit medicine problem is still negatively affecting worldwide health. The Data Matrix code, a unique identifier that guarantees medication packaging authenticity, allows to trace a medicine from its production until its delivery to the patient. In the hospital pharmaceutical industry, at the secondary level, for the inventory task, the scanning of the medicine packages to introduce them into the management system is performed manually by the user through a Data Matrix reader. This paper proposes a low cost system to control medicine packages, acquiring a set of medicine boxes simultaneously and autonomously introducing them into the authentication database. A proof of concept was performed by installing the proposed system in a hospital pharmacy and testing it with real medicine. The achieved results were very encouraging, and it is expected that, with the addition of extra functionalities, the system can be used as a real support for the pharmacist work. The proposed prototype, works as a standalone system, that can be added to any validation system by connecting an USB port. It owns an embedded illumination system that eliminated the exterior lighting conditions. It could reach 90% of extraction ratio for real conditions and real medicines. Nevertheless, there are some limitations such as the small acquisition area and the processing time for extraction of the matrix codes.
As future work, feedback from the MVO database will be received through an ethernet port and the system will project the codes accordingly. For this purpose, a projection mapping will be used to assist the technician in the authentication operation. This task will be performed as soon as the information from the MVO is received. To improve the system flexibility and to avoid the user being forced to put the packages face with code upside, new cameras in distinct orientations will be integrated as well as the size of the work area will be increased. Additionally, including a conveyor belt in order to increase the amount of medicine packages which are autonomously scanned, and a robotic manipulator to pick the counterfeit medicine boxes, are improvements to consider. Finally, in order to improve the detection ratio, a machine learning based vision system could be added to detect matrix codes. Then, it would be possible to map the matrix codes and detect the missed ones improving their quality (e.g., rotation, histogram equalization, among others) and sent them again to the library. In this way, it would be possible to improve the detection and extraction.