0% found this document useful (0 votes)
43 views

SUNIL CS PROJECT 12YH

Uploaded by

yogeshjat004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

SUNIL CS PROJECT 12YH

Uploaded by

yogeshjat004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

CERTIFICATE

This is to certify that SUNIL KUMAR KUMAWAT


class: XII A of PM SHRI JAWAHAR NAVODAYA
VIDYALAYA HURDA BHILWARA has done his
project on HOSPITAL MANAGEMENT SYSTEM
under my supervision. He has taken interest and
has shown at most sincerity in completion of this
project. I certify this project up to my expectation
& as per guidelines issued by CBSE, NEW
DELHI.

Internal Examiner External


Examiner

Principal
ACKNOWLEDGMENT
It is with pleasure that I acknowledge my
sincere gratitude to our teacher, MR.
YOGESH KUMAR NAMA who taught and
undertook the responsibility of teaching the
subject computer science. I have been
greatly benefited from his classes. I am
especially indebted to our Principal MR.
MOHAN MEGHWAL who has always been a
source of encouragement and support and
without whose inspiration this project would
not have been a successful I would like to
place on record heartfelt thanks to him.
Finally, I would like to express my sincere
appreciation for all the other students for my
batch their friendship & the fine time that we
all shared together
HARDWARE AND SOFTWARE REQUIRED:
HARDWARE
1. PC

2. MOBILE PHONE

SOFTWARE
• PYTHON (latest version)

• MYSQL

• PYTHON CONNECTOR
HOSPITAL
A hospital is a health care institution providing patient
treatment with specialized staff and equipment. Hospital are
usually funded by public sector by health organizations (for
profit or non-profit), by health insurance companies, or by
departments (e.g. , surgery, and urgent care etc).

HOSPITAL MANAGEMENT SYSTEM


A hospital management system is an information system that
manages the aspects of a hospital. This may include the
administrative, financial, and medical processing. It is an
integrated end-to-end Hospital Management System that
provides relevant information across the hospital to support
effective decision making for patient care, hospital
administration and critical financial accounting, In a seamless
flow. This program can look after Inpatients, OPD patients,
records, database. treatment, status illness, billing etc. it also
maintains their hospital info such as ward id, Doctor in
charge, Department administering etc.
NEED OF HMS :-
1. Minimized documentation and no duplication of records.
2. Reduced paper work.
3. Improved patient care
4. Better Administration Control
5. Faster information flow between various departments
6. Smart Revenue Management
7. Effective billing of various services
8. Exact stock information
INTRODUCATION
The project Hospital Management System includes registration of patients,
storing their details into the system. The software has the 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 a
patient using the id. The Hospital 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. The
purpose of the project entitled as “HOSPITAL MANAGEMENT SYSTEM” is to
computerize the Front Office Management of Hospital to develop software
which is user friendly, simple, fast, and cost-effective. It deals with the
collection of patient’s information, diagnosis details, etc., and also to
manipulate these details meaningfully System input contains patient details,
diagnosis details; while system output is to get these details on to the screen.
EXISTING SYSTEM
❖In today’s world if someone wants to book a Doctor’s
Appointment we need to call in clinic or personally go to that place
and book the appointment.
❖This consumes precious time of the patient. Also if the doctor
cancels his /her schedule, the patient does not come to know about
it unless he/she goes to the clinic.

DISADVANTAGES OF EXISTING SYSTEM


1. Lack of privacy
2. Risk in the management of the data.
3. Less security
4. Less user-friendly
5. Accuracy nor guaranteed
6. Not in reach of distant users.
7. There is no storage and automation if users have some enquiry.
ADVANTAGES OF HMS
➢ Less paperwork
➢ Costs Reduction
➢ Improves patient’s experience
➢ Improve data security
➢ Better collaboration & Communication
➢ Analytic anytime anywhere
MODULE LIST

ADMIN
• ADD PATIENTS

• ADD STAFF

• VIEW PATIENTS RECORD

• VIEW STAFF RECORD

• CHANGE PASSWORD

• REMOVE PATIENTS

• REMOVE STAFF

• UPDATE PATIENT

• UPDATE STAFF INFORMATION

• ADD DOCTOR

