My Project Documentation

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 42

Wellbeing Indicator

ABSTRACT
Wellbeing indicator is a JAVA based standalone application which is intended to developed and
provide an easy and simple way services for both doctors and patients. The main objective of this
application is to design and develop in a real time, to help out patients and other end users
suffering from various diseases, or medical emergence can communicate with doctors or medical
assistance through online mode and can resolve their queries.Most of the times doctors are not be
available when the patients visit to hospital. Such sort of issues can be resolved through
Wellbeing Indicator.

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 1


Wellbeing Indicator

INTRODUCTION
Wellbeing indicator is an application developed for patients, other end users and doctors. This
application is JAVA and MySQL based application which helps users to know if they are
suffering from any diseases, also the application suggests doctors. The main objective of this
project is to build an application which will help the users and doctors have a conversation
through application and all the queries of users can be solved. Sometimes doctors may not be
available all the time and also users may not be able to visit the hospital in their busy schedule
this application provides the users to know if they are suffering from any diseases through the
symptoms. This helps the users to skip the long procedure of visiting the hospital. Also, the
conversation between doctors and users are made available which made doctors available all the
time. Here the system allows users to get instant guidance on their health issues through this
wellbeing indicator. The system is fed with various symptoms and the disease associated with
that symptoms. This system not only shows the type of the disease but also suggests the doctor
for that disease. This is fully unique system and we are sure that it will be helpful for hospital as
well they can add this with their existing feature. Hope this will be very demandable in coming
future. The proposed system states that the patients/user(s) can access their mobile phone at any
place, anytime to manage their minor illness by providing their symptoms.

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 2


Wellbeing Indicator

PROBLEM STATEMENT
To design and develop a java based application, which provides an interface between doctors and
patients to check the availability of a doctor and to know if they are suffering from any disease
through the symptoms.

AIM OF THE PROJECT


The main aim of the project is to build an application which will help the user and doctors to
have a conversation through application and all the queries of users can be solved.

EXISTING SYSTEM
In this present scenario most of the people are following the traditional way through visiting the
hospitals and meeting the doctor in physical mode. But due to the busy schedule people are
unable to wait in long queues and patents are unable to manage their time, and also lot of paper
work.

PROPOSED SYSTEM

The proposed system is to design an application which brings doctors and patients/user under a
same platform which makes the interaction easier through online.

OBJECTIVES
1. To learn how to design and program java applications
2. To learn how to build and package modules reusability using java
3. To learn how to design object-oriented programs
4. To learn how to use exception handling in java applications for error handling
5. To learn how to build online web application using eclipse

ADVANTAGES
1. Interaction between doctors and users become easier
2. User can know his disease by the symptoms
3. This application suggest the doctor according to the users disease

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 3


Wellbeing Indicator

HARDWARE REQUIREMENT SPECIFICATION

 Processer :Intel core i3 and above


 Ram :4 GB and above
 Hard disk :512 GB and above
 Monitor :15.6 inch HD Display
 Keyboard : Standard keyboard
 Mouse : Standard optimal mouse or touch pad

SOFTWARE REQUIREMENT SPECIFICATION

 Operating system : Windows 10

 Programming language : Java

 IDE : Eclipse
 Database : MySQL 5.5

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 4


Wellbeing Indicator

SYSTEM ANALYSIS
It is a process of studying and identifying the problem defined earlier by the client in the
requirement phase. The general system analysis deals with the system behavior for the input
values provided by the end user(s). the primary purpose of system analysis is a methodology of
the system and its components or modules function together according to the objectives specified
by the user.

The fundamental objective of system analysis is to ensure that the proposed system will meet the
client needs and can be delivered in time and also to provide the operational efficiency too. The
analysis made on the said project “WELLBEING INDICATOR” will give the clear idea of
“what the system should do” as specified in the objectives by the end user, the proposed system
must function through the interface and Data base modules to ensure the integrity and efficiency
of the system components. Each component of a system will work effectively accordingly to user
inputs and can be stored and retrieved with proper database designs made in next phase of the
project.

SYSTEM DESIGN

The developing application is considered to the version up on thesystem, which is proposed to be


built with the content and touch of MSSQL server as the backend database. Java is front end
technology used to design the application eclipse is theIDE used to develop the application. The
purpose of the system design process is to provide sufficient detailed data and information about
the system and its system elements to enable the implementation consistent with architectural
entities.

SOFTWARE MODEL APPROACH

