... support and understanding I would also like to thank Dr Yen Shih Cheng and A/Prof Gerald Koh for their patient explanation of concepts and timely pointers I am grateful to Ms Karen Koh and Angela... has also been a pleasure to work with Mr Benjamin Hon and Mr Phan Shi Wen who developed and maintained the iOS patient application, sensor nodes and o↵ered help and company to the author throughout... exercises and the amount of resistance with the the exercises and meant to be performed, along with traditional tele-rehabilltation capabilities of video calling between the patient and his/her
Trang 1Tele-rehabilitation System for Elderly
Yogaprakash Kumar
A0039716Y B.Eng.(Hons.), NUS Friday 18th July, 2014
A THESIS SUBMITTEDFOR THE DEGREE OFMASTER OF ENGINEERING
DEPARTMENT OF ELECTRICAL AND COMPUTER
ENGINEERINGNATIONAL UNIVERSITY OF SINGAPORE
2014
Trang 2I hereby declare that the thesis is my original work and it has beenwritten by me in its entirety I have duly acknowledged all the sources of
information which have been used in the thesis
This thesis has also not been submitted for any degree in any university
previously
Yogaprakash KumarFriday 18th July, 2014
Trang 3Post-stroke patients tend to have low participation rate in their supervised apy schedule This is due to factors such as high cost of therapy, complexity ofexercises and difficulties involved in travelling to a rehabilitation centre Therefore,
ther-a mobile tele-rehther-abilitther-ation system thther-at uses low-cost components to guide, monitorthe patients exercises and provide timely feedback is proposed This system alsofacilitates tele-communication with a tele-therapist who prescribes exercises for thepatient and supervises his/her progress The e↵ectiveness of this system is beingtested using a Randomized Controlled Trial (RCT) consisting of patients from Ang
Mo Kio Thye Hua Kwan Hospital (AMK-THKH) and Singapore General tal (SGH) This thesis presents in detail the hardware and software components ofthe mobile tele-rehabilitation system and concludes with preliminary results fromthe RCT The focus of the thesis will be on the author’s main contribution tothe project This includes the sensor validation, iOS application developed for thetherapist as well as server-side database design and scripts The iOS applicationdeveloped for the patient and the hardware devices will also be discussed for thesake of completeness
Trang 4I would like to thank my supervisor, A/Prof Arthur Tay for providing continuousguidance, support and understanding I would also like to thank Dr Yen ShihCheng and A/Prof Gerald Koh for their patient explanation of concepts and timelypointers I am grateful to Ms Karen Koh and Angela Cheong from the Saw SweeHock School of Public Health for contributing knowledge from decades of experience
in physiotherapy and working with patients They have also been instrumental inboth the product development and the testing of the prototypes on normal subjectsand patients
It has also been a pleasure to work with Mr Benjamin Hon and Mr Phan Shi Wenwho developed and maintained the iOS patient application, sensor nodes and o↵eredhelp and company to the author throughout the project It has been enriching tohelp out several batches of FYP students on related project as these helped me
to gain confidence in solving problems I would also like to acknowledge Ms S.Mainavathi, the laboratory technician who made many of the administrative tasksproceed smoothly I would also like to thank all my friends and everyone elsewho provided support or expressed curiosity or interest in this project Last butcertainly not the least, I would like to thank Singapore Millennium Foundation,National University Health System and National University of Singapore for theirgenerous funding for the project This project would not have been possible withouttheir support
Trang 51.1 Motivation 11
1.2 Contribution 13
1.3 Organisation 14
2 Literature Review 16 3 The Tele-Rehabilitation System 22 3.1 Overview of proposed solution 22
3.2 System Architecture 23
3.3 The patient Application and Sensors 25
3.4 The Therapist Application 25
3.4.1 Login 32
3.4.2 Patient Selection 33
3.4.3 Activity Selection 36
3.4.4 Five-frame Scroller 41
3.4.5 Videos 44
3.4.6 Forms 47
3.5 Database Design 55
3.6 Server scripts 60
Trang 64.1 Calibration of static accelerometer 62
4.2 Goniometer-Sensor comparison for angular measurements 62
4.3 Preliminary Testing 79
4.4 Randomized controlled trial 79
5 Conclusion 82 5.1 Conclusion 82
5.2 Future Work 82
Appendix B Exercises for testing of sensor accuracy 94
Trang 7List of Figures
2.1 Photo of the NESS system is use, taken from a brochure 17
2.2 System architecture of Gertner Tele-Motion-Rehab system, taken from [11] 19
2.3 Screenshot of the one of the games o↵ered by the Gertner system, taken from [11] The screenshot shows the customer ordering item 2 from the menu shown in the right 20
2.4 Photo of the Armeo spring system, taken from [15] 21
3.1 Overall System Architecture 27
3.2 Storyboard of Therapist Application 28
3.3 Screenshot of Login screen 32
3.4 Screenshot of Patient Selection screen 33
3.5 Screenshot of Patient Selection screen with call notes and forms 34
3.6 Screenshot of Activity Selection Screen 36
3.7 Arrangement of the screens on a UIScrollView 42
3.8 The change in the arrangement of the screens on a UIScrollView, just after a user scrolls to the screen that is to the right hand side The screens with ‘X’ are to be discarded while the dotted screens are to be generated 42
3.9 Screenshot of the video screen showing a user performing shoulder flexion 45
3.10 Screenshot of the navigation tables at the video screen 46
Trang 83.11 A screenshot of the heart rate - blood pressure (HR-BP) form, ing the user that the systolic blood pressure is too low and that thediastolic blood pressure is too high 473.12 E-mail sent to the administrator to inform that an abnormal HR-BPentry has been added for a patient 493.13 A screenshot of the main page of the compliance form 503.14 A screenshot of the one of the week-pages of the compliance form 513.15 A screenshot of the patient search screen, with call notes opened 533.16 A screenshot of the first part of the adverse events form 553.17 A screenshot of the second part of the adverse events form 563.18 Enhanced-Entity-Relationship (EER) diagram of the tables in database 593.19 Flowchart of verification of a request on the server 614.1 Goniometer vs Static Accelerometer plot The error bars for most ofthe points are too small to be seen 634.2 Positions of sensors on the upper and lower extremities 684.3 Scatter Plots of Angles Using Goniometer vs Sensor of Major Joints(a) UE and (b) LE in normal subjects 694.4 Scatter plots of angles measured using goniometer vs sensor of majorjoints (a) UE and (b) LE in patients 704.5 Scatter plot of angles measured using goniometer vs sensor for specificjoints in both sides of UE in normal subjects 714.6 Scatter plot of angles measured using goniometer vs sensor for specificjoints in both sides of LE in normal subjects 714.7 Scatter plot of angles measured using goniometer vs sensor for specificjoints in both sides of UE in patients 724.8 Scatter plot of angles measured using goniometer vs sensor for specificjoints in both sides of LE in patients 72
Trang 9alert-4.9 Scatter plot of angles measured using goniometer vs sensor for specificjoints in both sides of UE in normal subjects 734.10 Scatter plot of angles measured using goniometer vs sensor for specificjoints in both sides of LE in normal subjects 744.11 Scatter plot of angles measured using goniometer vs sensor for specificjoints in both sides of UE in patients 754.12 Scatter plot of angles measured using goniometer vs sensor for specificjoints in both sides of LE in patients 764.13 Upper extremity inter-therapist and inter-sensor Plots of specific ex-ercises from 19 normal subjects 764.14 Lower extremity inter-therapist and inter-sensor Plots of specific ex-ercises from 19 normal subjects 774.15 Upper extremity inter-therapist and inter-sensor Plots of specific ex-ercises from 19 newly disabled patients 774.16 Lower extremity inter-therapist and inter-sensor Plots of specific ex-ercises from 20 newly disabled patients 78
Trang 10List of Tables
3.1 List of screens with the name of the ViewController object managingthe screen and description 294.1 This table provides an overview of days of activity within the first 3weeks of intervention Days that are in bold are those days duringwhich the first 4 patients performed exercises 80A.1 Therapist information table (therapist info) to store data identifyingthe therapists 86A.2 Patient information table (patient info) to store data identifying thepatients 87A.3 Strengthening Activity Lists table to store information about allstrengthening activity 91A.4 Strengthening Progression levels table to store information about theprogression levels of strengthening exercises 91A.5 Strengthening activity selection table to store the therapists’ strength-ening activity prescriptions for the patients 91A.6 Strengthening activity record table to store the patients’ strengthen-ing activity repetitions 92A.7 Compliance form data table to store the number of minutes of exer-cise per day for every patient 92
Trang 11A.8 HR-BP record table to store the heart-rate and blood pressure values
of patients 93A.9 FaceTime calls record table to record the date and time of calls made
by the therapist, and call notes 93A.10 iPad record table to keep track of the various iPads that are underuse 93A.11 Seen graphs record table to keep track of the graph-pages that havebeen seen by each therapist 93B.1 Outline of Range-of-Motion (ROM) assessment exercises 94
Trang 12List of Abbreviations
AMK-THKH Ang Mo Kio Thye Hua Kwan Hospital 1, 83
B-A Bland-Altman 69
BVH Bright Vision Hospital 83
ECE Electrical and Computer Engineering 83
EER Enhanced-Entity-Relationship 6, 62
HR-BP heart rate - blood pressure 5, 6, 10, 48–51, 104
NMES Neuromuscular Electrical Stimulation 14
NUS National University of Singapore 66, 83
RCT Randomized Controlled Trial 1, 63, 64, 83, 94
ROM Range-of-Motion 10, 14–16, 18, 20, 33, 60, 66–68, 105
SGH Singapore General Hospital 1, 83
SSH Saw Swee Hock School of Public Health 83, 84
STARS Singapore tele-technology aided rehabilitation in stroke 61
VR Virtual Reality 15
Trang 13or even death The World Health Organisation has identified stroke to be thesecond leading cause of death worldwide, accounting for 11.9% of deaths in the year2011[2] (leading cause is ischaemic heart disease and 3rd leading cause if chronicobstructive pulmonary disease) The common disabilities include inability to moveone or more limbs on one side of the body or an inability to understand or formulatespeech Patients admitted into hospitals due to stroke are usually discharged after
a few weeks of initial treatment, which may involve a surgery After the initialtreatment, stroke rehabilitation is usually encouraged in an attempt to recover thelost functions
The goal of rehabilitation is to enable the patients to reduce their dependency
on others when performing routine tasks and increase the chances of their long-termsurvival For cases of physical disabilities, the patients are usually taught individu-ally customised therapy exercises to perform before their initial discharge from the
Trang 14hospitals They are often encouraged to continue performing these exercises on adaily basis, after the initial discharge In Singapore, they are also encouraged toreturn to a hospital or a rehabilitation centre in their neighbourhood, to performthe rehabilitation exercises under the supervision of a therapist In the case ofSingapore, these centres are located all over the relatively small land area of thecountry, making it accessible for most residences The supervision enables the ther-apist to check if the exercises are being done properly, monitor patients’ progress,change the prescribed exercises if needed and o↵er feedback and encouragement.The alternative to the patient travelling down to the rehabilitation centres is hometherapy, where a therapist travels to patient’s home for a supervised home-basedrehabilitation session This is uncommon in Singapore as it is expensive (about 200SGD per session for home-based rehabilitation versus approximate value of 60 SGDper session for rehabilitation at rehabilitation centres) and not widely available.
A local research on 215 stroke patients from 2 hospitals in Singapore found thatsustained participation in supervised therapy provides faster and greater functionalrecovery when compared with performance of unsupervised therapy at home as pre-scribed prior to discharge[4] This trend of greater functional recovery was evidentthrough objective functional measurements at five time-points from the time of ad-mission into hospitals till 1 year after the initial discharge from hospitals To add
to the significance of supervised therapy, 66.9% of the patients performing vised rehabilitation at home performed therapy more than 75% of the recommendedtime while only 33.3% of the patients performing supervised rehabilitation at cen-tres performed therapy more than 25% of the recommended time This also meansthat only 33.3% of the patients in the supervised therapy group actually commuted
unsuper-to hospitals or rehabilitation centres frequently enough unsuper-to participate in supervisedtherapy more than 25% of the recommended time Therefore, although supervisedtherapy gives better functional outcomes such as improvement in performing ac-tivities of daily living, there is a low utilisation rate of rehabilitation services by
Trang 15stroke patients This could be due to the cost of therapy sessions and/or social andphysical difficulties involved in travelling to a rehabilitation centre.
It will therefore be of benefit to the patients if supervised therapy can be formed at the comfort of the patients’ homes without the high cost involved intherapists visiting homes This can potentially reduce crowd at outpatient reha-bilitation wards A RCT on telerehabilitation performed in America found that
per-it can significantly improve physical function, wper-ith improvements lasting up to 3months after completing a 5-week long intervention [5] The telerehabilitation in-tervention used in this study includes an in-home messaging device that would askthe patient questions regarding common post stroke complications on depression,self-care/mobility and falls Therefore, the aids provided to the patient could notmonitor and guide the patient in performing the prescribed exercises There areseveral tele-rehabilitation hardware/software based systems available in the marketthat attempt to help, guide and monitor the patient to perform their prescribedexercises at home [7][10][15] However, these systems lack the ability to focus onboth the upper and lower limb related exercises and assessments This capability
is required to attend to the variety of stroke patients who require improvement inactive ROM of upper and/or lower limb(s) in order to eventually be able to per-form functional tasks These systems are often bulky and expensive, relative to thecost of home therapy There are also an unmet need of enabling the therapist toremotely prescribe relevant upper and lower limb exercises and adjust the difficultylevels of these exercises according to the patient’s progress
1.2 Contribution
The proposed tele-rehabilitation system consists of 3 software sub-systems thatwork together with a pair of sensor nodes These include the patient application,therapist application and a server
Trang 16The therapist application allows the therapist to modify the exercise tions for any of the assigned patients and to look at summary graphs of the exercisesperformed by the patient Exceptional cases spotted in the graphs can be furtherinvestigated by viewing a video of the patient performing the exercise There arealso administrative forms for the therapist to take down clinical notes, as they wouldusually do.
prescrip-The server contains a database to store information about the patients, therapists, independent assessors assessing the patients, activity prescriptions forthe patient by the tele-therapist, activities performed by the patients The authorhas designed mySQL tables in the database in order to reduce redundancies inthe data being stored The server also contains PHP scripts coded by the author,rendered by an Apache server The server scripts securely connect to the database toquery and retrieve data required by the iOS applications Communication betweenthe PHP scripts and the applications is encrypted by a session keys as part of theHTTPS protocol
tele-The author also helped in the collection of data from patients in AMK-THKH
in order to establish the reliability of sensor measurements relative to goniometry.The author is currently assisting in the technology side of the RCT in order to test
if the tele-rehabilitation system increases the compliance of post-discharge strokepatients to their prescribed exercises
Trang 17application, mySQL database and the server scripts The results and discussion ofthe tests performed on the sensors are presented in Chapter 4, together with pre-liminary results and analysis of the data from the first few patients of the ongoingRCT The thesis is then concluded in Chapter 5, with pointers for future research.Appendix A lists the columns that are used in the various database tables,together with the type of variables stored in these columns Appendix B lists theexercises that are used in establishing the reliability of the sensors, with respect tothe goniometer.
Trang 18Chapter 2
Literature Review
There have been several tele-rehabilitation systems developed in an attempt totranscend some of the barriers that patients face in attaining supervised therapy.However, the systems developed often lack in providing the ability to monitor theROM of various joints in both the upper and lower limbs while remaining portable.ROM is one of the fundamental evaluation procedures used by both occupationaland physiotherapists to assess patients undergoing rehabilitation
For example, the systems covered by [7] and [13] focus on rehabilitating andmonitoring ROM of hand-joints Article [7] discusses the details and examines theefficacy of a remote arm rehabilitation system There are several components to thisintervention regimen First is the Ness H200 Hand Rehabilitation System, which
is a Neuromuscular Electrical Stimulation (NMES) system consisting of a mouldedforearm brace with an array of electrodes Priced at US$6200 per unit [8], theelectrodes deliver alternating current waves to stimulate the contraction of digitflexors or extensors of the forearm A photo of the system in use is shown in Figure2.1 In addition to this, Logitech Buddy Cams were used with Skype telecommu-nication software to allow a tele-therapist to conduct 30 minutes of individualisedtherapy sessions, two times per week at scheduled times Computer to computervideo communication through Skype is free of charge The study points out that
Trang 19Figure 2.1: Photo of the NESS system is use, taken from a brochure
lack of computer competency and lack of comfort with technology is a threat to thegeneralised use of this regimen This would also be true in the context of Singaporewhere a significant proportion of the stroke patients are elderly and are not likely
to be able to operate relatively complex computer software independently Anotherlearning point from this study is that regular face-to-face communication betweenthe therapist and the patient would be necessary during tele-rehabilitation, for thetherapist to fully assess and advise the patient
Hence, the hardware and software interfaces to be used in tele-rehabilitationhas to be user-friendly and should only require minimal manual input from theuser Some of the stroke patients in Singapore are looked after by a caregiver
Trang 20who remains with them for most of the day This maybe a domestic helper, thepatient’s children or other relatives While it may not be justifiable to expect thecaregiver to be more comfortable or competent with technology than the patient,they can be trained to operate simple, straightforward and robust hardware and/orsoftware-based tele-rehabilitation systems for the patient.
Another relevant example is the Gertner Tele-Motion-Rehab presented in [10]and evaluated in [11] The system uses the Microsoft Kinect camera (priced atUS$99.99 [9]) interfaced with a customised software package to engage a patient
in Virtual Reality (VR) games while it captures the various ranges of motion andcompensations of the upper extremity joints The system’s angular measurementshave been validated with the Vicon optokinetic system The system as a whole can
be used in 3 configurations: One therapist to one patient, one therapist to manypatient and patient self-support The games provide control over the level of diffi-culty, configurable live feedback and storage of results for later retrieval In addition
to the results of the games, evaluative data such as the ROM angles of shoulder(flexion and abduction) and elbow (flexion) and the maximum compensation anglesthat occur while making these movements The trunk lateral and anterior-posteriormotions are captured as compensatory angles The difficulty of the games can bedecided by the software based on the stored evaluative data These decisions canalso be manually adjusted onsite or remotely The advantage of this system is thatthe patient does not need to wear sensors of controllers for the Kinect system topick up movements and evaluative angles The downside of this feature is that if apatient is accompanied by a care-taker, the caretaker cannot block the line-of-sightbetween the patient and the Kinect camera(s) This may happen in cases wherepassive ROM is being measured, with the caretaker assisting the patient to performrequired movements Furthermore, the caretaker’s should be able to provide assis-tance to the patient however required, without being concerned about the Kinectcamera
Trang 21Figure 2.2: System architecture of Gertner Tele-Motion-Rehab system, taken from[11]
Another relevant example is the well-established Armeo line of products thatare capable of monitoring and controlling the upper limb’s ROM[15].This systemuses a gravity-supporting exoskeleton apparatus with a pressure sensitive hand-grip and has been proven to enable patients to increase their active ROM morethan what is possible without support[12] The system, through virtual reality, cansimulate and help the patient accomplish functional daily living movements such
as table wiping It also provides auditory and visual performance feedback duringand after practice The virtual reality is shown on a 24-inch flat screen monitorwith speakers The advantage of this system is the partially active ROM that iso↵ers, as well as immediate feedback through virtual reality and also feedback that
is capable of pointing out sublet improvements in patients’ functionality This issignificant since it may be a challenge to stroke patients to lift the weight of theirown arm, in which case, getting them to perform arm movements without supportmight prove to be too difficult for them The difficulty level of the activities canalso be customised to the patient’s ability On the other hand, the Armeo system
is bulky (weighs upto 82 Kg) and restricted to the upper limb
Trang 22Figure 2.3: Screenshot of the one of the games o↵ered by the Gertner system, takenfrom [11] The screenshot shows the customer ordering item 2 from the menu shown
in the right
Therefore, the shortcomings of current options include high cost, lack of bility and the lack of flexibility to monitor multiple joints of both upper and lowerlimb Hence, to date, there is no single system that can monitor the ROM of bothupper and lower limb joints, provide exercises for these joints, allow the therapists
porta-to remotely prescribe the relevant exercises and the amount of resistance with thethe exercises and meant to be performed, along with traditional tele-rehabilltationcapabilities of video calling between the patient and his/her tele-therapist
Trang 23Figure 2.4: Photo of the Armeo spring system, taken from [15].
Trang 24Chapter 3
The Tele-Rehabilitation System
3.1 Overview of proposed solution
The proposed tele-rehabilitation system consists of 3 software sub-systems thatwork together with a pair of sensor nodes These include the patient application,therapist application and a server The patient and therapist applications are de-veloped on the iOS platform The sensor nodes communicate with the patientapplication via bluetooth and both the applications communicate with the serverthrough internet In addition to this, the patient might also require a stand to holdthe iPad, a heart rate and blood pressure monitoring set and traditional rehabili-tation aids such as theraband/theratubes The theraband/theratubes are used too↵er di↵erent colour-coded levels of resistance, while the iPad stand helps to holdthe iPad in a position from which its camera can capture the patient performingthe exercise
The iOS platform was chosen for its well-known and robust video tion solution, FaceTime It also allows a relatively fast development of the therapistand patient applications due to its intuitive development environment Low-leveltechnologies like Grand Central Dispatch make it easier to perform multi-threadingacross multiple processor cores Automatic Reference Counting avoids the perfor-
Trang 25communica-mance lag that garbage collection mechanism in Java can cause The iPad waschosen due to its user-friendly and intuitive user interface The iPad has proven re-liability as it is being used in life-critical applications such as aircraft and medicine.The therapist application allows the therapist to modify the exercise prescrip-tions for any of the assigned patients and to look at summary graphs of the exercisesperformed by the patient Exceptional cases observed from the graphs can be fur-ther investigated by viewing a video of the patient performing the exercise.
The patient application presents a simple and minimal user interface to allow thepatient to perform the assigned exercises at the settings prescribed by a therapist.The prescriptions and data for identification of the patient are retrieved from thedatabase, after an iPad is allocated to a particular patient The data collected fromthe exercises are uploaded to the server, together with the videos of the patientperforming the exercises
There are 2 sensor nodes that are used in this system The number of sensornodes for monitoring ROM have been minimised through various trials with hospitalinpatients
The sensors used in this system have been validated in earlier work, with ditional tools used in rehabilitation Validation of the sensors with goniometry hasbeen established in [17] and [18] Validation of the sensors with the Kinesia system[19] has been reported in [20] The Kinesia system has already been validated in[21] Therefore, the ROM measurements performed by these sensors are sufficientlyreliable for this application
tra-3.2 System Architecture
Figure 3.1 shows the system architecture of the entire tele-rehabilitation system.The 3 software sub-systems are namely the therapist application, patient set andthe server The therapist application has a server communication module that is
Trang 26used by other components that need to send and/or receive data from the server.These include retrieval of data from the database through HTTP POST requestsand retrieval of video files for streaming The server is addressed using a domainname that is mapped to a public static IP address The patient application has asimilar server communication module that enables it to communicate with the PHPscripts on the server through HTTP POST requests The patient application alsohas a bluetooth communication module to enable it to send command and receivedata from the nodes.
The server used in this system runs a non-server version of Mac OS X operatingsystem that comes with an Apache web server installed This web server is thenconfigured to receive and direct HTTP POST requests to a set of PHP scripts.These scripts then connect with the mySQL database if needed, to send mySQLqueries and receive the resulting data which are then used to reply the HTTP POSTrequests These requests can be sent by the patient or the therapist application.Uploading of videos by the patient application also uses a PHP script while retrieval
of videos by the therapist application is through a password-protected web address.The database that the PHP module communicates with is a mySQL database run-ning on the same machine This database is used to store discrete data such asthe patient and therapist details, exercise prescriptions, ROM for the repetitionsperformed by the patient and so on This is in addition to the file-system whichstores the videos and raw sensor data in xml files, for each of the exercise sessions.The neck and limb sensor nodes have the same hardware components and runsimilar programs Their only di↵erence is in the identity numbers that are hard-coded into them Each of the sensors have a ATMEGA328 processor that polls thegyroscope, accelerometer and magnetometer chips via I2C protocol to retrieve iner-tial data These numbers are processed, packaged by the ATMEGA328 processoronboard the sensor node and then sent to the patient application via low-energybluetooth module
Trang 273.3 The patient Application and Sensors
Each sensor node consists of a ATMEGA328 microprocessor embedded on aPrinted Circuit Board (PCB) with 3 motion sensors and a bluetooth module forwireless communication with the iPad The motion sensors include a BMA180 ac-celerometer, ITG3200 gyroscope and a HMC5883L magnetometer The bluetoothmodule used is the BLE112-E low energy single mode module by Bluegiga Technolo-gies The data from the various sensors are polled into the ATMEGA328 processorover a daisy-chained I2C connection This data is then fused into a 4-dimensionalquaternion orientation vector using the algorithm suggested by [16] This vectordenotes the orientation of the sensor node with respect to the direction of gravityvector This sensor fusion is performed by the ATMEGA328 processor The time-stamped orientation data is then communicated to the iPad over a bluetooth 4.0connection The patient application analyses this data to determine the orientation
of the 2 sensor nodes These orientation data is used to calculate the various gles that are needed for evaluation of each repetition or exercise performed by thepatient The cost price to buy the parts and manufacture one sensor node is about
an-50 SGD for bulk orders The minimum cost of an iPad that supports low-energybluetooth is 528 SGD, as of April 2014
3.4 The Therapist Application
This chapter goes though the typical as well as the exceptional workflows thatcan occur in every screen of the therapist application, followed by a technical de-scription of each of the workflows This method of discussion is selected due to itscloseness to the organisation of code The view objects in each of the screens aremanaged by a particular view controller object, as shown in Table 3.1 This tablealso has a description of each of the screen for easier identification The therapistapplication was developed with regular input from an experienced physiotherapist
Trang 28and a doctor.
The storyboard feature added from XCode version 4 allows a graphical display
of all of the screens with their content and the connections representing the sitions between those screens Each screen represents a view controller Each viewcontroller manages a single hierarchy of view objects Therefore, all of the viewobjects within a particular screen are subviews of a single background view that
tran-is managed by the corresponding view controller There are also container viewcontrollers that manage other view controllers instead of managing views The 2navigation view controllers and the split view controller at the start of the story-board’s flow are examples of container view controllers A mock-up of the storyboard is provided in Figure 3.19 The actual storyboard is not shown since thewords and subviews are too small for the various view controllers or the screens to
be identified
Trang 29Server Apache Web Server
Patient Application
Server Communication Module
Bluetooth Communication Module
Bluetooth Communication Module
Sensor Node
Gyroscope ITG3200
Accelerometer &
Magnetometer LSM303DLH
ATMEGA328
Bluetooth Low-energy Module
I²C I²C
Serial Port
Trang 30Split View Controller
Navigation Controller
Custom Navigation Controller
Compliance Form Master TVC
TVC
Activities Selection TVC
Adverse Events Web VC
Compliance Form Detail Main VC
Compliance Form Detail Weeks VC
Heart Rate Blood Pressure TVC
Integrated Graph VC
Integrated Video VC
Exercises Weeks Years Graph Navigator VC
Exercises Years Weeks Days Video Navigator VC
Call Notes History TVC
Call Note Editor VC
Activity Remarks Editor VC Form Options VC
used by used by
used by
used by
used by
Trang 31Friendly name Name of View Controller Description
Login screen LoginViewController The initial screen that allows the therapist to log into
the system
Patient selection screen PatientSearchTableView Controller This screen contains a list of patients assigned to a
ther-apist Contains links to the forms and allows FaceTimecalls to patients
Activities Selection Screen ActivitiesTableView Controller This screen allows assignment of exercises to a selected
patient and adjustment of exercise parameters
Scroll Infrastructure for
Graphs
IntegratedGraphView Controller This screen allows scrolling across graphs to navigate
to subsequent exercises or weeks Left/right scroll fornext/previous exercise and top/bottom scroll for previ-ous/next week of activity
Scroll Infrastructure for
Videos
IntegratedVideoView Controller This screen shows a video of the patient performing an
assigned exercise and allows scrolling to navigate to thevideos of subsequent exercises or weeks Left/right scrollfor next/previous exercise and top/bottom scroll for pre-vious/next week of activity
Pop-up screen to navigate
between graphs
ExercisesWeeksYearsGraphNavigatorViewController
This pop-up screen contains 2 lists: A list of exercisesand a list of weeks organised by year numbers The userfirst selects the exercise to navigate to and then selectsthe week to navigate to within that exercise
Pop-up screen to navigate
between videos
ExercisesYearsWeeksDaysVideoNavigatorViewController
This pop-up screen contains 3 lists: A list of exercises,
a list of weeks organised by year numbers, and a list
of days and video times, organised by days within aselected week This screen allows the user to navigate
to another video by selecting an exercise, week and thenthe time of the exercise session to watch
Table 3.1: List of screens with the name of the ViewController object managing the screen and description
Trang 32Friendly name Name of View Controller Description
Pop-up remarks editor for
an activity’s prescription
ActivityRemarksEditorVC This pop-up screen is used within the activities
selec-tion screen to allow therapists to enter remarks linked
to particular exercise prescriptions
Form selection screen FormOptionsViewController This pop-up screen is used within the patient selection
screen to allow therapists to select a form to fill-up Theoptions are HR/BP form, compliance form, call notesand adverse events form
Heart rate/Blood Pressure
form screen
HR˙BPTableViewController This screen is used to fill the systolic, diastolic blood
pressure of the patient, together with the hear rate Italso shows the history of HR/BP records for the patient.Compliance Form Naviga-
tor table
ComplianceFormMasterTableViewController
This screen is the one on the left side of the complianceform screen It allows the user to navigate between themain page and the various weeks of compliance forms.Compliance Form Main
Page
ComplianceFormDetailMainViewController
This screen is the one on the right side of the complianceform screen, when the form is first opened It states thedetails of the selected patient, such as the trial number,initials, start date and date of 3rd month assessment.Compliance Form Week
Page
ComplianceFormDetailWeeksViewController
This screen is the one on the right side of the complianceform screen when a particular week number is chosenfrom the left navigation pane It allows the therapist
to fill in the number of minutes spent in therapy with
a therapist and the number of minutes spent doing anyprescribed rehabilitation exercises for everyday of thechosen week within the 13-week period of the study.Call Notes List Screen CallNotesHistoryTableViewController This pop-up screen is shown when ‘Call Notes’ is se-
lected from the form options screen It presents a list ofall the call notes for a particular patient (regardless ofwhich therapists entered it), with the timing and snip-pets of the notes
Trang 33Friendly name Name of View Controller Description
Call Note Editor Screen CallNoteEditorViewController This pop-up screen is shown in patients selection screen
when the user needs to add or edit a particular note Itcontains a text field for editing the call note
Adverse Events Form
Screen
AdverseEventsWebViewController This screen loads and shows a web-based form that is to
be filled up in case of an adverse event
Custom Navigation
Con-troller
CustomUINavigationControllerViewController
This is an inheritance of a standard troller The customisation is to catch and handle theevent of the user pressing the back button to go back to
UINavigationCon-a previous screen A common use is to check if the userhas saved the changes made in screens such as the activ-ity selection screen, before navigating back to a previouspage
Custom Split View
Con-troller
splitViewController This is an inheritance of a standard
UISplitViewCon-troller This serves as the root view controller of theentire application, for the purpose of using it for thecompliance form The master side of this split viewcontroller is hidden for the rest of the screens Thiscustomisation is to store a reference of this root viewcontroller at the appDelegate class for accessing it later
on, at runtime
Trang 34Figure 3.3: Screenshot of Login screen
The login screen as shown in Figure 3.3 asks for the username and password ofthe therapist in order to login into the application It is managed by the Login-ViewController class.This is the first screen that is presented upon launching thetherapist application A typical workflow would involve the therapist using the 2text fields to enter the username and password before pressing the ‘Log In’ button.When the user is in the username field, the ‘Return’ key on the keyboard has beenconfigured to show ‘Next’ to go on to the password field When the user is in thepassword field, the ‘Return’ key has been configured to show ‘Go’ and has the samee↵ect as the ‘Log In’ button The button, textfields and the application icon havebeen positioned on the screen such that they are not hidden when the keyboard
is activated The keyboard is automatically activated when the screen is initiallyshown, for the user’s convenience
Additionally, this screen also shows error messages for reachability and login
Trang 35Figure 3.4: Screenshot of Patient Selection screenissues If the invalid credentials are used to log-into the application, the user is no-tified of this through the message ‘Therapist name and/or Password invalid Pleasetry again’ The transition to the patient selection screen occurs if the credentialsare verified to be valid.
There are also some additional but hidden features on this screen, for developers.Single one-finger tap on the application icon displays the version number of theapplication and indicates if it is a developer or production version Single two-finger tap on the application icon displays the device and the advertiser identifiers
A subsequent single one-finger or two-finger tap on the application icon hides thetext label that the corresponding initial tap brought up
The patient selection screen, as shown in Figure 3.4 shows a list of patientsunder the therapist who has logged into the application It is managed by the
Trang 36Figure 3.5: Screenshot of Patient Selection screen with call notes and formsPatientSearchTableViewController class This is the first screen that is presentedupon logging into the therapist application For each patient, the table shows theparalysed side, how many weeks ago the latest activity was performed and thecurrent week number of the patient in the study This is also the screen where thetherapist can access the various forms (HR/BP Form, Compliance Form, Call Notesand Adverse Events Form) for each patient The therapist can place a FaceTimecall to a patient by tapping the FaceTime icon on this screen.
A example workflow at this screen would involve the therapist inspecting whenthe latest activity was performed by patients and then tapping on a patient’s row
to go on to the activities selection screen and check if there are any new graphs
to look at A search feature is available in case of a long patient list This searchupdates the list at every addition or deletion of character from the search text field.The study protocol requires the tele-therapists to set an appointment for Face-Time call with the patient in advance Tapping on the FaceTime icon for a patient
Trang 37pushes the therapist application to the background while FaceTime Application isfired up A call is then automatically made to the patient If the initial call isunsuccessful, the therapist can either come back to the Therapist Application toplace another call or stay within the FaceTime application and using the patient’scontact from the address book view on the right Every time the therapist returns
to the app after having pressed the FaceTime icon, an alert pops up to ask if the callwas successful The alert is dismissed in cases of unsuccessful calls If the therapistreplies that the call is in progress, the alert is dismissed to show a list of forms(Form Selection Screen) that the therapist may want to fill up during the call Ifthe therapist indicates that the FaceTime call is over, a new note editor windowpops up to allow the therapist to fill up notes from her recent call
From a developer’s perspective, an example workflow would start with the pearance of a progress indicator to indicate the progress of loading the basic patientinformation from the server This is followed by the sending of a request to the server
ap-to get the basic patient information When the server’s reply has been received, thetable is reloaded with the new data
Every time the text within the search bar’s text field is changed, a new request
is sent to the server to obtain an updated reply to refresh the table with Whenthe FaceTime icon is tapped, a record is made in an sqlite database within theapplication to indicate the time of button press, together with the ID of the therapistwho pressed it and patient that the call was intended for A request is then made
to the server to get the patient’s FaceTime address The FaceTime call is placedonce a valid reply is received from the server
When returning to the application, the internal sqlite database is checked forany unfinished FaceTime calls For each of these unfinished calls, an alert is shown
to check the status of the call with the therapist The reply of the therapist isprocessed as described above The call is marked as settled if the therapist informsthat the call was unsuccessful If the call was successful, the therapist is prompted