Nineveh Blood: Android Based Blood Donation Application for Nineveh Governorate in Iraq

Blood donation (BD) is one of the most significant contributions that a person can make towards the society. The growing android technology has made the process of BD easier and hassle-free. The Nineveh blood bank is an android application made for such great and noble cause. The application connects the givers and the requesters of blood who live in the Nineveh province, Iraq. The blood requester can serach from a list of all donors who have the same blood group and directly contact them without any third-party involvement. The Nineveh Blood application creates giver’s/requester’s profile through the Google Firebase Real-time database. In which, a one WebSocket two-way channel can constantly send the data back-and-forth between the server and the clients, and store the data as a JavaScript Object Notation (JSON) file.


Introduction
Donating blood has the power of saving millions of people from life-threatening. With the increasing of population in different countries, the blood bank system should consist different blood centers which collect the human blood independently. Therefore, a precise management blood bank platform is needed [1]. Mosul, Iraq was subjected to a siege by the Islamic State in Iraq and Syria (ISIS) between June 2014 till June 2017 where a lot of families were killed, injured, and required an electronic health system [2]. City inhabitants affected with poor healthcare services that started to deteriorate during the crisis. In 2018, the health directorate reported the service operations with their damages between operative and non-operative including hospitals, and Blood Center Ibn Alather Hospital in Mosul [3] [4]. The people in the city of Mosul had to resort to the conventional methods of arrangement of blood by visiting hospitals and blood banks.
In 2020, the coronavirus outbreak (COVID-19) engulfed the entire world with its wraith. Health services like the safe supply of blood are disturbed in every country [5]. Healthcare service platform such as mobile application can reduce the gaps between the giver/blood center and the requester. The mobile health (m-health) in such cases can play major role in reaching blood donors for urgent [6].
The rest of the paper is divided as follows: Section 2 gives an insight into the existing similar platforms which provide m-healthcare services. Section 3 contains information about the architecture of the application and methodology. Section 4 describes the user interface of the application and its implementation. Finally, section 5 summarizes the main points of the proposed work.

Related Work
Various platforms have been made in order to provide different m-health solutions. These solutions aim to provide services like personal health record management [7], providing electronic medical and health records [8], providing in-home medical nursing services [9], and provides convenient method of monitoring and safe life from kidnapping or lost [10]. The use of the m-health platform was discussed by Karagiannaki et al. [11], in which the assessment of the women who are under maternity was done against the exposure to the environment. Kirtava et al. [12] discussed the use of the m-health platform in the region of Georgia to monitor the outpatients for cardiac arrhythmia.
Several BD m-platforms have also been developed over the years. Islam et al. [13] developed a BD service for Bangladesh, which helps the users to get quick access to blood donor records in the country. The system used the Short Message Service (SMS) to request and replay for the blood transfusion. Another platform was created by S. I. Rahman et al. [14] which provided users to find blood donors and their information on the platform. The system also used SMS interaction as a means of proving an interface. F. Fahim et al. [15] developed a m-health based platform that offers an android based BD platform, which helps the blood requestor connect with the willing blood donors. As this platform was made on android, there is an improvement in the user experience when compared to the earlier platforms. Another similar implementation was given by S. S. Mandale et al. [16] in which uses an android application as a platform to provide information about the blood donors in the local region. This platform also included location assisted tracking of the blood donor using the service of GPS. Jenipha et al. [17] developed a web application with an android BD application to serve as a marketing information collector to incase lifesaving awareness in India. In this study [18], both SMS service and website are developed to serve BD. If no internet provided, a donor can also receive a request through SMS service. A GPS routing map will launch to reach the donor's location. Where a lot of implementations needed in both serverclient side, mobile system resources, and battery drain.

The Main Contribution
In this paper, a proposed Nineveh Blood android application is developed to serve both giver and requester of the blood without involving a third-party medical center. This means that the application doesn't serve as a Blood Transfusion Service (BTS). The application uses Google Firebase real-time, where the clients can save and retrieve the data through a WebSocket, in which it acts a lot faster than a normal HTTP protocol. This gives an advantage that all clients share one real-time database and receive updates every time the data changes.
Patients who require blood can easily search for healthy donors whom they can contact directly through the application to reach an agreement for blood transfusion.

The Proposed Approach
The requirement analysis was carried out with correspondence to provide the users of the Nineveh Province an m-platform for BD where users can search for information about willing donors and contact them. To tackle a new approach of developing the application that serve a blood transfusion, few concepts where taken into consideration and illustrated Table 1. Many general-purpose services in Iraq are being converted to e-platforms, mainly android based [19] [20]. The main architecture of the app is shown in Figure 1. The main modules were identified as follows: the voluntary blood donors and the cloud computing infrastructure. In detail, these modules are presented in the following subsections.

Voluntary Blood Donors
The users can join the platform and publically post their availability to the users who require blood. Initially, the donor must get registered to the platform through a simple registration form, as shown later in Figure 3. The registration form is the same for all the users on the platform irrespective of the role of the user. After registering on the platform, they become valid donors by typing their name, phone number and blood type in the firebase system. However, once the giver and requester agreed for a medical center for the purpose of blood transfusion, the medical center will valid the giver blood type before the transfusion process.
Once the blood donors are available for BD, their information is shown on the public donor list where the blood requestors can view and access the information of the blood donors. In addition, we use the power of cloud computing to provide rapid information with high availability to the users on the platform.

