Sei sulla pagina 1di 31

INDUSTRIAL TRAINING ON CORE JAVA/J2EE

A PROJECT REPORT
Submitted by
Ayush Barnawal
13BTCSE007
inpartialfulfillmentfortheawardofthedegreeof

BACHELOROFTECHNOLOGY
IN
COMPUTERSCIENCE&ENGINEERING
At

Department of Computer Science & Information Technology


Shepherd School of Engineering and Technology
Sam Higginbottom Institute of Agriculture, Technology and Sciences,
Allahabad, U. P. 211007, India
November2015

ABSTRACT
'SANJEEVANI' is a hospital providing the Genuine Health Services. The
information about the patients admitted in the hospital is maintained properly
yet such information are not always easily accessible.
There is an emerging realization that the more widespread use of
Information Technology increases efficiency and enable changes in Health Care
Delivery Processes could do much to improve the performance of the Hospital
Management System, within the bound of appropriate measures to protect the
confidentiality of Patients Health Information. Hence, the Higher Authorities of
organization decided to enhance the Health Services and take the hospital to a
complete new level by introducing a Computer-based program i.e. Patient
Information System (PIS) including all the elements that facilitate the
formalities like Registration Form, Discharge Form, Hospital Staff Details,
Doctors Availability, Past Patients Record, Payment Details and Hospital
Information itself.
The Patient Information System is highly secure & is not
accessible by any user. Only Hospital Administrator and Receptionist can access
this system. Patient can easily track the doctors like their Timings,
Specialization. Likewise, doctors can easily make the progress report of
patients health from past patient information.
PIS is Swing-JDBC based Patient Information system whose Front End is
designed using Swing while Back End with Oracle 10g Express Edition.

INTRODUCTION
With all the research and medical information that is generated on a daily basis,
the storage requirements and data management are enormous. Hence, the Health
Institution will need to have a reliable storage system to store, retrieve and
preserve their work.
A data repository for patients Health Care Information system is becoming a
critical need. This data repository would contain comprehensive patient records,
including information such as Admitted On, Medical history, Discharge Date,
paid Dues and Hospitals information like Doctors Timing, Staffs availability.
Due to large volume and complexity of the data as well as the daily transaction
details, the implementation of PIS manually will be a complex and challenging
task, in particular with an archive system that is scalable and upgradeable with
time. PIS program offers a greater efficiency and accuracy for the hospital and
patient who needs specialists will be able to get treatment faster and easier.
Even therere advantages of having a patient record system, there are still flaw
in it. For instance, by having an electronic medical database in place, all
medical records will be allowed to access if Admins password is known. Thus,
increases the likelihood of security breach.
Nonetheless we should not overlook the good points of the medical record
system.

Requirements Specification
Depending on the decision given by the management on the Computer Based
Patient Information system is to be developed. Following are the requirements
based on which the system needs to be developed.
1. System will generate Registration Forms for newly admitted patients.
2. Users of this system can search for patient by name, admission date,
Discharge date, etc.
3. Users can view the previous visited patients histories (details).
4. System can maintain the list of doctor in the hospital.
5. System can maintain the list of beds/rooms available in the hospital.
6. Patients are categorized into "Patients under Treatment" and "Discharged
Patients"

7. Performs necessary validations like each patient and doctors have their
unique Identification Number.

BACKGROUND OF THE PROJECT


OOPS CONCEPT
JAVA is an object oriented programming language. It was developed by
JAMES GOSLING, PATRIC NAUGHTON, CRIS WARTH, MIKE
SHERIDAN and 1985. They wanted to combine the best of both the
languages and create a more powerful language that could support object
oriented programming language.
The main problem associated with large programs written in
procedural language is under evaluation if data is neglected. There are no
built in mechanism to ensure the security of data. The OOP approach is
different. In OOP, the emphasis is on Data not on Procedures. In OOP, a
class is the specification for such a data form.
In OOP, we bundle together the data and the functions that operate on
the data into a single software unit called class. A class is the specification of
a data entity. This data entity is called object. An object is an instantiation of
a class. The relationship between a class and an object is the same as that of
a built in data type and a variable of that type. A class is a data type and an
object is an instance of that data type.
The most important and the most basic concept in OOP is
the concept of the class. Defining a class does not perform any memory
allocation. A class is like a blue print for a house. The blue print gives the
specification of the house. Based on the blue print many houses can be
constructed. In a similar way you can create many objects of a given class.
When an object is created, memory allocation takes place. OOP design
methodology is different. Problems are no longer divided into functions. Instead
it is divided into a collection of mutually interacting objects. Objects interact
with one another through methods.