• REMOVE DOCTOR

• CHECK DOCTOR JOB STATUS

PATIENT
• BOOK APPOINTMENT

• FIND DOCTOR

• VIEW DOCTOR PROFILE

DOCTER
• LOGIN

• APPLY JOB

• VIEW APPOINTMENT
import tkinter as tk
from tkinter import messagebox, ttk
import mysql.connector
from datetime import date

# MySQL connection
def connect_to_database():
return mysql.connector.connect(
host="localhost",
user="root", # Replace with your MySQL username
password="root", # Replace with your MySQL password
database="eprescription"
)

# Add Prescription
def add_prescription():
try:
conn = connect_to_database()
cursor = conn.cursor()

patient_name = entry_name.get()
age = entry_age.get()
gender = gender_var.get()
contact = entry_contact.get()
diagnosis = entry_diagnosis.get("1.0", tk.END).strip()
medicine = entry_medicine.get("1.0", tk.END).strip()
prescription_date = date.today()

if not (patient_name and age and gender and contact and diagnosis and
medicine):
messagebox.showerror("Error", "All fields are required!")
return

query = "INSERT INTO prescriptions (patient_name, age, gender, contact,


diagnosis, medicine, prescription_date) VALUES (%s, %s, %s, %s, %s, %s, %s)"
data = (patient_name, age, gender, contact, diagnosis, medicine,
prescription_date)

cursor.execute(query, data)
conn.commit()
conn.close()

messagebox.showinfo("Success", "Prescription added successfully!")


clear_entries()
view_prescriptions()
except Exception as e:
messagebox.showerror("Error", f"Something went wrong: {e}")

# View All Prescriptions


def view_prescriptions():
try:
conn = connect_to_database()
cursor = conn.cursor()
cursor.execute("SELECT * FROM prescriptions")
rows = cursor.fetchall()
conn.close()

for row in tree.get_children():


tree.delete(row)

for row in rows:


tree.insert("", tk.END, values=row)
except Exception as e:
messagebox.showerror("Error", f"Something went wrong: {e}")

# Search Prescription by Name


def search_prescription():
try:
name = entry_search.get()
if not name:
messagebox.showerror("Error", "Enter a patient name to search!")
return

conn = connect_to_database()
cursor = conn.cursor()
query = "SELECT * FROM prescriptions WHERE patient_name LIKE %s"
cursor.execute(query, (f"%{name}%",))
rows = cursor.fetchall()
conn.close()

for row in tree.get_children():


tree.delete(row)

for row in rows:


tree.insert("", tk.END, values=row)
except Exception as e:
messagebox.showerror("Error", f"Something went wrong: {e}")

# Delete Prescription
def delete_prescription():
try:
selected_item = tree.focus()
if not selected_item:
messagebox.showerror("Error", "Select a record to delete!")
return

record = tree.item(selected_item)["values"]
conn = connect_to_database()
cursor = conn.cursor()
query = "DELETE FROM prescriptions WHERE id = %s"
cursor.execute(query, (record[0],))
conn.commit()
conn.close()
messagebox.showinfo("Success", "Prescription deleted successfully!")
view_prescriptions()
except Exception as e:
messagebox.showerror("Error", f"Something went wrong: {e}")

# Update Prescription
def update_prescription():
try:
selected_item = tree.focus()
if not selected_item:
messagebox.showerror("Error", "Select a record to update!")
return

record = tree.item(selected_item)["values"]

patient_name = entry_name.get()
age = entry_age.get()
gender = gender_var.get()
contact = entry_contact.get()
diagnosis = entry_diagnosis.get("1.0", tk.END).strip()
medicine = entry_medicine.get("1.0", tk.END).strip()

if not (patient_name and age and gender and contact and diagnosis and
medicine):
messagebox.showerror("Error", "All fields are required!")
return

conn = connect_to_database()
cursor = conn.cursor()
query = """
UPDATE prescriptions
SET patient_name = %s, age = %s, gender = %s, contact = %s, diagnosis =
%s, medicine = %s
WHERE id = %s
"""
data = (patient_name, age, gender, contact, diagnosis, medicine,
record[0])
cursor.execute(query, data)
conn.commit()
conn.close()

