Você está na página 1de 33

HOSPITAL MANAGEMENT SYSTEM

The Industrial Training Project report submitted to


Rajiv Gandhi Proudyogiki Vishwavidyalaya, Bhopal
towards partial fulfillment of the Degree of
Bachelor of Engineering
in
Computer Science and Engineering

Guided by
Prof. Gaurav Shrivastava

Submitted by
Aditi Trivedi
Anand Pandey
Tapan Jain

Computer Science Department


Mahakal Institute of Technology & Management, Ujjain(M.P.)
2014-2015

MAHAKAL INSTITUTE OF TECHNOLOGY


&MANAGEMENT, UJJAIN

RECOMMENDATION

This is to certify that Miss. Aditi Trivedi, Mr. Anand Pandey and Mr. Tapan Jain, students
of fourth year B.E., in the year 2014-15 of Computer Science and Engineering Department
of this institute has completed their work on HOSPITAL MANAGEMENT SYSTEM for
Industrial Training project based on syllabus and has submitted a satisfactory account of
their work in this report which is recommended for the partial fulfillment of the degree of
Bachelor of Engineering in Computer Science.

HOD,

Project Guide,

Computer Science
Engineering Department
M.I.T.M. Ujjain

Computer Science
Engineering Department
M.I.T.M. Ujjain
Director,
M.I.T.M. Ujjain

MAHAKAL INSTITUTE OF
TECHNOLOGY&MANAGEMENT, UJJAIN

CERTIFICATE

This is to certify that the Minor Project report entitled HOSPITAL MANAGEMENT
SYSTEM submitted by Miss. Aditi Trivedi, Mr. Anand Pandey and Mr. Tapan Jain,

students of B.E. VII sem, Computer Science and Engineering department in the year 201415, is a satisfactory account of their work based on syllabus which is accepted in partial
fulfillment of degree of Bachelor of Engineering in Computer Science .

INTERNAL EXAMINER

EXTERNAL EXAMINER

Date:

Date:

ABSTRACT
Our project "Patient Record System" includes registration of patients, storing their detail into
the system. Our software has facility to give a unique id for every patient and stores the details
of every patient and the staff automatically. It includes a search facility to know the current
status of each room. User can search availability of a doctor and the details of the patient using
the id.
This patient record system can be entered using a username and password. It is accessible
either by an administrator or receptionist. Only they can add data into the database. The data
can be retrieved easily. The data are well protected for personal use and makes the data
processing very fast.
Keeping track of all the activities and their records on paper is very cumbersome and error
prone. It also is very inefficient and a time-consuming process Observing the continuous
increase in population and number of people visiting the hospital.
The main aim of our project is to provide a paper-less hospital up to 90%. It also aims at
providing low-cost reliable automation of the existing systems. The system also provides
excellent security of data at every level of user-system interaction and also provides robust
& reliable storage and backup facilities.

TABLE OF CONTENTS
1.

Introduction .............................................................................................
.......................1

1.1 Existing System................................................................................................1


1.1.1 Limitations of Existing system.......1
1.2 Objective of Proposed System..2
2. Software Development Life Cycle..3
2.1 SDLC Model used........3
3. Analysis................5
3.1 Requirement analysis.........5
3.2 Requirement Specification........5
3.2.1 Functional Requirements........5
3.2.2 Non-Functional Requirements...6
3.3 Use case Analysis...6
3.3.1 Use case Description...6
3.3.2 Use case Diagram....7
3.3.3 Activity Diagram....8
4. Design.....10
4.1 Data Flow Diagram..............10
4.2 Sequence Diagram....12
4.3 Class Diagram..........14
4.4 Database Design...15
4.4.1 Database Tables details.....15
4.5 Modules Identified.........16
5. Implementation....17
5.1 Platforms used..17
5.1.1 Hardware Recommended..............19
5.1.2 Software Recommended19
5.2 Implementation Level Details...19
5.2.1 System Modules Description......19
5.2.2 Screenshots.....20
5.2.3 Sample Source Code...24
5.3 Testing....30
5.3.1 Testing Methods..30
5.3.2 Testing Techniques Performed....31
6. Conclusion......32
6.1 Important Features...........32
6.2 Limitations...........32
6.3 Future Works............32