The initial phase of the proposed application incorporated one of the basic software design
modules of the software engineering such as waterfall model; this model illustrates the software
development process in a linear sequential flow. This means that any phase in the development
process begins only if the previous phase is complete. The application is designed with the
following 3 modules:

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 5


Wellbeing Indicator

 Login Module
 Register Module
 Disease Prediction
 view Tips

Login Module: Admin, doctor and user all can be able to login into the application by providing
the username and the password where unauthorized login will be restricted.

Register Module: Here the doctors and user (s) register with their details. Here there are are
some fields are given to fill the details and create an account. They can further login by
providing username and password which were set by themselves.

Disease prediction: Here the user(s) can know their disease by providing the symptoms and if
the user is already registered then they can get the specialist doctor details, if the new user wants
to meet the doctor then they should enroll their details and login to the application.

View Tips: here the user(s) who visited the application can see the tips option where they can
view the tips for different diseases and know the control measures.

SOFTWARE DEVELOPMENT PROCESS MODEL ADOPTED

This document plays a vital role in development of life cycle as it describes the complete
requirements of the system. This project is waterfall model based; it was the first process model
to be introduced. It is also referred to as a linear sequential life cycle model. It is very simple to
understand and use. In a waterfall model, each phase must be completed before the next phase
can begin and there is no overlapping in the phase. This model illustrates the software
development process in a linear sequential flow. This means that any phase in the development
process begins only if the previous phase is complete.

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 6


Wellbeing Indicator

SEQUENTIAL PHASES IN WATER FALL MODEL ARE:

 REQUIREMENT GATHERING AND ANALYSIS: all possible requirements of the


system to be developed are captured in this phase and documented in a requirement
specification document.
 SYSTEM DESIGN: the requirement specifications from first phase are studied in this
phase and the system design is prepared. This system design helps in specifying hardware
and system requirement and helps in defining the overall system architecture.
 IMPLEMENTATION AND UNIT TESTING: with inputs from the system design, the
system is first developed in small programs called units, which are integrated in the next
phase. Each unit is developed and tested for its functionality, which is referred to as unit
testing.
 INTIGRATION AND TESTING: all the units developed in the implementation phase
are integrated into a system after testing of each unit. Post integration the entire system is
tested for any faults and failures.
 DEPLOYMENT OF SYSTEM: ones the functional and non functional testing is done,
the product is deployed in the customer environment are released into the market.
 MAINTENANCE: there are some issues which comes up in the client environment to
fix those issues patches are released. Also to enhance the product some better versions
are released. Maintenance is done to deliver these changes in the customer environment.

Figure 1: Waterfall model

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 7


Wellbeing Indicator

Class Diagram
A class diagram in the unified modeling language (UML) is a type of static structure diagram
that describes the structure of the system by showing the system classes, their attributes,
operations and the relationships among objects. The class diagram is the main building block of
object-oriented modeling

Admin Login Doctor register


Wellbeing Indicator

Username: varchar Admin login ( ) Name : varchar


Password: varchar Doctor registration ( ) Username : varchar
Disease predication ( ) Gender : varchar
Tips ( )
Specialist : varchar
Ph number : bigint
Password : varchar

details
Search ( )
Add ( ) Check( )
Delete ( ) Tips Create account ( )
Disease predication

Symptoms:
Get Info ()
select

Submit ( )

User

Username : varchar
Password : varchar

Gender : varchar

Ph number : bigint
Password : varchar
Age : int

Figure 2 : Class diagram of Wellbeing Indicator

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 8


Wellbeing Indicator

USECASE DIAGRAM
Use Case Model is an approach that is a combination of text and pictures in order to improve the
understanding of requirements. A use case model describes the complete functionality of a
system by identifying how everything that is outside the system interacts with it. A use case
diagram is given below that relates to this application. The project is a java application that
maintains the user and doctor details disease prediction and control measures on particular
diseases (TIPS).

ADMIN

REGISTERATION

DISEASE PREDICTION

ADMIN ADMIN/USER
TIPS

Figure 4 : Use case diagram for Wellbeing Indicator

SEQUENCE DIAGRAM
A sequence diagram shows object interactions arranged in time sequence. It depicts the objects
and classes involved in the scenario and the sequence of messages exchanged between the
objects needed to carry out the functionality of the scenario. A sequence diagram is a type of
interaction diagram it describes how and in what order A group of objects works together.

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 9


Wellbeing Indicator

User Login Wellbeing DB

1.Login

2. Password

3. Successful

4. Access to application

5. Allow using modules

6. Add user details

7. Stores in db

8. edit/ search stored record

9. Display of selected record

10. Disease prediction

