Multi-Agent System for Post-Stroke Medical Monitoring in Web-Based Platform

Stroke is an injury to blood vessels in the brain and affects their cells; this causes the person to lose the functionality of their body and autonomy. The rehabilitation involves a set of activities for the medical specialists, that is, to have a strict control in the care of the patient, which includes the diets, therapies and ingestion of drugs so that the recovery of the patient is carried out in an optimal way and can be reintegrated into their family, social and work environment. This means that achieving communication and coordination among the members of the health area represents a problem; there is no established structured control plan and physicians need to modify them to adjust to the new situation, which is in accordance with the patient clinical needs. Thus, finding a solution to this problem becomes extremely important and, in this work, we propose a multi-agent system for post-stroke monitoring aimed at medical specialists. The main objective of this research is to communicate and coordinate the follow-up of the patient for the reduction of the damages caused by the stroke using the theory of artificial intelligence agents. The results of this research include the multi-agent system in web-based platform, description of the agents and finally, the implementation of the web system oriented to medical specialists.


Introduction
Stroke is a lesion caused by the obstruction or reduction of blood flow within an artery in the brain, leaving it without oxygen, and without the necessary nutrients, making the brain cells are affected, or to a greater degree they die. Stroke is a medical emergency because, when not treated in time, the person can suffer from multiple consequences (Motivar & Correa, 2011). According to American Stroke Association, strokes are the second leading cause of death in the world. In addition, 3 out of 10 stroke survivors may have another stroke, 1 in 8 spills are fatal within the first 30 days, 1 in 4 spills are fatal within a year. Depending on the damage caused by the stroke, the patient will need a rehabilitation. A rehabilitation is not a cure. However, a treatment helps to reduce the damage caused by the injury and improve the condition of the patient. The main objective of rehabilitation is to help facilitate patient independence to achieve reintegration in their family, social and work environment. It may require different areas of therapy, such as language, body and spatial perception, balance, psychological and emotional assistance. Carried out with the intervention of professionals specialized in the area of health (Sá nchez & Castro, 2018) Within the protocol of discharge of a patient who has suffered a stroke, medical specialist in rehabilitation, is the one that determines the necessary work team, the plan for the follow-up of the patient, as well as the frequency of the appointments so that their recovery is optimal, but, this goes according to individual clinical needs. Therefore, there is no structured control plan established for coordination and communication. In order to carry out the control over the care of the patient, the coordination of a team of health professionals is necessary (Callejas, Parada, & Alarcón, 2012). In addition, it is necessary that specialist have a continuous communication so that the patient has an optimal progress in their evolution against the scale of a stroke. However, this represents a problem because each professional has a role within their work, and it is difficult to achieve communication and coordination of the team, that is, a structured control plan during the rehabilitation of a patient, having consequently the impediment of the progress of this.
Nowadays, technologies are involved in activities to solve needs that are present in everyday life and in different areas of education, industry, communications, even health. Society has reached a point where it is necessary to automate processes make them more effective, faster, economic that is where the new models of production and social transformation based on the use of technology (Yanahuaya, 2016;Morales, Rí os, & Londoño, 2014). Artificial Intelligence (AI) is a branch of computer science, which builds computer systems to perform tasks through artificial elements that have an intelligent behavior and have ability to adapt to different environments that change constantly.
This approach aims to solve specific problems as if experts in the area carried them out. Within Artificial Intelligence, there is an approach focused on creating intelligent, dynamic distributed systems that have the capacity to reorganize functions and adapt to environments, called Multi-agent Systems (SMA). Agents are motivated entities (Russell & Norvig, 2004). They are autonomous and intelligent programs that perform functions based on their environment, also, they are social entities, thus forming the SMA (see Figure 1) In SMA, the developer has to think about what objectives the components must reach. Instead of modeling a system with components executing methods, such as in object-oriented programming. This presents a strong advantage over traditional programming paradigms (López, Herná ndez, de Oca, & Leyva, 2018)  On the other hand, web platforms are a software tool such as a web page, but with the advantage of providing services and solutions, and are able to communicate and distribute information through servers with the help of the Internet, in other words, a distributed system. Web platforms use a system construction where a specific model is usually the object-oriented model in these platforms. Though they are not dynamic systems, they allow the fulfillment of their objectives. Multi-agent systems have worked with web development in conjunction as a new technological trend and their capabilities to solve problems that require coordination and communication go beyond the object-oriented model and allow the development of more flexible systems capable of adapting to changes in the environment. The main objective is to create appropriate solutions in the area of medicine that lead towards the achievement of the proposed goals, thus improving processes in different aspects, such as keeping track of the services provided, storing and obtaining data from a patient.
Undoubtedly, a web platform based on a multi-agent system will help doctors to have a better record and control of activities during the treatment after a stroke. It will improve communication and coordination within the work group. In other words, the platform will allow the Specialized Physician in the area of Rehabilitation to define their work group before rehabilitation, and thus, share information about the services and methods the patient needs for their recovery.