7. References.............33

Chapter 1
Introduction
Hospital are the essential part of our lives, providing best medical facilities to
people suffering from various ailments, which may be due to change in climatic
conditions, increased work-load, emotional trauma stress etc. It is necessary for the
hospitals to keep track of its day-to-day activities & records of its patients, doctors, nurses,
ward boys and other staff personals that keep the hospital running smoothly &
successfully.
But keeping track of all the activities and their records on paper is very cumbersome and
error prone. It also is very inefficient and a time-consuming process Observing the
continuous increase in population and number of people visiting the hospital.
The main aim of our project is to provide a paper-less hospital up to 90%. It also aims at
providing low-cost reliable automation of the existing systems. The system also provides
excellent security of data at every level of user-system interaction and also provides robust
& reliable storage and backup facilities.
The outpatient management system can be entered using a username and password. It can
be accessible only by a doctor or a receptionist. Only they can add data into the database.
The data can be retrieved easily. The interface is very user friendly. The data are well
protected for personal use and makes the data processing very fast.

1.1Existing System
Existing system refers to the system that is being followed till now.
Presently all the hospital functionalities are done manually. That is if patient
want to consult a doctor he need to wait their till his chance called. This is very
difficult process.
Outpatient tickets are distributed directly. The main disadvantage is time
consuming.

1.1.1 Limitations of Existing System


Records related to patients are maintained in papers. Recording and
maintaining all these records is highly unreliable, inefficient and1 error-prone.
It is also not economically & technically feasible to maintain these records on
paper.
Lack of security of data.

Time consuming.
Consumes large volume of paper work.
To avoid all these limitations and make the system working more accurately it

needs to be computerized.
1.2 Objectives of Proposed System
The main objectives of the proposed system can be enumerated as follows:

Patients are easily allocated to the doctors.

Doctors search is possible.

Todays patient lists help doctors to search their patients.

Chapter 2
Software development Life Cycle
The systems development life cycle (SDLC), also referred to as the application
development life-cycle, is a term used in systems engineering, information systems and
software engineering to describe a process for planning, creating, testing, and deploying
an information system. The systems development life-cycle concept applies to a range of
hardware and software configurations, as a system can be composed of hardware only,
software only, or a combination of both.
An iterative life cycle model does not attempt to start with a full specification of
requirements. Instead, development begins by specifying and implementing just part of the
software, which can then be reviewed in order to identify further requirements. This
process is then repeated, producing a new version of the software for each cycle of the
model.

2.1 SDLC Model used in our product


Iterative Model
Iterative life cycle model does not attempt to start with a full specification of
requirements. Instead, development begins by specifying and implementing just part of the
software, which is then reviewed in order to identify further requirements. This process is
then repeated, producing a new version of the software at the end of each iteration of the
model.

Iterative Model design


Iterative process starts with a simple implementation of a subset of the software
requirements and iteratively enhances the evolving versions until the full system is
implemented. At each iteration, design modifications are made and new functional
capabilities are added. The basic idea behind this method is to develop a system through
repeated cycles (iterative) and in smaller portions at a time (incremental).
Iterative and Incremental development is a combination of both iterative design or
iterative method and incremental build model for development. "During software
development, more than one iteration of the software development cycle may be in
progress at the same time." and "This process may be described as an "evolutionary
acquisition" or "incremental build" approach."
In incremental model the whole requirement is divided into various builds. During each
iteration, the development module goes through the requirements, design, implementation
and testing phases. Each subsequent release of the module adds function to the previous
release. The process continues till the complete system is ready as per the requirement.
The key to successful use of an iterative software development lifecycle is rigorous
validation of requirements, and verification & testing of each version of the software
against those requirements within each cycle of the model. As the software evolves
through successive cycles, tests have to be repeated and extended to verify each version of
the software.

Advantages of Iterative model


