MediCare System – A social media platform for Iraq environment

During the mobile technology's global expansion, the widespread use of internet-enabled smartphones on all countries and especially in Asia Minor/Iraqi community has increased dramatically, as mobile applications became a key area of interest among physicians and patients in this society. Also, there are applications available that help healthcare providers, but these applications have limited possibilities and don’t have communication, monitoring, or other functions of healthcare. Physicians and patients turn to social media applications in the healthcare process. If we speak about Asia Minor, especially Iraq there are very few applications and related research that facilitates electronic health. Therefore, due to the conditions and requirements of the Iraqi health environment a healthcare solution called "MediCare" system that provides a medical social platform that facilitates interaction between hospitals, clinics, physicians, and patients has been developed. In this paper we present the implementation of the MediCare system together with its general architecture.


Introduction
Healthcare organizations seek to develop Web and Mobile applications for the mobile healthcare environment to facilitate communication between users (patients and medical staff) while improving healthcare services, quality, and safety [1].
In addition, the lower prices and advancements in the software and hardware capabilities of portable medical devices, bracelets, and smartphones, have contributed to a large expansion of the mobile technology and related industries. Besides, modern smartphones and computers have greater computing power, GPS sensors, and permanent connectivity to the internet and wireless networks [2]. This has led to the development of a large number of health apps over the last few years [3]. Smartphones, mobile applications, computers, and web applications have brought physicians' attention, as well as patients' worldwide, as the medical and patient-oriented applications available on these devices enable the physicians at the care point to get the information needed for diagnosing, treating, and controlling different patient's health conditions and diseases [4].
During the mobile technology's global expansion, the widespread use of internet-enabled smartphones on all countries and especially in Asia Mino/Iraqi community has increased dramatically, as mobile applications became a key area of interest among physicians and patients in this society [5]. Also, there are applications available that help healthcare providers, but these applications have limited possibilities and don't have communication, monitoring, or other functions of healthcare. Physicians and patients turn to social media applications in the healthcare process [6]. If we speak about Asia Minor, especially Iraq there are very few applications and related research that facilitates electronic health. Therefore, due to the conditions and requirements of the Iraqi health environment a healthcare solution called "MediCare" system that provides a medical social platform that facilitates interaction between hospitals, clinics, physicians, and patients has been developed.
In this paper we present the implementation of the MediCare system together with its general architecture. We organized this paper as follows: Section III presents the architectural description. Section IV presents the implementation of the Medicare Android Application. Section V presents the implementation of the Medicare Web Application. Section VI presents the implementation of the Health News API. Section VII specifies the database of the system. Finally, section VIII concludes the paper.

Stateoftheart
In this section we describe the related work.

A. Related work
In what follows we present similar system and how we differ from them.
The paper "A smart watch based health monitoring system" written by Yang Gu, J Shen and Y Chen[18] presents a system based on a self-developed smartwatch with physiological sensing ability, supporting health data gathering, and health monitoring. The smartphone software was implemented based on the developed smartwatch. This software system together with the hardware can collect health data and monitor personal health regarding physiological measurements.
In the study called "An Android Application for Geolocation Based Health Monitoring, Consultancy And Alarm System" written by Emre O. Tartan and CebrailCiflikli[19], a remote health monitoring system is developed based on an Android operating system. This system benefits from the facilities provided by smartphone technology and presents a heart rate monitoring system based on the user location. This Android application can send a notification through SMS, email, and allows messaging with a health specialist for consulting. If the application observes variability, in heart rate, during the outdoor activities, emergency information can be delivered in the shortest time and the delays which have crucial effects can be prevented.
The paper "Development of Monitoring and Health Service Information System to Support Smart Health on Android Platform" composed by A'isya N. A. Yusuf,Fitri Y. Zulkifli and I WayanMustika[20], proposes a health monitoring system called MOOBLE (Monitoring for Better Life Experience), a system that can monitor patient's health conditions and prevent diseases as early as possible. Mooble consists of two parts: web application and mobile application on the android platform. MOOBLE is designed to help doctors in monitoring a patient's health conditions and prevention of disease as early as possible and will be used by patients. While using this system, patients can report their health condition based on the level of pain felt at that time. In addition, patients also can see the health condition progress in graphical form. The system also facilitates patient requesting a medical checkup using online medium and see medical treatments provided by the doctor for specific illnesses.
The paper "Conceptual Design of Personal Wellness Record for Mobile Health Monitoring" published by HongSeok Na,YounSik Cho i[21], proposes a conceptual model for managing personal wellness information such as daily activities related to personal health. It also, provides a basis for integrating monitored information from various devices and a mobile health platform ensuring preventive and proactive service. The aim of this paper is to design an open and flexible information structure for personal health and wellness which could be used as a reference data model on mobile health monitoring. In comparison with our solution, the application presented above doesn't work on computers, medical devices and bracelets all together; doesn't provide medical posts and patients, can't communicate in a form of social media. Also, it does not target the Iraqi environment. Similar conclusions can be drawn for other systems that are described in the literature. Therefore, we will stop here. The strengths and weaknesses of the systems described above are shown in Table 1 below.

