Hospital Managemnt System PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 160

Hospital Management System

A Project Report on

“HOSPITAL MANAGEMENT SYSTEM”

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

“Bachelor of Computer Application (BCA) ”


Session:-2016-2019

Under the Guidence of Submitted By:


Dr.Shah Salamat Ali Rizwi
Ekta Kumari
Asst. Professor, IT
RegNo : 108679
RollNo : 165155
Course : BCA
Session : 2016-2019

1
Hospital Management System

Table of Contents

S. No Topics Page Number


1. Title of the project 03
2. Introduction of the project 04
3. Objective & Scope 06
4. Identification of Need 07
5. Software Development Life cycle 08
 Preliminary Investigation 09
10
 Feasibility Study
 Project Planning 11
6. Language Description 17
7. Database Description 19
8. Tools & Platform 21
9. Project Scheduling (PERT Chart and Gantt 22
Chart)
10. Software Requirement Specification(SRS) 23

11. Modules Description 27


12. Data flow Diagram(DFD’s) 28
13. ER-Diagram 33
14. Class Diagrams 34
15. Use-case Diagrams 35
16. Database schema Design 37
17. Flow chart 41
18. Coding 43
19. Interface Design 135
20. Testing 143
21. Future scope and conclusion Project 159
22. Limitation of the Project 159
23. Bibliography 160

2
Hospital Management System

Title of the project

3
Hospital Management System

Introduction of the Project

A Hospital Management System is an automated software system that manages the

function of a health care. The presented project here is made in view overcoming the

problems faced by many Hospitals regarding Maintaining patient records , Recording

and keeping of Doctor’s information, Bed management , Report generation etc. i.e.

“General HMS Automation”.

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

profitability of the organization.

About the Organization

A Hospital normally contains information about patient. A hospital management

system normally contains the following parts:-

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

identification number or room number.

Bed Management

Bed Management means allows hospital authorities to view and track the bed

occupancy related operations. Bed Management governs activities like Bed Enquiry,

Bed Census, and Bed Maintenance.

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.

 We shall create honest working environment with see-through-glass

planning.

Our Mission:

To create opportunity for growth & self actualization and provide an environment

of highly conducive works culture.

5
Hospital Management System

Objective of the project

o PROJECT RECORD MAINTENANCE

To maintain the proper details of hospital management system provides the following:

Registration, list of patients, adding doctors, record of patients, modify details,

discharge of patients so on under various provision provided by the management.

o MAINTAIN FLEXIBILITIES

The system should be modified depending on the changing needs of the user such

modification should be entire reconstructing on recreation of software. It should also be

portable to different computer system.

o INCREASE PRACTICABILITY

The system should be a stable and can be operated by people with average intelligence

means it should be user friendly.

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

must satisfy all the requirements.

o MAINTAIN THE SECURITY

This is very important aspect of the design and should cover areas of hardware

reliability, physical security of data.

6
Hospital Management System

Identification of Needs

We are various need to develop for successful of this system

1. Different Phase of System Analysis


2. Need for various designing diagrams such as DFD(Data flow Diagram), ER-
Diagram , User Case Diagram ,Sequence diagram , Class Diagram etc.
3. After the successful Analysis or designing phase to be find out the best
programming language to develop this project. I have choose the “ JAVA ” to
develop this project.
4. Again we find out the best Database to store the permanent basis of the this
project data. I have choose the “ORACLE” database of this project.
5. After the database to develop this project E-Learning Management System, I
have choose various testing techniques to check out this project the running
problem.

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

Software Development Life cycle


SDLC is a process followed for a software project, within a software organization. It
consists of a detailed plan describing how to develop, maintain, replace and alter or
enhance specific software. The life cycle defines a methodology for improving the
quality of software and the overall development process.
The SDLC phase has describe for Water fall model.

Requirement Analysis

Designing

Coding

Testing

Maintenance

8
Hospital Management System

Requirement Analysis phase


