Beruflich Dokumente
Kultur Dokumente
PROJECT 754
HOSPITAL MANAGEMENT SYSTEM
BY:SAURABH SRIVASTAVA
B.Tech final year
Computer science &
Engineering
0725710049
PROJECT TITLE
HOSPITAL MANAGEMENT
SYSTEM
INTRODUCTION
HOSPITAL MANAGEMENT SYSTEM is a
computerized management system. This
management system has been developed to form
whole management system including Employees,
Doctors, Nurses, Patients, Bills, and Complains etc.
The proposed system will keep a track of
Employees, Doctors, Patients, Accounts and
generation of report regarding the present status.
Health of citizen is the wealth of Nation. By using
the cutting edge technologies, Hospital
Management can be improved with efficient work
flow and communication. Details of the Patients,
their previous visits etc. are totally not perceptible
without a computer. Relevant Informations are
always stored in the computer and are available
instantly in front of the user.
OBJECTIVES
The project Hospital Management System is
aimed to develop to maintain the day-to-day state
of admission/discharge of Patients, List of Doctors,
List of medicines, Bills etc.
TOOLS USED
SOFTWARE:
:
:
:
C# & .NET
MS-OFFICE
VISUAL STUDIO
WINDOWS XP,
SQL SERVER
HARDWARE:
PROCESSOR
RAM
HDD
: Core 2 Duo
: 3 GB
: 250 GB
ANALYSIS
HMS
: context diagram
REGISTRATIO
RECEPTION
REGIST
ER
DOCTOR
GET STATUS
DISCHARGE
1 LEVEL DFD
MODULE DESCRIPTION
There are five major modules which are being
focused in the project.
First module is IPD (enrolment patient detail)
SECURITY
As in todays world we need
security as a main purpose for
implementing any logic so as to
keep it safe.
Thus we need to authenticate the
user for using or accessing the
data of the hospital management
system and for that we provide a
USERNAME & PASSWORD to the
admin so to keep the data safe.
CODING
FORM 5
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace hospital_management
{
public partial class Form5 : Form
{
SqlDataAdapter ad = new SqlDataAdapter();
SqlConnection con = new SqlConnection();
public Form5()
{
InitializeComponent();
}
private void Form5_Paint(object sender, PaintEventArgs e)
{
SolidBrush sb = new SolidBrush(Color.Black);
SolidBrush s = new SolidBrush(Color.White);
Pen p = new Pen(sb, 1);
Graphics g = this.CreateGraphics();
Rectangle r = new Rectangle(1, 1, 461, 50);
Rectangle rr = new Rectangle(2, 2, 460, 49);
g.DrawRectangle(p, r);
g.FillRectangle(s, rr);
SolidBrush sb2 = new SolidBrush(Color.Purple);
SolidBrush s2 = new SolidBrush(Color.Magenta);
SolidBrush s3 = new SolidBrush(Color.GreenYellow);
String str = " HOSPITAL
MANAGEMENT
SYSTEM";
}
else
{
}
private void Form5_Load(object sender, EventArgs e)
{
con.ConnectionString = "data source=saurabh\\sqlexpress; initial
catalog=hospital; integrated security=true";
}
private void button2_Click(object sender, EventArgs e)
{
Form.ActiveForm.Close();
}
FORM 1
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace hospital_management
{
public partial class Form1 : Form
{
SqlConnection con = new SqlConnection();
SqlDataAdapter ad = new SqlDataAdapter();
DataSet ds = new DataSet();
public static string s;
public static string d;
public static string n;
public void clear()
{
textBox1.Text = null;
textBox2.Text = null;
textBox3.Text = null;
textBox4.Text = null;
textBox5.Text = null;
textBox6.Text = null;
textBox7.Text = null;
textBox8.Text = null;
textBox9.Text = null;
textBox18.Text = null;
textBox19.Text = null;
textBox20.Text = null;
textBox21.Text = null;
textBox22.Text = null;
textBox23.Text = null;
textBox24.Text = null;
textBox25.Text = null;
comboBox1.SelectedItem = null;
comboBox2.SelectedItem = null;
comboBox3.SelectedItem = null;
}
public Form1()
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
con.ConnectionString = "data source = saurabh\\sqlexpress; initial
catalog = hospital; integrated security = true";
}
private void button2_Click(object sender, EventArgs e)
{
try
{
s = textBox1.Text.ToString();
d = dateTimePicker1.Value.ToShortDateString();
n = textBox2.Text;
SqlCommand cmd = new SqlCommand();
con.Open();
cmd.CommandText = "insert patient values('" +
int.Parse(textBox1.Text) + "','" + textBox2.Text + "','" +
textBox3.Text + "','" + int.Parse(textBox4.Text) +
"','" + comboBox1.SelectedItem.ToString() + "','" +
dateTimePicker1.Value.ToShortDateString() + "','" +
textBox5.Text + "','" + textBox6.Text + "','" +
textBox7.Text + "','" + textBox8.Text + "','" +
textBox9.Text + "','IPD','FALSE')";
cmd.Connection = con;
cmd.ExecuteNonQuery();
button1.Enabled = true;
MessageBox.Show("inserted");
clear();
Form3 f = new Form3();
f.ShowDialog();
f.Close();
}
catch
{
// MessageBox.Show("Error Occured");
if (textBox1.Text == "")
errorProvider1.SetError(textBox1, "insert patient ID");
if (textBox2.Text == "")
errorProvider1.SetError(textBox2, "insert patient's
name");
if (textBox3.Text == "")
errorProvider1.SetError(textBox3, "insert patient father's
name");
if (textBox4.Text == "")
address");
if (textBox6.Text == "")
errorProvider1.SetError(textBox6, "insert patient's
contact no.");
if (textBox7.Text == "")
errorProvider1.SetError(textBox7, "insert reference");
if (textBox8.Text == "")
errorProvider1.SetError(textBox8, "insert patient's
room_no.");
if (textBox9.Text == "")
errorProvider1.SetError(textBox9, "insert custody");
if (comboBox1.SelectedItem == null)
errorProvider1.SetError(comboBox1, "select sex of the
patient");
else
{
}
}
finally
{
con.Close();
}
}
private void button1_Click(object sender, EventArgs e)
{
try
{
SqlCommand cmd = new SqlCommand();
int i = 0;
cmd.CommandText = "select max(p_id) from patient";
cmd.Connection = con;
con.Open();
i = (int)cmd.ExecuteScalar();
textBox1.Text = (i + 1).ToString();
button1.Enabled = false;
}
catch
{
MessageBox.Show("Error occured");
}
finally
{
con.Close();
}
}
private void button8_Click(object sender, EventArgs e)
{
try
{
s = textBox24.Text.ToString();
d = dateTimePicker3.Value.ToShortDateString();
n = textBox23.Text;
SqlCommand cmd = new SqlCommand();
con.Open();
cmd.CommandText = "insert patient values('" +
int.Parse(textBox24.Text) + "','" + textBox23.Text + "','" +
textBox22.Text + "','" + int.Parse(textBox21.Text) +
"','" + comboBox3.SelectedItem.ToString() + "','" +
dateTimePicker3.Value.ToShortDateString() + "','" +
textBox25.Text + "','" + textBox20.Text + "','" +
textBox19.Text + "','OPD PATIENT','" + textBox18.Text
+ "','OPD','OPD PATIENT')";
cmd.Connection = con;
cmd.ExecuteNonQuery();
MessageBox.Show("inserted");
clear();
button9.Enabled = true;
con.Close();
Form3 f = new Form3();
f.ShowDialog();
f.Close();
}
catch
{
// MessageBox.Show("Error Occured");
if (textBox24.Text == "")
errorProvider2.SetError(textBox24, "insert patient ID");
if (textBox23.Text == "")
errorProvider2.SetError(textBox23, "insert patient's
name");
if (textBox22.Text == "")
errorProvider2.SetError(textBox22, "insert patient
father's name");
if (textBox21.Text == "")
age");
if (textBox25.Text == "")
errorProvider2.SetError(textBox25, "insert patient
address");
contact no.");
if (textBox20.Text == "")
errorProvider2.SetError(textBox20, "insert patient's
if (textBox19.Text == "")
errorProvider2.SetError(textBox19, "insert reference");
if (textBox18.Text == "")
errorProvider2.SetError(textBox18, "insert custody");
if (comboBox3.SelectedItem == null)
errorProvider2.SetError(comboBox3, "select sex of the
patient");
}
private void button9_Click(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand();
int i = 0;
cmd.CommandText = "select max(p_id) from patient";
cmd.Connection = con;
con.Open();
i = (int)cmd.ExecuteScalar();
con.Close();
textBox24.Text = (i + 1).ToString();
button9.Enabled = false;
s = textBox24.Text.ToString();
d = dateTimePicker3.Value.ToShortDateString();
}
Graphics g = this.CreateGraphics();
g.DrawLine(p, 1, 400, 500, 400);
g.Dispose();
e.Handled = false;
e.Handled = true;
}
else
e.Handled = false;
}
private void textBox19_KeyPress(object sender, KeyPressEventArgs e)
{
Char pressedKey = e.KeyChar;
if (Char.IsPunctuation(pressedKey) || Char.IsNumber(pressedKey) ||
Char.IsSymbol(pressedKey))
{
e.Handled = true;
}
else
e.Handled = false;
}
private void textBox21_KeyPress(object sender, KeyPressEventArgs e)
{
Char pressedKey = e.KeyChar;
if (Char.IsSymbol(pressedKey) || char.IsSeparator(pressedKey) ||
char.IsPunctuation(pressedKey) || char.IsLetter(pressedKey))
{
e.Handled = true;
}
else
}
e.Handled = false;
}
}
}
try
{
}
catch { }
FORM 2
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Data.SqlClient;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace hospital_management
{
public partial class Form2 : Form
{
DataSet ds = new DataSet();
SqlDataAdapter ad = new SqlDataAdapter();
SqlConnection con = new SqlConnection();
public Form2()
{
InitializeComponent();
}
private void textBox1_KeyUp(object sender, KeyEventArgs e)
{
ds.Clear();
ad.SelectCommand = new SqlCommand();
ad.SelectCommand.CommandText = "select * from patient where p_name
like '" + textBox1.Text + "%'";
ad.SelectCommand.Connection = con;
con.Open();
ad.SelectCommand.ExecuteNonQuery();
con.Close();
ad.Fill(ds, "t1");
dataGridView1.DataSource = ds.Tables["t1"];
}
private void Form2_Load(object sender, EventArgs e)
{
con.ConnectionString = "data source=saurabh\\sqlexpress; initial
catalog=hospital; integrated security=true";
}
private void textBox3_KeyUp(object sender, KeyEventArgs e)
{
if (textBox3.Text==null)
MessageBox.Show("enter ID");
else
{
try
{
ds.Clear();
ad.SelectCommand = new SqlCommand();
ad.SelectCommand.CommandText = "select * from patient
where p_id='" + int.Parse(textBox3.Text) + "'";
ad.SelectCommand.Connection = con;
con.Open();
ad.SelectCommand.ExecuteNonQuery();
con.Close();
ad.Fill(ds, "t1");
dataGridView1.DataSource = ds.Tables["t1"];
}
catch { }//MessageBox.Show("error"); }
}
e)
ds.Clear();
ad.SelectCommand = new SqlCommand();
ad.SelectCommand.CommandText = "select * from patient where
p_status='" + comboBox1.SelectedItem.ToString()+ "'";
ad.SelectCommand.Connection = con;
con.Open();
ad.SelectCommand.ExecuteNonQuery();
con.Close();
ad.Fill(ds, "t1");
dataGridView1.DataSource = ds.Tables["t1"];
}
ds.Clear();
ad.SelectCommand = new SqlCommand();
ad.SelectCommand.CommandText = "select * from patient where
p_father like '" + textBox2.Text + "%'";
ad.SelectCommand.Connection = con;
con.Open();
ad.SelectCommand.ExecuteNonQuery();
con.Close();
ad.Fill(ds, "t1");
dataGridView1.DataSource = ds.Tables["t1"];
}
catch { }
}
private void textBox4_KeyUp(object sender, KeyEventArgs e)
{
try
{
ds.Clear();
ad.SelectCommand = new SqlCommand();
ad.SelectCommand.CommandText = "select * from patient where
room_no = '" + textBox4.Text + "'";
ad.SelectCommand.Connection = con;
con.Open();
ad.SelectCommand.ExecuteNonQuery();
con.Close();
ad.Fill(ds, "t1");
dataGridView1.DataSource = ds.Tables["t1"];
}
catch { }
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
FUTURE SCOPE