0% found this document useful (0 votes)
14 views19 pages

Cs Final Project

The document presents an investigatory project on a Hospital Management System developed using Python and CSV files, submitted to the Central Board of Secondary Education for the academic year 2024-2025. It includes sections on hardware and software requirements, an overview of Python and CSV, source code, and output screens. The project aims to provide functionalities for managing patient records, including adding, modifying, deleting, and searching for patient information.

Uploaded by

prkr77993399
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)
14 views19 pages

Cs Final Project

The document presents an investigatory project on a Hospital Management System developed using Python and CSV files, submitted to the Central Board of Secondary Education for the academic year 2024-2025. It includes sections on hardware and software requirements, an overview of Python and CSV, source code, and output screens. The project aims to provide functionalities for managing patient records, including adding, modifying, deleting, and searching for patient information.

Uploaded by

prkr77993399
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/ 19

INVESTIGATORY PROJECT ON

HOSPITAL MANAGEMENT SYSTEM:


Submitted to:

CENTRAL BOARD OF SECONDARY EDUCATION

(Academic Year: 2024-2025)


By

MOHNISSH MANGALATH DHANAM JAYAN


Reg.No: .
Under the guidance of

MrS.MAHALAKSHMI RAMESH
B.Ss.,M.C.A.,M.Phil.,B.Ed.
(Computer Science Faculty)

DEPARTMENT OF COMPUTER SCIENCE

SENTHIL PUBLIC SCHOOL


(Affiliated to CBSC, New Delhi, Affiliation No: 1930323)
Jagirammapalayam, Salem – 636 302.
ACKNOWLEDGEMENT
I am here over whelmed in all humbleness and gratefulness
to acknowledge my depth to all those who have help me to put
these ideas, well above the level of simplicity and into something
concrete.
I would like to place and record my heartfelt gratitude to my
renowned Research Supervisor, Mrs.Mahalakshmi Ramesh, B.Sc.,
M.C.A., M.Phil., B.Ed, Academic Coordinator, Senthil public School,
Salem, Tamil Nadu, India. Her constant support, encouragements
and guidance throughout my research periods have played a vital
role in my scientific pursuit. This helped me immensely to throw
great insight to address my research issue. She gave me the
liberty of planning and executing the research work. Her energy
and enthusiasm have developed my own passion for research
and I am truly grateful for her guidance and encouragements.
I express my sincere and heartfelt thanks to our Senior
Principal Mr.C.Srinivasan (M.Sc, M.Phil, M.Ed, Ph.D,
Dip.in.Montessori) and our Principal Dr. V. Manoharan(M.Sc,
M.Phil, M.Ed, Ph.D) and our Academic Coordinator Dr.T.Vinodh
kumar (M.Sc, M.Phil, Ph.D, PGHM, DMLT, B.Ed) Senthil Public
School, Salem, Tamil Nadu, India, who gave me the golden
opportunity to do this wonderful project work.
I would like to thank my parents who helped me a lot in
gathering different information, collecting data and guiding me
from time to time in making this project, despite of their busy
schedules, they gave me different ideas in making this project
unique.
NAME:
(Mohnissh Mangalath Dhanam jayan)
S.No Contents Page.No
About project
1. 1

Hardware and
2. software 1
requirements

3. Python 2
Overview

4. CSV files 3
Overview

5. Source Code 4

Output
6. screens 14

7. Bibliograph 18
ABOUT PROJECT
This project focuses on hospital
management system by using python and
CSV file.

HARDWARE AND SOFTWARE


REQUIREMENTS

 Hardware requirements:
 Laptop
 Minimum 1GB of ram
 Minimum of 100GB HDD
 Software requirements:
 Windows operating system
 Python 3. 12. 5

PYTHON OVERVIEW
Python is a high level, interpreted,
interactive and object oriented Scripted
language. Python is a designed to be highly
readable. It uses English keywords
frequently where as other languages use
punctuation, and it has fewer syntactical
constructions than other languages.

Python is a open source and cross- platform


Programming Language. It is available for
use under python software foundation
license (compatible to GNU GENERAL
PUBLIC LICENSE) on all the major operating
system platforms windows and Mac os.
CSV OVER VIEW

CSV is abbreviated as comma separated


values.csv is a delaminated data format
that has fields separated by comma
character and record’s /rows Terminated by
new lines.
A csv file does not require specific
character encoding, byte order, or line
terminator format. A record ends at a line
terminator.
The files have a simple structure and
human readable.
CSV file can be easily and accurately
compressed. The running costs are not high.
They are easier to import into a
spreadsheet or another storage database.
SOURCE CODE

import os
import csv

