# Implementation of Context Aware e-Health Environments Based on Social Sensor Networks
## 3 Social Sensor Devices
* Core: This is the most important element and includes all the software modules required for the management of layers, and the communication from one layer to each other. * Plugins: This element represents all the software modules that can be connected to the platform in order to add features. The following are the main plugins. * Agents: These plugins are used to wrap connections between source and destination. The agent must be provided with a socket for performing a connection; thus, the socket makes the communication between the device/sensor and the back-end system possible. In addition, the agent provides its own services and methods: installation, open/close a connection, abort a connection, _etc._
* Transports: These plugins provide the different sockets required for agents. Obviously, the software architecture is able to use any implemented transport plugin, although NASISTIC software includes the following: Internet transport based on HTTP and TCP/IP protocols, and Bluetooth transport based on bluecove library. * Manager: This plugin registers the communication source and destination. These are kept in mind by the client application together its associated active agents. The manager also allows the client to establish a communication with any installed source/destination, or listen to incoming communication through any running transport. The back-end's architecture, depicted in Figure 6, is formed by several logical elements and abstraction layers. The following are the main blocks. * The Spring Framework and Spring MVC (_Model-View-Controller_) allow the development of flexible and highly connected web applications. * View layer: This layer provides the user interface according to the client request by means of the ZK library. This library provides an AJAX web framework in order to create a user interface through JAVA programming. In this way, it is possible to develop an environment with RIA (_Rich Internet Application_) features. The view layer also performs the data transmission to final client. The format used in the transmitted information is JSON (_JawaScript Object Notation_). * Controller layer: It validates the data received from client, and selects the appropriate view for showing them. * Data access layer: This layer is based on DAO (_Data Access Object_) elements and consists of two main logical blocks: the Java Persistence API focused on the management of persistence and objects mapping, and the Spring-ORM (_Object Relational Mapping_) module, which performs ORM container tasks. Figure 5: Software architecture for the gateway node device. The architecture also includes a web-service layer for showing the measurements acquired by sensors. Afterwards, this information can be analyzed and exploited by the own back end system. This layer implements a REST (_Representational State Transfer_) web service. This simple technology has been selected for several reasons: simplicity of implementation in both client and server side, scalability in number of clients, and reduction of interaction latency between client and server, among others. A real monitoring scenario for evaluation purposes based on social and health sensors is depicted in Figure 7. The scenario is a home monitoring service where the user's health and environment status is continuously acquired and received by a set-top box. The user's information is later transmitted by this gateway device to a remote call center in order for it to be displayed, stored, or analyzed by specialist staff. The system consists of multiple acquisition sensors; some of them (portable health and social sensors) are placed at fixed locations, and others (wearable health sensors) are worn by the user. Concerning wireless communication and processing capacity features, these acquisition sensors could be implemented with no particular restriction with the evaluation module's hardware introduced in this paper. Consequently, the real sensors should implement only a specific acquisition and conditioning block according to the type of measurement that will be taken.