Architectural Description
The proposed medical social media system (MediCare) has the following types of users: -People/Patient: search physicians before asking for medical advice, read medical posts to enhance their medical knowledge; they can also communicate with physicians through SMS, mobile calls, chat inside the MediCare system or send an e-mail through the system.
-Doctors: monitor the health state of their patients. They can ask for health information regarding their patients, visualize their health logs and offer medical advice to patients. Medical professionals are able to read the most recent healthcare news and publish their own medical advice.
-Administrator: the administrator is responsible for managing the system. The administrator can access the MediCare web application by using a web browser installed on the computer, tablet, smartphone. The administrator uses the dashboard to execute tasks such as creating web pages and modifying them, managing users' publications, studying users' activities, studying impact activity, sending invitations to physicians to join the MediCare system accompanied by a doctor activation code, managing users' powers, whether physicians or ordinary people, supervising site changes and even following-up requests, suggestions and complaints regarding the site. Figure 1 depicts the general architecture of the MediCare software solution as a medical social media system where users can register and add their data by using computers, smartphones or Withings health devices. Also, the system ensures tight communication between physicians and patients and allows the physicians to track the health state of their patients, as well as to give medical advice to users. Medical data is gathered while performing daily activities, which improves the general understanding of a patient's health status. In what follows we will detail on the components of the system A.

MediCare Android Application
The MediCare android application has Android-dedicated user interfaces. It contains several screens, such as login screen, medical info display, posts screen, etc. The MediCare Android Application can be used by doctors and patients. The patient can Register and log in to the Medicare Android application and easily add medical data daily. He can also review his medical information and send it to his doctor or he can use "Withings" medical devices that can enter his medical data registered in these devices directly into the system and then he can review it. Withings will be further explained in section D.
The MediCare Android application can display the patient's medical information in the form of charts according to time, which facilitates understanding of the patient's health status. The patient can review the list of doctors, go to the doctor's profile, read an overview of the doctor's experience, set an appointment, and communicate with the doctor via the chatting screen, sending mobile messages or by calling. The doctor can register and log in to the MediCare Android Application and start communicating with patients using the chatting screen and review the appointments screen where the doctor can read the schedule of appointments for patients.
The "Xamarin Cross Platform" was used to design, develop and debug the MediCare Android application by "Visual Studio". In this way the same C# code, data structures and APIs can be used on Android applications and Web applications [14].