11. Display predicted information

12.Suggest doctor

13. Tips

14. Display tips

15.Logout

Figure 4 : Sequence diagram

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 10


Wellbeing Indicator

E-R DIAGRAM
Entity Relationship modeling is a data modeling method used in software engineering to produce
a conceptual data model of an information system. Diagrams created using this Entity
Relationship modeling method are called Entity-Relationship Diagrams. An Entity Relationship
Diagram (ERD) is a visual representation of different entities within a system and how they
relate to each other. ADMIN

MANAGES
MANAGES
MANAGES

GENDER

USER. DETAILS
LOGIN DR. DETAILS USERNAME

PH NUMBER

AGE
USERNAME
DR. NAME
PASSWORD

PASSWORD
NAME
SPECIALISATION

Figure 5.1: E-R Diagram for Wellbeing Indicator

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 11


Wellbeing Indicator

USER

MANAGES MANAGES
MANAGES

DISEASE TIPS
DR. DETAILS
PREDICATION

SYMPTIOM 1
NAME
HEADACHE
FEVER

PH NUMBER SYMPTIOM 2
DISEASE
COMMON COLD

GENDER
SYMPTIOM 3
3
SPECILASTION

Figure 5.2: E-R Diagram for Wellbeing Indicator

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 12


Wellbeing Indicator

DATABASE TABLES
ATTRIBUTES DATA TYPE SIZE NULL PRIMARY KEY

Docname varchar 20 No -
gender varchar 20 No -
specialist varchar 20 No -

Ph.number bigint 10 No -
username varchar 20 No Yes

password varchar 20 No -

ATTRIBUTES DATA TYPE SIZE NULL PRIMARY KEY

Name Varchar 20 No -

gender Varchar 20 No -

age Varchar 20 No -

Ph.number Bigint 10 No -

Cusername Varchar 20 No Yes

password Varchar 20 No -

Table 1: Database Table of Dr.Register

Table 2 : Database table of User register

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 13


Wellbeing Indicator

IMPLEMENTATION
Implementation is the stage of the project theoretical design is turned into working system. It can
be considered to be the most critical stage in the achieving successful new system and in giving
the user, confidence that the new system will work and effective. The goal of the coding phase is
to translate the design into code in the given programming language. The coding steps translate
the detailed design of the system into programming language. The translation process continuous
when the compiler accepts source code as input and produces machine dependent object code as
output linking of object files are done to produce the machine code. Internal document is another
important factor to facilitate others to understand the code and the logic.

SOFTWARE’S USED
INTRODUCTION TO JAVA

Java is a high level programming language.Java was developed by Sun Microsystems in


1991, later acquired by Oracle Corporation. It was developed by James Gosling and Patrick
Naughton. It is a simple programming language.  Writing, compiling and debugging a program is
easy in java.  It helps to create modular programs and reusable code.

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 14


Wellbeing Indicator

JAVA COMPONENTS

 Java Virtual Machine (JVM): JVM executes the byte code generated by compiler. This
is called program run phase.

 Java Development Kit (JDK) :Java development kit includes JRE (Java Runtime
Environment), compilers and various tools like JavaDoc, Java debugger etc..In order to
create, compile and run Java program We need JDK installed on computer

 Java Runtime Environment (JRE): JRE is a part of JDK which means that JDK
includes JRE.. JRE includes JVM, browser plug-in and applets support.

FEATURES OF JAVA:

 Robust

 Simple

 Secured

 Distributed

 Object oriented

 Portable

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 15


Wellbeing Indicator

COMPILATION OF JAVA PROGRAM

Compilation and execution of a Java program is two step process. During compilation phase Java
compiler compiles the source code and generates byte code. This intermediate byte code is saved
in form of a .class file. In second phase, Java virtual machine (JVM) also called Java interpreter
takes the .class as input and generates output by executing the byte code. Java is an object
oriented programming language; therefore, a program in Java is made of one or more classes. No
matter how trivial a Java program is, it must be written in form of a class.

Figure 6:Compilation module of java

ECLIPSE
Eclipse is an integrated development environment (IDE) for developing applications using the
Java programming language and other programming languages such as C/C++, Python, PERL,
Ruby etc..The Eclipse platform which provides the foundation for the Eclipse IDE is composed
of plug-ins and is designed to be extensible using additional plug-ins. Developed using Java, the
Eclipse platform can be used to develop rich client applications, integrated development
environments and other tools. Eclipse can be used as an IDE for any programming language for
which a plug-in is available.

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 16


Wellbeing Indicator

