ip project
ip project
ip project
Session: 2024-2025
SUBMITTED TO SUBMITTED BY
Ms. Vartika Rai Name: yogita oad
P.G.T Roll No. :
ACKNOWLEDGEMENT
Valuable Support, Constant Help And Guidance At Each And Every Stage,
Rahatekar For Her Immense Encouragement That Has Made This Project
Successful.
I Would Also Like To Thank My Friends And Family For Their Endless Support
CERTIFICATE
External’s Signature
INTRODUCTION
A Hospital Management System (HMS) is an integrated
software solution used by healthcare institutions, such
as hospitals, clinics, and medical centers, to manage
various administrative, clinical, and financial
operations. The primary aim is to streamline hospital
activities and improve the overall quality of patient
care. The key functionalities of an HMS include:
Rec=[Patientid,Patientname,Disease,fee,Doctorname]
s.writerow(rec)
f.close( print(“Patient Record Saved”)
input(“Press any key to continue..”)
def editPatient():
print(“Modify a Patient Record”)
print(“=========================”)
f=open(‘Patient.csv’,’r’,newline=’\r\n’)
f1=open(‘temp.csv’,’w’,newline=’\r\n’)
f1=open(‘temp.csv’,’a’,newline=’\r\n’)
r=input(‘Enter Patientid whose record you want to
modify=’)
s=csv.reader(f)
s1=csv.writer(f1)
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 Doctor=”,rec[4])
print(“-------------------------------“)
choice=input(“Do you want to modify this Patient
Record(y/n)=”
if choice==’y’ or choice==’Y’:
print(“--------------------------------------------------“)
Patientid=input(‘Enter new Patient id(if required)=’)
Patientname=input(‘Enter new Patient name(if
required)=’)
Disease=input(‘Enter Disease=’)
Fee=float(input(‘Enter Fee=’))
Doctorname=input(‘Enter name of Doctor=’)
Print(“--------------------------------------------------“)
Rec=[Patientid,Patientname,Disease,fee,Doctorname]
S1.writerow(rec)
Print(“Patient Record Modified”)
Else:
S1.writerow(rec)
Else:
S1.writerow(rec)
f.close()
f1.close()
os.remove(“Patient.csv”)
os.rename(“temp.csv”,”Patient.csv”)
def delPatient():
f=open(‘Patient.csv’,’r’,newline=’\r\n’)
f1=open(‘temp.csv’,’w’,newline=’\r\n’)
f1=open(‘temp.csv’,’a’,newline=’\r\n’)
r=input(‘Enter Patientid whose record you want to
delete’)
s=csv.reader(f)
s1=csv.writer(f1)
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 Doctor=”,rec[4])
print(“-------------------------------“)
choice=input(“Do you want to delete this Patient
Record(y/n)”)
if choice==’y’ or choice==’Y’:
pass
print(“Patient Record Deleted….”)
else:
s1.writerow(rec)
else:
s1.writerow(rec)
f.close()
f1.close()
os.remove(“Patient.csv”)
os.rename(“temp.csv”,”Patient.csv”)
print(“=======================================
==============================”)
print(“ List of All Patients”)
print(“=======================================
==============================”)
f=open(‘Patient.csv’,’r’,newline=’\r\n’)
s=csv.reader(f)
i=1
for rec in s:
print(rec[0],end=”\t\t”)
print(rec[1],end=”\t\t”)
print(rec[2],end=”\t\t”)
print(rec[3],end=”\t\t”)
print(rec[4])
i+=1
f.close()
print(“----------------------------------------------------------------
------“) input(“Press any key to continue..”)
def menu():
choice=0
while choice!=6:
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(“Software Exited..
break
menu()
OUTPUT
Pateint-1
CSV FILE
CONCLUSION
Conclusion for a Hospital Management System Using
Python and CSV
Developing a hospital management system using
Python and CSV files offers a simple yet effective way to
manage hospital operations.
Efficiency: Python’s versatility makes it suitable for
handling data, while CSV files provide a lightweight and
accessible format for storing information like patient
Cost-Effectiveness: This approach eliminates he need
for complex databases, making it an affordable solution
for small to medium-sized healthcare facilities.
Ease of Use: CSV files are easy to create, update, and
integrate with Python scripts, enabling quick dataa
In conclusion, using Python and CSV files for a hospital
management system is a practical choice for
developing a lightweight, user-friendly, and cos
effective solution that can streamline basic hospital
operations efficiently.
Pateint 2