ON DEVELOPMENT OF INFORMATION SYSTEM FOR EMERGENCY MEDICINE BASED ON MICROSERVICES ARCHITECHTURE

The work is devoted to presentation of microservices approach for development of information system for emergency medicine. Implementation is based on usage of Spring, Spring Boot and Spring Cloud frameworks.


Introduction.
A variety of approaches and techniques are used when developing information systems for medical practice and research [1-12, 17-20, 23].
Primarily they are based on so called monolithic architecture.In such case you are developing a serverside enterprise application.It must support a variety of different clients including desktop browsers, mobile browsers and native mobile applications [22].
In turn Microservice is a paradigm that serves for organization and usage of distributed services that can have different proprietors.The basic idea of this architectural approach was stated by Martin Fowler in 2014 in [16].
Microservices allow large systems to be built up from a number of collaborating components.It does at the process level what a lot of frameworks (e. g., Spring) has always done at the component level: loosely coupled processes instead of loosely coupled components.
Many technologies and the protocols that are created to realization of business processes [15] and their support are included in the content of widely understoodable microservices architechture.Those technologies together create powerfull instruments for: • implementation of business processes; • opening for access to the client for different type of services through a network; • seeking out of services (UDDI Universal Description, Discovery of and of Integration); • uses of services through a client; • determinations of business processes with help of languages of determination of flow of problems and creations of complex services.Mentioned above possibilities of microservices technology and in particular arrangement of services in greater processes are as background of application of microservices to the construction of the system of medical information services.However at the market there is a shortage of such solutions now.
Composition of services in microservice architecture results in combining of separate services (WS, Web Service) in a structure named by a process that describes the algorithm of implementation of series of services.In order to do it, possession of the detailed information on motion of process is needed (before it will be determined).
In case of emergency medicine service the detailed determination of tasks is not possible.Reason is unpredictability of motion of incident and also factors that influence on flow of possible treatment scheme: • number and state of health of patients; • variety of services that belong to many health establishments; • dynamics of patient state can change in the process of implementation of treatment; • accessibility (primarily distance) to healthcare establishments for patient.We can divide those factors into two groups: 1) information on state of patient previously known.
It should be known from the point of view of healthcare, e. g. patient passport data, health assessment, previous histories of diseases and so on; 2) exceptional/change of certain factors.It can be instant change of well-known or unknown previously factor, e. g.: fracture, blooding, emergency etc.It all causes that the detailed setting by default, how procedure of emergency medicine should look like, is impossible.Moreover, settings are not possible usually, how must be conducted healthcare in situation, when this situation will arise up already.The reason of that is a typical shortage of sufficient data during undertaking of action, since at the beginning of healthcare as a rule we don't have possibility to deliver accordingly exact data [21].
The objective of this paper is to present the way of application of Microservices architecture for the problem of development of information system for emergency medicine.
Potential problems that touch an emergency medicine and idea of construction of the system that basing on the paradigm of Microservice forms separate healthcare services into one coordinated healthcare process, will be presented in the paper.The offered solution means to determine dynamically process without detailed definition from point of view of the whole action.When basing the behaviors on typical charts, the system executes certain introductory steps.During their execution, additional data on the basis of the system for determination of further actions are gotten.As far as progress of emergency medicine action gets each time more detailed data dealing with certain case and necessary actions, a process is being specified in the process of implementation.