Cloud Computing Infrastructure
Cloud computing provides computer system resources like computational power and data storage via an on-demand service over the network [21]. Google's Firebase is used as a backend service for the BD application. Firebase is a Backend-as-a-Service (BaaS) created by Google in 2014 which runs on the Google Cloud Platform [22]. In which it is NoSQL-based database that works in a different concept than the relational SQL database management. Where there is no code required in the server side to setup and all events are driven in the client side. The NoSQL database is schemaless meaning that the NoSQL database can store the data in any structure. Generally, the data stores as a JSON object which is "self-described", as shown later in Figure 4.
The real-time database provided by firebase is used to store the list of available donors, register a new user, and log the user into the system. Firebase uses a WebSockets protocol which provides a full-duplex communication channel between the client and the server. A typical use case of the WebSocket protocol includes: chatting, social media news feed, and stock market prices. The synchronization process in WebSocket is faster than the HTTP call and does not require to establishing a new connection session each time during the communication between the server-client. The HTTP protocol cannot use in this case of study because it requires establishing an HTTP request each time there is a call or update the data with a closing session [23].

Software Development and Implementation
The proposed application was created in the android studio: Open-source android development software. The application built with Android Oreo, API 26 and up to date 29 compile SDK. (Software Development Kit). The SDK is a set of core libraries that provide the functionalities used to communicate with Google Firebase. Some of the essential firebase java classes were taken into consideration is listed in Table 2. The application has three main types of accounts that interact with each other in the Nineveh Blood application. Figure 2 represents the flowchart of the Nineveh Blood application.
At the registration page of the application has a checkbox to choose whether the user wants to be a donor or requester for BD. If a user selects the checkbox, he/she becomes a donor and its information goes to the donor database of the application. If the user is not a giver, its information enters the system as a regular blood requester. The admin user (blood center and medical center) have the authority to look for all donors and contact them. The requester can search for donors in their city according to their blood type. They will be incident to a donor list where they can choose the desired donor and contact the donor by using the personal information. The proposed architecture mentioned in Figure 3 represents the application design of the user interface. The screenshots of the different views of the Nineveh Blood application are shown in Figure 3. In Figure 3(a), the view of the login activity to enter the application is presented.   Each user can enter the login credentials and log-in to the application. For the new users, there is a registration activity shown in Figure 3(b). Here, users can get themselves registered on the application. The role of the user on the application can also be chosen on this page by selecting to become a donor option. Figure 3(c) shows the view of the reset password activity where the users can reset the password of their account. Once the user is registered as a blood recipient, he/she can search for available donors on the application. Figure 3(d) represents the view of the donor search activity where the blood recipients can search for willing donors by selecting the required blood group and the city where they live. Figure 3(e). The phone number, address and the blood group of the output listed donor is shown to the blood recipient along with an option to call the donor directly from the application and select a hospital to get the blood donated. Figure 3(f) shows the application icon uploaded at Google play-store.
The user's data can be stored in real time as a JSON file format [22]. The NoSQL schema for the user instance is presented in Table 3. For each user, the mentioned data fields are maintained. As the authentication on the application is handled by the firebase authenticator, when a new user is registered on the system, a unique user id is generated. That user id stored in the "uid" data field of the user database which makes it a foreign key similar to that in traditional SQL. The donor data field is a Boolean data field which is true if the donor checkbox is checked on the user registration page. If the donor field is true for a user, the user becomes a donor on the application, and the user's data is shown on the list of willing donors. The blood_group instance stores a string value of the blood group of the user which is used as a filter in the list of willing donors. When adding data to the JSON file, it becomes a node in the JSON file with its associated key reference. In which, firebase allows up to 32 nested data. Fig. 4, illustrates the structured output JSON objects and automatically serialized into the required subset data.    Over time the application uploaded to the play store, 48 users registered into the application. In which it reflects the need for the m-health platform to manage the blood transfusion in the city of Mosul. Fig. 5. indicates the distribution of the users over the cities.

Discussion and Conclusion
The purpose of the study is to integrate the society in the city of Mosul with a new BD technique that connects the giver and the requester in a direct approach based on BaaS cloud computing. The result is to implement a fast method of searching for blood donors without the need to look for it in the hospitals. The Nineveh Blood application can receive data from 30 cities in the province of Nineveh-Iraq. Include Duhok and Erbil in the Kurdistan region. Firgure 5 shows the distribution of the application in Nineveh which reflects the needs for such application in the city.
The advantage of the proposed application is to search for the blood donors by city and blood group to increase the possibility of finding the donors within one province.
The firebase real-time database provides a simplicit way to connect a cloud server with multiple users. Firebase is the new modern in developing both web and mobile applications in comparison with the HTTP web-based applications. Table 4 provides the reasons for our new approach of using the Firebase real-time in BD services. 3-Run the application without the need to manage the server and the database. 4-Enable the application data even when you are offline. 5-Use WebSocket protocol with full-duplex communication (one-to-one or one-to-many). 6-Firebase keeps the data in JSON format which is common practice in non-relational database.
The proposed application identifies different types of BD apps that exist in the mobile store. Table 5 concludes different strategies of implementation compared with the proposed framework. There are different criteria should be taken into consideration when developing the BD application such as: -The eligibility of finding donors, centers, and recommend hospitals.
-The application functionality: user's notification for a blood donor, enable GPS location and call permission. -Provide tips and information about the transfusion process and eligibility. As the application increases in complexity of implementation, one could find it is hard to deal with the application. Our application acts in an easy search method without requires to call for multiple system resources. Such as GPS permission, SMS service, authorization, or Captcha verification [18].
The future work is to integrate the Firebase Cloud Messaging (FCM) API, to send messages to multiple devices and push notification for users in need. In addition, the application could create a donation community campaign and push notification through the social network. The firebase can also develop a web application and mastering the frontend framework using Angular and Node.js.