You are on page 1of 13

CHAPTER 1

Mobile Application for Medical


Diagnosis
ANDREI GABOR • MARIUS POPESCU • FLORIN POPA-IOVANUT •
ANTOANELA NAAJI
“Vasile Goldis” Western University of Arad, Arad, Romania

1 INTRODUCTION are becoming more stable and provide access to more


Mobile applications continue to be a challenge for and more hardware features of devices. Hybrids typically
software developers, although the first attempts yielded consist of a native web browser component that can
results decades ago. Technological evolution has moved access various features of the running platform (e.g.,
this industry from an exclusive area to a purely commer- video camera, contact list, etc.). As a rule, hybrid applica-
cial one, which appeals to large hardware and software tions have the same graphic design on all platforms that
companies in the field [1e3]. have been published, regardless to the user interface
Digital pager technology dominated the market until implementation guide of each platform running the
the early 1990s, when the emergence of mobile phones application [10e12].
dramatically reduced pager sales [4]. In this chapter we present a mobile application
Today, the use of smart mobile devices such as which was designed to diagnose users’ illnesses
tablets and cell phones is steadily increasing. This is following a set of questions. Any element in the appli-
why mobile device manufacturers are forced to improve cation can be modified by using Firebase. The software
their hardware and come up with improved technolo- is developed in the Xcode programming environment
gies [5,6]. It is also well-known that the volume of using the Objective-C programming language.
hardware sales from giant companies such as Apple, The second section of the chapter contains the
Samsung, BlackBerry or Nokia are mainly due to the description of the application (the structure, the archi-
number and quality of software that each platform tecture, the description of the modules, the structure
offers to its users. of the database, the features, etc.). The third section
Mobile applications are divided into two main describes how the application works. At the end of the
categories: native applications and hybrid applications. chapter some conclusions are drawn and future work
Native applications are those that are written in the is identified.
programming language specific to the platform for
which they are developed. This is because native appli- 2 DESCRIPTION OF THE APPLICATION
cations must retain the behavior and the design of the The application for medical diagnosis was designed to
running operating system. They must integrate into help reluctant people who, because of being afraid of
the platform chosen by the end user. For a “native” going to a doctor when experiencing health problems,
product to run on multiple operating systems, it usually prefer to look up on the internet for possible causes
requires a programmer for each platform based on and find a diagnosis.
workload, deadlines, and other factors [7e9]. To further simplify matters, MedicalDiag offers its
Hybrid applications are those that are typically users, free of charge, a presumptive medical diagnosis
developed using WEB technologies (JavaScript, HTML, service guided by their answers to various questions.
CSS). Nowadays, hybrid applications are starting to The responses are “Yes” and “No”. Finally, to make
grow stronger because many development environments sure that the diagnosis is as accurate as possible, they

Telemedicine Technologies. https://doi.org/10.1016/B978-0-12-816948-3.00001-5


Copyright © 2019 Elsevier Inc. All rights reserved. 1
2 Telemedicine Technologies

plan projects, events and work in general. It follows the


stages of running a project according to their duration.
It is a common method in project management. It was
invented by Henry L. Gantt (American engineer and
sociologist) in 1917 and was considered a revolutionary
technique at the time, its author being rewarded for his
contributions to management [13]. Specifically, the
Gantt chart graphically illustrates an activity schedule
that helps plan, coordinate, and monitor project-
specific tasks. It has the form of a matrix with two axes:
a horizontal one indicating the amount of time required
for each activity (with the start and end dates of the task);
and a vertical one, indicating the tasks to be performed.

FIG. 1.1 The MedicalDiag block diagram. 2.3 Architecture of the Program
The architecture of the application is presented in
Fig. 1.4. The software is developed in the Xcode
have the opportunity of contacting a specialist doctor programming environment using the Objective-C
from a chosen city by phone. programming language. Google’s web and mobile appli-
The block diagram of the application is shown in cation development platform called Firebase was used
Fig. 1.1. for storing and synchronizing the data.
The navigation through the application interfaces
2.1 Application Features
is done through a navigation viewer controller that
The application has two modules: the administrative contains, after login, a tab bar viewer controller for
one and the client one. managing the other tabs (“statistics” and “my account”).
The administrator module has the following
features: 2.4 Design of the Modules
• Change any question for any illness; The application was built on the model presented by
• Change user data (name, email, PNC e personal Apple, in which applications must keep a uniform
numeric code); design, so that the user could see where the applica-
• Export/import the database; tion’s functions are. The application also follows an
• Statistics for any access; auto-layout, an Apple standard for scaling the app on
• Setting permissions for users. any screen size. The application structure is presented
The client module has the following features: in Fig. 1.5.
• Account creation and authentication; The application icon was designed using Adobe
• Ability to change your password; Photoshop CC2017, considering current design require-
• Displaying the human body (male/female, front and ments, the need for fluid integration among other iOS
back) and choosing the main areas of the body; icons, and the need to be user-friendly (Fig. 1.6). This
• Identifying a possible disease and displaying a is performed vectorally to scale on any device running
diagnosis based on the user’s answers; an iOS operating system.
• Providing the contact details of a specialist in the The description of the modules is presented in the
field of the user’s possible illness, within his or her next paragraphs.
geographical area;
• Statistics in a pie chart with the most affected areas 2.4.1 Logging in module
(data taken from all users in real time); In order to be able to use the application, the user will
• The possibility to change personal data (PNC, need to log in, which is also the first screen encountered
gender, name). (start view controller). After logging in from Firebase,
the function that authenticates the user is called, with
2.2 Gantt Chart the contents of the email and password fields in the
For a better organization and planning of the develop- application, and when a response is received from the
ment stages of the application, the Gantt chart shown server, the user and password are saved in a separate
in Figs. 1.2 and 1.3, created with the SmartSheet native file (NSUserDefaults), otherwise they are the
application, was used. The Gantt chart is a tool used to error encountered is displayed.
CHAPTER 1 Mobile Application for Medical Diagnosis 3