Requirement gathering and analysis is the most important phase in software
development lifecycle. Business Analyst collects the requirement from the
Customer/Client as per the clients business needs and documents the requirements in
the Business Requirement Specification (document name varies depends upon the
Organization. Some examples are Customer Requirement Specification (CRS),
Business Specification (BS) etc., and provides the same to Development Team.Once
the requirement gathering and analysis is done the next step is to define and document
the product requirements and get them approved by the customer. This is done
through SRS (Software Requirement Specification) document. SRS consists of all the
product requirements to be designed and developed during the project life cycle. Key
people involved in this phase are Project Manager, Business Analysist and Senior
members of the Team. The outcome of this phase is Software Requirement
Specification.

Design Phase

It has two steps:


HLD – High Level Design – It gives the architecture of the software product to be
developed and is done by architects and senior developers
LLD – Low Level Design – It is done by senior developers. It describes how each and
every feature in the product should work and how every component should work.
Here, only the design will be there and not the code
The outcome from this phase is High Level Document and Low Level Document
which works as an input to the next 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’.

Deployment & Maintenance Phase:

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.

 There are various types of feasibility study in this system

Feasibility
Study

Technical Operational Economical


Feasibility Feasibility Feasibility

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.

 Determines whether the problems anticipated in user requirements are of high


priority
 Determines whether the solution suggested by the software development team is
acceptable
 Analyzes whether users will adapt to a new software
 Determines whether the organization is satisfied by the alternative solutions
proposed by the software development team.

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.

 Cost incurred on software development to produce long-term gains for an


organization
 Cost required to conduct full software investigation (such as requirements elicitation
and requirements analysis)
 Cost of hardware, software, development team, and training.

Feasibility Study Process

13
Hospital Management System

Feasibility study comprises the following steps.

1. Information assessment: Identifies information about whether the system helps in


achieving the objectives of the organization. It also verifies that the system can be
implemented using new technology and within the budget and whether the system can
be integrated with the existing system.
2. Information collection: Specifies the sources from where information about software
can be obtained. Generally, these sources include users (who will operate the
software), organization (where the software will be used), and the software
development team (which understands user requirements and knows how to fulfil
them in software).
3. Report writing: Uses a feasibility report, which is the conclusion of the feasibility
study by the software development team. It includes the recommendations whether the
software development should continue. This report may also include information
about changes in the software scope, budget, and schedule and suggestions of any
requirements in the system.
4. General information: Describes the purpose and scope of feasibility study. It also
describes system overview, project references, acronyms and abbreviations, and points
of contact to be used. System overview provides description about the name of the
organization responsible for the software development, system name or title, system
category, operational status, and so on. Project references provide a list of the
references used to prepare this document such as documents relating to the project or
previously developed documents that are related to the project. Acronyms and
abbreviations provide a list of the terms that are used in this document along with
their meanings. Points of contact provide a list of points of organizational contact
with users for information and coordination. For example, users require assistance to
solve problems (such as troubleshooting) and collect information such as contact
number, e-mail address, and so on.
5. Management summary: Provides the following information.
6. Environment: Identifies the individuals responsible for software development. It
provides information about input and output requirements, processing requirements of

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.

Project planning requires an in-depth analysis and structuring of the following


activities:

 Setting project goals


 Identifying project deliverables
 Creating project schedules
 Creating supporting plans

15
Hospital Management System

The project planning stage requires


several inputs, including conceptual proposals, project schedules, resource
requirements/limitations and success metrics. Project planning begins by setting the
scope of a project and eventually working through each level of dependent actions,
tasks, checkpoints and deadlines.

All of this information is integrated into Gantt charts, or other types of scheduling
charts, to provide a project overview for all involved parties.

The culmination of the project planning stage identifies:

 Road blocks in the project


 Work required for project completion
 People involved in the project and their key responsibilities
 Minimum project completion time
 Major project deliverables
 Required project milestones

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

Java is a general-purpose, concurrent, object-oriented, class-based, and the runtime

environment(JRE) which consists of JVM which is the cornerstone of the Java

platform. This blog on What is Java will clear all your doubts about why to learn

java, features and how it works.

Java is: –

 Concurrent where you can execute many statements instead of


sequentially executing it.
 Class-based and an object-oriented programming language.
 Independent programming language that follows the logic of “Write once, Run
anywhere” i.e. the compiled code can run on all platforms which supports java.

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

Object-oriented: Everything is considered to be an “object” which possess some


state, behavior and all the operations are performed using these objects.

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.

Dynamic: It has the ability to adapt to an evolving environment which supports


dynamic memory allocation due to which memory wastage is reduced and
performance of the application is increased.

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 is a fourth generation relational database management system. In general, a


database management system (DBMS) must be able to reliably manage a large
amount of data in a multi-user environment so that many users can concurrently
access the same data. All this must be accomplished while delivering high
performance to the users of the database. A DBMS must also be secure from
unauthorized access and provide efficient solutions for failure recovery. The
ORACLE Server provides efficient and effective solutions for the major database
features.

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.

This documentation will cover:

 ORACLE Architecture - provides a basic understanding of the ``Big Picture''


including the concepts and terminology of the ORACLE Server.

 Starting ORACLE And Other Important Information - provides the knowledge


of how to set up your account and other system environment variables. It will
also provide information about how ORACLE is currently setup, which you
will require, and the steps you must take to report any problems.

 SQL*Plus (Terminal Monitor) - provides a summary of the commands that you


will require in order to create tables and manipulate the database.

 SQL*Loader - provides a summary of the commands that you will require to


allow you to load data from a file to the database.

 SQL Commands - provides the syntax of some of the SQL Commands in


ORACLE to help you get started. This section will only shed light on the Data
Definition Language commands and will not contain any information on
querying the database (which should be covered in class).

19
Hospital Management System

Is ORACLE hard to learn? Not really.


Use this manual to give you an introduction and reference, and peruse whatever code
the T.A. gives you, but above all else experiment! No amount of documentation could
hope to encapsulate all of the little ins and outs that some good old fashioned fiddling
around will find. Try to remember that a few thousand pages were boiled down to this
thin tome that you are holding, so if you think that this book is the be-all and end-all
of ORACLE knowledge... Well, you'll find out soon enough.

20
Hospital Management System

Tools & Platform

Hardware Requirement:

Processor : Pentium II Processor

RAM : 512 MB RAM (Min.)

Hard Disk : 320 GB

Monitor : Color Monitor and Advance

Keyboard : Any Keyboard

Mouse : Any Mouse

Printer : B/W and Color

Software Requirement:

Operating System : Window98, Window XP, Window7,8,


Linux

Database : ORACLE

User Interface : AWT/SWING package

Programming Language : JAVA

Software Development Kit : Java JDK 1.8 Above

Database JDBC Driver : oracle

Development Tools:

Front – End : JAVA

Back – End : ORACLE

21
Hospital Management System

Project Scheduling (Gantt Chart and PERT Chart)

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

Analysis of this project

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.

Design for PERT chart according to Hospital Management System

Task Dependancy Lane

Index page
Index 01 10 Days
Page
10 Apri 2019 20 Apr 2019

Patient Registration form Employee Registration form

Registration 02 3 Days 03 3 Days


form
21 Apr 2018 24 Apr 2019 24 Apr 2019 27 Apr 2019

Appointment Schedule Patient certificate form

Schedule 04 7 Days 05 7 Days

01may 2019 07 may 2019 08may 2019 15 may2019

Ready Testing Environment Test E-Learning

Testing 06 5 Days 07 5 Days

16 may 2019 21 may 2019 22 may 2019 27 may 2019

23
Hospital Management System

Software Requirement Specification(SRS)

1.1 Purpose of the software requirement specification

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

1.2 Scope and objectives

 The specification builds on the experience of users of IT technology in E-learning


transfusion that is currently available and informs both connecting for health and
commercial companies producing both hardware and software.
 The main objective of the specification is to support the automated tracking of blood
product from the initial ordering of blood transfusion for a patient, through to the
taking of a blood sample for cross machine, to administration of a learning and
subsequent updates to care records. The scope of the specification includes the
following scenarios:
 Routine class schedule
 Transfusion for special
 Special class duration

1.3 Definitions, Acronyms and Abbreviations

 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

2.1 Product Perspective

The product software mainly support E-Learning System

 Administrator signup&login.

 Teacher signup&login.

 Search Course availability.

 Search Teacher

 Course tips.

 Search class camp near you.

 Search new news & events.

 Send any query related Query.

2.1.1System interface

It describe input output webpage and communication.

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:

The system shall keep a log of all the 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.

7. Resources tracking: Admin can even maintain a track of resources being


utilized in the hospitals by the doctors and patients.

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

Data Flow Diagram(DFD’s)

ZERO Level DFD

Report
Patient Doctor

Service

Token
Salary

Hospital
Management
System work
work

Staff
Reception Salary Salary

Salary
Service

Nurse

28
Hospital Management System

DFD Laval-1 Patient

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

DFD Laval-1 Doctor

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

DFD Laval-1 Nurse

Payment
Salary
Department Nurse

record

Nurse
Attendance
Department
check

served
record
Patient

department

31
Hospital Management System

Lavel-1 DFD Of Employee

Employee

Id password
Attendance

department Check

Retrive

Retrive record Serve


Record

working
Payment
Department
Department

Salary

Employee

32
Hospital Management System

ER-Diagram for Hospital Management System

D_Id Address Salary

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

Class Diagram for 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

Database Schema Design

logmaster.sql

Field Name Data Type Constraints Description

Username Varchar2(60) Primary key User name

First_name Varchar2(60) Not Null Firs Name

Last_name Varchar2(40) Not Null Last name

City Varchar2(20) Not Null City

Distric Varchar2(40) Not null Distric

State Varchar2(40) Not null State

Ccontry Varchar2(40) Not Null Country Name

Pincode Number(7) Not Null Pin code

Telephone Varchar2(30) Telephone

Mobile Varchar2(14) Not Null Mobile no

Gender Varchar2(10) Not Null Gender

Email id Varchar2(60) Not Null Email id

Dob Varchar2(10) Not Null Date of birth

Seq_ques Varchar2(100) Not null Security question

Answer Varchar2(200) Not null Answer

Password Varchar2(20) Not Null Password

Doc Date Not Null Date of creation

Toc Varchar2(20) Not Null Time of creation

User_type Varchar2(30) Not null Type of user

37
Hospital Management System

Data Structure of doctor_create: -

DOCTOR_CREATE.sql

Field Name Data Type Constraints Description

USER_ID NUMBER(20) PRIMARY KEY DOCTOR ID

USERNAME VARCHAR2(60) Not Null User name

QUALIFICATION VARCHAR2(40) Not Null Qualification of doctor

EXP VARCHAR2(20) Not Null Experience of doctor

P_WORK VARCHAR2(100) Not Null Patient work

Data Structure of Room: -

ROOM.sql

Field Name Data Type Constraints Description

ROOM NUMBER(20) Primary key ROOM ID

CATEGORY VARCHAR2(40) Not Null CATEGORY OF ROOM

RENT NUMBER(10) Not Null RENT OF ROOM

BED VARCHAR2(10) Not Null NUMBER OF BED

TOILET VARCHAR2(10) Not Null DETAILS OF TOILET

AC VARCHAR2(10) Not Null DETAILS OF AC

LIGHT VARCHAR2(10) Not Null DETAILS OF LIGHT

CHAIR VARCHAR2(10) Not Null DETAILS OF CHAIR

TABLE VARCHAR2(10) Not Null DETAILS OF TABLE

Data Structure of Ambulance : -

AMBULANCE.sql

Field Name Data Type Constraints Description

AMBULANCE_NO VARCHAR2(40) Primary key AMBULANCE_NO

38
Hospital Management System

DRIVER_NAME VARCHAR2(20) Not Null NAME OF DRIVER

CONTACT_NO VARCHAR2(14) Not Null CONTACT NO OF DRIVER

RANT VARCHAR2(10) Not Null RENT OF AMBULANCE

STATUS VARCHAR2(20) Not Null STATUS OF


AMBULANCE

Data Structure of Ambulance_trans : -

AMBULANCE.sql

Field Name Data Type Constraints Description

TRANS_ID NUMBER(10) Primary key TRANS_ID

NAME VARCHAR2(20) Not Null NAME OF BOOKER

ADDRESS VARCHAR2(44) Not Null ADDRESS OF BOOKER

CONTACT_NO VARCHAR2(14) Not Null CONTACT NO OF


BOOKER

DISTANCE NUMBER(5) Not Null DISTANCE

AMOUNT NUMBER(5) NOT NULL AMOUNT

DDATE VARCHAR2(15) DATE

TTIME VARCHAR2(15) TIME

Data Structure of PATIENT : -

PATIENT.sql

Field Name Data Type Constraints Description

PATIENT_ID NUMBER(10) Primary key PATIENT_ID

NAME VARCHAR2(20) Not Null NAME OF PATIENT

GENDER VARCHAR2(10) Not Null GENDER

AGE VARCHAR2(5) Not Null

ADDRESS VARCHAR2(60) Not Null

CONTACT_NO VARCHAR2(14) Not Null

ROOM_NO NUMBER(10)

FEE NUMBER(10) Not Null

39
Hospital Management System

DDATE VARCHAR2(15) Not Null

TTIME VARCHAR2(15) Not Null

Data Structure of Medicine :-

MEDICINE.sql

Field Name Data Type Constraints Description

M_NO NUMBER(10) Primary key

PATIENT_ID NUMBER(10) Not Null PATIENT_ID

MEDICINE VARCHAR2(1000) Not Null

TEST VARCHAR2(100)

40
Hospital Management System

Flow Charts

Flowchart for the login Page

STARTS

Enter username & password

Verify from the database

Print Login failed


Is
correct?
No

yes

Allow Access to the modules

STOP

41
Hospital Management System

PURPOSE

Any project development is ultimately intended to serve as a user-friendly utility,


providing an environment where error should not be present. So, the post design is
dedicated for the development of test plans. This test plan should accomplish the task of
testing the code after the coding. Ideally it should include two strategies:

Code test plan and

Specification test plan

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.*;

class LoginWindow extends Frame implements ActionListener

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=new JFrame("Login Window");

f.setBounds(0,0,1375,750);

l1=new JLabel("Please fill the login text field");

l1.setBounds(370,130,600,50);

f.add(l1);

Font fon=new Font("Times New Roman",Font.BOLD,50);

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);

