Python Project
Python Project
Report On
SUBMITTEDBY:
I.DNUMBER NAME
UNDERTHE ESTEEMEDGUIDANCE OF
Dr. R. MEGANATHAN
ASSOCIATE PROFESSOR
KLUNIVERSITY
Green fields,
Vaddeswaram – 522 502
GunturDt., AP, India
DEPARTMENT OF BASIC ENGINEERING SCIENCES
CERTIFICATE
PROJECTSUPERVISOR HEADOFTHEDEPARTMENT
I.DNUMBER NAME
1 Abstract 1
2 Introduction 2
3 Objectives 3
5 Features 5
6 System Requirements 6
7 Class diagram 7
8 Classes 8-9
9 Implementation 10-11
10 Result 12
Conclusion
11
ABSTRACT
[1]
INTRODUCTION
Objectives:
Patient Class: This class allows the user to check-in, check-out, and view patient
information. Patients can be added to the system by providing their name, age,
illness, and contact information.
Doctor Class: This class enables doctors to view their schedule, patient
information, and prescribe medication. Doctors can be added to the system by
providing their name, specialization, and contact information.
Room Class: This class helps users to view room availability and book a room.
Rooms can be added to the system by providing their room number, occupancy
status, and room type
To ensure the program is user-friendly and can be easily used by patients, doctors,
working staff.
To test the program thoroughly to ensure it is working as expected and meets the
requirements of managing Hospital information using OOP concepts, without
using a database.
[3]
Scope of the project
[4]
Features
The key features of theLibrary Management System include:
• To design and implement a simple hospital management system using
object-oriented programming concepts such as encapsulation, inheritance,
and polymorphism.
• Patient Class: This class allows the user to check-in, check-out, and view
patient information. Patients can be added to the system by providing their
name, age, illness, and contact information.
• Doctor Class: This class enables doctors to view their schedule, patient information, and
prescribe medication. Doctors can be added to the system by providing their name,
specialization, and contact information.
• Room Class: This class helps users to view room availability and book a room. Rooms can
be added to the system by providing their room number, occupancy status, and room
type
• Appointment Class: This class enables users to schedule appointments, view upcoming
appointments, and cancel appointments. The system maintains appointment details like
the patient name, doctor name, and appointment time.
• To ensure the program is user-friendly and can be easily used by patients, doctors,
working staff.
• To develop methods for adding new patients, doctors, and rooms, checking-in and
checking-out patients, scheduling appointments, prescribing medications, viewing patient
information, viewing schedules, viewing room availability, viewing bills, and paying bills
• Data structures: The project stores hospital information in data structures such as
lists, dictionaries, or sets. These data structures store the patients and doctor
objects and can be saved to a file or memory.
• No database: The project doesn't use a database to store the hospital information,
making it simpler to develop and maintain.
[5]
SYSTEMREQUIREMENTS
Requirements
SOFTWAREREQUIREMENTS:
The major software requirements of the project are as follows
Language : python
Operating system : Windows XP or later.
Complier : IDLE, PyCharm, Spyder, VS Code
HARDWAREREQUIREMENTS:
The hardware requirements that map towards the software are :
Processor : Intelcorei5orlater
Other Requirements:
[6]
Class diagram
Class: patient
Name: string
Age: int
illness: string
contact_info: string
Check_in( ) :
Check_out( ) :
View_info():
Class: doctor
name: string
Specialty : string
Contact_info : string
View_schedule( ):
View_appointment( ):
Prescribe_medication( ) :
Class: room
room_no: int
occupancy_status: str
room_type: str
view_availability():
book_room():
Class:
appointment
patient: str
services: str
doctor: str
time: str
schedule()
view_upcoming()
cancel()
[7]
Classes
These are two classes that will be designed as part of our project. Here's a
detailed description of each class with its properties, methods, and
relationships with other classes:
Class: patient
Attributes:
Class: doctor
Attributes:
A Doctor can have many Patients and many Appointments. The doctor class
has relation with patient and appointment class
.
Class: room
Attributes:
Methods:
A Room can be occupied by a Patient. Room class has relation with patient class
.
Class: appointment
Attributes:
Methods:
.
Class: bill
Attributes:
Methods:
view_bill(): A method that takes instance of the patient class and is used to
check the bill.
pay_bill (): A method that takes the instance of the patient class and is used to
pay bill
A Room can be occupied by a Patient. Room class has relation with patient class
[9]
Implementation
class Patient:
def __init__(self, name, age, illness, contact_info):
self.name = name
self.age = age
self.illness = illness
self.contact_info = contact_info
self.checked_in = False
def check_in(self):
self.checked_in = True
def check_out(self):
self.checked_in = False
def view_info(self):
return f"Name: {self.name}\nAge: {self.age}\nIllness: {self.illness}\nContact Info:
{self.contact_info}\nChecked In: {self.checked_in}"
class Doctor:
def __init__(self, name, specialization, contact_info):
self.name = name
self.specialization = specialization
self.contact_info = contact_info
def view_schedule(self):
# some logic for displaying the doctor's schedule
pass
class Room:
def __init__(self, room_number, occupancy_status, room_type):
self.room_number = room_number
self.occupancy_status = occupancy_status
self.room_type = room_type
def view_availability(self):
return f"Room {self.room_number} is currently {'occupied' if self.occupancy_status
else 'vacant'}."
def book(self):
self.occupancy_status = True
class Appointment:
def __init__(self, patient, doctor, time):
self.patient = patient
self.doctor = doctor
self.time = time
def schedule(self):
# some logic for scheduling an appointment
pass
def view_upcoming(self):
# some logic for displaying upcoming appointments
pass
def cancel(self):
# some logic for cancelling an appointment
pass
class Bill:
def __init__(self, patient, services, cost):
self.patient = patient
self.services = services
self.cost = cost
def view_bill(self):
return f"Patient: {self.patient}\nServices: {self.services}\nTotal Cost: {self.cost}"
def pay(self):
# some logic for processing payment
pass
class Main:
def __init__(self):
self.patients = []
self.doctors = []
self.rooms = []
self.appointments = []
self.bills = []
def view_patients(self):
for patient in self.patients:
print(patient.view_info())
def view_doctors(self):
for doctor in self.doctors:
print(f"Name: {doctor.name}\nSpecialization: {doctor.specialization}\nContact
Info: {doctor.contact_info}")
def view_rooms(self):
for room in self.rooms:
print(room.view_availability())
def view_appointments(self):
for appointment in self.appointments:
print(f"Patient: {appointment.patient}\nDoctor: {appointment.doctor}\nTime:
{appointment.time}")
def view_bills(self):
for bill in self.bills:
print(bill.view_bill())
patient1 = Patient("John Smith", 35, "Flu", "555-1234")
patient1.check_in()
patient2 = Patient("Jane Doe", 50, "Pneumonia", "555-5678")
hospital.view_patients()
hospital.view_doctors()
hospital.view_rooms()
hospital.view_appointments()
hospital.view_bills()
[11]
RESULT
CONCLUSION:
[12]