PROJECT DESCRIPTION
Modules:
The Project contains several modules.

Administrator
Hospital Details
Doctors
Staffs
Patient Registration
Discharged Patients
Past Patient Records
Expenses Details

Analysis
Activity Chart

Patient

Entry

Attendant

Patient Admit

Patient Discharge

Payment
Report
Status

LANGUAGE SPECIFICATION
JAVA
JAVA is the most widely used object-oriented language today. It
is faster and more powerful than Java, another popular object-oriented
language, which lacks certain features such as pointers and multiple
inheritance.
Some important concepts of the object-oriented programming language
are as follows:

Objects
Classes
Data abstraction and encapsulation
Inheritance
Polymorphism
Dynamic binding
Message passing

We shall discuss these concepts in detail in this Section.


Objects
Object are the basic run-time entities in an object-oriented system. They
may represent a person, a bank account, a table of data or any item that
the program has to handle. They may also represent user-defined data
such as vectors, time and lists. Programming problem is analyzed in
terms of objects and the nature of communication between them.
Program objects should be chosen such that they match closely with the
real-world objects. Objects take up space in the memory and have an
associated address like a record in Pascal, or a structure in C.

Classes
We just mentioned that objects contain data, and code to
manipulate that data. The entire set of data and code of an object can be made a
user-defined data type with the help of a class. In fact, objects are variables of
the type class. Once a class has been defined, we can create any number of
objects belonging to that class. Each object is associated with the data of type
class with which they are created. A class is thus a collection of objects of

similar type. Classes are user-defined data types and behave like the built-in
types of a programming language. The syntax used to create an object is no
different than the syntax used to create an integer object in C.

Data Abstraction and Encapsulation


The wrapping up of data and functions into a single unit (called class ) is
known as encapsulation. Data encapsulation is the most striking feature
of a class. The data is not accessible to the outside world, and those
functions which are wrapped in the class can access it .These functions
provide the interface between the objects data and the program. This
insulation of the data from direct access by the program is called data
hiding or information hiding.
Abstraction refers to the act of representing essential features
without including the background details or explanations. Classes use
the concept of abstraction and are defined as a list of abstract attributes
such as size, weight and cost, and functions to operate on these
attributes. They encapsulate all the essential properties of the object that
are to be created. The attributes are sometimes called data members
because they hold information. The functions that operate on these data
are sometimes called methods or member functions. Since the classes
use the concept of data abstraction, they known as Abstract Data Types
(ADT).

Inheritance
Inheritance is the process by which objects of one class acquire the
properties of objects of another class. It supports the concept of
hierarchical classification. For example, the bird robin is a part of the
class flying bird which is again a part of the class bird. The principle
behind this sort of that each derived class shares common characteristics
with the class from which it is derived.
In OOP, the concept of inheritance provides the idea of reusability. This
means that we can add additional features to an existing class without
modifying it. This is possible by deriving a new class from the existing
one. The new class will have the combined features of both the classes.

The real appeal and power of the inheritance mechanism is that it allows
the programmer to reuse a class that is almost, but not exactly, what he
wants, and to tailor the class in such a way that it does not introduce any
undesirable side-effects into the rest of the classes.
Note that each sun-class defines only those features that
are unique to it. Without the use of classification, each class would have
to explicitly include all of its features.
Polymorphism
Polymorphism is another important OOP concept. Polymorphism, a
Greek term, means the ability to take more than one form. An operation
may exhibit different behaviors depends upon the types of data used in
the operation. For example, consider the operation of addition. For two
numbers, the operation will generate a sum. If the operands are strings,
then the operation would produce a third string by concatenation. The
process of making an operator to exhibit different behaviors in different
instances is known as operator overloading.
A single function name can be used to handle different number
and different types of arguments. This is something similar to a
particular word having several different meanings depending on the
context. Using a single function name to perform different types of
tasks is known as function overloading. Polymorphism plays an
important role in allowing objects having different internal structures to
share the same external interface. This means that a general class of
operations may be accessed in the same manner even though specific
action associated with each operation may differ. Polymorphism is
extensively used in implementing inheritance.

