**3. Development as a Wearable Mobile Cloud Platform**

In this section, we describe the technical development of the proposed approach to be deployed in wearable wrist-worn devices, mobile devices, and a cloud web platform. The proposed architecture is inspired by current advances in wearable and mobile development tools [41], which provide real-time monitoring in wearable devices and data synchronization between mobile and web applications.

For the client, we have implemented two applications using Android Platform [42], both in wearable wrist-born and mobile devices. On the server side, we have implemented a web server under Java Tomcat, which web services orchestrate and synchronize the flow data between the cardiac rehabilitation team and patients. In Figure 3, we show the architecture and data flow of components.

**Figure 3.** Architecture of components: (**1**) wearable device with real-time monitoring; (**2**) mobile application for evaluating the sessions; and (**3**) a web platform for evaluating the sessions by the cardiac rehabilitation team. The data from the patient and the team are synchronized (**A**) from wearable to mobile by Bluetooth; and (**B**) from mobile to cloud services by 4G/WiFi.

Hence, the approach includes three applications: a wearable application, a mobile application, and a web application, whose use cases are:

	- **–** Registration and updating of patient data, including the thresholds for CRP: maximal heart rate *HRmax*, ventilatory thresholds [*VT*1, *VT*2], basal ranges [*r* 0 <sup>+</sup>,*r* 0 <sup>−</sup>] and basal limits [*VT*<sup>0</sup> 1 , *VT*<sup>0</sup> 2 ].
	- **–** Creation and modification of the parameters of the sessions in the rehabilitation programs. They are: optimal heart rate training zones [*r* ∗ <sup>+</sup>,*r* ∗ <sup>−</sup>], duration range [*d*1, *<sup>d</sup>*2], and duration of progressive stage *dw*.
	- **–** Showing the CRSs from patients. The sessions developed by patients are synchronized from the mobile application to the web server. From them, the cardiac rehabilitation team can observe: (1) the raw data from the HR of the session in a timeline (with an option to zoom and scale); (2) the real-time monitoring provided for the patient using gradual colors: *blue, green, red* based on the degree of the terms {*low*, *adequate*, *high*}, respectively; and (3) a summarized indicator which evaluates the session using a 4-star scale.
	- **–** Synchronization of the parameters of the next sessions from the CRP, which are defined by the cardiac rehabilitation team and are collected in the web server, in the mobile device using a web service under wireless network technology (3G/4G or WiFi).
	- **–** Updating the the parameters of sessions from the mobile device into the wrist-worn wearable device using an ad-hoc Bluetooth connection.
	- **–** Monitoring the session in the wearable device with regard to the CRP providing a real-time monitoring by means of showing (1) the current HR of the patient; (2) the target HR; (3) a graphical evaluation using gradually changing colors *blue, green, red* based on the degree of the terms {*low*, *adequate*, *high*} respectively; and (4) the time of session and the graphical time progression in proportion to the proposed duration.
	- **–** To synchronize the data of sessions, which contains the monitoring and raw HR, from the wrist-worn wearable device into the mobile device using an ad hoc Bluetooth connection.

Images from wearable, mobile, and web applications are shown in Figure 4, where we detail the evaluation and real-time monitoring developed under the methodology described in Section 2 by means of the technological components of the approach.

**Figure 4.** Pictures of the wearable, mobile, and web applications. In the wearable application in Polar M600, we show (1) a gradual color change in the evaluation of the HR; (2) progression and total time; and (3) the current and reference HR. In the mobile application, the *VT*<sup>1</sup> , *VT*2, *r* ∗ <sup>+</sup> and *r* ∗ <sup>−</sup> thresholds and the 4-star evaluations are described. In the web application, the cardiac rehabilitation team has access to heart streams and *VT*<sup>1</sup> , *VT*2, *r* ∗ <sup>+</sup> and *r* ∗ <sup>−</sup> thresholds of patients with zoom and scale options.

Polar M600 (https://www.polar.com/us-en/products/sport/M600-GPS-smartwatch) was chosen as an Android Wear device due to the high-quality optical heart rate monitor. The strength specifications of Polar M600 include : (1) optical heart rate measurement with six LEDs; (2) its waterproof nature (IPX8 10 m); (3) low weight (63 g); (4) reduced dimensions (45 × 36 × 13 mm); and (5) long-life battery (500 mAh Li-pol for a 2-day average uptime per charge or 8 h of training).

Based on the further evaluation of [43], Polar M600 is highly accurate. The HR value is ±5 bpm or less from the ECG HR value during periods of steady-state sports (cycling, walking, jogging, and running), which are the focus of cardiac rehabilitation. However, the accuracy was reduced during some intensity change exercises. No statistically significant was found in this sample on the basis of sex, body mass index, VO2max, skin type, or wrist size.