FIG. 1.2 Gantt chart (part 1).

FIG. 1.3 Gantt chart (part 2).

The next function will allow the user to use the “Next” Otherwise, the users will see a warning message on
button on the keyboard in order to jump to the next the screen informing them of what they have entered
field, and if it is the last one, the application will “press” incorrectly.
the “LOGIN” button on its own. If the user will press In order for the PNC to be considered valid, it must
anywhere else on the screen, the keyboard will disappear. start with 0 if the user has selected “Male”, or 1 if
If the users have an account, they enter their email “Female” is selected. The selection of the gender is
and password here. These are saved so that next time made by using the two buttons located at the top of
when the users wish to use the application, their login the registration form.
is made automatically. If all these conditions are met, a dictionary contain-
ing the name, PNC, and gender will be created; these
2.4.2 Registration module will be created separately from email and password
If the user does not have an account already created, s/he (encrypted and decrypted by Firebase) in the database
can register by pressing the top right button, which will user table. If the registration has been successful, the
send him/her to the next screen, i.e. the Register screen. user will receive a message on the screen and will be
When the user has entered all the required data and redirected to the login screen, where the email and
pressed the registration button, the validateInput function password fields will be automatically filled in.
will be called to validate all fields. For a cleaner and
easier way to debug layout, a separate Boolean return 2.4.3 The human body module
function was used for each validation. The email will The human body consists of two images: the front- and
have to contain the “@” and the “.” signs, and the rear-view body. Fig. 1.7 represents the male body. When
name and password must contain at least 5 characters. the user is a woman, the images change.
4 Telemedicine Technologies

FIG. 1.4 Architecture of the program.

For the head we have an interim class that works function and will shade the selected area for better
according to the same principle, and a separate image highlighting.
will be uploaded containing only this part, to better select The goToNextStep function verifies if the user has
other related areas (forehead, eye, nose, mouth, chin, pressed the head-marker area (has element_cap as the
ears). Over the images, buttons have been set with unique identifier) to know which screen to go forward into
identifiers that are related to the Firebase database. (the head seen from the front or back, both having sepa-
When selecting a specific area (pressing a button on the rate classes defined), or else it will lead directly to the
body), it will be shaded to highlight it. This is what symptoms section (QuestionManager ViewController)
the “setupBodyActions” feature does, which cycles for the area that was pressed. The first query is made
through the entire collection of buttons, sets them to be in the QuestionManagerViewController class, where
hidden, adds an action that will go to the “goToNextStep” the existing malfunctions are listed. If the user chose
FIG. 1.5 Application structure in Xcode.
FIG. 1.6 Creating the MedicalDiag icon.
CHAPTER 1 Mobile Application for Medical Diagnosis 7

FIG. 1.7 Division of the body.

the head, where there are several sub-zones, then this query, and we take the first set of questions for the cho-
fact will be taken into account when making the query. sen illness. Depending on the contents of the “yes” and
Also, this initial query increments the number of hits “no” keys, we open the same class but with a new query,
for that area. and the query path retains its position. This is done
Once we have the illness chosen by the user, we move until the “yes” or “no” keys no longer contain dictio-
to the QuestionViewController class, which makes a naries, but values, meaning that that is the diagnosis.
8 Telemedicine Technologies

