**3.1 The multilingual sensing network (MSN)**

In **Figure 1**, we present the building blocks of the MSN network. The MSN consists of Apache Camel module. This module implements ActiveMQ Artemis, REST API, and Apache Kafka. In this way, we implemented specific machine-tomachine (M2M) communication between several services. The ActiveMQ Artemis module is then used for the MQTT broker. And Apache Kafka module is used for microservice architecture. The Apache Camel module is like a router in the system, since it has the ability to convert asynchronous to synchronous messages, or vice versa. We can run Apache Camel module also as a Spring Boot application in order to provide REST API end points for all HTTP requests. The MQTT broker in the system represents a link between mHealth app and OHC. Namely, the mHealth app is MQTT client that is just subscribed to ActiveMQ Artemis module. Further, microservices are using HTTP APIs and Kafka topics. For microservices, asynchronous communication is used. All predefined topics for dedicated language are supported. The synchronous communication is then used for RASA chatbot. In this case, HTTP REST requests are used and performed via Camel REST end points API.

In **Figure 2**, we can recognize two types of connections. The first one represents the synchronous connection used for communication over the secured application protocol HTTPS REST. It is needed for questionnaires, responses, and requests. The second one is then asynchronous connection. It is needed for the MQTT protocol, where we use MQTT topics. Established connections with the OHC platform can use

**Figure 1.** *The architecture of the PERSIST system.*

*Multilingual Chatbots to Collect Patient-Reported Outcomes DOI: http://dx.doi.org/10.5772/intechopen.111865*

#### **Figure 2.**

*Machine-to-machine communication (M2M) platform for the PERSIST system.*


#### **Figure 3.**

*Patient (left) and clinician (right) mHealth app interface.*

in this way synchronous HTTPS REST protocol. Further, MSN internal connections uses MQTT, Camel Java Messaging Service (or JMS), Kafka topics, and REST.

#### **3.2 mHealth application**

As can be seen in **Figure 3**, patients and clinicians have separate mHealth applications. One is patient mHealth application that is used for data gathering and trends monitoring, while the clinician mHealth application is used for patient monitoring and specifying the patient's care plans (developed by company Emoda). The first one enables mood selection, diary recordings, reading of specific articles advised by clinicians, etc. And the second one has options to see the patients' lists and their clinical details. It is also possible to delete or edit existing patient records, or create a new one. Further, new appointments can be created by clinicians, receive notifications from patients, see the calendar, or just send/receive messages from patients. Thus, this application uses both asynchronous and synchronous protocols. We use the REST protocol for communication with the MSN REST OpenAPI (Swagger) and OHC end points, and for receiving notifications the MQTT protocol is used.
