Sanjana XII
Sanjana XII
Sanjana XII
SUBMITTED TO : SUBMITTED BY :
MR. SAURAV BHATTACHARJEE NAME: SANJANA ROUTH
PGT (COMPUTER SCIENCE) CLASS: XII
ROLL NO.: 41
STREAM :- SCIENCE (PCM)
1|P a ge
CERTIFICATE
She has taken interest and has shown at most sincerity in completion of this
project.
---------------------------- -----------------------------
Signature of Principal :
---------------------------------
2|P a ge
ACKNOWLEDGEMENT
I would like to express a deep sense of thanks & gratitude to my teacher Mr.
Saurav Bhattacharjee who taught and undertook the responsibility of teaching
the subject computer science.
My sincere thanks goes to our Principal Mrs. Hemasree Datta who has always
been a source of encouragement and support and without whose inspiration, this
project would not have been a successfully completed.
I sincerely thank my family and especially to my parents for unconditional
support and love.
It is a pleasure to pay praise also to my friends for their valuable help and
debugging some of the problems during the studies.
SANJANA ROUTH
XII (Science)
3|P a ge
INDEX
4|P a ge
INTRODUCTION
5|P a ge
OBJECTIVES OF THE PROJECT
6|P a ge
PROPOSED SYSTEM
One has to use the data management software. Software has been an
ascent in atomization various organisations. Many software products
working are now in markets, which have helped in making the
organizations work easier and efficiently. Data management initially
had to maintain a lot of ledgers and a lot of paperwork has to be done
but now software producton this organization has made their work
faster and easier. Now only this software has to be loaded on the
computer and work can be done.
This prevents a lot of time and money. The work becomes fully
automated and any information regarding the organization can be
obtained by clicking the button. Moreover, now it's an age of
computers of and automating such an organization gives the better
look.
7|P a ge
SYSTEM DEVELOPMENT LIFE CYCLE (SDLC)
8|P a ge
PHASES OF SYSTEM DEVELOPMENT LIFE CYCLE
(SDLC)
9|P a ge
PLANNING STAGE
The planning stage (also called the feasibility stage) is exactly what it
sounds like: the phase in which developers will plan for the upcoming
project.
It helps to define the problem and scope of any existing systems, as
well as determine the objectives for their new systems.
By developing an effective outline for the upcoming development
cycle, they'll theoretically catch problems before they affect
development.
And help to secure the funding and resources they need to make their
plan happen.
Perhaps most importantly, the planning stage sets the project
schedule, which can be of key importance if development is for a
commercial product that must be sent to market by a certain time.
ANALYSIS STAGE
The analysis stage includes gathering all the specific details required
for a new system as well as determining the first ideas for prototypes.
Developers may:
10 | P a g e
DESIGN STAGE
They'll typically tum the SRS document they created into a more
logical structure that can later be implemented in a programming
language. Operation, training, and maintenance plans wilt all he
drawn up so that developers know what they need to do throughout
every stage of the cycle moving forward.
Once complete, development managers will prepare a design
document to be referenced throughout the next phases of the SDLC
DEVELOPMENT STAGE
11 | P a g e
Programming languages can include staples such as C++, PHP, and
more. Developers will choose the right programming code to use
based on the project specifications and requirements.
TESTING STAGE
After testing, the overall design for the software will come together.
Different modules or designs will be integrated into the primary
source code through developer efforts, usually by leveraging training
environments to detect further errors or defects.
MAINTENANCE STAGE
The SDLC doesn't end when software reaches the market. Developers
must now move into a maintenance mode and begin practicing any
activities required to handle issues reported by end-users.
12 | P a g e
Furthermore, developers are responsible for implementing any
changes that the software might need after deployment.
This can include handling residual bugs that were not able to be
patched before launch or resolving new issues that crop up due to user
reports. Larger systems may require longer maintenance stages
compared to smaller systems.
PURPOSE
13 | P a g e
SOURCE CODE
14 | P a g e
c1.execute('''CREATE TABLE IF NOT EXISTS patient_details(
p_id VARCHAR(10) PRIMARY KEY, p_name CHAR(20),
p_age INT, p_problems CHAR(50), p_phoneno BIGINT,
p_history TEXT)''')
15 | P a g e
def main_menu():
while True:
print("\n\n=================================================
===============================")
print("\t\t*WELCOME TO AMRI HOSPITAL*")
print("\t\t~ Your Health is in GOOD hands ~ ")
print("====================================================
============================\n")
print("\t\t1. LOGIN\n\t\t2. EXIT")
choice1 = int(input("ENTER YOUR CHOICE: "))
if choice1 == 1:
login_menu()
elif choice1 == 2:
print("Thank you for using AMRI Hospital System.")
break
else:
print("Invalid input. Please enter again.")
# Admin menu
def admin_login():
username = input("ENTER USERNAME: ")
password = input("ENTER PASSWORD: ")
if password == 'admin123':
print("\n---WELCOME ADMIN---")
16 | P a g e
admin_menu()
else:
print("Incorrect Password. Access Denied.")
def register_patient():
print("Registering New Patient:")
p_id = generate_id('P', 'patient_details', 'p_id')
p_name = input("Enter Patient Name: ")
p_age = int(input("Enter Age: "))
p_problems = input("Enter the Problem/Disease: ")
p_phoneno = int(input("Enter Phone number: "))
p_history = input("Enter Patient Medical History: ")
sql_insert = "INSERT INTO patient_details(p_id, p_name, p_age,
p_problems, p_phoneno, p_history) VALUES (%s, %s, %s, %s, %s, %s)"
c1.execute(sql_insert, (p_id, p_name, p_age, p_problems, p_phoneno,
p_history))
conn.commit()
print(f"Patient {p_name} registered successfully!")
def register_doctor():
print("Registering New Doctor:")
d_id = generate_id('D', 'doctor_details', 'd_id')
d_name = input("Enter Doctor Name: ")
d_age = int(input("Enter Age: "))
d_specialization = input("Enter Specialization: ")
d_department = input("Enter Department: ")
d_phoneno = int(input("Enter Phone number: "))
17 | P a g e
sql_insert = "INSERT INTO doctor_details(d_id, d_name, d_age,
d_specialization, d_department, d_phoneno) VALUES (%s, %s, %s, %s, %s,
%s)"
c1.execute(sql_insert, (d_id, d_name, d_age, d_specialization, d_department,
d_phoneno))
conn.commit()
print(f"Doctor {d_name} registered successfully!")
def register_nurse():
print("Registering New Nurse:")
n_id = generate_id('N', 'nurse_details', 'n_id')
n_name = input("Enter Nurse Name: ")
n_age = int(input("Enter Age: "))
n_department = input("Enter Department: ")
n_phoneno = int(input("Enter Phone number: "))
sql_insert = "INSERT INTO nurse_details(n_id, n_name, n_age,
n_department, n_phoneno) VALUES (%s, %s, %s, %s, %s)"
c1.execute(sql_insert, (n_id, n_name, n_age, n_department, n_phoneno))
conn.commit()
print(f"Nurse {n_name} registered successfully!")
def register_staff():
print("Registering New Staff:")
st_id = generate_id('S', 'staff_details', 'st_id')
st_name = input("Enter Staff Name: ")
st_age = int(input("Enter Age: "))
st_job = input("Enter Job Title: ")
st_phoneno = int(input("Enter Phone number: "))
18 | P a g e
sql_insert = "INSERT INTO staff_details(st_id, st_name, st_age, st_job,
st_phoneno) VALUES (%s, %s, %s, %s, %s)"
c1.execute(sql_insert, (st_id, st_name, st_age, st_job, st_phoneno))
conn.commit()
print(f"Staff {st_name} registered successfully!")
def view_records():
print("1. View Patients \n2. View Doctors\n3. View Nurses\n4. View
Staff\n")
choice = int(input("Enter choice to view: "))
if choice == 1:
view_table('patient_details')
elif choice == 2:
view_table('doctor_details')
elif choice == 3:
view_table('nurse_details')
elif choice == 4:
view_table('staff_details')
else:
print("Invalid choice.")
def view_table(table):
c1.execute(f"SELECT * FROM {table}")
rows = c1.fetchall()
if rows:
for row in rows:
print(row)
else:
19 | P a g e
print("No records found.")
def remove_records():
print("1. Remove Patients\n2. Remove Doctors\n3. Remove Nurses\n4.
Remove Staff\n")
choice = int(input("Enter choice to remove: "))
if choice == 1:
remove_patient()
elif choice == 2:
remove_doctor()
elif choice == 3:
remove_nurse()
elif choice == 4:
remove_staff()
else:
print("Invalid choice.")
def remove_patient():
p_id = input("Enter Patient ID to remove: ")
c1.execute("DELETE FROM patient_details WHERE p_id = %s", (p_id,))
conn.commit()
print("Patient record removed successfully!")
def remove_doctor():
d_id = input("Enter Doctor ID to remove: ")
c1.execute("DELETE FROM doctor_details WHERE d_id = %s", (d_id,))
conn.commit()
print("Doctor record removed successfully!")
20 | P a g e
def remove_nurse():
n_id = input("Enter Nurse ID to remove: ")
c1.execute("DELETE FROM nurse_details WHERE n_id = %s", (n_id,))
conn.commit()
print("Nurse record removed successfully!")
def remove_staff():
st_id = input("Enter Staff ID to remove: ")
c1.execute("DELETE FROM staff_details WHERE st_id = %s", (st_id,))
conn.commit()
print("Staff record removed successfully!")
def update_records():
print("1. Update Patients\n2. Update Doctors\n3. Update Nurses\n4. Update
Staff\n")
choice = int(input("Enter choice to update: "))
if choice == 1:
update_patient()
elif choice == 2:
update_doctor()
elif choice == 3:
update_nurse()
elif choice == 4:
update_staff()
else:
print("Invalid choice.")
21 | P a g e
def update_patient():
p_id = input("Enter Patient ID to update: ")
field = input("Which field to update? (name/age/problems/phoneno/history):
").lower()
new_value = input("Enter the new value: ")
if field == 'name':
c1.execute("UPDATE patient_details SET p_name = %s WHERE p_id =
%s", (new_value, p_id))
elif field == 'age':
c1.execute("UPDATE patient_details SET p_age = %s WHERE p_id =
%s", (new_value, p_id))
elif field == 'problems':
c1.execute("UPDATE patient_details SET p_problems = %s WHERE p_id
= %s", (new_value, p_id))
elif field == 'phoneno':
c1.execute("UPDATE patient_details SET p_phoneno = %s WHERE p_id
= %s", (new_value, p_id))
elif field == 'history':
c1.execute("UPDATE patient_details SET p_history = %s WHERE p_id =
%s", (new_value, p_id))
else:
print("Invalid field.")
conn.commit()
print("Patient record updated successfully!")
def update_doctor():
d_id = input("Enter Doctor ID to update: ")
22 | P a g e
field = input("Which field to update?
(name/age/specialization/department/phoneno): ").lower()
new_value = input("Enter the new value: ")
if field == 'name':
c1.execute("UPDATE doctor_details SET d_name = %s WHERE d_id =
%s", (new_value, d_id))
elif field == 'age':
c1.execute("UPDATE doctor_details SET d_age = %s WHERE d_id =
%s", (new_value, d_id))
elif field == 'specialization':
c1.execute("UPDATE doctor_details SET d_specialization = %s WHERE
d_id = %s", (new_value, d_id))
elif field == 'department':
c1.execute("UPDATE doctor_details SET d_department = %s WHERE
d_id = %s", (new_value, d_id))
elif field == 'phoneno':
c1.execute("UPDATE doctor_details SET d_phoneno = %s WHERE d_id
= %s", (new_value, d_id))
# Doctor Menu
def set_doctor_availability(doctor_id):
print("Setting availability for doctor:", doctor_id)
days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']
for day in days:
available_from = input(f"Enter available start time for {day} (HH:MM): ")
available_to = input(f"Enter available end time for {day} (HH:MM): ")
c1.execute("INSERT INTO doctor_availability(d_id, available_day,
available_from, available_to) VALUES (%s, %s, %s, %s)",
(d_id, day, available_from, available_to))
23 | P a g e
conn.commit()
print("Availability set successfully.")
def doctor_login():
username = input("ENTER DOCTOR ID: ")
password = input("ENTER PASSWORD: ")
if password == 'doctor123':
print("\n---WELCOME DOCTOR---")
doctor_menu(username)
else:
print("Invalid Doctor ID or Password.")
def doctor_menu(doctor_id):
while True:
print("\n\t\t*DOCTOR MENU*")
print("1. View Appointments\n2. Update Status\n3. Set Availability\n4.
Log Out")
choice = int(input("ENTER YOUR CHOICE: "))
if choice == 1:
view_appointments(doctor_id)
elif choice == 2:
24 | P a g e
update_job_status(doctor_id)
elif choice == 3:
set_doctor_availability(doctor_id)
elif choice == 4:
print("Doctor logged out.")
break
else:
print("Invalid choice. Please select again.")
# Patient Menu
25 | P a g e
print("Appointment canceled successfully!")
def patient_menu(username):
while True:
print("\n\t\t*PATIENT MENU*")
print("1. View Appointments")
print("2. Book Appointment")
print("3. View Medical History")
print("4. Request Medication Refill")
print("5. View Lab Results")
print("6. Update Personal Information")
print("7. View Doctor Information")
print("8. Submit Feedback")
print("9. Cancel Appointment")
print("10. Log Out")
if choice == 1:
view_appointments(username)
elif choice == 2:
book_appointment(username)
elif choice == 3:
view_medical_history(username)
elif choice == 4:
add_lab_result(username)
elif choice == 5:
26 | P a g e
view_lab_results(username)
elif choice == 6:
update_personal_info(username)
elif choice == 7:
view_doctor_info(username)
elif choice == 8:
submit_feedback()
elif choice == 9:
appointment_id = int(input("Enter Patient Id to cancel: "))
cancel_appointment(patient_id)
elif choice == 10:
print("Patient logged out.")
break
else:
print("Invalid choice. Please select again.")
def patient_login():
username = input("ENTER PATIENT ID: ")
password = input("ENTER PASSWORD: ")
if password == 'patient123':
print("\n---WELCOME PATIENT---")
patient_menu(username)
else:
27 | P a g e
print("Invalid Patient ID or Password.")
# Registration Functions
def register_patient():
print("Registering New Patient:")
p_id = generate_id('P', 'patient_details', 'p_id')
p_name = input("Enter Patient Name: ")
p_age = int(input("Enter Age: "))
p_problems = input("Enter the Problem/Disease: ")
p_phoneno = int(input("Enter Phone number: "))
p_history = input("Enter Patient Medical History: ")
sql_insert = "INSERT INTO patient_details(p_id, p_name, p_age,
p_problems, p_phoneno, p_history) VALUES (%s, %s, %s, %s, %s, %s)"
c1.execute(sql_insert, (p_id, p_name, p_age, p_problems, p_phoneno,
p_history))
conn.commit()
print(f"Patient {p_name} registered successfully!")
# ID Generation Function
def generate_id(prefix, table, id_field):
c1.execute(f"SELECT MAX({id_field}) FROM {table}")
max_id = c1.fetchone()[0]
28 | P a g e
if max_id:
num = int(max_id[1:]) + 1
else:
num = 1
return f"{prefix}{num}"
# Appointment Functions
def book_appointment(patient_id):
print("Booking an Appointment:")
doctor_id = input("Enter Doctor ID for appointment: ")
try:
from datetime import datetime
datetime.strptime(appointment_date, '%Y-%m-%d')
except ValueError:
print("Invalid date format. Please enter in YYYY-MM-DD format.")
return
29 | P a g e
try:
datetime.strptime(appointment_time, '%H:%M')
except ValueError:
print("Invalid time format. Please enter in HH:MM format.")
return
30 | P a g e
view_table('staff_details')
else:
print("Invalid choice.")
def view_table(table):
c1.execute(f"SELECT * FROM {table}")
rows = c1.fetchall()
if rows:
for row in rows:
print(row)
else:
print("No records found.")
31 | P a g e
print("Invalid choice.")
def update_patient():
p_id = input("Enter Patient ID to update: ")
field = input("Which field to update? (name/age/problems/phoneno/history):
").lower()
new_value = input("Enter the new value: ")
if field == 'name':
c1.execute("UPDATE patient_details SET p_name = %s WHERE p_id =
%s", (new_value, p_id))
elif field == 'age':
c1.execute("UPDATE patient_details SET p_age = %s WHERE p_id =
%s", (new_value, p_id))
elif field == 'problems':
c1.execute("UPDATE patient_details SET p_problems = %s WHERE p_id
= %s", (new_value, p_id))
elif field == 'phoneno':
c1.execute("UPDATE patient_details SET p_phoneno = %s WHERE p_id
= %s", (new_value, p_id))
elif field == 'history':
c1.execute("UPDATE patient_details SET p_history = %s WHERE p_id =
%s", (new_value, p_id))
else:
print("Invalid field.")
conn.commit()
print("Patient record updated successfully!")
32 | P a g e
# Removing Records Function
def remove_records():
print("1. Remove Patients\n2. Remove Doctors\n3. Remove Nurses\n4.
Remove Staff\n")
choice = int(input("Enter choice to remove: "))
if choice == 1:
remove_patient()
elif choice == 2:
remove_doctor()
elif choice == 3:
remove_nurse()
elif choice == 4:
remove_staff()
else:
print("Invalid choice.")
def remove_patient():
p_id = input("Enter Patient ID to remove: ")
c1.execute("DELETE FROM patient_details WHERE p_id = %s", (p_id,))
conn.commit()
print("Patient record removed successfully!")
33 | P a g e
print("1. Search Patients\n2. Search Doctors\n3. Search Nurses\n4. Search
Staff\n")
choice = int(input("Enter choice to search: "))
if choice == 1:
search_patient()
elif choice == 2:
search_doctor()
elif choice == 3:
search_nurse()
elif choice == 4:
search_staff()
else:
print("Invalid choice.")
def search_patient():
name = input("Enter Patient Name to search: ")
c1.execute("SELECT * FROM patient_details WHERE p_name LIKE %s",
('%' + name + '%',))
rows = c1.fetchall()
if rows:
for row in rows:
print(row)
else:
print("No matching records found.")
# Generating Reports
def generate_reports():
print("Generating reports...")
34 | P a g e
c1.execute("SELECT d_department, COUNT(*) FROM doctor_details
GROUP BY d_department")
departments = c1.fetchall()
print("Number of Doctors by Department:")
for dep in departments:
print(f"{dep[0]}: {dep[1]} doctors")
def add_lab_result():
print("Adding Lab Result:")
result_id = input("Enter Lab Result ID: ")
patient_id = input("Enter Patient ID: ")
35 | P a g e
try:
from datetime import datetime
datetime.strptime(result_date, '%Y-%m-%d')
except ValueError:
print("Invalid date format. Please enter in YYYY-MM-DD format.")
return
sql_insert = '''INSERT INTO lab_results(result_id, patient_id, lab_test,
result, result_date)
VALUES (%s, %s, %s, %s, %s)'''
c1.execute(sql_insert, (result_id, patient_id, lab_test, result, result_date))
conn.commit()
def view_lab_results():
print("Viewing Lab Results:")
patient_id = input("Enter Patient ID to view results: ")
if rows:
for row in rows:
print(row)
else:
print("No lab results found for this patient.")
36 | P a g e
def admin_menu():
while True:
print("\n\t\t*ADMIN MAIN MENU*")
print("1. Register Patients")
print(" 2. Register Doctors")
print("3. Register Nurses")
print("4. Register Staff")
print("5. View All Records")
print("6. Remove Records")
print("7. Update Records")
print("8. Generate Reports")
print("9. Search Records")
print("10. Manage Appointments")
print("11. Manage Feedback")
print("12. Manage Medication Refills")
print("13. Manage Lab Results")
print("14. Manage Doctor Availability")
print("15. Log Out")
if choice == 1:
register_patient()
elif choice == 2:
register_doctor()
elif choice == 3:
37 | P a g e
register_nurse()
elif choice == 4:
register_staff()
elif choice == 5:
view_records()
elif choice == 6:
remove_records()
elif choice == 7:
update_records()
elif choice == 8:
generate_reports()
elif choice == 9:
search_records()
elif choice == 10:
cancel_appointments()
elif choice == 11:
manage_feedback()
elif choice == 12:
add_lab_result()
elif choice == 13:
view_lab_results()
elif choice == 14:
manage_doctor_availability()
elif choice == 15:
print("Admin logged out.")
break
else:
38 | P a g e
print("Invalid choice. Please select again.")
if role == 1:
admin_login()
elif role == 2:
doctor_login()
elif role == 3:
patient_login()
else:
print("Invalid role selection. Please retry.")
login_menu()
39 | P a g e
OUTPUT
40 | P a g e
41 | P a g e
42 | P a g e
43 | P a g e
44 | P a g e
45 | P a g e
46 | P a g e
HARDWARE AND SOFTWARE REQUIREMENTS
Software Specifications :-
Operating System :- Windows 10
Platform :- Python IDLE 3.7
Database :- MySQL
Language :- Python
Hardware Specifications :-
PROCESSOR :- Intel i5 8th GEN
HARD DISK :- 1 TB
RAM :- 8 GB
47 | P a g e
MySQL (DATABASE TABLES)
48 | P a g e
49 | P a g e
BIBLIOGRAPHY
Internet -
>> www.w3resource.com
>> www.google.com
>> www.wikipedia.org
50 | P a g e
THANK YOU
51 | P a g e