B. MediCare Web Application
The MediCare Web Application was created to provide health services in the Iraqi environment due to the regular usage of computers by physicians and the possibility of using Web applications through computers, tablets and smartphones without the need to setup any extra applications and misuse space on the system. The doctor can register and log in to the MediCare Web Application and start communicating with patients using the chatting page or e-mail page, and review the appointments page where the doctor can read the schedule of appointments and make appointments for patients as well. The patient can register and log in to the MediCare Web Application and go to the Add Medical Data page to directly enter his medical data daily, and he can also review his medical data and send it to his doctor. The patient can review the list of doctors, go to the doctor's page, read an overview of the doctor's experience, set an appointment and write to the doctor via the chatting page or e-mail page.
Several technologies, particularly MVC with JQuery, ASP.NET, Bootstrap, and JavaScript, were used to build the MediCare Web Application. ASP.NET MVC is part of ASP.NET which offers a way to classify parts in the development of views by HTML, CSS, and JavaScript. ASP.NET MVC offers many rich and valuable features, such as jQuery, to boost the development of web application [15].

C. API Services
We used API web services as a load protocol. Web services are intended to provide a fast connection between the web application and android application on the one hand, and the database system on the other. As a middleware between the system and the SQL Server database, ASP.NET was used.

D. Withings API services
Withings is a healthcare foundation that provides medical services, such as devices to measure blood pressure, thermometers, smartwatches and scale devices, where the user can connect these devices to mobile phones through the HealthMate application and store data in the Withings database.
Withings manufactures smartwatches, fitness trackers, WiFi Body Scales, Blood Pressure Monitors, and thermometers that provides the user with accurate and reliable temperature readings using 16-sensors, including the activity tracker which is a smartwatch that looks like a conventional wristwatch. The aforementioned Withings devices are controlled by a mobile app that is compatible with Android. The Withings mobile application called Health Mate is associated with most of its health devices and displays user's daily activity by graphs. Users can manually enter data or it can automatically track the user's daily activities such as walking, heart rate, running, and body temperature when the user has a Withings device such as blood pressure monitor, smartwatch and smart scale. It also has the ability to display weight and body mass data entered from Withings wireless scales.
By using API services in the MediCare system, the data can be retrieved via an API provided by Withings for the purpose of storing it in the MediCare system database and displaying it to the user within the system.

E. Health News API
It is an API that brings the latest health news for the purpose of displaying it in the Medicare system. Each news is displayed with its image and details.

F. Database
The MediCare system's data is stored within an SQL Server database and is accessible via web services for Android and web applications. In this MediCare system, the SQL Server database is applied as the database server [16]. All healthcare information for physicians, patients and others is stored in the database server of the system. Numerous tables of various details and types have been used to incorporate MediCare system queries.
Based on the role provided by the administrator, there are two kinds of users, specifically, patient and doctor. For the security portion, encryption is carried out for of all personal information and correlated medical details.
In what follows we will detail on the scenario and the classes that were used within MedCare Application.

Medicare Android Application
The MediCare Android Application has the following scenarios (see below). We will give the correspondent class diagram for each scenario. The actors are: First, the patient who is a user that wants to communicate with physicians and other patients, second, the doctor who is a user of this system as medical professional. In addition, the administrator who has the ability to manage and monitor the MediCare system.

A. New Registration and Login:
The user can join the MediCare system by performing a new registration via email and password from the Android application.
In the registration, the user has to fill the user email address, user password, user confirmation password. The data of a user is registered in this phase of the registration process. After completing the new Registration, the user can add their First Name, Last Name, Age, Blood Type, Gender, Medical Specialty -just for doctors-in the final registration. In case the user is a doctor, they must enter their own confirmation code received from the admin; the confirmation code is sent as part of an invitation to the doctor to register in the Medicare system by the admin via SMS or email. A user needs to use this form for only one time and that is when they start using the application for the first time.
In the Login the user has to fill the two compulsory fields before gaining access to the entire application: the user email address and password. The authentication of the user will be done based on their email and password.
The application will check the registry settings; the username and password will be checked first and if empty the user will be sent to the new registration screen to create a new account, otherwise the log in screen will be displayed to the user. The application checks the access token. If empty (expired), it will display the log in screen to input his username and password, otherwise it will take the user to the home screen. After the success of the authorization and authentication, the user will get the right of access to the application based on the type of user.

