Hospital Managemnt System PDF
Hospital Managemnt System PDF
Hospital Managemnt System PDF
A Project Report on
EHC
APPROVED
EDUCATION PROVIDER
Submitted to:
Faculty of Information Techonology,
B.R.A. Bihar University,Muzaffarpur
In general fulfilment of the requirements for award of the degree of
1
Hospital Management System
Table of Contents
2
Hospital Management System
3
Hospital Management System
function of a health care. The presented project here is made in view overcoming the
and keeping of Doctor’s information, Bed management , Report generation etc. i.e.
This project can be widely used in any Hospital which contain different departments
with various employees having different designations etc. HMS not only provides an
opportunity to the hospital to enhance their patient care but also can increase the
Patient Admission
Patient admission means capturing information of all the patients visiting the hospital
and provides record of all the registered patients through a unique patient
Bed Management
Bed Management means allows hospital authorities to view and track the bed
occupancy related operations. Bed Management governs activities like Bed Enquiry,
4
Hospital Management System
Patient Record
The patient record is a comprehensive patient care module that tracks the episodes of
care for all patients and maintains and arranges the clinical information including their
address. It is the central repository for holding the entire medical records of the
patient. It stores data in an organized and structured manner so that a clinician or any
other clinical user easily accesses clinical data based on his role on needs basis.
Our Vision:
We shall define ourselves in the cutting edge technology in the coming era.
planning.
Our Mission:
To create opportunity for growth & self actualization and provide an environment
5
Hospital Management System
To maintain the proper details of hospital management system provides the following:
o MAINTAIN FLEXIBILITIES
The system should be modified depending on the changing needs of the user such
o INCREASE PRACTICABILITY
The system should be a stable and can be operated by people with average intelligence
o INCREASE EFFICIENCY
This project involves accuracy, timeliness & comprehensiveness of the system output.
o COST
It is desirable to aim for a system with a minimum cost subject to the condition that
This is very important aspect of the design and should cover areas of hardware
6
Hospital Management System
Identification of Needs
Note:-
1. The project are developed in the java(jdk1.8) environment
2. There are various libraries are includes in apache tomcat server such as
oracle14.jar file etc
3. The environmental Operating system( windows 10 ) is used to develop this
project.
7
Hospital Management System
Requirement Analysis
Designing
Coding
Testing
Maintenance
8
Hospital Management System
Design Phase
Development Phase
Developers of all levels (seniors, juniors, freshers) involved in this phase. This is the
phase where we start building the software and start writing the code for the product.
The outcome from this phase is Source Code Document (SCD) and the developed
product.
9
Hospital Management System
Testing Phase
When the software is ready, it is sent to the testing department where Test team tests it
thoroughly for different defects. They either test the software manually or using
automated testing tools depends on process defined in STLC (Software Testing Life
Cycle) and ensure that each and every component of the software works fine. Once
the QA makes sure that the software is error-free, it goes to the next stage, which is
Implementation. The outcome of this phase is the Quality Product and the Testing
Artefacts’.
After successful testing, the product is delivered/deployed to the customer for their
use. Deployment is done by the Deployment/Implementation engineers. Once when
the customers start using the developed system then the actual problems will come up
and needs to be solved from time to time. Fixing the issues found by the customer
comes in the maintenance phase. 100% testing is not possible – because, the way
testers test the product is different from the way customers use the product.
Maintenance should be done as per SLA (Service Level Agreement)
10
Hospital Management System
Preliminary Study
Preliminary study of discrete design processes and their timing, when undergraduate
engineering students undertake project work. The method of the study followed the
approach undertaken by others1,2 where the project design cycle is broken into
discrete stages, for example problem definition, modeling, feasibility analysis and
communication. In these previous studies the design was over approximately 3 hours1
using a single session design problem and required talking aloud by the designer, so
that an observer could assess the stages being undertaken at given time intervals. Our
study is over one or two terms and uses self-reporting by students to the criteria.
Weekly emails prompted students with individualized links to a webform to report the
type of design work done in the previous week. Because a week is a relatively long
interval, the web form asks the students to report in terms of their primary (most effort
and time) and secondary tasks. Similar to previous studies, this study compares the
time spent and the points in the design cycle when certain process are undertaken or
revisited. Our results, however, describe the design process over various durations
(one term projects or full-year capstone projects), for different years of study
(primarily, third and fourth year), different fields of engineering (from Aerospace,
Civil, Mechanical, Electrical as well as Systems) and finally for different sized teams
(from pairs of students in course projects to teams of twenty in Mechanical and
Aerospace capstone projects). Comparisons will also be made between the design
processes of different students, based on their final grade for their project. This first
year of study is seen as a preliminary year to a longer and broader study, and the paper
present our preliminary results as well as lessons learned in the areas of self-reporting
and sizeable, longer-term data collection.
11
Hospital Management System
Feasibility Study
Feasibility is defined as the practical extent to which a project can be performed
successfully. To evaluate feasibility, a feasibility study is performed, which
determines whether the solution considered to accomplish the requirements is
practical and workable in the software. Information such as resource availability, cost
estimation for software development, benefits of the software to the organization after
it is developed and cost to be incurred on its maintenance are considered during the
feasibility study. The objective of the feasibility study is to establish the reasons for
developing the software that is acceptable to users, adaptable to change and
conformable to established standards.
Feasibility
Study
Technical Feasibility
Technical feasibility assesses the current resources (such as hardware and software)
and technology, which are required to accomplish user requirements in the software
within the allocated time and budget. For this, the software development team
ascertains whether the current resources and technology can be upgraded or added in
the software to accomplish specified user requirements. Technical feasibility also
performs the following tasks.
Analyzes the technical skills and capabilities of the software development team
members
Determines whether the relevant technology is stable and established
Ascertains that the technology chosen for software development has a large number
of users so that they can be consulted when problems arise or improvements are
required.
12
Hospital Management System
Operational Feasibility
Operational feasibility assesses the extent to which the required software performs a
series of steps to solve business problems and user requirements. This feasibility is
dependent on human resources (software development team) and involves visualizing
whether the software will operate after it is developed and be operative once it is
installed. Operational feasibility also performs the following tasks.
Economical Feasibility
Economic feasibility determines whether the required software is capable of
generating financial gains for an organization. It involves the cost incurred on the
software development team, estimated cost of hardware and software, cost of
performing feasibility study, and so on. For this, it is essential to consider expenses
made on purchases (such as hardware purchase) and activities required to carry out
software development. In addition, it is necessary to consider the benefits that can be
achieved by developing the software. Software is said to be economically feasible if it
focuses on the issues listed below.
13
Hospital Management System
14
Hospital Management System
the software and the interaction of the software with other software. It also identifies
system security requirements and the system's processing requirements
7. Current functional procedures: Describes the current functional procedures of the
existing system, whether automated or manual. It also includes the data-flow of the
current system and the number of team members required to operate and maintain the
software.
8. Functional objective: Provides information about functions of the system such as
new services, increased capacity, and so on.
9. Performance objective: Provides information about performance objectives such as
reduced staff and equipment costs, increased processing speeds of software, and
improved controls.
10. Assumptions and constraints: Provides information about assumptions and
constraints such as operational life of the proposed software, financial constraints,
changing hardware, software and operating environment, and availability of
information and sources.
Project Planning
The project planning is a procedural step in project management, where required
documentation is created to ensure successful project completion. Documentation
includes all actions required to define, prepare, integrate and coordinate additional
plans. The project plan clearly defines how the project is executed, monitored,
controlled and closed.
15
Hospital Management System
All of this information is integrated into Gantt charts, or other types of scheduling
charts, to provide a project overview for all involved parties.
Project planning is never truly finished until a project is completed. The project plan
may return to the planning stage multiple times prior to project completion, or even
abandoned. Generally, project complexity determines the length of the project
planning stage.
16
Hospital Management System
LANGUAGE INTORDUCTION
platform. This blog on What is Java will clear all your doubts about why to learn
Java is: –
Features of Java
Simple: Java has made life easier by removing all the complexities such as pointers,
operator overloading as you see in C++ or any other programming language
Portable: Java is platform independent which means that any application written on
one platform can be easily ported to another platform.
17
Hospital Management System
Secured: All the code is converted in bytecode after compilation, which is not
readable by a human. and java does not use an explicit pointer and run the programs
inside the sandbox to prevent any activities from untrusted sources. It enables to
develop virus-free, tamper-free systems/applications.
Robust: Java has a strong memory management system. It helps in eliminating error
as it checks the code during compile and runtime.
18
Hospital Management System
Database introduction
ORACLE consists of many tools that allow you to create an application with ease and
flexibility. You must determine how to implement your requirements using the
features available in ORACLE, along with its tools. The features and tools that you
choose to use to implement your application can significantly affect the performance
of your application.
Several of the more useful features available to ORACLE application developers are
integrity constraints, stored procedures and packages, database triggers, cost-based
optimizer, shared SQL, locking and sequences.
This documentation will lead you through the main features and tools of ORACLE. It
is intended to give you a partial view of what is available to you to use within the
assignments.
19
Hospital Management System
20
Hospital Management System
Hardware Requirement:
Software Requirement:
Database : ORACLE
Development Tools:
21
Hospital Management System
Gantt Chart
A Gantt chart is constructed with a horizontal axis representing the total time span of the
project, broken down into increments (for example, days, weeks, or months) and a vertical
axis representing the tasks that make up the project (for example, if the project is outfitting
your computer with new software, the major tasks involved might be: conduct research,
choose software, install software). Horizontal bars of varying lengths represent the sequences,
timing, and time span for each task. Using the same example, you would put "conduct
research" at the top of the vertical axis and draw a bar on the graph that represents the amount
of time you expect to spend on the research, and then enter the other tasks below the first one
and representative bars at the points in time when you expect to undertake them. The bar
spans may overlap, as, for example, you may conduct research and choose software during
the same time span. As the project progresses, secondary bars, arrowheads, or darkened bars
may be added to indicate completed tasks, or the portions of tasks that have been completed.
A vertical line is used to represent the report date.
03---25 Apr 25Apr---10 May 10May -10 Jun 1 1Jun.-20Jun 20Jun---27 Jun
Time
Designing
Coding
Testing
Maintenance
22
Hospital Management System
PERT Chart
PERT Chart is acronym for (Program Evaluation and Review Technique). A PERT chart is a
project management tool used to schedule, organize, and coordinate tasks within a project. It
is basically a method to analyze the tasks involved in completing a given project, especially
the time needed to complete each task, and to identify the minimum time needed to complete
the total project.
Index page
Index 01 10 Days
Page
10 Apri 2019 20 Apr 2019
23
Hospital Management System
Online E-Learning system which calls in OBBS in short is a management system which
specially designed for most of the general E-Learning for keeps track their daily Teaching
operation information. The main purpose of doing this project is in partial fulfilment of the
requirement for Bachelor of Science. Besides that, we will get to know in details regarding
how to complete a project in the real working environment by following the standard
methodology During development of a system such as prepare documentation system
development and system testing
The purpose is to meet the challenging requirement of modern day blood to efficiently
collect blood during emergency
Admin: Admin should have prior knowledge of the system. Admin is able to control
the whole system. He/she can add, delete, update and modify the system.
Teacher: can view the teaching events and donate or can make requests for donation
online learning .
Student: full fill the all term and condition after can make request for online learning
24
Hospital Management System
2. General Description
Administrator signup&login.
Teacher signup&login.
Search Teacher
Course tips.
2.1.1System interface
2.1.2User interface
Home page.
Login page.
Signup page
Search page
3.3.3 Security
Teacher identification:
The system requires the Donor to identify himself/ herself using student ID.
Login ID:
Any user who user the system shall have a login id and password.
Modification:
25
Hospital Management System
Any modification (insert, delete, and update) for the database shall be
synchronized and done only by the administrator in the ward.
Administrator’s Rights:
Administrator shall be able to view and modify all information in institute.
3.3.4 Maintainability
Error:
26
Hospital Management System
Modules Description
1. Admin login: Admin has an account in the system from where he administers
all doctors' account and resources.
2. Doctor login: Doctors' can create an account into the system by registering,
and can view their related information like salary, patient assigned or treated.
3. Receptionist login: All the receptionist are provided with an id and password
to log onto the system and can view their assigned Patient's details.
4. Patient information: Admin can add or delete patient from the system. It
maintains respective patient's details like the disease, kind of treatment taken,
doctor consulted, tests taken, days of stay, and so on.
5. Doctor's information: Admin can view doctors' details and can even update
them regularly such as updating salary, leaves taken, consulting timings etc.
6. Bed availability: The admin can keep a check on the beds available and
allotted to patients in the hospital.
8. Patient bill generation: The system automatically calculates the patient bill by
considering the number of days of stay, and bed and resources charges
incurred.
27
Hospital Management System
Report
Patient Doctor
Service
Token
Salary
Hospital
Management
System work
work
Staff
Reception Salary Salary
Salary
Service
Nurse
28
Hospital Management System
patient
Token no
Token create
Called
Store
Reception
Token
no
Doctor
Treatment report
Treatment Treatment
Departme
nt
Report
Deportm
ent
Patient
29
Hospital Management System
Doctor
Id Passward
Attendance
Department
check
Treatment retrive
Patient
Department
report
record
Account record
work
Department
Working
salary Department
Doctor
Doctor
30
Hospital Management System
Payment
Salary
Department Nurse
record
Nurse
Attendance
Department
check
served
record
Patient
department
31
Hospital Management System
Employee
Id password
Attendance
department Check
Retrive
working
Payment
Department
Department
Salary
Employee
32
Hospital Management System
Doctor
M
N id treatment
Addres E_id salary
s
M 1 1 M
Nurse served Hospital served
Employee
1
Admited
SalaryW Qualificatio
n Work Address
M
Patient
has P_id
Address Fee
1
Receptionist
R_ID
Name
d Address Salary
33
Hospital Management System
Patient Doctor
Data Member Data Member
P_ID,P_name,p_address,P_contact D_ID,D_name,D_address,D_contac
t
+token() +token()
+details() +details()
+treatment() +treatment()
Receptionist Employee
Data Member Data Member
R_ID,R_name,R_address,R_contact E_ID,E_name,E_address,E_contact
+token() +token()
+details() +details()
+service() +worked()
Nurse
Data Member
N_ID,N_name,N_address,N_contac
t
+token()
+details()
+treatment()
34
Hospital Management System
Use-case diagram
1. Patient
Token create
Treatment
Take Medicine
Payment Details
2. Doctor
Treatment
Lab examining
Medicine
Payment Details
35
Hospital Management System
3. Receptionist
Appointment
Medicine check-up
Payment Details
Patient Manage
4. Nurse
Treatment
Patient check-up
Medicine check-up
Payment Details
36
Hospital Management System
logmaster.sql
37
Hospital Management System
DOCTOR_CREATE.sql
ROOM.sql
AMBULANCE.sql
38
Hospital Management System
AMBULANCE.sql
PATIENT.sql
ROOM_NO NUMBER(10)
39
Hospital Management System
MEDICINE.sql
TEST VARCHAR2(100)
40
Hospital Management System
Flow Charts
STARTS
yes
STOP
41
Hospital Management System
PURPOSE
Code test plan: - The code testing strategy examines the logic of the system in
this; the instructions of the program are tested. The path testing of the coding
should also be planned. The testing based on these test plans does not guarantee
against software failures. Also, it does not indicate whether the code is
according to requirements or not.
Specification test plan: - This test plan includes of the specific cases of the
program. The test cases are developed for each condition or combination of
conditions and submitted for processing. This test plan doesn’t include the
testing of third party software and utilities.
42
Hospital Management System
Coding
43
Hospital Management System
LoginPage.java
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
JFrame f;
JLabel l1,l2,l3,l4,l5,l6;
JTextField t1;
JPasswordField p1;
JButton b1,b2,b3,b4,b5;
String ch,r1,r2,ch2;
int a=0,i=0;
ResultSet rs;
JComboBox cbx;
String arg[],arg2[];
LoginWindow()
f.setBounds(0,0,1375,750);
l1.setBounds(370,130,600,50);
f.add(l1);
l1.setFont(fon);
44
Hospital Management System
l1.setForeground(Color.RED);
JLabel l5=new
JLabel("______________________________________________________________
_____________________");
l5.setBounds(370,160,600,25);
f.add(l5);
l5.setForeground(Color.GREEN);
l4=new JLabel(icn4);
l4.setBounds(450,0,424,119);
f.add(l4);
l2.setBounds(450,250,200,25);
f.add(l2);
l2.setFont(fon1);
l2.setForeground(Color.GREEN);
t1=new JTextField();
t1.setBounds(600,250,250,25);
f.add(t1);
l3=new JLabel("2.Password:");
45
Hospital Management System
l3.setBounds(450,300,200,25);
f.add(l3);
l3.setFont(fon2);
l3.setForeground(Color.GREEN);
p1=new JPasswordField();
p1.setBounds(600,300,250,25);
f.add(p1);
b1=new JButton("Login");
b1.setBounds(450,450,100,50);
f.add(b1);
b2=new JButton("Cancel");
b2.setBounds(600,450,100,50);
f.add(b2);
b4=new JButton("Registred");
b4.setBounds(750,450,100,50);
f.add(b4);
46
Hospital Management System
l5.setBounds(970,630,400,25);
f.add(l5);
l5.setForeground(Color.pink);
l5.setFont(fon5);
try
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","System","
12345");
Statement st=con.createStatement();
ResultSet rs5=st.executeQuery(val2);
while(rs5.next())
a++;
ResultSet rs6=st.executeQuery(val2);
arg=new String[a];
arg2=new String[a];
while(rs6.next())
arg[i]=rs6.getString("UserName");
47
Hospital Management System
arg2[i]=rs6.getString("Password");
i++;
catch(Exception e)
System.out.println(e);
cbx=new JComboBox(arg);
cbx.setBounds(950,665,400,25);
f.add(cbx);
l6.setBounds(0,665,500,25);
f.add(l6);
l6.setForeground(Color.black);
b5=new JButton("Print");
b5.setBounds(50,640,200,25);
f.add(b5);
Toolkit tkt=Toolkit.getDefaultToolkit();
48
Hospital Management System
Image ii=tkt.getImage("logo.jpg");
f.setIconImage(ii);
Container cp=f.getContentPane();
cp.setBackground(Color.GRAY);
f.add(b1,BorderLayout.EAST);
b1.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
f.setLayout(null);
f.setVisible(true);
if(e1.getSource()==b5)
Graphics g = printjob.getGraphics();
g.dispose();
printjob.end();
49
Hospital Management System
System.exit(0);
if(e1.getSource()==b1)
try
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","System","
12345");
ch=t1.getText();
ch2=p1.getText();
Statement st=con.createStatement();
rs=st.executeQuery(val);
while(rs.next())
r1=rs.getString("UserName");
r2=rs.getString("Password");
50
Hospital Management System
JOptionPane.showMessageDialog(null,"Your
UserName and Password are invalid","Please Registration Your User
Id",JOptionPane.INFORMATION_MESSAGE);
else if(!ch2.equals(r2))
JOptionPane.showMessageDialog(null,"Your
Password are invalid please Check","Error
Message",JOptionPane.INFORMATION_MESSAGE);
else if(ch2.equals(r2))
new MainWindow(ch);
f.setVisible(false);
r1=null;
r2=null;
catch(Exception e)
System.out.println(e);
if(e1.getSource()==b4)
51
Hospital Management System
new CreateLoginDemo();
f.setVisible(false);
new LoginWindow();
CreateNewAccount.java
import java.awt.*;
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;
import java.io.*;
JFrame f;
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13,l14,l15,l16,l17,l18,l19,l20;
JTextField t1,t2,t3,t4,t5,t6,t7,t8,t55;
JRadioButton rb1,rb2;
JComboBox cb1,cb2,cb3,cb4;
JButton b1,b2,b3,b4,b55;
Font f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15;
ButtonGroup bg;
JTextArea ta1;
52
Hospital Management System
JPasswordField p1,p2;
String log="p";
String
ar[]={"$abc","@lBh","&1Ta","%1aW","#a5G","*12h","5$a","0@as","24K","12D^"}
;
String s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14;
String
st1[]={"day","01","02","03","04","05","06","07","08","09","10","11","12","13","14",
"15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31
"};
String
st2[]={"month","Janury","Fabury","March","April","May","June","July","Augest","S
eptember","October","November","December"};
String
st3[]={"year","1991","1992","1993","1994","1995","1996","1997","1998","1999","20
00","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","201
1","2012","2013","2014","2015"};
String
st4[]={"Nasility","Indian","American","Chaina","Nepali","Britan","Pakistani","Rushi
an"};
String name,ch,pas,std;
int n,i=0,a=0;
CreateLoginDemo()
f=new JFrame("PatientLoginDemo");
f.setBounds(0,0,1375,750);
53
Hospital Management System
l1.setBounds(350,30,1000,50);
f.add(l1);
l1.setFont(f1);
l1.setForeground(Color.RED);
l2=new
JLabel("____________________________________________________________");
l2.setBounds(350,40,1000,50);
f.add(l2);
l2.setFont(f2);
l2.setForeground(Color.GREEN);
Container cp=f.getContentPane();
cp.setBackground(Color.gray);
l3.setBounds(150,150,200,25);
f.add(l3);
l3.setFont(f3);
l3.setForeground(Color.GREEN);
t1.setBounds(350,150,200,25);
f.add(t1);
54
Hospital Management System
t1.addActionListener(this);
l4.setBounds(600,150,200,25);
f.add(l4);
l4.setFont(f4);
l4.setForeground(Color.GREEN);
t2.setBounds(800,150,200,25);
f.add(t2);
l5.setBounds(150,200,200,25);
f.add(l5);
l5.setFont(f5);
l5.setForeground(Color.GREEN);
cb1=new JComboBox(st1);
cb1.setBounds(350,200,100,25);
f.add(cb1);
//cb1.setSelectedIndex(15);
55
Hospital Management System
//cb1.setEnabled(false);
//System.out.println(cb1.getItemCount());
cb2=new JComboBox(st2);
cb2.setBounds(500,200,100,25);
f.add(cb2);
cb3=new JComboBox(st3);
cb3.setBounds(650,200,100,25);
f.add(cb3);
cb1.addActionListener(this);
cb2.addActionListener(this);
cb3.addActionListener(this);
l6=new JLabel("Gender:");
l6.setBounds(150,250,200,25);
f.add(l6);
l6.setFont(f6);
l6.setForeground(Color.GREEN);
rb1=new JRadioButton("Male");
rb1.setBounds(350,250,75,20);
f.add(rb1);
56
Hospital Management System
rb2=new JRadioButton("Female");
rb2.setBounds(500,250,75,20);
f.add(rb2);
bg=new ButtonGroup();
bg.add(rb1);
bg.add(rb2);
rb1.addActionListener(this);
rb2.addActionListener(this);
l7=new JLabel("UserName:");
l7.setBounds(150,300,200,25);
f.add(l7);
l7.setFont(f7);
l7.setForeground(Color.GREEN);
t3.setBounds(350,300,200,25);
f.add(t3);
l8=new JLabel("Password:");
l8.setBounds(150,350,200,25);
f.add(l8);
57
Hospital Management System
l8.setFont(f8);
l8.setForeground(Color.GREEN);
p1=new JPasswordField();
p1.setBounds(350,350,200,25);
f.add(p1);
p1.setEchoChar('*');
l9=new JLabel("RePassword:");
l9.setBounds(150,400,200,25);
f.add(l9);
l9.setFont(f9);
l9.setForeground(Color.GREEN);
p2=new JPasswordField();
p2.setBounds(350,400,200,25);
f.add(p2);
p2.setEchoChar('*');
l10.setBounds(150,450,200,25);
f.add(l10);
l10.setFont(f10);
l10.setForeground(Color.GREEN);
58
Hospital Management System
t6.setBounds(350,450,200,25);
f.add(t6);
l11=new JLabel("Address:");
l11.setBounds(150,500,200,25);
f.add(l11);
l11.setFont(f11);
l11.setForeground(Color.GREEN);
ta1.setBounds(350,500,200,50);
f.add(ta1);
l12=new JLabel("Nationilty:");
l12.setBounds(600,300,200,25);
f.add(l12);
l12.setFont(f12);
l12.setForeground(Color.GREEN);
cb4=new JComboBox(st4);
cb4.setBounds(800,300,100,25);
f.add(cb4);
59
Hospital Management System
l13.setBounds(600,350,600,25);
f.add(l13);
l13.setFont(f13);
l13.setForeground(Color.GREEN);
b1=new JButton();
b1.setBounds(700,390,100,40);
f.add(b1);
b1.setText(ar[8]);
t8.setBounds(850,400,130,25);
f.add(t8);
l33.setBounds(1050,500,300,25);
f.add(l33);
l34.setBounds(1050,500,300,25);
f.add(l34);
60
Hospital Management System
t55.setBounds(1050,530,200,25);
f.add(t55);
b55=new JButton("Check");
b55.setBounds(1100,580,100,25);
f.add(b55) ;
b55.addActionListener(this);
b2=new JButton("Submit");
b2.setBounds(300,600,100,50);
f.add(b2);
b3=new JButton("Clear");
b3.setBounds(500,600,100,50);
f.add(b3);
b4=new JButton("Cancel");
b4.setBounds(700,600,100,50);
f.add(b4);
b1.setForeground(Color.RED);
b2.setForeground(Color.RED);
b3.setForeground(Color.RED);
b4.setForeground(Color.RED);
61
Hospital Management System
//lk.setBounds(700,300,200,300);
//f.add(lk);
t1.setBackground(Color.orange);
t1.setForeground(Color.red);
t2.setBackground(Color.orange);
t2.setForeground(Color.red);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
f.setLayout(null);
f.setVisible(true);
f.setResizable(false);
ch=t55.getText();
if(e1.getSource()==b55)
62
Hospital Management System
try
Thread.sleep(5000);
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","System","
12345");
Statement st=con.createStatement();
System.out.println(val2);
ResultSet rs=st.executeQuery(val2);
while(rs.next())
a++;
pas=rs.getString(a);
System.out.println(a);
catch(Exception e)
System.out.println(e);
63
Hospital Management System
try
byte gt[]=pas.getBytes();
fout.write(gt);
fout.close();
catch(Exception s)
System.out.println(s);
if(e1.getSource()==cb1)
cb1.setForeground(Color.RED);
cb1.setBackground(Color.yellow);
if(e1.getSource()==cb2)
64
Hospital Management System
cb2.setForeground(Color.RED);
cb2.setBackground(Color.yellow);
if(e1.getSource()==cb3)
cb3.setForeground(Color.RED);
cb3.setBackground(Color.yellow);
if(e1.getSource()==rb1)
rb1.setForeground(Color.RED);
rb1.setBackground(Color.yellow);
rb2.setForeground(Color.GREEN);
rb2.setBackground(Color.yellow);
if(e1.getSource()==rb2)
rb2.setForeground(Color.RED);
rb1.setForeground(Color.GREEN);
if(e1.getSource()==b2)
//Alert Message.
65
Hospital Management System
else if(cb1.getSelectedIndex()==0)
else if(cb2.getSelectedIndex()==0)
else if(cb3.getSelectedIndex()==0)
66
Hospital Management System
else if(cb4.getSelectedIndex()==0)
else if(p1.getText().equals(""))
JOptionPane.showMessageDialog(null,"Please fill
the Password","Error Message",JOptionPane.ERROR_MESSAGE);
else if(p2.getText().equals(""))
JOptionPane.showMessageDialog(null,"Please fill
the RePassword","Error Message",JOptionPane.ERROR_MESSAGE);
67
Hospital Management System
else
//Database Coding.
try
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","System","
12345");
Statement st=con.createStatement();
s1=t1.getText();
s2=t2.getText();
68
Hospital Management System
int d=cb1.getSelectedIndex();
int m=cb2.getSelectedIndex();
int y=cb3.getSelectedIndex();
s3=st1[d];
s4=st2[m];
s5=st3[y];
String date=s3+"-"+s4+"-"+s5;
if(rb1.isSelected())
s6="Male";
else
s6="Female";
s7=t3.getText();
s8=p1.getText();
s9=p2.getText();
s10=t6.getText();
s11=ta1.getText();
s12=t8.getText();
s13=s7+"@host.com";
int index=cb4.getSelectedIndex();
s14=st4[index];
System.out.println(s13);
System.out.println(s8);
System.out.println(s9);
69
Hospital Management System
System.out.println(val2);
ResultSet rs=st.executeQuery(val2);
//int a=0;
while(rs.next())
a++;
ResultSet rs2=st.executeQuery(val2);
while(rs2.next())
if(i<a)
name=rs2.getString(i);
i++;
int v=0;
while(v<9)
if(ar[v].equals(s12))
break;
70
Hospital Management System
v++;
if(v==9)
JOptionPane.showMessageDialog(null,"Your
Secret text are Wrong","Error Window",JOptionPane.INFORMATION_MESSAGE);
if(v!=9)
if(s8.equals(s9))
System.out.println(name);
int x=st.executeUpdate(val);
System.out.println(val);
if(x==1)
JOptionPane.showMessageDialog(null,s13,"Your
User Name",JOptionPane.INFORMATION_MESSAGE);
else
71
Hospital Management System
catch(Exception e2)
System.out.println(e2);
if(e1.getSource()==b3)
if(x==JOptionPane.YES_OPTION)
cb1.setSelectedIndex(0);
cb1.setForeground(Color.black);
cb2.setSelectedIndex(0);
cb2.setForeground(Color.black);
cb3.setSelectedIndex(0);
cb3.setForeground(Color.black);
72
Hospital Management System
if(e1.getSource()==b4)
if(x==JOptionPane.YES_OPTION)
new LoginWindow();
f.setVisible(false);
if(e1.getSource()==b1)
while(n<9)
String a=ar[n];
b1.setText(a);
n++;
break;
73
Hospital Management System
new CreateLoginDemo();
MainPage.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
JFrame f;
JMenuBar mbr;
JMenu m1,m2;
JLabel l1;
JButton b1;
MainWindow(String us)
f=new JFrame();
f.setTitle("Welcome User:"+us);
f.setBounds(0,0,1375,730);
mbr=new JMenuBar();
mbr.setBounds(0,0,1375,50);
f.add(mbr);
mbr.setBackground(Color.green);
m1=new JMenu("Home");
74
Hospital Management System
mbr.add(m1);
m1.setForeground(Color.blue);
m2=new JMenu("Help");
mbr.add(m2);
l1.setBounds(10,660,500,25);
f.add(l1);
l1.setForeground(Color.red);
Container c1=f.getContentPane();
c1.setBackground(Color.pink);
b1=new JButton("AnotherLogin");
b1.setBounds(1200,660,150,25);
f.add(b1);
b1.addActionListener(this);
f.setLayout(null);
f.setVisible(true);
if(e1.getSource()==b1)
75
Hospital Management System
new LoginWindow();
f.setVisible(false);
new MainWindow("");
RecepsnistPage.java
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
JFrame f;
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13,l14;
JTextField t1,t2,t3,t4,t5,t6,t7;
JTextArea ta1,ta2,ta3,ta5;
JButton b1,b2;
JRadioButton rb1,rb2;
JComboBox cb1,cb2,cb3,cb4,cb5,cb6;
EmployeeFormDemo()
76
Hospital Management System
f.setBounds(200,50,700,600);
l1.setBounds(200,20,400,25);
f.add(l1);
l1.setFont(fon1);
l2.setBounds(30,50,200,25);
f.add(l2);
l2.setFont(fon2);
t1=new JTextField();
t1.setBounds(220,50,350,25);
f.add(t1);
l3.setBounds(30,85,200,25);
f.add(l3);
l3.setFont(fon3);
t2=new JTextField();
77
Hospital Management System
t2.setBounds(220,85,350,25);
f.add(t2);
l4.setBounds(30,120,200,25);
f.add(l4);
l4.setFont(fon4);
t3=new JTextField();
t3.setBounds(220,120,350,25);
f.add(t3);
l5=new JLabel("4.Gender:");
l5.setBounds(30,155,200,25);
f.add(l5);
l5.setFont(fon5);
rb1=new JRadioButton();
rb1.setBounds(220,155,20,20);
f.add(rb1);
l6=new JLabel("Male");
l6.setBounds(240,155,50,25);
78
Hospital Management System
f.add(l6);
rb2=new JRadioButton();
rb2.setBounds(350,155,20,20);
f.add(rb2);
l7=new JLabel("Female");
l7.setBounds(370,155,50,25);
f.add(l7);
bg1.add(rb1);
bg1.add(rb2);
l8=new JLabel("5.Age:");
l8.setBounds(30,190,200,25);
f.add(l8);
l8.setFont(fon6);
t5=new JTextField();
t5.setBounds(220,190,50,25);
f.add(t5);
l9.setBounds(30,225,200,25);
79
Hospital Management System
f.add(l9);
l9.setFont(fon7);
String
st1[]={"day","01","02","03","04","05","06","07","08","09","10","11","12","13","14",
"15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31
"};
cb1=new JComboBox(st1);
String
str2[]={"month","Janury","Fabury","March","April","May","June","July","Augest","S
eptember","October","November","December"};
cb2=new JComboBox(str2);
String
str3[]={"year","1991","1992","1993","1994","1995","1996","1997","1998","1999","2
000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010","20
11","2012","2013","2014","2015"};
cb3=new JComboBox(str3);
cb1.setBounds(220,225,50,25);
f.add(cb1);
cb2.setBounds(300,225,85,25);
f.add(cb2);
cb3.setBounds(400,225,75,25);
80
Hospital Management System
f.add(cb3);
l10=new JLabel("7.Qualification:");
l10.setBounds(30,260,200,25);
f.add(l10);
l10.setFont(fon8);
ta1=new JTextArea();
ta1.setBounds(220,260,300,50);
f.add(ta1);
l11.setBounds(30,315,200,25);
f.add(l11);
l11.setFont(fon9);
String
st4[]={"day","01","02","03","04","05","06","07","08","09","10","11","12","13","14",
"15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31
"};
cb4=new JComboBox(st4);
81
Hospital Management System
String
str5[]={"month","Janury","Fabury","March","April","May","June","July","Augest","S
eptember","October","November","December"};
cb5=new JComboBox(str5);
String
str6[]={"year","2000","2001","2002","2003","2004","2005","2006","2007","2008","2
009","2010","2011","2012","2013","2014","2015","2016"};
cb6=new JComboBox(str6);
cb4.setBounds(220,315,50,25);
f.add(cb4);
cb5.setBounds(300,315,85,25);
f.add(cb5);
cb6.setBounds(400,315,75,25);
f.add(cb6);
l14=new JLabel("9.Experience:");
l14.setBounds(30,350,200,25);
f.add(l14);
l14.setFont(fon12);
82
Hospital Management System
cb7.setBounds(220,350,100,25);
f.add(cb7);
l12.setBounds(30,390,200,25);
f.add(l12);
l12.setFont(fon10);
t6=new JTextField();
t6.setBounds(220,390,300,25);
f.add(t6);
l13=new JLabel("10.Address:");
l13.setBounds(30,425,200,50);
f.add(l13);
l13.setFont(fon11);
ta3=new JTextArea();
83
Hospital Management System
ta3.setBounds(220,425,300,50);
f.add(ta3);
b1=new JButton("Submit");
b1.setBounds(150,490,100,25);
f.add(b1);
b2=new JButton("Cancel");
b2.setBounds(300,490,100,25);
f.add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
Container c1=f.getContentPane();
c1.setBackground(Color.cyan);
f.setLayout(null);
f.setVisible(true);
if(e1.getSource()==b1)
84
Hospital Management System
if(e1.getSource()==b2)
new ModuleDemo();
f.setVisible(false);
new EmployeeFormDemo();
DeleteRecord.java
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
JFrame f;
JLabel l1,l2;
JButton b1,b2;
JTextField t1;
DeleteRecordDemo()
85
Hospital Management System
f.setBounds(200,50,500,400);
l1.setBounds(75,25,300,25);
f.add(l1);
l1.setFont(fon);
l2.setBounds(50,100,150,25);
l2.setFont(fon2);
f.add(l2);
t1=new JTextField();
t1.setBounds(175,100,200,25);
f.add(t1);
b1=new JButton("Submit");
b1.setBounds(100,200,100,25);
f.add(b1);
b2=new JButton("Cancel");
86
Hospital Management System
b2.setBounds(250,200,100,25);
f.add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
f.setLayout(null);
f.setVisible(true);
if(e1.getSource()==b1)
if(e1.getSource()==b2)
new ModuleDemo();
f.setVisible(false);
new DeleteRecordDemo();
87
Hospital Management System
FeePayment.java
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
JFrame f;
JButton b1,b2;
JLabel l1,l2,l3,l4,l5;
JTextField t1,t2;
FeePayment(String name)
f=new JFrame("PaymentDemo");
f.setBounds(500,200,400,300);
System.out.println(name);
l1.setBounds(75,10,400,25);
f.add(l1);
l1.setFont(fon);
l1.setForeground(Color.red);
l2=new JLabel("_________________________________");
l2.setBounds(75,15,400,25);
f.add(l2);
88
Hospital Management System
l3=new JLabel("1.PatientsName:-");
l3.setBounds(50,50,200,25);
f.add(l3);
l3.setForeground(Color.green);
l4=new JLabel(name);
l4.setBounds(150,50,200,25);
f.add(l4);
l4.setForeground(Color.pink);
l5=new JLabel("2.Fee:-");
l5.setBounds(50,80,200,25);
f.add(l5);
l5.setForeground(Color.green);
t1.setBounds(130,80,150,25);
f.add(t1);
b1=new JButton("Cancel");
b1.setBounds(150,150,100,25);
f.add(b1);
b1.addActionListener(this);
Container c1=f.getContentPane();
c1.setBackground(Color.darkGray);
f.setLayout(null);
89
Hospital Management System
f.setVisible(true);
String pay=t1.getText();
f.setVisible(false);
new FeePayment("");
PatientEntryForm.java
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
JFrame f;
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13,l14,l15,l16,l17,l18;
JCheckBox
cbx1,cbx2,cbx3,cbx4,cbx5,cbx6,cbx7,cbx8,cbx9,cbx10,cbx11,cbx12,cbx13,cbx14,cbx
15,cbx16,cbx17,cbx18;
JTextField t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,bo11;
JButton b1,b2,b3;
Font fon1,fon2,fon3,fon4,fon5,fon6,fon7,fon8,fon9,fon10,fon11,fon12;
90
Hospital Management System
JComboBox cb1,cb2,cb3,cb4,cb5,cb6,cb7,cb8;
JTextArea ta1,ta2;
JRadioButton rb1,rb2;
String name;
String
day[]={"Day","01","02","03","04","05","06","07","08","09","10","11","12","13","14"
,"15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","3
1"};
String
month[]={"Month","January","Febuary","March","April","May","June","July","Auge
st","September","October","November","December"};
String
year[]={"Year","2010","2011","2012","2013","2014","2015","2016","2017","2018","
2019","2020"};
String
days[]={"Days","Sunday","Monday","Tuesday","Wednesday","Thrusday","Friday","
Sturday"};
String
state[]={"State","Bihar","Panjab","WBangle","Jharkhand","Karnataka","Maharshata",
"Kerala","Gujrat"};
JTextField bo1,bo2,bo3,bo4,bo5,bo6,bo7,bo8,bo9,b011;
PatientsFrom()
f.setBounds(350,50,700,600);
//Set Border
bo1=new JTextField();
bo1.setBounds(25,40,625,2);
91
Hospital Management System
f.add(bo1);
bo2=new JTextField();
bo2.setBounds(25,42,2,500);
f.add(bo2);
bo3=new JTextField();
bo3.setBounds(25,542,625,2);
f.add(bo3);
bo4=new JTextField();
bo4.setBounds(650,40,2,502);
f.add(bo4);
l1.setBounds(250,10,250,25);
f.add(l1);
l1.setFont(fon1);
l1.setForeground(Color.red);
l2=new JLabel("______________________________");
l2.setBounds(250,15,250,25);
f.add(l2);
l3.setBounds(50,50,200,25);
f.add(l3);
l3.setFont(fon1);
92
Hospital Management System
l3.setForeground(Color.orange);
t1.setBounds(230,50,150,25);
f.add(t1);
l4.setBounds(50,80,200,25);
f.add(l4);
l4.setFont(fon1);
l4.setForeground(Color.orange);
cb1=new JComboBox(day);
cb1.setBounds(230,80,100,25);
f.add(cb1);
cb2=new JComboBox(month);
cb2.setBounds(350,80,100,25);
f.add(cb2);
cb3=new JComboBox(year);
cb3.setBounds(470,80,100,25);
f.add(cb3);
l5=new JLabel("3.Day:");
l5.setBounds(50,110,200,25);
f.add(l5);
93
Hospital Management System
l5.setFont(fon4);
l5.setForeground(Color.orange);
cb4=new JComboBox(days);
cb4.setBounds(230,110,100,25);
f.add(cb4);
l6.setBounds(50,140,200,25);
f.add(l6);
l6.setFont(fon5);
l6.setForeground(Color.orange);
t2.setBounds(230,140,300,25);
f.add(t2);
l7.setBounds(50,175,200,25);
f.add(l7);
l7.setFont(fon6);
l7.setForeground(Color.orange);
94
Hospital Management System
t3.setBounds(230,175,300,25);
f.add(t3);
l8=new JLabel("6.Age:");
l8.setBounds(50,205,200,25);
f.add(l8);
l8.setFont(fon7);
l8.setForeground(Color.orange);
t4=new JTextField("Age");
t4.setBounds(230,205,50,25);
f.add(t4);
l9=new JLabel("7.Gender:");
l9.setBounds(50,235,200,25);
f.add(l9);
l9.setFont(fon8);
l9.setForeground(Color.orange);
rb1=new JRadioButton("Male");
rb1.setBounds(230,235,60,20);
f.add(rb1);
rb2=new JRadioButton("Female");
rb2.setBounds(350,235,75,20);
95
Hospital Management System
f.add(rb2);
bp.add(rb1);
bp.add(rb2);
b3=new JButton("Payment");
b3.setBounds(470,235,100,25);
f.add(b3);
b3.setBackground(Color.pink);
b3.addActionListener(this);
l10=new JLabel("8.Address:");
l10.setBounds(50,275,200,25);
f.add(l10);
l10.setFont(fon9);
l10.setForeground(Color.orange);
//Set Border.
bo5=new JTextField();
bo5.setBounds(230,275,400,2);
f.add(bo5);
bo6=new JTextField();
bo6.setBounds(230,275,2,130);
f.add(bo6);
bo7=new JTextField();
96
Hospital Management System
bo7.setBounds(230,405,400,2);
f.add(bo7);
bo8=new JTextField();
bo8.setBounds(630,275,2,130);
f.add(bo8);
l11=new JLabel("Vill:-");
l11.setBounds(240,280,100,25);
f.add(l11);
l11.setForeground(Color.orange);
t5.setBounds(270,280,150,25);
f.add(t5);
l12=new JLabel("P.O:-");
l12.setBounds(430,280,100,25);
f.add(l12);
l12.setForeground(Color.orange);
t6.setBounds(470,280,150,25);
f.add(t6);
l13=new JLabel("P.S:-");
l13.setBounds(240,310,100,25);
f.add(l13);
97
Hospital Management System
l13.setForeground(Color.orange);
t7.setBounds(270,310,150,25);
f.add(t7);
l14=new JLabel("Dist:-");
l14.setBounds(430,320,100,25);
f.add(l14);
l14.setForeground(Color.orange);
t7.setBounds(470,320,150,25);
f.add(t7);
l15=new JLabel("State:-");
l15.setBounds(240,350,100,25);
f.add(l15);
l15.setForeground(Color.orange);
t8.setBounds(270,350,150,25);
f.add(t8);
l16=new JLabel("PinCode:-");
98
Hospital Management System
l16.setBounds(500,350,100,25);
f.add(l16);
l16.setForeground(Color.orange);
t9.setBounds(470,375,150,25);
f.add(t9);
l17.setBounds(50,420,300,25);
f.add(l17);
l17.setFont(fon10);
l17.setForeground(Color.orange);
t10.setBounds(350,420,250,25);
f.add(t10);
l18.setBounds(50,450,300,25);
f.add(l18);
l18.setFont(fon11);
l18.setForeground(Color.orange);
cbx1=new JCheckBox("01");
99
Hospital Management System
cbx1.setBounds(200,450,40,25);
f.add(cbx1);
cbx2=new JCheckBox("02");
cbx2.setBounds(250,450,40,25);
f.add(cbx2);
cbx3=new JCheckBox("03");
cbx3.setBounds(300,450,40,25);
f.add(cbx3);
cbx4=new JCheckBox("04");
cbx4.setBounds(350,450,40,25);
f.add(cbx4);
cbx5=new JCheckBox("05");
cbx5.setBounds(400,450,40,25);
f.add(cbx5);
cbx6=new JCheckBox("06");
cbx6.setBounds(450,450,40,25);
f.add(cbx6);
cbx7=new JCheckBox("07");
cbx7.setBounds(500,450,40,25);
f.add(cbx7);
100
Hospital Management System
cbx8=new JCheckBox("08");
cbx8.setBounds(550,450,40,25);
f.add(cbx8);
cbx9=new JCheckBox("09");
cbx9.setBounds(600,450,40,25);
f.add(cbx9);
cbx10=new JCheckBox("10");
cbx10.setBounds(200,480,40,25);
f.add(cbx10);
cbx11=new JCheckBox("11");
cbx11.setBounds(250,480,40,25);
f.add(cbx11);
cbx12=new JCheckBox("12");
cbx12.setBounds(300,480,40,25);
f.add(cbx12);
cbx13=new JCheckBox("13");
cbx13.setBounds(350,480,40,25);
f.add(cbx13);
cbx14=new JCheckBox("14");
cbx14.setBounds(400,480,40,25);
f.add(cbx14);
101
Hospital Management System
cbx15=new JCheckBox("15");
cbx15.setBounds(450,480,40,25);
f.add(cbx15);
cbx16=new JCheckBox("16");
cbx16.setBounds(500,480,40,25);
f.add(cbx16);
cbx17=new JCheckBox("17");
cbx17.setBounds(550,480,40,25);
f.add(cbx17);
cbx18=new JCheckBox("18");
cbx18.setBounds(600,480,40,25);
f.add(cbx18);
b1=new JButton("Submit");
b1.setBounds(200,510,100,25);
f.add(b1);
b2=new JButton("Cancel");
b2.setBounds(450,510,100,25);
f.add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
102
Hospital Management System
Container c1=f.getContentPane();
c1.setBackground(Color.darkGray);
f.setLayout(null);
f.setVisible(true);
if(e1.getSource()==b1)
String srl=t1.getText();
int d=cb1.getSelectedIndex();
String dy=day[d];
int m=cb2.getSelectedIndex();
String mo=month[m];
int y=cb3.getSelectedIndex();
String yr=year[y];
int da=cb4.getSelectedIndex();
String day1=days[da];
name=t2.getText();
String pname=t3.getText();
String ag=t4.getText();
String gender;
103
Hospital Management System
if(rb1.isSelected()==true)
gender="Male";
else if(rb2.isSelected()==true)
gender="Female";
if(dy.equals("Day"))
else if(mo.equals("Month"))
else if(yr.equals("Year"))
104
Hospital Management System
else if(day1.equals("Days"))
else if(ag.equals("Age"))
105
Hospital Management System
if(e1.getSource()==b2)
f.setVisible(false);
if(e1.getSource()==b3)
name=t2.getText();
new FeePayment(name);
new PatientsFrom();
BloodTest.java
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
106
Hospital Management System
JFrame f;
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13,l14;
JTextField
t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25;
Font fon1,fon2,fon3,fon4,fon5,fon6,fon7,fon8,fon9,fon10,fon11;
JButton b1,b2,b3,b4;
JComboBox cb1,cb2,cb3;
String
st1[]={"day","01","02","03","04","05","06","07","08","09","10","11","12","13","14",
"15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31
"};
String
st2[]={"month","Janury","Fabury","March","April","May","June","July","Augest","S
eptember","October","November","December"};
String
st3[]={"year","2013","2014","2015","2016","2017","2018","2019","2020","2021","20
22","2023","2024"};
BloodTest()
f.setBounds(300,50,700,600);
l1.setBounds(150,10,500,25);
f.add(l1);
l1.setFont(fon1);
107
Hospital Management System
l2=new
JLabel("_____________________________________________________________")
;
l2.setBounds(150,15,500,25);
f.add(l2);
l1.setForeground(Color.blue);
l2.setForeground(Color.black);
l3.setBounds(50,50,150,25);
f.add(l3);
l3.setForeground(Color.blue);
t1=new JTextField("Dr.");
t1.setBounds(150,50,300,25);
f.add(t1);
Container c1=f.getContentPane();
c1.setBackground(Color.cyan);
l4.setBounds(50,80,150,25);
f.add(l4);
l4.setForeground(Color.blue);
t2=new JTextField();
t2.setBounds(150,80,300,25);
f.add(t2);
108
Hospital Management System
l4.setBounds(530,40,150,25);
f.add(l4);
l4.setForeground(Color.blue);
cb1=new JComboBox(st1);
cb1.setBounds(460,70,50,25);
f.add(cb1);
cb2=new JComboBox(st2);
cb2.setBounds(520,70,80,25);
f.add(cb2);
cb3=new JComboBox(st3);
cb3.setBounds(610,70,80,25);
f.add(cb3);
t3=new JTextField();
t3.setBounds(20,120,650,2);
f.add(t3);
t3=new JTextField();
t3.setBounds(20,120,2,400);
f.add(t3);
t3=new JTextField();
t3.setBounds(20,520,650,2);
109
Hospital Management System
f.add(t3);
t3=new JTextField();
t3.setBounds(670,120,2,400);
f.add(t3);
t3=new JTextField();
t3.setBounds(350,120,2,400);
f.add(t3);
t3=new JTextField();
t3.setBounds(20,180,650,2);
f.add(t3);
t3=new JTextField();
t3.setBounds(20,220,650,2);
f.add(t3);
t3=new JTextField();
t3.setBounds(20,270,650,2);
f.add(t3);
t3=new JTextField();
t3.setBounds(20,310,650,2);
f.add(t3);
t3=new JTextField();
t3.setBounds(20,350,650,2);
f.add(t3);
t3=new JTextField();
t3.setBounds(20,390,650,2);
f.add(t3);
t3=new JTextField();
t3.setBounds(350,430,320,2);
110
Hospital Management System
f.add(t3);
t3=new JTextField();
t3.setBounds(20,470,650,2);
f.add(t3);
l5.setBounds(25,120,100,25);
f.add(l5);
l5=new JLabel("Erythrocytes-");
l5.setBounds(40,135,100,25);
f.add(l5);
l5.setBounds(45,148,200,25);
f.add(l5);
t4.setBounds(180,140,120,25);
f.add(t4);
l8.setBounds(300,140,200,25);
f.add(l8);
l6=new JLabel("Leucoytes");
l6.setBounds(45,175,200,25);
111
Hospital Management System
f.add(l6);
l7.setBounds(45,190,200,25);
f.add(l7);
t5.setBounds(180,190,120,25);
f.add(t5);
l8.setBounds(300,190,200,25);
f.add(l8);
l9=new JLabel("2.Haemoglobin");
l9.setBounds(30,220,100,25);
f.add(l9);
l8=new JLabel("(14.5gm=100%)");
l8.setBounds(40,240,200,25);
f.add(l8);
t6=new JTextField();
t6.setBounds(130,230,50,25);
f.add(t6);
l10.setBounds(190,230,100,25);
f.add(l10);
t7.setBounds(230,230,80,25);
f.add(t7);
l10=new JLabel("%");
112
Hospital Management System
l10.setBounds(330,230,100,25);
f.add(l10);
l11=new JLabel("3.MP/MF(Slide)-");
l11.setBounds(30,280,100,25);
f.add(l11);
t8.setBounds(150,280,100,25);
f.add(t8);
l11.setBounds(30,320,100,25);
f.add(l11);
t9.setBounds(150,320,100,25);
f.add(t9);
l11.setBounds(30,360,100,25);
f.add(l11);
t10.setBounds(150,360,100,25);
f.add(t10);
l11.setBounds(30,390,200,25);
f.add(l11);
113
Hospital Management System
t11.setBounds(200,430,80,25);
f.add(t11);
l11.setBounds(40,410,200,25);
f.add(l11);
l11.setBounds(40,430,200,25);
f.add(l11);
l11=new JLabel("mm");
l11.setBounds(280,430,200,25);
f.add(l11);
l11.setBounds(40,480,100,25);
f.add(l11);
t12.setBounds(200,480,80,25);
f.add(t12);
l11=new JLabel("mm");
l11.setBounds(280,480,200,25);
f.add(l11);
l11.setBounds(360,120,200,25);
f.add(l11);
l11=new JLabel("Netrophil-");
l11.setBounds(380,140,200,25);
114
Hospital Management System
f.add(l11);
l11=new JLabel("(50-60%)");
l11.setBounds(385,155,200,25);
f.add(l11);
t13.setBounds(450,150,100,25);
f.add(t13);
l11=new JLabel("%");
l11.setBounds(555,150,200,25);
f.add(l11);
l11=new JLabel("Lymphocyte");
l11.setBounds(380,180,200,25);
f.add(l11);
l11=new JLabel("(28-30%)");
l11.setBounds(385,195,200,25);
f.add(l11);
t14.setBounds(450,190,100,25);
f.add(t14);
l11=new JLabel("%");
l11.setBounds(555,190,200,25);
f.add(l11);
l11=new JLabel("Eosinophil");
l11.setBounds(380,225,200,25);
f.add(l11);
115
Hospital Management System
l11=new JLabel("(2-6%)");
l11.setBounds(385,240,200,25);
f.add(l11);
t16.setBounds(450,235,100,25);
f.add(t16);
l11=new JLabel("%");
l11.setBounds(555,235,200,25);
f.add(l11);
l11=new JLabel("Monocyts");
l11.setBounds(380,265,200,25);
f.add(l11);
l11=new JLabel("(1-3%)");
l11.setBounds(385,280,200,25);
f.add(l11);
t17.setBounds(450,275,100,25);
f.add(t17);
l11=new JLabel("%");
l11.setBounds(555,275,200,25);
f.add(l11);
l11=new JLabel("Basophiles");
l11.setBounds(380,310,200,25);
f.add(l11);
l11=new JLabel("(2-6%)");
116
Hospital Management System
l11.setBounds(385,325,200,25);
f.add(l11);
t18.setBounds(450,320,100,25);
f.add(t18);
l11=new JLabel("%");
l11.setBounds(555,320,200,25);
f.add(l11);
l11.setBounds(360,360,200,25);
f.add(l11);
t19.setBounds(450,360,100,25);
f.add(t19);
l11.setBounds(360,400,200,25);
f.add(l11);
t20.setBounds(450,400,100,25);
f.add(t20);
l11.setBounds(360,440,200,25);
f.add(l11);
117
Hospital Management System
t21.setBounds(500,440,100,25);
f.add(t21);
l11=new JLabel("11.Others-");
l11.setBounds(360,490,200,25);
f.add(l11);
t22.setBounds(500,490,100,25);
f.add(t22);
b1=new JButton("Submit");
b1.setBounds(200,530,100,25);
f.add(b1);
b2=new JButton("Cancel");
b2.setBounds(450,530,100,25);
f.add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
f.setLayout(null);
118
Hospital Management System
f.setVisible(true);
f.setResizable(false);
if(e1.getSource()==b1)
if(t1.getText().equals("Dr."))
else if(t2.getText().equals(""))
else if(cb1.getSelectedItem().equals("day"))
else if(cb2.getSelectedItem().equals("month"))
119
Hospital Management System
else if(cb3.getSelectedItem().equals("year"))
if(e1.getSource()==b2)
f.setVisible(false);
new BloodTest();
ProfilePage.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.sql.*;
JFrame f;
JButton b1,b2,b3,b4,b5,b6,b7,b8;
JFrame f1;
120
Hospital Management System
String ph=null;
String fname=null,Lname=null,cover=null,u=null;
FacebookProfileDemo(String user)
u=user;
System.out.println(user);
f=new JFrame("FacebookProfileDemo");
f.setBounds(0,0,1375,720);
Container c=f.getContentPane();
c.setBackground(Color.cyan);
t1.setBounds(250,150,900,5);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
t1=new JTextField();
t1.setBounds(250,0,5,155);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
t1=new JTextField();
t1.setBounds(0,0,5,700);
121
Hospital Management System
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
t1=new JTextField();
t1.setBounds(250,0,1300,5);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
lk.setBounds(1200,250,250,25);
f.add(lk);
t1=new JTextField();
t1.setBounds(1350,0,5,700);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
b2.setBounds(1125,125,25,25);
f.add(b2);
b2.setBackground(Color.white);
122
Hospital Management System
t1=new JTextField();
t1.setBounds(0,0,250,5);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
t1=new JTextField();
t1.setBounds(0,100,250,5);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
t1=new JTextField();
t1.setBounds(0,0,5,100);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
l2.setBounds(5,0,50,50);
f.add(l2);
123
Hospital Management System
l1.setBounds(45,10,200,30);
f.add(l1);
l1.setForeground(Color.white);
l1.setFont(fon);
l12.setBounds(20,40,200,25);
f.add(l12);
l12.setForeground(Color.black);
t1=new JTextField();
t1.setBounds(1150,0,5,155);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
t1=new JTextField();
t1.setBounds(1150,155,5,600);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
124
Hospital Management System
t1=new JTextField();
t1.setBounds(250,250,5,500);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
t1=new JTextField();
t1.setBounds(100,100,150,5);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
t1=new JTextField();
t1.setBounds(100,100,5,150);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
t1=new JTextField();
t1.setBounds(250,100,5,150);
125
Hospital Management System
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
b1.setBounds(230,225,20,25);
f.add(b1);
b1.setBackground(Color.white);
t1=new JTextField();
t1.setBounds(100,250,155,5);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
b3=new JButton("Home");
b3.setBounds(255,155,100,25);
f.add(b3);
b4=new JButton("Profile");
b4.setBounds(355,155,100,25);
f.add(b4);
b5=new JButton("Frineds");
126
Hospital Management System
b5.setBounds(455,155,100,25);
f.add(b5);
b1.setForeground(Color.gray);
b6.setBounds(555,155,100,25);
f.add(b6);
b7=new JButton("Chat");
b7.setBounds(655,155,100,25);
f.add(b7);
b8=new JButton("Logout");
b8.setBounds(1250,645,100,25);
f.add(b8);
b2.setForeground(Color.gray);
b3.setForeground(Color.gray);
b4.setForeground(Color.gray);
b5.setForeground(Color.gray);
b6.setForeground(Color.gray);
b7.setForeground(Color.gray);
b8.setForeground(Color.gray);
b3.setBackground(Color.cyan);
127
Hospital Management System
b4.setBackground(Color.cyan);
b5.setBackground(Color.cyan);
b6.setBackground(Color.cyan);
b7.setBackground(Color.cyan);
b8.setBackground(Color.cyan);
t1=new JTextField();
t1.setBounds(250,180,900,5);
f.add(t1);
t1.setEditable(false);
t1.setBackground(Color.red);
b1.addActionListener(this);
b2.addActionListener(this);
b7.addActionListener(this);
Toolkit tkt=Toolkit.getDefaultToolkit();
Image ii=tkt.getImage("facebook.jpg");
f.setIconImage(ii);
/*try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("Driver Regestied");
Connection
con=DriverManager.getConnection("jdbc:odbc:mydb");
128
Hospital Management System
Statement st=con.createStatement();
System.out.println("Connetction");
System.out.println(val);
ResultSet rs=st.executeQuery(val);
while(rs.next())
fname=rs.getString("first_name");
Lname=rs.getString("Last_name");
ph=rs.getString("photo");
System.out.println(fname+Lname);
catch(Exception e)
System.out.println(e);
System.out.println(ph);
ll.setBounds(100,100,150,150);
f.add(ll);
129
Hospital Management System
l13.setBounds(150,40,200,25);
f.add(l13);
l13.setForeground(Color.black);
b8.addActionListener(this);
*/
f.setLayout(null);
f.setVisible(true);
if(e1.getSource()==b8)
new LoginWindow();
f.setVisible(false);
/*if(e1.getSource()==b1)
130
Hospital Management System
fc.setFileFilter(new ImageFilter());
if (result == JFileChooser.APPROVE_OPTION)
file = fc.getSelectedFile();
System.out.println(file.getPath());
String p=file.getPath();
l1.setBounds(100,100,150,150);
f.add(l1);
System.out.println("Hello");
else if(e1.getSource()==b2)
//fc.setFileFilter(new ImageFilter());
if (result == JFileChooser.APPROVE_OPTION)
file = fc.getSelectedFile();
System.out.println(file.getPath());
131
Hospital Management System
String p=file.getPath();
cover=file.getPath();
l1.setBounds(250,0,900,150);
f.add(l1);
//f.setImage(icn);
//f.setIcon(icn.getImage());
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("Driver Regestied");
Connection
con=DriverManager.getConnection("jdbc:odbc:mydb");
Statement st=con.createStatement();
System.out.println("Connetction");
st.executeUpdate(val);
System.out.println(val);
catch(Exception e)
132
Hospital Management System
System.out.println(e);
if(e1.getSource()==b7)
if(f1!=null)
f1.setVisible(false);
f1.setBounds(700,400,400,300);
l1.setBounds(100,80,200,25);
f1.add(l1);
ta1.setBounds(0,120,400,100);
f1.add(ta1);
Toolkit tkt=Toolkit.getDefaultToolkit();
Image ii=tkt.getImage("facebook.jpg");
f1.setIconImage(ii);
f1.setLayout(null);
133
Hospital Management System
f1.setVisible(true);
}*/
if (f.isDirectory())
return true;
if (name.matches(".*((.jpg)|(.gif)|(.png))"))
return true;
else
return false;
new ProfileDemo("");
134
Hospital Management System
Interface Design
135
Hospital Management System
Welcome Page
136
Hospital Management System
Login Page
137
Hospital Management System
Profile Page
138
Hospital Management System
139
Hospital Management System
140
Hospital Management System
141
Hospital Management System
142
Hospital Management System
White box testing sometimes called glass box testing. It is a test case design method
that uses the control structure of procedural design to derive test cases. Using ‘white
box testing’ methods, the software can be derived test that Guarantee that all
independent paths within module have been exercised at least once.
143
Hospital Management System
Basic path testing is a white box testing technique first proposed by TOM
McCabe. The basic path methods enables the test case to derive a logical complexity
to measure of procedural design and measure as a guide for basic sets of execution
paths. Test cases derived to excise the basis set are guaranteed to execute every
statements in the program at least one time during testing.
CONDITION TESTING:
Condition testing is a test case design method that exercises the logical
conditions contained in the program module. The condition testing methods focuses
on testing each condition in the program. Condition testing strategies have two
advantages, first, measurement of test coverage of a conditional is simple; second, and
the test coverage of a condition in the program provides guidance for the generation of
additional tests for the program.
The data flow testing techniques selects the test path of a program according to
the locations of the definitions and uses of variables in the program. Data flow testing
strategies are useful for selecting test paths of a program containing nested if and else
statements.
LOOP TESTING:
It is also a white box testing technique that focuses exclusively on the validity of loop
constructs. Four different classes of loops can be defined: simple loops, concatenated
loops, nested loops and unstructured loops.
144
Hospital Management System
Black box testing also called behavioral testing, focuses on the functional
requirements of software. That is black box testing enables the software engineer to
derive the sets of inputs conditions that will fully exercise all functional requirements
for a program. Black box testing is not an alternative to white box testing. Rather, it is
also complementary approach that is likely to uncover a different class of errors than
white box testing.
1) Test cases that reduce, by a count that is greater than one, the number of
additional test cases that must be designed to achieve reasonable testing and
2) Test cases that tell us something about the presence or absence of classes of
errors, rather than an error associated only specific test at hand.
Graph based testing methods:
The first step in black box testing is to understand the objects that are modeled in
software and the relationship that connects these objects. Once this need has been
accomplished, the next step is to define a series of test that verify. All objects have
the expected relationship to one another.
145
Hospital Management System
Equivalence partitioning:
Boundary value analysis is a test case design technique that complements equivalence
partitioning. Rather than selecting any element of equivalence classes, BVA leads to
the selection of test cases at the “edge” of class.
By using these testing methods in the present software many defects and errors
present has been removed and it looks a good software with no or minimum errors.
146
Hospital Management System
The strategy provides a road map that describes the steps to be conducted as part of
testing, when these steps are planned and then undertaken, how much effort, time and
resources will be required.
A number of software testing strategies have been proposed. All provides the software
developer with a template for testing and all have the following general
characteristics:
Testing begins at the component level and works “outward” towards the
integration of the entire computer based system.
Different testing techniques are appropriate at different point in time.
Testing is conducted by the developer of the software and the
independent test group.
Testing and debugging are different activities, but debugging must be
accomplished in any testing strategy.
Unit testing
Unit testing focuses verification effort on the smallest unit of the software design the
software component or the module. Using the component level design description as a
guide, important control paths are tested to uncover errors within the boundary of the
module. The unit testing is white box oriented and steps can be constructed in parallel
for multiple components.
The module interface is tested to ensure that information properly flows into and
output of the program unit under test. The local data structure is examined to ensure
that data stored temporarily maintains its integrity during all steps in an algorithm
execution. Boundary conditions are tested to ensure that the module operates properly
at the boundary established to limit or restrict processing. All independent paths
through the control structure are exercised to ensure that all statements in module have
been executed at least once. And finally, all errors handling are tested.
147
Hospital Management System
Unit testing can be performed from the bottom up, starting with smallest and lowest-
level modules and proceeding one at a time. For each module in bottom up testing a
short program is used to execute the module and provides the needed data, so that that
module is asked to perform the way it will when embedded within the larger system.
Each module of this project is tested at the local data structure level, boundary level,
interface level, independent path and error handling path. No errors are found,
interface between two modules are compatible i.e. it sends data and receive data as
they desire from other module. Data structures are capable to store module level data
as well as data received from other module.
Integration testing
Integration testing is a systematic technique for constructing the program structure
while at the same time conducting test to uncover errors associated with the
interfacing. The objective is to take unit tested components and built a program
structure that has been dictated by design.
Validation testing
Software validation is achieved through a series of black box tests that demonstrate
conformity with requirements. A test plans outlines the classes of tests to be
conducted and a test procedure defines specific test cases that will be demonstrated
with conformity with requirements. Both the plan and procedure are designed to
ensure that all functional requirements are satisfied, all behavioral characteristics are
achieved, all performance requirements are attained and human engineered and other
requirements are meet.
148
Hospital Management System
System testing
System testing is actually a series of different tests whose primary purpose
is to fully exercise the computer based system. Although each test has a different
purpose, all work to verify that system elements have been properly integrated and
perform allocated functions. The purpose of system testing is to consider all the
likely variations to which it will subject and then push the system to its limits.
System testing makes a logical assumption that if all the parts of the system are
correct, the goal will be successfully activated. Another reason for system testing
is its utility as user oriented vehicle before implementation.
Program testing
String testing
Recovery testing
Security testing
Stress testing
Performance testing
These given testing strategies have been used for the present project software. It took
a long time to test every possible condition for the system and the software can said
“tested ok” up to a reasonable limit. As any software can’t be 100% error free, this
software is also not an exception and it is possible to find out errors in the future (at
the time of application). These errors will be freed when it comes.
Test Log:-
149
Hospital Management System
Of username and
password.
Of the details
Entered by the
User.
Working of total
button.
150
Hospital Management System
Proper working of
back button.
TC5 10 75%
Proper working
Of exit button.
TC6 6 100%
Proper working
Working of the
abort button.
TC9 10 90%
151
Hospital Management System
Security Mechanism
This module takes input as login and password .if admin wants to change the
password then this module provides this facility. The User Password must have at
least 6 characters. Main Menu and system are only accessed by the Admin.
The Backup and Restore facility are also provided here which is very essential
component for security purposes.
152
Hospital Management System
Cost Estimation
Software costs constituted a small percentage of the overall computer-based
system cost. An order of magnitude error in estimates of software cost had relatively
little impact. Today, software is the most expensive element of virtually all computer
based systems.
As far as my project is concerned the metric for the project cost and effort
estimation can be as follows.
Estimation Model : COCOMO
Project : Online School Admission and Enquiry
System
Line of Code (LOC) : 2000 Approx.
People : One
Project Mode : Organic (< 50 KLOC)
Now According to COCOMO,
153
Hospital Management System
154
Hospital Management System
Report Generation
Ward Master
Attendent_Master
Doctor Master
Name
sinha
155
Hospital Management System
Test Master
Id
Patient Master
Pat Name Addres AdmitD Admit- Doctor Test- Roo Fee- Fee-
t e
01 r
Patient Service
156
Hospital Management System
ServiceMaster
157
Hospital Management System
Future Scope
158
Hospital Management System
159
Hospital Management System
Bibliography
160