Medical Care 1
Medical Care 1
Medical Care 1
BACHELOR OF TECHNOLOGY
In
Computer Science & Engineering
Submitted by
PABBOJU NAVEEN KUMAR 19D31A0573
THARIGOPPULA MANASA 20D35A0519
JOGINI KAVERI 19D31A0544
Under the Guidance of
JANUARY 2023
i
INDUR INSTITUTE OF ENGINEERING & TECHNOLOGY
Ponnala (V), Siddipet (Mdl&Dist), Telangana State, PIN: 502277
Date: / /2022
CERTIFICATE
EXTERNAL EXAMINER
ii
ACKNOWLEGEMENT
We are thankful to MR. RITESH THAKUR, Prof & Head, Dept. of CSE,
Indur Institute of Engineering & Technology, for extending his help in the
department academic activities in the course duration. He is the personality of
dynamic, enthusiastic in the academic activities.
We sincerely acknowledge to all the lecturers of the Dept. of CSE for their motivation
during my B. Tech course.
We would like to say thanks to all of our friends for their timely help and
encouragement.
iii
DECLARATION
iv
ABSTRACT
v
CONTENTS
1 INTRODUCTION 2
3.3.1 Python
3.3.2 Django
5 Requirement Analysis
vi
5 IMPLEMENTATION 46-54
5.1 Modules
5.2.1 Doctor
5.2.2 Patient
5.2.3 Admin
6 RESULTS 56-61
8 CONCLUSION 69
8.1 Conclusion
9 BIBLIOGRAPHY 71-72
vii
LIST OF FIGURES
1 Django architecture 24
2 Model view template 25
3 System Architecture 38
4 Data Flow Diagram 39
5 Use Case Diagram 41
6 Class Diagram 42
7 Sequence Diagram 43
8 Activity Diagram 44
Doctor
9 Registration Page 56
10 Doctor Page 56
11 View Patient Data 57
12 Add Treatment 57
Patient
13 Registration Page 58
14 Patient Page 58
15 Treatment 58
Hospital
16 HSP Page 59
17 Upload Patient Data 59
18 View Patient Data 59
Admin
19 Admin Page 60
20 Patient Details 60
21 Doctor Details 60
22 Store Data 61
23 SVM 61
24 Decision Tree 61
viii
CHAPTER – 1
1
INTRODUCTION
2
CHAPTER – 2
3
LITERATURE SURVEY
4
3)Liver segmentation from CT images using a sparse priori statistical shape
model (SP-SSM)
5
4)Automatic Detection of Cerebral Microbleeds From MR Images via 3D
Convolutional Neural Networks
AUTHORS:Qin Yu, Tao Jiang, Aiyun Zhou, Lili Zhang, Cheng Zhang & Pan
Xu
Cerebral microbleeds (CMBs) are small haemorrhages nearby blood vessels. They
have been recognized as important diagnostic biomarkers for many cerebrovascular
diseases and cognitive dysfunctions. In current clinical routine, CMBs are manually
labelled by radiologists but this procedure is laborious, time-consuming, and error
prone. In this paper, we propose a novel automatic method to detect CMBs from
magnetic resonance (MR) images by exploiting the 3D convolutional neural network
(CNN). Compared with previous methods that employed either low-level hand-crafted
descriptors or 2D CNNs, our method can take full advantage of spatial contextual
information in MR volumes to extract more representative high-level features for
CMBs, and hence achieve a much better detection accuracy. To further improve the
detection performance while reducing the computational cost, we propose a cascaded
framework under 3D CNNs for the task of CMB detection. We first exploit a 3D fully
convolutional network (FCN) strategy to retrieve the candidates with high
probabilities of being CMBs, and then apply a well-trained 3D CNN discrimination
model to distinguish CMBs from hard mimics. Compared with traditional sliding
window strategy, the proposed 3D FCN strategy can remove massive redundant
computations and dramatically speed up the detection process. We constructed a large
dataset with 320 volumetric MR scans and performed extensive experiments to
validate the proposed method, which achieved a high sensitivity of 93.16% with an
average number of 2.74 false positives per subject, outperforming previous methods
using low-level descriptors or 2D CNNs by a significant margin. The proposed
method, in principle, can be adapted to other biomarker detection tasks from
volumetric medical data.
6
5)Automatic Classification of Specific Melanocytic Lesions Using Artificial
Intelligence
Background. Given its propensity to metastasize, and lack of effective therapies for
most patients with advanced disease, early detection of melanoma is a clinical
imperative. Different computer-aided diagnosis (CAD) systems have been proposed
to increase the specificity and sensitivity of melanoma detection. Although such
computer programs are developed for different diagnostic algorithms, to the best of
our knowledge, a system to classify different melanocytic lesions has not been
proposed yet. Method. In this research we present a new approach to the classification
of melanocytic lesions. This work is focused not only on categorization of skin lesions
as benign or malignant but also on specifying the exact type of a skin lesion including
melanoma, Clark nevus, Spitz/Reed nevus, and blue nevus. The proposed automatic
algorithm contains the following steps: image enhancement, lesion segmentation,
feature extraction, and selection as well as classification. Results. The algorithm has
been tested on 300 dermoscopic images and achieved accuracy of 92% indicating that
the proposed approach classified most of the melanocytic lesions correctly.
Conclusions. A proposed system can not only help to precisely diagnose the type of
the skin mole but also decrease the amount of biopsies and reduce the morbidity
related to skin lesion excision.
7
CHAPTER – 3
8
SYSTEM ANALYSIS
Computer technology could be used to reduce the number of mortality and reduce the
waiting time to see the specialist. Computer programs or software developed by
emulating human intelligence could be used to assist the doctors in making decisions
without consulting the specialists directly. The software was not meant to replace the
specialist or doctor, yet it was developed to assist general practitioners and specialists
take immediate action to produce as many doctors as possible. However, while
waiting for students to become doctors and the doctors to become specialists, many
patients may already die. Current practice for medical treatment required patients to
consult specialists for further treatment. Artificial intelligence provides students with
more opportunities to participate in a digital and dynamic way.
.we can’t predict any type of cancer like breast cancer or skin cancer etc..
9
3.2 PROPOSED SYSTEM:
In this paper, Focusing on research about ML in medical care currently, its focus is
basically on the judgement of the symptoms and the improvement of related medical
measures.
Certainly, relevant researchers are able to reduce the investment of medical resources
and avoid subjective error caused by human’s judgement themselves.
With the development of medical technology Machine learning has been studied for
the prediction of tumor, follow-up treatment and so on. At present, relevant study has
made a significance in breast cancer, lung cancer, skin cancer. Researchers are still
advancing research on other cancers.
By implementing machine learning we can predict breast cancer, lung cancer, skin
cancer..
Recommendations on health and treatments for diseases are personalized based on the
patient’s medical history, diet, stress levels, past conditions, etc.
Robots are being trained to perform complicated surgeries on humans and, that too,
as efficient as a human doctor. Imagine an era where a patient can scan an image of
his skin through his phone and know what kind of disease he is suffering with.
10
3.3 SYSTEM Environment
3.3.1 PYTHON
Invoking the interpreter without passing a script file as a parameter brings up the
following prompt –
$ python
Python 2.4.3 (#1, Nov 11 2010, 13:34:43)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.>>>
Type the following text at the Python prompt and press the Enter –
>>> print “Hello, Python!”
If you are running new version of Python, then you would need to use print statement
with parenthesis as in print (“Hello, Python!”);. However in Python version 2.4.3, this
produces the following result –
Hello, Python!
11
Script Mode Programming
Invoking the interpreter with a script parameter begins execution of the script and
continues until the script is finished. When the script is finished, the interpreter is no
longer active.
Let us write a simple Python program in a script. Python files have extension .py.
Type th following source code in a test.py file –
Live Demo
print “Hello, Python!”
We assume that you have Python interpreter set in PATH variable. Now, try to run
this program as follows –
$ python test.py
This produces the following result –
Hello, Python!
Let us try another way to execute a Python script. Here is the modified test.py file –
Live Demo
#!/usr/bin/python
print “Hello, Python!”
We assume that you have Python interpreter available in /usr/bin directory. Now, try
to run this program as follows –
Hello, Python!
Python Identifiers
A Python identifier is a name used to identify a variable, function, class, module or
other object. An identifier starts with a letter A to Z or a to z or an underscore (_)
followed by zero or more letters, underscores and digits (0 to 9).
Python does not allow punctuation characters such as @, $, and % within identifiers.
Python is a case sensitive programming language. Thus, Manpower and manpower
are two different identifiers in Python.
12
Here are naming conventions for Python identifiers –
Class names start with an uppercase letter. All other identifiers start with a lowercase
letter.
Starting an identifier with a single leading underscore indicates that the identifier is
private.
Starting an identifier with two leading underscores indicates a strongly private
identifier.
If the identifier also ends with two trailing underscores, the identifier is a language-
defined special name.
Reserved Words
The following list shows the Python keywords. These are reserved words and you
cannot use them as constant or variable or any other identifier names. All the Python
keywords contain lowercase letters only.
13
if True:
print “True”
else:
print “False”
However, the following block generates an error –
if True:
print “Answer”
print “True”
else:
print “Answer”
print “False”
Thus, in Python all the continuous lines indented with same number of spaces would
form a block. The following example has various statement blocks –
Note – Do not try to understand the logic at this point of time. Just make sure you
understood various blocks even if they are without braces.
#!/usr/bin/python
import sys
try:
# open file stream
file = open(file_name, “w”)
except IOError:
print “There was an error writing to”, file_name
sys.exit()
print “Enter ‘”, file_finish,
print “’ When finished”
while file_text != file_finish:
file_text = raw_input(“Enter text: “)
if file_text == file_finish:
# close the file
file.close
break
file.write(file_text)
file.write(“\n”)
14
file.close()
file_name = raw_input(“Enter filename: “)
if len(file_name) == 0:
print “Next time please enter something”
sys.exit()
try:
file = open(file_name, “r”)
except IOError:
print “There was an error reading file”
sys.exit()
file_text = file.read()
file.close()
print file_text
Multi-Line Statements
Statements in Python typically end with a new line. Python does, however, allow the
use of the line continuation character (\) to denote that the line should continue. For
example –
total = item_one + \
item_two + \
item_three
Statements contained within the [], {}, or () brackets do not need to use the line
continuation character. For example –
word = ‘word’
sentence = “This is a sentence.”
Paragraph = “””This is a paragraph. It is
15
made up of multiple lines and sentences.”””
Comments in Python
A hash sign (#) that is not inside a string literal begins a comment. All characters after
the # and up to the end of the physical line are part of the comment and the Python
interpreter ignores them.
Live Demo
#!/usr/bin/python
# First comment
print “Hello, Python!” # second comment
This produces the following result –
Hello, Python!
You can type a comment on the same line after a statement or expression –
# This is a comment.
# This is a comment, too.
# This is a comment, too.
# I said that already.
Following triple-quoted string is also ignored by Python interpreter and can be used as
a multiline comments:
‘’’
This is a multiline
comment.
‘’’
Using Blank Lines
A line containing only whitespace, possibly with a comment, is known as a blank line
and Python totally ignores it.
16
In an interactive interpreter session, you must enter an empty physical line to
terminate a multiline statement.
#!/usr/bin/python
raw_input(“\n\nPress the enter key to exit.”)
Here, “\n\n” is used to create two new lines before displaying the actual line. Once the
user presses the key, the program ends. This is a nice trick to keep a console window
open until the user is done with an application.
Multiple Statements on a Single Line
The semicolon ( ; ) allows multiple statements on the single line given that neither
statement starts a new code block. Here is a sample snip using the semicolon.
Import sys; x = ‘foo’; sys.stdout.write(x + ‘\n’)
Multiple Statement Groups as Suites
A group of individual statements, which make a single code block are called suites in
Python. Compound or complex statements, such as if, while, def, and class require a
header line and a suite.
Header lines begin the statement (with the keyword) and terminate with a colon ( : )
and are followed by one or more lines which make up the suite. For example –
if expression :
suite
elif expression :
suite
else :
suite
Command Line Arguments
Many programs can be run to provide you with some basic information about how
they should be run. Python enables you to do this with -h –
$ python -h
usage: python [option] … [-c cmd | -m mod | file | -] [arg] …
17
Options and arguments (and corresponding environment variables):
-c cmd : program passed in as string (terminates option list)
-d : debug output from parser (also PYTHONDEBUG=x)
-E : ignore environment variables (such as PYTHONPATH)
-h : print this help message and exit
You can also program your script in such a way that it should accept various options.
Command Line Arguments is an advanced topic and should be studied a bit later once
you have gone through rest of the Python concepts.
Python Lists
The list is a most versatile datatype available in Python which can be written as a list
of comma-separated values (items) between square brackets. Important thing about a
list is that items in a list need not be of the same type.
tup1 = ();
18
To write a tuple containing a single value you have to include a comma, even though
there is only one value –
tup1 = (50,);
Like string indices, tuple indices start at 0, and they can be sliced, concatenated, and
so on.
Accessing Values in Tuples
To access values in tuple, use the square brackets for slicing along with the index or
indices to obtain value available at that index. For example –
Live Demo
#!/usr/bin/python
tup1[0]: physics
tup2[1:5]: [2, 3, 4, 5]
Updating Tuples
Live Demo
#!/usr/bin/python
19
dict[‘Name’]: Zara
dict[‘Age’]: 7
If we attempt to access a data item with a key, which is not part of the dictionary, we
get an error as follows –
Live Demo
#!/usr/bin/python
dict[‘Alice’]:
Traceback (most recent call last):
File “test.py”, line 4, in <module>
print “dict[‘Alice’]: “, dict[‘Alice’];
KeyError: ‘Alice’
Updating Dictionary
You can update a dictionary by adding a new entry or a key-value pair, modifying an
existing entry, or deleting an existing entry as shown below in the simple example –
Live Demo
#!/usr/bin/python
dict[‘Age’]: 8
dict[‘School’]: DPS School
20
Delete Dictionary Elements
You can either remove individual dictionary elements or clear the entire contents of a
dictionary. You can also delete entire dictionary in a single operation.
To explicitly remove an entire dictionary, just use the del statement. Following is a
simple example –
Live Demo
#!/usr/bin/python
dict[‘Age’]:
Traceback (most recent call last):
File “test.py”, line 8, in <module>
print “dict[‘Age’]: “, dict[‘Age’];
TypeError: ‘type’ object is unsubscriptable
Note – del() method is discussed in subsequent section.
21
More than one entry per key not allowed. Which means no duplicate key is
allowed. When duplicate keys encountered during assignment, the last assignment
wins. For example –
Live Demo
#!/usr/bin/python
dict[‘Name’]: Manni
(b) Keys must be immutable. Which means you can use strings, numbers or tuples as
dictionary keys but something like [‘key’] is not allowed. Following is a simple
example –
Live Demo
#!/usr/bin/python
22
tup2 = (‘abc’, ‘xyz’);
To explicitly remove an entire tuple, just use the del statement. For example –
Live Demo
#!/usr/bin/python
tup = (‘physics’, ‘chemistry’, 1997, 2000);
print tup;
del tup;
print “After deleting tup : “;
print tup;
This produces the following result. Note an exception raised, this is because after del
tup tuple does not exist any more –
(‘physics’, ‘chemistry’, 1997, 2000)
After deleting tup :
Traceback (most recent call last):
File “test.py”, line 9, in <module>
print tup;
NameError: name ‘tup’ is not defined
3.3.2 DJANGO
23
Django is a high-level Python Web framework that encourages rapid development
and clean, pragmatic design. Built by experienced developers, it takes care of much of
the hassle of Web development, so you can focus on writing your app without
needing to reinvent the wheel. It’s free and open source.
24
fig(2). Model View Template
Create a Project
Whether you are on Windows or Linux, just get a terminal or a cmd prompt and
navigate to the place you want your project to be created, then use this code –
myproject/
manage.py
myproject/
__init__.py
settings.py
urls.py
wsgi.py
25
The Project Structure
The “myproject” folder is just your project container, it actually contains two
elements –
manage.py – This file is kind of your project local 26jango-admin for interacting with
your project via command line (start the development server, sync db…). To get a full
list of command accessible via manage.py you can use the code –
$ python manage.py help
The “myproject” subfolder – This folder is the actual python package of your project.
It contains four files –
__init__.py – Just for python, treat this folder as package.
Settings.py – As the name indicates, your project settings.
Urls.py – All links of your project and the function to call. A kind of ToC of your
project.
Wsgi.py – If you need to deploy your project over WSGI.
Setting Up Your Project
Your project is set up in the subfolder myproject/settings.py. Following are some
important options you might need to set –
DEBUG = True
This option lets you set if your project is in debug mode or not. Debug mode lets you
get more information about your project’s error. Never set it to ‘True’ for a live
project. However, this has to be set to ‘True’ if you want the Django light server to
serve static files. Do it only in the development mode.
DATABASES = {
‘default’: {
‘ENGINE’: ‘django.db.backends.sqlite3’,
‘NAME’: ‘database.sql’,
‘USER’: ‘’,
‘PASSWORD’: ‘’,
‘HOST’: ‘’,
‘PORT’: ‘’,
}
}
26
Database is set in the ‘Database’ dictionary. The example above is for SQLite engine.
As stated earlier, Django also supports –
MySQL (27jango.db.backends.mysql)
PostGreSQL (27jango.db.backends.postgresql_psycopg2)
Oracle (27jango.db.backends.oracle) and NoSQL DB
MongoDB (27jango_mongodb_engine)
Before setting any new engine, make sure you have the correct db driver installed.
Now that your project is created and configured make sure it’s working –
Validating models…
0 errors found
September 03, 2015 – 11:41:50
Django version 1.6.11, using settings ‘myproject settings’
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
A project is a sum of many applications. Every application has an objective and can
be reused into another project, like the contact form on a website can be an
application, and can be reused for others. See it as a module of your project.
Create an Application
We assume you are in your project folder. In our main “myproject” folder, the same
folder then manage.py –
27
You just created myapp application and like project, Django create a “myapp” folder
with the application structure –
myapp/
__init__.py
admin.py
models.py
tests.py
views.py
__init__.py – Just to make sure python handles this folder as a package.
Admin.py – This file helps you make the app modifiable in the admin interface.
INSTALLED_APPS = (
‘django.contrib.admin’,
‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.sessions’,
‘django.contrib.messages’,
‘django.contrib.staticfiles’,
‘myapp’,
)
28
Creating forms in Django, is really similar to creating a model. Here again, we just
need to inherit from Django class and the class attributes will be the form fields. Let’s
add a forms.py file in myapp folder to contain our app forms. We will create a login
form.
Myapp/forms.py
class LoginForm(forms.Form):
user = forms.CharField(max_length = 100)
password = forms.CharField(widget = forms.PasswordInput())
As seen above, the field type can take “widget” argument for html rendering; in our
case, we want the password to be hidden, not displayed. Many others widget are
present in Django: DateInput for dates, CheckboxInput for checkboxes, etc.
def login(request):
username = “not logged in”
if request.method == “POST”:
#Get the posted form
MyLoginForm = LoginForm(request.POST)
29
if MyLoginForm.is_valid():
username = MyLoginForm.cleaned_data[‘username’]
else:
MyLoginForm = Loginform()
<html>
<body>
<br>
<br>
30
<div style = “max-width:470px;”>
<center>
</center>
</div>
</form>
</body>
</html>
The template will display a login form and post the result to our login view above.
You have probably noticed the tag in the template, which is just to prevent Cross-site
Request Forgery (CSRF) attack on your site.
{% csrf_token %}
Once we have the login template, we need the loggedin.html template that will be
rendered after form treatment.
<html>
<body>
You are : <strong>{{username}}</strong>
</body>
</html>
Now, we just need our pair of URLs to get started: myapp/urls.py
31
from 32jango.views.generic import TemplateView
urlpatterns = patterns(‘myapp.views’,
url(r’^connection/’,TemplateView.as_view(template_name = ‘login.html’)),
url(r’^login/’, ‘login’, name = ‘login’))
When accessing “/myapp/connection”, we will get the following login.html template
rendered –
Setting Up Sessions
In Django, enabling session is done in your project settings.py, by adding some lines
to the MIDDLEWARE_CLASSES and the INSTALLED_APPS options. This should
be done while creating the project, but it’s always good to know, so
MIDDLEWARE_CLASSES should have –
‘django.contrib.sessions.middleware.SessionMiddleware’
And INSTALLED_APPS should have –
‘django.contrib.sessions’
By default, Django saves session information in database (32jango_session table or
collection), but you can configure the engine to store information using other ways
like: in file or in cache.
When session is enabled, every request (first argument of any view in Django) has a
session (dict) attribute.
Let’s create a simple sample to see how to create and save sessions. We have built a
simple login system before (see Django form processing chapter and Django Cookies
Handling chapter). Let us save the username in a cookie so, if not signed out, when
accessing our login page you won’t see the login form. Basically, let’s make our login
system we used in Django Cookies handling more secure, by saving cookies server
side.
For this, first lets change our login view to save our username cookie server side –
def login(request):
username = ‘not logged in’
32
if request.method == ‘POST’:
MyLoginForm = LoginForm(request.POST)
if MyLoginForm.is_valid():
username = MyLoginForm.cleaned_data[‘username’]
request.session[‘username’] = username
else:
MyLoginForm = LoginForm()
return render(request, ‘loggedin.html’, {“username” : username}
Then let us create formView view for the login form, where we won’t display the
form if cookie is set –
def formview(request):
if request.session.has_key(‘username’):
username = request.session[‘username’]
return render(request, ‘loggedin.html’, {“username” : username})
else:
return render(request, ‘login.html’, {})
Now let us change the url.py file to change the url so it pairs with our new view –
urlpatterns = patterns(‘myapp.views’,
url(r’^connection/’,’formView’, name = ‘loginform’),
url(r’^login/’, ‘login’, name = ‘login’))
When accessing /myapp/connection, you will get to see the following page
33
3.4 SYSTEM STUDY
3.4.1 FEASIBILITY STUDY
The feasibility of the project is analyzed in this phase and business proposal is
put forth with a very general plan for the project and some cost estimates. During
system analysis the feasibility study of the proposed system is to be carried out. This
is to ensure that the proposed system is not a burden to the company. For feasibility
analysis, some understanding of the major requirements for the system is essential.
ECONOMICAL FEASIBILITY
TECHNICAL FEASIBILITY
SOCIAL FEASIBILITY
ECONOMICAL FEASIBILITY
This study is carried out to check the economic impact that the system will have on
the organization. The amount of fund that the company can pour into the research and
development of the system is limited. The expenditures must be justified. Thus the
developed system as well within the budget and this was achieved because most of the
technologies used are freely available. Only the customized products had to be
purchased.
TECHNICAL FEASIBILITY
This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand on
the available technical resources. This will lead to high demands on the available
technical resources. This will lead to high demands being placed on the client. The
developed system must have a modest requirement, as only minimal or null changes
are required for implementing this system.
34
SOCIAL FEASIBILITY
The aspect of study is to check the level of acceptance of the system by the
user. This includes the process of training the user to use the system efficiently. The
user must not feel threatened by the system, instead must accept it as a necessity. The
level of acceptance by the users solely depends on the methods that are employed to
educate the user about the system and to make him familiar with it. His level of
confidence must be raised so that he is also able to make some constructive criticism,
which is welcomed, as he is the final user of the system.
Functional Requirements
1. Python
2. Django
3.
Operating Systems supported
35
1. Windows 7
2. Windows XP
3. Windows 8
Technologies and Languages used to Develop
1. Python
Debugger and Emulator
Any Browser (Particularly Chrome)
Hardware Requirements
36
CHAPTER – 4
37
SYSTEM DESIGN
1. The DFD is also called as bubble chart. It is a simple graphical formalism that
can be used to represent a system in terms of input data to the system, various
processing carried out on this data, and the output data is generated by this system.
2. The data flow diagram (DFD) is one of the most important modeling tools. It
is used to model the system components. These components are the system process,
the data used by the process, an external entity that interacts with the system and the
information flows in the system.
3. DFD shows how the information moves through the system and how it is
modified by a series of transformations. It is a graphical technique that depicts
information flow and the transformations that are applied as data moves from input to
output.
38
4. DFD is also known as bubble chart. A DFD may be used to represent a system
at any level of abstraction. DFD may be partitioned into levels that represent
increasing information flow and functional detail
39
The goal is for UML to become a common language for creating models of object
oriented computer software. In its current form UML is comprised of two major
components: a Meta-model and a notation. In the future, some form of method or
process may also be added to; or associated with, UML.
The UML represents a collection of best engineering practices that have proven
successful in the modeling of large and complex systems.
The UML is a very important part of developing objects oriented software and the
software development process. The UML uses mostly graphical notations to express
the design of software projects.
GOALS: The Primary goals in the design of the UML are as follows:
40
4.3.1 USE CASE DIAGRAM:
A use case diagram in the Unified Modeling Language (UML) is a type of behavioral
diagram defined by and created from a Use-case analysis. Its purpose is to present a
graphical overview of the functionality provided by a system in terms of actors, their
goals (represented as use cases), and any dependencies between those use cases. The
main purpose of a use case diagram is to show what system functions are performed
for which actor. Roles of the actors in the system can be depicted.
41
4.3.2 CLASS DIAGRAM:
42
4.3.3 SEQUENCE DIAGRAM:
43
4.3.4 ACTIVITY DIAGRAM:
44
CHAPTER – 5
45
IMPLEMENTATION
5.1 MODULES:
Doctor.
Patient.
Admin
Machine learning
5.2.1 Doctor:
The Doctor can register the first. While registering he required a valid doctor email
and mobile for further communications. Once the doctor registers, then the admin can
activate the customer. Once the admin activates the customer then the customer can
login into our system. After login he can see the view-patient data. based on patient
symptoms, the doctor will give the precautions and he will give the doctor treatment.
5.2.2 Patient:
The Doctor can register the first. While registering he required a valid patient email
and mobile for further communications. Once the patient registers, then the admin can
activate the patient. Once the admin activates the patient then the patient can login
into our system. After login he can provide symptoms. based on patient symptoms,
the doctor will give the precautions and he will give the doctor treatment.
5.2.3 Admin:
Admin can login with his credentials. Once he logs in he can activate the doctors. The
activated user only login in our applications. Once he logs in he can activate the
patients. . The admin can add new data to the dataset. So this data user can perform
the testing process.admin can get predictions svm algorithm and also get the
prediction from the decision tree.
46
5.2.4 Machine learning:
url.py:
urlpatterns = [
path('admin/', admin.site.urls),
path('index/', doctor.index, name='index'),
path('logout/',medical.logout,name='logout'),
path('admin1/', medical.adminlogin, name='admin1'),
path('adminloginentered/', medical.adminloginentered, name='adminloginentered'),
path('doctordetails/', medical.doctordetails, name='doctordetails'),
path('patientdetails/', medical.patientdetails, name='patientdetails'),
47
path('activatedoctor/',medical.activatedoctor,name='activatedoctor'),
path('activatepatient/',medical.activatepatient,name='activatepatient'),
path('storecsvdata/',medical.storecsvdata,name='storecsvdata'),
path('svm/',medical.svm,name='svm'),
path('decision/',medical.decision,name='decision'),
path('hsplogin/', hsp.hsplogin, name='hsplogin'),
path('hsploginentered/', hsp.hsploginentered, name='hsploginentered'),
path('uploadpatientdata/', hsp.uploadpatientdata,name='uploadpatientdata'),
path('viewpatientdata/', hsp.viewpatientdata,name='viewpatientdata'),
path('doctorlogin/',doctor.doctorlogin,name='doctorlogin'),
path('doctorregister/',doctor.doctorregister,name='doctorregister'),
path('doctorlogincheck/',doctor.doctorlogincheck,name='doctorlogincheck'),
path('doctorviewpatientdata/',doctor.doctorviewpatientdata,name='doctorviewpatientd
ata'),
path('addtreatment/',doctor.addtreatment,name='addtreatment'),
path('patientlogin/',patient.patientlogin,name='patientlogin'),
path('patientregister/',patient.patientregister,name='patientregister'),
path('patientlogincheck/',patient.patientlogincheck,name='patientlogincheck'),
path('treatment/',patient.treatment,name='treatment'),
path('patienttreatmentresult/',patient.patienttreatmentresult,name='patienttreatmentres
ult'),
]
if settings.DEBUG:
urlpatterns +=
static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)
48
views.py:
from collections import defaultdict
from io import TextIOWrapper
import csv
from django.shortcuts import render
from django.http import HttpResponse
from patient.models import patientModel
from patient.forms import patientForm
from doctor.models import doctorModel, storedatamodel
from sklearn.model_selection import train_test_split
from sklearn.svm import SVC
from sklearn.metrics import classification_report, confusion_matrix
import pandas as pd
from django_pandas.io import read_frame
from sklearn.naive_bayes import GaussianNB
from sklearn import metrics
from sklearn import datasets
def logout(request):
return render(request, "index.html")
def adminlogin(request):
return render(request, "admin/adminlogin.html")
def adminloginentered(request):
if request.method == 'POST':
uname=request.POST['uname']
passwd=request.POST['upasswd']
if uname =='admin' and passwd=='admin':
return render(request,"admin/adminloginentered.html")
else:
return HttpResponse("invalied credentials")
return render(request, "admin/adminloginentered.html")
49
def doctordetails(request):
qs=doctorModel.objects.all()
return render(request,'admin/doctordetails.html',{"object":qs})
def patientdetails(request):
qs=patientModel.objects.all()
return render(request,'admin/patientdetails.html',{"object":qs})
def activatedoctor(request):
if request.method == 'GET':
uname = request.GET.get('pid')
print(uname)
status = 'Activated'
print("pid=", uname, "status=", status)
doctorModel.objects.filter(id=uname).update(status=status)
qs = doctorModel.objects.all()
return render(request,"admin/doctordetails.html", {"object": qs})
def activatepatient(request):
if request.method == 'GET':
uname = request.GET.get('pid')
print(uname)
status = 'Activated'
print("pid=", uname, "status=", status)
patientModel.objects.filter(id=uname).update(status=status)
qs = patientModel.objects.all()
return render(request, 'admin/patientdetails.html', {"object": qs})
def storecsvdata(request):
if request.method == 'POST':
name = request.POST.get('name')
csvfile =TextIOWrapper( request.FILES['file'])
columns = defaultdict(list)
storecsvdata =csv.DictReader(csvfile)
50
for row1 in storecsvdata:
Pregnancies = row1["Pregnancies"]
Glucose = row1["Glucose"]
BloodPressure = row1["BloodPressure"]
SkinThickness = row1["SkinThickness"]
Insulin = row1["Insulin"]
DiabetesPedigreeFunction = row1["DiabetesPedigreeFunction"]
Age = row1["Age"]
BMI = row1["BMI"]
Outcome = row1["Outcome"]
storedatamodel.objects.create(Pregnancies=Pregnancies, Glucose=Glucose,
BloodPressure=BloodPressure,
SkinThickness=SkinThickness,
Insulin=Insulin,BMI=BMI,DiabetesPedigreeFunction=DiabetesPedigreeFunction,Age
=Age,Outcome=Outcome)
print("Name is ",csvfile)
return HttpResponse('CSV file successful uploaded')
else:
return render(request, 'admin/storecsvdata.html', {})
doctors.html:
{% extends 'base.html' %}
{% load static %}
{% block contents %}
<div class="main-banner header-text" id="top">
<div class="Modern-Slider">
<!-- Item -->
<div class="item">
<!--<div class="img-fill">-->
<img src="{% static 'images/home.jpg' %}" alt="">
<div class="text-content">
<h3 style="color:blue"><center>Doctor REGISTRATION</center></h3>
<center> <h4><form action="/doctorregister/" method="POST">
51
{% csrf_token %}
<table>
<tr><td style="color:blue">doctor
name</td><td>{{form.name}}</td></tr>
<tr><td
style="color:blue">Password</td><td>{{form.passwd}}</td></tr>
<tr><td
style="color:blue">confirmPassword</td><td>{{form.cwpasswd}}</td></tr>
<tr><td
style="color:blue">Email</td><td>{{form.email}}</td></tr>
<tr><td
style="color:blue">Mobile</td><td>{{form.mobileno}}</td></tr>
<tr><td
style="color:blue">specialization</td><td>{{form.specialization}}</td></tr>
<tr><td></td><td>{{form.status}}</td></tr>
</table>
<input type="submit" value="submit">
</form></h4></center>
{% if messages %}
{% for message in messages %}
<font color='darkred'> {{ message }}</font>
{% endfor %}
{% endif %}
</div>
</div>
</div>
{% endblock %}
52
5.4 INPUT AND OUTPUT DESIGN
5.4.1 INPUT DESIGN
The input design is the link between the information system and the user.
It comprises the developing specification and procedures for data preparation and
those steps are necessary to put transaction data in to a usable form for processing can
be achieved by inspecting the computer to read data from a written or printed
document or it can occur by having people keying the data directly into the system.
The design of input focuses on controlling the amount of input required, controlling
the errors, avoiding delay, avoiding extra steps and keeping the process simple. The
input is designed in such a way so that it provides security and ease of use with
retaining the privacy. Input Design considered the following things:
Methods for preparing input validations and steps to follow when error occur.
OBJECTIVES
3.When the data is entered it will check for its validity. Data can be
entered with the help of screens. Appropriate messages are provided as when needed
so that the user will not be in maize of instant. Thus the objective of input design is to
create an input layout that is easy to follow
53
5.4.2 OUTPUT DESIGN
A quality output is one, which meets the requirements of the end user
and presents the information clearly. In any system results of processing are
communicated to the users and to other system through outputs. In output design it is
determined how the information is to be displaced for immediate need and also the
hard copy output. It is the most important and direct source information to the user.
Efficient and intelligent output design improves the system’s relationship to help user
decision-making.
3.Create document, report, or other formats that contain information produced by the
system.
The output form of an information system should accomplish one or more of the
following objectives.
Future.
Trigger an action.
Confirm an action.
54
CHAPTER – 6
55
Results :
Doctor
56
Fig(11). View Patient Data
57
Patient
Fig(15). Treatment
58
Hospital
59
Admin
60
Fig(22). Store Data
61
CHAPTER – 7
62
SYSTEM TESTING
TYPES OF TESTS
Unit testing involves the design of test cases that validate that the
internal program logic is functioning properly, and that program inputs produce valid
outputs. All decision branches and internal code flow should be validated. It is the
testing of individual software units of the application .it is done after the completion
of an individual unit before integration. This is a structural testing, that relies on
knowledge of its construction and is invasive. Unit tests perform basic tests at
component level and test a specific business process, application, and/or system
configuration. Unit tests ensure that each unique path of a business process performs
accurately to the documented specifications and contains clearly defined inputs and
expected results.
63
7.3 Functional test
System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An
example of system testing is the configuration oriented system integration test.
System testing is based on process descriptions and flows, emphasizing pre-driven
process links and integration points.
64
7.6 Black Box Testing
Unit Testing
Test objectives
Features to be tested
65
Integration Testing
The task of the integration test is to check that components or software applications,
e.g. components in a software system or – one step up – software applications at the
company level – interact without error.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
Acceptance Testing
User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional
requirements.
Test Results: All the test cases mentioned above passed successfully. No defects
encountered.
66
Sample Test Cases
Remarks(IF
S.no Test Case Excepted Result Result
Fails)
If already Doctor
If Doctor registration
1. Doctor Register Pass mail exists then it
successfully.
fails.
If already patient
If patient registration
3. Patient Register Pass mail exists then it
successfully.
fails.
67
CHAPTER – 8
68
CONCLUSION
8.1 CONCLUSION
This article reviews the main methods of machine learning, and summarizes several
representative applications after understanding the history of machine learning in the
medical field and its current application. The typical ideas and algorithms are
summarized. At the same time, the improvement method based on machine learning
in the process of visiting is proposed. However, this does not mean that ML is perfect.
Whether in terms of technology, ethic or law, it has certain problems. The solution of
these problems requires technicians and legal personnel. Working together, and how
to strike a balance between manpower and machine is also a problem that everyone of
us must face.
69
CHAPTER – 9
70
BIBILOGRAPHY
[1] G. Eason, B. Noble, and I.N. Sneddon, “On certain integrals of Lipschitz-Hankel
type involving products of Bessel functions,” Phil. Trans. Roy. Soc. London, vol.
A247, pp. 529-551, April 1955. (references)
[2] Jiang M, Zhang S, Huang J, et al. Scalable histopathological image analysis via
supervised hashing with multiple features[J]. Medical Image Analysis, 2016, 34:3-12.
[6] Sarraf S , Tofighi G . Classification of Alzheimer's Disease using fMRI Data and
Deep Learning Convolutional Neural Networks[J]. 2016.
[8] Pang-ning Tan, Michael Steinbach, Vipin Kumar, Introduction to data mining,
Beijing: Posts & Telecom Press, 2011.
[9] Xue-Hu WANG, Study Liver Segmtation Method from CT Images based on
Deformation Optimization and Sparse Statistics[D]. Beijing Institute of Technology,
2015.
71
[10] Yu Q , Jiang T , Zhou A , et al. Computer-aided diagnosis of malignant or
benign thyroid nodes based on ultrasound images[J]. European Archives of Oto-
Rhino-Laryngology, 2017, 274(7):2891- 2897.
[11] Fei Liu, Jun-Ran Zhang, Hao Yang. Advances in medical images recoginition
based on deep learning[J]. Chinese Journal of Biomedical Engineering, 2018.
[12] Ke-Yang Zhao, Mu-Yue Yang, Jing-Yu Zhu, Ze-Qi Wang, Wei-Wei Shen.
Machine learning AIDS in tumor dignosis[J]. Tumor, 2018, 38(10): 987-991.
[13] Bin Huang, Feng Liao, Yu-Feng Ye. Advances in machine learning in image
analysis of nasopharyngeal carcinom[J]. International Journal of Medical Radiology,
2019(1).
72