def newPatient():
print("Add a new patient record")
print("======================
========")
with open('Patient.csv', 'a', newline='') as
f:
s = csv.writer(f)
patient_id = input('Enter Patient ID: ')
patient_name = input('Enter Patient
Name: ')
disease = input('Enter Disease: ')
fee = float(input('Enter Fee: '))
doctor_name = input('Enter Name of
the Doctor: ')
print("----------------------------------------")
rec = [patient_id, patient_name,
disease, fee, doctor_name]
s.writerow(rec)
print("Patient Record Saved")
input("Press any key to continue..")

def editPatient():
print("Modify a Patient Record")
print("======================
======")
with open('Patient.csv', 'r', newline='') as
f, open('temp.csv', 'w', newline='') as f1:
r = input('Enter Patient ID to modify: ')
s = csv.reader(f)
s1 = csv.writer(f1)
modified = False
for rec in s:
if rec[0] == r:
print("-------------------------------------")
print("Patient ID:", rec[0])
print("Patient Name:", rec[1])
print("Disease:", rec[2])
print("Fee:", rec[3])
print("Name of the Doctor:",
rec[4])
print("-------------------------------------")
choice = input("Do you want to
modify this patient record (y/n)? ")
if choice.lower() == 'y':
print("-----------------------------------------------------
--------------------------")
patient_id = input('Enter new
Patient ID (leave blank if not required): ') or
rec[0]
patient_name = input('Enter
new Patient Name (leave blank if not
required): ') or rec[1]
disease = input('Enter Disease
(leave blank if not required): ') or rec[2]
fee = input('Enter Fee (leave
blank if not required): ')
fee = float(fee) if fee else
rec[3]
doctor_name = input('Enter
Name of the Doctor (leave blank if not
required): ') or rec[4]
print("-----------------------------------------------------
--------------------------")
rec = [patient_id,
patient_name, disease, fee, doctor_name]
modified = True
s1.writerow(rec)
if modified:
print("Patient record modified.")
else:
print("No record modified.")
os.remove("Patient.csv")
os.rename("temp.csv", "Patient.csv")
input("Press any key to continue..")

def delPatient():
print("Delete a Patient Record")
with open('Patient.csv', 'r', newline='') as
f, open('temp.csv', 'w', newline='') as f1:
r = input('Enter Patient ID to delete: ')
s = csv.reader(f)
s1 = csv.writer(f1)
found = False
for rec in s:
if rec[0] == r:
print("---------------------------------------")
print("Patient ID:", rec[0])
print("Patient Name:", rec[1])
print("Disease:", rec[2])
print("Fee:", rec[3])
print("Name of the Doctor:",
rec[4])
print("---------------------------------------")
choice = input("Do you want to
delete this patient record (y/n)? ")
if choice.lower() == 'y':
found = True
print("Patient record deleted.")
continue # Skip writing this
record
s1.writerow(rec)
if not found:
print("Patient ID not found.")
os.remove("Patient.csv")
os.rename("temp.csv", "Patient.csv")
input("Press any key to continue..")

def searchPatient():
print("Search a Patient Record")
print("======================
========")
with open('Patient.csv', 'r', newline='') as
f:
r = input('Enter Patient ID to search: ')
s = csv.reader(f)
found = False
for rec in s:
if rec[0] == r:
print("------------------------------")
print("Patient ID:", rec[0])
print("Patient Name:", rec[1])
print("Fee:", rec[3])
print("Name of the Doctor:",
rec[4])
print("------------------------------")
found = True
break
if not found:
print("Patient ID not found.")
input("Press any key to continue..")

def listofPatients():
print("======================
========================")
print(" List of All Patients")
print("======================
========================")
with open('Patient.csv', 'r', newline='') as
f:
s = csv.reader(f)
for rec in s:
print("\t\t".join(rec))
print("------------------------------------------------")
input("Press any key to continue..")

def menu():
while True:
print("\n")
print("|--------------------------|")
print("| Hospital Management System
|")
print("|--------------------------|")
print("\n")
print("######################
###########")
print(" Menu")
print("######################
###########")
print("1. Add a new Patient Record")
print("2. Modify Existing Patient")
print("3. Delete Existing Patient")
print("4. Search a Patient")
print("5. List all Patients")
print("6. Exit")
print("---------------------------------")
choice = int(input('Enter your choice:
'))
print("---------------------------------")
if choice == 1:
newPatient()
elif choice == 2:
editPatient()
elif choice == 3:
delPatient()
elif choice == 4:
searchPatient()
elif choice == 5:
listofPatients()
elif choice == 6:
print("Exiting the software...")
break
else:
print("Invalid choice, please try
again.")

menu()
OUTPUT SCREENS
BIBILOGRAPHY:
1)Progress in computr with python
-Dhanpat Rai &
Co[publisher]
-Sumita Arora[AUTHOR]
2)Computer scienece with python:
-Sultan chand [publisher]
-Preeti Arora [AUTHOR]
3)Computer science:
-New Saraswathi house
[Publisher]
-Harsha basin[ Auhtor]

You might also like