Smart Drainage Monitoring System Establishment: Case Study in Pleural Effusion Drainage and Its Application

(3) unplanned chest tube/catheter removal by the patients. Moreover, the rapid drainage of large pleural effusion volumes leads to reexpansion pulmonary edema (RPE), which can threaten the patient’s life. Hence, the current drainage system needs to monitor the heart rate or respiration rate. In this study, we intend to establish a smart drainage monitoring system that could improve the traditional drainage system functions, including (1) drainage volume and speed estimation, removal warning, and heart rate monitoring, and (2) its applications to drainage monitoring in both the thoracic cavity and the abdominal cavity. We expect that we can improve the function of the drainage monitoring system in terms of drainage volume, physiological signals, and safety confirmation.


Introduction
Pleural effusion can be classified as pulmonary edema and hemothorax. Among the causes of pleural effusion, which include heart diseases, pulmonary hypertension, hypertension, cirrhosis, renal insufficiency, and hypoalbuminemia, among others; heart diseases contribute to a major proportion of pulmonary edema. Heart diseases cause the accumulation of blood in the heart. When blood from the lungs attempts to return to the heart, the increased internal cardiac pressure blocks the blood reflux. This makes water in the blood enter the interstitial space in tissues, which thus interferes with gaseous exchange and pulmonary edema. Furthermore, hemothorax is a type of pleural effusion that is caused by extrathoracic trauma, malignant effusion, pneumonia, and autoimmune diseases or after thoracic surgery (e.g., open heart surgery and lobotomy). (1)(2)(3) An extremely high effusion volume (>1000-1500 mL) results in dyspnea, whereas purulent effusion leads to infection. In general, drainage tubes are inserted through a thoracic puncture for the drainage of the pleural effusion as recommended by clinicians. (4) The catheters used in this case include large-diameter chest tubes and smalldiameter pigtail catheters, as shown in Figs. 1(a) and 1(b). The pleural effusion can be drained through a catheter inserted through the thoracic wall to a negative-pressure water-seal chest bottle. A significant increase in pleural effusion volume generally affects breathing and becomes life-threatening to the patient. The following strategies are applied in clinical practice: • A puncture needle is inserted into the pleural cavity to drain the effusion out of the body.
Approximately 1500 mL of effusion could be drained in one session. A catheter can be inserted through the thoracic wall into the thoracic cavity for drainage when the pleural effusion volume is large. • Thoracic puncture, chemical pleurodesis, and pleuroperitoneal shunt, among others, can be used for treating pleural effusion. • Antibiotics and pus drainage are used for treating empyema caused by infection.
In clinical practice, after determining the pleural effusion volume and site, the principle of negative pressure is applied to drain the pleural effusion into a chest bottle, as shown in Fig. 2. The drainage devices and techniques that are currently used are not equipped with automatic sensors for performing the following functions: (1) automatic notification to the nurse when the target volume is achieved during drainage, (2) providing warning when the drainage has not achieved the expected height during the set duration, which might indicate the presence of obstruction in the drainage catheter, (3) monitoring blood circulation and respiration during drainage, and (4) monitoring the removal or detachment (unplanned removal) of drainage catheters in patients during drainage. Considering these issues, we expect that the monitoring  aid developed in this study can improve the smart drainage monitoring system's drainage and monitoring functions of physiological signals, drainage volume, and safety confirmation.