In iterative model we can only create a high-level design of the application before we
actually begin to build the product and define the design solution for the entire product.
Later on we can design and built a skeleton version of that, and then evolved the design
based on what had been built.
In iterative model we are building and improving the product step by step. Hence we can
track the defects at early stages. This avoids the downward flow of the defects.
In iterative model we can get the reliable user feedback. When presenting sketches and
blueprints of the product to users for their feedback, we are effectively asking them to
imagine how the product will work.
In iterative model less time is spent on documenting and more time is given for designing.

Disadvantages of Iterative model

Each phase of iteration is rigid with no overlaps.


Costly system architecture or design issues may arise because not all requirements
are gathered up front for the entire lifecycle.

Chapter 3
Analysis
3.1 Requirement Analysis
Requirements analysis in systems engineering and software engineering, encompasses
those tasks that go into determining the needs or conditions to meet for a new or altered
product or project, taking account of the possibly conflicting requirements of the
various stakeholders, analyzing, documenting, validating and managing software or
system requirements.
Requirements analysis is critical to the success of a systems or software project. The
requirements should be documented, actionable, measurable, testable, traceable, related to
identified business needs or opportunities, and defined to a level of detail sufficient for
system design.
Requirements analysis includes three types of activities:

Eliciting requirements(e.g. the project charter or definition), business process


documentation, and stakeholder interviews. This is sometimes also called
requirements gathering.

Analyzing requirements: determining whether the stated requirements are clear,


complete, consistent and unambiguous, and resolving any apparent conflicts.

Recording requirements: Requirements may be documented in various forms,


usually including a summary list and may include natural-language documents, use
cases, user stories, or process specifications.

3.2 Requirement Specifications


3.2.1 Functional Requirements
A functional requirement defines a function of a system and its components. A function is
described as a set of inputs, the behavior, and outputs.

Functional requirements may be calculations, technical details, data manipulation and


processing and other specific functionality that define what a system is supposed to
accomplish.
Our software product will provide the following services
1. Collect/Input Data, i.e., get data into the Software Application
2. Manage Data, i.e., receive data, verify data, store data, send data
3. Analyze Data, i.e., group data by similar attributes (location, condition, etc.)
4. Integrate Data, i.e. receive data from more than one data system/source
5. Generate Output, i.e., reports, summaries, alerts, notifications, etc.

3.2.2 Non Functional Requirement


A non-functional requirement is a requirement that specifies criteria that can be used to
judge the operation of a system, rather than specific behaviors. This should be contrasted
with functional requirements that define specific behavior or functions. The plan for
implementing functional requirements is detailed in the system design. The plan for
implementing non-functional requirements is detailed in the system architecture.

A software requirements specification (SRS) is a description of a software system to be


developed, laying out functional and non-functional requirements, and may include a set
of use cases that describe interactions the users will have with the software.

Software requirements specification establishes the basis for an agreement between


customers and contractors or suppliers (in market-driven projects, these roles may be
played by the marketing and development divisions) on what the software product is to do
as well as what it is not expected to do. Software requirements specification permits a
rigorous assessment of requirements before design can begin and reduces later redesign. It
should also provide a realistic basis for estimating product costs, risks, and schedules.

The software requirements specification document enlists enough and necessary


requirements that are required for the project development. To derive the requirements we
need to have clear and thorough understanding of the products to be developed or being
developed. This is achieved and refined with detailed and continuous communications
with the project team and customer till the completion of the software.

3.3 Use case Analysis

3.3.1 Use case Description


To model a system the most important aspect is to capture the dynamic behavior. To
clarify a bit in details, dynamic behavior means the behavior of the system when it is
running /operating. So only static behavior is not sufficient to model a system rather
dynamic behavior is more important than static behavior. In UML there are five diagrams
available to model dynamic nature and use case diagram is one of them. Now as we have
to discuss that the use case diagram is dynamic in nature there should be some internal or
external factors for making the interaction. These internal and external agents are known
as actors. So use case diagrams are consists of actors, use cases and their relationships.
The diagram is used to model the system/subsystem of an application. A single use case
diagram captures a particular functionality of a system. Use case diagrams are used to
gather the requirements of a system including internal and external influences. These
requirements are mostly design requirements. So when a system is analyzed to gather its
functionalities use cases are prepared and actors are identified.

