0% found this document useful (0 votes)
26 views26 pages

Hospital Management File by Parav Class 12th

The document outlines a project titled 'Hospital Management System' developed by Parav Kumar for the Class XII CBSE practical examination, utilizing Python for the front end and MySQL for the back end. The system aims to improve hospital operations by streamlining patient management, appointment scheduling, and doctor profiles, while also detailing hardware and software requirements. It includes programming code examples and features such as data validation, search functionality, and a user-friendly interface.
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)
26 views26 pages

Hospital Management File by Parav Class 12th

The document outlines a project titled 'Hospital Management System' developed by Parav Kumar for the Class XII CBSE practical examination, utilizing Python for the front end and MySQL for the back end. The system aims to improve hospital operations by streamlining patient management, appointment scheduling, and doctor profiles, while also detailing hardware and software requirements. It includes programming code examples and features such as data validation, search functionality, and a user-friendly interface.
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/ 26

PM SHREE

K.V AFS ARJANGARH

HOSPITAL MANAGEMENT SYSTEM

~Using Python(Front end) & MYSQL (Back end)~

SUBMITTED BY:
SUBMITTED to:
PARAV KUMAR
12th A Mrs. Vani
ROLL NO:17 Kochhar

1
This is tothcertify that PARAV KUMAR of
Class 12 has successfully completed
the project titled “Hospital Management
System using Python & MySQL” for the
Class XII CBSE practical examination of the
Central Board of Secondary Education in
the year 2024-25.

INTERNAL EXAMINER SIGN :

EXTERNAL EXAMINER SIGN :

PRINCIPAL SIGN :

2
I would like to express my heartfelt gratitude to
my Computer Science teacher, Mrs. Vani
Kochhar, and our esteemed school principal,
Mrs. Charan Kamal Kaur, for giving me the
wonderful opportunity to undertake this
Computer Science Investigatory Project.

Completing this project has helped me improve


my research skills, and I am truly thankful for
their guidance and support.

I am grateful to my family and friends for their


constant encouragement throughout the course
of this project. Their support was invaluable in
helping me complete this project successfully.

3
 Objective
 System description
 System requirements
 Working
 Add-Ons
 Menu description
 Programming
 Output
 Conclusion

4
The objective of the Hospital Management System
project is to streamline and enhance the efficiency of
various hospital operations. This system aims to
improve patient management by effectively handling
admissions, discharges, and transfers. It will provide
a user-friendly interface for appointment scheduling,
allowing patients and staff to easily schedule,
modify, and cancel appointments.
Appointment Scheduling: To develop a user-
friendly interface for patients and staff to
schedule, modify, and cancel appointments
easily.
Streamline Patient Management: To enhance
the efficiency of patient data handling, including
admissions, discharges, and transfers

5
The Hospital Management System will provide
essential functions to streamline hospital
operations. It will allow staff to easily register
patients by adding their personal and medical
information.
Administrators can manage doctor profiles,
including their specialties and availability.
The system will support appointment
scheduling, enabling patients to book,
change, or cancel appointments with
doctors.

6
Hardware Requirements:
• Processor: Minimum Intel i3 or equivalent
• RAM: At least 4 GB (8 GB recommended)
• Storage: Minimum 100 GB of available disk space
• Display: 1024 x 768 resolution or higher

Software Requirements:
Operating System:
o Windows 10 or later
o macOS Mojave or later
o Linux (Ubuntu 18.04 or later)

Python:
o Python 3.6 or later
o Required Libraries:
 mysql-connector-python or PyMySQL for
database connectivity
 Other libraries as needed (e.g., Flask for
web framework, Pandas for data manipulation)

7
MySQL:
o MySQL Server 5.7 or later
o MySQL Workbench for database management
(optional)

Web Browser:
o Latest version of Chrome, Firefox, or any
modern web browser (if applicable for web
interface)

Network Requirements:
Stable internet connection for downloading
dependencies

8
• PYTHON
The Hospital Management System is built using
Python, leveraging its versatility and ease of use
to create an intuitive interface for users. The
graphical user interface (GUI) is designed to be
user-friendly, allowing staff to navigate
seamlessly through various functionalities such
as patient registration, appointment scheduling,
and medical record management. Python's robust
libraries enable smooth data handling and
interaction with the MySQL database, ensuring
quick access to patient information and real-time
updates.

• MYSQL
The Hospital Management System utilizes MySQL
as its database management system, providing a
reliable and efficient backend for storing and
retrieving data. MySQL's robust structure enables
seamless management of various data entities,
including patient records, doctor profiles,
appointments, and inventory.
With features such as data integrity, strong
security measures, and support for complex
queries, MySQL ensures that the system can
handle large volumes of information while
maintaining quick access times.

9
1. Data Validation: Implement checks to ensure that all input data
(e.g., patient details, appointment times) are valid before saving
to the database.

2. Search Functionality: Add search features to quickly find


patients, doctors, or appointments using various criteria.

3. Dashboard Interface: Create a user-friendly dashboard


that displays key statistics like total patients, upcoming
appointments, and recent admissions.

4. Audit Logs: Maintain logs of user actions within the system for
accountability and tracking changes made to patient records

5. Session Management: Implement session handling to manage


user sessions securely and allow users to log in and out effectively.

6. Backup and Restore: Add functionality to back up the


database regularly and restore it when needed, ensuring data
safety.

7. Graphical Reports: Use libraries like Matplotlib or Polly to


create visual representations of data (e.g., patient demographics,
appointment trends).

10
1. Patient Registration
Add new patient profiles with personal and medical
information

2. Doctor Management
 Add and manage doctor profiles, including specialties and
availability.