Dynamic Binding
Binding refers to the linking of a procedure call to the code to be
executed in response to the call. Dynamic binding (also known as late
binding) means that the code associated with a given procedure call is
not known until the time of the call at run-time. It is associated with
polymorphism and inheritance. A function call associated with a
polymorphism with a polymorphism reference depends on the dynamic
type of that reference.

By inheritance, every object will have this procedure. Its algorithm


is, however, unique to each object and so the draw procedure will be
redefined in each class that defines the object. At run-time, the code
matching the object under current reference will be called.

Message Passing
An object-oriented program consists of a set of objects that
communicate with each other. The process of programming in an
object-oriented language, therefore, involves the following basic steps:
1. Creating classes that define objects and their behaviors,
2. Creating objects from class definitions, and
3. Establishing communication among objects.
Objects communication with one another by sending and receiving information
much the same way as people pass messages to one another. The receiving
information much the same way as people pass message to one another. The
concept of message passing makes it easier to talk about building systems that
directly model or simulate their real-world counterparts.
A message for an object is a request for execution for execution of a procedure,
And therefore will invoke a function (procedure) in the receiving object that
Generates the desired result. Message passing involves specifying the name of
the object, the name of the function (message) and the information to be sent.
Objects have a life cycle. They can be created and
destroyed. Communication with an object is feasible as long as it is
alive.

ORACLE 10G XE
An Oracle database is actually referred to physical storage of information, while
instance refers to the software executing on the server that provides access to
the information in the database. The instance runs on the computer or server; the
database is stored on the disks attached to the server:

Figure 2.9 A simplify network for an instance and a database


(http://www.oracle.com)

It is important to know that users do not directly access the information in an


Oracle database. Instead, they pass requests for information to an Oracle
instance.

Figure 2.9 Overall view of Oracle database network


(http://www.oracle.com)

ADVANTAGE OVER MANUAL SYSTEM


Manual work takes more time.
Computer management reduces paper work.
Data retrieval process becomes easy when it is needed, if we use
computer management instead of manually.
Updating of data is easy in computerized system.
Data consistency is required for neat and proper management that is
achieved by computer easily.

MINIMUM HARDWARE REQUIREMENT


RAM 256 MB
HARD DISK 40GB
PENTIUM 3

SOFTWARE REQUIREMENT

Operating System: Win XP, 7


Front End: JDK 7
Back End: Oracle 10 XE
Eclipse (Any Version)

SOFTWARE MAINTENANCE AND EVALUATION


Maintenance is the enigma of system development. It holds the software
industry captive, tying up programming resources. Analysts and
programmers spend far more time maintaining programs than do writing
them. Maintenance accounts for 50-80 percent of total system development.
Some programs executed with software maintenance.

1.
2.
3.
4.
5.
6.
7.
8.
9.

Maintenance is not as rewarding as exciting as developing system.


It is perceived as requiring neither skill nor experience.
Users are not fully cognizant of the maintenance problem or its high
cost.
Few tools and techniques are available for maintenance.
A good test plan is lacking.
Standards, procedures, and guidelines are poorly defined and enforced.
Maintenance is viewed as a necessary evil, often delegated to junior
programmers. There is practically no maintenance manager job
classification in the MIS field.
Programs are often maintained without care for structure and
documentation.
There are minimal standards for maintenance.
Programmers expect that they will not be in their current commitment
by the time their programs go into the maintenance cycle.

SOFTWARE ARCHTECTURE
Data Flow Diagram (DFD)

0th LEVEL DFD

1th LEVEL DFD

ENTITY RELATIONSHIP DIAGRAM (ER)

FUTURE SCOPE
1. Making it accessible to any platform.
2. Using More Secured Database.
3. Adding advanced security level.

SNAPSHOTS

Login Page

MAIN MENU

REGISTRATION FORM

SEARCH PAGE FOR DISCHARGED PATIENTS

HOSPITAL INFORMATION

DATABASE FOR DOCTOR DETAILS

SAMPLE SOURCE CODE


package pro;
import java.awt.Color;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class DisChargeForm extends JFrame implements ActionListener
{
/**
*
*/
private static final long serialVersionUID = 1L;
private static JTextField t1,t2,t3,t4,t5,t6,t8,t9,t12,t13;
private static JLabel lhead,l1,l2,l3,l4,l5,l6,l8,l9,l12,l13, l14;
private static JButton b1,b2,b3;
private static JFrame f3;
private static GridBagLayout gbl;
private static GridBagConstraints gbc;
public DisChargeForm()
{
setDefaultLookAndFeelDecorated(true);
f3=new JFrame("Discharge Form");
f3.setSize(800,600);
f3.setLocation(100,100);
JPanel p=new JPanel();
f3.getContentPane().add(p);
f3.setBackground(Color.green);
p.setBackground(Color.white);
gbl=new GridBagLayout();
gbc=new GridBagConstraints();
p.setLayout(gbl);
gbc.gridx=0;

gbc.gridy=0;
lhead=new JLabel(" PATIENT DISCHARGE FORM");
gbl.setConstraints(lhead,gbc);
Font ft=new Font("Algerian", Font.BOLD,30);
lhead.setFont(ft);
lhead.setForeground(Color.RED);
gbc.gridx=0;
gbc.gridy=19;
l14=new JLabel("
");
gbl.setConstraints(l14,gbc);
gbc.gridx=0;
gbc.gridy=20;
l1=new JLabel("Patient Reg No");
gbl.setConstraints(l1,gbc);
gbc.gridx=30;
gbc.gridy=20;
t1=new JTextField(15);
gbl.setConstraints(t1,gbc);
gbc.gridx=0;
gbc.gridy=30;
l2=new JLabel("Patient Name");
gbl.setConstraints(l2,gbc);
gbc.gridx=30;
gbc.gridy=30;
t2=new JTextField(15);
gbl.setConstraints(t2,gbc);
gbc.gridx=0;
gbc.gridy=40;
l3=new JLabel("Admission Date (dd-MMM-yyyy)");
gbl.setConstraints(l3,gbc);
gbc.gridx=30;
gbc.gridy=40;
t3=new JTextField(15);
gbl.setConstraints(t3,gbc);
gbc.gridx=0;
gbc.gridy=50;
l4=new JLabel("Discharge Date (dd-MMM-yyyy)");
gbl.setConstraints(l4,gbc);
gbc.gridx=30;
gbc.gridy=50;
t4=new JTextField(15);

gbl.setConstraints(t4,gbc);
gbc.gridx=0;
gbc.gridy=60;
l5=new JLabel("Diseases");
gbl.setConstraints(l5,gbc);
gbc.gridx=30;
gbc.gridy=60;
t5=new JTextField(15);
gbl.setConstraints(t5,gbc);
gbc.gridx=0;
gbc.gridy=70;
l6=new JLabel("Room Charges");
gbl.setConstraints(l6,gbc);
gbc.gridx=30;
gbc.gridy=70;
t6=new JTextField(15);
gbl.setConstraints(t6,gbc);
gbc.gridx=0;
gbc.gridy=80;
l8=new JLabel("Medicine Charges");
gbl.setConstraints(l8,gbc);
gbc.gridx=30;
gbc.gridy=80;
t8=new JTextField(15);
gbl.setConstraints(t8,gbc);
gbc.gridx=0;
gbc.gridy=90;
l9=new JLabel("Operation/Testing Charges");
gbl.setConstraints(l9,gbc);
gbc.gridx=30;
gbc.gridy=90;
t9=new JTextField(15);
gbl.setConstraints(t9,gbc);
gbc.gridx=0;
gbc.gridy=100;
l12=new JLabel("Docter Charges");
gbl.setConstraints(l12,gbc);
gbc.gridx=30;
gbc.gridy=100;
t12=new JTextField(15);

gbl.setConstraints(t12,gbc);
gbc.gridx=0;
gbc.gridy=110;
l13=new JLabel("Total Amount");
gbl.setConstraints(l13,gbc);
gbc.gridx=30;
gbc.gridy=110;
t13=new JTextField(15);
gbl.setConstraints(t13,gbc);
gbc.gridx=0;
gbc.gridy=120;
b1=new JButton("Submit");
gbl.setConstraints(b1,gbc);
gbc.gridx=28;
gbc.gridy=120;
b2=new JButton("Reset");
gbl.setConstraints(b2,gbc);
gbc.gridx=30;
gbc.gridy=120;
b3=new JButton("Cancel");
gbl.setConstraints(b3,gbc);
p.add(lhead);
p.add(l14);
p.add(l1);
p.add(t1);
p.add(l2);
p.add(t2);
p.add(l3);
p.add(t3);
p.add(l4);
p.add(t4);
p.add(l5);
p.add(t5);
p.add(l6);
p.add(t6);
p.add(l8);
p.add(t8);

p.add(l9);
p.add(t9);
p.add(l12);
p.add(t12);
p.add(l13);
p.add(t13);
p.add(b1);
p.add(b2);
p.add(b3);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
f3.setVisible(true);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==b1)
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","sys12
3");
PreparedStatement ps=con.prepareStatement("Insert
into DisCharge(RegNo, P_Name, Ad_Date, Dis_Date,Diseases, Room_Charges,
Med_Charges, OT_Charges, Doc_Charges, Total_Amt) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
String RegNo = t1.getText();
String PatientName = t2.getText();
String AdmissionDate = t3.getText();
String DischargeDate = t4.getText();
String Diseases = t5.getText();
int RoomCharges = Integer.parseInt(t6.getText());
int MedicineCharges = Integer.parseInt(t8.getText());
int OTCharges = Integer.parseInt(t9.getText());
int DoctorCharges=Integer.parseInt(t12.getText());
int total = RoomCharges + MedicineCharges +
OTCharges + DoctorCharges;
t13.setText(String.valueOf(total));
int TotalAmt = Integer.parseInt(t13.getText());

ps.setString(1, RegNo);
ps.setString(2, PatientName);
ps.setString(3, AdmissionDate);
ps.setString(4, DischargeDate);
ps.setString(5, Diseases);
ps.setInt(6, RoomCharges);
ps.setInt(7, MedicineCharges);
ps.setInt(8, OTCharges);
ps.setInt(9, DoctorCharges);
ps.setInt(10, TotalAmt);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Record Insert
Successfully");
}
catch(Exception ex)
{
ex.printStackTrace();
JOptionPane.showMessageDialog(null,"required field
must not be blank");
}
else if(ae.getSource()==b2)
{
t1.setText("");
t2.setText("");
t3.setText("");
t4.setText("");
t5.setText("");
t6.setText("");
t8.setText("");
t9.setText("");
t12.setText("");
t13.setText("");
}
else if(ae.getSource()==b3)
{
new MainMenu();
f3.setVisible(false);
}
}
public static void main(String args[])

{
new DisChargeForm();
}
}

package pro;

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;

public class StaffDtls extends JFrame implements ActionListener


{
/**
*
*/
private static final long serialVersionUID = 1L;
private final JTable tb1;
private final JScrollPane sp1;
private final String[] field={ "Department" , "Doctors", "Nurses", "WardBoys",
"Helpers", "Guards", "Sweepers"};
private final JFrame f1;
private final JButton b1;

public StaffDtls()
{

setDefaultLookAndFeelDecorated(true);
f1=new JFrame("Staff Table");
f1.setSize(500,300);
f1.setLocation(100,100);
JPanel p=new JPanel();
f1.getContentPane().add(p);
f1.setBackground(Color.white);

Object[][] data={
{"General","4","6","4","2","2","2"},
{"Child","2","6","4","2","2","2"},
{"Eye","1","2","1","2","1","2"},
{"Heart","2","6","4","6","4","4"},
{"Surgeon","2","6","5","6","4","2"},
{"Maternity","4","6","0","0","0","0"},
{"Laboratory ","4","2","2","2","2","2"},
{"Skin","2","2","1","1","0","1"},
{"Medical","2","2","1","1","0","1"},
{"Brain","2","2","1","1","0","1"},
{"Dental","1","2","1","1","0","1"},
{"Total","26","42","24","24","15","18"},
};

b1= new JButton("Exit");


b1.addActionListener(this);
tb1=new JTable(data, field);

tb1.setEnabled(false);

sp1=new JScrollPane(tb1);
p.add(b1);

p.add(sp1);

f1.setVisible(true);

public void actionPerformed(ActionEvent ae)


{
if(ae.getSource()==b1)
{
new MainMenu();
f1.setVisible(false);
}
}

public static void main(String args[])


{
new StaffDtls();
}
}

Potrebbero piacerti anche