messagebox.showinfo("Success", "Prescription updated successfully!")


clear_entries()
view_prescriptions()
except Exception as e:
messagebox.showerror("Error", f"Something went wrong: {e}")

# Print Prescription
def print_prescription():
try:
selected_item = tree.focus()
if not selected_item:
messagebox.showerror("Error", "Select a record to print!")
return
record = tree.item(selected_item)["values"]
details = (
f"JNV MI ROOM\n\n"
f"Patient Name: {record[1]}\n"
f"Age: {record[2]}\n"
f"Gender: {record[3]}\n"
f"Contact: {record[4]}\n"
f"Diagnosis: {record[5]}\n"
f"Medicines: {record[6]}\n"
f"Date: {record[7]}\n"
)
messagebox.showinfo("Prescription", details)
except Exception as e:
messagebox.showerror("Error", f"Something went wrong: {e}")

# Clear Input Fields


def clear_entries():
entry_name.delete(0, tk.END)
entry_age.delete(0, tk.END)
gender_var.set("")
entry_contact.delete(0, tk.END)
entry_diagnosis.delete("1.0", tk.END)
entry_medicine.delete("1.0", tk.END)

# GUI
root = tk.Tk()
root.title("E-Prescription System")
root.geometry("800x600")

# Styling
style = ttk.Style(root)
style.theme_use("clam")

# Input Fields
tk.Label(root, text="Patient Name").grid(row=0, column=0, padx=10, pady=5)
entry_name = tk.Entry(root)
entry_name.grid(row=0, column=1, padx=10, pady=5)

tk.Label(root, text="Age").grid(row=1, column=0, padx=10, pady=5)


entry_age = tk.Entry(root)
entry_age.grid(row=1, column=1, padx=10, pady=5)

tk.Label(root, text="Gender").grid(row=2, column=0, padx=10, pady=5)


gender_var = tk.StringVar()
gender_menu = ttk.Combobox(root, textvariable=gender_var, values=["Male",
"Female", "Other"], state="readonly")
gender_menu.grid(row=2, column=1, padx=10, pady=5)

tk.Label(root, text="Contact").grid(row=3, column=0, padx=10, pady=5)


entry_contact = tk.Entry(root)
entry_contact.grid(row=3, column=1, padx=10, pady=5)

tk.Label(root, text="Diagnosis").grid(row=4, column=0, padx=10, pady=5)


entry_diagnosis = tk.Text(root, height=3, width=30)
entry_diagnosis.grid(row=4, column=1, padx=10, pady=5)

tk.Label(root, text="Medicines").grid(row=5, column=0, padx=10, pady=5)


entry_medicine = tk.Text(root, height=3, width=30)
entry_medicine.grid(row=5, column=1, padx=10, pady=5)

# Search Field
tk.Label(root, text="Search by Name").grid(row=0, column=2, padx=10, pady=5)
entry_search = tk.Entry(root)
entry_search.grid(row=0, column=3, padx=10, pady=5)
btn_search = tk.Button(root, text="Search", command=search_prescription)
btn_search.grid(row=0, column=4, padx=10, pady=5)

# Buttons
btn_add = tk.Button(root, text="Add", command=add_prescription)
btn_add.grid(row=6, column=0, pady=10)

btn_update = tk.Button(root, text="Update", command=update_prescription)


btn_update.grid(row=6, column=1, pady=10)

btn_delete = tk.Button(root, text="Delete", command=delete_prescription)


btn_delete.grid(row=6, column=2, pady=10)

btn_print = tk.Button(root, text="Print", command=print_prescription)


btn_print.grid(row=6, column=3, pady=10)

btn_view = tk.Button(root, text="View All", command=view_prescriptions)


btn_view.grid(row=6, column=4, pady=10)

# Treeview for Display


columns = ("ID", "Name", "Age", "Gender", "Contact", "Diagnosis", "Medicines",
"Date")
tree = ttk.Treeview(root, columns=columns, show="headings")
tree.grid(row=7, column=0, columnspan=5, pady=10, sticky="nsew")

for col in columns:


tree.heading(col, text=col)
tree.column(col, width=100)

# Run the application


root.mainloop()

You might also like