CSC Project

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 24

HINDUSTAN INTERNATIONAL

SCHOOL,
PADUR
(Af f liated to the Central Board of Secondary Education, New
Delhi

Af f liation No:1931031, School Code: 55940)

GRADE - XII
COMPUTER SCIENCE PROJECT REPORT

SUBMITTED BY:
SIKHANDER REDDY
DEPARTMENT OF COMPUTER SCIENCE
CERTIFICATE
This is to certify that the project report entitled “HOSPITAL MANAGEMENT”

Submitted by SIKHANDER REDDY of Grade XII with Roll No.

for the AISSCE - 2023-2024 at

Hindustan International School, Padur has been examined. This report is

checked by the Practical External/ Internal Examiner on .

Signature of Internal Examiner Signature of the External Examiner

Signature of Principal
DEPARTMENT OF COMPUTER SCIENCE
ACKNOWLEDGEMENT

We would like to express my deep sense of honour and gratitude to our


project guide Ms. Suganya, for guiding and mentoring us through the
course of the project. She always evinced keen interest in our work. Her
constructive advice and constant motivation have been responsible for the
successful completion of this project.

Our sincere regards go to our respected Principal, Ms. Susan George for
extending every possible support for the completion of this project.

We also extend our obligation to our Parents for their motivation and
support. We must thank our classmates for their timely help and support in
the completion of this project.

Last but not the least; we would like to thank all those who helped us
directly or indirectly towards the successful completion of this
project.
MEMBERS OF THE PROJECT

1. SIKHANDER REDDY
2. LOGESH KUMAR

Grade XII
CONTENTS

S.No Topic Page No

1. BONAFIDE CERTIFICATE

2. ACKNOWLEDGEMENT

3. INTRODUCTION

4. OBJECTIVE OF THE PROJECT

5. PROPOSED APPLICATION

6. APPLICATION ALGORITHM

7. FLOW CHART

8. DATABASE: TABLE STRUCTURE AND


DATA

9. APPLICATION CODE

10. OUTPUT

11. SYSTEM REQUIREMENTS

12. BIBLIOGRAPHY
INTRODUCTION

A Hospital Management System is an important tool for medical facilities. It


allows for the efficient management of patient data, doctor data, and
appointments. With a Hospital Management System in place, medical staff can
easily keep track of important information such as patient contact details,
medical histories, and upcoming appointments.

In today's healthcare landscape, the volume of patient data can be


overwhelming. Errors or delays in accessing this information can lead to adverse
outcomes. Our project seeks to revolutionize the management of patient records,
streamlining the process and enhancing the quality of care. Through this
endeavor, we will design, develop, and implement a secure system that not only
categorizes patients conveniently but also ensures the confidentiality and
integrity of their medical data.
This project holds the potential to significantly
improve hospital operations, ultimately benefiting both healthcare professionals
and patients.

The code provided establishes the foundational structure for such a system. It is
written in Python and uses MySQL as the database management system.

The program allows medical staff to add new patients and doctors to the
system. When adding a new patient, the program prompts the user to give the
patient's name, age, gender, contact number, address, and patient ID. This
information is then stored in the MySQL database using SQL INSERT
statements.
Similarly, when adding a new doctor, the program prompts the user for the
doctor's name, specialization, contact number, and doctor ID. This information
is also stored in the MySQL database using SQL INSERT statements.

The program also allows for scheduling appointments between patients and
doctors. When scheduling an appointment, the program prompts the user for the
patient ID, Doctor ID, and appointment date. This information is stored in the
MySQL database using another SQL INSERT statement.

The program is designed to be user-friendly and easily navigable. Medical


staff can choose between adding a new patient, adding a new doctor,
scheduling an appointment, or exiting the program. The program runs in an
infinite loop until the user chooses to exit.

Overall, this program serves as a strong foundation for building a comprehensive


Hospital Management System. Medical facilities can use this code as a starting
point and tailor it to meet their specific needs. By implementing a Hospital
Management System, medical staff can streamline data management and ensure
a smooth operation of the facility.
OBJECTIVE

The objective of the Hospital Management System is to provide a digital


