finall python project is done 1 (1) (1)
finall python project is done 1 (1) (1)
on
of
Assistant Professor/IT
Submitted By
VARSHINI S (927623BIT123)
MAY 2024
M. KUMARASAMY COLLEGE OF ENGINEERING
BONAFIDE CERTIFICATE
Signature Signature
Mrs.M.MYTHILI, M.E., Dr. K.CHITIRAKALA, M.Sc.,
M.Phil.,Ph.D.,
SIGNATURE
--------------------------
VARSHINI S
Place:Karur
Date:
ACKNOWLEDGEMENT
It is with great pride that I express our gratitude and in-debt to our institution “
M.Kumarasamy College of Engineering (Autonomous)”, for providing us with
the opportunity to do this project.
I glad to credit honourable chairman Dr. K. RAMAKRISHNAN, B.E., for having
provided for the facilities during the course of our study in college.
I would like to express our sincere thanks to our beloved Executive Director
Dr. S. KUPPUSAMY, MBA, Ph.D., for forwarding to our project and offering
adequate duration in completing our project.
I would like to thank Dr. B.S. MURUGAN., Principal, who gave opportunity to
frame the project the full satisfaction.
I whole heartily thanks to Dr. S. GEEITHA M.E., Ph.D., Head of the department,
INFORMATION TECHNOLOGY for providing her encourage pursuing this
project.
I express our deep expression and sincere gratitude to our project guide Mrs.
M.MYTHILI. M.E., Department of INFORMATION TECHNOLOGY, for his
incalculable suggestions, creativity, assistance and patience which motivated us to
carry out this project.
I render our sincere thanks to Course Coordinator and other staff members for
providing valuable information during the course.
I wish to express our special thanks to the officials and Lab Technicians of our
departments who rendered their help during the period of the work progress.
DEPARTMENT OF INFORMATION TECHNOLOGY
Produce smart technocrats with empirical knowledge who can surmount the global
challenges
Create a diverse, fully-engaged, learner-centric campus environment to provide
quality education to the students
Maintain mutually beneficial partnerships with our alumni, industry, and
Professional associations
Build necessary skills required for employ ability through career development
training to meet the challenges posed by the competitive world.
PROGRAM EDUCATIONAL OBJECTIVES (PEOs)
PEO 1: Graduates will be able to solve real world problems using learned concepts pertaining
to Information Technology domain.
PEO 2: Encompass the ability to examine, plan and build innovative software Products and
become a successful entrepreneur.
PEO 3: Graduates will be able to carry out the profession with ethics, integrity, leadership and
social responsibility.
PEO 4: Graduates will be able to pursue post-graduation and succeed in academic and research
careers.
PROGRAM OUTCOMES (POs)
Engineering students will be able to:
1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex engineering
problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering problems
and design system components or processes that meet the specified needs with appropriate
consideration for the public health and safety, and the cultural, societal, and
environmental considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and
research methods including design of experiments, analysis and interpretation of data, and
synthesis of the information to provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to
assess societal, health, safety, legal and cultural issues and the consequent responsibilities
relevant to the professional engineering practice.
7. Environment and sustainability: Understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and
need for sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities
and norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or
leader in diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and
write effective reports and design documentation, make effective presentations, and give
and receive clearinstructions
11. Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member
and leader in a team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to
engage in independent and life-long learning in the broadest context of technological
change.
3. PSO 3: Successful career: Apply knowledge of theoretical computer science to assess the
hardware and software aspects of computer systems.
ABSTRACT
This Python program is designed to manage doctor-patient appointments at
Thanush Multi Specialist Hospital. It initializes a list of doctors with details such as
name, profession, specialty, available seats, and working hours. Patients can book
appointments by selecting a preferred doctor and receive a unique token number. The
program converts the current time from UTC to IST for accurate appointment details.
Additionally, patients can cancel appointments by providing their token number,
which frees up seats for other patients. A menu-driven interface allows users to book
appointments, cancel appointments, or exit the system.
TABLE OF CONTENTS
3 SYSTEM ANALYSIS
3.1. Existing System 5
3.1.1. Disadvantages 5
3.2 Proposed System 6
3.2.1. Advantage 6
4 SYSTEM DESIGN & MODULES
4.1. Block Diagram 8
4.2. Module Description 9
4.2.1. Input Choice 9
4.2.1.1. Book Appointment 9
4.2.1.2. Cancel Appointment 9
4.2.1.3 Exit 9
9
5 CONCLUSION & FUTURE ENHANCEMENT
5.1. Conclusion 10
5.2. Future Enhancement 10
6 APPENDICES
Appendix A-Source code 12
Appendix B -Screen shots 14
LIST OF FIGURES
ABBREVIATIONS
IDEs and Code Editors: Popular options include PyCharm, VS Code, and Jupyter
Notebook, which offer features like syntax highlighting, code completion, and debugging.
Package Management: Tools like pip and conda facilitate the installation and management
of Python libraries and dependencies.
Testing Frameworks: unittest, pytest, and nose are commonly used for writing and running
tests to ensure code reliability and correctness.
Build Tools: setuptools and wheel help in packaging Python projects, making them easy to
distribute and install.
Linters and Formatters: pylint, flake8, and black help maintain code quality and
consistency by enforcing coding standards and formatting.
CHAPTER 2
PROJECT DESCRIPTION
2.1. PROJECT INTRODUCTION
The Doctor-Patient Appointment System in Python allows patients to book and cancel
appointments with doctors at Thanush Multi Specialist Hospital. It manages doctor details
including name, profession, specialty, available seats, and timings. The system provides
real-time appointment booking by converting UTC to IST and generates unique token
numbers for each appointment. Patients can cancel appointments using their token numbers,
updating seat availability. A user-friendly menu interface facilitates easy navigation. While
basic, this project can be expanded with features like online payment integration and
automated reminders for enhanced functionality.
CHAPTER 3
SYSTEM ANALYSIS
3.1.1. DISADVANTAGES
1. Security Risks: Depending on implementation, Python-based appointment systems may
be vulnerable to security threats such as SQL injection and session hijacking if robust
security measures are not enforced.
2. Scalability Challenges: As appointment databases expand, the performance of Python-
based systems may decline, resulting in slower response times and increased resource
consumption.
3. Limited Features: Basic appointment systems implemented solely in Python may lack
advanced features such as multi-factor authentication and comprehensive logging
capabilities.
4.Dependency on External Libraries: Certain functionalities like password hashing may
require external libraries, introducing potential security risks and compatibility issues.
5. Maintenance Overhead: Python-based appointment systems necessitate ongoing
maintenance to address security vulnerabilities and incorporate new features, increasing
maintenance overhead.
6. Platform Dependency: Python-based systems may rely on specific runtime
environments, limiting deployment options and increasing complexity.
7. Complexity of Implementation: Developing a secure and efficient appointment system in
Python demands a deep understanding of security principles and web application
development, posing challenges for inexperienced developers.
8. Performance Overhead: Security features like password hashing may introduce
performance overhead, impacting system response times and user experience.
3.2.1. ADVANTAGES
1. Streamlined Appointment Booking: The system simplifies the process of booking
appointments by providing a user-friendly interface and displaying available doctors and
their schedules.
2.Efficient Resource Management: By managing doctor schedules and available seats, the
system optimizes resource allocation and ensures efficient utilization of hospital resources.
3. Improved Patient Experience: Patients benefit from reduced wait times and increased
convenience when booking appointments, enhancing their overall experience with the
healthcare facility.
4. Enhanced Organization: The system enhances the organization of patient appointments by
centralizing booking information and facilitating easy access for hospital staff.
5. Real-Time Updates: Doctors and patients receive real-time updates on appointment
bookings and cancellations, minimizing confusion and improving communication.
6. Increased Accessibility: The system improves accessibility for patients by providing
multiple channels for appointment booking, including in-person and remote options.
7. Data Security: Patient data is securely stored and managed, ensuring confidentiality and
compliance with data protection regulations, thereby enhancing trust and confidence in the
healthcare provider.
8. Scalability: The system can accommodate the growth of the hospital and adapt to changes
in patient demand, ensuring scalability and long-term viability.
CHAPTER 4
4.2.1.3 Exit
If the user decides to exit the appointment system, the program prints a thank you
message and terminates its execution. This option allows users to gracefully end their
interaction with the system when they have completed their tasks or no longer wish to
use it.
CHAPTER 5
5.1. CONCLUSION
The system lacks robust error handling, leading to potential issues with invalid inputs.
Additionally, scalability concerns may arise as the user database grows, impacting
performance. Integration with advanced features like reminders and patient history tracking
could enhance the system's functionality and user experience.
Despite these limitations, the system provides a solid foundation for appointment
management, with potential for further development and refinement to meet evolving user
needs and technological advancements.
APPENDICES
import datetime
import pytz
import random
def display_hospital_info():
print(f"Welcome to {hospital_name}!")
print(f"Hospital Address: {hospital_address}\n")
def display_doctors():
print("Available Doctors:")
for num, doctor_info in doctors.items():
print(f"{num}. {doctor_info['name']} ({doctor_info['profession']},
{doctor_info['specialty']}) - {doctor_info['seats']} seats available")
print(f" Timings: {doctor_info['timings']}")
def generate_token():
return random.randint(1000, 9999)
def book_appointment():
patient_name = input("Enter your name: ")
appointment_date = current_datetime_ist.strftime("%Y-%m-%d")
appointment_time = current_datetime_ist.strftime("%H:%M:%S")
display_doctors()
try:
selected_num = int(input("Enter the number of your preferred doctor: "))
if selected_num in doctors:
preferred_doctor = doctors[selected_num]["name"]
available_seats = doctors[selected_num]["seats"]
if available_seats > 0:
token_number = generate_token()
doctors[selected_num]["appointments"][token_number] =
patient_name
doctors[selected_num]["seats"] -= 1
print(f"Appointment booked for {patient_name} with
{preferred_doctor} on {appointment_date} at {appointment_time}.")
print(f"Your token number is: {token_number}")
print(f"Remaining seats for {preferred_doctor}:
{doctors[selected_num]['seats']}")
else:
print(f"Sorry, no more seats available for {preferred_doctor}.")
else:
print("Invalid doctor number. Please choose a valid number.")
except ValueError:
print("Invalid input. Please enter a valid number.")
def cancel_appointment():
token_number = int(input("Enter your token number: "))
for doc_id, doctor_info in doctors.items():
if token_number in doctor_info["appointments"]:
patient_name = doctor_info["appointments"].pop(token_number)
doctor_info["seats"] += 1
print(f"Appointment for {patient_name} with {doctor_info['name']} has
been canceled.")
print(f"Remaining seats for {doctor_info['name']}:
{doctor_info['seats']}")
return
print("Invalid token number. Please try again.")
# Main menu
while True:
display_hospital_info()
print("Doctor-Patient Appointment System")
print("1. Book an appointment")
print("2. Cancel an appointment")
print("3. Exit")
choice = input("Enter your choice (1/2/3): ")
if choice == "1":
book_appointment()
elif choice == "2":
cancel_appointment()
elif choice == "3":
print("Thank you for using the appointment system. Have a great day!")
break
else:
print("Invalid choice. Please select 1, 2, or 3.")
APPENDIX B -SCREEN SHOTS
1.2 Book the Appointment with Doctor and Get the Token Number
2 Cancel Appointent