Techniques for drainage volume estimation
In clinical practice, pleural effusion is generally examined using methods such as chest X-ray, computed tomography (CT) scan, and chest ultrasound, (5)(6)(7)(8)(9)(10)(11)(12) which are used to estimate the liquid level of the pleural effusion. Before drainage, approximately 20 mL of the effusion is initially sampled and the cause of the effusion is determined by the appearance and test results of the effusion sample. During drainage, the chest bottle must be placed approximately 60 cm lower than the thoracic cavity to prevent the backflow of liquid into the chest bottle. A medical tape is used to secure the connection between the chest tube or the pigtail catheter and the chest bottle to prevent the tubing from loosening. The principle of negative-pressure suction is applied to drain the pleural effusion into the chest bottle. The nurse must be informed that the drainage flow rate is more than 100 mL/h and that adequate fluid supplementation and blood transfusion must be provided. Attention must also be paid to the obstruction or detachment of the catheter. The volume of the pleural effusion is then used to determine the drainage volume. In the literature, (5)(6)(7)(8)(9)(10)(11)(12) routine examination methods, such as chest ultrasound, chest X-ray, and CT, are described as below.
• Chest ultrasound is used to measure the distance D 1 , as shown in Fig. 3(a), between the pleural visceral and the diaphragm visceral. The assessment method (5) is where V drained is the approximation formula for estimating the pleural effusion volume. (5) When D 1 < 30 mm, the pleural effusion V drained is < 480 mL. When D 1 > 30 mm, V drained is > 480 mL. The coefficient of determination, R 2 = 0.7941, indicates the presence of a comparable positive correlation. • Chest ultrasound is used to measure the distance D 2 , as shown in Fig. 3(b) between the pleural visceral and the diaphragm visceral. The assessment method (6) is where V drained is the approximation parameter for estimating the pleural effusion volume. (6) When D 2 < 30 mm, the pleural effusion V drained is < 600 mL. When D 2 > 30 mm, V drained is > 600 mL. The coefficient of determination, R 2 = 0.5200, shows the presence of a comparable positive correlation. • As shown in the chest X-ray image in Fig. 3(c), an obvious sharp angle (red circle) is present at the lower thoracic cavity. The bilateral thoracic cavity can hold a volume of approximately 2000-3000 mL. (13,14) When pleural effusion occurs, the space for gaseous exchange in the lungs is affected. The chest X-ray method can provide only a rough determination of mild, moderate, and severe effusion. • The CT examination can detect and distinguish the areas of masses, nodules, pleural plaques, calcifications, and encapsulated pleural effusion. After performing chest ultrasound and chest X-ray examinations, another round of chest CT for confirmation is generally required. However, limitations still exist regarding the information about pleural effusion provided by CT images. In general, current CT images can be classified as low, moderate, and high effusion volumes. Pleural effusion can also be categorized on the basis of the largest depth of the effusion as the parameter d, including (a) a low effusion volume at a depth of < 3.0 cm, (b) a moderate effusion volume at a depth of 3.0-5.0 cm, and (c) a high effusion volume at a depth of > 5.0 cm. To date, there has been no unified gold standard. The largest length of the effusion as the parameter l can be used to estimate the volume of the effusion using the formula V = d 2 × l (mL), which is based on the depth d (cm) and length l (cm). According to the literature, (15) the order of accuracy of the abovementioned assessment methods in a descending series is chest ultrasound, X-ray, and CT scan. When chest ultrasound is used, Eqs. (2) and (4) can be used to estimate the pleural effusion volume V drained . In general, a maximum of 1500-2000 mL can be drained from one side. However, this also depends on the condition of the patient. After estimating the pleural effusion volume, approximately 800 mL of the pleural effusion is drained each time, which may increase to 1000 mL as the number of sessions increases. In clinical practice, a 28-to 32-F catheter (patients feel more comfortable with a smaller catheter) is often used to drain the thoracic cavity. This is suitable for draining blood or pus. After the administration of local anesthesia, the effusion catheter is connected to a water-seal collection bottle, as shown in Fig. 2. We believe that the chest ultrasound scan and the negative-pressure drainage water-seal bottle can support the drainage of the pleural effusion.