Related Works
Below, research projects that describe the connection that exists between systematization and artificial intelligence techniques in the area of health care are presented. Framework for the Implementation of a Telemedicine Service Project by Pan American Health Organization & World Health Organization (2016) proposes the use of Information and Communications Technology (ICT) in the health care area as a means of innovation to transfer medical information with a diagnostic, therapeutic, and educational purpose, to provide health attention services, where distance is a critical factor, contemplating four essential strategies that should be adopted:  Remote assistance services.
 Patient administration management services.
 Distance training for professionals.
 Evaluation and collaborative research network.
Another approach is presented by (Reyes & Rivera, 2011), who propose a medical system to make a pre-diagnosis of neurological diseases by means of a multiagent system; for the design of the multiagent system they use the INGENIAS methodology which employs five aspects (the agent, the organization between agents, tasks and objectives, interactions, and the environment), the software platform, the development of JADE (Java Agent Development Framework) agents, and the decision tree algorithm to evaluate the classification of results. As a result, a multiagent system is obtained which is composed of the interviewer agent, the data agent, the broker agent, and the pre-diagnosis agent.
In work by (Sanchez & Castro, 2016), it is proposed to generate a web prototype to manage the administration of patients' medical records, which also contemplates the interoperability between health information systems. The architecture is supported by the software platform JADE (Java Agent Development Framework), with a distribution support and parallelization of medical files which include images that comply with the DICOM format (Digital Imaging and Communications in Medicine). (Safdari, Malak, Mohammadzadeh & Shahraki, 2017) model a multiagent architecture, to manage the interconnection of hospital elements that are involved in the process of pre-hospital attention, with intent to obtain systematized means that work as support in the intelligent decision taking. The development was carried out using modelling by means of the sequence diagram in Rational Rose software, obtaining as a result a multiagent system that is composed of EMS Center, ambulance, traffic station, medical attention provider, patient, consultation center, national system of medical records, and monitoring agent of service quality.
Finally, (RameshKumar, Viswanathan, 2019) develops an expert system that employs the multiagent system philosophy for attention in real time, contributing to the register of patients' vital signs remotely. The multiagent system is basically composed by the supervisor agent, the patient agent, the local clinic agent, and the specialist doctor agent. For the patient register it has an application composed of two graphic user interfaces in which the patient's vital signs data is added or answers are received, which are evaluated by a suitable specialist with the possibility of activating an attention alarm. The medical information center is used to carry out the data analysis and the patient's health management in real time. The caretaker terminal is used for the person in charge of taking care and also so that the specialists maintain communication and take decisions regarding a work plan. The instant consultant has the capacity of emitting recommendations to the patient. The multiagent system was developed in the software Java Agent Development Framework (JADE) platform.