B. Publish and Share the Post
The user get the right of access to the application based on the type of user (Doctor, Patient) after the success of the authorization and authentication. The users can use the MediCare Android application to view, read, share or publish medical posts.
When the user chooses "My Activities" from this application list, a screen will display the following tabs: the user can choose "Health News" to view medical publications -which I will detail in section VI-or he can choose "Activities" to read the posts and share or publish a post; the user can also rate and choose like or dislike and comment on a post.

C. Search for Doctor or Friend or Post
The patients can use the MediCare Android application to find a physician who can handle their illness and also can search for other users.

D. Display Profile
Personal information can be entered by the user and displayed, such as First Name, Last Name, Age, Gender, Weight, Blood type, Medical specialization -just for physicians-, as well as add a contact number, personal photo, email and official website. The patients can also use this application to add their medical data such as weight, number of steps, body temperature, blood pressure, heart rate.

E. Request Medical Advice and Write Medical Report
By using the MediCare Android application, patients can ask the physicians for medical advice or an appointment. This is also the place where the patient can review the doctor's profile and choose to book an appointment, to set the date and time of the appointment. In addition, the specified appointment will be stored in the database and appear in the doctor's and patient's profiles.

Figure 2: Appointment
The AppointVM class is associated with the ApiAppointmentServices class by the _apiAppointmentServices variable to store and retrieve appointments details from the database. The AppointVM class and AppointmentTB class process how the patient makes an appointment with the doctor while the GetListAppointmentVM class displays the list of appointments to the doctors and patients. All these classes are derived from Object class.
The Appointment has a fragment of code written in C#.
The code was written to perform the functions of creating and displaying an appointment and the Task<List<GetListAppointmentVM>>GetListAppointmentInfo method displays the appointments by retrieving the details from the database. The ICommandAdduserAppointCommand makes a new appointment and stores the details in the database.
Input The Medical Information The patients can use the MediCare Android application to get medical information automatically from mobile sensors or associate the application by Bluetooth with Withings health devices. The patients can also type the medical information directly inside the application and display it as tables or charts. The patient can communicate with her/his doctor and send medical information.

F. Communication or Chatting
Users can communicate with each other by chatting via the MediCare Android application, sending an email from the application, sending an SMS to the contact number or by calling using the contact number written on the profile screen.

V. MEDICARE WEB APPLICATION
The MediCare Web Application has different scenarios, as illustrated below, where the correspondent class diagram for each scenario is provided in the appendix. a) The user can join the MediCare system by performing a new registration via email and password from the Web application. b) In the registration stage, the user has to fill in the user email address, user password, user confirmation password. The data of user is registered in this phase of the registration process. After completing the new registration, the user can add his/her First Name, Last Name, Age, Blood Type, Gender, Medical Specialty -just for doctors-in the final registration. If the user is a doctor, she/he must enter her/his own confirmation code received from the admin. The confirmation code is sent as part of an invitation to the doctor to register in the Medicare system by the admin via SMS or email. A user needs to use this form for only one time and that is when he/she starts using the web application for the first time.
c) In the login stage, the user has to fill in the two compulsory fields before gaining access to the entire Web application, the user email address and password respectively. The authentication of the users will be done with use of their email and password.
The system will check the registry settings, first the username and password and, if empty, it will navigate the user to the new registration page to create a new account, otherwise the login page will be displayed to the user. The system checks if the access token is empty (expired) and will display the login page to input his username and password, otherwise it will navigate the user to the home page. After the success of the authorization and authentication, the user will get the right to access the Web application based on the type of user.

B. Publish and Share the Post
The user will get the right to access the application based on the type of user (Doctor, Patient) after the success of the authorization and authentication. The users can uses the MediCare Web application to view, read, share or publish medical posts.
The user chooses "Health News" to view the medical publications -this will be further explained in section -5or they can choose "Activities" for reading posts, sharing or publishing a post. The user can also rate and choose like or dislike and comment on a post.

C. Search for Doctor or Friend or Post
The patients can use the MediCare Web application to find a physician who can handle their illness. They can also search for other users.

