Krish
Krish
SCIENCE PROJECT
~Hospital Management
system with SQL & Python~
COMPUT ER SCI EN CE
PROJECT ON
HOSPITAL MANAGEMENT
SYSTEM
USING PYTHON (FRONT END) AND MYSQL (BACK
END)
-----------------------------------
• Objective
• System description
• System requirements
• Working
• Add-Ons
• Menu description
• Programming
• Output
• Conclusion
OBJECTIVE
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)
SYSTEM REQUIREMENTS
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
WORKING
• 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.
ADD-ONS
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.
PROGRAMMING
MySQL code
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: ")
PROGRAMMING
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)
PROGRAMMING
except ValueError:
print("Invalid input. Please enter valid data.")
elif choice == "4":
view_doctors()
elif choice == "5":
view_patients()
elif choice == "6":
view_appointments()
Adding Doctor
OUTPUT
Adding Patient
Scheduling an Appointment
OUTPUT
Discharging a Patient
Viewing Appointments
OUTPUT
Exiting Hospital
management system
CONCLUSION
W3Schools