3. Appointment Scheduling
 Book, modify, or cancel appointments with doctors.

4. Search Functionality
 Quickly find patients, doctors, or appointments using
search criteria.

11
MySQL code

CREATE DATABASE IF NOT EXISTS hospital_db;


USE hospital_db;
-- Table for doctors
CREATE TABLE doctors (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
specialization VARCHAR(255),
phone_number VARCHAR(20)
);
-- Table for patients
CREATE TABLE patients (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
age INT,
gender VARCHAR(10),
contact_number VARCHAR(20)
);
-- Table for appointments
CREATE TABLE appointments (
id INT AUTO_INCREMENT PRIMARY KEY,
patient_id INT,
doctor_id INT,
appointment_date DATE,

12
description varchar(30),
FOREIGN KEY (patient_id) REFERENCES patients(id)
);
Python code
import mysql.connector
from datetime import datetime
# Function to connect to MySQL database
def connect_to_db():
return mysql.connector.connect(
host="localhost", # Your MySQL host
user="root", # Your MySQL username
password="your_password", # Your MySQL password
database="hospital_db" # Your database name
# Add a new doctor
def add_doctor(name, specialization, phone_number):
connection = connect_to_db()
cursor = connection.cursor()
cursor.execute("INSERT INTO doctors (name, specialization,
phone_number) VALUES (%s, %s, %s)",
(name, specialization, phone_number))
connection.commit()
cursor.close()
connection.close()
print(f"Doctor {name} added successfully.")
# Add a new patient

def add_patient(name, age, gender, contact_number):


13
connection = connect_to_db()
cursor = connection.cursor()
cursor.execute("INSERT INTO patients (name, age, gender,
contact_number) VALUES (%s, %s, %s, %s)",
(name, age, gender, contact_number))
connection.commit()
cursor.close()
connection.close()
print(f"Patient {name} added successfully.")
# Schedule an appointment
def add_appointment(patient_id, doctor_id, appointment_date,
description):
connection = connect_to_db()
cursor = connection.cursor()
cursor.execute("INSERT INTO appointments (patient_id,
doctor_id, appointment_date, description) VALUES (%s, %s, %s,
%s)",
(patient_id, doctor_id, appointment_date,
description))
connection.commit()
cursor.close()
connection.close()
print(f"Appointment scheduled for patient ID {patient_id} with
doctor ID {doctor_id} on {appointment_date}.")
# View all doctors
def view_doctors():

14
connection = connect_to_db()
cursor = connection.cursor()
cursor.execute("SELECT * FROM doctors")
doctors = cursor.fetchall()
cursor.close()
connection.close() print("\
nList of Doctors:") for
doctor in doctors:
print(f"ID: {doctor[0]}, Name: {doctor[1]}, Specialization:
{doctor[2]}, Phone: {doctor[3]}")
# View all patients
def view_patients():
connection = connect_to_db()
cursor = connection.cursor()
cursor.execute("SELECT * FROM patients")
patients = cursor.fetchall()
cursor.close()
connection.close() print("\
nList of Patients:") for
patient in patients:
print(f"ID: {patient[0]}, Name: {patient[1]}, Age:
{patient[2]}, Gender: {patient[3]}, Contact: {patient[4]}")
# View all appointments
def view_appointments():

15
connection =
connect_to_db() cursor =
connection.cursor()
cursor.execute("""
SELECT appointments.id, patients.name, doctors.name,
appointments.appointment_date, appointments.description
FROM appointments
JOIN patients ON appointments.patient_id = patients.id
JOIN doctors ON appointments.doctor_id = doctors.id
""")
appointments = cursor.fetchall()
cursor.close()
# Main menu loop for hospital management system
def hospital_management_system():
while True:
print("\nHospital Management System Menu:")
print("1. Add Doctor")
print("2. Add Patient")
print("3. Schedule Appointment")
print("4. View Doctors")
print("5. View Patients")
print("6. View Appointments")
print("7. Exit")
choice = input("Enter your choice: ")
16
if choice == "1":
name = input("Enter doctor's name: ")
specialization = input("Enter doctor's specialization: ")
phone_number = input("Enter doctor's phone number: ")
add_doctor(name, specialization, phone_number)
elif choice == "2":
name = input("Enter patient's name: ")
age = int(input("Enter patient's age: "))
gender = input("Enter patient's gender (M/F): ")
contact_number = input("Enter patient's contact number: ")
add_patient(name, age, gender, contact_number)
elif choice == "3":
try:
patient_id = int(input("Enter patient ID: "))
doctor_id = int(input("Enter doctor ID: "))
appointment_date = input("Enter appointment date (YYYY-
MM-DD): ")
description = input("Enter appointment description: ")
add_appointment(patient_id, doctor_id, appointment_date,
description)

17
except ValueError:
print("Invalid input. Please enter valid data.")
elif choice == "4":
view_doctors()
elif choice == "5":
view_patients()
elif choice == "6":
view_appointments()

elif choice == "7":


print("Exiting Hospital Management System. Goodbye!")
break
else:
print("Invalid choice. Please select a valid option.")
if name == " main ":
hospital_management_system()

18
19
20
21
22
23
The Hospital Management System is designed to
enhance the efficiency and effectiveness of hospital
operations by providing a comprehensive set of
features. It enables seamless patient registration
and doctor management, allowing for easy
scheduling of appointments and maintaining
electronic medical records.

Overall, this system aims to improve patient care,


optimize hospital operations, and provide a secure
and user-friendly environment for all stakeholders
involved.

24
COMPUTER SCIENCE CLASS 12TH NCERT
BOOK

SUMITA ARORA CLASS 12TH COMPUTER


SCIENCE BOOK

W3Schools

25

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy