Documente Academic
Documente Profesional
Documente Cultură
First and foremost, we are grateful to Almighty Allah for His immense blessings
and graciously helping us to complete this project.
This project owes its existence to the help, support, and inspiration of many people.
In the first place, we owe my deepest gratitude to my main supervisor Prof. Dr. Safia
Abbas whose great knowledge, experience and sharp sense of research direction have
provided invaluable feedback to improve the quality of this project. This project would
not have been possible without her sound advice and encouragement. We would like to
express our sincere appreciation and gratitude to her tremendous amount of support,
guidance, insightful comments, and invaluable collaboration. It was our great pleasure
and honor to have such professor as our supervisor for her endless support and cooperation
during this project and research, in addition to her final revision of the documentation.
Last, but not least with all my appreciation and love that no words can express,
we would like to thank all our friends and family members for their endless love and
support. We offer my love and heartfelt thanks to our parents for their lifelong support in
all my endeavors. We dedicate this project to our dear parents who always provided us
with love, prayers, blessings, advice, and care. They are behind any success in our life.
i
Abstract
Nowadays computer technology has become a fact of life. Computer technology has
helped streamline management and serving whether a whole organization or even an
individual which made it a much-needed tool for every domain in life: Business,
Entertainment, Education, Industry, Medicine and many others. The importance of the
computer technology to the mentioned domains and specifically in the Medical or the
Biological areas enabled the inspiration of our project idea to become a real one. Introducing
a system is capable of giving a primary diagnosis for a patient who is unable for some reason
to see a doctor and needs to take a primary treatment if available or for somebody planning
to see a doctor and for saving time he will get prepared by being identified with maybe some
and not all of the tests required to be done. Moreover, the patient can measure his heart rate
pulses and blood pressure. Such type of systems presents new medical advantages for both
the doctor and the patient by letting the patient aware of any disease of interest. On the other
hand, the user can gather different type of information about any disease of interest
depending on the type of user i.e. if the user is an ordinary user the system offers basic type
of information while if the user is a researcher it introduces high level of information. Also,
the patient is capable of knowing the precautions and the tests required for certain disease
which directly may help in minimizing the rate of exposure to diseases and thus increasing
the population production in any country.
ii
Table of Contents
Acknowledgment…………………………………………………………………………….. i
Abstract……………………………………………………………………………………….. ii
Table of content……………………………………………………………………………....iv
List of abbreviations………………………………………………………………………… v
List of figures…………………………………………………………………………………. vi
iv
List of abbreviations
DiaMe Diagnose Me
DB database
UA User Agent
MA Master Agent
v
Table of Figures
Figure 1: HER system ...........................................................................................................5
Figure 17: Result less than 50% and no diseases found ......................................................32
vii
List of tables
viii
Smart Agent for Medical Diagnosis (DiaMe)
Chapter 1
Introduction and Background
Main points
1
Smart Agent for Medical Diagnosis (DiaMe)
Introduction
As it was mentioned above there are several domains interacting with the computer
science field and among these areas the medical area as it concerns the most valuable
resource in the whole world which is the human.
This concept invented the cooperation and the integration between the two
mentioned domains assisting the doctors, the researchers and the patients. it is aiding the
doctors to diagnose and analyze the disease early and prescribe treatment or medicine for
their patients which may help in saving time. also, it is aiding the people to gain more
information and knowledge about many diseases which were not defined simply previously
that is affect the results in decreasing the rate of exposure to diseases. Finally supporting the
researchers in many related fields from the point of view of the research, analysis, and
applications such as drug design, clinical research, cancer research, genetics research and
genome biology...Etc. This system will be designed to immediately diagnose by providing
tools to assist the patient, which would otherwise have to be performed manually. By This
Smart Agent for Medical Diagnosis, we will be able to quickly diagnose a person and give
reports about that person that is easy to understand and use.
The Analytical workflow works by the measurement of the heart rate pulses and the
blood pressure. This option is available to the user (patient). If the user (patient) wants to
measure the blood pressure or heart rate, then the user (patient) will put the sensors in the
corrected place. The hearting draw will appear. There is a four point in normal heart function
(P, (Q, R, S), T). These mean that atrial depolarization, ventricular depolarization, and
repolarization respectively.
Finally, the Research support workflow assists the researcher by providing him with
the most recent publications related to certain disease which may help the researcher with
supplementary and valuable information.
2
Smart Agent for Medical Diagnosis (DiaMe)
Problem definition
1. According to some circumstances, an individual could feel pain and is not able to
see a doctor so there is an urgent need for taking temporary effective treatment or
performing some medical tests.
2. Again, due to the absence of the doctor some people may advise a patient feeling
certain symptoms with improper medicine leading to mistreatment and complicated
medical problems.
3. In the remote places there is a huge problem which is the rarity of the pharmacies or
the hospitals and suddenly a patient may need to measure the rate of the heart pulses
or the blood pressure.
4. A researcher doing research or writing some scientific paper about certain disease
possibly requires a complete overview of that disease and the publications related to
that disease of interest.
5. For an individual or even for an important organization in the country preparing for
an event or seminar about a disease which begun to propagate and the organization
is informing the people of the symptoms, required precautions and the causes of such
disease to avoid it.
3
Smart Agent for Medical Diagnosis (DiaMe)
We will predict what kind of disease the patients are suffering from based on the
analysis drugs that bought by each patient. The dataset that used is containing details such
as sex, age, the name of the drug for each patient. Applying different data mining techniques
such as k-nearest neighbor (KNN), naïve Bayes and decision tree comparing performance
for predicting diseases. We detected that the proposed model has higher accuracy rather than
KNN, decision tree, and naïve Bayes.
Diagnosis support system has the following function. Firstly, the human computer
interface for doctors and clients. Counselors and clients must be able to access the system
at remote locations through the internet. The system must also have data mining function to
extract the unknown relationship between test items for medical advancement. The
prototype system is evaluated through usability and impression. This system is better than
printed materials and not only for diagnosis prevention but also for improving continuous
lifestyle.
4
Smart Agent for Medical Diagnosis (DiaMe)
Multi-agent system based medical diagnosis system in which an agent called User
Agent (UA) is responsible for taking the user inputs i.e. symptoms from the patients with
the help of a user interface. The Master Agent (MA) has the responsibility to give the task
and to provide the proper knowledge from the Global Knowledgebase (G KB) to the
specialist doctor agents (SDA). For each SDA, there are individual local knowledge bases
5
Smart Agent for Medical Diagnosis (DiaMe)
(LKB) associated with them. After having the solution, SDA will give the solution to the
(MA) and that solution will be stored in the Solution knowledge base (S KB).
The Medical Diagnosis System takes input in the form of symptoms and gives output
in the form of a particular disease. The medical diagnosis system shows in Figure 3. The
importance of this system to help medical practitioners in the analysis of some extreme
diseases. It also gives easier ways decrease the doctor's burden. It offers many advantages
both to the medical practitioners and patients. Because of this, the system really is supposed
to be a trusted system. It is user friendly and most importantly can be utilized by users to
obtain self-notified without the assistant.
Our solution, a smart agent for medical diagnosis (DiaMe), aids users and novice
doctors with the diagnostic process using cloud-based services for medical record keeping,
provides integrated consulting services, symptom analysis, and electronic health
monitoring. Using heuristic information, the system monitors the progress of each patient
and provides a report analyzing the patient's condition making notes on where improvement
could be achieved.
The new system (DiaMe) differs from the previous systems via the presented
options. Firstly, the system enables the user (patient) to choose two options (measurement
or models). The measurement option enables the user (patient) to measure blood pressure
or heart rate. When the user select model, the user (patient) should select the part in which
he is suffering from and choose the symptoms that exist in the created database. The
system shows all possible diseases with percentage based on an apriori algorithm. If the
percentage less than 50%, no result appears. Otherwise, the result appears. Crawling begin
6
Smart Agent for Medical Diagnosis (DiaMe)
to work when the user determines maximum value as long as the percentage of crawl
should be greater than retrieved percentage form database.
Secondly, the system enables novice doctors to choose the option he needs. The
options presented in this systems are searching for disease name or symptoms name as
well. The doctor writes the disease name then crawl retrieves description with the disease
name, and also when the novice doctor writes symptoms, crawl retrieves all available
diseases related to the entered symptoms. When the novice doctor selects any disease, a
new form appears to contain a description of this disease.
Scope:
The scope has two parts. First, project scope is concerned with work-based,
implementation details and rework. It can change by any stakeholders. Second, product
scope is concerned with features, functionality, and requirements. It can be changed by the
customer. To define the scope, the following things should be identified:
Objectives and Goals: there are many impacts on this system from various
perspectives (social, commercial, environment…. etc.).
7
Smart Agent for Medical Diagnosis (DiaMe)
Tasks:
Budget: the total cost for the project is estimated as follows in table 2:
8
Smart Agent for Medical Diagnosis (DiaMe)
Schedule:
Deliverables
▪ Is the most sufficient diagnosis of symptoms and diseases It's also choosing the most
appropriate disease for selected symptoms.
▪ DiaMe system enables the user (patient) to select the model (male, female) and
select the part suffer from.
▪ DiaMe is a good choice for novice doctors. It enables novice doctors to search with
disease name and the description of the disease will appear. So, the diagnosis is
easier for them.
▪ DiaMe also enhancing the Health awareness processes with patients by making an
interactive & interesting diseases phase.
9
Smart Agent for Medical Diagnosis (DiaMe)
Summary
Current systems are presented with only one option “symptoms checker”.
Proposed system (DiaMe) present three option rather than current systems.
The first option, sensors that connected with Arduino kit to measure heart rate and
blood pressure. secondly, symptoms checker by the user through selected model and
part. Finally, for novice doctors to make search with disease name or symptoms
name as well. Also, crawl to retrieve description when the novice doctors search for
disease or symptoms.
10
Smart Agent for Medical Diagnosis (DiaMe)
Chapter 2
Analysis and Design
Main points
System development life cycle (SDLC) phases such as (analysis and design)
were presented in this chapter
▪ User requirements
▪ System requirements
▪ Hardware and software requirements
▪ Functions and Non-functions
▪ Block diagram
▪ Use case diagram
▪ Class diagram
▪ Sequence diagram
▪ Database design (ERD, Shema)
▪ System Architecture
11
Smart Agent for Medical Diagnosis (DiaMe)
Introduction
3. The user (patient) shall enter the prevailing symptoms, then system show disease with
a percentage.
3.1. The user (patient) shall start the system.
3.2. The system has many options such as search, check the symptoms and measurement.
3.3. The user (patient) shall select the checker symptoms.
3.4. The user (patient) shall select the model as well as.
3.5. The user (patient) shall select the part of the model (liver), the symptoms will appear
from the database.
3.6. The user (patient) shall check the symptoms and click the result.
3.7. The result contains the disease with the percentage of this disease.
3.8. If the user (patient) clicks any disease, it also shows the description of that disease,
required tests if available, and classification.
4. When The user (patient) select measure, the user (patient) shall use blood pressure
and heart sensors to allow the system to read the measurements.
4.1. The user (patient) shall start the system
4.2. The system has many options such as search, check the symptoms and measurement.
4.3. The user (patient) shall select the measurements.
4.4. The user (patient) shall put the sensors.
4.5. The sensors shall start to measure heart and pulse rate and show diagram on the screen.
12
Smart Agent for Medical Diagnosis (DiaMe)
Software requirements:
Operating System: Microsoft Windows 10 or 8.
Visual Studio 2017.
SQL server 2016.
Internet access.
Arduino.
13
Smart Agent for Medical Diagnosis (DiaMe)
Functional requirements
Function Name: measure heart rate beats
Primary Actor Senor
Secondary Actor User
Flow of Event 1. The user (patient) shall be start the system.
2. The system has many options such as search, diagnose,
scientific papers and measurements.
3. The user (patient) select the measurements.
Pre-condition Users (patients) put the sensor in the correct place.
Post-condition Report with heart rate beats (Normal, Fast, Slow)
Alternative solution NONE
Pre-condition 1. Doctor shall start the system and choose the search
feature. This feature includes search by symptoms name
and disease name.
2. Doctor should be select one of them.
14
Smart Agent for Medical Diagnosis (DiaMe)
▪ The user will save his data in private account by using username and
password that no one should know them.
▪ Every patient will get a unique code (barcode) encrypted well to avoid
anyone from guessing it or used only by permissions of the patient.
▪ The details of the consultation for the patient including all test results will be
only accessed by the patient.
3. Availability:
4. Throughput:
▪ The System will be on a server with high-speed Internet capability.
▪ Better component design to get better performance.
▪ There will be flexible service for future extension.
Stakeholders
Government.
Medical professionals and other healthcare providers.
Patients.
Medical schools.
Students of health care and Labor unions.
15
Smart Agent for Medical Diagnosis (DiaMe)
System Design
Why UML?
UML represents a collection of best engineering practices that have proven success
in the modeling of large and complex systems. The UML is a very important part in
developing object-oriented software and the software development process. It uses mostly
graphical notations to express the design of software projects. Using it helps project teams
communicate, explore potential design and validate the architectural design of the software.
Block Diagram
16
Smart Agent for Medical Diagnosis (DiaMe)
Use Cases
Use case diagram: it is the simplest representation of user interaction. It has many
components such as actors, boundary, functions, and relationship (include, extend). Figure
6 shows use case of DiaMe system.
Class Diagram
17
Smart Agent for Medical Diagnosis (DiaMe)
Design Patterns
creational patterns: it is used while hiding creation logic rather than instantiating
objects.
structural patterns: it is concerned with class and object composition.
behavioral patterns: it is concerned with communication between objects.
J2EE patterns: it is concerned with the presentation tier.
18
Smart Agent for Medical Diagnosis (DiaMe)
Sequence Diagrams
Sequence diagram: describe interactions among classes to exchange messages over time. It
is a good way to visualize and validate runtime scenarios. It can help to predict how the
system will behave and discover responsibilities. Figure 9 shows the sequence diagram of
DiaMe System.
19
Smart Agent for Medical Diagnosis (DiaMe)
Database Design
20
Smart Agent for Medical Diagnosis (DiaMe)
Database Schema:
21
Smart Agent for Medical Diagnosis (DiaMe)
System Architecture:
System architecture: is a conceptual model that defines the structure of the system.
It can comprise system component. The system architecture of DiaMe show in figure 12.
22
Smart Agent for Medical Diagnosis (DiaMe)
Summary
In this chapter, all system designs were discussed. In the first part, system analysis
was introduced including user and system requirement of DiaMe system. Also, it
contains Function and Non-function of DiaMe system.
In the second part, system design was introduced including all system diagrams. The
diagrams are classified into structural and dynamic diagrams.
Structural diagrams are use case diagram and class diagram, Entity relationship
diagram, schema and system architecture while Dynamic diagram is sequence
diagram.
The use case that represents system functionality, the requirements of the system
from user's perspective.
Class diagram is an essential step that helps the developers see and plan the structure
of the system before the code is written also help to ensure that the system is well
designed from the beginning.
Entity relationship diagram (ERD): contains different symbols and connectors that
visualize two important information: The major entities within the system scope,
and the inter-relationships among these entities.
Chapter 3
Deliverables and Evaluation
Main points
24
Smart Agent for Medical Diagnosis (DiaMe)
Introduction
Evaluations can also be an important tool you use to monitor your project. Although
final evaluations are often mandated by a funding agency or required by a sponsor, Mid-
term evaluations offer the advantage of answering many of the same questions posed
through final evaluations, while providing the opportunity to supply suggestions to improve
the project efficiency and impact while the activities are still being executed.
Did the project succeed at accomplishing the outcomes, goals, and impact desired?
Was the project relevant, effective and efficient?
Does the project have the potential to be sustainable in its operations and impact?
Is the theory expressed in the logical framework upheld?
Information
Documents
Plan
Equipment
Money
Software
Consultation
Project Plan
Tools
Apps
Software
Test Results
Contracts
25
Smart Agent for Medical Diagnosis (DiaMe)
Project Plan
Reports
Minutes
Hardware
Software
Apps
Contracts
Assessment Results
User Manual
The user’s manual consists of five sections: General information, system summary,
getting started, using the system, and reporting.
1. General Information
Crawling refers to dealing with large datasets while Web crawling is internet crawler
which systematically browses the World Wide Web for purpose of web indexing. Web
search engines and other sites use web crawling or spidering software to update web content
or indexes. Figure 13 is the architecture of web crawling shows as follow:
26
Smart Agent for Medical Diagnosis (DiaMe)
Why Arduino?
Arduino has been used in thousands of different projects and applications. The
Arduino software is easy-to-use for beginners and flexible enough for advanced users. It
runs on Mac, Windows, and Linux. Arduino is a key tool to learn new things. Anyone
(children, hobbyists, artists, programmers) can start tinkering just following the step by step
instructions of a kit. Arduino also simplifies the process of working with microcontrollers,
but it offers some advantage for teachers, students, and interested amateurs over other
systems:
27
Smart Agent for Medical Diagnosis (DiaMe)
Open source and extensible software - The Arduino software is published as open
source tools, available for extension by experienced programmers.
2. System Summary:
2.1.System configuration:
2.2.User level:
3. Getting Started:
3.1.System menu:
28
Smart Agent for Medical Diagnosis (DiaMe)
3.2.Exist system:
29
Smart Agent for Medical Diagnosis (DiaMe)
them is when the percentage is less than 50%, no outcome results i.e. disease
does not appear. Another one is to make crawl when determining the
maximum value for the crawl. This value should be greater than the
calculated percentage. The crawl returns with the result. The result contains
selected symptoms, another symptom added after crawling and new diseases
as well.
5. Reporting:
5.1. Report capabilities:
There are two models (male, female). Figure 15 shows that. The
patient should select a specific part of the model. The symptoms of this part
will appear.
30
Smart Agent for Medical Diagnosis (DiaMe)
5.2.Report procedures:
Testing
In this phase, we will provide an information about the software product and
services.
Second: Diagnosis
There are two models. The patient (the user) should select one of them. There are
many cases will be discussed.
Case 1: if the percentage of selected symptoms less than 50%, then no diseases
found. Figure 17 shows that:
31
Smart Agent for Medical Diagnosis (DiaMe)
Case 2: Figure 18 shows that if the percentage of selected symptoms greater than
or equal 50%, then diseases found and it determines the percentage of the crawl. Crawl
may return the result as in Figure 19 and may not retrieve result as in figure 20:
32
Smart Agent for Medical Diagnosis (DiaMe)
33
Smart Agent for Medical Diagnosis (DiaMe)
The novice doctors or researcher should select the search with the symptoms name,
and then enter the symptoms. Figure 22 shows that and the result in figure 23.
34
Smart Agent for Medical Diagnosis (DiaMe)
The novice doctors or researcher should select the search with the disease name,
and then enter the disease. Figure 24 shows that and the result in figure 25.
35
Smart Agent for Medical Diagnosis (DiaMe)
The scientific paper option is available for only novice doctor or researcher. In this
option, the novice doctor or researcher determines that result retrieved by date in figure 26
or relevance in figure 27.
36
Smart Agent for Medical Diagnosis (DiaMe)
Fourth: measurement
This feature was used by the novice doctor. The patient should catch the sensor.
The sensor begins to start with sending data. Data should be signal and beat per minute
(BPM). In other words, the analog reads from the sensor(signal) followed by comma (,)
then the beats per minute (BPM) followed by newline. the app separates the two numbers
and plots them, then it decides the status of the signal if it is normal or not according to the
given BPM to 3 states as follows:
<60: Slow Beats
60-100: Normal
>100: Fast Beats
37
Smart Agent for Medical Diagnosis (DiaMe)
DiaMe system will be evaluated and verified by making tests to some people
(patients) that suffer from any types of diseases and take their tests and medical record and
compare it with our system and see if it meets the appropriate result.
It includes the heart pulse sensor to measure the heart rate. Figure 29 shows the
shape of heart pulse sensors. we will test it on sets of people that have normal heart rate
shows in figure 30, and also abnormal heart rate shows in figure 31.
38
Smart Agent for Medical Diagnosis (DiaMe)
In this phase, there are many options such as diagnose by disease name,
symptoms name, and a scientific paper. Before evaluating these options. We will introduce
the algorithm that is applied.
39
Smart Agent for Medical Diagnosis (DiaMe)
40
Smart Agent for Medical Diagnosis (DiaMe)
to search for any scientific paper. Also, the novice doctor should determine the
search date if he wants recent researches. This option also is available.
Diagnose:
This is available for patients (users). The patient should select the type of
model, then choose the part of the model (liver for example). The symptoms will
have displayed from the database. the patient should check the symptoms then the
result will have displayed after applying the algorithm and show possible diseases.
If the percentage is less than 50%, web crawling will work to retrieve the possible
diseases, new symptoms then storing it in the database. every disease retrieved will
have the description.
Summary
41
Smart Agent for Medical Diagnosis (DiaMe)
Chapter 4
Discussion and Conclusion
Main points
42
Smart Agent for Medical Diagnosis (DiaMe)
Introduction
This chapter reflects on the main findings of the research in terms of its contributions
to the key issues of the medical diagnosis system (smart agent for medical diagnosis),
questions raised in the medical field and the methodology of agent-based modeling applied
to these issues.
Main Findings
When starting to write the main findings, we should answer the following question.
1. What are the main features of smart agent for medical diagnosis system
(DiaMe) and how do they operate in practice?
2. What are the barriers and enablers to DiaMe?
3. What is the impact of DiaMe on doctor and patients?
The project starts with gathering data about medical diagnosis system, medical
websites, diseases (liver) for example and its symptoms.
After that classifying liver diseases. Classification of the diseases shows in table 3.
43
Smart Agent for Medical Diagnosis (DiaMe)
Budd-Chiari syndrome
Hypercoagulable disorders1.
liver injury
cancer
parasitic infection
Cirrhosis
chronic hepatitis
alcoholism
chronic bile duct obstruction
The main features in this project are measurement, diagnosis, search and a
scientific paper. There are two features require internet while others not require.
Search, scientific paper, and diagnosis require internet because it depends on the
crawling from different sites. Measurement based on external hardware component
(pulse heart rate). The measurement option read pulse heart rate and drawing it to
show if the patient (user) is normal or abnormal heart rate. The search feature
includes two options, one for symptoms while other for the disease. The scientific
paper is available for the doctor to retrieve links to paper, definition, citation. It
also includes search with a specific date.
In this project, there are some barriers and enablers. If the user (patient) selects
symptoms and the percentage of applying Apriori less than 50%, the system show
percentage only without related diseases of selected symptoms. If there is no
44
Smart Agent for Medical Diagnosis (DiaMe)
DiaMe system allows the user (patient) to measure blood pressure and heart rate by
additional devices (Arduino, sensors) and discover if it is normal or he is suffering
from any problem.
DiaMe system allows the user (patient) to do full services at home or anywhere
without going to the doctor. It provides some services which can help save time,
analyze and predict some medical issues. Among these services, it has the ability to
perform diagnosis for the patient based on the symptoms.
DiaMe is a good choice for novice doctors because it is making the diagnoses Phase
easier by using two available options (search by disease name, symptoms name and
for scientific papers). if the user is a researcher it can provide a high level of
information about the disease of interest which includes the related published papers.
45
Smart Agent for Medical Diagnosis (DiaMe)
Practical Implementations:
It contains the implementation of the algorithm discussed, and also includes samples code
of feature in the project and Arduino code
int count = 0;
double diseaseRatio = 0;
//dictionary<diseaseId,matchRatio>
46
Smart Agent for Medical Diagnosis (DiaMe)
if (disease.Value>=1)
{
dictDiseaseRatio = ((double)disease.Value / selectedDiseases.Count) * 100;
//if this disease has at least a 50% percent match ratio of selected symptoms
//used in Disease info to get each disease matching by id
if (dictDiseaseRatio>=50)
{
validDiseases.Add(disease.Key, dictDiseaseRatio);
}
}
diseaseRatio = Math.Round(diseaseRatio,3);
if (max > 0)
{
//var diseaseIdList = result.Where(a => a.Value == max).Select(a => a.Key).ToList();
//this list contains diseases which only has at least 1 match point for the selected symps
//contains ids for diseases which has at least a 50% percent match ratio of selected symptoms
//used to initialize the listbox in localResult Form
var diseaseIdList = validDiseases.Select(a => a.Key).ToList();
if (Names.Length > 2)
{
Names = Names.Remove(Names.Length - 1);
}
//MessageBox.Show($"The Disease is : {Names} with a match ratio of : {diseaseRatio}%");
47
Smart Agent for Medical Diagnosis (DiaMe)
}
else
{
MessageBox.Show($"No Diseases found related to the selected symptoms with a match ratio of:
{diseaseRatio}%");
return diseaseRatio;
publicpartialclassScientific_Papers : Form
{
public Scientific_Papers()
{
InitializeComponent();
}
48
Smart Agent for Medical Diagnosis (DiaMe)
if (txtbxSearch.Text != "")
{
this.webBrowser1.DocumentCompleted += delegate
{
if (complete)
return;
complete = true;
HashSet<ScientificPaper> SearchResult=
GoogleScraper.SearchForPaper(webBrowser1.Document);
dataGridView1.Style = MetroFramework.MetroColorStyle.Purple;
dataGridView1.ForeColor = Color.Black;
dataGridView1.DataSource = dataSource;
lblpapersCount.Text = SearchResult.Count.ToString();
// dataGridView1.Refresh();
}, null);
});
};
webBrowser1.ScriptErrorsSuppressed = true;
49
Smart Agent for Medical Diagnosis (DiaMe)
string url="";
if (rdbtnCustomDate.Checked)
{
int dateFrom, dateTo;
dateFrom = DatePickerFrom.Value.Year;
dateTo = DatePickerTo.Value.Year;
if (rdbtnSortByRelevance.Checked)
{
url =
$"https://scholar.google.com.eg/scholar?q={queryStringParams}&as_ylo={dateFrom}&as_yhi={dateTo}";
elseif (rdbtnSortByDate.Checked)
{
url =
$"https://scholar.google.com.eg/scholar?q={queryStringParams}&scisbd=1&as_ylo={dateFrom}&as_yhi={
dateTo}";
elseif(rdbtnNoFilters.Checked)
{
if (rdbtnSortByRelevance.Checked)
{
url = $"https://scholar.google.com.eg/scholar?q={queryStringParams}";
elseif (rdbtnSortByDate.Checked)
{
url = $"https://scholar.google.com.eg/scholar?q={queryStringParams}&scisbd=1";
}
}
webBrowser1.Navigate(url);
else
{
MessageBox.Show("Search Query Cannot Be Empty");
50
Smart Agent for Medical Diagnosis (DiaMe)
Diagnose feature :
publicpartialclassfemale: MetroFramework.Forms. MetroForm
{
bool checklistFilled = false;
HashSet<string> diseases;
HashSet<string> symptoms;
public female()
{
InitializeComponent();
}
privatevoid button3_Click(object sender, EventArgs e)
{
this.Close();
Form1 main = new Form1();
main.ShowDialog();
}
if (checklistFilled==false)
{
51
Smart Agent for Medical Diagnosis (DiaMe)
checkedListBox1.Items.Add(symptom.symptom_name);
checklistFilled = true;
}
// SymptomChecker.Match_Disease(checkedListBox1.CheckedItems);
//}
if (txtRatio.Text.Length > 0)
{
52
Smart Agent for Medical Diagnosis (DiaMe)
this.webBrowser1.DocumentCompleted += delegate
{
if (complete)
return;
complete = true;
}, null);
});
};
webBrowser1.ScriptErrorsSuppressed = true;
//webBrowser1.Visible = false;
if (checkedListBox1.CheckedItems.Count > 0)
{
string queryStringParams = "";
webBrowser1.Navigate(url);
}
else
{
MessageBox.Show("Please Choose Sypmtoms !");
}
}
}
else
{
53
Smart Agent for Medical Diagnosis (DiaMe)
Search feature:
publicpartialclassSearch: MetroFramework.Forms. MetroForm
{
DiagnosisEntities db = new DiagnosisEntities();
HashSet<string> diseases;
HashSet<string> symptoms;
public Search()
{
InitializeComponent();
}
if (txtbxSearch.Text.Length > 0)
{
if (rdbtnDisease.Checked)
{
this.webBrowser1.DocumentCompleted += delegate
54
Smart Agent for Medical Diagnosis (DiaMe)
{
if (complete)
return;
complete = true;
}, null);
});
};
}
elseif (rdbtnSymptom.Checked)
{
this.webBrowser1.DocumentCompleted += delegate
{
if (complete)
return;
complete = true;
}, null);
});
};
}
55
Smart Agent for Medical Diagnosis (DiaMe)
webBrowser1.ScriptErrorsSuppressed = true;
//webBrowser1.Visible = false;
if (rdbtnDisease.Checked)
{
queryStringParams = txtbxSearch.Text;
webBrowser1.Navigate(url);
}
else
{
queryStringParams = $"addterm={txtbxSearch.Text}";
webBrowser1.Navigate(url);
}
}
else
{
MessageBox.Show("Please Write A Sypmtom !");
}
56
Smart Agent for Medical Diagnosis (DiaMe)
f.ShowDialog();
}
Measurement feature: it has two parts, one for Arduino while other for C#
application.
/* Pulse Sensor Amped 1.5 by Joel Murphy and Yury Gitman http://www.pulsesensor.com
This code:
3) Determines BPM
Read Me:
https://github.com/WorldFamousElectronics/PulseSensor_Amped_Arduino/blob/master/README.
md
*/
// Variables
57
Smart Agent for Medical Diagnosis (DiaMe)
volatile int BPM; // int that holds raw Analog in 0. updated every 2mS
volatile int IBI = 600; // int that holds the time interval between beats! Must be seeded!
volatile boolean Pulse = false; // "True" when User's live heartbeat is detected. "False" when not
a "live beat".
// https://github.com/WorldFamousElectronics/PulseSensor_Amped_Processing_Visualizer
// SERIAL_PLOTTER outputs sensor data for viewing with the Arduino Serial Plotter
void setup(){
// IF YOU ARE POWERING The Pulse Sensor AT VOLTAGE LESS THAN THE BOARD
VOLTAGE,
// UN-COMMENT THE NEXT LINE AND APPLY THAT VOLTAGE TO THE A-REF PIN
// analogReference(EXTERNAL);
58
Smart Agent for Medical Diagnosis (DiaMe)
void loop(){
serialOutput() ;
void ledFadeToBeat(){
fadeRate = constrain(fadeRate,0,255); // keep LED fade value from going into negative
numbers!
Interrupt:
59
Smart Agent for Medical Diagnosis (DiaMe)
volatile int thresh = 530; // used to find instant moment of heart beat, seeded
volatile boolean firstBeat = true; // used to seed rate array so we startup with reasonable BPM
volatile boolean secondBeat = false; // used to seed rate array so we startup with reasonable
BPM
TCCR2A = 0x02; // DISABLE PWM ON DIGITAL PINS 3 AND 11, AND GO INTO CTC
MODE
OCR2A = 0X7C; // SET THE TOP OF THE COUNT TO 124 FOR 500Hz SAMPLE RATE
int N = sampleCounter - lastBeatTime; // monitor the time since the last beat to avoid noise
60
Smart Agent for Medical Diagnosis (DiaMe)
if(Signal < thresh && N > (IBI/5)*3){ // avoid dichrotic noise by waiting 3/5 of last IBI
if(Signal > thresh && Signal > P){ // thresh condition helps avoid noise
Pulse = true; // set the Pulse flag when we think there is a pulse
for(int i=0; i<=9; i++){ // seed the running total to get a realisitic BPM at startup
rate[i] = IBI;
61
Smart Agent for Medical Diagnosis (DiaMe)
BPM = 60000/runningTotal; // how many beats can fit into a minute? that's BPM!
if (Signal < thresh && Pulse == true){ // when the values are going down, the beat is over
62
Smart Agent for Medical Diagnosis (DiaMe)
T = thresh;
//////////
/////////
63
Smart Agent for Medical Diagnosis (DiaMe)
void serialOutput()
Serial.print(Signal);
Serial.print(",");
Serial.println(BPM);
chart1.ChartAreas[0].CursorX.AutoScroll = true;
chart1.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
chart1.Series.Clear();
chart1.Series.Add("Signal");
chart1.Series.Add("BPM");
chart1.Series["Signal"].ChartType = SeriesChartType.FastLine;
chart1.Series["BPM"].ChartType = SeriesChartType.FastLine;
}
int i = 0;
// timer function that gets activated every time interval (50 ms)
private void timer1_Tick(object sender, EventArgs e)
{
if (comboBox1.Text.Length > 0)
{
if (!serialPort1.IsOpen)
64
Smart Agent for Medical Diagnosis (DiaMe)
serialPort1.Open();
//serialPort1.BaudRate = 9600;
//serialPort1.PortName = comboBox1.Text;
//serialPort1.Open();
string read = serialPort1.ReadLine();
read = serialPort1.ReadLine().TrimEnd();
if (read.Split(',').Length == 2)
{
try
{
int y0 = int.Parse(read.Split(',')[0]);
int y1 = int.Parse(read.Split(',')[1]);
if (y0 > 1000)
y0 = 1000;
if (y1 > 150)
y1 = 150;
if (i > 200)
{
chart1.ChartAreas[0].AxisX.ScaleView.Position = i-190;
}
}
catch (Exception ex)
{
//MessageBox.Show(read);
}
}
//serialPort1.Close();
}
}
65
Smart Agent for Medical Diagnosis (DiaMe)
{
timer1.Enabled = true;
sendBtn.ForeColor = Color.Green;
serialPort1.BaudRate = 9600;
serialPort1.PortName = comboBox1.Text;
serialPort1.Open();
}
else
{
timer1.Enabled = false;
sendBtn.ForeColor = Color.Red;
serialPort1.Close();
}
}
}
Limitations
This study looked at the efficacy of diagnosing the diseases based on symptoms,
crawling for disease name and also for searching about scientific paper for the novice doctor.
The results were very positive; however, because we only looked at liver part of the patients,
these findings may translate to other parts of the body. A statement to this effect could be
declared in the limitations section of the manuscript, followed up by a comment about how
the results might still be widely applicable as they will help with patient-specific treatment
in all parts of the world.
Although the system has reached its aims, there were unavoidable limitations. First,
because of the internet, the appropriate disease for diagnosis can't be identified when it isn't
found in the database. And also, when the doctor search for disease name or scientific paper.
The slow network might discourage doctors interest and motivation in joining peer feedback
so The internet is very important in this project. Second, rent of the cloud is very costly.
Future Recommendation
There are a number of gaps in our knowledge around the smart agent medical
diagnosis that follows from our findings, and would benefit from further research, including
realist evaluation to extend and further test We have developed here:
66
Smart Agent for Medical Diagnosis (DiaMe)
Gaps in measurement:
Gaps in diagnosis:
The database includes some of the diseases and related symptoms. When applying
crawling and return with the result added it in DB. The problem found here is there is a
duplication of symptoms.
Gaps in crawling:
When applying crawl from different sites, we want to use the APIs but this still not
working yet.
Conclusion Summary
This project is considered a great support to health and life quality of the affected
communities. Many developing countries are facing the shortage of medical experts in the
medical field. Due to the shortage of medical expert, they are getting a huge queue of
patients in hospitals. Especially in rural areas we have a young medical expert or don't have
the medical expertise. Dime-Smart Agent for Medical Diagnosis can be a substitute for the
above problem. This is very useful to diagnose patient diseases and prescribe the good
prescription to the patients as a human medical expert. From the above study, it is concluded
that DiaMe-Smart Agent for Medical Diagnosis System can be applied any country for
improving medical diagnosis. Also, this system can be applied anytime, anyplace, to
provides a medical prescription for general diseases. The system adopts user-friendly
control interface and the usage of easy words makes the user operate the system without
doubts and difficulties.
67
Smart Agent for Medical Diagnosis (DiaMe)
References
[1] Shiva Kazempour Dehkordi and Hedieh Sajedi; “A Prescription-based Automatic
Medical Diagnosis System using a Stacking Method”;. IEEE 15th International
Symposium on Intelligent Systems and Informatics, September 14-16, 2017 •
Subotica, Serbia.
[2] Preety Dagar, Aman Jatain and Dr. Deepti Gaur; “MEDICAL DIAGNOSIS
SYSTEM USING FUZZY LOGIC TOOLBOX"; International Conference on
Computing, Communication, and Automation (CCCA); 2015, ISBN:978-1-4799-
8890-7/15/$31.00 ©2015 IEEE.
[3] Minoru Mori, Tetsuo Tsukahara, Kazuhiko Shinozawa, Norihiro Hagita and
Michiko Furutani; “Medical Diagnosis Support System for Disease Prevention and
Its Interface”; 978-1-4244-4713-8/10/$25.00 ©2010 IEEE.
https://www.softwareadvice.com/medical/athenacollector-athenaclinicals-profile/
(Last accesses on 4/10/2016).
[7] Cássio R. S. Souza, Guilherme F. Ribeiro, Lorenzo L. Rizzini, Tiago Martines, Lucia V. L.
Filgueiras; “Adaptive assisted medical diagnosis system for mobile devices
68