The Java Development Tools (JDT) project provides a plug-in that allows Eclipse to be used as a
Java IDE, PyDev is a plug in that allows Eclipse to be used as a Python IDE, C/C++
Development Tools (CDT) is a plug-in that allows Eclipse to be used for developing application
using C/C++, the Eclipse Scala plug-in allows Eclipse to be used an IDE to develop Scala
applications and PHPeclipse is a plug-in to eclipse that provides complete development tool for
PHP.

XAMPP:it is an abbreviation for cross-platform, apache, MySQL, PHP and perl, and it allows
you to build word press site offline, on a local web server on your computer. This simple and
lightweight solution works on windows, linex, and Mac- hence the “cross-platform” part since
word press is not a stand-alone application, XAMPP provides two essential components for its
installation- apache, which is used to create the local server, and MySQL which you can use a
database for your website.

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 17


Wellbeing Indicator

MySQL DATABASE
A database is a structured collection of data. It may be anything from a simple shopping list to a
picture gallery or the vast amounts of information in a corporate network. To add, access, and
process data stored in a computer database, you need a database management system such as
MySQL server. Since computers are very good at handling large amounts of data, Database
management system play a central role in computing, as standalone utilities, Or as parts of other
applications. MySQL is the world’s most popularopen sourcedatabase. With its proven
performance, reliability and ease-of-use, MySQL has become leading database choice for web-
based applications, used in high profile web properties including Facebook, Twitter, YouTube,
and Yahoo! And many more. Oracle drivers MySQL innovation, delivering new capabilities to
power next generation web, cloud, mobile and embedded applications. It organizes data into one
or more data tables in which the data types may be related to each other, these relations helps
structure of the database. Following are some features of MySQL.

 MySQL is a database management system.


 MySQL database is relational.
 MySQL software is open source
 The MySQL Database server is very fast, reliable, scalable, and easy to use
 MySQL server works in client/server or embedded systems.

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 18


Wellbeing Indicator

SAMPLE CODING
Admin login page using

Admin can login only through proper username and password. The variables username and
password is taken

from textfield and is checked with username by using simple string matching.

JButtonbtnSubmit = new JButton("Login");

btnSubmit.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

String username = user.getText();

String password = passwordtf.getText();

try {

if(username.contains("admin123") &&password.contains("1234"))

{ user.setText(null);

passwordtf.setText (null);

dispose();

adminpage info = new adminpage();

adminpage.main(null);}

else

JOptionPane.showMessageDialog(null, "Invalid
login","Loginerror",JOptionPane.ERROR_MESSAGE);

passwordtf.setText(null);

user.setText(null);}}

catch(Exception e30) {JOptionPane.showMessageDialog(null, "Invalid login","Login

error",JOptionPane.ERROR_MESSAGE);}}});

Password validation using Key listener:

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 19


Wellbeing Indicator

Admin login page using

Admin can login only through proper username and password. The variables username and
password is taken

from textfield and is checked with username by using simple string matching.

JButtonbtnSubmit = new JButton("Login");

btnSubmit.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

String username = user.getText();

String password = passwordtf.getText();

try {

if(username.contains("admin123") &&password.contains("1234"))

{ user.setText(null);

passwordtf.setText(null);

dispose();

adminpage info = new adminpage();

adminpage.main(null);}

else

JOptionPane.showMessageDialog(null, "Invalid
login","Loginerror",JOptionPane.ERROR_MESSAGE);

passwordtf.setText(null);

user.setText(null);}}

catch(Exception e30) {JOptionPane.showMessageDialog(null, "Invalid login","Login

error",JOptionPane.ERROR_MESSAGE);}}});

Password validation using Key listener:

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 20


Wellbeing Indicator

Password of admin is taken only in the form of numbers and only 4-digit valid pin number. The
below part of

code which is implemented with the help of “addKeyListener” is the keyword used for validation
of pin code.

passwordtf.addKeyListener(new KeyAdapter() {

//@Override

int count = 0;

public void keyTyped(KeyEvent e) {

try {

int i= Integer.parseInt(passwordtf.getText());

err.setText("");

count ++;

if(count>-1 && count<3)

{ err.setText(""); }

catch(NumberFormatException e13)

{err.setText("Enter 4 digit number");}}

});

Event handler for viewing doctors and users details:

When admin successfully logs in he can now view, add, edit and search details of doctors and
users.

JButtonbtnNewButton = new JButton("View Doctors Details");

btnNewButton.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

dispose();

doctorsdetails info = new doctorsdetails(); //opens details of doctors

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 21


Wellbeing Indicator

doctorsdetails.main(null);

});

JButtonbtnViewPatientDetails = new JButton("View Users Details");

btnViewPatientDetails.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

dispose();

userdetails info = new userdetails(); //opens details of users

userdetails.main(null); }});