ImageIcon icn4=new ImageIcon("F:/swing component/logo/images


(44).jpe");

l4=new JLabel(icn4);

l4.setBounds(450,0,424,119);

f.add(l4);

l2=new JLabel("1.User Name:");

l2.setBounds(450,250,200,25);

f.add(l2);

Font fon1=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

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);

Font fon2=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

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);

l5=new JLabel("Please Check Your UserID.");

46
Hospital Management System

l5.setBounds(970,630,400,25);

f.add(l5);

l5.setForeground(Color.pink);

Font fon5=new Font("Times New Roman",Font.BOLD,25);

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();

String val2="Select UserName,Password from Login3";

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=new JLabel("@Hospital Management 2015Design&Devlop by


Pappu");

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);

//Change logo of window.

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);

public void actionPerformed(ActionEvent e1)

if(e1.getSource()==b5)

PrintJob printjob =getToolkit().getPrintJob(this,"Print


graphics",null);

Graphics g = printjob.getGraphics();

g.drawRect(2, 2, 100, 100);

g.drawLine(2, 2, 100, 100);

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();

String val="Select UserName,Password from Login3


Where UserName='"+ch+"'";

rs=st.executeQuery(val);

while(rs.next())

r1=rs.getString("UserName");

r2=rs.getString("Password");

if(r1==null && r2==null)

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);

public static void main(String str[])

new LoginWindow();

CreateNewAccount.java

import java.awt.*;

import javax.swing.*;

import java.sql.*;

import java.awt.event.*;

import java.io.*;

class CreateLoginDemo extends Thread implements ActionListener

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);

l1=new JLabel("Please fill the above field");

53
Hospital Management System

l1.setBounds(350,30,1000,50);

f.add(l1);

f1=new Font("New Times Roman",Font.BOLD,50);

l1.setFont(f1);

l1.setForeground(Color.RED);

l2=new
JLabel("____________________________________________________________");

l2.setBounds(350,40,1000,50);

f.add(l2);

f2=new Font("Times New Roman",Font.BOLD,20);

l2.setFont(f2);

l2.setForeground(Color.GREEN);

//Change Window Color.

Container cp=f.getContentPane();

cp.setBackground(Color.gray);

l3=new JLabel("First Name");

l3.setBounds(150,150,200,25);

f.add(l3);

f3=new Font("Times New Roman",Font.BOLD,25);

l3.setFont(f3);

l3.setForeground(Color.GREEN);

t1=new JTextField("Enter the First Name");

t1.setBounds(350,150,200,25);

f.add(t1);

54
Hospital Management System

t1.addActionListener(this);

l4=new JLabel("Last Name:");

l4.setBounds(600,150,200,25);

f.add(l4);

f4=new Font("Times New Roman",Font.BOLD,25);

l4.setFont(f4);

l4.setForeground(Color.GREEN);

t2=new JTextField("Enter the Last Name");

t2.setBounds(800,150,200,25);

f.add(t2);

l5=new JLabel("Date of Birth:");

l5.setBounds(150,200,200,25);

f.add(l5);

f5=new Font("Times New Roman",Font.BOLD,25);

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);

f6=new Font("Times New Roman",Font.BOLD,25);

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);

f7=new Font("Times New Roman",Font.BOLD,25);

l7.setFont(f7);

l7.setForeground(Color.GREEN);

t3=new JTextField("Enter the User Name");

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

f8=new Font("Times New Roman",Font.BOLD,25);

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);

f9=new Font("Times New Roman",Font.BOLD,25);

l9.setFont(f9);

l9.setForeground(Color.GREEN);

p2=new JPasswordField();

p2.setBounds(350,400,200,25);

f.add(p2);

p2.setEchoChar('*');

l10=new JLabel("Mobile No:");

l10.setBounds(150,450,200,25);

f.add(l10);

f10=new Font("Times New Roman",Font.BOLD,25);

l10.setFont(f10);

l10.setForeground(Color.GREEN);

58
Hospital Management System

t6=new JTextField("Enter the Mobile Number");

t6.setBounds(350,450,200,25);

f.add(t6);

l11=new JLabel("Address:");

l11.setBounds(150,500,200,25);

f.add(l11);

f11=new Font("Times New Roman",Font.BOLD,25);

l11.setFont(f11);

l11.setForeground(Color.GREEN);

ta1=new JTextArea("Enter the Address");

ta1.setBounds(350,500,200,50);

f.add(ta1);

l12=new JLabel("Nationilty:");

l12.setBounds(600,300,200,25);

f.add(l12);