Smart drainage monitoring system implement
As shown in Fig. 2, the principle of negative pressure is applied to drain the effusion in the body to a negative-pressure dual chest bottle during the drainage of the thoracic cavity. A sensor can automatically monitor the drainage volume and rate and provide a warning signal when the drainage tubes are removed. The annual data of the Taiwan Patient Safety Reporting System show that drainage catheter abnormalities account for 5% of hospital tubing events in Taiwan. These abnormalities include tubing detachment, obstruction, and misconnections, among which detachment events are classified as self-removal and accidental detachment (unplanned tubing removal). Approximately 70% of these events are unplanned removal events and often occur owing to physiological and depressive symptoms in patients. To prevent selfremoval in patients, a smart drainage monitoring system was designed, as shown in Fig. 3. A chest-belt warning sensor with magnetic field sensing (Hall sensors) was designed for the smart drainage monitoring system. This belt could be worn on the patient's chest, as shown in Fig. 4(a). A magnetometer is a small-scale magnetic sensing unit for detecting and measuring magnetic field disappearance. A warning notification can be sent to the nurse when the inserted needle is removed by the patient during drainage. The function of this system is to monitor unplanned catheter removal. This function can be used in the monitoring of drainage in the thoracic and abdominal cavities. Regarding the automatic monitoring of drainage volume and speed, chest bottles were designed in this study using regular shapes such as circles, squares, and rectangles for the bottom of these containers. In this study, we used a circular base as an example for calculating the height H of the drainage volume sensor as , , Circle Area Quadrangle Area , where V drained is the volume (mL) to be drained, which can be estimated by chest ultrasound examination; the parameter r 1 (cm) is the radius of the circle, L (cm) and W (cm) are the length and width of the square or rectangular base, respectively, and H (cm) is the preset height of the drainage volume sensor. For chest ultrasound examination, as seen in Figs. 3(a) and 3(b), when D 1 > 30 mm or D 2 > 30 mm, the fluid-filled volume in the right/left lung cavity can be estimated, as three levels: (1) small effusion size: < 500 mL, (2) moderate effusion size: 500-1000 mL, and (3) large effusion size: > 1000 mL. Using Eq. (2) or (4), (5,6) we can estimate the height H (liquid level) of the drainage volume sensor. In this study, a noncontact liquid-level sensor, which uses the principle of changes in coupling capacitance distribution to detect the changes in potential, was used, as depicted in Fig. 4(b). Its sensing unit does not require contact with the liquid to sense the liquid height H in the collection container. The noncontact method is not affected by pus, blood, and debris and has high accuracy. .
Here, Q can be obtained using the liquid flow velocity sensor. This function can monitor the drainage volume (mL/min), thereby estimating the time required for the completion of the drainage. When the drainage exceeds the expected duration, the drainage tubing may be blocked. Moreover, the nurse must periodically monitor the physiological status of the patient, including the heart rhythm, blood pressure, or respiratory rate. Our function enables the monitoring of the drainage flow velocity at any time to determine whether the drainage is overly fast or slow and can be combined with heart rate and respiratory rate monitoring, and to remind nurses to carry out transfusion (fluid or blood) during drainage. As shown in Fig. 4(d), we used an optical sensor in our study to monitor pulse signals and calculate the heart rate. The optical sensor integrating a red light source and a light receiver (reflection mode) is designed as a wristband to be worn on the wrist. The heart rate is estimated every 10 s on average, which can be used to monitor sudden life-threatening events such as reexpansion pulmonary edema (RPE). (16,17) In the smart drainage monitoring system, when the drainage volume achieves the preset height H (cm), a signal is immediately sent out to inform the nurse that the drainage volume V drained (mL) has been achieved to prevent excessive drainage. In contrast, when the drainage fluid does not achieve H within the specified time, there is a possibility that the tubing is obstructed. The smart drainage monitoring system developed in this study includes the following four major functions: (1) drainage volume estimation, (2) drainage speed estimation, (3) physiological status monitoring, and (4) safety confirmation. The smart drainage monitoring system developed in this study employs the Arduino ® (Uno, Atmel 8-bit CMOS microcontroller 32-kB self-programmable mechanism, six analog inputs, 14 digital inputs/outputs, DI/DO) circuit board, as shown in Fig. 5(a). This circuit board integrates detection signals from multiple sensors and can be used to acquire analog signals to carry out analog-to-digital conversion (ADC). The ADC formula is shown as , 1023.0 where V mea,i is the ith input analog signal and V i is its converted digital information. A 10-bit ADC was used to convert the analog voltage signal into the digital signal V cc = +0.0-+5.0 VCD, and its value is converted by approximately 1023-fold. The maximum acquisition rate is 10000 times/s. The voltage change in various sensors can be directly converted on the Arduino ® circuit board. The C/C++ programming language is used to implement the detection algorithm in the Arduino ® circuit board. Figure 5(b) shows the circuit board program editor. When the monitored value reaches a specified threshold, such as reaching the liquid height H, the duration of the drainage exceeds the expected duration t and power interruption occurs at the belt sensor. When there are heart rate abnormalities, a high-voltage output will directly trigger the LED (warning light) and buzzer (alarm) as warning signals so that nurses can make the appropriate treatment at the earliest possible time.