platform for hospitals to manage their day-to-day operations more
efficiently.With the help of this system, hospital staff can manage their patient
data, doctor information, and administrative tasks, such as scheduling
appointments, billing, and inventory management. This system helps in
streamlining hospital operations and improving patient care.
PURPOSE

The purpose of the Hospital Management System is to simplify the process of


hospital management. The system is designed to provide a digital solution to
manage hospital operations efficiently. This system helps in managing patient
information, such as patient history, treatment records, and follow-up
appointments. Additionally, it helps doctors to manage their schedules, track
patient treatments, and update treatment plans. The Hospital Management
System also helps in managing hospital inventory, such as medicines, lab
equipment, and consumables. The main purpose of this system is to enhance
patient care while improving hospital efficiency. Overall, the Hospital
Management System is a comprehensive solution that enables hospitals to
manage their operations more efficiently, helping them provide better patient
care, improving patient outcomes, and increasing operational efficiency.
ALGORITHM

Hospital Management System code, including the SQL statements:


Step-1: Import the 'MySQL. connector' module
Step 2: Define a function to add a new patient
Step-2.1: Prompt the user to input the patient details such as name, age,
gender, contact_number, address, and patient ID
Step-2.2: Connect to the 'hospzone' database using the 'connect()' method
and create a cursor using the 'cursor()' method
Step-2.3: Use an INSERT statement to add the patient's details to the
'patients' table in the 'hospzone' database
Step-2.4: Commit the changes to the database using the 'commit()'
method
Step-2.5: Close the cursor and database connection using the
'close()' method
Step 3: Define a function to add a new doctor

Step-3.1: Prompt the user to input the doctor details such as name,
specialization, contact_number, and doctor ID
Step-3.2: Connect to the 'hospzone' database using the 'connect()' method
and create a cursor using the 'cursor()' method
Step-3.3: Use an INSERT statement to add the doctor's details to the
'doctors' table in the 'hospzone' database
Step-3.4: Commit the changes to the database using the 'commit()'
method
Step-3.5: Close the cursor and database connection using the 'close()'
method
Step 4: Define a function to schedule an appointment

Step-4.1: Prompt the user to input the appointment details such as


patient ID, doctorID, and appointment date
Step-4.2: Connect to the 'hospzone' database using the 'connect()' method
and create a cursor using the 'cursor()' method
Step-4.3: Use an INSERT statement to add the appointment details to
the 'appointments' table in the 'hospzone' database
Step-4.4: Commit the changes to the database using the 'commit()'
method
Step-4.5: Close the cursor and database connection using the 'close()'
method
Step-5: Define a while loop to show the main menu to the user
Step-5.1: Show the main menu options to the user - add patient, add
doctor, schedule appointment
Step-5.2: Prompt the user to input their choice
Step-5.3: If the user chooses to add a patient, call the 'add_patient()'
function
Step-5.4: If the user chooses to add a doctor, call the
'add_doctor()' function
Step-5.5: If the user chooses to schedule an appointment, call the
'schedule_appointment() ' function
Step-5.6: If the user chooses to exit, break out of the while loop
Step-5.7: If the user enters an invalid choice, display an error message
and show the main menu again

Step-6: Close the database connection

The main menu algorithm using Python:

Step-1: define a while loop with a boolean variable to run the program
continuously
Step-2: display the menu options to the user
Step-3: prompt the user to input their choice
Step-4: validate the user's choice using if-elif
statements Step-5: if the user enters 1, call the
'add_patient()' function Step-6: if the user enters 2, call
the 'add_doctor()' function
Step-7: if the user enters 3, call the 'schedule_appointment()' function
Step-8: if the user enters 4, break out of the while loop
Step-9: display an error message and show the menu again if the user enters
an invalid choice.
FLOW CHART
DATABASE: TABLE STRUCTURE AND DATA

Database Tables
For the project, a database named “hospzone” was created in MySQL and
used. The following tables were created to be used by the application to
maintain the application.
List of Tables:

Description of Tables:
Table Name: Patients

Table Name: Doctors


Table Name: Appointments
APPLICATION CODE

import mysql.connector

# Connect to the MySQL database


conn=mysql.connector.connect(host="localhost",user="root",
password="123aasha#savni", database="hospzone")
cursor = conn.cursor()

