improvement on the controlling software of human fluid ... · improvement on the controlling...
TRANSCRIPT
1
Improvement on the Controlling Software of
Human Fluid Monitoring Device
By
ZHAO Yize
1155022841
A report
submitted in partial fulfillment
of the requirements for the degree of
Master of Science in Biomedical Engineering
The Chinese University of Hong Kong
May 2013
2
Abstract
Intravenous (IV) infusion is one of the most effective treatments in clinical care. IV
fluid monitoring plays a critical role in the patient healing time and safety
management. In this project, we present a revolutionary way to perform IV fluid
monitoring by taking advantage of numerous sensors and an Android device. A
working prototype has been built to test the effectiveness of our design. In the
experiment, we have found that our device reveals high accuracy in measuring the
flow rate of IV solutions.
Keyword: IV infusion, signal processing, Android device
3
Acknowledgement
Upon completion of “Improvement on the Controller Software of Human Fluid
Monitoring Device” project, I would like to give the most profound thanks to my
supervisor Prof. K.S. Leung and associate examiner Prof. Louis W.H. Cheung for
their continuous support to my study. Besides, special thanks go to Patrick Tsang of
Technical Team and other department personnel for their services of providing high
quality hardware and software. I also appreciate the work of other professors,
lecturers, and teaching assistants in our faculty. Lastly, let me say "thank you" to the
people who conducted User Acceptance Test for their great contribution to the
completion of this project.
4
TABLE OF CONTENTS
1. INTRODUCTION AND PROJECT BACKGROUND ............................... 5
2 RELATED WORK ...................................................................................... 10
3. PROBLEM IDENTIFICATION ............................................................... 22
4 HARDWARE ARCHITECTURE .............................................................. 24
5 SOFTWARE ARCHITECTURE ............................................................... 31
6 METHODOLOGY ...................................................................................... 42
7 IMPLEMENTATION AND TESTING ..................................................... 47
8 EXPERIMENTAL RESULT ....................................................................... 51
9 CONCLUSIONS .......................................................................................... 55
10 REFERENCE ............................................................................................ 56
APPENDIX 1 COST BREAKDOWN .......................................................... 59
APPENDIX 2 LOAD CELL SPECIFICATION ........................................... 60
5
Chapter 1. Introduction and Project Background
1.1 Introduction
Intravenous infusion (IV infusion) is a therapy that liquid substances are injected into
a vein. It is commonly used to maintain electrolyte balances, medicine and nutrition
delivery, and blood transfusion [1] [2] [3] [4]. Because of its ability to transmit
desired substances into patient’s body, doctors believe that it is one of the most
effective treatments in clinical care [5] [6] . IV fluid is a generic name for all types of
liquid which are transmitted into patient’s body in IV infusion process. It is widely
administered to acutely-unwell, hospitalized patients [7]. Since the administration of
patient’s IV fluids is crucial to clinical care, nurses are well trained to monitor and
manipulate the infusion rate of IV fluids [8] [9] [10] [11] [12] [13]. Currently, nursing
personnel employs a manual process to check the flow rate of IV fluids [14]. The best
practice requires a continuous monitoring of IV drops to calculate the approximate
flow rate of the fluid. As a consequence, the experience of nursing staff plays a
crucial role in calculating correct flow rate. Moreover, the efficiency of nursing work
becomes severely depreciated due to the long duration of IV fluid monitoring on each
patient. Therefore, we purpose a revolutionary system which is able to automatically
monitor the flow rate of IV fluids via Android device. Our design integrates hardware
and software components to detect the weight changes in IV solution dynamically.
The Android application has an interactive interface which allows users to manipulate
the software control according to their specific requirement. This report discusses our
work as follows. In Chapter 1, we will explain the background information of this
project. Chapter 2 reviews the related work and products in the industry. Chapter 3
discuss the issues and potential problems associated with IV pump device. In Chapter
4 and 5, we will demonstrate the hardware and software design principle of this
6
project. Our methodology and implementation procedures are presented in Chapter 6
and 7. The experimental results are elaborated in Chapter 8 before we conclude our
work with some future insight in Chapter 9.
7
1.2 Project Objective
The principle goal of this project is to development system which automatically
monitors the change rate of IV fluid. By doing so, the system should be able to
present the flow rate on an output screen. A dynamic update of output is desired
whenever changes of flow rate occur. In addition, an alert mechanism shall be
implemented to notify doctors and nurses in the event of abnormal flowing rate. On
top of these two features, we ought to be able to perform signal processing and data
transmission on sensors and data communication devices. Figure 1 summarizes the
breakdown of major objectives of this project.
Figure 1: Project Objective
The scope of the system is defined on Android 2.2 or higher devices. This is largely
due to the hardware restriction from the manufacture’s side. The implementation of
the purposed system will be carried out in controlled experimental environment.
Owing to liability issues, the system will not be tested on actual patients.
Monitor IV fluid rate
Signal processing
Wireless transmission
Data visualization
Alarm mechanism
8
1.3 Project Schedule
The project will last for seven months from November 2012 to May 2013. At the end
of each month, a milestone report will be delivered to summarize the work of each
month. The detailed working schedule is shown in Table 1.
Table 1 Project Schedule
Date Tasks Deliverable
November 2012 -Project purposely
-Analysis of existing software and
hardware
-Interface testing on existing system
Project purposely
December 2012 -Literature review
-Problem identification
-System requirement analysis
Literature review
System analysis report
January 2013 -Hardware Design System design report
System Prototype
February 2013 -Software Design
-Hardware Software Integration
Midterm report
Coding I
March 2013 -System Implementation
-User Acceptance Test (UAT)
Coding II
System Testing report
April 2013 -Refined system after testing
-Experiment
-Result Analysis
Working prototype
Presentation Slide
Thesis draft
May 2013 Prepare oral presentation
Thesis
Oral presentation
Submit thesis
9
1.4 Project Budget
A total amount of HKD 1,000 has been granted to this project. The funding will be
used primarily on purchasing equipment and software license. A comprehensive
breakdown of budget spending will be presented at the end of this project.
10
Chapter 2 Related Work
2.1 IV Fluid Regulation
IV fluid regulation refers the control of flow rate of IV fluids as they are delivered
into patient’s body via a vein. Manual regulation of IV fluid is performed by
adjusting the roller adapter of the IV tubing until it reaches the desire rate. Figure 2
illustrates the procedure of adjusting IV dropping rate.
Set up IV fluid
injection system
Adjust roller to
manipulate
dropping rate
Reaches desired rate?
Continue
monitoring
hourly
Prime IV tubing
Yes
No
Figure 2: Adjusting IV Dropping Rate Procedure
11
To correctly adjust the IV fluid dropping rate, nurses use a clock and counts the
number of drops in one minute. If the dropping is either too fast or slow, the nurse
should adjust the roller and repeat the counting procedure until the desired rate is
reached. IV fluid rate must be checked hourly by nursing team to ensure that rate is
accurate and that the correct dosage is injected into patient’s body.
12
2.2 Method of IV Dropping Rate Calculation
Method I: 1 mL per hour
“mL per hour” is commonly used in measuring the IV fluid dropping rate. When a
physician orders an IV solution treatment, the IV fluid flow rate is stated in “ml per
hour”. In this project, we use the following equation to derive the dropping rate of IV
fluid.
𝑟 =𝑚𝑎𝑓𝑡𝑒𝑟− 𝑚𝑏𝑒𝑓𝑜𝑟𝑒
𝜌 ×(𝑡𝑎𝑓𝑡𝑒𝑟− 𝑡𝑏𝑒𝑓𝑜𝑟𝑒) where
𝑟: IV fluid dropping rate to be measured
𝑚𝑎𝑓𝑡𝑒𝑟: mass of IV fluid in the end
𝑚𝑏𝑒𝑓𝑜𝑟𝑒: mass of IV fluid in the beginning
𝜌: density of the fluid
𝑡𝑎𝑓𝑡𝑒𝑟: timestamp in the beginning
𝑡𝑎𝑓𝑡𝑒𝑟 timestamp in the end
As 𝜌 can be obtained from the description of different types of solution and that 𝑡𝑎𝑓𝑡𝑒𝑟
and 𝑡𝑎𝑓𝑡𝑒𝑟 can be retrieved by system clock, we only need to measure the difference
of mass, i.e. 𝑚𝑎𝑓𝑡𝑒𝑟 and 𝑚𝑏𝑒𝑓𝑜𝑟𝑒.
Method II: drop per minute
“drop per minute” is often used by nurses to manually calculate the dropping rate of
IV fluid. To measure drop per minute, we need to obtain the drop factor which is
available on the plastic dropper of the IV tubing. Common drop factors are 10 gtts/ml
(blood set), 15 gtts/ml (regular set), or 60 gtts/ml (microdrop). We may employ the
13
following formula to derive the rate in terms of drop per minute.
𝑟 =𝑚𝑎𝑓𝑡𝑒𝑟− 𝑚𝑏𝑒𝑓𝑜𝑟𝑒
𝜌 ×(𝑡𝑎𝑓𝑡𝑒𝑟− 𝑡𝑏𝑒𝑓𝑜𝑟𝑒) × 𝑓 where
𝑟: IV fluid dropping rate to be measured
𝑚𝑎𝑓𝑡𝑒𝑟: mass of IV fluid in the end
𝑚𝑏𝑒𝑓𝑜𝑟𝑒: mass of IV fluid in the beginning
𝜌: density of the fluid
𝑡𝑎𝑓𝑡𝑒𝑟: timestamp in the beginning
𝑡𝑎𝑓𝑡𝑒𝑟: timestamp in the end
𝑓: drop factor of the fluid being injected
Method III: mcg/kg/min
“mcg/kg/min” is calculated by obtaining drug dose, the patient’s weight, and solution
concentration.
𝑚𝑐𝑔/𝑘𝑔/𝑚𝑖𝑛 =𝑑 ×𝑤 ×60𝑚𝑖𝑛
𝜌 where
𝑑: dose of the prescribed drug
𝑤: patient weight in kg
𝜌: solution concentration in mcg/cc
14
2.3 Review of Different IV Therapy Regulator
2.3.1 Rice Mousetrap IV Regulator
Inspired by mousetrap, researchers in Rice University employ a mechanical system to
regulate amount of IV fluid injection to resolve the issue of under-hydration and over-
hydration [15]. As shown in Figure 3, the device consists of one weight scale, one
mousetrap, and a lever arm.
Figure 3: Mousetrap IV Regulator
With IV solution bag placed on one side of the lever arm, a counterweight is
suspended to balance the weight of solution bag. When the desiring amount of
medication has been injected into patient’s body, balance in the lever arm will be
restored, with the arm tilting back towards the counterweight [15]. By running the IV
tubing through the lever arm with a mechanical clamp, the tubing is crimped when the
desiring amount of IV fluid is delivered.
2.3.2 IV Drip Rate Calculator
“IV Drip Rate Calculator” is an Android application which calculates the infusion rate
in ml/hr for IV injection [16]. Figure 4 shows the screenshots of this app. The
following fields are required to input for correct calculation.
15
Figure 4: IV Drip Rate Calculator Screenshot
- Drug Amount Added in mg, mcg, grams, or units
- Volume of Solution in ML
- Dosage Ordered in mg/hr, mg/min, mcg/hr, mcg/min, units/hr, units/min,
mg/kg/hr, mg/kg/min, mcg/kg/hr, mcg/kg/min, units/kg/hr, or units/kg/min
- Patient Weight in kg or lbs
When users press “Calculate” button, the Infusion Rate will be calculated and
rounded to integer and direct user to the next screen, shown in Figure 5.
16
Figure 5: Result of Infusion Rate Calculation
Besides infusion rate, the concentration of the solution is derived in mg/ml. The
following two formulas are used to derive concentration and infusion rate.
𝑐𝑜𝑛𝑐𝑒𝑛𝑡𝑟𝑎𝑡𝑖𝑜𝑛 =𝑑𝑟𝑢𝑔 𝑎𝑚𝑜𝑢𝑛𝑡 𝑎𝑑𝑑𝑒𝑑
𝑣𝑜𝑙𝑢𝑚𝑒 𝑜𝑓 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛
𝑖𝑛𝑓𝑢𝑠𝑖𝑜𝑛 𝑟𝑎𝑡𝑒 =𝑑𝑜𝑠𝑎𝑔𝑒 𝑜𝑟𝑑𝑒𝑟𝑒𝑑 × 𝑣𝑜𝑙𝑢𝑚𝑒 𝑜𝑓 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛
𝑑𝑟𝑢𝑔 𝑎𝑚𝑜𝑢𝑛𝑡 𝑎𝑑𝑑𝑒𝑑
2.3.3 IV Infusion Calc
IV Infusion Calc provides services of calculating infusion rate in either pump or
gravity mode [17]. For gravity mode, suppose the following parameters have been
entered and that users decide to calculate IV flow rate in terms of Mcg/Kg/Min in
Figure 6.
17
Figure 6: IV Infusion Calc Screenshot
First, the concentration of the solution needs to be derived.
𝑐𝑜𝑛𝑐𝑒𝑛𝑡𝑟𝑎𝑡𝑖𝑜𝑛 =total dose in solution
total volume
Then, the infusion rate can be derived.
𝑖𝑛𝑓𝑢𝑠𝑖𝑜𝑛 𝑟𝑎𝑡𝑒 =dose × weight × 60min
concentration
2.3.4 IV Infusion Controller (IVIC-M)
IVIC-M is an educational app on iOS for regulating IV flow rate of IV therapy [18].
One of its attractive feature is the ability to check the current dropping rate. As
illustrated in Figure 7, when users tab the screen immediately after each drop for five
times, the system will calculate the dropping rate in terms of mL/hr and drops/min.
This functionality is extremely helpful in reducing the time required to estimate
dropping rate of IV fluid.
18
Figure 7: IV Infusion Controller (IVIC-M) Screenshot
2.3.5 Infusion Pump
Infusion pumps are devices that deliver fluids into patient’s body in a controlled
manner [19]. Since infusion pumps can produce relatively high and controlled
pressures, health care professionals have employed them in injecting different kinds
of fluids subcutaneously, including IV fluid, nutrients, medications, and local
anesthesia drugs [20] [21] [22]. As the scope of this project is dealing with
intravenous fluid therapy, we focus on the usage of infusion pumps on IV fluid
injection.
FDA has placed infusion pumps under General Hospital Devices and Supplies Risk
Class II [23], which means 510(k) premarket notification (PMN) is required before
the distribution of the device. A new 510(K) submission is required for any of the
following three criteria:
Changes or modifications to an existing device
Where the modification could significantly affect the safety or effectiveness of the
device
19
The device is to be marketed for a new or different indication for use
As shown in Figure 8, the basic setup of the pump involves the attachment of pump
with the tubing of the IV infusion system.
Figure 8: Typical IV Pump Setup
The most common infusion pump is the syringe infusion pump where fluid is held in
a reservoir plastic bag, and portable tubing with roller controls the fluid delivery. For
pumps used to regulate critical fluid, alarming system is incorporated in the event of a
problem.
Table 2 lists the detailed comparison of different types of IV Therapy regulators.
20
Table 2: Comparison of Different IV Therapy Regulators
IV Drip Rate Calculator IV Infusion Calc IVIC-M IV Drip Manage Infusion Pump
Operating System Android 1.6 Android 1.6 iOS 4.0 iOS 4.0 Standalone device
Drug List N/A N/A N/A Yes No
Accuracy
(significant digit)
Round to integer Round to one
decimal digit
Round to one decimal
digit
Round to two
decimal digit
Round to one decimal
digit
Alarm notification N/A N/A Triggers when
infusion completes
N/A Triggers when problem
occurs or infusion
completes
Power Battery Battery Battery Battery AC or Battery
Mobility Carried by Nurse Carried by Nurse Carried by Nurse Carried by Nurse Mounted on infusion
pole
Input Drug amount
Volume
Dosage
Patient Weight
Dose
Patient Weight
Total Dose
Volume
Drip Factor
Drop Factor
Volume
Time
Patient data
Volume
Rate
Drop Factor
Dose
Patient Weight
Volume
Drip Factor
Output Infusion rate Infusion rate
Dose
Flow rate
Drip rate
Time before
medication
Flow rate
Volume
21
Mcg/kg/min completes
Unit of
measurement
International and English
System of Unit
International and
English System of
Unit
International System
of Unit
International
System of Unit
International and
English System of Unit
Scope Single Patient Single Patient Single Patient Multiple Patients Multiple Patients
Cost per unit Free Free HKD 118.00 HKD 15.00 USD 100 to 1,2001
FDA Approval Not required Not required Not required Not required Risk Class II – 510(k)
PMN
Regulating
Mechanism
Pre-set before usage Pre-set before
usage
Pre-set before usage
Dynamic regulating
Pre-set before
usage
Dynamic
regulating
Pre-set before usage
Language English English English, Korean English, Japanese English
1 Price quote from eBay.
http://www.ebay.com/sch/IV-Fluid-Administration-/31464/i.html
22
Chapter 3. Problem Identification
3.1 Potential Problems of IV Pump
From 2005 to 2009, FDA received approximately 56,000 reports regarding the use of
infusion pumps [19]. During the same period, 87 recalls were ordered by
manufacturers to address critical safety concerns. Among them, 14 recalls were Class
I – situation where the use of the recalled device will cause serious adverse health
consequences or death [19]. We summarized three major challenges in current
infusion pumps.
3.1.1 Software Defects
Many infusion pumps reveal software malfunctions during usage. For instance,
deadlock occurs when inexperienced users manipulate the system without clear
instructions. In one cased reported to FDA, a pump fails to trigger pre-programmed
alarm when problem occurs, resulting in over-hydration of patient.
3.1.2 User Interface issues
Confusing instructions leads to improper programming of medication doses and
infusion rate. For example, the display monitor of most pumps is not large enough to
make instructions clear for senior nurses who have bad eyesight.
3.1.3 Mechanical and Electrical Failures
Infusion pumps should be able to work continuously to provide sufficient fluid
injection to patient. It has been reported that battery failures occurs during a IV
therapy that fluid was not being delivered for over 30 minutes, causing the risk of
23
under administration of critical fluids to patient.
3.2 Proposed Solutions
With respect with this project, we proposed a new design of IV monitoring. Instead
of using infrared, which is employed by IV pump, we will be using sensors to deal
with signal acquisition problem. In the realm of signal transmission, we will take
advantage of wireless transmission to ease the overhead of overcrowded space in
hospital. Since mobile platform will be the future’s computing platform, we will
implement all software on Android devices.
24
Chapter 4 Hardware Architecture
4.1 Hardware Design Strategy
Figure 9 shows the hardware architecture of our IV Monitor design. The process of
IV Flow Rate monitoring is listed in the following:
1. Weight sensor sense the change in weight of IV Medication
2. Weight sensor sends the signal to Amplifier
3. Amplifier scales up the signal then forward it to AD Converter
4. AD Converter converts analog signal to digital signal
5. AD Converter sends digital signal to Bluetooth module
6. Bluetooth module broadcasts signal
7. App receives signal from Bluetooth
8. App calculates desired measurement according to user’s instruction
User Mobile app
WeightSensor
IV Medication Amplifier
0
0
0
0
0
AD Converter
u1
x2
x1* / *
Bluetooth
Data
Figure 9 Hardware Architecture
25
4.2 Hardware Components
4.2.1 Weight Sensor
We use a load cell as the principle weight sensor to detect the weigh change of IV
solution. The load cell is a weight sensor that converts force into electrical signal [24]
[25] [26]. It can be considered as a transducer that produces voltage signal from
mechanical strain [27]. Conventionally, there are three types of load cells [28]:
1. Hydraulic cell
2. Pneumatic cell
3. Strain gauge cell
In this project, we apply the strain gauge cell to detect the weight change of the
flowing liquid in IV system, shown in Figure 10.
Figure 10 Strain gauge cell
Principle
Strain gauge utilizes the advantage of the material property of electrical conductance’s
dependency on its geometric shape. Typically, when a conductor is stretched within
the limit of its elasticity, it will become longer and narrower. Since the resistance ℛ
can be computed with the formula below, the conductor’s resistance increases due to
26
elongation of length and reduction in cross-section area.
ℛ = 𝜌 𝑙
𝐴
Where 𝜌 is the electrical resistivity of the material
𝑙 is the length of the conduct or
𝐴 is the cross sectional area of the conductor
A strain gage arranges a long, thin conductive wire in a zig-zag fashion in parallel
lines such that a slight change of stress can affect the orientation of the lines and
eventually causes change in resistance, as shown in Figure 11.
Figure 11 Load Cell
Gauge Factor
The Gage Factor (GF), also known as Strain Factor (SF), is the ratio of relative
change in electrical resistance of a material to the mechanical strain 𝜖.
𝐺𝐹 =Δ𝑅
𝑅
𝜖=
Δ𝜌
𝜌
𝜖+ 1 + 2𝜐, where
𝑅 is the resistance of the material;
𝜖 is the strain applied;
27
𝜌 is the resistivity of the material;
𝜐 is the Poisson's ratio of the material.
Wheatstone Bridge
Wheatstone Bridge system is used to measure the change of resistance in a strain
gauge. Illustrated in Figure 12, direct current of 12V is the power supplied to the
strain gauge. Whenever there is change in resistance, it can be measured in the output
side by the change in output voltage.
Output
Figure 12 Wheatstone Bridge System
For metallic foil gauges, whose GF is usually greater than two, the output voltage 𝜐
can be computed by the following formula.
𝜐 = 𝐵𝑉 ∙𝐺𝐹 ∙ 𝜖
4, where
𝐵𝑉 is the bridge excitation voltage, in our case 12V.
Variation in temperature
Since temperature plays a critical role in a material’s resistance, its change introduces
error in measuring the output voltage. It is a good engineering practice to keep the
excitation voltage low enough to avoid self heating of the gauge.
28
4.2.2 Amplifier
Since the output from weight sensor is less than 50mV, we ought to apply an amplifier
to scale up the signal. The gain of the amplifier can be calculated in the following
formula.
𝐺𝑎𝑖𝑛(𝑑𝑏) = 10 log𝑉𝑜𝑢𝑡
𝑉𝑖𝑛
In our study, the largest gain of the applied amplifier is 36.98db in a situation where
𝑉𝑜𝑢𝑡 = 5V and 𝑉𝑖𝑛 = 1mV. According to the manufacturer’s specification, the
bandwidth of our amplifier is in the range between 150 and 10kHz under normal
usage. Figure 13 illustrates the amplifier in our experiment.
Figure 13 Amplifier
4.2.3 AD Converter
As the ultimate goal is to visualize the signal on an Android device, we have to
convert the amplified voltage from analog to digital format. In our experiment, we
use Arduino to perform AD conversion, shown in Figure 14. The resulting digital
output is in 8-bit character format in order to be consistent with Bluetooth
transmission protocol. The idea is to have the hardware do as little parsing as possible
29
to minimize signal loss and interference.
Figure 14 Arduino as AD Converter
4.2.4 Bluetooth
We take advantage of wireless transmission technology to establish the
communication between AD converter and Android device. The reason why we
select Bluetooth is that each Bluetooth has a unique MAC address and that it can be
identified by the downstream Android device [29] [30]. Moreover, if the Android
device is attempting to monitor more than one IV medication at the same time,
Bluetooth modules would make it possible owing to its unique identifier. In our study,
we apply Class 2 Bluetooth whose range is 10 meters in diameter, this selection is
sufficient for ward monitoring [31]. Similar to AD conversion, we perform Bluetooth
transmission on Arduino board with Bluetooth extension, shown Figure 15.
30
Figure 15 Arduino's Bluetooth Extension
4.2.5 Android Device
The minimum requirement for Android device is the following:
Minimum OS: Android 2.2
With Bluetooth transmission component
Touch screen for user’s interaction
In our experiment, we used a Samsung Ace Plus Smartphone as a prototype.
31
5 Software Architecture
5.1 Software Design Strategy
Similar with most Android applications, this project utilizes Model View Controller
(MVC) pattern in implementation [32]. Figure 16 shows the software architecture of
this Android application.
Figure 16: Software Architecture
There are five components in this application.
1. User Interface: Receive input and display output to interact with users
2. Bridge: Pass values between User Interface (XML) and Engine (Java)
3. Interpreter: Link between element ID on XML and Java program
32
4. Engine: Perform calculation (Java)
5. SQL: Query language of communication between Engine and Temp Storage
6. Temp Storage: Temporary data storage (SQLite)
33
5.2 Software Components
5.2.1 User Interface
The User Interface (UI) on the android device has two main screens. The Welcome
Screen and Main Activity. They are implemented with XML.
Welcome Screen
The first one, shown in Figure 17 is a welcome screen of the application. While the
system is displaying the welcome screen, it opens the socket connection to connect
with Arduino’s Bluetooth extension [33]. In our experiment, we hard coded the MAC
address of the Bluetooth module into our Java program. As a result, the process of
selecting Bluetooth device has been eliminated. Once the connection has been
established, the screen will be transferred to Main Activity.
Figure 17: Welcome Screen
34
Main Activity
The Main Activity screen is where the monitoring and flowing action are being
displayed. Ash shown in Figure 18, from top to bottom, there are five parts on Main
Activity. Line chart, magnify buttons, volume monitor, speed monitor, calibration.
Figure 18: Main Activity Screen
Line Chart
The line chart depicts the dynamic movement of the volume of the IV solution. By
default, it is turned off and does not show anything. Once it has been turned on, it
will draw a line chart of the current volume of IV solution every second.
Magnify Buttons
The magnify buttons are created to allow users to zoom in or out of the line chart.
This feature has been added after the initial test when some users complaint the
difficulty of seeing the line chart after a long period of time.
35
Volume Monitor
The volume monitor area displays the current volume of volume of IV solution. The
output is in two decimal point format. A toggle button is provided to users to switch
on and off the monitoring process. By default, the button is switched off. Once
switched on, the volume value updates every second.
Speed Monitor
Similar with volume monitor, the speed monitor area displays the speed of IV solution
flow. The difference is that speed value starts monitor starts five seconds after
volume monitor has been kicked off.
Calibration
The calibration bar is for calibrating the application at the beginning of each
experiment. Users may use the Seekbar to set the initial volume of the IV solution.
After the calibration is complete, users may start monitoring.
5.2.2 Bridge
Bridge is the connection between UI and interpreter. Whenever an action is detected,
such as button pressed, the bridge will send a request to Interpreter for request
handling.
5.2.3 Interpreter
Interpreter is responsible for handling events passed by Bridge. We implemented the
Interpreter by using a number of Java interfaces. The goal is to have all user event
handled successfully.
36
5.2.4 Engine
In Java Engine’s main duty is receiving data from Bluetooth device and performing
necessary calculation. We employed multithreading technique to handle Bluetooth
event and calculations separately.
5.2.5 Temp Storage
Whenever a new piece of data is received from Bluetooth device, it is stored
temporarily with SQL statement. If the Engine is to perform calculation, it will fetch
the data with a queue data structure.
37
5.3 Software Design Patterns
In object oriented system design, patterns are utilized to improve the overall structure
of the system architecture. A design pattern is a general reusable solution to a
commonly occurring problem within a given context in software design. Design
patterns are not finished designed that can be directly implemented into coding. It
works, however, as a model or template to guide a specific type of problem solving
technique which can be broadly applied to similar situations. In this project, object
oriented design pattern shows the relationship and interactions between classes. The
goal of using design pattern is to enhance the performance and efficiency during
system implementation.
5.3.1 Model-view-controller
Model-view-controller (MVC) isolates the domain logic from presentation interface,
permitting independent development, testing and maintenance of each component. It
is applied in most graphical systems which support multiple platforms such as desktop,
smart phone, and other devices. The advantage is that single logical component is
used regardless of presentation interface. As a consequence, only user interface needs
to be developed to fulfill the requirement of different devices. System consistency
and efficiency are achieved. The figure below shows the overall structure of MVC
and user.
38
Controller
View Model
The control flow of MVC is the following
1. User interacts with interface (View) from Android device
2. Controller handles user’s input and request via a register and converts the
event into appropriate action, which is well defined business logic
3. Controller notifies the model to handle the request and perform computation
or change state
4. View queries Model to generate appropriate output and update result in
Android activity
5. User receives the output and restarts the cycle
Implementation Methodology
In this project, object oriented technology is applied in the system. The class diagram
if figure below shows the relationship of objects in MVC.
39
Model
The model is a collection of Java classes that form a software application intended to
store, and optionally separate, data. A single front end class that can communicate
with Android activity class.
View
The view is represented by a Java Server Page, with data being transported to the
activity in the RequestDispatcher.
Controller
The Controller servlet communicates with the front end of the model and loads the
RequestDispatcher with appropriate data, before accepting the Request instance.
40
5.3.2 Abstract Factory
Abstract Factory is a design pattern that provides a way to encapsulate a group of
individual factories that have a common theme [34] [35] [36]. In normal usage, the
client layer creates a concrete implementation of the abstract factory and then uses the
generic interfaces to create the concrete objects that are part of the theme. The client
does not know (or care) which concrete objects it gets from each of these internal
factories since it uses only the generic interfaces of their products. This pattern
separates the details of implementation of a set of objects from their general usage.
The class diagram below shows the general structure of Abstract Factory pattern.
+createButton()
«interface»GUI Factory
+method()
«interface»Button
+createButton()
WinFactory
+createButton()
OSFactory
+method()
WinButton
+method()
OSButton
Application
41
5.3.3 Façade
Façade pattern is commonly used to provide simplified interface to a large number of
clients or class library. A vivid example of Façade is the inter-connection of office
equipment and clients. The advantage of using Façade is that only the façade object
needs to be modified if there is update of the client. As a result, communication
between clients and equipment are centralized to achieve efficiency and consistent.
Regardless of login sessions, the server is able to handle request from different users
to complete multiple tasks simultaneously. Whenever a new user session is created,
Façade object adds a new instance for this user. Similarly, if new services are added,
corresponding instance in Façade object will create new instance for this service as
well.
42
6 Methodology
6.1 Linear Regression
As stated in the previous section, the output voltage of load cell is in linear
relationship with the forced applied. We use linear regression model to determine the
parameters to compute the weight from a voltage read from our sensor.
Mathematically, we can use the following formula to represent the weight and voltage
relationship.
𝑊𝑖 = 𝜀𝑖 + ∑ 𝛽𝑖 𝑉𝑖𝑗
𝑛
𝑗=1
Where 𝑊𝑖 is the weight we want to compute in the i-th experiment
𝜀𝑖 is the error term of the i-th experiment
𝛽𝑖 is the parameter vector or the regression coefficient in the i-th experiment
𝑉𝑖𝑗 is the j-th reading voltage in the i-th experiment
43
6.2 Measured Flow Rate
In computing the flow rate of the IV solution, we need to compute the amount of
liquid which has been delivered into patient’s body. This can be represented by the
change of volume in the IV solution bag. We use the following formula to calculate
the change of volume.
∆𝑣𝑖 = ∆𝑊𝑖
𝜌𝑖
Where ∆𝑣𝑖 is the change of volume of the solution in i-th experiment
∆𝑊𝑖 is the change of the weight in i-th experiment
𝜌𝑖 is the density of the solution in i-th experiment
After we obtained the change of volume, we may calculate the flow rate.
𝑟𝑖 = ∆𝑣𝑖
∆𝑡
Where 𝑟𝑖 is the flow rate in i-th experiment
∆𝑣𝑖 is the change of volume of the solution
∆𝑡 is the time interval of our measurement
44
6.3 Actual Flow Rate
The actual flow rate of the solution in an IV system can be calculated by using the
drop factor stated on the IV system’s label. Mathematically, the formula to compute
the actual flow rate is the following:
�̂�𝑖 = 𝑁𝑖
𝑓𝑖
Where �̂�𝑖 is the actual flow rate in i-th experiment
𝑁𝑖 is the total number of drops in one minute in i-th experiment
𝑓𝑖 is the drop factor of the IV system in i-th experiment
In measuring the performance of our designed system, we may simply compare the
Measured Flow Rate (𝑟𝑖) with the Actual Flow Rate (𝑟�̂�) in our experiment.
45
6.4 Root Mean Square Error
Root Mean Square Error (RMSE) measures the deviation between the value measured
by our system and the actual value calculated by using IV drop factor. We use the
following formula to calculate RMSE.
𝑅𝑀𝑆𝐸𝑖 = √∑ (𝑟𝑖,𝑡 − �̂�𝑖,𝑡)2𝑛
𝑡 =1
𝑛
Where 𝑅𝑀𝑆𝐸𝑖 is the RMSE of i-th experiment
𝑟𝑖,𝑡 is the measured value at time 𝑡 in i-th experiment
�̂�𝑖,𝑡 is the actual value calculated using IV drop factor at time 𝑡 in i-th experiment
𝑛 is the total number of measurement in i-th experiment
46
6.5 Normalized Root Mean Square Error
Normalized Root Mean Square Error (NRMSE) is calculate by dividing RMSE from
the largest discrepancy of the measured data.
𝑁𝑅𝑀𝑆𝐸𝑖 = 𝑅𝑀𝑆𝐸𝑖
𝑟𝑖,𝑚𝑎𝑠−𝑟𝑖,𝑚𝑖𝑛 where
𝑅𝑀𝑆𝐸𝑖 is the root mean square error of the i-th experiment
𝑟𝑖,𝑚𝑎𝑠 is the maximum measured value of the i-th experiment
𝑟𝑖,𝑚𝑖𝑛 is the minimum measured value of the i-th experiment
47
7 Implementation and Testing
7.1 Test Plan
Testing is the process of exercising a program with the specific intent of finding errors
prior to delivery to the end user. Testing requires that the developer discard
preconceived notions of the “correctness” of the system developed and then work
hard to design test cases and strategies to “break” the system. As Know Your Course
is an online information system, its testing activities requires a collection of testing
tasks in web application content, function, capacity, performance, and security.
7.1.1 Testing Objective
The goal of testing is to find errors. At the same time, the tests themselves exhibit a
set of characteristics that achieve the goal of uncovering errors with a minimum of
effort. Upon completion of all the tests, Know Your Course should be error-free, and
ready for delivery to users.
7.1.2 Testing Strategy
The strategy for testing activities for Know Your Course may be viewed in the context
of the spiral cycle (Figure 5.1.1). Unit testing begins at the vortex of the spiral and
concentrates on each unit. Testing progresses by moving outward along the spiral to
integration testing, in which the focus is on design of the system. Later, validation
testing is aimed to validate against the requirements. Then, browser testing focuses on
the results of web applications when they are run on different web browsers, such as
Internet Explorer, Firefox, and Chrome. Finally, system testing is conducted so that
elements from different system modules are tested as a whole.
48
7.1.3 Testing Methods
There are three methods implemented in the testing activities of Know Your Course:
Black Box Testing, White Box Testing, and User Acceptance Testing.
49
7.2 Black Box Testing
Black Box Testing, also known as behavioral testing, focuses on the functional
requirements of the system. Black Box Testing techniques enable testers to derive sets
of input conditions that will fully exercise all functional requirements for a program.
As the name suggest, system testers treat the entire system as a black box in which the
details of the system is unknown to the testers. The figure below demonstrates how
black box testing can be understood.
Figure 19 Black box testing
Black Box Testing can be applied to all levels of testing plans: unit, integrating, and
system testing.
50
7.3 White Box Testing
White box testing, which is also known as Structured Testing, is an approach to
testing where the tests are derived from knowledge of the software’s structure and
implementation. The internal perspective of the software and programming skills are
used to design test cases. More precisely, testers should be aware of the organization
and logic of the testing programs. In addition, they are required to have the
knowledge of the algorithms used to implement the functions as well as the
underlying data structures. Similar to black box testing, white box testing can be
applied to unit, integrate, and system testing levels. On the contrary, it is often
performed in unit testing because it takes substantial amount of resources to test all
independent paths of a system in system testing stage. In my project, I will perform
white box testing in unit testing level to illustrate each independent path of the system.
51
8 Experimental Result
8.1 Linear Regression
We implement the linear regression model with fixed weight which is commonly used
on laboratory’s balance. The range of weight is from 10 to 200 grams with ten grams
interval. We then read the voltage output from our sensor for each weight applied.
Figure 20 displays the distribution of Mass and Voltage on a scatter plot. From the
chart, we can observe that the distribution of mass follows a linear relationship with
voltage, which is consistent with our prior knowledge that the output of load cell is
proportional to the forced applied.
Figure 20 Linear Regression of Mass vs Voltage
In each weight, we log the maximum and minimum voltage. For example, if the
output voltages for 30 grams weight are 0.056, 0.049, 0.054, 0.050, 0.057, 0.051, the
maximum and minimum voltage reading are 0.056 and 0.049 respectfully. Eventually,
we have obtained 40 data point for the linear regression model.
0
50
100
150
200
250
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35
Mas
s (g
)
Voltage (V)
Linear Regression: Mass vs Voltage
52
Once we input the data into the model, we come up with the following equation of the
relationship between mass and voltage.
𝑉 = 𝑠𝑀 + 𝑏
Where s = 1.532E-3
b = 1.009E-2
53
8.2 IV Flow Rate
In measuring the IV Flow Rate, we used the method of comparing measured flow rate
𝑟𝑖 with the actual flow rate 𝑟�̂�. In our experiment, we used an IV system with drop
factor of 15 gtts/mL. We compared our measured result with five actual flow rate
values computed in the formula for each actual value we log the measured value every
second for one minute. As a result, we have 60 measured values in each experiment.
Table 3 illustrates the actual and measured value of flowing rate in mL/min.
Table 3 IV Flow Rate Unit: mL/min
Actual Value 1.67 2.00 2.33 2.67 3.00
Measured Value Average 1.64 2.14 2.37 2.71 3.03
Minimum 1.50 1.85 2.06 2.34 2.75
1st Percentile 1.56 2.00 2.22 2.55 2.88
Median 1.62 2.14 2.38 2.70 3.01
3rd Percentile 1.72 2.28 2.51 2.91 3.16
Maximum 1.79 2.49 2.68 3.08 3.34
The distribution of our measured data is shown in Figure 21. From the box chart, we
can identify that the result is consistent with our prior knowledge about linear
relationship with change of mass and voltage.
54
Figure 21 Accuracy of Flow Rate
The error of the measurement is presented using Normalized Root Mean Square Error
(NRMSE) in Figure 22. Overall, the discrepancy between actual and measured value
is below 40% at all levels.
Figure 22 Normalized RMSE
1.40
1.60
1.80
2.00
2.20
2.40
2.60
2.80
3.00
3.20
3.40
1.67 mL/min25 gtts/min
2.00 mL/min30 gtts/min
2.33 mL/min35 gtts/min
2.67 mL/min40 gtts/min
3.00 mL/min45 gtts/min
Me
asu
red
Flo
w R
ate
(m
L/m
in)
Actual Flow Rate (mL/min, gtts/min)
Accuracy of Flow Rate Monitoring
55
9 Conclusions
Research on IV therapy’s monitoring device could continue in a number of directions.
First, the system shall be tested under a number of different types of solutions in
actual clinical environment with the consideration of interference and patient’s
willingness to cooperate. From the biomedical engineering’s perspective, it is crucial
to develop a system that introduces no barrier to patient’s and healthcare professionals.
Ultimately, a future integration with the Electrical Health Record will lay the
foundation of quantitative analysis of clinical cases
In conclusion, our study has provided a useful prototype of IV flow rate monitoring.
Consistent with our hypothesis, the Weight sensor Mobile Platform model
demonstrated satisfactory result in our experimental analysis.
56
10 Reference
[1] J. K. Loo and S. Riegelman, "Assessment of pharmacokinetic constants from
postinfusion blood curves obtained after I.V. infusion," Journal of Pharmaceutical
Sciences, vol. 59, no. 1, pp. 53-55, 2006.
[2] J. Grem, K. D. Tutsch and K. J. Simon, "Phase I study of taxol administered as
a short i.v. infusion daily for 5 days," Cancer Treat Report, vol. 71, no. 12, pp. 1179-
1184, 1987.
[3] D. D. Breimer, "Pharmacokinetics of Methohexitone Following Intravenous
Infusion in Humans," British Journal of Anaesthesia, vol. 48, no. 7, pp. 643-649, 1976.
[4] M. J. Orloff, H. L. Williams and C. C. Pfeiffer, "Timed Intravenous Infusion of
Metrazol and Strychnine for Testing Anticonvulsant Drugs," Experimental Biology
and Medicine, vol. 70, no. 2, pp. 254-257, 1949.
[5] J. P. Eder and J. G. Supko, "Phase I Clinical Trail of Recombinant Human
Endostatin Administered as a Short Intravenous Infusion Repeated Daily," Journal of
Clinical Oncology, vol. 20, no. 18, pp. 3772-3784, 2002.
[6] A. G. Hansma and H. J. Broxterman, "Recombinant human endostatin
administered as a 28-day continuous intravenous infusion, followed by daily
subcutaneous injections: a phase I and pharmacokinetic study in patients with
advanced cancer," Annals of Oncology, vol. 16, no. 10, pp. 1695-1701, 2005.
[7] K. Rosenthal , "Intravenous fluids: the whys and wherefores.," Nursing, vol.
36, no. 7, pp. 26-27, 2006.
[8] G. Eastwood and L. Peck, "Intravenous fluid administration and monitoring
for adult ward patients in a teaching hospital," Nursing & Health Sciences, vol. 14, no.
2, pp. 265-271, Jume 2012.
[9] W. Adachi and A. E. Lodolce, "Use of failure mode and effects analysis in
improving the safety of i.v. drug administration," American Journal of Health-system
Pharmacy, vol. 62, no. 9, pp. 917-920, 2005.
[10] P. L. Trbovich, S. Pinkney, J. A. Cafazzo and A. C. Easty, "The impact of
traditional and smart pump infusion technology on nurse medication administration
performance in a simulated inpatient unit," The International Journal of Healthcare
Improvement, vol. 19, no. 5, pp. 430-434, 2009.
[11] "Where errors occur in the preparation and administration of intravenous
medicines: a systematic review and Bayesian analysis," Quality & Safety in Health
Care, vol. 19, no. 4, pp. 341-345, 2010.
[12] T. B. Wetterneck and K. A. Skibinski, "Using failure mode and effects analysis
to plan implementation of smart i.v. pump technology," American Journal of Health-
System Pharmacy, vol. 63, no. 16, pp. 1528-1538, 2006.
57
[13] V. V. Wheless, "Safety of rapid intravenous infusion of valproate loading doses
in epilepsy patients.," Epilepsy Research, vol. 35, no. 2, pp. 147-153, 1999.
[14] R. Barker, "How to Monitor IV Fluid Therapy," ehow.com, 2012. [Online].
Available: http://www.ehow.com/how_7428103_monitor-iv-fluid-therapy.html.
[15] A. Pasolini, "Students develop mousetrap IV drip to tackle dehydration in
developing world," 18 May 2012. [Online]. Available: http://www.gizmag.com/rice-
university-iv-drip/22579/.
[16] "Google Play," [Online]. Available:
https://play.google.com/store/apps/details?id=com.DTsEMT.DripRateCalc&hl=zh_T
W.
[17] "Google Play," [Online]. Available:
https://play.google.com/store/apps/details?id=com.jonsap.ivinfusioncalc&hl=zh_TW.
[18] "Appszoom," [Online]. Available: http://www.appszoom.com/iphone-
apps/medical/iv-therapy_dqbng.html.
[19] U.S. Food and Drug Administration, "White Paper: Infusion Pump
Improvement Initiative," U.S. Food and Drug Administration, 22 April 2010. [Online].
Available:
http://www.fda.gov/MedicalDevices/ProductsandMedicalProcedures/GeneralHospital
DevicesandSupplies/InfusionPumps/ucm205424.htm.
[20] P. Carayon, A. S. Hundt and T. B. Wetterneck, "Nurses’ acceptance of Smart
IV pump technology," International Journal of Medical Informatics, vol. 79, no. 6, pp.
401-411, 2010.
[21] D. W. Bates, T. Vanderveen, E. Seger, C. Yamaga and J. Rothschild,
"Variability in intravenous medication practices: implications for medication safety,"
Joint Comission Journal on Quality and Patient Safety, vol. 31, no. 4, pp. 203-210,
2005.
[22] C. Keohane, J. Hayes, C. Saniuk, J. Rothschild and D. Bates, "Intravenous
medication safety and smart infusion systems: lessons learned and future
opportunities," Infusion Nursing Standards of Practice, vol. 28, no. 5, pp. 321-328,
2005.
[23] U.S. Food and Drug Administration, "FDA Database," U.S. Food and Drug
Administration, 14 December 2012. [Online]. Available:
http://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfpmn/pmn.cfm?ID=40532.
[24] "Wikipedia," [Online]. Available: httpL://en.wikipedia.org/wiki/Load_cell.
[25] M. C. Beverly, F. T. Horan and W. C. Hutton, "Load Cell Analysis Following
Silastic Arthroplasty of the Hallux," International Orthopaedics, vol. 9, no. 2, pp. 101-
104, 1985.
[26] D. A. Sear, W. Damon, D. J. Booker and D. G. Anderson, "A Load Cell Based
58
Continuous Recording Bedload Trap," Earch Surface Processes and Landforms, vol.
25, no. 6, pp. 659-672, 2000.
[27] P. Dario, "Tactile Sensing: Technology and Applications," Sensors and
Actuators A: Physical, vol. 26, no. 1-3, pp. 251-256, 1991.
[28] N. M. White and J. E. Brignell, "A Planar Thick-firm Load Cell," Sensors and
Actuators, vol. 26, no. 1-3, pp. 313-319, 1991.
[29] "IEEE Standard for Information Technology- Telecommunications and
Information Exchange," [Online]. Available:
http://ieeexplore.ieee.org/xpl/mostRecentIssue.jsp?punumber=7932.
[30] "IEEE Standard for Information Technology - Telecommunications and
Information Exchange Between Systems - Local and Metropolitan Area Networks -
Specific Requirements. - Part 15.1: Wireless Medium Access Control (MAC) and
Physical Layer (PHY) Specification," [Online]. Available:
http://ieeexplore.ieee.org/xpl/mostRecentIssue.jsp?punumber=9980.
[31] Wikipedia, "Wikipedia," 2013. [Online]. Available:
http://en.wikipedia.org/wiki/Bluetooth.
[32] "Applications Programming in Smalltalk-80(TM):," [Online]. Available:
http://st-www.cs.illinois.edu/users/smarch/st-docs/mvc.html.
[33] "Arduino Board Bluetooth," [Online]. Available:
http://arduino.cc/en/Main/ArduinoBoardBluetooth.
[34] "Abstract factory pattern," [Online]. Available:
http://en.wikipedia.org/wiki/Abstract_factory_pattern.
[35] "Abstract Factory Design Pattern," [Online]. Available:
http://www.lepus.org.uk/ref/companion/AbstractFactory.xml.
[36] R. R. Raje and S. Chinnasamy, "eLeLePUS - a language for specification of
software design patterns," Proceedings of the 2001 ACM symposium on Applied
computing, pp. 600-604, 2001.
59
Appendix 1 Cost Breakdown
Item Unit Cost
Load Cell 2 200.00
Arduino Board 1 175
Arduino Bluetooth
Extension
1 79.00
Amplifier 1 300.00
Arduino Accessories 1 15.00
Total: HKD 769.00
60
Appendix 2 Load Cell Specification
Capacity Kg 3
Sensitivity mV/V 1.2±0.1
Combined Error %FS 0.005
Creep %FS(15min) 0.005
Input Resistance Ω 406±20
Output Resistance Ω 350±5
Insulation Resistance M Ω ≥5000(100VDC)
Zero Balance %FS ±1
Temperature Effects Span %FS/10℃ 0.02
Temperature Effects Zero %FS/10℃ 0.017
Rated Temperature Range ℃ -10~+60
Operating Temperature Range ℃ -20~+80
Proposed Excitation Voltage V 6~12
Allowed Excitation Voltage V 3~15
Safe Overload %FS 120
Ultimate Overload %FS 150
Protection IP67
Material Aluminum Alloy