Next, a new class e DiagnosticViewController - is the number of hits. This area can be hidden by pressing
presented, which will display the diagnosis in a the name of the condition in the legend.
scrollable text view next to a doctor contact button.
We also display a button so that the user can return to 2.5 Structure of the Database
the human body page, without having to press “back” Firebase has been chosen because it allows easy access
repeatedly. The “contact a specialist” button opens a to in-app data, is easy to scale to a large number of users,
native action sheet that gives the user a list of counties increased security is provided by Google, and APIs are
in the country to choose a physician who is closer to tailored for mobile systems. The database was designed
their location. The list of counties is read from a text with Google’s recommendations for real-time firebase
file located in the external file folder. databases. Its structure is in the form of questions:
A new class opens, RecDoctorViewController, where • head body part: hits - value, illness (question - value,
we display the recommended details of the doctor in answer 1 - value or another dictionary of the ques-
the selected county (data read from text files). Here tion&answer1&answer2, answer 2 - value or another
on the top right corner there is a button where the dictionary of the type question&answer1&answer2
doctor can be called directly from the application or a • part of the body: hits - value, illness (question - value,
button that opens a web page containing a list of all answer 1 - value or another dictionary of the question
doctors in the country. &answer1&answer2, answer 2 - answer 2 - value or
another dictionary of the type question&answer1
2.4.4 My account module &answer2
My account gives the user: • users: user idcnp - valuesex - valuename - value
• the possibility to change the gender, name and The structure of the Firebase database is illustrated
PNC. It contains the same checks as the registration in Fig. 1.8.
module. In order to change the name, PNC, and
gender, a query in Firebase will be taken to retrieve
this data and display it in the corresponding fields 3 USAGE OF THE APPLICATION
in the application interface. 3.1 Registration Process and Finding a
• the possibility of logging out (removes the email Presumptive Diagnosis
and password, saves the changes and sends us to the The first step which is necessary for using the app is regis-
login screen) tration. In order to benefit from all of the application’s
• the possibility to reset the password. The sendPass- utilities, the user has to create an account (Fig. 1.9),
wordResetWithEmail function is called in Firebase, selecting gender (to differentiate body areas and possible
giving it the current user’s email as parameter, and diagnoses) and then filling out a form containing email
when a response is received, the users will receive a address, password, full name and Personal Numeric
message informing them that the password has been Code (PNC).
requested and that they will need to access the reset All these fields will have to be to be completed by
link received via email. following a set of rules:
The email will have to be in the form of [user] @
2.4.5 The statistics sub-module [domain]. [TLD], where [domain] is the address of
The statistics tab makes a query through all parts of the the website that provides the email service and [TLD]
body in the database, then extracts the “hits” key to is the geographic location extension of the domain
generate a body part dictionary and the number of hits. (Top Level Domain);
To create the pie chart, we use an external library The password must be longer than 6 characters;
called AAChartView that helps us build different types The name must be longer than 5 characters;
of charts very easily, just by moving the data; it deals The PNC will have exactly 13 characters and will have to
with computing, building and interacting with charts. begin with the number 1 if the user selected “Male”,
In order to populate the chart with the required data or 0 if they selected “Female” (this rule is available in
from Firebase (the number of hits for each affected Romania, but it can be changed). Otherwise, a
body part), we created the configChart function that pop-up warning will be displayed specifying what
takes this data from the database as the library expects needs to be corrected. After completing this form
(a key and a dictionary value). Each area on the and thus creating the account, the user is redirected
chart will show the name of the affected area and to the Login page, where s/he will enter the email
CHAPTER 1 Mobile Application for Medical Diagnosis 9

FIG. 1.9 Registration form.

shadow, as it can be seen in Fig. 1.11. The available


body parts are:
• Head e the most complex part of the body; when
selected, the application will zoom in on it to
facilitate easy selection;
• Feet, thigh, knees, fingers, hands;
• Shoulder, arm, forearm, fingers;
• Body: pectorals/breast, hypogastrium, mesogastrium,
epigastrium and genital organs.
After selecting the affected area, the user will select
the symptom (Fig. 1.12) and respond to a set of succes-
sive YES or NO questions, after which s/he will receive a
diagnosis, indicating that this is a presumptive one, and
a medical check is recommended for the diagnosis to be
as accurate as possible.
With the receipt of the presumed diagnosis
(Fig. 1.13), the user will have a button located at the
bottom of the screen, to search for a specialist doctor.
FIG. 1.8 Structure of the database. When pressed, the user will be presented with a list of
the country’s 41 counties to narrow searches to the
selected region (Fig. 1.14).
address and password followed by the “Enter” Finally, after displaying the recommended physician
button. Once logged in, the human body will be in the selected region, along with his/her address and
displayed according to the gender chosen by the two phone number, the user can contact him/her via the
buttons located at the bottom of the screen: male button illustrated by a handset at the top right of the
and female (Fig. 1.10). screen.
The next step will be to select the affected area from
the human body (differing by gender) by tapping on it. 3.2 Statistics Area
To make sure that tapping is done exactly in the desired Apart from the above functionalities, the user can
area, the application will highlight the area with a access a statistics area (by clicking on the “Statistics”
10 Telemedicine Technologies

FIG. 1.10 Male body and female body.

tab located in the menu at the bottom of the screen)


where s/he can see with a pie chart, the most affected
areas in all users. Body parts are represented on the
diagram with different colors and when they are
pressed, the number of affected users in the area is
shown (Fig. 1.15).

3.3 Update/Modify the Personal Data


One of the key features of the app is the possibility to
change personal data (gender, name or PNC), this being
done in the “My Account” menu, accessible from the
lower-menu menu bar.
If the user wants to change the password for personal
reasons, the “Change Password” button is pressed
(Fig. 1.16), at which time a pop-up will inform them
that a mail has been sent to their email account with
which they created the account (Fig. 1.17).
In order to complete the password change process, it
will be necessary to access the email link, where the user
will need to enter the new password.
FIG. 1.11 Selection of affected area.
FIG. 1.12 Symptom list.

FIG. 1.13 Diagnosis. FIG. 1.14 List of counties.


12 Telemedicine Technologies

FIG. 1.16 Changing password.

FIG. 1.15 Affected area percentage.

4 CONCLUSIONS
The MedicalDiag application was built according to the
specifications provided, eventually reaching version
v.1.3.2, bringing new functionalities and improvements FIG. 1.17 Email confirmation for changing password.
to it during the development. MedicalDiag is available
on any device running the iOS operating system, or diagnosis can be modified without interfering with
designed to diagnose users’ illnesses following a set of the application, all being changed in Firebase.
questions. As an application for a vast domain, it has many
The biggest challenge of this application was to create development directions and will be periodically
a simpler and more logical structure for arranging ques- upgraded, bringing new functionalities and even solv-
tions, answers and diagnostics. The current solution is ing existing problems. The app will be placed as soon
not just “memory friendly”, but also scalable. If one as possible in Apple’s AppStore, and new features will
should want to add one or 100,000 questions later, be brought to it, such as the ability to contact a physi-
this will not affect the application at all. Any element cian in real time with a live chat, or search for it using
in the application is scalable and any question, answer, the embedded GPS module.
CHAPTER 1 Mobile Application for Medical Diagnosis 13

These two new functionalities are already under [7] R. Pryss, M. Reichert, B. Langguth, W. Schlee, Mobile
development and another is in plan, namely the possibil- crowd sensing services for tinnitus assessment, therapy,
ity of receiving a diagnosis after uploading a photograph and research, mobile services, in: IEEE International
(if the disease has visual signs, for example varicella). Conference, August, 2015.
[8] K.F. Braekkan Payne, H. Wharrad, K. Watts, Smartphone
and medical related App use among medical students
and junior doctors in the United Kingdom (UK): a regional
REFERENCES survey, BMC Med Inf. Decis. Mak. (2012) (October).
[1] R. Ford, J. Wierdermann, The App&mobile Case Study [9] M.N. Faruk, J. Mallipeddi, An optimal healthcare
Book, Indexed edition, TASCHEN, 2011. self-diagnosis system using cloud framework, in: Interna-
[2] W.J. Yi, W. Jia, J. Saniie, Mobile sensor data collector using tional Conference On Big Data Analytics and Computa-
android smartphone, in: Circuits and Systems, IEEE 55th tional Intelligence, 2017.
International Midwest Symposium, 2012, pp. 956e959. [10] L. Briz Ponce, J. Antonio, J. Méndez, F.J. García Peñalvo,
[3] A. Székelya, R. Talanow, P. Bágyi, Smartphones, tablets First approach of mobile applications study for medical
and mobile applications for radiology, Eur. J. Radiol. 82 education purposes, in: TEEM ’14, Salamanca, October,
(May) (2013) 829e836. 2014.
[4] M. Panhale, Beginning Hybrid Mobile Application [11] M.N. Kamel Boulos, A.C. Brewer, C. Karimkhani,
Development, first ed., Apress, 2015. D.B. Buller, R.P. Dellavalle, Mobile medical and health
[5] W.J. Yi, W. Jia, J. Saniie, Mobile sensor data collector apps: state of the art, concerns, regulatory control and
using android smartphone, in: Circuits and Systems, certification, Online J. Public Health Inform. 5 (February)
IEEE 55th International Midwest Symposium, 2012, (2014).
pp. 956e959. September. [12] L. Csiki, A. Gabor, M. Popescu, A. Naaji, Software applica-
[6] R. Pryss, M. Reichert, J. Herrmann, B. Langguth, W. Schlee, tion for disabled students, Brain 8 (4) (2017) 32e40
Mobile crowd sensing in clinical and psychological trials e (December).
a case study, computer-based medical systems, in: IEEE [13] http://www.scritub.com/stiinta/informatica/Ce-este-diagrama-
28th International Symposium, June, 2015. Gantt1032201711.php, accessed in January 2017.

You might also like