Method
We analyzed and identified interactions between agents based on the needs of the multi-agent system. In addition, we identified communication protocols to achieve coordination between agents. Furthermore, the necessary components for communication defined, in other words, the artificial intelligence algorithms that manage to establish a better communication and coordination within the agents. On the other hand, the different activities and functions that the web platform needs for the accomplishment of the project's objectives identified. Subsequently, the multi-agent system developed based on the previous analysis. We estab-lished coordination and communication between the agents according to the needs of the web services and developed the web platform satisfying the criteria that doctors need to have a good communication and coordination, according to a previous analysis. As a final part of this solution proposal, the multi-agent system integrated into the different services provided by the web platform. This procedure is shown in Figure 2.
The methodology consists in four phases: requirements, preliminary design, detailed design and deployment.
1. Phase 1 -Requirements. Based on a methodology build on an agent-based system, the necessary models we obtained for the monitoring of patients with stroke, of which there are:  Domain model. It contemplates the interaction of doctors within the web platform, as well as the management of data and communication between agents.
 Model of use cases. Where is shown an overview of the platform and the respective services it provides. In addition, the relationship that indicates the sending of information among physicians is established  Prototypes of interfaces. Designed to assist in the identification of necessary services.
2. Phase 2 -Preliminary Design. In this phase, we obtained a use case file from each of the cases; it contains a name, a description, a precondition that agents must know before starting, and a post-condition that agents must achieve upon completion if it ends correctly.
 Description of use cases.
 Robustness diagram. This tool allows us to capture what to do and how to do it. We made a Robustness diagram for the services contemplated in the web platform.

Phase 3 -Design:
 Identification of types of agents.
 Identification of possible interactions between types of agents.
 Identification of the necessary components.
 Definition of coordination protocols for each type of interaction.

Phase 4 -Implementation:
 Development of the web platform with the necessary services.
 Development of a multi-agent system with the necessary components based on the functions of the platform.
 Integration of the multi-agent system in the web platform.

Results
We describe the functions, which agents do. In this research, there are four agents: 1. Interface agent. Observes and interprets the actions that the doctors perform. In addition, he coordinates the multi-agent system and sends the obtained information to the assistant agent and manager agent to process it.
2. Assistant agent. Registers, consults and stores the information about doctors and patients made by the interface agent and sends the information to manager agent.
3. Manager agent. It receives and interprets the information sent by the assistant agent, decides the actions it performs with the records and manages the requests made by the agent interface. On the other hand, it establishes the connection with agent comunication to carry out sending and receiving data with a mobile application.
4. Communication agent. It allows sending and receiving data with a mobile application, using Agent Communications Language (ACL) as communication protocol.

Multi-agent Architecture
The proposed architecture for the system based on a research, where four agents exist: assistant agent, manager agent, agent comunication and agent interface. You might observe on the left side, the database that link to the assistant agent, and will be in communication with the manager agent and agent comunication. The agent interface is within web platform, which is the agent that coordinates the multi-agent system and receives instructions from the doctors in the web platform generated (see Figure 3).

Data Model
The data model in Figure 4 represents how doctors saves the necessary information.

Multi-agent Architecture on Web Platform
The Figure 5 shows how the communication between multi-agent system and web platform works; we establish servlets to connect the interface agent to web platform.

Figure 5. Multi-agent architecture on web platform
It works based on the model, view, controller model that works with three layers: 1. Model. It is the layer where we work with data; in other words, it is where the Gateway agents store their data. They will show when they need.
2. View. It is the interaction of the doctor with the data through a user interface, allows the collection and presentation of information, in other words, this is where you have the HTML code.
3. Controller. It is the link between the Model and the View, this is where we can find the Servlets that will help the agents to show the information and to the platform to store the required data.

Discussion
We presented a multi-agent system for post-stroke monitoring oriented to medical specialists based on the web, which allows a group of physicians to store and share information about the patient's situation, it means, having the control and monitoring of patients who have had a stroke. The designed platform consists in four main modules: 1. Registry of the persons: It allows the registry of the medical specialists who will be involved with the patient's follow-up, and the patient who has suffered a stroke; before the arrival of the patient with stroke. This web platform shows a great support towards the doctors. Since it allows them to have more knowledge about what happens to the patient, without having frequent contact with the patient. Supporting doctors in the decision-making, since the group of doctors is, they will be able to communicate. In addition, sharing the information with each other, that is, all the information about the patient will be stored on the platform where everyone can see the current situation, having consequently a better control over the progress of a patient with stroke.