scieee AI-readable full text Open interactive document viewer

Automatic Performance Status Evaluation and Physical Activity Recognition in Cancer Patients for Medical Diagnosis Assistance

Moreno Gutiérrez, Salvador

Abstract

Sobresaliente (10)

Full text

Trabajo de Fin de Grado Grado en Ingenier ´ ıa Electr´ onica Industrial Automatic Performance Status Evaluation and Physical Activity Recognition in Cancer Patients for Medical Diagnosis Assistance Autor Salvador Moreno Guti´errez Directores Miguel Damas Hermoso H´ector Pomares Cintas Departamento Arquitectura y Tecnolog´ıa de Computadores Granada, 28 de junio de 2016 Automatic Performance Status Evaluation. S. Moreno Guti´errez Automatic Performance Status Evaluation and Physical Activity Recognition in Cancer Patients for Medical Diagnosis Assistance Salvador Moreno Guti´errez [email protected] Resumen. La evaluaci´on de la recuperaci´on de pacientes con c´ancer est´a caracterizada por un alto grado de subjetividad en los diagn´osticos del personal m´edico. Se han implementado con ´exito diferentes sistemas para la evaluaci´on de la actividad f´ısica, sin embargo, a´un existe un amplio margen de evoluci´on dentro de la medida de la capacidad funcional con las escalas ECOG y de Karnofsky. En este proyecto se ha dise˜nado un sistema autom´atico para la biomonitorizaci´on de pacientes basado en tecnolog´ıa Android con smartphones y wearables. Con esto se provee a los onc´ologos de datos objetivos para sus diagn´osticos junto con nuevos algoritmos para la evaluaci´on de la actividad f´ısica y la capacidad funcional, estos ´ultimos aplicados a ECOG y la escala de Karnofsky sin precedente alguno. Adem´as, se han sentado las bases y el dise˜no de una futura implementaci´on de gamificaci´on para favorecer la motivaci´on del paciente en su recuperaci´on. Palabras calve. mHealth, eHealth, actividad f´ısica, capacidad funcional, recuperaci´on en el c´ancer, Android, wearables, smartwatch, Internet de las Cosas, gamificaci´on, ludificaci´on. Abstract. The evaluation of cancer patients’ recovery is still under a big grade of subjectivity from the physicians’ diagnoses. Different systems have been successfully implemented for general physical activity evaluation, nonetheless there is still a big leap of improvement into Performance Status (PS) evaluation with ECOG and Karnofsky’s Performance Status (KPS) scores. In this project an automatic system for patients’ biomonitoring based on Android technology with smartphones and wearables has been designed. As a result, objective data is provided for the oncologists’ diagnoses along with new algorithms for physical activity and PS assessment, having the latter applied to ECOG and KPS no precedent known. Furthermore, the basics for prospective implementation of gamification has been designed for boosting patients’ motivation in their recovery. Keywords. mHealth, eHealth, physical activity, performance status, cancer recovery, Android, wearables, smartwatch, Internet of Things, gamification. 1 UNIVERSIDAD DE GRANADA INGENIERIA ELECTRÓNICA INDUSTRIAL AUTORIZACIÓN DE LECTURA DE TRABAJO FIN DE CARRERA D. Héctor Pomares Cintas y D. Miguel Damas Hermoso, profesores del Departamento de Arquitectura y Tecnología de Computadores de la Universidad de Granada, como director/es del Trabajo Fin de Grado titulado “Automatic Performance Status Evaluation and Physical Activity Recognition in Cancer Patients for Medical Diagnosis Assistance” y realizado por el alumno D. Salvador Moreno Gutiérrez. CERTIFICA/N: que el citado Trabajo Fin de Grado, ha sido realizado y redactado por dicho alumno y autorizan su presentación. Granada, Fdo. Héctor Pomares Cintas Fdo. Miguel Damas Hermoso UNIVERSIDAD DE GRANADA INGENIERIA ELECTRÓNICA INDUSTRIAL AUTORIZACIÓN DE DEPÓSITO EN EL DEPARTAMENTO DE ARQUITECTURA Y TECNOLOGÍA DE COMPUTADORES. Yo, D/Dña. Salvador Moreno Gutiérrez con DNI 75934301P, autor del Trabajo Fin de Grado titulado “Automatic Performance Status Evaluation and Physical Activity Recognition in Cancer Patients for Medical Diagnosis Assistance” realizado en la Universidad de Granada AUTORIZO: al depósito de dicho Trabajo en la Secretaría del Departamento de Arquitectura y Tecnología de Computadores, y a su visualización bajo firma de documento de confidencialidad Granada, Fdo. D/Dña. Salvador Moreno Gutiérrez. Preface When I decided to start this project as my End-of-Degree Thesis, I was not aware of the actual amount of work, problems and time investment I was going to deal with. I have had to tackle with several disciplines from very different areas of study such as cancer patients’ assessment, physical activity evaluation, gamification, computer programming, data processing and database management. This has lead me to me to learn many new and specific concepts from all of those subjects that will be introduced along the document presented. However, I would like to highlight the love and effort put into this work. Gathering all the presented elements into one solid functional system is just the beginning of a new way to assess cancer patient’s diagnosis. The fascinating thing is that this work does not end here, it opens several new areas of study and application on which I intend to keep working on in the near future. I hope you reader like this work as much as I did making it. Salvador Moreno Guti´errez. 4 Acknowledgements I would like to thank everybody that has supported me along this project: to Miguel Damas and Hector Pomares for encouraging me to make this project under their great direction; to Oresti Ba˜nos and Jose A. Moral-Mu˜noz for their valuable advices; to Carlos Bail´on for all the great co-working trajectory we have shared; to my aunt and psychologist Pilar Guti´errez and the oncologist V´ıctor Amezcua for their opinions and advises on the different perspectives of the project; and finally, to my sister Maria Victoria who succeeded in her recovery before I ended this work. 5 Contents List of Figures 7 List of Tables 8 1 Introduction 9 1.1 Motivation ....................................... 9 1.2 Objectives........................................ 10 1.3 Document’sStructure ................................. 10 Bibliography ......................................... 11 2 State of the Art 14 2.1 Cancer Patients’ Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.1.1 Performance Status Evaluation . . . . . . . . . . . . . . . . . . . . . . . . 14 2.1.2 PhysicalActivity................................ 16 2.1.3 Physical Activity Intensity Estimation using daily Step Count . . . . . . . 18 2.2 mHealth within the IoT context. . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.3 Gamification ...................................... 20 2.3.1 GameElements................................. 21 Bibliography ......................................... 23 3 System Design & Tools 30 3.1 RequirementsandNeeds................................ 30 3.1.1 Requirements.................................. 30 3.1.2 User’s Description and Role . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.2 Hardware ........................................ 30 3.2.1 MobileDevices................................. 31 3.2.2 Wearables.................................... 32 3.3 Software......................................... 36 3.3.1 Development Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.3.2 Object-Oriented Programming . . . . . . . . . . . . . . . . . . . . . . . . 36 3.3.3 GoogleFitAPI................................. 38 3.3.4 DataSources and DataTypes . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.3.5 AndroidThreading............................... 40 3.3.6 DatabaseStorage................................ 42 6 Automatic Performance Status Evaluation. S. Moreno Guti´errez 3.4 Gamification. Considerations for Design . . . . . . . . . . . . . . . . . . . . . . . 42 3.4.1 Cancer patients’ psychology . . . . . . . . . . . . . . . . . . . . . . . . . . 42 3.4.2 Gamification Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 3.4.3 TargetBehaviours ............................... 43 3.4.4 PlayersDescription............................... 43 3.4.5 ActivityLoops ................................. 44 3.5 Summary & System Design Overview . . . . . . . . . . . . . . . . . . . . . . . . 46 Bibliography ......................................... 48 4 System Implementation and Results 51 4.1 Patient’sApp...................................... 51 4.1.1 DataRecorded ................................. 51 4.1.2 Authentication & Authorization system . . . . . . . . . . . . . . . . . . . 52 4.1.3 OncoRecord................................... 53 4.1.4 OncoHealth................................... 57 4.2 Data Gathering and Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 4.2.1 IPAQInferring ................................. 65 4.2.2 ECOG and KPS Inferring . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 4.2.3 Algorithm Flowcharts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 4.3 Summary ........................................ 72 Bibliography ......................................... 73 5 Conclusions and Future Work 75 5.1 Conclusions....................................... 75 5.2 FutureWork ...................................... 76 Appendix 77 User’sManual:Patient ................................... 77 IPAQ ............................................. 84 Short IPAQ, English Version - USA . . . . . . . . . . . . . . . . . . . . . . . . . 84 Short IPAQ, Spanish Version - Spain, Junta de Andalucia . . . . . . . . . . . . . 88 GoogleFit’sDataTypes ................................... 91 7 List of Figures 2.1 IoT Web Interest. Source Google Trends [45] . . . . . . . . . . . . . . . . . . . . 19 2.2 PPG embedded in a smartwatch. [51] . . . . . . . . . . . . . . . . . . . . . . . . 20 2.3 Gamification Web Interest. Source Google Trends [45] . . . . . . . . . . . . . . . 21 2.4 Game Elements. Adaptation from For the Win, Werbach K. [57] ......... 22 3.1 Smartphone sales value worldwide from 2013 to 2016 (in billion U.S. dollars), by region.Datasource:[2] ................................ 31 3.2 Smartphone OS Market Share. Data source: [3] . . . . . . . . . . . . . . . . . . 32 3.3 Sony SmartBand 2 (SWR12) (a) front and (b) back. . . . . . . . . . . . . . . . . 35 3.4 Google Fit on Android. Source: [28]. . . . . . . . . . . . . . . . . . . . . . . . . 39 3.5 (a) Engagement and (b) Progression loops. Adapted from [39] . . . . . . . . . . . 45 3.6 Quest list in an Android ScrollView design . . . . . . . . . . . . . . . . . . . . . . 46 3.7 General Schema of the complete System proposed . . . . . . . . . . . . . . . . . . 47 4.1 Data Structure and utilization in IPAQ, ECOG and KPS algorithms. . . . . . . . 52 4.2 Google Developer Console OAuth 2.0 Certificate Request. . . . . . . . . . . . . . 53 4.3 Permissions and Dependencies declared in OncoRecord. . . . . . . . . . . . . . . 54 4.4 Recording API implementation in OncoRecord’s main activity. . . . . . . . . . . 55 4.5 Figures of (a) OncoRecord asking for Google Fit Data access permission and (b) OncoRecord activating subscriptions successfully. . . . . . . . . . . . . . . . . . . 58 4.6 OncoHealth main activity flowchart. . . . . . . . . . . . . . . . . . . . . . . . . . 59 4.7 One-hour-query execution time in OncoHealth. . . . . . . . . . . . . . . . . . . . 62 4.8 SmartBand’s Database View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 4.9 Figures of OncoHealth patient’s sign up form in a ScrollView (a) top and (b) bottom.......................................... 64 4.10 Figures of OncoHealth query for 1 hour, (a) connection and (b) end. . . . . . . . 64 4.11 Daily detection for 18 days long database. . . . . . . . . . . . . . . . . . . . . . . 65 4.12 METs calculation comparison between Google estimation and IPAQ algorithm (a) with all the data and (b) without outliers. . . . . . . . . . . . . . . . . . . . . 67 4.13 Strict Light Activity Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 4.14 Daily proportion of user’s Active Time . . . . . . . . . . . . . . . . . . . . . . . . 70 4.15 ECOG performance along two weeks with IPAQ = 1 . . . . . . . . . . . . . . . . 71 4.16 KPS performance along two weeks with IPAQ = 1 . . . . . . . . . . . . . . . . . 71 4.17 Frequency adaptation algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 8 Automatic Performance Status Evaluation. S. Moreno Guti´errez [22] IPAQ scoring protocol - International Physical Activity Questionnaire. https://sites. google.com/site/theipaq/scoring-protocol. Online; accessed 2016-04-25. [23] The Worldwide Wearables Market Leaps 126.9% in the Fourth Quarter and 171.6% in 2015, According to IDC. http://www.idc.com/getdoc.jsp?containerId=prUS41037416. Online; accessed 2016-03-13. [24] Sasan Adibi, editor. Mobile Health, volume 5 of Springer Series in Bio-/Neuroinformatics. Springer International Publishing, Cham, 2015. [25] E. Jovanov. Preliminary analysis of the use of smartwatches for longitudinal health monitoring. In 2015 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), pages 865–868, 2015. [26] Michael R. Neuman and Edward Sazonov. Application of Optical Heart Rate Monitoring. In Wearable Sensors. Academic Press, August 2014. [27] Catrine Tudor-Locke. Taking Steps toward Increased Physical Activity: Using Pedometers To Measure and Motivate. President’s Council on Physical Fitness and Sports Research Digest, 2002. 15 Chapter 2 State of the Art 2.1 Cancer Patients’ Recovery Cancer patients face many challenges during their process of recovery, both in a physical [1, 2] and a mental way [3, 4]. This recovery implies, most of the times, an aggressive treatment with chemotherapy and radiotherapy that leads the patient to a state of asthenia and general physical weakness with several side effects. Performance Status (PS) scales emerge as the solution for cancer patients assessment, pointing out whether an individual is able to receive a session of chemotherapy or radiotherapy, or not. These PS scales are also an indicator of the survival probability, specially when analyzed along the whole period of treatment [5, 6, 7, 8]. 2.1.1 Performance Status Evaluation There are several more Performance Status Scales such as the KPS and ECOG already mentioned. Some of them are the Lansky score [9] for children, the Palliative Performance Scale [10], which focus on palliative care to propose a solution for those patients in the last stages of irreversible cancer, the Edmonton Functional Assessment Tool [11] for terminal patients, or the Katz Index [12] and the Barthel Index [13], both for geriatric patients. In this project the approach for PS estimation is tackled from the perspective of the ECOG and KPS scores. Both scales were the first proposals to PS evaluation (each one with its own range) in cancer patients and they are still widely used across the world. Besides, since the rest of indexes are adaptations and modifications of KPS and ECOG for specific solutions, it seems reasonable to start the approach of automatic PS estimation with KPS and ECOG. It is important to highlight that no paper related to automatic PS evaluation was found throughout the extent review done within the search engines of Scopus and Web Of Science. Karnofsky’s Performance Status Karnofsky’s Performance Status (KPS) is a measure developed by Karnofsky and Burchenal in 1949 to evaluate cancer patients’ condition and planning their treatment [1]. The KPS classification goes from 0 (worst case, death) to 100 (best case, asymptomatic) and it is depicted in Table 2.1. 16 Automatic Performance Status Evaluation. S. Moreno Guti´errez The most important gap in the KPS is the one between 50 and 60. It matches the gap between 2 and 3 ECOG (see ECOG/WHO/Zubrod Performance Status, page 15) which determines if a patient is able to receive a session of chemotherapy for treatment [6]. Scoring 60 KPS implies “ocassional assistance but able to care for most of personal needs”, that is, a symptomatic patient but still strong enough to live mostly by his/her own. On the other hand, scoring below that level comes always with “considerable assistance and frequent medical care”, in a higher (10 KPS) or lower (50 KPS) degree depending on the impact of the symptoms. Several studies have validated its reliability for PS and survival prediction [5, 14, 8]. Besides, there is no denial of the big impact of the scale in its field, even serving as the basis for other measures like the Palliative Performance Scale. However, some studies have pointed out critics that may have an impact on this reliability [15, 16, 17]. Those critics can be summed up in three points: 1. The gap between the different levels in the scale does not match in the same proportion to the functional disability reflected. This means that there is not the same difference in functional disability in the gap between levels 70 and 60 than the one between 40 and 30. 2. The higher the level in the scale, the lower the reliability. This project also looks forward to improve reliability in that major categories which doctors fail to evaluate due to the lack of proper data and monitoring. 3. Results may vary depending on the observer and its medical role (doctor, nurse), and the place of evaluation (place of residence, consulting room, hospital). It has also been reported a noticeable difference between the PS evaluated by the physician and the patient’s self-evaluated PS in which medical personnel tend to assign patients better PS than they may feel [8]. However, it can be highlighted that the KPS scores a good Kendall’s correlation coefficient 0.65 when comparing doctor’s evaluation and patient’s own evaluation with this score [18]. ECOG/WHO/Zubrod Performance Status Score developed by the Eastern Cooperative Oncology Group (ECOG) with the same PS evaluation purposes as KPS [2]. The ECOG scale goes from 5 (worst case, death) to 0 (best case, asymptomatic) and it is depicted in Table 2.2. The most important gap in the ECOG scale is the one between 3 and 2. It determines whether the patient is capable of receiving a session of chemotherapy (ECOG 2 or lower) or not (ECOG 3 or higher). Scoring 2 implies being ’Symptomatic, less than 50% of waking hours in bed, and capable of self care but unable to carry out any work activities’, whilst 3 is for ’Symptomatic, more than 50% of waking hours in bed, and limited self-care’. The reliability and validity of this scale has been studied by different authors obtaining very good results for PS as an evaluation and survival probability estimation tool [19, 18, 8, 7]. It can be highlighted that the ECOG scores a good Kendall’s correlation coefficient 0.59 when comparing doctor’s evaluation and patient’s own evaluation with this score [18]. 17 Automatic Performance Status Evaluation. S. Moreno Guti´errez Table 2.1: Karnofsky’s Performance Status Score Moreover, when comparing ECOG and KPS Spearman’s correlation coefficient 0.85 (p < 0.0001) was scored in [8] and 0.87 (p <0.0001) in [6]. The latter work proposes a three-grades conversion table where ECOG 0 and 1 matches 100, 90 and 80 KPS; ECOG 2 matches 70 and 60 KPS; ECOG 3 and 4 matches KPS <60. 2.1.2 Physical Activity The relevance of Physical Activity (PA) in health is not only for those who do not suffer any condition, some studies have outlined the benefits of regular exercise in cancer patients along treatment and after recovery [20, 21, 22, 23]. PA may have a direct and beneficial impact on Heart Rate Variability (HRV) which is directly related to the activation of the sympathetic and parasympathetic nervous activity, hence the regulation of the autonomous nervous system (ANS) [24, 25]. The ANS controls, among other Table 2.2: ECOG/WHO/Zubrod Performance Status score 18 Automatic Performance Status Evaluation. S. Moreno Guti´errez things, acute physiological responses to psychophysical stress, but its adequate performance can be undermined by any chronic condition like cancer [26]. Thus, a better performance of the ANS comes with a general improvement of body self-recovery. Metabolic Equivalent of Task (MET) The most direct way to evaluate a PA is by comparing the calorie expenditure of each activity for every patient. However, this value depends deeply on different personal conditions such as weight, height, age and gender. Thus, it is preferably used a normalized measure that takes into account all those variables, the Metabolic Equivalent of Task (MET) [27]. MET was defined in the Compendium of Physical Activities for use in epidemiologic studies to standardize the assignment of MET intensities in PA questionnaires. It is a physiological measure that express the energy cost of physical activities and is defined as the ratio of metabolic rate during a specific PA. It is set by convention: 1MET = 3,5ml O2 kg ·min = 1 kcal kg ·h= 4.184 kJ kg ·h In the beginning, 1 MET was considered as the Resting Metabolic Rate (RMR) obtained while quiet sitting. It should not be confused or misused as an approximation of the Basal Metabolic Rate (BMR), which is the minimum amount of energy expended under a physically and psychologically undisturbed state, in a thermally neutral environment (25 - 30 oC) and not actively digesting food [28]. BMR can be also referred as the minimal amount of energy necessary just to be alive. International Physical Activity Questionnaire (IPAQ) The IPAQ is a self-reported questionnaire for assessing PA and has been tested in 12 countries among adults aged 18 to 65 years [29]. It is normally obtained by making the subject fill up the questionnaire given with PA data (walking time, running time and so on) referred to the previous week. However, it seems reasonable to assume the difficulties that any person may have when remembering exactly how many minutes he/she walked, ran or lifted heavy loads. It is hard to count all the PA unless the subject has a very scheduled agenda; there are many situations in life that are usually taken out from the daily PA like walking from place to place. The detection of this kind of activity is tackled along the system proposed. It has been validated in different studies with very different groups of people: elderly adults [30], Chinese people [31], Europe in general [32] or Swiss people [33]; resulting in a widely accepted validity [34]. All of these studies used raw accelerometer signals to measure steps count in a day and their cadence, classifying the intensity of the PA detected depending on the step levels registered. There are two versions of the IPAQ, short and long. In this thesis the focus is presented over the short IPAQ since it is already being used in Spanish hospitals, more precisely, in all the Andalusian ones. There is a copy of the Spanish official version in the Appendix (see Short IPAQ, Spanish Version - Spain, Junta de Andalucia, page 88) and a copy of the original USA English version (see Short IPAQ, English Version - USA, page 84). 19 Automatic Performance Status Evaluation. S. Moreno Guti´errez The IPAQ protocol evaluates the Energy Consumption (EC) using this formula: EC =f·minutesperweek (MET) where f={3.3,4,8}depending on the levels of PA defined, respectively, light,moderate and vigorous. Physical Activity Intensity Estimation using Heart Rate In order to evaluate the intensity of the PA, it is studied the effect of different levels of exercise in the patient’s HR [35]. The different levels are the following: •Low-intensity PA: for HR between 0% and 50% of maximum HR. •Moderate-intensity PA: for HR between 50% and 70% of maximum HR. •Vigorous-intensity PA: for HR between 70% and 100% of maximum HR. There are different ways to calculate HR intensity, like the Zoladz and the Karvonen methods. In this work the latter is chosen since it is entirely a quantitative measure [36]. The Heart Rate Intensity (HRI) it is obtained by Karvonen formula as: HRI =HR −HRrest HRmax −HRrest ·100 [%] To calculate this HRI, it is necessary to define the minimum and the maximum HR. The minimum is HRrest, the Resting Heart Rate (RHR). The RHR is the Heart Rate under minimun Physical Activity levels, is defined as the heart rate when a person is awake and within a neutrally temperate environment. The subject cannot have been altered by any recent exertion or stimulation like stress or surprise [37]. For this project, a RHR of 62 bpm has been considered after HR a study involving sleep traking through several days and taking the mean of HR when recently awaken. There are several Maximum Heart Rate (MHR) estimation formulas, up to 53 different proposals from authors like Astrand, Fernandez, Jones et al., Karvonen et al., or Tanaka et al. [38]. Even though there is still controversy about the validity of this formulas and its application, in this work the Tanaka et al. (2001) version is to be used due to its good performance with young athletes [38, 39]. MHR = 208.75 −0.73 ·age It is important to note that for this work, the intention is to look for patients’ tendencies above all, so a relative inaccuracy in HRI evaluation depending on the formula used, in the end, will not conduct the measures to flagrant error. 2.1.3 Physical Activity Intensity Estimation using daily Step Count There is a common agreement regarding to the recommendation of 10 000 steps/day for most of the population [40, 41, 42]. Its validity has been demonstrated in the same papers, even 20 Automatic Performance Status Evaluation. S. Moreno Guti´errez including different ranges of steps for different sectors of society. However, it is necessary to define different levels to evaluate the effort done in exercise referring to steps done. Therefore, and looking into the work done in [42], different grades can be defined for most of the population: •Sedentary: <5000 steps/day. •Low active: 5000 −7499 steps/day. •Somewhat active: 7500 −9999 steps/day. •Active: 10000 −12499 steps/day. •Highly active: >12500 steps/day. For this work, this scale would be used for evaluating the effort of patients in the ECOG and KPS inferring. 2.2 mHealth within the IoT context. mHealth is the integration of medicine and public health practices into portable devices such as mobile phones, tablet computers or wearables. It emerges from the electronic health (eHealth) sector, always within the context of Information and Communication Technology (ICT), but primarily focusing in the use of the cutting edge technologies that enable data monitoring through a Body Sensor Network (BSN) or a Personal Area Network (PAN). With this new kind of implementations, grown up in the cradle of the IoT, the picture of medicine goes beyond its traditional concept where the patient needs to personally attend to the hospital in order to be checked. Nowadays, this biomonitoring enables a higher relevance of prevention instead of treatment what is becoming the quintessence of modern medical care [43]. Looking at Figure 2.1 it can be seen how the IoT is already in the Peak of Inflated Expectations, according to the Gartner Hype Cycle Curve [44]. Thus, early procedures and implementations as the one proposed in this report characterize this moment for IoT. There is still long way to go in the areas related to mHealth and the IoT in general, that is an ideal sector to take advantage of in both commercial and research levels. A wide range of new wearable and different sensors are being used not only in research but also in the regular market. Photoplethysmography (PPG) is becoming the new standard for different measures such as heart rate monitoring and blood pressure. This technology is based on the optical obtention of a plethysmogram, that is, the volumetric changes of an organ. A pulse oximeter illuminates the skin and measures changes in light absorption to finally, monitor the perfusion of blood to the dermis and subcutaneous tissue of the skin [46]. Different wavelengths like infra-red, red and green have been implemented in the same device to improve performance [47]. Machine learning techniques are also being used to infer blood glucose levels from blood pressure [48]. Most of the devices in the wide spectrum of fitness trackers contain PPG embedded (Figure 2.2). It will be further analysed in section Hardware (page 30). Other technologies are being studied for wearable HR tracking such as using an in-ear piezoelectric sensor [49] and graphene-clad textile electrodes for direct attachment in clothes [50]. 21 Automatic Performance Status Evaluation. S. Moreno Guti´errez Figure 2.1: IoT Web Interest. Source Google Trends [45] Many different projects have been found in the literature dealing with the issue of mHealth. For example, the use of pedometers for physical activity measurement through steps count [41]; the study of robust activity recognition based on multi-sensor fusion, considering non-ideal conditions [52]; or the use of a fully integrated wearable sensor array for sweat perspiration analysis [53]. Even full system approaches to general mHealth open frameworks have been developed [54]. The value of smartwatches and wristbands has also been studied in different papers referring to its validity for long-term HR monitoring [55] and for posture tracking [56], concluding both with good results. All this sums up the good state of the mHealth and IoT field, where many different proposals are rising from the very same concept of taking modern medicine a step ahead with wearables and mobile devices. Figure 2.2: PPG embedded in a smartwatch. [51] 22 Automatic Performance Status Evaluation. S. Moreno Guti´errez 2.3 Gamification Gamification is the inclusion of game-design elements and principles into non-game contexts [57, 58]. As it can be seen in Figure 2.3, the interest in Gamification may be already entering into the Trough of Disillusionment according to the Gartner Hype Cycle Curve [44]. That means that it is a good moment to start evaluating the different proposals along the literature to find out which are the key elements for successful implementation of gamification and how to introduce them properly into this work. Figure 2.3: Gamification Web Interest. Source Google Trends [45] 2.3.1 Game Elements There are several definitions depending on the author. According to Kevin Werbach [57] (Figure 2.4), the basic game-design elements are: •Components. The most specific items in every game or gamified system: achievements, badges, points, leaderboards, levels, teams, etc. •Mechanics. These are the rules that engage all the different components into one system, the basic relations among them. •Dynamics. It is the result of putting mechanics to use. A flow is created between the different interactions resulting in positive or negative effects, like winning or losing. Hunicke et al. consider that Aesthetics is another extra step in the top of the pyramid as the “desirable emotional responses evoked in the player, when he/she interacts with the game system” [59]. Another example is the definition found in the Enterprise Gamification Consultancy [60]. It parts from the Werbach’s definition and adds to it the several items in a very formal description detailed in the following points: 23 Automatic Performance Status Evaluation. S. Moreno Guti´errez Figure 2.4: Game Elements. Adaptation from For the Win, Werbach K. [57] 1. Components & Mechanics. 2. Dynamics. 3. Feedback. It consists of a return of information to the player caused by his actions, a response of the system to interaction. This can be reflected from simple points to badges, leaderboards, levels, achievements, etc. 4. Psychology. It is important to know the target player’s condition in order to adapt the gamified experience to his response ability. 5. Interface. From a simple chess table-top to a complex Android app. 6. Aesthetics. The art, colours, materials, design. Almost everything susceptible to personal taste. 7. Justification/Meaning. The purpose of the game elements beyond Fun, like telling a story; focus on a personal or an online experience; emulate real life (The Sims); or even informing about an issue of major concern, known as serious games (serious games, [61]) - the effects of drugs, the big impact of media in the world, planned obsolescence, etc. 8. Rules. Directly applicable to the player. 9. Game characteristics. They may appear either in Layering contexts (games in another games) or impact they may have such as becoming viral due to social impact. 10. Player’s Motivation. There are two main kinds of motivation, intrinsic and extrinsic motivation. The first one comes from personal desires, strong believes or just great determination, whilst the latter comes out from outside rewards, such as points, achievements or even money. Fun is also another motivator that can be triggered from very different approaches like role playing, mastery and learning, social interaction or customization. Very different gamification implementations have been found in the literature for several groups of people with good results. An extent review of different gamified apps for health related contexts and its results can be found in the paper of Pereira et al., A review of Gamification 24 Automatic Performance Status Evaluation. S. Moreno Guti´errez [67] Monique Tabak Frederiek de Vette. Engaging Elderly People in Telemedicine Through Gamification. Journal of Medical Internet Research, Serious Games(2), 2015. [68] David C Mohr, Stephen M Schueller, Enid Montague, Michelle Nicole Burns, and Parisa Rashidi. The Behavioral Intervention Technology Model: An Integrated Conceptual and Technological Framework for eHealth and mHealth Interventions. Journal of Medical Internet Research, 16(6):e146, June 2014. [69] Antonio Maturo and Francesca Setiffi. The gamification of risk: how health apps foster self-confidence and why this is not enough. Health, Risk & Society, 0(0):1–18, 2016. [70] Coursera - Gamification Course by Kevin Werbach Certificate. https://www.coursera. org/account/accomplishments/certificate/HF7WNCE2Y63E. Online; accessed 2016-06- 29. 31 Chapter 3 System Design & Tools In this chapter the project’s requirements are set and all the tools needed, both hardware and software, are chosen from the discussion on the different options available. 3.1 Requirements and Needs 3.1.1 Requirements A prototype for the system proposed (see Objectives, page 10) shall cover the following requirements: •Select an activity tracker with, at least, one day long battery duration, HR monitoring, sleep tracking and pedometer. Connectivity must be available for data storage. •A data gathering device for parameter analysis like a smartphone. •Development of automatic algorithms for IPAQ, ECOG and KPS inferring. 3.1.2 User’s Description and Role Two main types of users are going to interact with the system, the patients and the doctors. For the patient, an user-friendly interface with the minimal information display is needed. The data availability will be highly restrained for these regular users. It is important not to overwhelm the cancer patient with an excessive amount of data in order to prevent hypochondriasis and apprehensive behaviour. At this point a gamified system would tackle the stimuli loop. (See Gamification. Considerations for Design, page 42) On the other hand, for the medical personnel, all the data gathered and inferred needs to be available for displaying. According to medical advise from oncologists in the Hospital Virgen de las Nieves, a multiple choice view with different time-length buckets (for example, an hour, a day or a week) would be very useful. 3.2 Hardware There is a vast and huge amount of available devices in the market related to activity monitoring, connectivity and mHealth, therefore a highly condensed summary is necessary to serve as an 32 Automatic Performance Status Evaluation. S. Moreno Guti´errez useful comparison instead of a deep insight on each piece of equipment. 3.2.1 Mobile Devices Nowadays global market is having a boom related to activity trackers and wearable technologies. From February 2015 to February 2016 an overall growth of 171.6% in this market share has been detected. Several leading companies like Samsung, Fitbit, Apple or Sony are striving to make the most of their slice in this industry. This assures a strong range of improvements in many differently oriented sets of products: smartwatches, fitness trackers, mHealth devices and so on [1]. Moreover, the world market smartphone is still in a very good condition, delivering products for most of people. The market smartphone sales have been growing to stable within the last three years (see Figure 3.1). These are basically the same companies enrolled in the wearable industry previously commented, hence the compatibility provided among all the products is a very good starting point to take into account when building the system [2]. Figure 3.1: Smartphone sales value worldwide from 2013 to 2016 (in billion U.S. dollars), by region. Data source: [2] However, there is a relevant difference in the market share of the smartphones’ Operating System (OS) (Figure 3.2). Android has been controlling the market with huge prevalence since 2012. On the last record, 2015Q2, Android was running 83% of all the smartphones sold, whilst iOS was just running Apple’s own devices (14% of share) and Windows Phone the 3% [3]. This is the main reason why Android devices, primarily smartphones, have been selected for running the biomonitoring system proposed. This project is eager to reach the most possible amount of people. This will only be possible using very popular tools like Android smartphones. There are other reasons to support Android, which will be discussed along the chapter, such as the possibility of using Google Fit and the big compatibility of the wearable industry with it (See Google Fit API, page 38). 33 Automatic Performance Status Evaluation. S. Moreno Guti´errez Figure 3.2: Smartphone OS Market Share. Data source: [3] 3.2.2 Wearables Fitness assessment is the new trend for wearables. There are several companies objectively oriented to this target with diverse approaches to physical activity measurement. In this section some of the main products of the most relevant companies are going to be presented, compared and discussed for their suitability for the purpose of this project. Smartwatches Smartwatches emerge as the evolution of wrist watches as we knew them. The miniaturization has allowed the inclusion of powerful microprocessors along with different sensors (accelerometers, photoplethysmogram, skin temperature, etc) run by OS like Android Wear, Tizen or WatchOS 2. In Table 3.1 a summary of the Smartwach Leaders characteristics comparison is presented [4, 5, 6, 7, 8, 9]. The possible selections are highlighted in yellow whilst the reasons for rejection are clearly marked with a red N: Apple Watch and Pebble Time Round because of the lack of Android compatibility and the Samsung Gear S2 because of Tizen environment along with the absence of scheduling reminders. Their characteristics are very similar along the different models pre-selected: •HR measurament enabled by PPG. •Bluetooth v4.1, LE and Wi-Fi 802.11 b/g for connectivity. •9-axis accelerometer, gyroscope and barometer. •Pedometer. •4GB of internal storage. •512 MB RAM. 34 Automatic Performance Status Evaluation. S. Moreno Guti´errez Table 3.1: Leading Smartwatch characteristic comparison •Battery capacity of ˜ 300 mAh. In spite of the fancy modern look the smartwatches provide, according to different Internet reviews, the performance of HR sensor in these devices is not acceptable not even for regular fitness. Besides, the cost of any of these products goes beyond 300e, a very high cost against the low performance offered. It is concluded that the market of smartwatches is already looking for aesthetics rather than performance, so this option seems an unlikely candidate for the prototype. Fitbit Fitbit offers three different products that the proposed system can rely on: Charge HR (149.95 e), Blaze (229.95 e) and Surge (249.95 e). They all meet the functional requirements of having pedometer, PPG for HR tracking, sleep tracking and long time battery duration [10]. Nevertheless, they do not provide any sort of integration with the Google Fit API, which will be key in the system proposed, gathering data only for their for their own private closed platform. The Fitbit API is quite restricted, it enables collecting data already processed by their algorithms but it does not allow to collect it directly from the wearable. It requires the installation of their own app. Fitbit’s Data Policy claims that there is complete security and privacy with the data collected and that they are not to be sold to any other company. However, they are available for making their own use statistics [11]. 35 Automatic Performance Status Evaluation. S. Moreno Guti´errez Microsoft Band 2 The Microsoft Band 2, with a 250$ price, suits up as a very good candidate for the project, featuring a very diverse set of sensors. It features the following characteristics: •Battery life of 48 hours of normal use •Optical heart rate sensor. Continuous heart rate monitoring. •3-axis accelerometer/gyro •Gyrometer •GPS •Ambient light sensor •Skin temperature sensor •UV sensor •Capacitive skin sensor •Galvanic skin response •Microphone •Barometer •Bluetooth 4.0 (Low Energy) for connectivity •Supported mobile devices: Windows Phone 8.1 update or later, iPhone: 5, 5C, 5S, 6, 6 Plus, iOS 8.1.2, and Android 4.4 or later phones with Bluetooth •Step tracking. The API provided is compatible with different SDKs such as Visual Studio, Eclipse and Android Studio. It provides direct access to the sensor data in the wrist band [12]. Unfortunately, Microsoft Band does not provide any connection with Google Fit. It works exclusively with Microsoft Health Vault, which Data Policy entitles the user to adjust the data to the most strict privacy standards, even preventing Microsoft from using your data for statistics [13]. Furthermore, it is still not available for the Spanish market, which makes this item an attractive yet inappropriate solution. Sony Sony offers the same range of options with three activity trackers: SmartBand ROXY SWR10 (49.50 e), SmartBand 2 (129.00 e), SmartBand Talk SWR30 (159.99 e). The only with HR monitoring via PPG, (automatic and continuous manual modes available), is the SmartBand 2, so the other two devices are automatically discarded [14]. The SmartBand 2 (see Figure 3.3) meets the requirements with a very low cost comparing to the rest of devices listed. Besides, it is fully compatible with Google Fit. 36 Automatic Performance Status Evaluation. S. Moreno Guti´errez Sony’s Data Policy is not as restrictive as the Microsoft’s Health Vault. Sony entitles itself to use the data anonymously for statistics within their company group without permission request[15]. However, for prototyping purpose this does not such an important issue to deal with. (a) (b) Figure 3.3: Sony SmartBand 2 (SWR12) (a) front and (b) back. Others: Xiaomi, Samsung and Apple The Xiaomi Mi Finess band looks like an attractive solution due to its low cost (28$) even implementing HR monitoring with PPG. However, internet reviews reach the conclussion ”you get what you pay for”, even though it is very cost-effective. There is no possibility of enabling continuous HR monitoring [16]. Samsung products have been directly rejected due to the Samsung inclination of moving all its products to their own closed OS Tizen, therefore not assuring future consistency with the implementations developed for this prototype [17]. Apple already has this market proposal with all its products almost exclusively related to iOS and WatchOS, so the same conclusion is reached. Conclusions There are many different companies competing in this market, some of them may have been left behind, but an extent review of the benefits and drawbacks of the leading products have been clearly pointed out. There is still one major issue to be addressed, common to all the brands analysed: the medical resignation. Each one of the activity trackers comes along with a non-warranty clause claiming that it is not a medical device. From the side of development, I want to assure that there is complete awareness of this explicit declaration, however, this is just a way for companies to tie loose ends and to leave any kind of responsibility to those who want to use the activity trackers for a medical purpose. 37 Automatic Performance Status Evaluation. S. Moreno Guti´errez To conclude, comparing price, requirements fulfilment, market availability and long-term functionality, the SmartBand 2 has been selected as the leading wearable for developing prototype in this Performance Status Evaluation Assessment System for Cancer Patients. 3.3 Software In this section the different and new software tools adopted for this project are going to be discussed. 3.3.1 Development Framework Android Android counts with several frameworks for development such as NetBeans, Eclipse, both providing support for mobile and web applications in Java, Javascript, HTML5 and more [18, 19], and Google’s Android Studio, which is based on the JetBrains’ IntelliJ IDEA software [20]. Despite of the big documentation and guidelines already written for Android programming under Eclipse and NetBeans, Android Studio has been selected to develop this project since its maintainer is the same one that maintains Android, Google. At the date of writing, Android Studio is currently at is version 2.1.2, which has proven extremely useful due to the high integration of Android assistance: to automatically create getters and setters in a class, templates for different kind of interface views such as Scroll View,Navigation Drawer or just blank activities. It has also improved the Layout Editor, making it more accessible enabling drag and drop actions and giving recommendations about the Material Design guidelines for aesthetics [21]. Furthermore, the community is already migrating to this platform due to the high support Google is giving. New publications from known publishers such as Big Nerd Ranch are already using Android Studio for development, courses and books like the one I used as the main guide through the project, Android Programming, 2016 Edition by Bill Phillips et al. [22]. Data Post-Processing & Algorithms There are diverse tools to implement the data post-processing, languages like C, Java, R, Octave or even MATLAB. In this case, and for the project’s prototype, MATLAB has been chosen as the framework to apply the algorithms to the gathered data. MATLAB is a development platform optimized to resolve engineering and science problems. Its language is based on matrixes and it provides integrated graphics to display the data accurately. Besides, there is available a vast library of toolboxes that enables immediate work with specific algorithms in areas like signal processing or statistics[23]. Moreover, MATLAB is a tool that has been used all along the Bachelor’s Degree in Industrial Electronic Engineering and it is known fairly well to start obtaining results with the comfort that the rest of very new areas like Android programming might not provide. 38 Automatic Performance Status Evaluation. S. Moreno Guti´errez 3.3.2 Object-Oriented Programming Android development is mainly done in Java, so this comes with a new programming paradigm never tackled before in the Bachelor’s Degree of Industrial Electronics Engineering, Object- Oriented Programming (OOP). OOP is based on the concept of objects that may contain data within its attributes (like fields). These objects are defined with Classes, in the class-based languages, that may also contain methods in which procedures are declared. The objective is to make the different objects interact among them via the methods defined in each one. The class-based languages create objects as instances of classes. The main reference for OOP learning has been the book from L´opez Goytia et al., Programaci´on orientada a objetos C++ y Java: un acercamiento interdisciplinario [24] and web resources like StackOverflow [25]. Objects and Classes It is usual that OOP languages support inheritance for code reuse and extensibility via other classes. The two main concepts of objects are classes are closely related: •Class. It is the definition for the available data and methods (or procedures) for the given object. It is like the archetype from which objects can receive its characteristics, e.g., the Animal class. •Object. They are instances of classes. For example, the objects lion and cat can be created as instance of the class Animal. Classes define variables, known as fields, and methods. Depending on their relationship with the objects inherited, different classification is accepted: •Class variables. They belong strictly to the class, regardless of how many instances exist. These variables are normally declared as static. •Instance variables. The field is defined in the class but each instance may have its own value in it. •Class methods. The methods declared belong to the class. These methods are normally under complete data request for they to properly work. For example, the method public static double sum(double num1, double num2) allocated in the Operations class. •Instance methods. These methods are applicable directly to the instance created. They cannot be executed for the class itself. It could be the method run() executed for the instance cat with the command cat.run(); . SOLID Guideline In order to create maintainable code for the application designed, the SOLID principles have been taking into account [26, 27]. Other guidelines like GRASP are famous but no explanation for Android was found. 39 Automatic Performance Status Evaluation. S. Moreno Guti´errez SOLID is a mnemonic acronym that helps define the five basic object-oriented design principles: •Single responsibility principle. A class should have only a single purpose or responsibility, like handling the patient’s data. •Open/close principle. Classes should be open for extension but closed for modification. High modification of classes for new features may point out a bad design. •Liskov substitution principle. Objects in the program should be replaceable with instances of their subtypes without altering the correctness of the program. For example, a method to run an Animal object should not have a problem to run a Mammal that extends Animal. •Interface segregation principle. Different specific interfaces are better than one generalpurpose interface. •Dependency inversion principle. Classes and programs should depend upon abstractions and not upon concretions. 3.3.3 Google Fit API Due to the high market share that Android has over its competitors, most of the wearable and fitness tracking devices implement connectivity with Google Fit. The election of Google Fit for data collection allows for data management for a high number of different activity trackers and wearables in the market. High difficulties have been presented when dealing with this API due to the lack of accurate documentation’s distribution all along the Guides, Reference and Developers sites for Google Fit. Besides, since it is still a rather early technology there is not much help on forums like StackOverflow – at least beyond the most basic implementations which are available in the official Google Fit website too. There are two APIs, the API for Android and the REST API for implementation in other devices[28]. Since the project app is android-oriented, the API for Android has been further studied and it is detailed in the following subsections. Its structure can be seen in Figure 3.4. 3.3.4 DataSources and DataTypes Google Fit defines DataSources and DataTypes for treating DataPoints. When DataPoints gather in DataSets, they always refer to a DataSource and to a DataType to know exactly what they are. DataSources are the definition for the origin of the data. For instance, in this project, two DataSources can be found: the smartphone data and the Sony SmartBand 2 SWR12. DataTypes define the format of the values inside the DataPoints. This format can be: •An instantaneous reading or observation, the TYPE DataTypes. •An aggregate with statistics over a time interval, the AGGREGATE DataTypes. 40 Automatic Performance Status Evaluation. S. Moreno Guti´errez ments are going to make this possible and in a very easy way. This activity tracking will be easily accessible for the patients to see their own progress, always highlighting the good results on the tendencies. Besides, there will be different experience points attached to each kind of activity: •Physical activity: referred to the time stood up, the steps given or the intensity of activity performed in a certain time. •Social activity: referred to activities involving social interaction. This will be very important in the social framework for the social community of patients. •Mental activity: referred to quests and missions that imply concentration activities. •Reflexive activity: referred to quests and missions that imply deep insights. •Emotional activity: referred to quests and missions that are related to the own or other people feelings. Moreover, like in videogames, the patient will be able to beat final bosses, for example, when they pass a chemotherapy, radiotherapy or reduce the tumor volume. This will also be shown in the patient’s profile, highlighting progress again. (a) (b) Figure 3.5: (a) Engagement and (b) Progression loops. Adapted from [39] Fun Like every game, a gamified app should come with fun attached to the process. The fun comes along with all that was described before: the sense of progression, being part of a community and beating cancer together. A fine art is needed to make the system app attractive for both smartwatches (in case) and smartphones: charts, figures, interface, enjoyable pictures of funny animals that describe the patients, personalized avatars, etc. Game-design Elements and Tools To achieve all this, the following tools are necessary: 47 Automatic Performance Status Evaluation. S. Moreno Guti´errez •Quests. Missions or objectives for the patient to fulfil. They will be all related to health and physical activity. In Figure 3.6 a first approach to its implementation in the Android app of OncoHealth has been done. To activate the activity the user would only need to press on them to increase the counter. •Badges. Achievements to earn in determined conditions, for example, for good physical activity performance in IPAQ score, for giving more than 10 000 steps in a day or for maintaining a good tendency all over the week. •Social media. This will enable build-up of a community where patients can fight in group. •Points. Physical, Social, Mental, Reflexive and Emotional points attached to any activity. Figure 3.6: Quest list in an Android ScrollView design 3.5 Summary & System Design Overview After knowing all the parts involved in the system, now it can be depicted in a general diagram in Figure 3.7. It combines all the elements chosen and discussed along the chapter in a solid design implemented in Chapter 4. 48 Automatic Performance Status Evaluation. S. Moreno Guti´errez Figure 3.7: General Schema of the complete System proposed 49 Automatic Performance Status Evaluation. S. Moreno Guti´errez Bibliography [1] The Worldwide Wearables Market Leaps 126.9% in the Fourth Quarter and 171.6% in 2015, According to IDC. http://www.idc.com/getdoc.jsp?containerId=prUS41037416. Online; accessed 2016-03-13. [2] Smartphone sales revenue worldwide 2013-2016 |Statistic. http://www.statista.com/ statistics/412145/global-smartphone-sales-value-global-region/. Online; accessed 2016-04-20. [3] IDC: Smartphone OS Market Share. http://www.idc.com/prodserv/ smartphone-os-market-share.jsp. Online; accessed 2016-04-20. [4] Apple Watch - Apple. https://www.apple.com/es/watch/. Online; accessed 2016-03-21. [5] Huawei Watch - Huawei Official Store. http://www.gethuawei.com/huawei-watch. Online; accessed 2016-03-21. [6] LG W150: Watch Urbane - Sleek, Stylish Smartwatch |LG USA. http://www.lg.com/ us/smart-watches/lg-W150-lg-watch-urbane. Online; accessed 2016-03-21. [7] Moto 360. http://www.motorola.com/us/products/moto-360. Online; accessed 2016-03- 21. [8] Pebble Time Round |Pebble, el reloj inteligente |Reloj inteligente para iPhone & Android. https://www.pebble.com/pebble-time-round-smartwatch-features. Online; accessed 2016-03-21. [9] Samsung Gear S2 y Gear S2 Classic |.http://www.samsung.com/es/galaxy/gear-s2/ features/. Online; accessed 2016-03-21. [10] Sitio oficial de Fitbit para monitores de actividad y mucho m´as. https://www.fitbit. com/es#. [11] Pol´ıtica de privacidad de Fitbit. https://www.fitbit.com/es/legal/privacy. Online; accessed 2016-03-21. [12] Microsoft. Microsoft Band. https://www.microsoft.com/microsoft-band/en-us. Online; accessed 2016-03-21. [13] Declaraci´on de privacidad. https://privacy.microsoft.com/es-es/privacystatement. Online; accessed 2016-03-21. [14] Sony SmartWear. http://www.sonymobile.com/es/products/smartwear/. Online; accessed 2016-03-21. [15] Pol´ıtica de privacidad de Sony Mobile - Sony Mobile (Espa˜na). http://www.sonymobile. com/es/legal/privacy/. Online; accessed 2016-06-21. [16] Buy Xiaomi Mi Fitness Band Online - Mi Singapore. 50 Automatic Performance Status Evaluation. S. Moreno Guti´errez [17] Samsung considers using Tizen in all products. http://www.koreatimes.co.kr/www/ news/tech/2016/06/133_206894.html. Online; accessed 2016-06-21. [18] Welcome to NetBeans. https://netbeans.org/. Online; accessed 2016-06-28. [19] Eclipse Foundation Inc. Eclipse - The Eclipse Foundation open source community website. https://www.eclipse.org/home/index.php, abstract = Eclipse is probably best known as a Java IDE, but it is more: it is an IDE framework, a tools framework, an open source project, a community, an eco-system, and a foundation. Online; accessed 2016-06-28. [20] Download Android Studio and SDK Tools |Android Studio. https://developer.android. com/studio/index.html. Online; accessed 2016-06-28. [21] Material Design. https://material.google.com/. Online; accessed 2016-06-28. [22] Bill Phillips, Chris Stewart, Brian Hardy, and Kristin Marsicano. Android Programming: The Big Nerd Ranch Guide. Big Nerd Ranch Guides, Atlanta, GA, 2 edition edition, August 2015. [23] MATLAB - El lenguaje del c´alculo t´ecnico - MathWorks Espa˜na. http://es.mathworks. com/products/matlab/. Online; accessed 2016-06-28. [24] Jose Luis Lopez Goytia and Angel Gutierrez Gonzalez. Programaci´on orientada a objetos C++ y Java: un acercamiento interdisciplinario. Larousse - Grupo Editorial Patria, Mexico D.F, 2014. [25] Stack Overflow. http://stackoverflow.com/. Online; accessed 2016-06-28. [26] Robert C. Martin. Principles of OOD. http://butunclebob.com/ArticleS.UncleBob. PrinciplesOfOod. Online; accessed 2016-06-28. [27] Donn Felker. SOLID Principles for Android. https://realm.io/news/ donn-felker-solid-part-1/. Online; accessed 2016-06-28. [28] Google Fit API. https://developers.google.com/fit/overview. Online; accessed 2016- 06-14. [29] Android Developers. https://developer.android.com/index.html. Online; accessed 2016-06-14. [30] MySQL. https://www.mysql.com/. Online; accessed 2016-06-14. [31] Database 12c |Oracle. https://www.oracle.com/database/index.html. Online; accessed 2016-06-14. [32] SQLite Home Page. http://sqlite.org/. Online; accessed 2016-06-14. [33] mksqlite, a MATLAB Mex-DLL to SQLite Databases. https://sourceforge.net/ projects/mksqlite/. Online; accessed 2016-06-29. 51 Automatic Performance Status Evaluation. S. Moreno Guti´errez [34] M. Rodr´ıguez P. Guti´errez. Actuaciones Psicol´ogicas. In Estrategias en el Cuidado y Seguimiento del Enfermo en Oncolog´ıa M´edica. Grupo Editorial Universitario, Granada, 2003. [35] Monique Tabak Frederiek de Vette. Engaging Elderly People in Telemedicine Through Gamification. Journal of Medical Internet Research, Serious Games(2), 2015. [36] Salvador Moreno, Miguel Damas, Hector Pomares, Jose Antonio Moral-Munoz, and Oresti Banos. Designing a Gamified System to Support Cancer Patients’ Recovery. In Proceedings -extended abstracts- of the 4th International Work-Conference on Bioinformatics and Biomedical Engineering (IWBBIO 2016), pages 433–436, Granada, April 2016. [37] David V. Nelson, Lois C. Friedman, Paul E. Baer, Montague Lane, and Frank E. Smith. Attitudes to cancer: Psychometric properties of fighting spirit and denial. Journal of Behavioral Medicine, 12(4):341–355, 1988. [38] Kayleigh Hodges and Sue Winstanley. Effects of Optimism, Social Support, Fighting Spirit, Cancer Worry and Internal Health Locus of Control on Positive Affect in Cancer Survivors: A Path Analysis. Stress and Health, 28(5):408–415, 2012. [39] Kevin Werbach and Dan Hunter. For the Win: How Game Thinking Can Revolutionize Your Business. Wharton Digital Press, October 2012. 52 Chapter 4 System Implementation and Results For all the implementation the following devices have been used: •Sony SmartBand 2 (SWR12) for biomonitoring. Brand new and specifically acquired for its implementation in the system. •Samsung Galaxy ACE 2 (GT-I8160). Three-years-old mid-range personal smartphone. Running Android 4.4.4 - CyanogenMod. •Personal laptop ASUS K53SJ running Debian Jessie 8.5; MATLAB version R2013a. 4.1 Patient’s App First of all, it is necessary to select the data to be collected, then implement it into an app based on the Recording API from Google Fit. Then the History API can be implemented into a service to query and pre-process the data requested. This will be pursued with two different apps, OncoRecord and OncoHealth, which will be in-depth explained along the chapter. 4.1.1 Data Recorded To infer the IPAQ (see subsection 4.2.1, page 65), and the ECOG and KPS (see subsection 4.2.2, page 68), the following data is required to be queried from the Google Fit API. A structure of the data purpose can be seen in Figure 4.1: 1. Heart Rate (DataType.TYPE HEART RATE BPM ). HR can be monitored in two different modes, automatic and manual. In this project the automatic mode has been selected due to the following reasons: •The automatic mode is entirely controlled by the SmartBand 2. According to the tracking and the experiments done, it tracks HR for 1 minute long after time intervals between 2 and 15 minutes, depending on the activity detected by the accelerometers of the wristband. Consequently, a non-regular sampling will force a post-processing to enable comparison with other measures. In this mode battery lasts for 48 hours long. The automatic activation of HR monitoring when sudden activity is detected makes this option suitable for the purpose of measuring tendencies and patient’s state 53 Automatic Performance Status Evaluation. S. Moreno Guti´errez Figure 4.1: Data Structure and utilization in IPAQ, ECOG and KPS algorithms. differences along the time. For example, if the wristband user is in a still position, the monitoring will be activated in time intervals of 15 minutes; if suddenly he starts walking or moving, the SmartBand 2 will automatically start to measure HR. •The continuous mode is controlled by the user, activated manually by double clicking the button on the side of the wristband. Thereon a more reliable measure is gathered at the expense of reducing the battery duration to max of 16 hours. The reason this mode is not selected is double, first because there is no need for that size of accuracy when monitoring for entire weeks long, and second because the battery draining is too high. 2. Step Count (DataType.TYPE STEP COUNT DELTA). Step Count has a continuous sampling frequency determined by the hardware itself. It combines data from the accelerometers of all the devices being carried (smartphone, wearables, tablet...) thanks to the Google Fit technology. Thus data will be ultimately bucked in length segments as requested in the app, in this case 5 minutes, as explained in subsection 4.1.4 OncoHealth, page 57. 3. Calories Expended (DataType.TYPE CALORIES EXPENDED). These data is used to compare the MET activity measured with the IPAQ criteria against the Google Criteria. In subsection 4.2.1 MET for IPAQ, page 66 will be concluded the good scoring of IPAQ criteria and the inclusion of Resting Metabolic Rate (RMR) of Google Calories estimation. 4. Activity Segments (DataType.TYPE ACTIVITY SEGMENT). Activity recognition is primarily done by the response of accelerometers and HR monitoring. This enables to recognise still, walking, running, cycling and sleeping conditions that will be used for the IPAQ and KPS-ECOG algorithms. 54 Automatic Performance Status Evaluation. S. Moreno Guti´errez 4.1.2 Authentication & Authorization system In order to get access to the data in Google Fit repository, an OAuth 2.0 Client verification is needed for the app. For prototyping purpose, it has been chosen the Debug Certificate over the Release Certificate process to put the system to work. It is necessary to: 1. Locate the debug keystore file, usually located in the same directory as the AVD. 2. List the SHA-1 fingerprint entering the following command: keytool −l i s t −v−key sto re ˜/. android /debug . keystor e −alias androiddebugkey −st or ep as s android −keypass android 3. Introduce the Credential into the Google Developer Console (Figure 4.2). Figure 4.2: Google Developer Console OAuth 2.0 Certificate Request. 4.1.3 OncoRecord First of all, it is necessary to start the automatic recording of the data selected. For this, the Recording API in Google Fit has been used. Along this subsection the issues tackled to 55 Automatic Performance Status Evaluation. S. Moreno Guti´errez make this happen are going to be explained. In the Figure 4.3 the following codes referred to permissions and dependencies are summed up. Figure 4.3: Permissions and Dependencies declared in OncoRecord. Android Manifest: Permissions In the Android Manifest are summarized the main components of the app such as its name, activities, services, permissions, intent-filters and so on. For this app the following code refers to the permissions required by the app: <manifest package=” es . ugr . smoreno . oncorecord ” . . . <uses−permission android:name= ” android . permission .ACCESS NETWORK STATE” /> <uses−permission android:name=” android . permission .BODY SENSORS”/> <uses−permission android:name=” android . permission .INTERNET” /> . . . </manifest> ACESS NETWORK STATE allows network connection status checking, BODY SENSORS allows recovering data from HR monitoring and INTERNET allows internet connection to the servers in Google API and checking internet status. Gradle: Dependencies In the Gradle file the compiler settings are disposed, where the minimum and the maximum Android versions , the dependencies and the package name are defined. For this app the minimun SDK version is 18, that is Android 4.3 Jelly Bean, which is the minimum requisite of the 56 Automatic Performance Status Evaluation. S. Moreno Guti´errez –num segments (int-count)1 First of all, the method used for querying the data with the History API was AsyncTask, but this was rather a rough method since it required manual activation, so the procedure was finally implemented as a Service. The class QueryService handling it extends its properties from IntentService. It sets an exact alarm with ServiceAlarm that launches the program after the time interval specified. The most important part of the code for activating the service it is the following: public static void setServiceAlarm ( Context context , boolean isOn) { Intent in tent = QueryService . newIntent ( context ) ; PendingIntent pendingIntent = PendingIntent . g et S er vi ce ( context , 0 , intent , 0 ) ; AlarmManager alarmManager = ( AlarmManager ) context . getSystemService ( Context .ALARM SERVICE) ; i f ( isOn ) { alarmManager . setRepeating ( AlarmManager .ELAPSED REALTIME, SystemClock . elapsedRealtime () , AlarmManager .INTERVAL HOUR, pendingIntent ); }else { alarmManager . cancel ( pendingIntent ) ; pendingIntent . cancel ( ) ; } } The AlarmManager sets the repeating interval for launching the intent in which the query is defined. Note that it is set with the method setRepeating instead of setInexactRepeating for precise intervals of repetition, so it queries in perfectly scheduled time buckets of one hour. With this distributed scheduling there is no perceptible drain of the smartphone’s performance. The total Time of Execution (TE) of one hour query is: TE = (3423.3±25.1)ms Theory of errors has been applied to the sample, making 15 samples enough to deliver a significant result (Figure 4.7). SQLite Storage For prototype purpose and due to the good implementation of local SQLite databases within the Android framework, it has been selected as the database manager over any remote MySQL or Oracle implementation. 1Unused 63 Automatic Performance Status Evaluation. S. Moreno Guti´errez One of the major problems dealing with SQLite had to do with how the Google Fit API treats the data. In spite of defining a time-bucket size for the data query (5 minutes), there are always some datapoints that do not respect that sampling time, it is rather a non-strict bucket-time definition. Moreover, Google Fit API only provides one datapoint at a time, say for example HR monitoring. This forces to collect each of the four raw DataTypes in a specific way. The data always comes with its own endTime and startTime, however, it is highly unlikely that those timestamps would happen to match among the different DataTypes. To solve that and to avoid multiple databases, each DataType collected is allocated in one row when received whilst the rest of colums, not available in the datapoint received, and its inferred values are set to -1 to point out that that row does not match with the data in that column (Figure 4.8). At the end of the process, a purge is necessary to erase a low random number of blank datapoints with timestamps startTime and endTime equal to 0 and null data. The databases are defined exactly with the same parameters than the detailed in the object description as in Figure 4.6: Figure 4.7: One-hour-query execution time in OncoHealth. Figure 4.8: SmartBand’s Database View. 64 Automatic Performance Status Evaluation. S. Moreno Guti´errez •Patient.db: for identification purposes. –id (History Number, UUID): since it is oriented to medical application, this value would relate the patient’s information to the data collected in SmartBandData.db –Name (String) –Last Name (String) –Sex (String) –Age (int): in years. –Weight (int): in kg. –Body Surface (double): useful for further clinical studies. It is calculated according to the DuBois and DuBois formula [1, 2]. –Type of cancer (String): useful for further studies. •SmartBandData.db –id (History Number, UUID): for identification of SmartBandData with its owner. –Date (String): easy display. –StartTime (long): UNIX time, ms. –EndTime (long): UNIX time, ms. –HR Mean (float): it is the used in algorithms depending on HR monitoring. –HR Max (float): only available when continuous HR monitoring activated. –HR Min (float): only available when continuous HR monitoring activated. –Intensity Mean (float): intensity calculated according to the Karvonen Formula with HR Mean [3]. –Intensity Max (float): intensity calculated according to the Karvonen Formula with HR Max. –Intensity Min (float): intensity calculated according to the Karvonen Formula with HR Min. –Activity detected (int). –METs Google: conversion of Calories Expended detected according to Compendium of Physical Activities [4]. –METs IPAQ: estimation of METs according to the intensity detected and IPAQ criteria [5]. –Steps Delta: number of steps given in the amount of time requested. Screenshots Some screenshots of the app can be seen in this subsection. In Figure 4.9b the interface for introducing patient’s information is displayed. It only appears on the first time for associating the data collected to that user. In Figure 4.10 a log of the querying process, enabled only for debugging, is displayed. 65 Automatic Performance Status Evaluation. S. Moreno Guti´errez (a) (b) Figure 4.9: Figures of OncoHealth patient’s sign up form in a ScrollView (a) top and (b) bottom . (a) (b) Figure 4.10: Figures of OncoHealth query for 1 hour, (a) connection and (b) end. 66 Automatic Performance Status Evaluation. S. Moreno Guti´errez 4.2 Data Gathering and Processing For the whole implementation of the algorithms an 18 days-long database has been used. I have served as tester for the biomonitoring, thus finding it easier to check on the data gathered and its accuracy. 4.2.1 IPAQ Inferring As an alternative to the self-reported IPAQ, the following algorithm is proposed for automatic evaluation. It is built upon the algorithm depicted in the IPAQ evaluation with data obtained from continuous biomonitoring [5]. It consists of: 1. Database query. The following data is queried: •Activity intensity based on HR and Karvonen Formula. •METs for IPAQ explained later in subsubsection MET for IPAQ. 2. Frequency adaptation. Since the frequency of the Activity intensity is higher than the HR monitoring, a frequency adaptation is necessary in order to compare data. The algorithm is explained in depth in subsection Algorithm Flowcharts, page 71, Figure 4.17. 3. Daily detection. A day range needs to be set. Results can be seen in Figure 4.11, and an in-depth explanation in subsection Algorithm Flowcharts, page 71, Figure 4.18. Figure 4.11: Daily detection for 18 days long database. 4. Activity intensity and METs for IPAQ bucketing day by day. The raw data gets organized in buckets of one day length. Both variables are composed by three different labels depending on the nature of the physical activity performed: light,moderate and intense. 67 Automatic Performance Status Evaluation. S. Moreno Guti´errez 5. Activity intensity and METs for IPAQ sum up week by week. Segmentation in week buckets is applied to the whole data. For each week detected, the IPAQ algorithm is evaluated: •Category IPAQ 1: Low. The lowest level of physical activity. Those individuals who not meet criteria for categories 2 or 3 are considered low/inactive. •Category IPAQ 2: Moderate. Any one of the following 3 criteria: –3 or more days of vigorous activity of at least 20 minutes per day. –5 or more days of moderate-intensity activity or walking of at least 30 minutes per day. –5 or more days of any combination of walking, moderate-intensity or vigorous intensity activities achieving a minimum of at least 600 MET-min/week. •Category IPAQ 3: High. Any one of the following 2 criteria: –Vigorous-intensity activity on at least 3 days and accumulating at least 1500 MET-minutes/ week. –7 or more days of any combination of walking, moderate-intensity or vigorous intensity activities achieving a minimum of at least 3000 MET-minutes/week. MET for IPAQ Before we enter to explain the IPAQ inferring, it is important to note how the physical activity in METs have been estimated. Since it is primarily focused in IPAQ inferring, it will specifically be counted when physical activity is detected. One of the problems that Google Calories Expenditure presents is that it considers always the RMR, so it points out calorie expenditure even when total resting is detected. The IPAQ does not take into account this kind of activity, therefore, to filter this, the IPAQ MET expenditure has been calculated only when an activity different from EXCEPTION,IN VEHICLE, STILL,DEEP SLEEP,LIGHT SLEEP,REM SLEEP and AWAKE SLEEP is detected. All those activities automatically have set a MET value of zero, which means no physical activity at all. The activities that are enabled to calculate the MET expediture are CYCLING,ON FOOT, WALKING and RUNNING, since most of physical activities imply on foot movement in different grades of intensity. The activity CYCLING count with its own MET expenditure since it is automatically detected, always according to the Compendium of Physical Activity [4]. The MET expenditure is calculated following these criteria [5]. The intensity is inferred directly from HR according to Karvonen’s Formula [3]: •Light activity intensity. MET = 3.3·duration (MET ·min) •Moderate activity intensity. MET = 4 ·duration (MET ·min) •Vigorous activity intensity. MET = 8 ·duration (MET ·min) •Cycling activity intensity. MET = 6 ·duration (MET ·min) 68 Automatic Performance Status Evaluation. S. Moreno Guti´errez A comparison of the METs inferred with IPAQ rules and with the Google Calorie Expenditure, transformed to METs, for a database along 18 days long, can be seen in Figure 4.12. In Figure 4.12a a good Pearson correlation coefficient of 0.8505 is obtained, but because of the outliers the Spearman and Kendall scores point out a rather low correlation. Nevertheless, if the outliers are taken out of the comparison (just 49 points over a total of 3385, points where Google detected minor activity whilst the IPAQ remained to zero), it can be seen in Figure 4.1b how very good scoring is obtained for all the correlation coefficients, finding a 0.9306 for Pearson, 0.9349 for Spearman and a 0.8316 for Kendall. These results validate the use of this IPAQ algorithm for exclusive physical activity detection in METs. The time considered for the IPAQ activities is strictly the one attached to physical activity, that is, the time in which METs evaluated are higher than zero. The resulting time recorded along the 18 days can be seen in Figure 4.13. In the data presented the following activities can be highlighted to validate the algorithm: 1. Two one-hour-and-a-half-long paddle matches in days 10 and 17. The breaks and starting and ending times are correctly not detected as physical activity. 2. An hour-and-a-quarter-long music concert performed in day 12. The duration of the activity shown is quite accurately the time I was on stage. The rest of the time a rather sedentary or low level activity performed is found. This leads to an IPAQ scoring of 1 (LOW) for each of the two weeks detected, which seems appropriate according to the sporadic exercise done. (a) (b) Figure 4.12: METs calculation comparison between Google estimation and IPAQ algorithm (a) with all the data and (b) without outliers. 69 Automatic Performance Status Evaluation. S. Moreno Guti´errez Figure 4.13: Strict Light Activity Detection 4.2.2 ECOG and KPS Inferring Since no precedent for automatic ECOG and KPS inferring algorithms was found in the extent review of the State of the Art (page 14), there has been some liberty when defining the conditions for classifying the patients, but always according to the references cited along the descriptions. In this subsection the ECOG and KPS algorithm is presented. Unlike the IPAQ inferring, the PS measure does not focus strictly on the intensity of physical activity, it remarks on the tendency and continuity of the exercise done, even if it is performed at a very low level of intensity. Thus, a more flexible duration of light,moderate and vigorous activities is necessary to measure the activities beyond absolute rest. Here it is reminded that most of cancer patients tend to have long resting periods of time in bed or chair due to the physical weakness and fatigue acquired in the treatment. At first, the time considered for light activity was strictly all the gathered with intensity in the interval [0,50)% [6]. Nevertheless, this was almost all the time available in which any activity was detected, so, levelling up the light intensity standards was tried. The algorithm would now take into account the data in the interval (X, 50)% where X={0,1,2,3,4,5}%. With this, the algorithm is trying to offer slightly different perspectives, more or less restrictive, to the same measure of PS. This is specially important when the conditions for calculating come from the very ambiguous classification guide that ECOG and KPS supply. The only numeric condition they contain is to be out of bed more than 50% of the time available or not, which is found in the gap between 2 and 3 ECOG. This gap equals the one between 50 and 60 KPS [7]. Taking this into account, another objective measure was needed: the steps count. This extra measure will help to evaluate the level of activity according to the total steps done day by day [8]. The following points conform the algorithm: 1. Database query. The following data is queried: •Activity Detected (AD). 70 Automatic Performance Status Evaluation. S. Moreno Guti´errez •Activity Intensity based on HR. •Steps delta counted in 5-min-long time buckets. 2. Frequency adaptation. Since the frequency of the AD is higher than the HR monitoring, a frequency adaptation is necessary to compare Activity intensity with AD. The algorithm in subsection Algorithm Flowcharts, page 71, Figure 4.17 is applied to these variables. 3. Daily detection. Algorithm in subsection Algorithm Flowcharts, page 71, Figure 4.18 is applied to the following data: •Activity intensity and AD after frequency adaptation. •Steps Delta. 4. Day-by-day Bucketing. The raw data gets organized in buckets of one day length. It is divided in: •Steps Delta. •Sleep Tracking: Light,deep,REM and awake sleep. The whole sum is equal to the total sleeping time of each day. •Activity intensity with multiple division depending on the intervals defined for light intensity: (X, 50)% where X={0,1,2,3,4,5}%. 5. Calculation of the daily proportion of AD time. It is applied to each of the divisions defined for Light activity, plus the moderate and high activity. The sleeping time detected is taken out of the proportion of every day. In Figure 4.14 the results are presented. 6. Weekly segmentation. ECOG and KPS rule base (Table 4.1) applied to the weekly segmented data. The setting of margins for the light activity level detection is intended to serve as an indicator for the oncologist analysing the data. In Figures 4.15 and 4.16 the results are shown. The first week scores at 0% level with 90 KPS and 1 ECOG, higher than the rest of levels with 70 KPS and 2 ECOG; the second week strikes with 70 KPS and 2 ECOG for all the possibilities. The ”optimistic” filter of 0% margin for the light activity measure helps this differing, even if there is a higher exercise amount in the second week. That is because it is the prevalence of tendencies and the long term activity what really scores in the KPS and ECOG inferring. The paddle match and the concert may have impact on the IPAQ, but not enough to raise it to 2. 71 Automatic Performance Status Evaluation. S. Moreno Guti´errez Figure 4.14: Daily proportion of user’s Active Time (a) (b) Table 4.1: (a) Rule base for ECOG and KPS inferring with (b) legend. 72 Appendix User’s Manual: Patient Along this manual it is going to be presented the installation and first use dialogues. First of all, it is necessary to install any request that the wearable used may require. In this prototype, the Sony SmartBand 2 SWR12 is used, so the application ”SmartBand 2 SWR12” must be installed from Google Play (Figure 5.1). Figure 5.1: Install ”SmartBand 2 SWR12” from Google Play 79 Automatic Performance Status Evaluation. S. Moreno Guti´errez Then, the app guides the user through a first use guide to connect the SmartBand 2 (Figure 5.2). Make sure have the SmartBand2 fully charged at connection. Three blue leds should blink when connection with the smartphone is established. (a) (b) Figure 5.2: (a)Welcome screen and (b) SmartBand 2 connection screen. 80 Automatic Performance Status Evaluation. S. Moreno Guti´errez Next screen will recommend the way to wear the SmartBand 2, about 2 cm over the wrist’s bone. Once accepted, the main view of the SmartBand 2 app is seen (Figure 5.3). (a) (b) Figure 5.3: (a)Wearing recommendations and (b) main SmartBand 2 SWR12 view. 81 Automatic Performance Status Evaluation. S. Moreno Guti´errez Next, it is necessary to enable the Google Fit Connexion. For this, we enter into ”Settings” - ”Google Fit” and turn on the the connectivity with Google Fit (Figure 5.4). (a) (b) Figure 5.4: (a) General menu display and (b) Settings menu. 82 Automatic Performance Status Evaluation. S. Moreno Guti´errez Once enabled, you will be requested for authentication and authorization for your data to be requested by Google Fit through your Google account (Figure 5.5) (a) (b) Figure 5.5: (a) Google Fit connection tab enabled and (b) Google authorization request. With all this steps done, the environment is ready to install the OncoRecord and OncoHealth apps. Both will be installed manually since there are not yet listed within the Google Play applications. 83 Automatic Performance Status Evaluation. S. Moreno Guti´errez Once OncoRecord is installed, there will be an authorization request for data collection from Google Play. Then the listeners registered will be shown (Figure 5.6). (a) (b) Figure 5.6: (a) Authorization request and (b) data listeners activated. 84 Automatic Performance Status Evaluation. S. Moreno Guti´errez Done this, you can proceed to the first start of OncoHealth. A first screen will ask for the patient details (Figure 5.7). Figure 5.7: Patient’s sign up screen (a) top and (b) bottom. 85 Automatic Performance Status Evaluation. S. Moreno Guti´errez Finally, another authorization screen is presented. Once accepted, a test request to Google Fit is performance to finally activate the service that will gather automatically the data. Figure 5.8: (a) Authorization request and (b) test request with service activation. IPAQ Short IPAQ, English Version - USA The English version of the Short IPAQ is the original IPAQ from where all the translations are done. Some may be adapted with minor changes depending on the place of application. 86 SHORT LAST 7 DAYS SELF-ADMINISTERED version of the IPAQ. Revised August 2002. INTERNATIONAL PHYSICAL ACTIVITY QUESTIONNAIRE (August 2002) SHORT LAST 7 DAYS SELF-ADMINISTERED FORMAT FOR USE WITH YOUNG AND MIDDLE-AGED ADULTS (15-69 years) The International Physical Activity Questionnaires (IPAQ) comprises a set of 4 questionnaires. Long (5 activity domains asked independently) and short (4 generic items) versions for use by either telephone or self-administered methods are available. The purpose of the questionnaires is to provide common instruments that can be used to obtain internationally comparable data on health–related physical activity. Background on IPAQ The development of an international measure for physical activity commenced in Geneva in 1998 and was followed by extensive reliability and validity testing undertaken across 12 countries (14 sites) during 2000. The final results suggest that these measures have acceptable measurement properties for use in many settings and in different languages, and are suitable for national population-based prevalence studies of participation in physical activity. Using IPAQ Use of the IPAQ instruments for monitoring and research purposes is encouraged. It is recommended that no changes be made to the order or wording of the questions as this will affect the psychometric properties of the instruments. Translation from English and Cultural Adaptation Translation from English is supported to facilitate worldwide use of IPAQ. Information on the availability of IPAQ in different languages can be obtained at www.ipaq.ki.se. If a new translation is undertaken we highly recommend using the prescribed back translation methods available on the IPAQ website. If possible please consider making your translated version of IPAQ available to others by contributing it to the IPAQ website. Further details on translation and cultural adaptation can be downloaded from the website. Further Developments of IPAQ International collaboration on IPAQ is on-going and an International Physical Activity Prevalence Study is in progress. For further information see the IPAQ website. More Information More detailed information on the IPAQ process and the research methods used in the development of IPAQ instruments is available at www.ipaq.ki.se and Booth, M.L. (2000). Assessment of Physical Activity: An International Perspective. Research Quarterly for Exercise and Sport, 71 (2): s114-20. Other scientific publications and presentations on the use of IPAQ are summarized on the website. SHORT LAST 7 DAYS SELF-ADMINISTERED version of the IPAQ. Revised August 2002. INTERNATIONAL PHYSICAL ACTIVITY QUESTIONNAIRE We are interested in finding out about the kinds of physical activities that people do as part of their everyday lives. The questions will ask you about the time you spent being physically active in the last 7 days. Please answer each question even if you do not consider yourself to be an active person. Please think about the activities you do at work, as part of your house and yard work, to get from place to place, and in your spare time for recreation, exercise or sport. Think about all the vigorous activities that you did in the last 7 days. Vigorous physical activities refer to activities that take hard physical effort and make you breathe much harder than normal. Think only about those physical activities that you did for at least 10 minutes at a time. 1. During the last 7 days, on how many days did you do vigorous physical activities like heavy lifting, digging, aerobics, or fast bicycling? _____ days per week No vigorous physical activities Skip to question 3 2. How much time did you usually spend doing vigorous physical activities on one of those days? _____ hours per day _____ minutes per day Don’t know/Not sure Think about all the moderate activities that you did in the last 7 days. Moderate activities refer to activities that take moderate physical effort and make you breathe somewhat harder than normal. Think only about those physical activities that you did for at least 10 minutes at a time. 3. During the last 7 days, on how many days did you do moderate physical activities like carrying light loads, bicycling at a regular pace, or doubles tennis? Do not include walking. _____ days per week No moderate physical activities Skip to question 5 duration (int—milliseconds) Table 1: Fitness data types for instantaneous readings Data types for aggregate data These data types are defined as public fields of the DataType class. Their field names start with the AGGREGATE_ prefix. Data Type Name Description Permissio nFields (Format—Unit) com. Total time and number of segments in a particular activity for a time interval. Activity activity (int—enum) duration (int—ms) num_segments (int— count) com. Average, maximum, and minimum beats per minute for a time interval. Body average (float—bpm) max (float—bpm) min (float—bpm) com. A bounding box for the user's location over a time interval. Location low_latitude (float— degrees) low_longitude (float— degrees) high_latitude (float— degrees) high_longitude (float— degrees) com. User's nutrition intake during a time interval. Nutrition nutrients (Map<String, —calories/grams/IU) meal_type (int—enum) food_item (String—n/a) com. Average, maximum, and minimum power generated while performing an activity. Activity average (float—watts) max (float—watts) min (float—watts) com. Average, maximum, and minimum speed over ground over a time interval. Location average (float—m/s) max (float—m/s) min (float—m/s) com. Average, maximum, and minimum weight over a time interval. Body average (float—kg) max (float—kg) min (float—kg) Table 2: Fitness data types for aggregate data