D. Display Profile
Personal information can be entered by the user and displayed, such as First Name, Last Name, Age, Gender, Weight, Blood type, Medical specialization -just for physicians-, as well as adding a contact number, personal photo, email and official website. Patients can also use this Web application to add their medical data, such as weight, number of steps, body temperature, blood pressure, heart rate.

E. Request Medical Advice and Write Medical Report
"Send a Medical Request to the Doctor": By using the MediCare Web application, patients can ask the physicians for medical advice or an appointment. This is also where the patient can review the doctor's profile and choose to book an appointment, to set the date and time of the appointment and, in addition to that, the specified appointment will be stored in the database and appear in the doctor's and patient's profiles.
Input Medical Information: The user can access the MediCare website to add medical information by typing her/his medical data inside the website and display it as tables or charts. The patient can communicate with her/his doctor and send medical information.

F. Communication or Chatting
Users can communicate with each other through chatting or emailing through the MediCare Website.

Figure 3: Communication
The ChatMainPage class is associated with the Message class by the msg variable. The Message class, the MessgingPage class, the ChatMainPage class and the ChatBindingVM class perform the chat process, while the UsersListPage class and the DoctorsProfilesListPage class perform the display of the list of chatted users.
The Chat has a fragment of code written by C#.
The code shown above is meant to perform the Chatting and the IndexGetListUsersDetails() method and displays the Chat with a particular user while the Task SaveMsg(string ItemList) method stores and retrieves the Chatting details from the database. Moreover, the Task<List<Message>>GetChatConvLSAsync(int idSession) method performs the Chatting session.

Health News Api
The users can use the MediCare system to read medical news whereas the user can choose "Health News" to view medical publications. The "Health News" is an API that brings the latest health news for the purpose of displaying it based on the design of the Medicare system to display each news with its image and details. The ApiResponse class and the Error class are associated with the ErrorCodes Enum by the Code Property. Also, the ArticlesResult class is associated with the Error class by the Error Property. The ArticlesResult class, the article class, the NewsHealthVM class and the Subjects class perform the list of provided health news and display the details of each post, while the ApiResponse class performs the connection with the health news provider.
The health news section has a fragment of code written by C#.
Health news will be fetched from a specific health news website [17] and then displayed in our system with the use of the above code where the GetHealthNewsListAsync method which specifies the health news will display in the system. Also, the user can choose the language of the health news displayed.

Database System
The database stores doctor profile, patient profile, medical history of patient, appointment details, contact details, and medical activities information etc. The relationships used between the above tables are One to One, like the MedInfTB table and UsersTB table, along with the One to Many relationships, such as UsersTB and AspNetUserRoles. The Primary Key utilized between the Id field in UsersTB and UserId, RoleId in AspNetUserRoles.
The database of our system stores all the records of the users, the healthcare organizations, and medical activities. Different tables were created according to the requirements of the system entities and these tables are linked together with the foreign keys. Tables 1, 2, 3, and 4 are typical tables of the system database which are Users Information table, Patient medical information, Posts, and Posts details. Whereas, Patient medical information, Posts, and Posts details tables are linked to Users Information table, which in turn is linked to AspNetUserRoles to deal with Frontend of the system.

Conclusions
During the mobile technology's global expansion, the widespread use of internet-enabled smartphones on all countries and especially in Asia Mino/Iraqi community has increased dramatically, as mobile applications became a key area of interest among physicians and patients in this society [5]. Also, there are applications available that help healthcare providers, but these applications have limited possibilities and don't have communication, monitoring, or other functions of healthcare. Physicians and patients turn to social media applications in the healthcare process [6]. If we speak about Asia Minor, especially Iraq there are very few applications and related research that facilitates electronic health. Therefore, due to the conditions and requirements of the Iraqi health environment a healthcare solution called "MediCare" system that provides a medical social platform that facilitates interaction between hospitals, clinics, physicians, and patients has been developed.
In this paper we present the implementation of the MediCare system together with its general architecture. We described related worksimilar systems and we presented how we differentiate from them. After that we presented the general architecture, the functions and related scenarios for each component and the corresponding class diagrams. As further work we want to test the system on a sample of people.