Clinic Management System Report File
Clinic Management System Report File
Project Report
On
“Clinic Management System”
Submitted in Partial Fulfillment of the
Of
From
Submitted to:
INVERTIS UNIVERSITY
Invertis Village, Bareilly - Lucknow National Highway, NH-24, Bareilly,
Uttar Pradesh - 243123
1. Title Page
1.1 Candidate Declaration
1.2 Acknowledgement
1.3 Preface
2. Introduction to System
2.1 Introduction
2.2 Existing system with Limitations
2.3 Proposed system
2.4 Objective of the Project
3. Feasibility Study
4. System Analysis
5. Software/Hardware Requirement
6. System Design
6.1 Database Design
6.1.1 ER-Diagram
6.1.2 Database Specifications
6.2 Data Flow Diagram
7. Input/output Design
8. Implementation
8.1 Coding
9. System Testing
10. Conclusion
11. Bibliography
CANDIDATE DECLARATION
We hereby declare that the work which is being presented in the project report entitled
“CLINIC MANAGEMENT SYSTEM’’ for partial fulfillment of the requirement of degree of
“BSC(IT)’’ of Shri Dev Suman Tehri Garhwal university submitted in Omkarananda
Institute of Managemnt& Technology, Rishikesh Is of record of our own work & was
carried out under the guidance of Mr. ANIL RANAKOTI OIMT, Rishikesh.
Date:
Wahid Yar Khan
This is to certify that the above statement made by candidate is correct to the best of my
knowledge.
First of all with great reverence, we express our deep sense of gratitude to “Invertis Institute of
Management and Technology (IIMT)”, Bareilly for giving us an opportunity to prepare a project
during B.C.A.
The guidance given by Mr. Saurabh Kumar, IIMT throughout the work was invaluable and
is an asset.
Our sincere and heartfelt gratitude is also due to all the other faculty members for their
guidance, they provided us as well as for the care and concern shown by them.
PREFACE
It gives us the great pleasure in redesign our work in a report from which contains the
real useful programming part of this project work .
This project has undergone significant changes. Since it is very initial stage through its present
version . the programming of this work has been done exclusively in .Net framework; this
programming language is chosen by us due to its acceptability features .
We hope & wish this project work will be linked by all & if anyone find any bug or
drawback he/she is welcome for any suggestion & help in debugging.
INTRODUCTION
Our project Clinic Management system includes registration of patients, storing their details into the
system . Our software has the facility to give a unique id for every patient and stores the details of
every patient and the staff automatically. User can search availability of a doctor and the details of a
patient using the id.
The Clinic Management 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 interface is very user-friendly. The data are well protected for personal use and
makes the data processing very fast.
EXISTING SYSTEM WITH LIMITATIONS
Existing system refers to the system that is being followed till now. Presently all the hospital
functionalities are done manually. That is if a patient want to consult a doctor he can visit their till
his chance called. This is made the person very difficult. Out-Patients and In-Patients tickets are
distributed directly. The main disadvantage is time consuming.
To avoid all these limitations and make the system working more accurately it needs to be
computerized.
PROPOSED SYSTEM
The main purpose behind the proposed system is to provide a comprehensive computerized system.
In comparison to the present system the proposed system will be less time consuming and is
more efficient.
Analysis will be very easy in proposed system as it is automated.
The proposed system is very secure as no chances of misplace the record of any department
in hospital.
OBJECTIVE OF THE PROJECT
Now as we have seen the huge the database management of patient through
computerization. We are summarizing up allthe advantage of computerized system.
Feasibility study is a test of a system proposal according to its workability , impact on the
organization ability to meet user needs , and effective use of resources . Depending on the
result of the initial investigation, the survey is expanded to a more detailed feasibility study.
What are the user’s demonstrable needs? And how does a candidate system meet them?
What resourcesare available for given candidate system? Is the problem worth solving?
What are the likely impacts of the candidate system on the organization ?
The answer of the above question revolve around investigation and evaluation of the
problem. The objective of the feasibility study is not to solve the problem but to acquire a
sense of its scops. During the study, the problem definition is crystallized and aspects of the
problem to be include in the system are determined.
We analyze the feasibility of the purposed system through the three types of feasibility
studies, which are as below.
Economic feasibility
Technical feasibility
Operational feasibility
Economical Feasibility
Economical feasibility determines whether there are sufficient benefits in creating to make the cost
acceptable, or is the cost of the system too high. As this signifies cost-benefit analysis and savings.
On the behalf of the cost-benefit analysis, the proposed system is feasible and is economical
regarding its pre-assumed cost for making a system. During the economical feasibility test we
maintained the balance between the Operational and Economical feasibilities, as the two were the
inflicting. For example the solution that provides the best operational impact for the end-users may
also be the most expensive and, therefore, the least economically feasible.
We classified the costs of NEMOSYS according to the phase in which they occur. As we know
that the system development costs are usually one-time costs that will not recur after the project has
been completed. For calculating the Development costs we evaluated certain cost categories viz.
Technical Feasibility :
Technical feasibility determines whether the work for the project can be done with the existing
equipment, software technology and available personnel. Technical feasibility is concerned with
specifying equipment and software that will satisfy the user requirement. This project is feasible on
technical remarks also, as the proposed system is more beneficiary in terms of having a sound proof
system with new technical components installed on the system. The proposed system can run on
any machines supporting Windows and works on the best software and hardware that had been
used while designing the system so it would be feasible in all technical terms of feasibility.
Operational Feasibility:-
In the phase of operational feasibility study we apply different operation to the project. Collect the
record, save the data, delete, update information, and search the information.
To design the Hospital Management software we have gather the information about processing and
other details related patient.
Information Gathering:
We have used following technique to gather information about the salary system.
Interviewing:
We had multiple round of interview with staff of alldepartments for patient details.
Questionnaire:
We have design the questionnaire to get the every aspect of software they actually need.
Software and hardware Requirement
Every successful running of project needs to be run on a particular specification. For the proposed
software following are the requirements with regard to hardware and software.
Hardware requirements:
MEMORY 120MB
HARD DISK 80 GB
Software requirements:
Login Table
Doctor InfoTable
Staff InfoTable
Data Flow Diagram
Welcome Form
Login Form
Main Form
Patient RegistrationForm
Patient Information Form
Doctor Form
Staff Information
User Information
Welcome Form
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
/**
*/
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
/**
*/
public name() {
setUndecorated(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setContentPane(contentPane);
contentPane.setLayout(null);
contentPane.add(lblNewLabel);
contentPane.add(panel);
lblNewLabel_2.setIcon(new ImageIcon("C:\\Users\\Divya\\workspace\\clinic\\project
img\\14.png"));
contentPane.add(lblNewLabel_2);
contentPane.add(lblNewLabel_1);
contentPane.add(lblNewLabel_3);
contentPane.add(lblNewLabel_4);
contentPane.add(lblDrmamtaBhura);
contentPane.add(lblColdEar);
contentPane.add(lblMbbsMddermatologykanpur);
contentPane.add(lblMonsat);
contentPane.add(lblAmto);
contentPane.add(lblAmto_1);
contentPane.add(lblNewLabel_5);
contentPane.add(label);
contentPane.add(lblAmto_2);
contentPane.add(label_1);
contentPane.add(lblTiming);
contentPane.add(lblAddressDehradunRoad);
contentPane.add(lblAddress);
contentPane.add(label_2);
contentPane.add(label_3);
contentPane.add(lblPhone);
contentPane.add(label_4);
contentPane.add(lblPhone_1);
contentPane.add(lblPresentationBy);
contentPane.add(lblBeenadivyameerapayalseema);
contentPane.add(lblBscit);
btnNewButton.addActionListener(new ActionListener() {
login.main(new String[]{});
});
btnNewButton.setIcon(new ImageIcon("C:\\Users\\Divya\\workspace\\clinic\\project
img\\25.png"));
contentPane.add(btnNewButton);
lblNewLabel_6.setIcon(new ImageIcon("C:\\Users\\Divya\\workspace\\clinic\\project
img\\pqsCZy.jpg"));
contentPane.add(lblNewLabel_6);
Login Form
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.Window;
import java.sql.*;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Dimension;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.Point;
import javax.swing.ImageIcon;
import java.awt.Color;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class login extends JFrame {
/**
*/
/**
*database connectivity.
*/
EventQueue.invokeLater(new Runnable() {
try {
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
/**
*/
public login() {
setUndecorated(true);
addWindowListener(new WindowAdapter() {
@Override
});
setTitle("clinic");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setContentPane(contentPane);
contentPane.setLayout(null);
btnX.addActionListener(new ActionListener() {
System.exit(0);
});
btnX.setToolTipText("Close");
contentPane.add(btnX);
contentPane.add(lblUsername);
contentPane.add(lblPassword);
text1 = new JTextField();
contentPane.add(text1);
text1.setColumns(10);
contentPane.add(text2);
btnLogin.addActionListener(new ActionListener() {
try{
Connection conn;
Statement smt;
System.out.println("Connected");
int i = 0;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection("jdbc:odbc:clinicdb","","");
System.out.println("Connected db");
smt = conn.createStatement();
ResultSet rs = smt.executeQuery(sql);
while(rs.next()){
String pd = rs.getString("Password");
window.frame.setVisible(true);
i=2;
break;
}
}
if(i==0){
System.out.println("Not Matched");
catch(SQLException e){
System.out.println("Not Connected");
} catch (ClassNotFoundException e) {
e.printStackTrace();
});
btnLogin.setBackground(Color.WHITE);
contentPane.add(btnLogin);
btnReset.setBackground(Color.WHITE);
btnReset.addActionListener(new ActionListener() {
text1.setText(null);
text2.setText(null);
});
contentPane.add(btnReset);
lblNewLabel.setIcon(new ImageIcon("C:\\Users\\Divya\\workspace\\clinic\\project
img\\user_add.png"));
contentPane.add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("");
lblNewLabel_1.setIcon(new ImageIcon("C:\\Users\\Divya\\workspace\\clinic\\project
img\\lock-24-20.png"));
contentPane.add(lblNewLabel_1);
}
Main Menu
import java.awt.EventQueue;
import javax.swing.JFrame;
import java.awt.Dimension;
import javax.swing.JDesktopPane;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import java.awt.Color;
import java.awt.Font;
import javax.swing.ImageIcon;
JFrame frame;
/**
EventQueue.invokeLater(new Runnable() {
try {
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
/**
*/
public menu() {
initialize();
/**
frame.setUndecorated(true);
frame.setResizable(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
frame.getContentPane().add(dp);
btnPatient.setIcon(new ImageIcon("C:\\Users\\Divya\\workspace\\clinic\\project
img\\preg.png"));
btnPatient.addActionListener(new ActionListener() {
dp.removeAll();
preg f1 = new preg();
dp.add(f1);
f1.show();
});
frame.getContentPane().add(btnPatient);
btnPatientInformation.addActionListener(new ActionListener() {
dp.removeAll();
dp.add(f1);
f1.show();
}
});
btnPatientInformation.setIcon(new
ImageIcon("C:\\Users\\Divya\\workspace\\clinic\\project img\\4.png"));
frame.getContentPane().add(btnPatientInformation);
btnDocter.addActionListener(new ActionListener() {
dp.removeAll();
dp.add(f1);
f1.show();
});
btnDocter.setIcon(new ImageIcon("C:\\Users\\Divya\\workspace\\clinic\\project
img\\2.png"));
btnDocter.setFont(new Font("Times New Roman", Font.BOLD, 18));
frame.getContentPane().add(btnDocter);
btnUserInformation.addActionListener(new ActionListener() {
dp.removeAll();
dp.add(f1);
f1.show();
});
btnUserInformation.setIcon(new ImageIcon("C:\\Users\\Divya\\workspace\\clinic\\project
img\\6.png"));
frame.getContentPane().add(btnUserInformation);
JButton btnStaffInformation = new JButton("Staff Information");
btnStaffInformation.addActionListener(new ActionListener() {
dp.removeAll();
dp.add(f1);
f1.show();
});
frame.getContentPane().add(btnStaffInformation);
btnStaffInformation.setIcon(new ImageIcon("C:\\Users\\Divya\\workspace\\clinic\\project
img\\5.png"));
btnLogout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
System.exit(0);
});
frame.getContentPane().add(btnLogout);
btnNewButton_1.addActionListener(new ActionListener() {
login.main(new String[]{});
});
btnNewButton_1.setIcon(new ImageIcon("C:\\Users\\Divya\\workspace\\clinic\\project
img\\left.jpg"));
frame.getContentPane().add(btnNewButton_1);
JButton button_1 = new JButton("x");
button_1.addActionListener(new ActionListener() {
System.exit(0);
});
button_1.setToolTipText("Close");
frame.getContentPane().add(button_1);
btnNewButton_2.addActionListener(new ActionListener() {
window.frame.setVisible(true);
});
frame.getContentPane().add(btnNewButton_2);
}
}
Registration Form
import java.awt.EventQueue;
import javax.swing.JInternalFrame;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import java.awt.Font;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
public class preg extends JInternalFrame {
String Gender;
PreparedStatement psmt;
/**
*/
EventQueue.invokeLater(new Runnable() {
try {
} catch (Exception e) {
e.printStackTrace();
});
/**
*/
public preg() {
getContentPane().setLayout(null);
getContentPane().add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel(" Registration No.");
getContentPane().add(lblNewLabel_1);
getContentPane().add(lblPatientName);
getContentPane().add(lblRegistrationDate);
getContentPane().add(lblAddress);
t1 = new JTextField();
getContentPane().add(t1);
t1.setColumns(10);
t2 = new JTextField();
getContentPane().add(t2);
t2.setColumns(10);
t3 = new JTextField();
getContentPane().add(t3);
t3.setColumns(10);
t4 = new JTextField();
getContentPane().add(t4);
t4.setColumns(10);
JLabel lblCity = new JLabel(" City");
getContentPane().add(lblCity);
getContentPane().add(lblGender);
getContentPane().add(lblPhone);
t5 = new JTextField();
t5.setColumns(10);
getContentPane().add(t5);
t8 = new JTextField();
t8.setFont(new Font("Times New Roman", Font.BOLD, 14));
t8.setColumns(10);
getContentPane().add(t8);
btnNewButton.addActionListener(new ActionListener() {
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:clinicdb","","");
JOptionPane.showMessageDialog(null,"database Connected");
catch(Exception e){
try{
psmt=con.prepareStatement("insert into PatientRg(Rnum, Rname, Rdate, City, Gender,
Address,Phone) values(?,?,?,?,?,?,?)");
psmt.setString(1,t1.getText());
psmt.setString(2,t2.getText());
psmt.setString(3,t3.getText());
psmt.setString(4,t4.getText());
psmt.setString(5,Gender);
psmt.setString(6,t5.getText());
psmt.setString(7,t8.getText());
JOptionPane.showMessageDialog(null,"data submit");
psmt.executeQuery();
}catch(SQLException e ){
});
getContentPane().add(btnNewButton);
JButton btnEdit = new JButton("Reset");
btnEdit.addActionListener(new ActionListener() {
t1.setText(null);
t2.setText(null);
t3.setText(null);
t4.setText(null);
t5.setText(null);
t8.setText(null);
});
getContentPane().add(btnEdit);
btnExit.addActionListener(new ActionListener() {
window.frame.setVisible(true);
}
});
getContentPane().add(btnExit);
rdbtnFemale.addActionListener(new ActionListener() {
Gender="Female";
});
buttonGroup.add(rdbtnFemale);
getContentPane().add(rdbtnFemale);
rdbtnMale.addActionListener(new ActionListener() {
});
buttonGroup.add(rdbtnMale);
getContentPane().add(rdbtnMale);
getContentPane().add(label);
Information Form
import java.awt.EventQueue;
import javax.swing.JInternalFrame;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import java.awt.Font;
import java.awt.Color;
import javax.swing.ImageIcon;
import javax.swing.JTextField;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
String Gender;
private final ButtonGroup buttonGroup = new ButtonGroup();
PreparedStatement psmt;
Connection con;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
pimformation frame = new pimformation();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public pimformation() {
getContentPane().setBackground(new Color(192, 192, 192));
p1 = new JTextField();
p1.setFont(new Font("Times New Roman", Font.BOLD, 14));
p1.setBounds(701, 193, 178, 26);
getContentPane().add(p1);
p1.setColumns(10);
p2 = new JTextField();
p2.setFont(new Font("Times New Roman", Font.BOLD, 14));
p2.setBounds(701, 261, 178, 26);
getContentPane().add(p2);
p2.setColumns(10);
p4 = new JTextField();
p4.setFont(new Font("Times New Roman", Font.BOLD, 14));
p4.setBounds(1136, 200, 189, 26);
getContentPane().add(p4);
p4.setColumns(10);
p5 = new JTextField();
p5.setFont(new Font("Times New Roman", Font.BOLD, 14));
p5.setBounds(1136, 264, 189, 26);
getContentPane().add(p5);
p5.setColumns(10);
p6 = new JTextField();
p6.setFont(new Font("Times New Roman", Font.BOLD, 14));
p6.setBounds(1136, 325, 189, 26);
getContentPane().add(p6);
p6.setColumns(10);
p7 = new JTextField();
p7.setFont(new Font("Times New Roman", Font.BOLD, 14));
p7.setBounds(1136, 385, 189, 26);
getContentPane().add(p7);
p7.setColumns(10);
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:clinicdb","","");
JOptionPane.showMessageDialog(null,"database
Connected");
}catch(Exception e){
}
try{
String pid,pna,gen,ag,pn,add,dis,chk;
pid=p1.getText();
pna=p2.getText();
gen=Gender;
ag=p3.getText();
pn=p4.getText();
add=p5.getText();
dis=p6.getText();
chk=p7.getText();
psmt=con.prepareStatement("update PatientInformation
set Pname='"+ pna +"', Gender='"+ gen +"' ,Age='" + ag +"', Phone='" + pn +"',
Address='"+ add +"', Diseses='" + dis +"', CheckIn='" + chk +"' where Pid="+ pid
);
psmt.executeUpdate();
JOptionPane.showMessageDialog(null,"Updated");
p2.setText("");
p3.setText("");
p4.setText("");
p5.setText("");
p6.setText("");
p7.setText("");
p1.setText("");
}catch(SQLException g2){
JOptionPane.showMessageDialog(null,g2.toString());
}
}
});
button_1.setForeground(new Color(128, 0, 128));
button_1.setFont(new Font("Times New Roman", Font.BOLD, 20));
button_1.setBounds(676, 470, 104, 33);
getContentPane().add(button_1);
Gender="Female";
}
});
buttonGroup.add(rdbtnFemale);
Gender="Male";
}
});
buttonGroup.add(rdbtnMale);
getContentPane().add(rdbtnMale);
p3 = new JTextField();
p3.setFont(new Font("Times New Roman", Font.BOLD, 14));
p3.setColumns(10);
p3.setBounds(701, 385, 178, 26);
getContentPane().add(p3);
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con =
DriverManager.getConnection("jdbc:odbc:clinicdb","","");
JOptionPane.showMessageDialog(null,"database
Connected");
}catch(Exception e){
}
try{
psmt.execute();
}catch(SQLException e){
}
});
btnDelete.setForeground(new Color(128, 0, 128));
btnDelete.setFont(new Font("Times New Roman", Font.BOLD, 20));
btnDelete.setBounds(932, 470, 104, 33);
getContentPane().add(btnDelete);
try{
String cId;
cId=(textField.getText());
psmt=con.prepareStatement("select*from Table1
where Name=?");
psmt.setString(1,cId);
rs=psmt.executeQuery();
if(rs.next())
{
textField.setText(rs.getString(1));
textField_1.setText(rs.getString(2));
}
else
{
JOptionPane.showMessageDialog(null,"
Record not found");
}
con.close();
psmt.close();
}
});
btnSearch.setForeground(new Color(128, 0, 128));
btnSearch.setFont(new Font("Times New Roman", Font.BOLD, 20));
btnSearch.setBounds(306, 301, 104, 33);
getContentPane().add(btnSearch);
}
}
}
Doctor Search Form
import java.awt.EventQueue;
import javax.swing.JInternalFrame;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import java.awt.Font;
import java.awt.Color;
import javax.swing.JTextField;
import javax.swing.ImageIcon;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
String Gender;
PreparedStatement psmt;
Connection con;
/**
*/
EventQueue.invokeLater(new Runnable() {
try {
} catch (Exception e) {
e.printStackTrace();
});
/**
*/
public doctor() {
getContentPane().setLayout(null);
label.setBackground(Color.LIGHT_GRAY);
getContentPane().add(label);
getContentPane().add(lblDoctor);
getContentPane().add(lblName);
d1 = new JTextField();
d1.setColumns(10);
getContentPane().add(d1);
d2 = new JTextField();
d2.setColumns(10);
getContentPane().add(d2);
d3 = new JTextField();
d3.setColumns(10);
getContentPane().add(lblAge);
getContentPane().add(lblContactNo);
getContentPane().add(lblId);
d4 = new JTextField();
d4.setColumns(10);
getContentPane().add(d4);
d5 = new JTextField();
d5.setColumns(10);
getContentPane().add(d5);
getContentPane().add(lblDepartment);
getContentPane().add(lblGender);
rdbtnFemale.addActionListener(new ActionListener() {
Gender="Female";
}
});
buttonGroup.add(rdbtnFemale);
getContentPane().add(rdbtnFemale);
rdbtnMale.addActionListener(new ActionListener() {
Gender="Male";
});
buttonGroup.add(rdbtnMale);
getContentPane().add(rdbtnMale);
getContentPane().add(btnReset);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:clinicdb","","");
JOptionPane.showMessageDialog(null,"database Connected");
}catch(Exception e){
try{
String did,dna,dag,dpn,dadd,genn;
dna=d4.getText();
dadd=d5.getText();
dag=d2.getText();
dpn=d3.getText();
genn=Gender;
did=d1.getText();
psmt=con.prepareStatement("update DoctorInfo set DName='"+
dna +"', Department='"+ dadd +"', Gender='" + genn +"' ,Age='" + dag +"', ContactNo='" + dpn +"' where
DId="+ did );
psmt.executeUpdate();
JOptionPane.showMessageDialog(null,"Updated");
d4.setText("");
d5.setText("");
d2.setText("");
d3.setText("");
d1.setText("");
}catch(SQLException g2){
JOptionPane.showMessageDialog(null,g2.toString());
});
getContentPane().add(button);
btnAdd.addActionListener(new ActionListener() {
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:clinicdb","","");
JOptionPane.showMessageDialog(null,"database Connected");
}catch(Exception e){
try{
psmt=con.prepareStatement("insert into
DoctorInfo(DId,Age,ContactNo,Dname,Department,Gender) values(?,?,?,?,?,?)");
psmt.setString(1,d1.getText());
psmt.setString(2,d2.getText());
psmt.setString(3,d3.getText());
psmt.setString(4,d4.getText());
psmt.setString(6,Gender);
psmt.setString(5,d5.getText());
JOptionPane.showMessageDialog(null,"data submit");
psmt.executeQuery();
}catch(SQLException e ){
});
getContentPane().add(btnAdd);
button_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
window.frame.setVisible(true);
});
getContentPane().add(button_1);
getContentPane().add(lblInputDoctorsId);
d6 = new JTextField();
d6.setColumns(10);
getContentPane().add(d6);
try{
String cId;
cId=(d6.getText());
psmt.setString(1,cId);
ResultSet rs = psmt.executeQuery();
if(rs.next())
d1.setText(rs.getString(1));
d2.setText(rs.getString(2));
d3.setText(rs.getString(3));
d4.setText(rs.getString(4));
d5.setText(rs.getString(5));
else
{
JOptionPane.showMessageDialog(null," Record not
found");
con.close();
psmt.close();
}catch(SQLException e2 )
System.out.println("error");
});
getContentPane().add(button_3);
}
Staff Form
import java.awt.EventQueue;
import javax.swing.JInternalFrame;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import java.awt.Font;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
public class staff extends JInternalFrame {
String Gender;
PreparedStatement psmt;
Connection con;
/**
*/
EventQueue.invokeLater(new Runnable() {
try {
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
/**
*/
public staff() {
getContentPane().setLayout(null);
getContentPane().add(label);
getContentPane().add(lblStaffInformation);
JLabel lblInputStaffsName = new JLabel(" Input Staff's Name");
getContentPane().add(lblInputStaffsName);
textField.setColumns(10);
getContentPane().add(textField);
getContentPane().add(lblId);
getContentPane().add(lblName);
JLabel lblGender = new JLabel(" Gender");
getContentPane().add(lblGender);
s1 = new JTextField();
s1.setColumns(10);
getContentPane().add(s1);
s2 = new JTextField();
s2.setColumns(10);
getContentPane().add(s2);
getContentPane().add(lblPosition);
getContentPane().add(lblSalary);
getContentPane().add(lblContactNo);
getContentPane().add(lblAddress);
s3 = new JTextField();
s3.setColumns(10);
getContentPane().add(s3);
s4 = new JTextField();
getContentPane().add(s4);
s5 = new JTextField();
s5.setColumns(10);
getContentPane().add(s5);
s6 = new JTextField();
s6.setColumns(10);
getContentPane().add(s6);
btnAdd.addActionListener(new ActionListener() {
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:clinicdb","","");
JOptionPane.showMessageDialog(null,"database Connected");
}catch(Exception e){
try{
psmt=con.prepareStatement("insert into
StaffInformation(SId,Sname,Gender,Position,Salary,Phone,Address) values(?,?,?,?,?,?,?)");
psmt.setString(1,s1.getText());
psmt.setString(2,s2.getText());
psmt.setString(3,Gender);
psmt.setString(4,s3.getText());
psmt.setString(5,s4.getText());
psmt.setString(6,s5.getText());
psmt.setString(7,s6.getText());
JOptionPane.showMessageDialog(null,"data submit");
psmt.executeQuery();
}catch(SQLException e ){
});
getContentPane().add(btnAdd);
btnUpdate.addActionListener(new ActionListener() {
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:clinicdb","","");
JOptionPane.showMessageDialog(null,"database Connected");
}catch(Exception e1){
JOptionPane.showMessageDialog(null,"not Connected");
try{
String sid,sna,gen,pos,sal,ph,addr;
sid=s1.getText();
sna=s2.getText();
gen=Gender;
pos=s3.getText();
sal=s4.getText();
ph=s5.getText();
addr=s6.getText();
psmt.executeUpdate();
JOptionPane.showMessageDialog(null,"Updated");
s2.setText("");
s3.setText("");
s4.setText("");
s5.setText("");
s6.setText("");
s1.setText("");
}catch(SQLException g2){
JOptionPane.showMessageDialog(null,g2.toString());
});
getContentPane().add(btnUpdate);
rdbtnFemale.addActionListener(new ActionListener() {
Gender="Female";
}
});
buttonGroup.add(rdbtnFemale);
getContentPane().add(rdbtnFemale);
rdbtnMale.addActionListener(new ActionListener() {
Gender="Male";
});
buttonGroup.add(rdbtnMale);
getContentPane().add(rdbtnMale);
getContentPane().add(button);
button_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
window.frame.setVisible(true);
});
getContentPane().add(button_1);
}
User Info Form
import java.awt.EventQueue;
import javax.swing.AbstractButton;
import javax.swing.JInternalFrame;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import java.awt.Font;
import java.awt.Panel;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.swing.JPanel;
import javax.swing.JTextField;
PreparedStatement psmt;
Connection con;
/**
*/
EventQueue.invokeLater(new Runnable() {
try {
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
});
/**
*/
public userinfor() {
getContentPane().setBackground(new Color(192, 192, 192));
getContentPane().setLayout(null);
getContentPane().add(lblUserInformation);
btnNew.addActionListener(new ActionListener() {
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:clinicdb","","");
JOptionPane.showMessageDialog(null,"database Connected");
}catch(Exception e){
}
try{
psmt=con.prepareStatement("insert into
login(UserName,Password) values(?,?)");
psmt.setString(1,text1.getText());
psmt.setString(2,text2.getText());
JOptionPane.showMessageDialog(null,"data submit");
psmt.executeQuery();
}catch(SQLException e ){
});
getContentPane().add(btnNew);
JButton btnClose = new JButton("Close");
btnClose.addActionListener(new ActionListener() {
System.exit(0);
});
getContentPane().add(btnClose);
label.setBackground(Color.LIGHT_GRAY);
getContentPane().add(label);
getContentPane().add(lblNewLabel);
JLabel lblUserName = new JLabel(" User Name");
getContentPane().add(lblUserName);
textField.setColumns(10);
getContentPane().add(textField);
textField_1.setColumns(10);
getContentPane().add(textField_1);
getContentPane().add(lblPassword);
JButton button = new JButton("Exit");
button.addActionListener(new ActionListener() {
window.frame.setVisible(true);
});
getContentPane().add(button);
}
System Testing:-
The aim of testing process is to identify all defects existing in a software product. But it provides a
practical way of reducing defects in a system and increasing the user’s confidence in a developed
system.
There are several factors that results in errors but three main areas:
Communication between the user and the designer.
The programmer’s ability to generate a code that reflects exactly the system
specification.
The time frame for the design.
Verification and validation
Verification is the process of determining whether the output of one phase of software development
conforms to that of its previousphase.
Validation is the process of determining whether a fully developed system conforms to its
requirements specification.
Verification and Validation are important part of testing process. Verification and validation mustbe
checked for accurate and efficient flow of software.
The effects of the system errors on the files and records with in the system .some tests which we did
to make our project error free are as follows:
Volume Testing:-
In this test, we create as many records as many records as world normally be produce to
verify that the hardware and software will function correctly.
The purpose of stress testing is to prove that candidate system does not malfunction under peak
loads. Unlike volume testing, where time is not a factor, we subject to a high volume of data cover
time period.
Current Problems
The current system is very time consuming.
It is very difficult to analyze the record manually.
Which doctors is allocated the which patient
Results are not precise as calculation and evaluations are done manually.
The chances of paper leakage are more in current system as compared to proposed system.
Billing and medicine Stock processing takes more time as it is done manually.
The proposed system is Hospital Management System. We can enhance this system by including
more facilities like billing system, inpatient room allotment for the admitted patients and the stock
details of medicines in the pharmacy. Providing such features enable the users to include more
comments into the system.
Bibliography
www.Wikipedia.com
www.google.com
www.Microsoft.com