The purposes of use case diagrams can be as follows:


1. Used to gather requirements of a system.
2. Used to get an outside view of a system.
3. Identify external and internal factors influencing the system.
4. Show the interacting among the requirements are act.
3.3.2 Usecase Diagram

Figure 3.1 Use case diagram for system administrator

Figure 3.2 Use Case Diagram for System Receptionist


3.3.3 Activity diagram
Activity diagrams are graphical representations of workflows of stepwise activities and
actions with support for choice, iteration and concurrency. In the Unified Modeling
Language, activity diagrams are intended to model both computational and organizational
processes (i.e. workflows). Activity diagrams show the overall flow of control.
Activity diagrams are constructed from a limited number of shapes, connected with
arrows. The most important shape types:

rounded rectangles represent actions;

diamonds represent decisions;

bars represent the start (split) or end (join) of concurrent activities;

A black circle represents the start (initial state) of the workflow;

An encircled black circle represents the end (final state).

Figure 3.3 Activity Diagram

Chapter 4
Design
4.1 Data Flow Diagram
A Data Flow Diagram (DFD) is a graphical representation of the "flow" of data through an
information system, modeling its process aspects. A DFD is often used as a preliminary
step to create an overview of the system, which can later be elaborated. DFDs can also be
used for the visualization of data processing (structured design). A DFD shows what kind
of information will be input to and output from the system, where the data will come from
and go to, and where the data will be stored. It does not show information about the timing
of process or information about whether processes will operate in sequence or in parallel
(which is shown on a flowchart).

Figure 4.1 Level 0 DFD

Figure 4.2 level 1 DFD

4.2 Sequence diagram


A Sequence diagram is an interaction diagram that shows how processes operate with
one another and what is their order. It is a construct of a message sequence chart. A
sequence diagram shows object interactions arranged in time sequence. It depicts the
objects and classes involved in the scenario and the sequence of messages exchanged
between the objects needed to carry out the functionality of the scenario. Sequence
diagrams are typically associated with use case realizations in the Logical View of the
system under development. Sequence diagrams are sometimes called event
diagrams or event scenarios.
.

Figure 4.3 Sequence Diagram 1

Figure 4.4 Sequence Diagram 2

4.3 Class Diagram


The class diagram is a static diagram. It represents the static view of an application. Class
diagram is not only used for visualizing, describing and documenting different aspects of a
system but also for constructing executable code of the software application.
The class diagram describes the attributes and operations of a class and also the constraints
imposed on the system. The class diagrams are widely used in the modeling of object
oriented systems because they are the only UML diagrams which can be mapped directly
with object oriented languages.
The class diagram shows a collection of classes, interfaces, associations, collaborations
and constraints. It is also known as a structural diagram.

patientRegistration
patientID
PatientName
Login
FatherName
username
<<includes>> Address
password
ContactNo
Email
Login()
Age
Gender
BG
Remarks

admitPatient
AdmitID
patientID
disease
RoomNo
AdmitDate
DoctorID
AP_Remark

dischargePatient
ID
AdmitID
DischargeDate
DP_Remarks
dischargePatient()

doctor()

Ward()

Room
roomNo
roomType
roomCharges
roomStatus
allotment()
checkAvaliability()

admitPatient()
<<includes>>

patientRegistration()
doctor
DoctorID
DoctorName
FatherName
Address
ContctNo
Email
Qualification
Specialization
Gender
BloodGroup
DateOfJoining

Ward
wardName
wardType
NoOfBeds
Charges

BillRoom
BillNo
DischargeID
BillingDate
NoOfDays
RoomCharges
TotalRoomCharges
ServiceCharges
TotalCharges
PaymenetMode
PaymentModeDetails

BillWard
billNo
discharge
billingDate
<<includes>>noOfDays
totalBedCharge
serviceCharges
totalCharges
paymentMode
paymentModeDetails
<<depends on>>
chargesPaid
dueCharges

bill()
generateBill()

addBillWard()
availabiltiy()

Figure 4.5 Class Diagram

