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

Hospital Management Project

Uploaded by

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

Hospital Management Project

Uploaded by

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

Class 12 Computer Science Project

Hospital Management System

Objectives:

1. To create a user-friendly system for managing hospital operations.

2. To implement features like patient registration, doctor assignment, appointment scheduling, and bill gene

3. To provide a menu-driven interface for ease of use.

Modules:

1. Patient Management: Add, view, update, and delete patient records.

2. Doctor Management: Add, view, and assign doctors to patients.

3. Appointment Scheduling: Schedule and manage appointments.

4. Billing System: Generate and display bills.

Python Code:

import datetime

# Global lists to store data

patients = []

doctors = []

appointments = []

# Menu for the system

def menu():

print("\n=== Hospital Management System ===")

print("1. Manage Patients")


print("2. Manage Doctors")

print("3. Schedule Appointment")

print("4. Generate Bill")

print("5. Exit")

# Patient Management

def manage_patients():

print("\n--- Patient Management ---")

print("1. Add Patient")

print("2. View Patients")

print("3. Update Patient")

print("4. Delete Patient")

choice = int(input("Enter your choice: "))

if choice == 1:

add_patient()

elif choice == 2:

view_patients()

elif choice == 3:

update_patient()

elif choice == 4:

delete_patient()

else:

print("Invalid choice!")

def add_patient():

name = input("Enter patient name: ")


age = int(input("Enter patient age: "))

disease = input("Enter disease: ")

patient_id = len(patients) + 1

patients.append({"ID": patient_id, "Name": name, "Age": age, "Disease": disease})

print(f"Patient added with ID: {patient_id}")

def view_patients():

print("\n--- Patient List ---")

for patient in patients:

print(f"ID: {patient['ID']}, Name: {patient['Name']}, Age: {patient['Age']},

Disease: {patient['Disease']}")

def update_patient():

patient_id = int(input("Enter Patient ID to update: "))

for patient in patients:

if patient["ID"] == patient_id:

patient["Name"] = input("Enter new name: ")

patient["Age"] = int(input("Enter new age: "))

patient["Disease"] = input("Enter new disease: ")

print("Patient record updated.")

return

print("Patient not found!")

def delete_patient():

patient_id = int(input("Enter Patient ID to delete: "))

global patients

patients = [patient for patient in patients if patient["ID"] != patient_id]


print("Patient record deleted.")

# Doctor Management

def manage_doctors():

print("\n--- Doctor Management ---")

print("1. Add Doctor")

print("2. View Doctors")

choice = int(input("Enter your choice: "))

if choice == 1:

add_doctor()

elif choice == 2:

view_doctors()

else:

print("Invalid choice!")

def add_doctor():

name = input("Enter doctor name: ")

speciality = input("Enter speciality: ")

doctor_id = len(doctors) + 1

doctors.append({"ID": doctor_id, "Name": name, "Speciality": speciality})

print(f"Doctor added with ID: {doctor_id}")

def view_doctors():

print("\n--- Doctor List ---")

for doctor in doctors:

print(f"ID: {doctor['ID']}, Name: {doctor['Name']}, Speciality:


{doctor['Speciality']}")

# Appointment Scheduling

def schedule_appointment():

print("\n--- Schedule Appointment ---")

patient_id = int(input("Enter Patient ID: "))

doctor_id = int(input("Enter Doctor ID: "))

date = input("Enter appointment date (YYYY-MM-DD): ")

appointments.append({"PatientID": patient_id, "DoctorID": doctor_id, "Date": date})

print("Appointment scheduled successfully!")

# Billing System

def generate_bill():

print("\n--- Generate Bill ---")

patient_id = int(input("Enter Patient ID: "))

amount = float(input("Enter amount: "))

print(f"Bill for Patient ID {patient_id} is Rs. {amount:.2f}")

# Main Function

while True:

menu()

choice = int(input("Enter your choice: "))

if choice == 1:

manage_patients()

elif choice == 2:

manage_doctors()
elif choice == 3:

schedule_appointment()

elif choice == 4:

generate_bill()

elif choice == 5:

print("Exiting the system. Goodbye!")

break

else:

print("Invalid choice!")

You might also like