f12=new Font("Times New Roman",Font.BOLD,25);

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=new JLabel("Please fill the box content to be Proof Secrete Code:-


");

l13.setBounds(600,350,600,25);

f.add(l13);

f13=new Font("Times New Roman",Font.BOLD,25);

l13.setFont(f13);

l13.setForeground(Color.GREEN);

b1=new JButton();

b1.setBounds(700,390,100,40);

f.add(b1);

b1.setText(ar[8]);

t8=new JTextField("Enter the above text");

t8.setBounds(850,400,130,25);

f.add(t8);

JLabel l33=new JLabel("Check the Password please fill");

l33.setBounds(1050,500,300,25);

f.add(l33);

JLabel l34=new JLabel("_________________________");

l34.setBounds(1050,500,300,25);

f.add(l34);

60
Hospital Management System

t55=new JTextField("Enter the Password");

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

//ImageIcon icn0=new ImageIcon("F:/swing component/logo/cap.jpe");

//JLabel lk=new JLabel(icn0);

//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);

public void actionPerformed(ActionEvent e1)

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();

String val2="Select PASSWORD from Login3 where


USERNAME='"+ch+"'";

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

FileOutputStream fout=new FileOutputStream("password.txt");

byte gt[]=pas.getBytes();

fout.write(gt);

JOptionPane.showMessageDialog(null,"Please Open Your


Password file in Current Directory","Warning
Message",JOptionPane.INFORMATION_MESSAGE);

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

if(t1.getText().equals("Enter the First Name"))

JOptionPane.showMessageDialog(null,"plesae fill the


First Name","Warning Message",JOptionPane.ERROR_MESSAGE);

else if(t2.getText().equals("Enter the Last Name"))

JOptionPane.showMessageDialog(null,"plesae fill the Last


Name","Warning Message",JOptionPane.ERROR_MESSAGE);

else if(cb1.getSelectedIndex()==0)

JOptionPane.showMessageDialog(null,"plesae fill the


day","Warning Message",JOptionPane.ERROR_MESSAGE);

else if(cb2.getSelectedIndex()==0)

JOptionPane.showMessageDialog(null,"plesae fill the


Month","Warning Message",JOptionPane.ERROR_MESSAGE);

else if(cb3.getSelectedIndex()==0)

JOptionPane.showMessageDialog(null,"plesae fill the


Year","Warning Message",JOptionPane.ERROR_MESSAGE);

else if(rb1.isSelected()==false && rb2.isSelected()==false)

66
Hospital Management System

JOptionPane.showMessageDialog(null,"plesae fill the


Gender","Warning Message",JOptionPane.ERROR_MESSAGE);

else if(t3.getText().equals("Enter the User Name"))

JOptionPane.showMessageDialog(null,"Please fill the


User Name","Error Message",JOptionPane.ERROR_MESSAGE);

else if(cb4.getSelectedIndex()==0)

JOptionPane.showMessageDialog(null,"Please fill the


nasility","Error Message",JOptionPane.ERROR_MESSAGE);

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);

else if(t6.getText().equals("Enter the Mobile Number"))

67
Hospital Management System

JOptionPane.showMessageDialog(null,"please fill the


Mobile Number","Error Message",JOptionPane.ERROR_MESSAGE);

else if(ta1.getText().equals("Enter the Address"))

JOptionPane.showMessageDialog(null,"please fill the


Address","Error Message",JOptionPane.ERROR_MESSAGE);

else if(t8.getText().equals("Enter the above text"))

JOptionPane.showMessageDialog(null,"please fill the


text","Error Message",JOptionPane.ERROR_MESSAGE);

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

String val2="Select FIRSTNAME from Login3 where


FIRSTNAME='"+s1+"'";

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);

String val="insert into Login3 values


('"+s1+"','"+s2+"','"+date+"','"+s6+"','"+s13+"','"+s8+"','"+s9+"','"+s10+"','"+s14+"','"
+s12+"','"+s11+"')";

int x=st.executeUpdate(val);

System.out.println(val);

if(x==1)

JOptionPane.showMessageDialog(null,"Your data are Successful insert","Your


User Name",JOptionPane.INFORMATION_MESSAGE);

JOptionPane.showMessageDialog(null,s13,"Your
User Name",JOptionPane.INFORMATION_MESSAGE);

else

71
Hospital Management System

JOptionPane.showMessageDialog(null,"please check your RePassword","Error


Window",JOptionPane.ERROR_MESSAGE);

catch(Exception e2)

System.out.println(e2);

if(e1.getSource()==b3)

int x=JOptionPane.showConfirmDialog(null,"Are you Sure for


Clear all field","Message Window",JOptionPane.YES_NO_OPTION);

if(x==JOptionPane.YES_OPTION)

t1.setText("Enter the First Name");

t2.setText("Enter the Last Name");

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)

int x=JOptionPane.showConfirmDialog(null,"Are you Sure to


Cancel","Message Window",JOptionPane.YES_NO_OPTION);

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

public static void main(String st[])

new CreateLoginDemo();

MainPage.java

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

class MainWindow implements ActionListener

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=new JLabel("@2015 Hospital Management System,Design&Devlop


by p.k Sharma");

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);

public void actionPerformed(ActionEvent e1)

if(e1.getSource()==b1)

75
Hospital Management System

new LoginWindow();

f.setVisible(false);

public static void main(String st[])

new MainWindow("");

RecepsnistPage.java

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

class EmployeeFormDemo implements ActionListener

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()

f=new JFrame("Employee Entry Form Demo");

76
Hospital Management System

f.setBounds(200,50,700,600);

l1=new JLabel("Please fill the Employee form");

l1.setBounds(200,20,400,25);

f.add(l1);

Font fon1=new Font("Times New Roman",Font.BOLD,25);

l1.setFont(fon1);

l2=new JLabel("1.Employee ID:");

l2.setBounds(30,50,200,25);

f.add(l2);

Font fon2=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

l2.setFont(fon2);

t1=new JTextField();

t1.setBounds(220,50,350,25);

f.add(t1);

l3=new JLabel("2.Case ID:");

l3.setBounds(30,85,200,25);

f.add(l3);

Font fon3=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

l3.setFont(fon3);

t2=new JTextField();

77
Hospital Management System

t2.setBounds(220,85,350,25);

f.add(t2);

l4=new JLabel("3.Parents Name:");

l4.setBounds(30,120,200,25);

f.add(l4);

Font fon4=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

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);

Font fon5=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

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);

ButtonGroup bg1=new ButtonGroup();

bg1.add(rb1);

bg1.add(rb2);

l8=new JLabel("5.Age:");

l8.setBounds(30,190,200,25);

f.add(l8);

Font fon6=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

l8.setFont(fon6);

t5=new JTextField();

t5.setBounds(220,190,50,25);

f.add(t5);

l9=new JLabel("6.Date of Birth:");

l9.setBounds(30,225,200,25);

79
Hospital Management System

f.add(l9);

Font fon7=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

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);

Font fon8=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

l10.setFont(fon8);

ta1=new JTextArea();

ta1.setBounds(220,260,300,50);

f.add(ta1);

l11=new JLabel("8.Date of Joining:");

l11.setBounds(30,315,200,25);

f.add(l11);

Font fon9=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

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);

Font fon12=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

l14.setFont(fon12);

String st8[]={"Years","6 months","1 year","2 years","3 years","4


years","5 years","6 years","7 years","8 years","9 years","10 years"};

82
Hospital Management System

JComboBox cb7=new JComboBox(st8);

cb7.setBounds(220,350,100,25);

f.add(cb7);

l12=new JLabel("9.Mobile No:");

l12.setBounds(30,390,200,25);

f.add(l12);

Font fon10=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

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);

Font fon11=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,25);

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);

public void actionPerformed(ActionEvent e1)

if(e1.getSource()==b1)

JOptionPane.showMessageDialog(null,"Your data are store","Get


information",JOptionPane.INFORMATION_MESSAGE);

84
Hospital Management System

if(e1.getSource()==b2)

JOptionPane.showConfirmDialog(null,"Are You Sure","Get the


information",JOptionPane.YES_NO_OPTION);

new ModuleDemo();

f.setVisible(false);

public static void main(String str[])

new EmployeeFormDemo();

DeleteRecord.java

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

class DeleteRecordDemo implements ActionListener

JFrame f;

JLabel l1,l2;

JButton b1,b2;

JTextField t1;

DeleteRecordDemo()

85
Hospital Management System

f=new JFrame("Delete Client Records");

f.setBounds(200,50,500,400);

l1=new JLabel("Please fill the text to delete");

l1.setBounds(75,25,300,25);

f.add(l1);

Font fon=new Font("Times New Roman",Font.BOLD,25);

l1.setFont(fon);

l2=new JLabel("Client ID:");

l2.setBounds(50,100,150,25);

Font fon2=new Font("Times New


Roman",Font.BOLD+Font.ITALIC,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);

public void actionPerformed(ActionEvent e1)

if(e1.getSource()==b1)

JOptionPane.showConfirmDialog(null,"Are you Sure to be


Delete Records:","Attention Window",JOptionPane.INFORMATION_MESSAGE);

if(e1.getSource()==b2)

new ModuleDemo();

f.setVisible(false);

public static void main(String str[])

new DeleteRecordDemo();

87
Hospital Management System

FeePayment.java

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

class FeePayment implements ActionListener

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=new JLabel("Patients Fee Payment");

l1.setBounds(75,10,400,25);

f.add(l1);

Font fon=new Font("Times New Roman",Font.BOLD,25);

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=new JTextField("Enter the Fee");

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);

public void actionPerformed(ActionEvent e1)

String pay=t1.getText();

f.setVisible(false);

public static void main(String st[])

new FeePayment("");

PatientEntryForm.java

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

import java.sql.*;

class PatientsFrom implements ActionListener

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=new JFrame("New Patients From");

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=new JLabel("New Patients Form");

l1.setBounds(250,10,250,25);

f.add(l1);

fon1=new Font("Times New Roman",Font.BOLD,25);

l1.setFont(fon1);

l1.setForeground(Color.red);

l2=new JLabel("______________________________");

l2.setBounds(250,15,250,25);

f.add(l2);

l3=new JLabel("1.Serial No:");

l3.setBounds(50,50,200,25);

f.add(l3);

fon2=new Font("Times New Roman",Font.BOLD,25);

l3.setFont(fon1);

92
Hospital Management System

l3.setForeground(Color.orange);

t1=new JTextField("Enter the Serial No");

t1.setBounds(230,50,150,25);

f.add(t1);

l4=new JLabel("2.Date of entry:");

l4.setBounds(50,80,200,25);

f.add(l4);

fon3=new Font("Times New Roman",Font.BOLD,25);

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

fon4=new Font("Times New Roman",Font.BOLD,25);

l5.setFont(fon4);

l5.setForeground(Color.orange);

cb4=new JComboBox(days);

cb4.setBounds(230,110,100,25);

f.add(cb4);

l6=new JLabel("4.Patients Name:");

l6.setBounds(50,140,200,25);

f.add(l6);

fon5=new Font("Times New Roman",Font.BOLD,25);

l6.setFont(fon5);

l6.setForeground(Color.orange);

t2=new JTextField("Enter the Patients Name");

t2.setBounds(230,140,300,25);

f.add(t2);

l7=new JLabel("5.Parents Name:");

l7.setBounds(50,175,200,25);

f.add(l7);

fon6=new Font("Times New Roman",Font.BOLD,25);

l7.setFont(fon6);

l7.setForeground(Color.orange);

t3=new JTextField("Enter the Parents Name");

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);

fon7=new Font("Times New Roman",Font.BOLD,25);

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);

fon8=new Font("Times New Roman",Font.BOLD,25);

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);

ButtonGroup bp=new ButtonGroup();

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);

fon9=new Font("Times New Roman",Font.BOLD,25);

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=new JTextField("Enter the Village");

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=new JTextField("Enter the Post Office");

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=new JTextField("Enter the Police Station");

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=new JTextField("Enter the District");

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=new JTextField("Enter the State");

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=new JTextField("Enter the PinCode");

t9.setBounds(470,375,150,25);

f.add(t9);

l17=new JLabel("9.Name of the treatment:");

l17.setBounds(50,420,300,25);

f.add(l17);

fon10=new Font("Times New Roman",Font.BOLD,25);

l17.setFont(fon10);

l17.setForeground(Color.orange);

t10=new JTextField("Enter the What is Problem");

t10.setBounds(350,420,250,25);

f.add(t10);

l18=new JLabel("10.Room No:");

l18.setBounds(50,450,300,25);

f.add(l18);

fon11=new Font("Times New Roman",Font.BOLD,25);

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);

public void actionPerformed(ActionEvent e1)

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(srl.equals("Enter the Serial No"))

JOptionPane.showMessageDialog(null,"Please fill the


Serial No","Error Infomaton",JOptionPane.ERROR_MESSAGE);

if(dy.equals("Day"))

JOptionPane.showMessageDialog(null,"Please fill the


day","Error Infomaton",JOptionPane.ERROR_MESSAGE);

else if(mo.equals("Month"))

JOptionPane.showMessageDialog(null,"Please fill the


month","Error Infomaton",JOptionPane.ERROR_MESSAGE);

else if(yr.equals("Year"))

104
Hospital Management System

JOptionPane.showMessageDialog(null,"Please fill the


year","Error Infomaton",JOptionPane.ERROR_MESSAGE);

else if(day1.equals("Days"))

JOptionPane.showMessageDialog(null,"Please fill the


Days","Error Infomaton",JOptionPane.ERROR_MESSAGE);

else if(name.equals("Enter the Patients Name"))

JOptionPane.showMessageDialog(null,"Please fill the


PatientsName","Error Infomaton",JOptionPane.ERROR_MESSAGE);

else if(pname.equals("Enter the Parents Name"))

JOptionPane.showMessageDialog(null,"Please fill the


ParentsName","Error Infomaton",JOptionPane.ERROR_MESSAGE);

else if(ag.equals("Age"))

JOptionPane.showMessageDialog(null,"Please fill the


Patients Age","Error Infomaton",JOptionPane.ERROR_MESSAGE);

else if(rb1.isSelected()==false && rb2.isSelected()==false)

JOptionPane.showMessageDialog(null,"Please fill the


Gender","Error Infomaton",JOptionPane.ERROR_MESSAGE);

105
Hospital Management System

if(e1.getSource()==b2)

f.setVisible(false);

if(e1.getSource()==b3)

name=t2.getText();

new FeePayment(name);

public static void main(String st[])

new PatientsFrom();

BloodTest.java

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

class BloodTest implements ActionListener

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=new JFrame("Blood Testing");

f.setBounds(300,50,700,600);

l1=new JLabel("Report on the Examination of Blood");

l1.setBounds(150,10,500,25);

f.add(l1);

fon1=new Font("Time New Roman",Font.BOLD,25);

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=new JLabel("Doctor's Name:");

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=new JLabel("Patient's Name:");

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=new JLabel("Testing Date:");

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);

//Used for lining.

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=new JLabel("1.Total Count:-");

l5.setBounds(25,120,100,25);

f.add(l5);

l5=new JLabel("Erythrocytes-");

l5.setBounds(40,135,100,25);

f.add(l5);

l5=new JLabel("(4 to 5 milion /cu mm)");

l5.setBounds(45,148,200,25);

f.add(l5);

t4=new JTextField("Enter Result");

t4.setBounds(180,140,120,25);

f.add(t4);

l8=new JLabel("/cu mm");

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=new JLabel("(5000-11000/cu mm)");

l7.setBounds(45,190,200,25);

f.add(l7);

t5=new JTextField("Enter Result");

t5.setBounds(180,190,120,25);

f.add(t5);

l8=new JLabel("/cu mm");

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=new JLabel("gm =");

l10.setBounds(190,230,100,25);

f.add(l10);

t7=new JTextField("Enter Result");

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=new JTextField("Enter Result");

t8.setBounds(150,280,100,25);

f.add(t8);

l11=new JLabel("4.Aldehyde Test-");

l11.setBounds(30,320,100,25);

f.add(l11);

t9=new JTextField("Enter Result");

t9.setBounds(150,320,100,25);

f.add(t9);

l11=new JLabel("5.A.S.O Titer-");

l11.setBounds(30,360,100,25);

f.add(l11);

t10=new JTextField("Enter Result");

t10.setBounds(150,360,100,25);

f.add(t10);

l11=new JLabel("6.E.S.R(Westergreen Method)");

l11.setBounds(30,390,200,25);

f.add(l11);

113
Hospital Management System

t11=new JTextField("Enter Result");

t11.setBounds(200,430,80,25);

f.add(t11);

l11=new JLabel("(5-10 mm/hr)");

l11.setBounds(40,410,200,25);

f.add(l11);

l11=new JLabel("1st hr. Reading-");

l11.setBounds(40,430,200,25);

f.add(l11);

l11=new JLabel("mm");

l11.setBounds(280,430,200,25);

f.add(l11);

l11=new JLabel("2nd hr.Reading");

l11.setBounds(40,480,100,25);

f.add(l11);

t12=new JTextField("Enter Result");

t12.setBounds(200,480,80,25);

f.add(t12);

l11=new JLabel("mm");

l11.setBounds(280,480,200,25);

f.add(l11);

l11=new JLabel("7.Differential Count(W.B.C)");

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=new JTextField("Enter Result");

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=new JTextField("Enter Result");

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=new JTextField("Enter Result");

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=new JTextField("Enter Result");

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=new JTextField("Enter Result");

t18.setBounds(450,320,100,25);

f.add(t18);

l11=new JLabel("%");

l11.setBounds(555,320,200,25);

f.add(l11);

l11=new JLabel("8.Blood Group-");

l11.setBounds(360,360,200,25);

f.add(l11);

t19=new JTextField("Enter Result");

t19.setBounds(450,360,100,25);

f.add(t19);

l11=new JLabel("9.R.A Test-");

l11.setBounds(360,400,200,25);

f.add(l11);

t20=new JTextField("Enter Result");

t20.setBounds(450,400,100,25);

f.add(t20);

l11=new JLabel("10.Coagulation Time-");

l11.setBounds(360,440,200,25);

f.add(l11);

t21=new JTextField("Enter Result");

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=new JTextField("Enter Result");

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);

public void actionPerformed(ActionEvent e1)

if(e1.getSource()==b1)

if(t1.getText().equals("Dr."))

JOptionPane.showMessageDialog(null,"Please fill the


DoctorName","Error Window",JOptionPane.ERROR_MESSAGE);

else if(t2.getText().equals(""))

JOptionPane.showMessageDialog(null,"Please fill the


PatientName","Error Window",JOptionPane.ERROR_MESSAGE);

else if(cb1.getSelectedItem().equals("day"))

JOptionPane.showMessageDialog(null,"Please fill the


day","Error Window",JOptionPane.ERROR_MESSAGE);

else if(cb2.getSelectedItem().equals("month"))

JOptionPane.showMessageDialog(null,"Please fill the


month","Error Window",JOptionPane.ERROR_MESSAGE);

119
Hospital Management System

else if(cb3.getSelectedItem().equals("year"))

JOptionPane.showMessageDialog(null,"Please fill the


year","Error Window",JOptionPane.ERROR_MESSAGE);

if(e1.getSource()==b2)

f.setVisible(false);

public static void main(String st[])

new BloodTest();

ProfilePage.java

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

import java.io.*;

import java.sql.*;

class FacebookProfileDemo implements ActionListener

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);

JTextField t1=new JTextField();

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);

JLabel lk=new JLabel("Online User");

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=new JButton(new ImageIcon("f.jpg"));

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);

ImageIcon icn=new ImageIcon("facebook.jpg");

JLabel l2=new JLabel(icn);

l2.setBounds(5,0,50,50);

f.add(l2);

123
Hospital Management System

JLabel l1=new JLabel("MyFacebook.com");

l1.setBounds(45,10,200,30);

f.add(l1);

l1.setForeground(Color.white);

Font fon=new Font("Time New Roman",Font.BOLD+Font.ITALIC,20);

l1.setFont(fon);

JLabel l12=new JLabel("Welcome User:-");

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=new JButton(new ImageIcon("f.jpg"));

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=new JButton("Find Friend");

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");

String val="Select first_name,Last_name,photo from Login


where userName='"+user+"'";

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);

ImageIcon icn2=new ImageIcon(ph);

JLabel ll=new JLabel(icn2);

ll.setBounds(100,100,150,150);

f.add(ll);

129
Hospital Management System

JLabel l13=new JLabel(fname+" "+Lname);

l13.setBounds(150,40,200,25);

f.add(l13);

l13.setForeground(Color.black);

b8.addActionListener(this);

*/

f.setLayout(null);

f.setVisible(true);

public void actionPerformed(ActionEvent e1)

if(e1.getSource()==b8)

new LoginWindow();

f.setVisible(false);

JOptionPane.showMessageDialog(null,"You are Successful


LogOut","UserMessage",JOptionPane.INFORMATION_MESSAGE);

/*if(e1.getSource()==b1)

JFileChooser fc = new JFileChooser();

130
Hospital Management System

fc.setFileFilter(new ImageFilter());

int result = fc.showOpenDialog(null);

File file = null;

if (result == JFileChooser.APPROVE_OPTION)

file = fc.getSelectedFile();

System.out.println(file.getPath());

String p=file.getPath();

ImageIcon icn=new ImageIcon(p);

JLabel l1=new JLabel(icn);

l1.setBounds(100,100,150,150);

f.add(l1);

System.out.println("Hello");

else if(e1.getSource()==b2)

JFileChooser fc = new JFileChooser();

//fc.setFileFilter(new ImageFilter());

int result = fc.showOpenDialog(null);

File file = null;

if (result == JFileChooser.APPROVE_OPTION)

file = fc.getSelectedFile();

System.out.println(file.getPath());

131
Hospital Management System

String p=file.getPath();

cover=file.getPath();

ImageIcon icn=new ImageIcon(p);

JLabel l1=new JLabel(icn);

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");

String val="update Login set


cover_photo='"+cover+"'where userName='"+u+"'";

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=new JFrame("online User:-");

f1.setBounds(700,400,400,300);

JLabel l1=new JLabel("Message Type Here");

l1.setBounds(100,80,200,25);

f1.add(l1);

JTextArea ta1=new JTextArea();

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);

}*/

private class ImageFilter extends javax.swing.filechooser.FileFilter

public boolean accept(File f)

if (f.isDirectory())

return true;

String name = f.getName();

if (name.matches(".*((.jpg)|(.gif)|(.png))"))

return true;

else

return false;

public String getDescription()

return "Image files (*.jpg, *.gif, *.png)";

public static void main(String st[])

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

New Receptionist Form

139
Hospital Management System

New Doctor Form

140
Hospital Management System

View Receptionist Form

141
Hospital Management System

Patient Entry Form

142
Hospital Management System

Testing of the project


My developed project “ School Management System” is taken following testing
techniques, as-

WHITE BOX TESTING

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.

Exercise all logical decisions on their true or false sides.


Execute all loops at their boundaries and within their operational bounds.
Exercise internal data structure to ensure their validity.

143
Hospital Management System

BASIC PATH TESTING

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.

Purpose of condition testing is to detect not only errors in the conditions of a


program but also other errors in the program. BRANCH TESTING is simplest
condition testing strategy.

DATA FLOW TESTING

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.

BLACK BOX TESTING

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.

Black box testing attempts to find errors in the following categories:

i. Incorrect or missing functions, no error are found in my project.


ii. Interface errors, no errors found.
iii. Errors in data structure or external database access, having no
errors.
iv. Behavior and performance error, and
v. Initialization and termination errors.
Unlike white box testing, which is performed in early in the testing process, black
box testing tends to be applied in the later stages of testing. By applying black box
technique, we derive a set of test cases that satisfy the following criteria:

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:

Equivalence partitioning is a black-box technique that divides the input domain of


a program into classes of data from which test cases can be derived. An ideal test
cases single handedly uncovers a class of errors that might otherwise require many
cases to execute before the general error is discovered. Equivalence partitioning
strives to define a test case that uncovers classes of error, thereby reducing the
total number of test cases that must be developed. Test design for equivalence
partitioning is based on an evaluation of equivalence classes for an input condition.

Boundary Value Analysis:

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.

12.2 Testing Strategy

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.

There are two types of integration testing

a) Top-down integration and


b) Bottom-up integration
My project also passes through integration testing, no error or incompatibilities found
when integrating two modules or more modules to make them as single module.

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

Validation testing is also conducted in my project, there are some problems


while inputting the special character in the input field so that the user of this project
requires little training so that they have not any problem while they input to this
project.

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.

System testing consists of following steps:

 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

Function Purpose Test No. of Test Number of


Case Case run Test Cases
Successful.
Login The verification TC1 6 100%

Of username and
password.

Admission The verification TC2 4 100%

Of the details

Entered by the

User.

The proper TC3 2 100%

Working of total
button.

The proper working TC4 5 100%


of schedule button.

150
Hospital Management System

Proper working of
back button.

TC5 10 75%

Proper working

Of exit button.

TC6 6 100%

Proper working

Of the entry form


while clicking the
TC7 8 100%
submit button
without entering
complete button.

Fee Deposit Verification of the TC8 12 83.33%


Class and Roll No
entered by the user.

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 we Know In terms of Software Engineering the estimation of cost is the


estimation of effort in terms of persons required for the project. Empirical estimation
models are widely used techniques to estimate the cost. An empirical estimation
model for computer software uses empirically derived formulas to predict effort as a
function of LOC (Lines of Code) or FP (Function Point) and the development time in
Calendar Months or Calendar Years. Value of LOC or FP and the development time is
estimated using metrics.

To estimate the cost of my project I used COCOMO (Constructive Cost


Model) estimation tool. It is a well-known cost estimation tool. The Original
COCOMO model was actually a set of three different models of increasing
complexity and level of detail. According to COCOMO The initial development
effort is based on the software being developed according to three modes: Organic,
Semidetached and Embedded. The modes of the project is depend upon the code size
(based on delivered source instructions i.e. KLOC). For each type of project modes
Allen Albrecht has given some constant term for measurement.

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

The total number of person month required for the development is E= ab


(KLOC) bb
Where, ab and bb are contents given by the model
Here ab = 2.4 and bb = 1.05 (for Organic Project)
E= Effort calculated in person month
Applying the values in the formula we have,
E = 2.4 (2 KLOC) 1.05
= 2.4 x (2) 1.05
= 4.96 = 5 (Round Off figure) and,
D= cb E db
Where, cb and db are constants given by the model
Here cb=2.5 and db = .38 (For Organic Project)
D= Development Time in Months
Applying the values in the formula we have,
D = 2.5 x (5).38
= 4.60 = 5 (Round off Figure)
Now Number of Persons Required = E / D
= 5 / 8 = 0.625 = 1 (Round Off Figure) = 1 Person Month

154
Hospital Management System

Report Generation

Ward Master

Room-Id Capacity Rate Location In charge-Id

001 20 600 1st floor I-01

002 30 600 2nd floor I-02

Attendent_Master

In charge-Id In charge-Name Room-Id Jr-Attendent

I-01 Raman Kumar 001 19

Doctor Master

Doctor-Id Doctor- Qualification Department Time-In Time-Out

Name

A001 Pratima M.B.B.S Testing 10:30 13:30

sinha

155
Hospital Management System

Test Master

Test-Id Test-Name In charge- Doctor-Id Rate Positive

Id

T-01 B.P.Test I-01 A001 200 Yes

Patient Master

Pat Name Addres AdmitD Admit- Doctor Test- Roo Fee- Fee-

Id s ate time -Id Id m-Id Deposi Balanc

t e

p- Son am Maripu 21-6-12 11:20am A001 T-01 001 300 800

01 r

Patient Service

Pat-Id Date In charge-Id Service-Value

p-01 20-6-12 I-01

156
Hospital Management System

ServiceMaster

In charge-Id DoctorId Rate

I-01 A001 300

157
Hospital Management System

Future Scope

Today’s most commercial project is built in around a complex data structure


maintain huge amount of data is a complex task. In this project MVC1 Architecture is
used. We can further use STRUT technology to build this project so as to enable it to
use centrally by school.

158
Hospital Management System

Limitation of the Project

Since this project is developed in MVC1 Architecture. So it use for small


project. If large number of users are viewing the site at once network traffic which can
result into slowing the website.

Thus, I using MVC2 Architecture to resolve these problem, which is contain


following feature:-

 The MVC2 architecture removes the page centric property of MVC1


architecture by separating presentation, control logic and application state.
 In MVC2 there is only one controller which receives the request for the
application and s responsible for taking appropriate action in response to each
request.

159
Hospital Management System

Bibliography

1. Web Enabled Commercial Application Development Using……...


JAVA (jdk1.8) (Ivan Bayross)

2. The Complete Reference of java ( Herbert Schildt )


3. Object Oriented Programming ( Provided by MAHE )

Also we have used the material supported by IGNOU

160

You might also like