4.4 Database Design:


Database design is the process of producing a detailed data model of a database.
This logical data model contains all the needed logical and physical design choices and
physical storage parameters needed to generate a design in a data definition language,
which can then be used to create a database. A fully attributed data model contains detailed
attributes for each entity.

E-R Diagram:
Database designs also include ER (entity-relationship model) diagrams. An ER diagram is
a diagram that helps to design databases in an efficient way.

Attributes in ER diagrams are usually modeled as an oval with the name of the attribute,
linked to the entity or relationship that contains the attribute.
Within the relational model the final step can generally be broken down into two further
steps, that of determining the grouping of information within the system, generally
determining what are the basic objects about which information is being stored, and then
determining the relationships between these groups of information, or objects. This step is
not necessary with an Object database.

Figure 4.6 E-R Diagram

4.5 Modules identified

Patient Registration:

This module records basic patient related information, which is collected When the
patient visits the hospital for the first time. Each patient is allocated a unique
patient identification numbers.
Patient id, patient name, address, admitted date, doctor name, room number are
entered in a form and stored for future reference. Also particular patient details can be
viewed in the table using a separate form with a attribute patient id.

Doctor Details:

It keeps track of all details about doctors of the hospital Doctors, Doctor id , address
Qualification, cell number, e-mail are entered and stored in a separate form.

Ward/ Room Details:

This module enters and stores the details about each ward of the hospital for future
reference. Individual ward detail can be viewed in the table using ward id .The
attributes used in storing award detail is ward id, ward name, floor number, number of
rooms.

Patient Discharge:

This module will record the details of the patient with respect to the room/ward
allotted their admitted date, services provided till the patient is discharged from the
hospital.

Billing:

This module will provide the service of computerized billing when the patient is
discharged from the hospital. This will contain the patient details, services provided till
the patient is discharged and calculates the bill according to that.

Chapter 5
Implementation
5.1 Platform Used

Software Used
MySQL-5.7.5.1

MySQL is a popular choice of database for use in web applications, and is a central
component of the widely used LAMP open source web application software stack (and
other 'AMP' stacks).
LAMP
is
an
acronym
for
"Linux, Apache,
MySQL, Perl/PHP/Python." Free-software-open source projects that require a fullfeatured database management system often use MySQL.
MySQL can be built and installed manually from source code, but this can be tedious so it
is more commonly installed from a binary package unless special customizations are
required. On most Linux distributions the package management system can download and
install MySQL with minimal effort, though further configuration is often required to adjust
security and optimization settings.
Though MySQL began as a low-end alternative to more powerful proprietary databases, it
has gradually evolved to support higher-scale needs as well. It is still most commonly used
in small to medium scale single-server deployments, either as a component in a LAMPbased web application or as a standalone database server. Much of MySQL's appeal
originates in its relative simplicity and ease of use, which is enabled by an ecosystem of
open source tools such as phpMyAdmin. In the medium range, MySQL can be scaled by
deploying it on more powerful hardware, such as a multi-processor server with gigabytes
of memory.
There are however limits to how far performance can scale on a single server ('scaling
up'), so on larger scales, multi-server MySQL ('scaling out') deployments are required to
provide improved performance and reliability. A typical high-end configuration can
include a powerful master database which handles data write operations and
is replicated to multiple slaves that handle all read operations. The master server
synchronizes continually with its slaves so in the event of failure a slave can be promoted
to become the new master, minimizing downtime. Further improvements in performance
can be achieved by caching the results from database queries in memory
using memcached, or breaking down a database into smaller chunks called shards which
can be spread across a number of distributed server clusters.

Java:
Java is a set of several computer software and specifications developed by Sun
Microsystems, later acquired by Oracle Corporation that provides a system for developing
application software and deploying it in a cross-platform computing environment. Java is
used in a wide variety of computing platforms from embedded devices and mobile phones
to enterprise servers and supercomputers. While less common, Java applets run in secure,
sandboxed environments to provide many features of native applications and can be
embedded in HTML pages.

Writing in the Java programming language is the primary way to produce code that will be
deployed as byte code in a Java Virtual Machine (JVM); byte code compilers are also
available for other languages, including ADA, JavaScript, Python, and Ruby. In addition,
several languages have been designed to run natively on the JVM, including Scale,
Closure and Groovy. Java syntax borrows heavily from C and C++, but object-oriented
features are modeled after Smalltalk and Objective-C. Java eschews certain low-level
constructs such as pointers and has a very simple memory model where every object is
allocated on the heap and all variables of object types are references. Memory
management is handled through integrated automatic garbage collection performed by the
JVM.
The Java platform is a suite of programs that facilitate developing and running programs
written in the Java programming language. The platform is not specific to any one
processor or operating system; rather an execution engine (called a virtual machine) and a
compiler with a set of libraries are implemented for various hardware and operating
systems so that Java programs can run identically on all of them.
The heart of the Java platform is the concept of a "virtual machine" that executes Java byte
code programs. This byte code is the same no matter what hardware or operating system
the program is running under. There is a JIT (Just In Time) compiler within the Java
Virtual Machine, or JVM. The JIT compiler translates the Java byte code into native
processor instructions at run-time and caches the native code in memory during execution.

SQL Server:
SQL server is a client/server relational database management system (RDBMS) that uses
transact-SQL to send request between a client and SQL server.
Client/server Architecture
SQL server is designed to be a client/server system. Client/server systems are constructed
so
that the database can reside on a central computer, know as a server, and be shared
among several users. When users want to access the date in SQL server, they run an
application on their local computer, know as a client that connects over a network to the
server running SQL server.
SQL server can work with thousands of client applications simultaneously. The server has
features to prevent the logical problems that occur if a user tries to read or modify data
currently being used by others.
While SQL server is designed to work as a server in a client/server network. It also
capable of working as a stand-alone database directly on the client. The scalability and
ease-of-use features of SQL server allow it to work efficiently on a client without
consuming too many resources. SQL server efficiently allocates the available resources,
such as memory, network bandwidth, and disk I/O, among the multiple users.
Codes 12 rules are satisfied. That is,
Data Representation
Rule of guaranteed access
Proper treatment of null value
Security

Versioning
Physical Independence
Logical Independence
Integrity constraint independence
View Updating
Data Description
Comprehensive data sub language
Insert and update rule
Distribution
5.1.1 Hardware recommended
Processor
: Intel CORE i5
System Type
: 64 bit O.S.
Memory Capability : 2 GB
Hard Disk Capability: 20 GB
Monitor Make
: DELL
5.1.2 Software recommended
Operating System
Database
.Programming Language

: Windows 7
: My SQL Server
: Java

5.2 Implementation level Details


5.2.1 System Modules Description
They are same described earlier in section 4.5 Modules Identified.

5.2.2 Screenshots
Here, some screenshots of that module are presented.
User login window:

Patient registration window:

New ward entry window:

Room booking window:

Main menu window:

Ward boy entry details Window:

Patient info window:

5.2.3 Sample Source Code


Patient Registration
private void Reset()
{
txtPatientID.setText("");
txtPatientName.setText("");
txtFathername.setText("");
txtContactNo.setText("");
txtAddress.setText("");
txtAge.setText("");
txtEmailID.setText("");
txtRemarks.setText("");
cmbBloodGroup.setSelectedIndex(-1);
cmbGender.setSelectedIndex(-1);
btnSave.setEnabled(true);
btnUpdate.setEnabled(false);
btnDelete.setEnabled(false);
txtPatientID.requestDefaultFocus();
}

Login:

public Login() {
initComponents();
setLocationRelativeTo(null);
}
private void initComponents() {
jMenuItem1 = new javax.swing.JMenuItem();
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new
java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0));
jSplitPane1 = new javax.swing.JSplitPane();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
txtUserName = new javax.swing.JTextField();
txtPassword = new javax.swing.JPasswordField();
btnOK = new javax.swing.JButton();
btnCancel = new javax.swing.JButton();
filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new
java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0));
jMenuItem1.setText("jMenuItem1");
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Login Form");
setResizable(false);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEventevt) {
formWindowOpened(evt);
}
});
jLabel1.setText("User Name");
jLabel2.setText("Password");
txtUserName.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEventevt) {
txtUserNameMouseClicked(evt);
}
});
txtUserName.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEventevt) {
txtUserNameActionPerformed(evt);
}
});

txtPassword.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEventevt) {
txtPasswordKeyPressed(evt);
}
});
btnOK.setText("OK");
btnOK.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEventevt) {
btnOKMouseClicked(evt);
}
});
btnOK.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEventevt) {
btnOKActionPerformed(evt);
}
});
btnCancel.setText("Cancel");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEventevt) {
btnCancelActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(layout.createSequentialGroup()
.addGap(89, 89, 89)
.addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, 86,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(32, 32, 32)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignmen
t.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(35, 35, 35)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
.addGroup(layout.createSequentialGroup()

.addComponent(btnOK,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacemen
t.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnCancel))
.addComponent(txtPassword,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(29, 29, 29)
.addComponent(txtUserName,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addContainerGap(32, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(35, 35, 35)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jLabel1)
.addComponent(txtUserName,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(26, 26, 26)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtPassword))
.addGap(26, 26, 26)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(btnOK)
.addComponent(btnCancel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(20, 20, 20))
);
pack();

}
private void txtUserNameMouseClicked(java.awt.event.MouseEventevt) {
}
private void btnOKMouseClicked(java.awt.event.MouseEventevt) {
if (txtUserName.getText().equals("")) {
JOptionPane.showMessageDialog(
this,
"Please
enter
user
name","Error",
JOptionPane.ERROR_MESSAGE);
return;
}
String Password= String.valueOf(txtPassword.getPassword());
if (Password.equals("")) {
JOptionPane.showMessageDialog(
this,
"Please
enter
password","Error",
JOptionPane.ERROR_MESSAGE);
return;
}
con=Connect.ConnectDB();
String sql= "select * from users where UserName= '" + txtUserName.getText() + "' and
user_Password ='" + txtPassword.getText() + "'";
try
{
pst=con.prepareStatement(sql);
rs= pst.executeQuery();
if (rs.next()){
this.hide();
MainMenufrm=new MainMenu();
frm.setVisible(true);
}
else{
JOptionPane.showMessageDialog(null,
"Login
denied",JOptionPane.ERROR_MESSAGE);
}
}catch(SQLException | HeadlessException e){
JOptionPane.showMessageDialog(null, e);

Failed..Tryagain

}
}
private void btnCancelActionPerformed(java.awt.event.ActionEventevt) {
System.exit(0);
}
private void formWindowOpened(java.awt.event.WindowEventevt) {

!","Access

}
private void txtUserNameActionPerformed(java.awt.event.ActionEventevt) {
// TODO add your handling code here:
}
private void txtPasswordKeyPressed(java.awt.event.KeyEventevt) {
if (evt.getKeyCode()==KeyEvent.VK_ENTER){
con=Connect.ConnectDB();
String sql= "select * from users where UserName= '" + txtUserName.getText() + "' and
user_Password ='" + txtPassword.getText() + "'";
try
{
pst=con.prepareStatement(sql);
rs= pst.executeQuery();
if (rs.next()){
this.hide();
MainMenufrm=new MainMenu();
frm.setVisible(true);
}
else
{
JOptionPane.showMessageDialog(null,"Login
Failed..Tryagain
!","Access
denied",JOptionPane.ERROR_MESSAGE);
txtUserName.setText("");
txtPassword.setText("");
txtUserName.requestDefaultFocus();
}
}catch(SQLException | HeadlessException e)
{
JOptionPane.showMessageDialog(null, e); } } }

5.3 Testing

Testing is the process of evaluating a system or its component(s) with the intent to find
that whether it satisfies the specified requirements or not. This activity results in the
actual, expected and difference between their results. In simple words testing is executing
a system in order to identify any gaps, errors or missing requirements in contrary to the
actual desire or requirements.
According to ANSI/IEEE 1059 standard, Testing can be defined as A process of
analyzing a software item to detect the differences between existing and required
conditions (that is defects/errors/bugs) and to evaluate the features of the software item.
It involves the execution of a software component or system component to evaluate one or
more properties of interest. In general, these properties indicate the extent to which the
component or system under test:

meets the requirements that guided its design and development,

responds correctly to all kinds of inputs,

performs its functions within an acceptable time,

is sufficiently usable,

can be installed and run in its intended environments, and

Achieves the general result its stakeholders desire.

System Testing is an important stage in any system development lifecycle. Testing is a


process of executing a program with the intention of finding errors. The importance of
software testing and its implications with respect to software quality cannot be
overemphasized. Software testing is a critical element of software quality assurance and
represents the ultimate review of specification, design and coding. A good test case is one
that has a high probability of finding a yet undiscovered error. Testing is the set of
activities that can be planned in advance and conducted systematically. Different test
conditions should be thoroughly checked and the bugs detected should be fixed. The
testing strategies formed by the user are performed to prove that the software is free and
clear from errors. To do this, there are many ways of testing the systems reliability,
completeness and maintainability.
5.3.1 Testing Techniques Performed
Unit Testing:
In the unit testing the analyst tests the program making up a system. The software units in
a system are the modules and routines that are assembled and integrated to perform a
specific function. In a large system, many modules on different levels are needed. Unit
testing can be performed from the bottom up starting with the smallest and lowest level

modules and proceeding one at a time. For each module in a bottom-up testing, a short
program executes the module and provides the needed data.
Integration Testing:
Integration testing is a systematic technique for constructing the program structure while
conducting test to uncover errors associate with interfacing. Objectives are used to take
unit test modules and built program structure that has been directed by design. The
integration testing is performed for this Patient Record System when all the modules
where to make it a complete system. After integration the project works successfully.
Validation Testing:
Tests were performed to find conformity with the requirements. Plans and procedures
were designed to ensure that all functional requirements are satisfied. The software was
alpha-tested. There are two goals in preparing test plans. Firstly, a properly detailed test
plan demonstrates that the program specifications are understood completely. Secondly,
the test plan is used during program testing to prove the correctness of the program.
5.3.2 Test Cases:
Well come up with our own requirement set for the login screen. Well write the scenario
based
Username should contain letter, number and period.
Username should not be left blank.
Username should not start with or contain any symbols.
User Interface
Here are some of the questions that can help you form test cases.
Where is the cursor focus in text area when you load the page?
Does enter key works as a substitute for the sign in button action?
Does username and password text field appears in order?
Does remember me check box selected by default?
Does the login page has register link for new users?
Does the user interface look as per the design specification?
Positive test cases:
Enter valid username and password.
Click on register link and fill out the form and register username and password.
Use enter button after typing correct username and password.
Use tab to navigate from username textbox to password textbox and then to login
button.
Negative test cases:
Enter valid username and invalid password.
Enter valid password but invalid username.
Keep both field blank and hit enter or click login button.

Keep username blank and enter password.


Keep password blank and enter username.
Enter username and password wrong.

Chapter 6
Conclusion
The project Patient Record System is for computerizing the working in a hospital. The
software takes care of all the requirements of an average hospital and is capable to provide
easy and effective storage of information related to patients that come up to the hospital.
6.1 Important Feature:
Can be used in any Hospital, Clinic labs for maintaining patient details and their test
results.
6.2 Limitations
The size of the database increases day-by-day, increasing the load on the database
back up and data maintenance activity.
Training for simple computer operations is necessary for the users working on the
system.
6.3 Future work
There can be many improvements possible in any new or old system.
It could be made online on internet which expands its service to whole world.
Also we will keep tracks of bugs found while testing.

References:
1.
2.
3.
4.
5.
6.
7.
8.

www.google.com
www.slideshare.com
Software Engineering by K.K.Aggrawal, Singh, Yogesh.
Ian Somerville, Software Engineering, Third Edition.
alexgorbatchev.com/SyntaxHighlighter/manual/brushes/xml.htm
www.tutorialspoint.com/java/java_multithreading.html
www.tutorialspoint.com/mysql/

java-sl.com

Você também pode gostar