Materials and methods. Conception of solution of problem of emergency medicine.
Consider that on a certain street in city accident has happened.In accident a dozen of car passengers damaged.Many people feel damages and need emergency medical assistance.
From the point of view of rescue services a problem is difficult for the solution, because information about a case is usually inexact on this stage: it is unknown, how many people are injured and how their damages are serious, how many coaches are needed on the place of accident, how many places in a hospital needed to be prepared to give a help for injured.
We need fast and well-coordinated rescue action.Human factor can lead to errors under such circumstances that can influence on saving life of injured ones.In this situation it is the best to dispose of the certain system able to manage a rescue action, liquidating the errors related to the emotions, by work in stress and necessity of the rapid reacting.
Possibility of support of rescue services is convenient here through the computer system that has an access to all well-known information about a case that is capable efficiently to plan actions on the basis of all well-known data, is able dynamically to adjust actions to the changeable conditions and also to coordinate the actions of elements of different services.Requirements for information system.In ideal case system that would solve the above-mentioned problems that arise in rescue medical service should be able: • to give independence to the different elements that are his constituents; • to do possible a suggestion of its own services in the system; • to do possible composition of component services into more complicated one such as a complex service for injured person.Main principle is opening for access of actions of medical services as network services of web-service at application of paradigm of microservices.
The system implements its task through a construction of a skeleton of process on the initial stage.Then as far as the flow of additional data will grow gradually, it allows corresponding adaptation of actions to the queries for concrete case.
Basic services of emergency medicine.For the purpose of development of the system we need to determine the basic complete set of services that will be able to serve to creation of arbitrary rescue action.It seems that determining a complete set of services in emergency medicine is impossible, taking into account a fact that together with development of medicine there will appear new services that should be taken into account during composition.The reasoning requires determining certain standard of description of services, that enables development of new ones in future instead of attempts of determination of complete base that is necessary for system running.Examples of services that will be taken into account when developing rescue action are: Arrival of ambulance to the place of incident (ArrivalToPlaceOfIncident) is simple service that means arrival of ambulances to the given place of incident.It includes arrival to the place of case; Hospitalization of injured persons (HospitalizationOfPatient) is service that consists of the acceptance of patient to the hospital and the delivering corresponding help to him.
Transportation of patient (TransportationOfPatient) is service implying the transportation of injured patient to the hospital.
Results.In this part of the article there will be presented an example of problem solution of emergency medicine action using basic set of services mentioned above (fig.1).
Let's consider that a travelling accident happened and casual witness is calling on a line.Operator of line inputs the system data concerning the case, after that the system begins processing the case immediately.
We imagine an online emergency medicine service with separate microservices for arrival-to-place-ofcase, hospitalization-of-patient and transportationof-patient.
Inevitably there are a number of moving parts that we have to setup and configure to build such a system.How to get them working together is not obvious-we need to have good familiarity with Spring Boot since Spring Cloud leverages it heavily, several Netflix or other OSS projects are required and, of course, there is some Spring configuration "magic" [13].
Service Registration.When you have multiple processes working together they need to find each other.If you have ever used Java's RMI mechanism you may recall that it relied on a central registry so that RMI processes could find each other.Microservices has the same requirement.
The developers at Netflix had this problem when building their systems and created a registration server called Eureka ("I have found it" in Greek).Fortunately for us, they made their discovery server open-source and Spring has incorporated into Spring Cloud, making it even easier to run up a Eureka server.Here is the complete discovery-server application: By default Eureka runs on port 8761, but here we will use port 1111 instead.Also by including the registration code in my process I might be a server or a client.The configuration specifies that I am not a client and stops the server process trying to register with itself.
Try running the RegistrationServer now.You can open the Eureka dashboard here: http://localhost:llll and the section showing Applications will be empty.
From now on we will refer to the discovery-server since it could be Eureka or Consul.
Creating a Microservice: Arrival-to-Place-of-Incident-Service.A microservice is a stand-alone process that handles a well-defined requirement.
When configuring applications with Spring we emphasize Loose Coupling and Tight Cohesion, These are not new concepts (Larry Constantine is credited with first defining these in the late 1960s [14]) but now we are applying them, not to interacting components (Spring Beans), but to interacting processes.
In this example, we have a simple Arrival-to-Place-of-Incident (Incident) microservice that uses Spring Data to implement a JPA IncidentRepository and Spring REST to provide a RESTful interface to incident information (fig.2).In most respects this is a straightforward Spring Boot application.
What makes it special is that it registers itself with the discovery-server at start-up.Here is the Spring Boot startup class: @EnableAutoConfiguration @EnableDiscoveryClient @Import(IncidentsWebApplication.The annotations do the work: 1. @EnableAutoConfiguration -defines this as a Spring Boot application.2. @EnableDiscoveryClient -this enables service registration and discovery.In this case, this process registers itself with the discovery-server service using its application name.3. @Import( Accounts WebApplication.class)-this Java Configuration class sets up everything else.What makes this a microservice is the registration with the discovery-server via @EnableDiscoveryClient and its YML configuration completes the setup:

Conclusions.
In the work an innovative approach to construct business process is presented.In opposite to typical application where the process is completely determined before its starting in this case process is not completely determined at the moment when its running is started.It is implemented using service that can be presented as handler for another process.That service composes process based on data obtained and runs it.
There is some lack of solutions for the problem presented.Although Microservice approach offers tools leading to development of system supporting emergency medicine.An advantage of the system offered is its usage based on mechanism of market.All services are searched through Internet.Moreover any institution can add its own service and in turn to join to the system.
It is not entirely known mechanism of integration of processes in emergency medicine.One of the most promising possibilities is application of Micriservices.Methods of search of appropriate services will be object of future research.In such case an application of ontological descriptions can be solution of the problem.Also the future investigations should be dealing with document formats for exchanging by the system elements, identification of basic services and taking into account economic factors when selecting services for patient.

Fig. 1 .
Fig. 1.Problem solution of emergency medicine action using basic set of microservices
.setProperty («spring .config.name»,«registration-server»); By default Spring Boot applications look for an application.propertiesorapplication.ymlfilefor configuration.By setting the spring.config.namepropertywe can tell Spring Boot to look for a different file -useful if you have multiple Spring Boot applications in the same project.This application looks for registration-server, properties or registration-server.yml.Here is the relevant configuration from registration-server.yml: ISSN 1996-1960.Медична інформатика та інженерія.2017,№1МЕДИЧНА ІНФОРМАТИКАТА ІНЖЕНЕРІЯ