Display of doctors and users details using Mysql connector and fetching data from
database:

try {

Connection
conn=DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/miniproject","root","");

java.sql.Statementst = conn.createStatement(); PreparedStatementps =

conn.prepareStatement("SELECT * from register_user;");

ResultSetrs = (ResultSet) ps.executeQuery();

int li_row=0;

while(rs.next())

{ table.setValueAt(rs.getString("cusername"),li_row,1);

table.setValueAt(rs.getString("name"),li_row,0);

table.setValueAt(rs.getString("gender"),li_row,2); // To display details of users in table.

table.setValueAt(rs.getString("age"),li_row,3);

table.setValueAt(rs.getString("phonenumber"),li_row,4);

table.setValueAt(rs.getString("password"),li_row,5);

li_row++;}}

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 22


Wellbeing Indicator

catch(Exception e26)

{}

try { Class.forName("com.mysql.jdbc.Driver");

int var = 0;

while(var<11) {

table.setValueAt((null),var,0);

table.setValueAt((null),var,1);

table.setValueAt((null),var,2);

table.setValueAt((null),var,3);

table.setValueAt((null),var,4);

table.setValueAt((null),var,5);

var++;

Connection conn =
DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/miniproject","root","");

PreparedStatementps = conn.prepareStatement("SELECT * from register_user where name like


'"+ser+"%';");

ResultSet rs1 = (ResultSet) ps.executeQuery(); //for searching details of particular user

int si_row =0;

while(rs1.next())

{ table.setValueAt(rs1.getString("cusername"),si_row,1);

table.setValueAt(rs1.getString("name"),si_row,0);

table.setValueAt(rs1.getString("gender"),si_row,2);

table.setValueAt(rs1.getString("age"),si_row,3);

table.setValueAt(rs1.getString("phonenumber"),si_row,4);

table.setValueAt(rs1.getString("password"),si_row,5);

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 23


Wellbeing Indicator

si_row++;

} conn.close();

catch(Exception e26) {System.out.println(e26)}

try {

String sql = "DELETE from register_user where cusername='"+del+"'";

Connection
con=DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/miniproject","root","");

PreparedStatementpst= con.prepareStatement(sql);

pst.executeUpdate();

JOptionPane.showMessageDialog(null, "Deleted","Update
info",JOptionPane.PLAIN_MESSAGE);

con.close();} //to delete data by entering username

Catch(Exception e27)

{ System.out.println(e27);

JOptionPane.showMessageDialog(null, "Name not found","Details not found


error",JOptionPane.ERROR_MESSAGE);}

MODULE USER FUNCTIONALITY


Creating new user account:

User must enter details like name, gender, age, phone number, username and password.

JButtonbtnSubmit = new JButton("Submit");

btnSubmit.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e12) {

try {

Class.forName("com.mysql.jdbc.Driver");

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 24


Wellbeing Indicator

Connection conn =
DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/miniproject","root","");

PreparedStatementps = conn.prepareStatement("insert into register_user (name,gender,age,

phonenumber,cusername,password) values (?,?,?,?,?,?);");

ps.setString(1, cname.getText());

ps.setString (3, age.getText());

ps.setString (2, (String)gender.getSelectedItem());

ps.setString(4, phonenumber.getText());

ps.setString(5, username.getText());

ps.setString(6, password.getText());

int zx = ps.executeUpdate();

if(zx>0) {System.out.println("Sucessful");}

else{System.out.println("Unsucessful");}

String name = cname.getText();

String ph = phonenumber.getText();

String pass = password.getText();

if( name.isEmpty() || ph.isEmpty() || pass.isEmpty() )

{JOptionPane.showMessageDialog(null, "Please fill all required fields","Submission

error",JOptionPane.ERROR_MESSAGE); }

else {

cname.setText(null);

gender.setName(null);

phonenumber.setText(null);

password.setText(null);

username.setText(null);

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 25


Wellbeing Indicator

JOptionPane.showMessageDialog(null, "Sucessfullyupdated","Login
info",JOptionPane.PLAIN_MESSAGE);

dispose();

userloginpage info = new userloginpage();

userloginpage.main(null);}}

catch(Exception e16) { System.out.println(e16);}}});

Validation of phone number using key typed event handler:

This function verifies if the key typed is integer or character and throws an exception. If the
number entered is

greater than 10 digit then an error message is displayed.

phonenumber.addKeyListener(new KeyAdapter() {

public void keyTyped(KeyEvent e) {

try { inti= Integer.parseInt(phonenumber.getText());

invalid.setText("");

int count = 0;

count +=1;

if(count>1 && count<9)

{ invalid.setText(""); } }

catch(NumberFormatException e13)

{ invalid.setText("Invalid number"); }}});

Disease prediction and display of doctor’s availability:


JButton btnNewButton_1 = new JButton("Submit");

btnNewButton_1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

String s1 = ((String)symptom1.getSelectedItem());

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 26


Wellbeing Indicator

String s2 = ((String)symptom3.getSelectedItem());

String s3 = ((String)symptom2.getSelectedItem());

try {

if(s1.equals(s2) || s1.equals(s3) || s2.equals(s3) || s1.equals("Symptom 1") || s2.equals("Symptom


2") ||

s3.equals("Symptom 3"))

{ errormsg.setText("Enter different Symptoms"); }

else{ errormsg.setText("");

if((s1.equals("Fever") || s2.equals("Fever") || s3.equals("Fever")) && (s1.equals("Irritability") ||

s2.equals("Irritability") || s3.equals("Irritability"))

&& (s1.equals("High breathing") || s2.equals("High breathing") || s3.equals("High breathing"))) {

resulttext.setText("Covid-19");

covid19.setText("Alert! "

+ "If you are suffering from Covid-19 please stay at home and immedieately consult nearest
health

care"+ " Social distancing is very important ");}

else if(s1.equals("Headache") || s2.equals("Headache") || s3.equals("Headache"))

{ if(s1.equals("Fever") || s2.equals("Fever") || s3.equals("Fever")|| s1.equals("Sweating") ||

s2.equals("Sweating") || s3.equals("Sweating") )

{resulttext.setText("Typhoid or Malaria");}

else{resulttext.setText(s1+","+s2+","+s3);}}

else if(s1.equals("Cold") || s2.equals("Cold") || s3.equals("Cold"))

{ if(s1.equals("Running nose") || s2.equals("Running nose") || s3.equals("Running nose") ||


s1.equals("Itchy

eyes") || s2.equals("Itchy eyes") || s3.equals("Itchy eyes") )

{resulttext.setText("Allergies &Asthama");}

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 27


Wellbeing Indicator

else resulttext.setText(s1+","+s2+","+s3); }

else if(s1.equals("Irritability") || s2.equals("Irritability") || s3.equals("Irritability")) {

if(s1.equals("Weight loss") || s2.equals("Weight loss") || s3.equals("Weight loss") )

resulttext.setText("Diabetes");}

else if((s1.equals("Vision problem") || s2.equals("Vision problem") || s2.equals("Vision


problem")) && (

s1.equals("Headache") || s2.equals("Headache") || s2.equals("Headache")))

{ resulttext.setText("Hyper or Hypo tension");}

else resulttext.setText("Hyper or Hypo tensio");}

else resulttext.setText(s1+","+s2+","+s3);}}

catch(Exception e27){ System.out.println(e27); }}});

//If the entered symptoms is valid then doctors details are fetched from database and is displayed
in table.

btnNewButton.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

String ser = resulttext.getText();

if(ser.equals(null))

{ errormsg.setText("Enter Symptoms first");}

else{ try {

Class.forName("com.mysql.jdbc.Driver");

int var = 0;

while(var<5) {

table.setValueAt((null),var,0);

table.setValueAt((null),var,1);

var++;}

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 28


Wellbeing Indicator

Connection conn =
DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/miniproject","root","");

PreparedStatementps = conn.prepareStatement("SELECT docname,phonenumber from


register_doctor where

specialist ='"+ser+"';");

ResultSet rs1 = (ResultSet) ps.executeQuery();

int si_row =0;

while(rs1.next()) {

table.setValueAt(rs1.getString("docname"),si_row,0);

table.setValueAt(rs1.getString("phonenumber"),si_row,1);

si_row++;} errormsg.setText("Doctors availibility = "+si_row);

conn.close();}

catch(Exception e26){ System.out.println(e26); }}}});

MODULE DOCTOR FUNCTIONALITY


Creating new Doctor account:

Doctor must enter details like name, gender, specialized field, phone number, username and
password to

create new account.

JButtonbtnSubmit = new JButton("Submit");

btnSubmit.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e12) {

try {

Class.forName("com.mysql.jdbc.Driver");

Connection conn =
DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/miniproject","root","");

PreparedStatementps = conn.prepareStatement("insert into register_doctor


(name,gender,specialized,

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 29


Wellbeing Indicator

phonenumber,cusername,password) values (?,?,?,?,?,?);");

ps.setString(1, cname.getText());

ps.setString (3, String)specialized.getSelectedItem());

ps.setString (2, (String)gender.getSelectedItem());

ps.setString(4, phonenumber.getText());

ps.setString(5, username.getText());

ps.setString(6, password.getText());

int zx = ps.executeUpdate();

if(zx>0) {System.out.println("Sucessful");}

else{System.out.println("Unsucessful");}

String name = cname.getText();

String ph = phonenumber.getText();

String pass = password.getText();

if( name.isEmpty() || ph.isEmpty() || pass.isEmpty() )

{JOptionPane.showMessageDialog(null, "Please fill all required fields","Submission

error",JOptionPane.ERROR_MESSAGE); }

else {

cname.setText(null);

gender.setName(null);

phonenumber.setText(null);

password.setText(null);

username.setText(null);

JOptionPane.showMessageDialog(null, "Sucessfullyupdated","Login
info",JOptionPane.PLAIN_MESSAGE);

dispose();

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 30


Wellbeing Indicator

userloginpage info = new userloginpage();

userloginpage.main(null);}}

catch(Exception e16) { System.out.println(e16);}}});

Validation of phone number using key typed event handler:


This function verifies if the key typed is integer or character and throws an exception. If the
number entered is

greater than 10 digit then an error message is displayed.

phonenumber.addKeyListener(new KeyAdapter() {

public void keyTyped(KeyEvent e) {

try { inti= Integer.parseInt(phonenumber.getText());

invalid.setText("");

int count = 0;

count +=1;

if(count>1 && count<9)

{ invalid.setText(""); } }

catch(NumberFormatException e13)

{ invalid.setText("Invalid number"); }}});

MODULE TIPS FUNCTIONALITY


This module is a message box display for various common disease like fever, headache, common
cold,

Diabetics and to reduce weight.

JTextPanemsgbox = new JTextPane();

msgbox.setForeground(new Color(0, 0, 0));

msgbox.setFont(new Font("Cambria", Font.BOLD, 16));

msgbox.setText("Coronaviruses are a group of viruses belonging to the family of Coronaviridae,


which infect both

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 31


Wellbeing Indicator

animals and humans.\r\n\r\nHere are few tips to stay away from corona:\r\n\r\n> Washing hands
with soaps or using

hand sanitizer\r\n\r\n> AVOID touching mouth or ears frequently\r\n\r\n>Practice respiratory


hygine \r\n

STAY HOME STAY SAFE \r\n> Social distancing is must\r\n\r\n> Cover your face while
coughing or sneezing\r\n\r\n>

Keep your surrounding clean\r\n\r\n> If a person is found with Symptoms like heavy breathing,
fever make sure that

person is home Quarantine\r\n\r\n> Products coming from outside like milk, vegetables, fruits
and others should be

washed before using it.\r\n\r\n>Stay informed and follow advice given by your healthcare
provider");

msgbox.setEditable(false);

scrollPane.setViewportView(msgbox);

JButton fever = new JButton("Fever");

fever.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

notice.setText(null);

msgbox.setText(null);

msgbox.setFont(new Font("Cambria", Font.BOLD, 20));

msgbox.setForeground(new Color(0, 0, 225));

msgbox.setText("How to break a fever"

+ "\r\n\r\nTake your temperature and assess your symptoms. if your temperature runs
100.4`F(38`C) or higher,

you have a fever"

+ "\r\n\r\n> Stay in bed and rest"

+ "\r\n\r\n> Keep hydrated. Drinking water, iced tea, or very diluted juice to replenish fluids lost
through

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 32


Wellbeing Indicator

sweating. But if keeping liquids down is difficult, suck on ice chips"

+ "\r\n\r\n> Take over the counter medications like paracetamol"

+ "\r\n\r\n> Stay cool. Remove extra layers of clothing and blankets, unless you have the chills"

+ "\r\n\r\n> Take tepid baths or using cold compresses to make you more comfortable. please
avoid cold baths

its dangerous"

+ "\r\n\r\n> But no matter what the number on the thermometer reads, if you have any concerns
consult your

doctor."); }});

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 33


Wellbeing Indicator

SYSTEM TESTING
System testing is a level of testing that validates the complete and fully integrated software
product. The purpose of a system test is to evaluate the end-to-end system specifications. It
involves two kinds of testing integration testing and acceptance testing. Integration testing is a
level of software testing where individual units are combined and tested as a group. Acceptance
testing is a level of software testing where a system is tested for acceptability.
Software testing
Software testing is defined as an activity to check whether the actual results match the expected
results and to ensure that the software system is Defect free. It involves execution of a software
component or system component to evaluate one or more properties of interest. Software testing
also helps to identify errors, gaps or missing requirements in contrary to the actual requirements.

Why software testing is important?


 Testing the fully integrated applications including external peripherals in order to check
how components interact with one another and with the system as a whole. This is also
called End to End testing scenario.
 Verify thorough testing of every input in the application to check for desired outputs.
 Testing of the user's experience with the application.

Testing objectives
1. Finding defects which may get created by the programmer while developing the software.
2. Gaining confidence in and providing information about the level of quality.
3. To prevent defects.
4. To make sure that the end results meet the business and user requirements.
5. To ensure that it satisfies the BRS that is Business Requirements Specification and SRS
that is System Requirement Specification.
6. To gain the confidence of the customers by providing them a quality product.

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 34


Wellbeing Indicator

Testing strategies

1. Unit Testing
It is a process of testing a programme components such as objects, methods etc. Where it
is used:
 To check and set the values of all attributes associated with the object.
 To check all the operations associated with the object.
 To put the object into all possible status.
(There are many modules like Login module, Add alumni module, Search alumni module, Edit
alumni module. Write u r modules)
2. Integration Testing
It is a level of software testing where individual units are combined and tested as a group.
The purpose of this level of testing is to expose faults in the interaction between
integrated units. The number of text fields specified in the design should match with the
number of entities in the database.
3. System Testing
Here the entire software system is tested. The reference document for this process is the
requirements document, and the goals to see if software meets its requirements. The
software has been tested against requirements of project and it is checked whether all
requirements of project have been satisfied or not.
4. Validation Testing
The process of evaluating software during the development process to determine whether
it satisfies specified requirements. Validation Testing ensures that the product actually
meets the client's needs. It can also be defined as to demonstrate that the product fulfils
its intended use when deployed on appropriate environment.
5. Black box testing
It considers a module as a single unit and checks the unit at interface and communication
with other modules rather getting into details at statement level.
6. White box testing
This is a unit testing method where a unit will be taken at a time and tested thoroughly at
a statement level to find the maximum possible errors.

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 35


Wellbeing Indicator

OUTPUT SCREENS

Homepage

Admin login page

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 36


Wellbeing Indicator

Details of users

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 37


Wellbeing Indicator

Doctor details

User details

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 38


Wellbeing Indicator

Adding new doctor details

Disease prediction

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 39


Wellbeing Indicator

Health tips

Doctor details in database

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 40


Wellbeing Indicator

User details in database

CONCLUSION
The main objective behind creating this application to predict disease and make sure that user
can get doctors details for contact. This application gets rid of the long process of consulting
doctor physically after all tests for particular disease. This application can help users to get
contact with doctors as soon as possible and through the phone number available can contact
through phone where doctors can guide them what to do regarding their symptoms. At the end of
this proposal we want to remember that this is fully unique system and we are sure that it will be
helpful for all the end user(s). Hospitals business can add this with their existing feature. Hope
this application will be very demandable in coming future.

FEATURE ENHANCEMENT

The digital technology era demands the world to provide an excellent health system, in order to
ensure the citizen and community to be alive and healthy. Our wellbeing indicator is exactly
based on this concept. Our application has good future scope which can make a revolution in

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 41


Wellbeing Indicator

breaking the gap between users and doctors. The following points are some of the enhancements
that can be made through wellbeing indicator.

 This application can help all fresher (doctor) where when doctor registers and the number
of users he treats can earn badges. Building up good profile for fresher.
 Have a video conversation to treat patients.
 Uploading photos and storing them by linking to patient ID, this helps easy identification.
 Accepting test reports of any hospitals if they link to this application.
 Link authorized pharmacy services and enable delivery services.
 Improving to such a condition where patients need to visit only if it is emergency and if
there is a need of operation.
 Implementing all the developed and developing technologies in order to develop the
present health care system.

BIBLOGRAPHY
 www.google.com
 www.github.com
 www.nevonprojects.com
 www.geeksforgeeks.org
 www.wiki.com
 www.youtube.com

DEPARTMENT OF COMPUTER SCIENCE, SGT COLLEGE, BALLARI Page 42

You might also like