Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write a HOSPITAL MANAGEMENT PROJECT in SIMPLE PYTHON language using for loop, ap

ID: 3901590 • Letter: W

Question

write a HOSPITAL MANAGEMENT PROJECT in SIMPLE PYTHON language using for loop, append function, arrays, functions ...following conditions should be implemented..


1.It should drive a menu...
a.patient
b.doctor
c.appointment
d.exit
2.when pressed patient.... it should show add patient, search patient, edit record, discharge patient, and exit


3. same is for Doctor.....its should print add doctor ID, doctor specialization, experience of doctor, time of availability, exit


4. for appointment it should appoint the respective patient from the record stored to the doctor of the hospital.....


5. MAX appointment for a doctor are 5 and those should be according to the time of availability of doctor.


Explanation / Answer

patient = {} doctor = {} appoinment = {} def patient_records(): def add_patient(): name = input("Enter patient's name:-") patient[name] = {} age = input("Enter age of patient") decease = input("Enter decease of patient") amount = input("Enter amount charged on patient") patient[name]['age'] = age patient[name]['decease'] = decease patient[name]['amount'] = amount print("Added Successfully") def search_patient(): sname = input("Enter patient name to search") all_patients = patient.keys() if sname in all_patients: print("Record Found...") print("Patient name :- ", sname) for i in patient[sname]: print(i, "->", patient[sname][i]) else: print("No such Records") def edit_rec_patient(): ename = input("Enter name to edit") for i in patient[ename]: print("Item recorded for "+i+" is :->", patient[ename][i]) edit_item = input("Enter new value for "+i+" ->") patient[ename][i] = edit_item print("Edited Successfully") def discharge_patient(): disc_name = input("Enter name of patient discharged") patient.pop(disc_name, None) print("Discharged Successfully") while True: print(" Press 1 to add patient...") print("Press 2 to search patient...") print("Press 3 to edit the patient...") print("Press 4 to discharge patient...") print("press 5 to exit..") ch = input("Enter Your Choice...") if ch == '1': add_patient() if ch == '2': search_patient() if ch == '3': edit_rec_patient() if ch == '4': discharge_patient() if ch == '5': break else: print("Invalid Selection...") def doctor_records(): def add_doctor(): dname = input("Enter doctors's name:-") doctor[dname] = {} id = input("Enter doctors ID") specialization = input("Enter doctors specialization") experience = input("Enter doctors experience") time_of_availability = input("Enter time of availability in 24 hrs format") doctor[dname]['id'] = id doctor[dname]['specialization'] = specialization doctor[dname]['experience'] = experience doctor[dname]['time_of_availability'] =time_of_availability doctor[dname]['patients'] = [] print("Added Successfully") def search_doctor(): sdname = input("Enter doctors name to search") all_doctors = doctor.keys() if sdname in all_doctors: print("Record Found...") print("Doctor's name :- ", sdname) for i in doctor[sdname]: print(i, "->", doctor[sdname][i]) else: print("No such Records") def edit_rec_doctor(): edname = input("Enter name to edit") for i in doctor[edname]: print("Item recorded for " + i + " is :->", doctor[edname][i]) edit_item = input("Enter new value for " + i + " ->") patient[edname][i] = edit_item print("Edited Successfully") while True: print(" Press 1 to add doctor...") print("Press 2 to search doctor...") print("Press 3 to edit the doctor...") print("press 4 to exit..") ch = input("Enter Your Choice...") if ch == '1': add_doctor() if ch == '2': search_doctor() if ch == '3': edit_rec_doctor() if ch == '4': break else: print("Invalid Selection...") def appointment_records(): pname = input("Enter patients name for appointment->") dname = input("Enter doctors name for appointment->") t = input("Enter time for appointment in 24 hrs format") all_doctors = doctor.keys() if dname in all_doctors: if t == doctor[dname]['time_of_availability']: if len(doctor[dname]['patients']) < 5: doctor[dname]['patients'].append(pname) else: print("Cant appoint max appointment for the day done..") else: print("Cant appoint doctor is not available in that timme") else: print("Doctor is not in this hospital.") while True: print(" Press 'a' for Patients") print("Press 'b' for Doctors") print("Press 'c' for Appointments") print("Press 'd' for exit") ch = input("Enter your choice...->") if ch == 'a': patient_records() if ch == 'b': doctor_records() if ch == 'c': appointment_records() if ch == 'd': break else: print("Invalid Selection")