# Functions
def new_registration_pati():
# Get patient data from the user
name = input("Enter patient name:
") address = input("Enter patient
address: ")
phone_number = input("Enter patient phone number: ")
insurance_number = input("Enter patient insurance number: ")

# Insert the patient data into the database


cursor.execute("INSERT INTO patients (name, address, phone_number,
insurance_number) VALUES (%s, %s, %s, %s)", (name, address,
phone_number, insurance_number))
conn.commit()

print("Patient registered

successfully!") def

view_doctors_records():
# Get doctor ID from the user
doctor_id = input("Enter doctors ID: ")

# Select the doctor records from the database


cursor.execute("SELECT * FROM doctors WHERE doctor_id = %s",
(doctor_id,)) doctor_records = cursor.fetchall()

# Print the doctor records


for doctor_record in doctor_records:
print("doctor name:", doctor_record[1])
print("specialty:", doctor_record[2])

def view_patients_records():
# Get patient ID from the user
patient_id = input("Enter patient ID: ")
# Select the patient records from the database
cursor.execute("SELECT * FROM patients WHERE patient_id = %s",
(patient_id,)) patients_records = cursor.fetchall()

# Print the patient records


for patients_record in patients_records:
print("Patient name:", patients_record[1])
print("Patient address:", patients_record[2])
print("Patient phone number:", patients_record[3])
print("Patient insurance number:", patients_record[4])

def schedule_appointment():
# Get patient ID and doctor ID from
the user patient_id = input("Enter
patient ID: ") doctor_id =
input("Enter doctor ID: ")

# Select the patient and doctor records from the database


cursor.execute("SELECT * FROM patients WHERE patient_id = %s",
(patient_id,)) patient_record = cursor.fetchone()
cursor.execute("SELECT * FROM doctors WHERE doctor_id = %s",
(doctor_id,)) doctor_record = cursor.fetchone()

# Check if the patient and doctor are


available if patient_record is None:
print("Patient not found!")
return
elif doctor_record is None:
print("Doctor not found!")
return

# Schedule the appointment


cursor.execute("INSERT INTO appointments (patient_id, doctor_id,
appointment_date, appointment_time) VALUES (%s, %s, %s, %s)",
(patient_id, doctor_id, input("Enter appointment date: "), input("Enter
appointment time: ")))
conn.commit()

print("Appointment scheduled successfully!")


# Main function
def main():
try:
while True:
print("Hospital Management
System") print("1. Add New Patient")
print("2. Add New Doctor ")
print("3. View Doctors ")
print("4. View Patients ")
print("5. Scheldule an appointment ")
print("6. Exit ")
choice = int(input("Enter your choice: "))

if choice == 1:
new_registration_pati()
elif choice == 2:
new_registration_doc()
elif choice == 3:
view_doctors_records()
elif choice == 4:
view_patients_records()
elif choice == 5:
schedule_appointment()
elif choice == 6:
break
else:
print("Invalid choice. Please choose again.")

except Exception as e:
print("An error
occurred:", e) if name == "
main ": main()
OUTPUT

Sample output screens from the application:


SYSTEM REQUIREMENTS

For the Hospital Management System you've provided, you would need both
hardware and software requirements. Here's a basic outline of what you might
need:

Software Requirements:

Operating System: Any operating system that supports Python and MySQL.
Common choices include Windows, Linux, or macOS.

Python: Python interpreter installed

MySQL Connector:`mysql-connector-python` library installed. You can install


it using:

```pip install mysql-connector-python ```

MySQL Database Setup: Database schema and tables created in MySQL.


Your script assumes the existence of a database named "hospzone" and
tables like "patients," "doctors," and "appointments."

Hardware Requirements:

Processor (CPU): A standard processor should be su cient for a basic


application like this.

Memory (RAM): A minimum of 4GB of RAM is recommended, but the actual


requirement depends on the database size and the number of concurrent users.

Storage: Adequate storage space for the MySQL database. The amount of space
required depends on the size of your patient, doctor, and appointment records.

Network: A network connection is required, especially if your MySQL server is


hosted remotely.
BIBLIOGRAPHY

● Computer Science With Python (Textbook for Class XII) – by Sumita


Arora
● MySQL Connector/Python Developer Guide
(https://dev.mysql.com/doc/connector-python/en/)

You might also like