**2. A development platform for supporting smart and pervasive healthcare**

xCARE is a platform that has been defined and implemented for supporting the development of smart and pervasive healthcare systems. It has been conceived in a very generic way in order to be adapted to any kind of scenarios. In fact, the "x" in its name means that it can be adopted and adapted for any application in the

<sup>1</sup> https: //www.connecare.eu/

<sup>2</sup> https://eithealth.eu/project/paprika/

<sup>3</sup> Funded by ACCIÓ Pla de Recerca i Innovació 2019/2020

<sup>4</sup> Compra Pública Innovadora or Pre-Commercial Procurement, co-financed by Fundació Salut Empordà and the Catalan Department of Health

#### *xCARE: A Development Platform for Supporting Smart and Pervasive Healthcare DOI: http://dx.doi.org/10.5772/intechopen.95951*

healthcare field. xCARE can be easily customized and adapted to develop system for: patients' self-management; health-status monitoring and follow-up; allowing communication between patients and healthcare professionals; monitoring dailylife activities; integrating wearable- and medical-devices and gathering data from them; as well as giving recommendations and nudges to patients, citizens, and healthcare professionals to support behavioral change.

The microservice approach has been adopted since microservices enable software to be divided into modules, making it easier to change and to adapt it. **Figure 1** sketches the overall platform. It is composed of a set of microservices each of them in charge of performing a simple task. Complex tasks are achieved by the collaboration, interaction, and coordination of one or more simple microservice. In the Figure, connections between microservices are shown to point out those that cooperate together to reach complex goals. When changes are needed in a microservice, they do not affect the rest of the system. Moreover, when a new functionality is required, a new microservice (or a set of them) is defined and simply added to the system. In doing so, the proposed solution is robust to changes and improvements.

Each microservice is completely independent of the actual system that will use it. In this way, a set of microservices has been implemented and it is already available (e.g., for monitoring physical activities, for taking measurements from medical devices, for following up drug prescriptions). If the actual system needs one or more of the already-implemented microservices, it/they will be used "as is" as bricks to build the system. On the contrary, if the actual system needs to rely on a new functionality for which there is not a corresponding microservice, the new microservice will be defined from scratch in a very generic way to be used in the system and to leave it available in the generic xCARE platform for the development of further systems.

In order to locate the microservices, *Netflix-Eureka* service discovery is adopted 5 . Eureka is a REST based microservice for locating microservices with the purpose of load balancing and failover of middle-tier servers (the Eureka Server). Eureka also comes with a client component (the Eureka Client), which makes interactions with the microservice much easier. The client also has a built-in load balancer that does basic round-robin load balancing.

As a front door for all requests from the front-end and the microservices, we rely on *Netflix Zuul*<sup>6</sup> . Zuul is the front door for all requests from devices and websites to the backend of the Netflix streaming application. It is built to enable dynamic routing, monitoring, resiliency and security. It uses a range of different types of filters that enables to quickly and nimbly apply functionality to the edge microservice. These filters help performing the following functions: authentication and security, identifying authentication requirements for each resource and rejecting requests that do not satisfy them; insights and monitoring, tracking meaningful data and statistics at the edge in order to give an accurate view of production; dynamic routing, dynamically routing requests to different backend clusters as needed; stress testing, gradually increasing the traffic to a cluster in order to gauge performance; load shedding, allocating capacity for each type of request and dropping requests that go over the limit; and static response handling, building some responses directly at the edge instead of forwarding them to an internal cluster.

Management of roles, rights, authentication control, and login is implemented by relying on Spring Cloud Security7 . It offers a set of primitives for building secure applications and services with minimum fuss; as well as a declarative model

<sup>5</sup> https://github.com/Netflix/eureka

<sup>6</sup> https://github.com/Ne5tflix/zuul/wiki

<sup>7</sup> https://cloud.spring.io/spring-cloud-security/

#### **Figure 1.**

*The xCARE development platform at a glance.*

which can be heavily configured externally (or centrally) and lend itself to the implementation of large systems of co-operating, remote components, usually with a central identity management service.

The front-end fully depends on the actual final system and the corresponding user-requirements and application. Different kinds of front-end can be developed: mobile apps, especially for patients, carers, or citizens who want to self-manage their status or activities; web apps, mostly for professionals that need to follow-up patients during an intervention; or desktop solutions to closed-system that need to directly interact to other systems, as for instance hospital information systems.