Experimental Results and Discussion
In clinical practice, the use of chest X-ray images is a common method of direct observation. Chest X-ray images are used for the interpretation of the anatomical position to estimate the volume of the pleural effusion. (8,9) The height of the pleural effusion that corresponds to the height of the intercostal space could be used to estimate the pleural effusion volume, which could be categorized as follows: • small effusion size: approximately 20% of the fluid-filled volume, corresponding to < 500 mL; • moderate effusion size: approximately 20-50% of the fluid-filled volume, corresponding to 500-1000 mL; • large effusion size: approximately > 50% of the fluid-filled volume, corresponding to > 1000 mL. Furthermore, the B-mode ultrasound probe could be placed at the horizontal position to obtain the diaphragm surface, and positioning can be carried out on the basis of the height of the intercostal space. (5,6) In the presence of a pleural effusion, scanning was carried out in an upward layer-by-layer manner to identify the pleural effusion region and observe whether there were flocculation, pleural effusion activity, and viscosity. Then, an ultrasound probe (vertical direction) was used for the parallel and vertical scanning of the vertebrae to obtain the skin thickness. Echoless regions in the scan were regarded as safe for inserting the drainage catheter to avoid injuring the lungs or bone contact. The drainage volume and drainage catheter insertion site could be determined using chest X-ray images and B-mode ultrasound scan.
In clinical practice, 28-to 32-F chest tubes are generally used for the drainage of the pleural effusion. After the administration of local anesthesia and tube insertion, the effusion drainage tube was connected to a negative-pressure water-seal collection bottle. During the drainage of the pleural effusion, attention should be made (1) regarding the volume of effusion to be drained (mL), (2) to ensure that the drainage volume does not exceed 1000 mL in each session and that continuous drainage does not exceed 500 mL/h. The drainage volume should be periodically monitored and (3) all interfaces should be secured using an adhesive tape to prevent patients from removing the chest tube on their own (unplanned removal) or accidental removal (pulling), and (4) to avoid rapid drainage of large volumes of pleural effusion that would tend to cause RPE, which requires the additional monitoring of heart rate or respiration rate. In this study, the above-mentioned precautions were used as a guide to develop a smart drainage monitoring system for pleural effusion, as shown in Fig. 6. Arduino ® (Uno) was used to develop the programming language of the circuit board, which is a C/C++ advanced programming language used to write the detection algorithms. Supportable software and hardware were used to integrate the smart drainage monitoring system for pleural effusion, whose functions and experimental results are described as follows: • Estimation of the effusion volume: After chest ultrasound examination, the distance D 2 between the pleural visceral and the visceral shown in Fig. 3(b) could be measured. From the correlation between the pleural effusion volume and the distance D 2 in Fig. 7(a), the drained effusion volume was computed using Eq. (2) as V drained = 20 × 25 = 500 mL. Then, the volume to be drained could be entered using a keyboard, and Eqs. (5) and (6) were used to calculate the preset height (cm) of the drainage volume sensor, H = 6 cm (radius of bottom circle: r 1 = 5.15 cm), as seen in the correlation between the preset height H and the pleural effusion volume in Fig. 7(b). The noncontact liquid-level sensor was placed at H. In general, the drainage volume must not exceed 1000 mL in each session and continuous drainage should not exceed 500 mL/h. Periodic observations must be conducted during the process. When the drainage volume reaches H, the sensor would generate a high-voltage output. Simultaneously, this would trigger the yellow LED (warning light) and buzzer (alarm) as warning signals so that nurses could be informed, as depicted in Fig. 6(a). • Estimation of drainage duration (drainage speed): Equation (7) was used to calculate the time taken for drainage volume. Using a drainage volume of 500 mL and a flow rate of 20 mL/min in the experimental model, we estimated that a drainage of 500 mL could be completed in approximately 25 min, as seen in the correlation between the drainage duration and the pleural effusion volume in Fig. 7(b). Referring to the drainage speed, this function could monitor whether the drainage was overly fast or slow. • Testing of sensor for unplanned tubing removal: Figure 6(b) shows the chest-belt warning sensor, in which a Hall sensor was used to detect power interruption. When the algorithm detects a low voltage, a high-voltage output is generated to drive the buzzer (alarm) to notify nurses for management. • Testing of heart rate monitoring: During drainage, if the drainage speed is extremely high, cardiac load or heart failure would be exacerbated. The drainage of large volumes of pleural effusion might lead to RPE, (16,17) which occurs unilaterally. If this is not immediately discovered and treated, the contralateral lung might become affected and the complication would progress to bilateral lungs. Therefore, heart rate or respiration rate monitors were required. An optical sensor was used to detect pulse signals, as shown in Fig. 6(b). To validate the feasibility of the optical sensor, a total of ten measurements were made. The average heart rate was 71.10 bpm, as shown in Fig. 8. The smart drainage monitoring system developed in this study could be used to monitor the drainage volume, physiological signals, and safety. The entire system could be divided into two subsystems, which can be summarized as follows: • The first subsystem consists of the Arduino ® (Uno) circuit board and noncontact liquid-level sensor, and could detect the drainage volume and estimate the drainage duration. • The second subsystem consists of the Arduino ® (Uno) circuit board, chest-belt warning sensor, and optical sensor, which was used to detect unplanned tubing removal and monitor heart rate. This system has high feasibility and potential commercialization. The development of this smart system can improve the drainage system in performing continuous monitoring. Its scope of application can also be extended to the monitoring of drainage in the thoracic and abdominal cavities. For multibed monitoring application, the proposed smart drainage monitoring system can be integrated into one or more intelligent end-alarm units to drain the pleural effusion and monitor the ascites drainage. Though the edge computing process, its framework can process the warning information at the network edge or near the source of the sensing data, (18) as shown in Fig. 9. Although any sensing unit detects abnormal data, the warning messages can be sent to the cloud data center via edge-to-cloud communication, thus enabling further analysis, persistent data storage, and final decision-making. The warning messages are also sent to nurse staffs' smart mobile devices (iPads or smart phones) via cloud-to-remote device communication or edge-to-remote device communication. Currently, drainage is required in thoracic surgery,  (Color online) Proposed smart drainage monitoring system for pleural effusion and ascites drainage in multibed monitoring application. simple chest aspiration/drainage, lung cancer (malignant tumors) surgery, or other surgeries, among which simple chest aspiration/drainage accounts for the majority of cases (55%), whereas thoracic surgeries and other surgeries account for 45%. There are approximately 50000 people requiring drainage in Taiwan every year. Moreover, approximately 13000 people develop lung cancer every year in Taiwan and 9000 die of lung cancer. Patients with lung cancer with pleural effusion also require drainage. This system can also be used in ascites drainage. Therefore, the smart drainage monitoring system developed in this study can satisfy the market demand. Subsequently, it would be necessary to assess the sensor electrical safety (IEC 60601 series standard) (19) and the biocompatibility of the wearable device; determine the relevant safety, stability, and efficacy of the detection system (including the software algorithm); and ensure that the smart wearable device conforms to skin irritation standards so that it becomes suitable for the human body or the medical setting after commercialization.

