In House Project Report
In House Project Report
on
COVID-19 Blood Cataloguing Application
Submitted to
Amity University Uttar Pradesh
Dr Abhishek Singhal
I, Aditya Oberai, student of B.Tech (CSE) hereby declare that the project titled “COVID-19
Blood Cataloguing Application” which is submitted by me to Department of Computer
Science and Engineering, Amity School of Engineering and Technology, Noida, Amity
University Uttar Pradesh, in partial fulfilment of requirement for the award of the degree of
Bachelor of Technology (CSE), has not been previously formed the basis for the award of any
degree, diploma or other similar title or recognition.
The Author attests that permission has been obtained for the use of any copy righted material
appearing in the report other than brief excerpts requiring only proper acknowledgement in
scholarly writing and all such use is acknowledged.
Signature
Noida
Date:
i
CERTIFICATE
On the basis of report submitted by Aditya Oberai, student of B.Tech (CSE), I hereby
certify that the report “COVID-19 Blood Cataloguing Application” which is submitted to
Department of Computer Science and Engineering, Amity School of Engineering and
Technology, Amity University Uttar Pradesh in partial fulfilment of requirement for the award
of the degree of Bachelor of Technology (CSE) is an original contribution with existing
knowledge and faithful record of work carried out by him/her under my guidance and
supervision.
To the best of my knowledge this work has not been submitted in part or full for any Degree
or Diploma to this University or elsewhere.
Noida
Date:
Dr Abhishek Singhal
Dy. HoD (CSE)
Department of Computer Science and Engineering
(Faculty Guide)
ii
ACKNOWLEDGEMENT
The satisfaction that accompanies that the successful completion of any task would be
incomplete without the mention of people whose ceaseless cooperation made it possible, whose
constant guidance and encouragement crown all efforts with success. I would like to thank Prof
(Dr) Abhay Bansal, Head of Department-CSE, and Amity University for giving me the
opportunity to undertake this project. I would like to thank my faculty guide Dr Abhishek
Singhal who is the biggest driving force behind my successful completion of the project. He
has been always there to solve any query of mine and also guide me in the right direction
regarding the project. Without her help and inspiration, I would not have been able to complete
the project. Also I would like to thank my batchmates who guided me, helped me and gave
ideas and motivation at each step.
Aditya Oberai
iii
Table of Contents
1
Abstract
We have all noticed that due to the rising trend of companies developing their mobile
applications, there has been an increase in the demand of mobile application developers
in the last few years. However, looking at the advancements in the two major mobile
operating systems Android and iOS as well as an increase in native mobile application
developers choosing to specialize in application development for one of the two
languages, companies have now started looking at alternatives which allow them to
rapidly develop applications for both the mobile operating systems. This has led to the
rise of the adoption of cross-platform frameworks such as Xamarin.Forms, Flutter and
React Native. Due to my recent experience with C# and .NET as well as my previous
experience developing Universal Windows Platform applications, I have chosen to work
with Xamarin.Forms for my project.
Looking at the current scenario with COVID-19 and the increasing infected numbers on
a daily basis, it has become more and more difficult for healthcare institutions to keep
track of patients who have been infected, especially in smaller towns and villages which
may not have the best of infrastructure and connectivity with other towns and
metropolitan cities. In order to help provide a possible solution to this problem, I have
created a cross-platform application using Xamarin.Forms to help catalogue the contact
details of patients who are visiting the healthcare institutions and getting themselves
tested. This application will definitely benefit towns and villages where healthcare
institutions such as clinics and blood banks do not have access to desktop or laptop
computers but do have accessibility to smartphones.
I have chosen to work on this project because I believe that such a project can help
impact those busy running our healthcare industry and thus, the citizens of our nation.
For this project, I am using tools such as Visual Studio Community IDE, .NET
Framework and SQLite which are available for free to the public, in this way making it
a no-cost viable solution to a possible real world problem that may come up in the times
to come.
2
1. Introduction
In the recent years, the trend for any company or organization to have its own mobile
application has grown at a huge rate. However, due to major advancements coming in
the two most commonly available mobile operating systems Android and iOS with both
having very different codebases, most mobile application developers began preferring to
specialize in one of the two platforms. This has led to a rise in cross-platform
application development frameworks such as Xamarin.Forms, Flutter, React Native, etc.
1.1 Relevance
We have all been under lockdown for over the last two months due to the current
Coronavirus pandemic. With the number of infected people across the country
increasing every day, it has become extremely difficult for healthcare institutions such
as hospitals, clinics and blood banks, especially in areas that do not have quality
infrastructure and connectivity with other towns and metropolitan cities. Recognizing
this possibly emerging problem, I have created an application to help catalogue the
contact details of patients who are visiting the healthcare institutions and getting
3
themselves tested. The cataloguing application essentially accepts the name, email
address, phone number and COVID-19 status of the patient who has just gotten their
blood tested and stores the information in a local database for higher security. The
platform that has been used to create the application is Xamarin.Forms as it allows me
to develop the application for Android, iOS and UWP (Universal Windows Platform)
simultaneously. The application also features the functionality to email a patient their
result so that they can check their information and have it rectified as well as the
functionality to check the database for any patient’s contact details whenever necessary
to do so. I have created the database using SQLite as it can directly be integrated with
any Xamarin.Forms application. This application will definitely benefit towns and
villages where healthcare institutions such as clinics and blood banks do not have access
to desktop or laptop computers but do have accessibility to smartphones.
The COVID-19 Patient Cataloguer application will feature two major functionalities:
This application is designed to be used by hospital staff only so the application’s access
shall be restricted from the general patients. The staff will be able to see various input
fields such as patient name, phone number, email address and COVID-19 status (yes or
no) which they can add to the database. In case they want to update the information of
any patient, they can do so using the same input fields as well.
If the staff wants to check for the presence of any patient’s personal details, they can do
so by using the phone number of the patient. They will input the phone number based
on which they can find all the other details present in the database. They can also email
the details of the patient to the provided email address if found in the database.
Before we proceed to discuss the design of the application, there are certain terms and
technologies that I would like to mention briefly about as they will benefit the
understanding of the reader.
Xamarin.Forms
o Share the same back-end code and have the ability to test the application
while maintaining the same business logic across multiple platforms
5
Visual Studio
6
SQLite
SQLite with Xamarin.Forms makes using local databases extremely easy to use as the
SQLite database engine allows the Xamarin.Forms applications to save data objects in
the shared code. All that the developer needs to do to utilize this functionality is search
“sqlite-net-pcl” in the NuGet Package Manager and install the latest stable release of the
shared code project created by Frank A. Krueger.
7
2.2 Programming Languages Used
The following two programming languages were a crucial part of developing this
Xamarin.Forms application
C#
8
XAML
9
2.3 Application Flow and Design
Coming over to the design of the application, the application’s user experience
flowchart is as follows:
10
This application has been developed keeping the hospital staff’s perspective in mind.
The application will not directly be used by the patients. On opening the application, the
user will see the following page:
The first functionalities available at the start of the program allow the user to input the
following personal details of the patient:
Patient Name
Patient Phone Number
Patient Email Address
Patient COVID-19 Status
Based on these details, the information will be either added to the database for the first
time or updated in case it is already present through the “Add” and “Update” buttons.
11
If the staff needs to then check if the patient details have been added to the database or
not, they can do so clicking on the “Check” button. In order to do so, they must input
the patient’s phone number first. If the patient’s phone number is not found in the
database, it shall tell us that the information was not found using the text boxes below
the button. If the details are found however, the patient’s name, email address and
COVID-19 status shall become visible in the same text boxes. Another feature that will
be unlocked if the details are found in the database is the “Email Details” button.
Clicking on this button will allow the user to automatically send the patient information
that has just been checked to the already inputted email address.
12
2.4 Application Architecture
The Add and Update functions in the applications work in almost an identical
manner. They essentially take an input of all the personal details required in the
SQLite database from the patient. Based on whether the Add button is pressed or
the Update button, the event handler calls the AddNewPatient function or the
UpdateNewPatient function in the PatientRepository class in the COVID
(project name that was used) namespace. If all the input fields required contain
the necessary data, i.e. are not null, the information is then added to the database
using the Language Integrated Queries (LINQ) which are available to C#
developers. The table in the SQLite database is created and written into using
the Patient class in the COVID.Models namespace. If any of the input fields in
the function is empty however, then the function returns an error that prevents
any of the information from being entered into the database, resulting in the end-
user having to re-enter the entire data once again. This prevents incomplete data
from being inputted into the database used by the application
13
Checking Patient Details in the Database:
In order to check the presence of a patient’s details, we use the phone number of
the patient. The phone number of the patient acts a primary key for our database
that has been created with the help of the Patient class in the COVID.Models
namespace. The schema of the database shall be discussed subsequently. In
order to start this process, the end-user presses on the Check button. The event
handler takes the phone number entered the getStatus function in the
PatientRepository class in the COVID namespace. Using the phone number, the
function searches the table in the database for a match with the primary key in
each row. If the primary key is found, then the details of the patient are
displayed in the application. If the phone number is not found, the function
returns “N.A.” and as a result, the “Not Found” message is displayed in the
application.
14
In case the details are found, the function unlocks an optional functionality to
email the just-checked details to the email address provided by the patient. The
.NET Libraries feature an Email class which allows the application developers to
keep the optional functionality of allowing users to send an email from the
application using the Simple Mail Transfer Protocol (SMTP). It asks for the
SMTP server host name, port, enabling SSL protocol and the user credentials for
the email address. Based on these details, it allows the application to send an
email to any other user as long as their email address is available, in this case the
patient details from the database to the matching email address.
Database Schema
The database only requires the usage of a single table called ‘patient’. The table
‘patient’ consists of four attributes within it.
15
The four attributes are:
Id: Stores the phone number of the patient and acts as the primary key for the
table
Name: Stores the name of the patient
Email: Stores the email address of the patient and is unique
Status: Stores the COVID-19 status of the patient
The table mentioned above is created in the database using the Patient class in the
COVID.Models namespace. The path for the database in the file system of the OS
where the application will be run is set using the FileAccessHelper function in the
COVID Namespace.
The Reset button in the application is essentially used to clear all the input fields and
outputs, essentially return the application to state in which it was opened. The Reset
button, however, does not make any changes to the database in which the patient details
are stored.
16
3. Results
The program worked in an absolutely spending manner. I received all the results I
expected. I tried inputting my own details at first to test the program. On checking
for my details, I got the exact details as inputted. I also tried emailing my details, on
which I received the following email. I even tried checking for non-existent patient
details and got the right output as well. I have attached screenshots of these tests
below.
17
Fig 3.4: Email received while
testing functionality
18
4. Conclusion
I believe that I have met the original goal that I had in mind when I began working
on the project. My application has all the basic functionalities I had in mind such as
adding/updating patient details in the database, checking for presence of the details
as well as the ability to email the details of a patient to their already provided email
address. I am extremely happy with the Xamarin.Forms platform as it has allowed
me to develop an application which is light enough to run on lower-end smartphones
as well as develop the application for both the commonly available mobile operating
systems simultaneously. Not only that, but I have to add that Visual Studio is a
really amazing IDE to work with. It makes developing applications quite a
comfortable process for a budding developer like myself as well as provides the
necessary tools for experienced developers to build advanced applications and
collaborate with other members of their organization.
19
6. References
1. Learning Resources on developing Xamarin.Forms applications:
https://docs.microsoft.com/en-us/learn/paths/build-mobile-apps-with-xamarin-
forms/
2. Visual Studio
https://docs.microsoft.com/en-us/visualstudio/ide/?view=vs-2019
3. SQLite
https://www.sqlite.org/docs.html
4. C#
https://docs.microsoft.com/en-us/dotnet/csharp/
5. XAML
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/xaml-basics/
20
7. Appendix I : Code-Base
(Also available at https://github.com/adityaoberai/InHousePracticalTraining)
MainPage.xaml
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-
compatibility/2006"
mc:Ignorable="d"
x:Class="COVID.MainPage">
<StackLayout>
FontSize="Large"
HorizontalOptions="Center"
VerticalOptions="StartAndExpand" />
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand" />
21
<Entry x:Name="email" Placeholder="Patient Email Address" />
<Grid>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
</Grid.RowDefinitions>
Clicked="addPatientButton_Clicked"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand"
Grid.Row="0"
Grid.Column="0"/>
Clicked="updatePatientButton_Clicked"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand"
Grid.Row="0"
Grid.Column="1"/>
</Grid>
22
<Label Text="Check if Patient Details are present:"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand" />
<Grid>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
</Grid.RowDefinitions>
Clicked="checkPatientButton_Clicked"
HorizontalOptions="CenterAndExpand "
VerticalOptions="CenterAndExpand"
Grid.Row="0"
Grid.Column="0"/>
Clicked="emailPatientButton_Clicked"
HorizontalOptions="CenterAndExpand "
VerticalOptions="CenterAndExpand"
23
IsEnabled="False"
Grid.Row="0"
Grid.Column="1"/>
Placeholder="Name of Patient"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
IsReadOnly="True"
Grid.Row="1"
Grid.Column="0"/>
Placeholder="Email address"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
IsReadOnly="True"
Grid.Row="1"
Grid.Column="1"/>
Placeholder="COVID-19 Status"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
24
IsReadOnly="True"
Grid.Row="2"
Grid.Column="0"/>
</Grid>
Clicked="resetButton_Clicked"
HorizontalOptions="CenterAndExpand "
VerticalOptions="CenterAndExpand"/>
</StackLayout>
</ContentPage>
MainPage.xaml.cs
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Net.Mail;
using Xamarin.Essentials;
using Xamarin.Forms;
namespace COVID
25
// Learn more about making custom code visible in the Xamarin.Forms previewer
// by visiting https://aka.ms/xamarinforms-previewer
[DesignTimeVisible(false)]
public MainPage()
InitializeComponent();
Debug.WriteLine(pid2.Text);
if (App.PatientRepo.getStatus(long.Parse(pid2.Text)).Equals("N.A."))
idCheck.Text = "No";
emailCheck.Text="N.A.";
else
idCheck.Text = App.PatientRepo.getName(long.Parse(pid2.Text));
emailCheck.Text = App.PatientRepo.getEmail(long.Parse(pid2.Text));
emailPatientButton.IsEnabled=true;
26
}
covidStatus.Text = App.PatientRepo.getStatus(long.Parse(pid2.Text));
App.PatientRepo.AddNewPatient(long.Parse(pid1.Text), name.Text,
cstatus.Text, email.Text);
name.Text = "";
pid1.Text = "";
cstatus.Text = "";
email.Text = "";
name.Text = "";
pid1.Text = "";
email.Text = "";
27
cstatus.Text = "";
pid2.Text = "";
idCheck.Text = "";
emailCheck.Text = "";
covidStatus.Text = "";
emailPatientButton.IsEnabled = false;
App.PatientRepo.UpdateNewPatient(long.Parse(pid1.Text), name.Text,
cstatus.Text, email.Text);
name.Text = "";
pid1.Text = "";
cstatus.Text = "";
try
28
MailMessage mail = new MailMessage();
mail.To.Add(App.PatientRepo.getEmail(long.Parse(pid2.Text)));
SmtpServer.Port = 587;
SmtpServer.Host = "smtp.gmail.com";
SmtpServer.EnableSsl = true;
SmtpServer.UseDefaultCredentials = false;
SmtpServer.Credentials = new
System.Net.NetworkCredential("[email protected]", "racers1234");
SmtpServer.Send(mail);
emailPatientButton.IsEnabled = false;
}
29
}
App.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xamarin.Forms;
namespace COVID
public App()
InitializeComponent();
30
MainPage = new COVID.MainPage();
FileAccessHelper.cs
using System;
using System.Collections.Generic;
31
using System.Text;
using Xamarin.Essentials;
namespace COVID
class FileAccessHelper
PatientRepository.cs
using System;
using System.Collections.Generic;
using System.Linq;
using COVID.Models;
using SQLite;
namespace COVID
32
{
SQLiteConnection conn;
conn.CreateTable<Patient>();
public void AddNewPatient(long id, string name, string status, string email)
int result = 0;
try
if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(status) ||
string.IsNullOrEmpty(id.ToString()) || string.IsNullOrEmpty(email))
33
StatusMessage = string.Format("{0} record(s) added [Name: {1})", result,
name);
public void UpdateNewPatient(long id, string name, string status, string email)
//int result = 0;
try
if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(status) ||
string.IsNullOrEmpty(id.ToString()) || string.IsNullOrEmpty(email))
34
}
try
return conn.Table<Patient>().ToList();
35
try
return conn.Get<Patient>(id).Status;
catch (Exception)
return "N.A.";
try
return conn.Get<Patient>(id).Name;
catch (Exception)
return "N.A.";
36
try
return conn.Get<Patient>(id).Email;
catch (Exception)
Patient.cs
using System;
using System.Collections.Generic;
using System.Text;
using SQLite;
namespace COVID.Models
[Table("patient")]
37
[PrimaryKey, Unique]
[MaxLength(250)]
[MaxLength(250), Unique]
[MaxLength(250)]
38
39