Conclusion
The proposed monitoring system can monitor drainage volume, physiological signals, and safety. In the future, this system may be combined with information processing and wireless communication to develop a wireless framework that can link end sensors, monitoring systems, and smart mobile devices. A Wi-Fi wireless sensor network can be used for monitoring multiple sensors for both pleural effusion and ascites drainage in multibed applications. At the edge commuting processing layer, the signal preprocessing unit would carry out the preliminary data analysis of the monitoring data from all sensor nodes. Then, only the warning information would be transmitted to the cloud data center and stored. Furthermore, the monitoring results would be displayed at the edge warning unit, including buzzers and smart mobile devices. Simultaneously, this would activate the warning device at the monitoring center or the nurse station so that nurses can provide the appropriate treatment. For commercialization in clinical applications, it is necessary to validate the biocompatibility, electrical safety, and effectiveness, including the hardware/software design, verification, and risk assessment, according to the IEC 60601 series standard. The proposed smart monitoring system can be further implemented through a compact microchip without limiting the patient's range of motions in clinical applications. The cost of the consumables required for this smart system is approximately 70 USD. In the future, the hardware circuitry can be replaced by microcontroller chips, so that the hardware circuitry can be miniaturized and the operation will become simple. This would increase the application scope, usage acceptability, such as in pleural effusion and ascites drainage, and the cost of the system to more than 70 USD.